text:
---
title: Preparations of Financial Statements
description: Know about accounting cycle, steps for preparing financial statements.
tags:
  - accounting
  - revenue
  - expense
lastmod: 2021-04-26T00:27:06-05:00
publishdate: 2021-04-26T00:27:06-05:00
coverImageUrl: ""
coverGifUrl: ""
---

## Table of contents

## Steps

---

Before going to steps it is important to know about what is `trial balance`.

> - **Trial Balance**: It is an accounting report showing the closing balances of all general ledger accounts at a point in time. In old days it was used to check if `total debits = total credits`, But since mordern softwares of accounting have automated that work, So now it is used to check for errors and assist in producing financial statements.

The **first step** is to adjust the trial balance which will give us `Adjusted trial balance` summarizes in each account after adjusting entries and is used to make financial statements.

The **second step** is to prepare an income statement and then use income to update retained earnings and to prepare balance sheet. Finally complete the statement of cash flows and statement of stockholder's equity.

## General format of Income Statement

---

> - **SG&A** = selling, general & administrative expenses also known as **Operating Expense**.

```text
  Revenue (or Sales)
- Cost of Goods Sold
==========================
  Gross Profit (Top line)
- Operating (SG&A) Expense
==========================
  Operating Income (EBIT/EBITDA)
- Interest, Gains and Losses
==========================
  Pre-tax Income
- Income Tax Expense
==========================
  Net Income (Bottom line)
```

## Balance Sheet Format: Assets

---

Assets are listed first in the following order:

> - Current assets (benefits within next year)
>   - Ordered by liquidity (how readily can they be converted to cash)
>     - Cash
>     - Accounts Receivable
>     - Inventory
>     - Prepaid Assets
> - Noncurrent assets
>   - Tangible assets
>   - Intangible assets

## Balance Sheet Format: Liabilities and Equity

---

Liabilities and Equity are listed next in the following order:

> - Current liabilities (obligation within next year)
>   - Ordered by liquidity
>     - Bank borrowings
>     - Accounts payable and other payables
>     - Deferred revenues and other noncash
> - Noncurrent liabilities
>   - Bank borrowings and bonds
>   - Other types of liabilities (deferred taxes, pensions)
> - Equity
>   - Contributed capital
>   - Retained Earnings

## The Accounting Cycle

---

![](/contents/accounting/others/preparation-of-financial-statements/img1.png)

![](https://media.giphy.com/media/BLN3Jhs4Pf07Z5pQNZ/giphy.gif)

## Close Temporary Accounts

---

> **Temporary Accounts**
>
> - Accumulate the effects of
> - Revenue and Expense accounts
> - Closed out to retained earnings at the end of period

> **Permanent Accounts**
>
> - Accumulate the effects of transactions over the entire life of business
> - Balance sheet accounts (Assets, Liabilities, Contributed Capital, Retained Earnings)

> **Close entries**
>
> - Internal transactions that 'zero out' temporary accounts at the end of the accounting period
> - Revenues and Expenses account balances are transferred to Retained Earnings
> - Revenues:
>   - Dr. Revenuse Accounts (-R, -SE)
>     - Cr. Retained Earnings (+SE)
> - Expenses:
>   - Dr. Retained Earnings (-SE)
>     - Cr. Expense Accounts (-E, +SE)
> - Net Income:
>   - Dr. Income Summary (-SE)
>     - Cr. Retained Earnings (+SE)

> **Post closing trial balance**
>
> - Summarizes balances of permanent accounts after closing entries
> - All revenue and expense accounts have a zero balance

> - Now, we're ready to start the next fiscal period

![](https://media.giphy.com/media/myuneaof9lR1AUPm1p/giphy.gif)

repository: AkashSDas/notesflow

repo_name: AkashSDas/notesflow


text:
# Pure CSS Connect 4

A Pen created on CodePen.io. Original URL: [https://codepen.io/finnhvman/pen/xXpzVN](https://codepen.io/finnhvman/pen/xXpzVN).

This is a CSS only connect four game, which can be played by two players (human vs human).
The red player takes the first turn. The goal is to form a row, column, or diagonal line of four discs in the same color. The game ends by either player winning, or as a draw.
It consists of 140 HTML elements and 350 lines of CSS. There are a lot of hacks in it to make the game playable. I couldn't have done this without the use of the :indeterminate pseudo-class and CSS counters.
The game should work on Chrome, Firefox and Safari.
Article about how it's made: https://css-tricks.com/roman-empire-made-pure-css-connect-4-possible/

license: MIT

repository: ShodiyevF/games-on-site

branch_name: refs/heads/main

extension: markdown

license_type: permissive

repo_name: ShodiyevF/games-on-site


text:
If you would like
to talk about someone, talk about the jerk who set up an AIM name using
the outdated address, not the company that repsonded.

PHM

AKA<EMAIL_ADDRESS>(among other names and addresses)

Anonymous wrote:
>
> This does wonders for my opinion of AOL. Even the administration has no clue.
>
> AOL administration spammed the Cypherpunks<EMAIL_ADDRESS>list, using
> an address for Cypherpunks which has been defunct for over a year now, with:
>
> >Thank you for registering for Netscape AOL Instant Messenger!
> >
> >Your registration for screen name aohelsux has been received.
> >
> >Please reply to this message within 48 hours to complete
> >the registration process.  Simply reply to the present message
> >and type 'OK' as the text of your message.
>
> P.S. "Well they just responded to an address someone gave them," like
> certain advocates of AOL, lamers, and Microsoft we have on the list have
> said, is not an excuse. It's easy to set up domain validation. The spammers
> just don't care.

{% endraw %}
```

## Thread

+ Return to [November 1998](/archive/1998/11)

+ Return to "[Anonymous <nobody@replay.com>](/authors/anonymous_nobody_at_replay_com_)"
+ Return to "["Paul H. Merrill" <PaulMerrill@acm.org>](/authors/paul_h_merrill_paulmerrill_at_acm_org_)"

+ 1998-11-25 (Wed, 25 Nov 1998 11:13:09 +0800) - [Re: Netscape AOL Instant Messenger Confirmation (kB3bEjeb1I aohelsux)](/archive/1998/11/4295f5b95a9bd378c494084cbb69cad008b52cfe41d2c203cd5c9da89aa33158) - _Anonymous<EMAIL_ADDRESS>  + 1998-11-25 (Wed, 25 Nov 1998 11:41:17 +0800) - Re: Netscape AOL Instant Messenger Confirmation (kB3bEjeb1I aohelsux) - _"Paul H. Merrill"<EMAIL_ADDRESS>

branch_name: refs/heads/master

extension: md

gha_license_id: MIT


text:
# jaco_contact_planning
Contact planning functionality for the Jaco2 7DOF robot

## Repository Organization
This code is written in the Robot Operating System (ROS) framework. The ros/ directory is the root workspace, and packages live inside the ros/src/ directory.

# Dependencies
* [SNOPT](https://ccom.ucsd.edu/~optimizers/solvers/snopt/)
* [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page#Download)
* [kdl_parser](http://wiki.ros.org/kdl_parser/Tutorials/Start%20using%20the%20KDL%20parser)

# Setup
## SNOPT
Request a [SNOPT license](https://ccom.ucsd.edu/~optimizers/downloads/) and follow the website instructions for [setting up the license](https://ccom.ucsd.edu/~optimizers/faq/).

Set the SNOPT environment variable to point to the SNOPT C++ interface:
```
export SNOPT=$HOME/jaco_contact_planning/ros/src/snopt-interface-2.1.1
````
Add this line to your ```.bashrc``` for this to be set in every terminal.

## ROS
Install the kdl_parser that allows us to read the robot's urdf by running:
```
rosdep install kdl_parser
rosmake kdl_parser
```
## Compilation
Navigate to the ```/contact_planner/src/``` directory. To compile the contact planner, type
```
make
```
To run the contact planner, type:
```
./planContact
```


text:
# temperqueue

This is a test implementation of four queues built in Temper, my Temporal fuzzing library (see [reitzen.com](https://reitzen.com)).

It uses unsafe shared memory and is not fit nor intended for production use.

However, the core algorithm has been heavily fuzzed for correctness. Any bugs are likely to be due to poor translating of the Clojure Temper code into Rust.

The code uses exclusively Relaxed atomics paired with SeqCst fence() calls. This is to emulate the constructs available in Temper, and is not the correct way to write this code in Rust. Emulating the Rust/C++ memory model will come in an updated version of Temper.

The queue memory is leaked even when dropped and it does not handle wraparound. This is not a production library, nor is it high quality code. Although it does use types to enforce that single producers or consumers are not Sync.

repository: reitzensteinm/temperqueue

repo_name: reitzensteinm/temperqueue


text:
# Envelopes #

 An envelope is a non-periodic function that varies over time, and is
 generally used to vary the amplitude of an oscillator to simulate
 percussive strikes and the gradual loss of energy in physical oscillating
 systems.

 Include the following code to use the classes below:

 ```c++
 #include "envelopes.h"
 using namespace CSynth;
 ```

 Subclasses of the `Trigger` class watch for changes to a value and call a
 given function when that value makes a given transition. They are used by
 envelopes to move through their stages when, for example, a key is pressed
 or released.

 ## Properties ###

 The `action` property is a `std::function` function that will be called
 when the transition the trigger is looking for happens. It should take
 one float argument with the value that caused the trigger and return
 nothing. The action can be defined as a function pointer, a lambda,
 a bind expression, etc:

 ```c++
 int count = 0;
 void increment() { count++; }

 Trigger t;
 // function pointer method
 t.action = &increment;
 // lambda method
 t.action = [&] { count++; };
 ```

 The `threshold` property is used by many triggers to determine whether
 the input value has crossed over a given line. It can be set at any time,
 but setting it will have no effect on the trigger until the next call to
 the `step` method.

 ## Constructors ##

 Triggers must be created with the default constructor and linked to
 their action later.

 ```c++
 void it_happened(float v) {
   // do something
 }

 RiseTrigger attack();
 attack.action = &it_happened;

 attack.step(0.0); // this will do nothing
 attack.step(1.0); // this will call it_happened(1.0)
 ```

 ## Methods ##

 The `step` method of a trigger takes the next input value and calls the
 `action` function if the trigger's condition has been met.

 The `RiseTrigger` class calls its action whenever the passed value
 crosses from at or below its threshold to above it.

 The `FallTrigger` class calls its action whenever the passed value goes
 from above its threshold to at or below it.

 The `Envelope` class acts as base class for all envelopes. Generally
 it should not be used directly, but it does contain methods and properties
 that can be used on other envelope types.

 An envelope is also a type of signal [Generator](generator.h.md). See the
 `Generator` class for additional properties and methods.

 A classic ADSR envelope has four named phases, illustrated by the following
 diagram:

 ```
                Decay                      Release
     |< Attack >|< >|< Sustain            >|<   >|
 1.0 -----------o----------------------------------------------------------
               / \
  ^           /   \
  L          /     \
  E         /       o----------------------o  <== sustain level
  V        /                                \
  E       /                                  \
  L      /                                    \
        /                                      \
       /                                        \
 0.0 -o------------------------------------------o------------------ TIME >
 ```

 ## Properties ###

 The `value` property provides access to the envelope's most recent output
 value.

 The four phases of the ADSR envelope are:

  1. Attack is the time between when the note is triggered and when it rises
     to full volume. Having a non-zero attack time can prevent the note from
     making a click as the level transitions suddenly from minimum to
     maximum, and longer attack times can simulate an instrument that swells
     slowly as notes begin. The `attack` property stores this time in seconds
     as a float.

  2. Decay is the phase where the energy of the attack dissipates and the
     instrument reaches a steady state. The `decay` property stores this
     time in seconds as a float.

  3. Sustain is the steady volume that the instrument holds for as long as
     the note is held down. The `sustain` property stores this level as a
     float.

  4. Release is the time from when the note is released to when it reaches
     the minimum volume. The `release` property stores this time in seconds
     as a float.

 A particular ADSR envelope can be fully described by four numbers, the
 duration of the attack in seconds, the duration of the decay in seconds,
 the level of the sustain (usually 0.0 to 1.0), and the duration of the
 release in seconds.

 ## Constructors ##

 Envelopes can be set up in the following ways:

 ```c++
 // 1. initialize parameters after construction
 ADSR env1;
 env1.attack = 0.05;
 env1.decay = 0.025;
 env1.sustain = 0.75;
 env1.release = 0.1;
 // 2. initialize parameters during construction
 ADSR env2(0.05, 0.025, 0.75, 0.1);
 ```

 If left uninitialized, the default envelope has a rectangular shape,
 rising immediately to full volume and dropping immediately to zero
 volume when released.

 ## Methods ##

 The `step` method of an envelope takes the current velocity and returns
 the appropriate level for that phase of the envelope. When the velocity
 is non-zero, the envelope is interpreted to be during the
 Attack/Decay/Sustain phases. When the velocity is zero, the envelope is
 interpreted to be in the release phase. The envelope is re-triggered
 whenever the velocity changes.

 ```c++
 ADSR env(0.1, 0.1, 0.5, 0.1);
 for (int i = 0; i < 100; i++) {
   float level = ADSR.step(0.5);
 }
 ```

 # ADSR #

 The `ADSR` class implements a classic ADSR envelope with all four phases.

 # AD #

 The `AD` class implements an envelope with no Sustain or Release phases.
 This is useful for percussive sounds that are not sensitive to how long
 a note is played.

license: Unlicense

repository: jessecrossen/csynth

repo_name: jessecrossen/csynth


text:
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/KeyedCodable.svg?style=flat)](https://cocoapods.org/pods/KeyedCodable)
[![License](https://img.shields.io/cocoapods/l/KeyedCodable.svg?style=flat)](https://cocoapods.org/pods/KeyedCodable)
[![Platform](https://img.shields.io/cocoapods/p/KeyedCodable.svg?style=flat)](https://cocoapods.org/pods/KeyedCodable)

![](/keyedCodable.gif)

# The goal

*KeyedCodable* is an addition to swift's *Codable* and it's designed for automatic nested key mappings. The goal it to avoid manual implementation of *Encodable/Decodable* and make encoding/decoding easier, more readable, less boilerplate and what is the most important fully compatible with 'standard' *Codable*.

# Nested keys
First, please have a look on Codable example provided by Apple.
### vanilla Codable:
```swift
struct Coordinate {
    var latitude: Double
    var longitude: Double
    var elevation: Double

    enum CodingKeys: String, CodingKey {
        case latitude
        case longitude
        case additionalInfo
    }

    enum AdditionalInfoKeys: String, CodingKey {
        case elevation
    }
}

extension Coordinate: Decodable {
    init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        latitude = try values.decode(Double.self, forKey: .latitude)
        longitude = try values.decode(Double.self, forKey: .longitude)

        let additionalInfo = try values.nestedContainer(keyedBy: AdditionalInfoKeys.self, forKey: .additionalInfo)
        elevation = try additionalInfo.decode(Double.self, forKey: .elevation)
    }
}

extension Coordinate: Encodable {
    func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(latitude, forKey: .latitude)
        try container.encode(longitude, forKey: .longitude)

        var additionalInfo = container.nestedContainer(keyedBy: AdditionalInfoKeys.self, forKey: .additionalInfo)
        try additionalInfo.encode(elevation, forKey: .elevation)
    }
}
```

### KeyedCodable:
```swift
struct Coordinate: Codable {
    var latitude: Double
    var longitude: Double
    var elevation: Double

    enum CodingKeys: String, KeyedKey {
        case latitude
        case longitude
        case elevation = "additionalInfo.elevation"
    }
}
```

*By default dot is used as delimiter to separate the inner keys*

# @Flat classes
Flat classes feature allows you to group properties into smaller parts. In the example below you can see that:
- longitude and latitude are placed in json's main class but it is 'moved' into separate struct ```Location``` in the swift's model
- both longitude and latitude are optional. If any of them is missing, the location property will be nil.

### Example JSON:
```json
{
    "longitude": 3.2,
    "latitude": 3.4,

    "greeting": "hallo"
}
```

### KeyedCodable:
```swift
struct InnerWithFlatExample: Codable {
    @Flat var location: Location?

    let greeting: String
}

struct Location: Codable {
    let latitude: Double
    let longitude: Double
}
```

  Without property wrappers

```swift
struct InnerWithFlatExample: Codable {
    let location: Location?

    let greeting: String

    enum CodingKeys: String, KeyedKey {
        case greeting
        case location = ""
    }
}
```

*By default empty string or whitespaces are used to mark flat class*

# @Flat arrays
Probably you found out that decoding an array will fail if decoding of any array's element fails. Flat array *KeyedCodable's* feature omits incorrect elements and creates array that contain valid elements only. In example below ```array``` property will contain three elements [1,3,4] though decoding second element fails.

```json
{
    "array": [
        {
        "element": 1
        },
        {},
        {
        "element": 3
        },
        {
        "element": 4
        }
    ]
}
```
### KeyedCodable:
```swift
struct OptionalArrayElementsExample: Codable {
    @Flat var array: [ArrayElement]
}

struct ArrayElement: Codable {
    let element: Int
}
```

Without property wrappers

```swift
struct OptionalArrayElementsExample: Codable {
    let array: [ArrayElement]

    enum CodingKeys: String, KeyedKey {
        case array = ".array"
    }
}
```

*To enable flat array you have to add [flat][delimiter] before property name - by defult it is 'empty string + dot'*

# KeyOptions

In case of conflicts between json's keys and delimiters used by ```KeyedCodable```, you may use ```KeyOptions``` to configure mapping features. You may do that by providing ```options: KeyOptions?``` property in your CodingKeys ( use ```nil``` to use default value). You may also disable the feature by setting ```.none``` value.

Examples

### Example JSON:
```json
{
    "* name": "John",
    "": {
        ".greeting": "Hallo world",
        "details": {
            "description": "Its nice here"
        }
    },
    "longitude": 3.2,
    "latitude": 3.4,
    "array": [
    {
    "element": 1
    },
    {},
    {
    "element": 3
    },
    {
    "element": 4
    }
    ],
    "* array1": [
    {
    "element": 1
    },
    {},
    {
    "element": 3
    },
    {
    "element": 4
    }
    ]
}
```
### KeyedCodable:
```swift
struct KeyOptionsExample: Codable {
    let greeting: String
    let description: String
    let name: String
    let location: Location
    let array: [ArrayElement]
    let array1: [ArrayElement]

    enum CodingKeys: String, KeyedKey {
        case location = "__"
        case name = "* name"
        case greeting = "+.greeting"
        case description = ".details.description"

        case array = "### .array"
        case array1 = "### .* array1"

        var options: KeyOptions? {
            switch self {
            case .greeting: return KeyOptions(delimiter: .character("+"), flat: .none)
            case .description: return KeyOptions(flat: .none)
            case .location: return KeyOptions(flat: .string("__"))
            case .array, .array1: return KeyOptions(flat: .string("### "))
            default: return nil
            }
        }
    }
}
```

# @Zero as default value

@Zero feature sets default "zero" value for the property in case value is not set in the JSON (no key at all or null value is set). If you find the situation there is no difference between 0 and nil from the business perspective you can easily get rid off optional from your codable.

### Example JSON:
```json
{
    "name": "Jan"
}
```

### KeyedCodable:
```swift
struct ZeroTestCodable: Codable {
    var name: String                    // Jan

    @Zero var secondName: String        // "" - empty string
    @Zero var numberOfChildren: Int     // 0
    @Zero var point: Point              // Point(x: 0.0, y: 0.0)
}

struct Point: Codable {
    let x: Float
    let y: Float
}
```

# Transformers - @CodedBy, @EncodedBy, @DecodedBy

Have you ever had a need of decoding a JSON having multiple Date formats in it ? Or maybe you had to add custom transformation from one value to another during decode/encode process and you had to write a lot of boilerplate code for manual coding ? Transformers are designed for making custom transformation a lot easier !

To add your custom transformer you have to implement ```DecodableTransformer```, ```EncodableTransformer``` or ```Transformer``` for two way transformation.

## Date formater example

### Example JSON:
```json
{
    "date": "2012-05-01"
}
```

### Usage
```swift
struct DateCodableTrasform: Codable {

    @CodedBy<DateTransformer> var date: Date
}
```

### Transformer
```swift
enum DateTransformer<Object>: Transformer {

    static func transform(from decodable: String) -> Any? {
        return formatter.date(from: decodable)
    }

    static func transform(object: Object) -> String? {
        guard let object = object as? Date else { return nil }
        return formatter.string(from: object)
    }

    private static var formatter: DateFormatter {
        let formatter = DateFormatter()
        formatter.dateFormat = "yyyy-MM-dd"
        return formatter
    }
}
```

## Non codable formater example

You can even implement transformer for non Codable model and use it in you Codable tree like that:

### Example JSON:
```json
{
    "user": 3
}
```

### Usage
```swift
struct DetailPage: Codable {

    @CodedBy<UserTransformer> var user: User
}

struct User {           // User do not implement Codable protocol
    let id: Int
}
```

### Transformer
```swift
enum UserTransformer<Object>: Transformer {
    static func transform(from decodable: Int) -> Any? {
        return User(id: decodable)
    }

    static func transform(object: Object) -> Int? {
        return (object as? User)?.id
    }
}
```

# How to use?

To support nested key mappings you need to use ```KeyedKey``` intead of ```CodingKey``` for your ```CodingKeys``` enums and  ```KeyedJSONEncoder```/```KeyedJSONDecoder``` in place standard ```JSONEncoder```/```JSONDecoder```. Please notice that *Keyed* coders inherit from standard equivalents so they are fully compatible with Apple versions.

### Codable extensions

```swift
struct Model: Codable {
    var property: Int
}
```
Decode from string:
```swift
let model = try Model.keyed.fromJSON(jsonString)
```
Decode from data:
```swift
let model = try Model.keyed.fromJSON(data)
```
Endcode to string:
```swift
model.keyed.jsonString()
```

Encode to data:
```swift
model.keyed.jsonData()
```

*You can provide coders in method parameters in case you need additional setup*

### Coders

You can also use *Keyed* coders the same way as standard versions.

```swift
let model = try KeyedJSONDecoder().decode(Model.self, from: data)
```
```swift
let data = try KeyedJSONEncoder().encode(model)
```

It's worth to mention that *Keyed* coders supports simple types ie. ```String```, ```Int``` etc.
For example when we try to decode ```Int``` using standard ```JSONDecoder```
```swift
let number = try JSONDecoder().decode(Int.self, from: data)
```
it will throw an incorrect format error. Keyed version will parse that with success.

### Keyed<> wrapper

There is a possibility to use standard JSON coders and still encode/decode *KeyedCodables*. To do that you have to use ```Keyed<>``` wrapper:
```swift
let model = try JSONDecoder().decode(Keyed<Model>.self, from: data).value
```
```swift
let data = try JSONEncoder().encode(Keyed(model))
```

It may be useful in case you do not have an access to coder's initialization code. In that situation your model may looks like that:

```swift
struct KeyedModel: Codable {
...

    enum CodingKeys: String, KeyedKey {
        ....
    }
....
}

struct Model {

    let keyed: Keyed<KeyedModel>
}
```

### Manual nested key coding

In case you need implement *Codable* manually you can use ```AnyKey``` for simpler access to nested keys.

```swift
private let TokenKey = AnyKey(stringValue: "data.tokens.access_token")

struct TokenModel: Codable {

    let token: Token

    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: AnyKey.self)
        token = try container.decode(Token.self, forKey: TokenKey)
    }

    func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy:  AnyKey.self)
        try container.encode(token, forKey: TokenKey)
    }
}
```

### KeyedConfig

As mentioned earlier there is possibility to setup key options eg. delimiters on ```KeyedKey``` level but there is also possibility to setup it globally.

To do that you need to set the value of  ```KeyedConfig.default.keyOptions```.

Beside key opptions there is also possibility to setup coders used by default in *Codable* extensions.

## Migration to 3.x.x version

Version 3.0.0 is backward compatible with version 2.x.x however you have to use **swift 5.1** for all new features connected with ```@PropertyWrapper```s.

## Migration to 2.x.x version

Unfortunately 2.x.x version is not compatible with 1.x.x versions but I believe that new way is much better and it brings less boilerplate than previous versions. There is no need to add any manual mapping implementation, it's really simple so I strongly recommend to migrate to new version. All you need is to:
- use ```KeyedJSONEncoder``` \ ```KeyedJSONDecoder``` instead of ```JSONEncoder``` \ ```JSONDecoder``` !!
- change you CodingKeys to ```KeyedKey``` and move your mappings here
- remove ```KeyedCodable``` protocol
- remove constructor and map method

repository: dgrzeszczak/KeyedCodable

gha_language: Swift

repo_name: dgrzeszczak/KeyedCodable


text:
#xolvio:stripe-stub

Overrides Stripes client and server methods to allow testing. The stub is based on `mrgalaxy:stripe`
package and may work with others.

#Get the Book
To learn more about testing with Meteor, consider purchasing our book [The Meteor Testing Manual](http://www.meteortesting.com/?utm_source=inbox-stub&utm_medium=banner&utm_campaign=stripe-stub).

[![](http://www.meteortesting.com/img/tmtm.gif)](http://www.meteortesting.com/?utm_source=inbox-stub&utm_medium=banner&utm_campaign=inbox-stub)

Your support helps us continue our work on Velocity and related frameworks.

###Installation

`meteor add xolvio:stripe-stub`

###Usage

This package expects you to expose a global `Stripe` object on the server like this:

```
Stripe = StripeAPI('your secret key');
```

TODO

If using in an end-to-end test like cucumber, you can use it this way:

```
// stub the client & server stubs
this.browser.executeAsync(function (done) {Meteor.call('stripeStub/stub', {email<EMAIL_ADDRESS>done)}).
```

This will stub both the client and server portion of Stripe and allow you to exercise your code without needing a connection to Stripe.

See [Letterpress](https://github.com/xolvio/Letterpress/) for an example.

This package is a `debugOnly` package and will only be used when developing
locally.

repository: xolvio/meteor-stripe-stub

repo_name: xolvio/meteor-stripe-stub


text:
# A Heap app for Strata

[![Latest Version on Packagist](https://img.shields.io/packagist/v/astrogoat/heap.svg?style=flat-square)](https://packagist.org/packages/astrogoat/heap)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/astrogoat/heap/run-tests?label=tests)](https://github.com/astrogoat/heap/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/astrogoat/heap/Check%20&%20fix%20styling?label=code%20style)](https://github.com/astrogoat/heap/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/astrogoat/heap.svg?style=flat-square)](https://packagist.org/packages/astrogoat/heap)

## Installation

You can install the package via composer:

```bash
composer require astrogoat/heap
```

## Usage

Included the script in your Blade file.

```php
@include('heap::script')
```

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [Megan Miller](https://github.com/smolDev-ai)
- [All Contributors](../../contributors)

This heap package is forked from the awesome [Spatie heap package](https://github.com/spatie/package-heap-laravel#support-us). Please go support them if you can.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: astrogoat/heap

gha_language: PHP

repo_name: astrogoat/heap


text:
# Patch Augmentation
*Patch Augmentation* is an novel image augmentation technique designed to improve model generalisation and mitigate against adversarial attacks.

## How it works

*Patch Augmentation* is a data-independent approach that creates new image data based on image/label pairs, where a patch from one of the two images in the pair is superimposed on to the other image, creating a new augmented sample.

A notebook containing a reproducible experiment (using ResNetv1 and ResNetv2 on the CIFAR-10 and CIFAR-100 datasets) can be found in the following notebook:

[Patch-Augmentation.ipynb](Patch-Augmentation.ipynb)

Initial *Patch Augmentation* experiments show a several percent improvement over baseline accuracies.

## Robustness Against Adversarial Attacks

Initial experiments show networks trained with *Patch Augmentation* are more robust to adversarial attacks, see the following notebook for details:

[Adversarial-Examples.ipynb](Adversarial-Examples.ipynb)

Using the Fast Gradient Sign Method to create adversarial examples, the network trained with *Patch Augmentation* had an accuracy of 72.5% versus 64.3% for the network trained without augmentation.

## Visual Example

Below is a visual example of the technique:

![simple-patch-aug-example](./DemoImages/patch-augmentation-simple-example.png)

In the case of the example above, a 25% area patch from Class B is superimposed on to the image from Class A. Its new label is `y = [0.75, 0.25]`.

## Publication

Repository made public on the 25th of October 2019. Publication in review.

repository: pgsrv/Patch-Augmentation

repo_name: pgsrv/Patch-Augmentation


text:
How does 75-inches suit you? How about for less than $700?
Right now you can pick up the 75-inch TCL 4-Series TV for just $699 from Best Buy.
This is a big discount on a large TV. For example, Best Buy says it's $200 off – stating it was sold for $899 before. However, TCL itself is listing the same TV with a $999 price tag.
Advertisement
What's more, Amazon did drop down to the same price although it appears Amazon has already sold out. The $700 price appears to be the cheapest price Amazon has ever sold this TV at.
So, yes, this is a very good price, on a very good and large TV.
Besides the more screen to look at, this TV comes with Roku built-in. That matters, as Roku TVs are a great way to instantly migrate over to a streaming way of life.
Advertisement
Over the past couple of years, Roku has risen in prominence and is now one of the major players in the streaming platform market. In no small part, thanks to the availability of great TVs at rock bottom prices, like this one.
Another major benefit of having Roku on this TV is the ease of access to The Roku Channel.
With The Roku channel, you can watch a number of TV shows and movies for free.
Advertisement
Besides the more screen, Roku, and free content available through The Roku Channel, this is a 4K TV with HDR10 support. Adding to that is a 120Hz CMI effective refresh rate along with upscaling technology. The latter look to improve the view on non-4K content by upscaling it to 4K.
If audio matters, then things aren't too bad here either. This TCL 4-Series TV comes with a total audio output of 20-watts. Basically, 10-watts per channel.
Overall, for the price you're paying here, you are getting a whole lot of TV. Yes, TCL does have better lines available, such as the 6-Series and the 8-Series. However, both of those lines are more expensive.
Advertisement
For example, the 6-Series is cheaper than the 8-Series and right now you'd be looking at double the price of this TV for a 75-inch 6-Series TV.
At this price, it's worth supersizing up.

        75-inch TCL Roku TV - $699 - Best Buy

Advertisement

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
Contributing to `hp-printer-app`
================================

I'm happy to accept changes into `hp-printer-app`.  For new drivers, I ask that
contributors provide me with a printer and supplies that would allow me to
debug any issues *and/or* commit to providing assistance on any issues that
are reported on Github.

Contributions should be submitted as pull requests on the
[hp-printer-app Github project](https://github.com/michaelrsweet/hp-printer-app).
New code MUST be supplied under the existing `hp-printer-app` license
(Apache 2.0).

repository: michaelrsweet/hp-printer-app

gha_language: C

repo_name: michaelrsweet/hp-printer-app


text:
---
sidebarDepth: 2
---

# Team Handbook

The Meltano team handbook is the central repository for how the team functions and builds the product.

As Meltano is part of [GitLab](https://about.gitlab.com/), those parts of the [GitLab team handbook](https://about.gitlab.com/handbook/) that are not specific to the GitLab product can be assumed to also apply to Meltano.

## Subresources

- [Engineering Handbook](/handbook/engineering/)
- [Marketing Handbook](/handbook/marketing/)
- [Product Handbook](/handbook/product/)

## Team

- [Douwe](https://about.gitlab.com/company/team/#DouweM) - Lead

## Customer Support

### Email

Emails to<EMAIL_ADDRESS>forward to our Zendesk inbox so they can be triaged, assigned, and managed.
We get a wide range of inbound there, including people who are looking for support and account setups.
Login info for each member of the Meltano team has been sent out, and the master account login info is in 1Password.

#### Responsible Disclosure of Security Vulnerabilities

Emails to<EMAIL_ADDRESS>also forward to our Zendesk inbox, and are automatically assigned to the Security group. As documented in our [Responsible Disclosure Policy](/docs/responsible-disclosure.md), we will acknowledge receipt of a vulnerability report the next business day and strive to send the reporter regular updates about our progress.

### Live Chat powered by Intercom.io

The [Meltano.com website](https://www.meltano.com) is set up with live chat powered by Intercom.
Meltano team members each have basic accounts, and there is a shared account for whoever is on chat duty to log into with full access to the Inbox.
Login credentials can be found in 1Password.

## Trademarks

Meltano is a registered trademark of GitLab B.V. in the USA and China.

Further details, such as the registration number and certificate, can be found in the "Meltano" 1Password vault.

repository: code-watch/meltano

gha_language: Python

repo_name: code-watch/meltano


text:
# Distributed Bookinfo

In this demo we took Istio's [Bookinfo sample application](https://istio.io/docs/guides/bookinfo/) and configured our Multi-Cluster so that the `Productpage` and `Ratings` microservices are running on one cluster and the `Details` and `Reviews v1/v2/v3` are running on the other. This demonstrates a two way communication between the clusters as `Productpage`, for instance, is calling the `Reviews` service on the remote cluster while `Reviews v2/v3` themselves are calling the `Ratings` service from the first cluster.

The communication between the clusters is going through a set of Ingress and Egress Gateways that both clusters have by deploying Istio to each one of them.

The Bookinfo demo has been tested on the following topologies:
1. Two IBM Kubernetes Clusters (IKS-IKS) where their ingress gateways are publicly available.
1. One IBM Kubernetes Cluster and one IBM Cloud Private (IKS-ICP) where the ICP is not accessible from outside of the organization network but can access the IKS cluster. We are using Strongswan VPN tunnel initiated by the IKS to connect the two clusters.

## Prerequisites
1. Make sure the two target clusters are available as contexts in the Kubeconfig path.

    ```console
    export KUBECONFIG=[location_of_kubeconfig_for_A_context]:[location_of_kubeconfig_for_B_context]
    kubectl config get-contexts
    ```

    The kubeconfig context name for each one of the clusters will be used as configuration parameters to the installation scripts.

    You can test that both clusters are accessible with the context name by executing the command:
    ```sh
    kubectl get nodes --context=<cluster_A_context>
    kubectl get nodes --context=<cluster_B_context>
    ```
1. Any public cluster should be able to assign a public IP to its Ingress Gateway. Ingress gatwayes are of type `LoadBalancer` when Istio is deployed on a public cluster.
1. If your second cluster is an ICP or any on-prem cluster you will need to connect between the private and public clusters with a VPN tunneling. We have instructions below for creating such connection using Strongswan VPN Helm charts deployed onto IKS and ICP clusters.

## Installing
1. Modify the `config.sh` file and set the following parameters:
    1. `CLUSTER_A` should hold the Kubeconfig context for the 1st cluster
    1. `CLUSTER_B` should hold the Kubeconfig context for the 2nd cluster
    1. `CLUSTER_B_TYPE` should be set to `"ICP"` if the 2nd cluster is an ICP. Use any other value if the 2nd cluster is a public one.
    1. `MANUAL_INJECTION` will toggle whether to run a `istioctl inject` to inject the sidecar to the deployed app pods. The app is being deployed to the `default` namespace and it depends on whether the automatic injection label is applied to that namespace or not. The main reason for disabling the automatic injection is when having an IKS with VPN pods deployed to the default namespace. In this case it's not desired that the VPN pods will be auto-injected.
1. Make sure both clusters are accessible
1. Execute the installation script:
    ```sh
    ./install.sh
    ```
1. The scripts will pause after installing Istio to both cluster and wait for you to press any key. Before continuing make sure all Istio pods are running on *both* clusters:
    ```sh
    kubectl get pods -n istio-system --context=<cluster_A_context>
    kubectl get pods -n istio-system --context=<cluster_B_context>
    ```
1. The script continues and the Bookinfo web page URL will be printed at the end. You can open this URL in your browser but as the deployment of the app takes few seconds you might need to refresh to see all information for that app.

## Connect Private and Public Clusters with Strongswan VPN
`strongSwan` is used to setup a IPSec VPN tunnel between clusters and share subnets of Kubernetes Pods and Services to remote clusters. As such, the deployment has two parts where in one the strongSwan is deployed on the public cluster as a VPN "server" and the other part installing the strongSwan as a "client" on the private cluster. Because the private cluster can access the public one but not vice versa, the "client" is the one that initiates the VPN tunnel.

Instructions below were tested with connecting an ICP cluster that has no public access to an IKS cluster (public).

### Install strongSwan on IKS
1. Set up Helm in IBM Cloud Kubernetes Service by following [these instructions](https://console.bluemix.net/docs/containers/cs_integrations.html#helm).
1. [Install strongSwan to public IKS Cluster using Helm chart](https://console.bluemix.net/docs/containers/cs_vpn.html#vpn).
Example configuration parameters (from `config.yaml`) for the strongSwan Helm release on an IKS (the rest as default):
    - ipsec.auto: `add`
    - remote.subnet: `<IP_ADDRESS>/24`
1. Execute:
    ```sh
    kubectl get svc vpn-strongswan
    ```
    And write down the External IP of the service as you will need it when installing on ICP.

### Install strongSwan on ICP
1. [Complete the strongSwan IPSec VPN workarounds](https://www.ibm.com/support/knowledgecenter/SS2L37_<IP_ADDRESS>/cam_strongswan.html) for ICP.
1. Install the strongSwan from [the Catalog in the management console](https://www.ibm.com/support/knowledgecenter/SSBS6K_<IP_ADDRESS>/app_center/create_release.html).
Example configuration parameters for the strongSwan Helm release on an ICP:
    - Chart name: `vpn`
    - Namespace: `default`
    - Operation at startup: `start`
	- Local subnets: `<IP_ADDRESS>/24`
    - Local id: `on-prem`
	- Remote gateway: _Public IP of IKS VPN service that you wrote down earlier_
	- Remote subnets: `<IP_ADDRESS>/16,<IP_ADDRESS>/16`
    - Remote id: `ibm-cloud`
	- Privileged authority for VPN pod: checked
1. Verify that ICP connected to IKS by running the following against the IKS:
    ```sh
    export STRONGSWAN_POD=$(kubectl get pod -l app=strongswan,release=vpn -o jsonpath='{ .items[0].metadata.name }')
    kubectl exec $STRONGSWAN_POD -- ipsec status
    ```
    If configured correctly the output of the command will list one established connection:
    ```sh
    Security Associations (1 up, 0 connecting):
    k8s-conn[10]: ESTABLISHED 65 minutes ago, <IP_ADDRESS>[ibm-cloud]...<IP_ADDRESS>[on-prem]
    k8s-conn{34}:  INSTALLED, TUNNEL, reqid 9, ESP in UDP SPIs: c46d5d8d_i c688564f_o
    k8s-conn{34}:   <IP_ADDRESS>/16 <IP_ADDRESS>/16 === <IP_ADDRESS>/24
    ```


text:
# nanodegree-blockchain-project4-notary-service

My 4th project while pursuing [Blockchain Developer Nanodegree](https://in.udacity.com/course/blockchain-developer-nanodegree--nd1309) from Udacity.

In this project, one can notarize their favorite star on the blockchain
This project is a webservice that creates a REAL blockchain. The blocks are stored
on the chain using [LevelDB](https://github.com/google/leveldb). It lets
you interact with the blockchain using a RESTful API.

### Getting started
- Clone this repository and `cd` into it from your terminal
- Type `npm install`
- Type `node index.js`
- Your server will start locally on port `8000`

## Endpoint documentation
### Request validation for star notarization

Requests a star notarizaiton request validation. This will return some data that
will be needed to be used in next API call

`POST /requestValidation`

**Request**
```
{
	"address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
}
```

**Response**
```
{
    "walletAddress": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV",
    "requestTimeStamp": "1547449250",
    "validationWindow": 279,
    "message": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV:1547449250:starRegistry"
}
```

### Signing the transaction

Sign the `message` field received in the response of the previous request
using wallet like Electrum and send it as a prameter in the request body.

`POST /message-signature/validate`

**Request**
```
{
	"address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV",
	"signature": "you-signature-using-wallet"
}
```

**Response**
```
{
    "status": {
        "requestTimeStamp": "1547449250",
        "validationWindow": 248,
        "message": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV:1547449250:starRegistry",
        "messageSignature": true,
        "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
    },
    "registerStar": true
}
```

### Add block with star data to blockchain

Add the star data to the blockchain as shown in the request below.

`POST /block`

**Request**
```
{
    "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV",
    "star": {
          "ra": "13h 03m 33.35sec",
          "dec": "-49° 31’ 38.1”",
          "mag": "4.83",
          "cen": "Cen",
          "story": "My first block before production"
    }
}
```

**Response**
```
{
    "height": 22,
    "time":<PHONE_NUMBER>339,
    "previousBlockHash": "f14fb3a565e77938407026dbbf0993c268e2931c7648b7ce77312b5b6dd91258",
    "hash": "e2abdf01c45ff4c67b20792e8db5bec3f6bbf1ca3880d4f1d0d750067b76fada",
    "body": {
        "star": {
            "ra": "13h 03m 33.35sec",
            "dec": "-49° 31’ 38.1”",
            "mag": "4.83",
            "cen": "Cen",
            "story": "4d7920666972737420626c6f636b206265666f72652070726f64756374696f6e",
            "storyDecoded": "My first block before production"
        },
        "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
    }
}
```

### Get block by hash

Retireve the block from the blockchain using the hash of the block

`GET /stars/hash:[HASH]`

**Response**
```
{
    "height": 22,
    "time":<PHONE_NUMBER>339,
    "previousBlockHash": "f14fb3a565e77938407026dbbf0993c268e2931c7648b7ce77312b5b6dd91258",
    "hash": "e2abdf01c45ff4c67b20792e8db5bec3f6bbf1ca3880d4f1d0d750067b76fada",
    "body": {
        "star": {
            "ra": "13h 03m 33.35sec",
            "dec": "-49° 31’ 38.1”",
            "mag": "4.83",
            "cen": "Cen",
            "story": "4d7920666972737420626c6f636b206265666f72652070726f64756374696f6e",
            "storyDecoded": "My first block before production"
        },
        "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
    }
}
```

### Get block by address

Retireve the block from the blockchain using the address of the block.
This API will return all the blocks that have been added using a particular
address.

`GET /stars/address:[ADDRESS]`

**Response**
```
[
    {
        "height": 10,
        "time":<PHONE_NUMBER>056,
        "previousBlockHash": "83b0a5c0c736f4358c98a78ca88176dc03c9fb28f928428870c43ce32230be2d",
        "hash": "5481268332618e6bcbc94dbda02a0c210ca0784283548897daa28ee310df2dfc",
        "body": {
            "star": {
                "ra": "13h 03m 33.35sec",
                "dec": "-49° 31’ 38.1”",
                "mag": "4.83",
                "cen": "Cen",
                "story": "4d7920666972737420626c6f636b206265666f72652070726f64756374696f6e",
                "storyDecoded": "My first block before production"
            },
            "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
        }
    },
    {
        "height": 11,
        "time":<PHONE_NUMBER>653,
        "previousBlockHash": "5481268332618e6bcbc94dbda02a0c210ca0784283548897daa28ee310df2dfc",
        "hash": "388179f931d88089dccca2c76c073a0ac79ca3a38683187909ecb3a482ab9c8c",
        "body": {
            "star": {
                "ra": "13h 03m 33.35sec",
                "dec": "-49° 31’ 38.1”",
                "mag": "4.83",
                "cen": "Cen",
                "story": "4d7920666972737420626c6f636b206265666f72652070726f64756374696f6e",
                "storyDecoded": "My first block before production"
            },
            "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
        }
    }
]
```

### Get block by height

Retireve the block from the blockchain by the height of the block.

`GET /block/:height`

**Response**
```
{
    "height": 22,
    "time":<PHONE_NUMBER>339,
    "previousBlockHash": "f14fb3a565e77938407026dbbf0993c268e2931c7648b7ce77312b5b6dd91258",
    "hash": "e2abdf01c45ff4c67b20792e8db5bec3f6bbf1ca3880d4f1d0d750067b76fada",
    "body": {
        "star": {
            "ra": "13h 03m 33.35sec",
            "dec": "-49° 31’ 38.1”",
            "mag": "4.83",
            "cen": "Cen",
            "story": "4d7920666972737420626c6f636b206265666f72652070726f64756374696f6e",
            "storyDecoded": "My first block before production"
        },
        "address": "17rsJAF4TyXbbHuasJCXQd8syQ2wkkutwV"
    }
}
```


text:
# Creepts Backend server

This repo implements a REST API in Python that serves the [Creepts game front-end](https://github.com/cartesi/creepts-game).
The API talks to the [Creepts DApp](https://github.com/cartesi/creepts-dapp), which talks to the blockchain.

The REST API is defined in OpenAPI V3, in the directory `reference/anuto/`.
That also includes examples of each endpoint response.

## Running the server locally

## Prerequisites

- Python3 installed
- Dispatcher server from the cartesi creepts-dapp repository available
- cartesi-machine-hash tool from the cartesi machine-emulator repository available
- Available Ethereum node specified in the WEB3_PROVIDER_URI env var
- Install dependencies (preferably in a virtualenv):
```
   pip install -r requirements.txt
```
- Define some env variables that specify some information needed by the server
```
export CONTRACTS_DIR=<PATH TO THE CREEPTS DAPP DIRECTORY> #the one from the creepts-dapp repository
export ACCOUNT_ADDRESS=<ETH ADDRESS TO USE FOR THE PLAYER> #alternatively you can specify the MNEMONIC env variable with the mnemonic of the desired eth wallet
export DISPATCHER_URL=<URL OF THE DISPATCHER SERVER> #the one from the creepts-dapp repository
export PACKLOG_CMD=<COMMAND TO USE THE PACKLOG SCRIPT> #there is one in the root directory of this repo
export UNPACKLOG_CMD=<COMMAND TO USE THE UNPACKLOG SCRIPT> #there is one in the root directory of this repo
export HASH_BINARY_CMD=<COMMAND TO USE THE CARTESI MACHINE HASH TOOL> #available in the cartesi machine-emulator repository
export WEB3_PROVIDER_URI=<WITH THE URI OF THE AVAILABLE ETHEREUM NODE>
```

## Running the server

```
gunicorn creepts.app:api
```

You may also wish to run the server with the `--log-level debug` and `--preload` options when developing to help debugging

## Running the tests

```
python -m unittest discover creepts/tests
```

## Testing the dispatcher and creepts backend server API manually

There are a couple of HTTPie-based simple scripts to manually test the dispatcher and creepts backend server endpoionts.
There is also a mock dispatcher scripts that starts a mocked dispatcher that returns responses based in the static files inside the creepts/tests/instance_samples directory.
They are located inside the creepts/tests directory:
```
run_mock_dispatcher.sh #starts the mocked dispatcher
httpie_test_get_instance.sh #tool to ask for an instance in the dispatcher
httpie_test_get_instances.sh #tool to ask for the list of instances in the dispatcher

httpie_test_get_my_info.sh #tool to ask for the own player info
httpie_test_get_my_score.sh #tool to ask for the own player score and gameplay log
httpie_test_get_player_score.sh #tool to ask for any player score and gameplay log
httpie_test_get_tournament.sh #tool to ask for a specific tournament info
httpie_test_get_tournaments.sh #tool to ask for all tournaments info
httpie_test_put_my_score.sh #tool to commit a score and gameplay log for a tournament
```
## API Documentation

### Using docker

    docker run --rm -v $(pwd)/reference/anuto:/project -p 5000:5000 wework/speccy serve openapi.yaml

### Running locally

Install [speccy](http://speccy.io), then run:

    speccy serve reference/anuto/openapi.yaml

Open documentation at [http://localhost:5000/](http://localhost:5000/)

### Validation

To validate the spec you can use any OpenAPI V3 validator, such as [swagger-cli](https://apitools.dev/swagger-cli/), [Spectral](https://stoplight.io/open-source/spectral/) or [speccy](http://speccy.io).

To lint and validate install your favorite tool and run:

swagger-cli validate reference/anuto/openapi.yaml (or)
spectral lint reference/anuto/openapi.yaml (or)
speccy lint reference/anuto/openapi.yaml

### Mock Server

To run a mock server based on the spec install [Prism](https://stoplight.io/prism), then:

cd reference/anuto
prism mock openapi.yaml

prism-cli 3.1.0 has a [bug](https://github.com/stoplightio/prism/pull/578) related to content negotiation and the `*/*` accept header. So you should explicitily send a `application/json` Accept header when using the mock server. So just using the browser won't usually work as expected (you will see a xml response instead of json).

Using [HTTPie](https://httpie.org):

http http://<IP_ADDRESS>:4010/maps/original
http http://<IP_ADDRESS>:4010/maps/waiting_line?__example=waiting_line
http http://<IP_ADDRESS>:4010/maps/hurry?__example=hurry
http http://<IP_ADDRESS>:4010/tournaments
http http://<IP_ADDRESS>:4010/tournaments/123
http http://<IP_ADDRESS>:4010/tournaments/123/scores/1
http http://<IP_ADDRESS>:4010/tournaments/123/scores/my

## Contributing

Thank you for your interest in Cartesi! Head over to our [Contributing Guidelines](CONTRIBUTING.md) for instructions on how to sign our Contributors Agreement and get started with Cartesi!

Please note we have a [Code of Conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

## License

This repository and all contributions are licensed under
[APACHE 2.0](https://www.apache.org/licenses/LICENSE-2.0). Please review our [LICENSE](LICENSE) file.

## Acknowledgments

- Original work

repository: cartesi/creepts-backend

repo_name: cartesi/creepts-backend


text:
---
title: "Huge Theme and Workflow Advances in Bridgetown 0.15 “Overlook”"
subtitle: Introducing themes, automations, Liquid Components, testing strategies, and a new Thor-based CLI—all to make your experience building Bridgetown sites a true delight.
author: jared
category: release
---

Whew, a lot has happened since the release of Bridgetown 0.14 "Hazelwood". The community has been growing [on Twitter](https://twitter.com/bridgetownrb) and [in Discord](https://discord.gg/V56yUWR), we've gotten [new sponsors on GitHub](https://github.com/bridgetownrb/bridgetown#special-thanks-to-our-founding-members--), and a ton of work to move the ecosystem forward has been going on behind the scenes.

It's time to unveil some of those initiatives today with the release of Bridgetown 0.15 "Overlook"!

### Overview Video

Before we get into the meat of the release, there's a brand-new overview video you can watch to learn more about Bridgetown!

<figure>
  <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/gSij_P3iaIE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy"></iframe>
</figure>

This is the first video in an ongoing series, so keep an eye out for future installments.

### Themes, Plugins, and Automations

While technically you could previously author a Gem-based plugin that would act as a theme for a Bridgetown site, there was a general lack of handholding for both the developer trying to set up the theme and the user trying to install the theme.

In 0.15, we've fixed both sides of this equation. First of all, we completely rewrote the Bridgetown CLI from the ground up (migrating from the Mercenary gem to the Thor gem). Because of this, we're able streamline and enhance all of the builtin commands as well as make it easier for plugins to supply new commands going forward.

You can now run `bridgetown plugins new` to create a new plugin folder directly with your own custom name right out of the gate. [This is a great way to get started authoring a plugin _or_ a theme.](/docs/plugins) Also in the next week or so, I (Jared) will be releasing a BulmaCSS-based Bridgetown theme which you can refer to as an example of how to build a theme.

Secondly, we've introduced a brand-new feature called [Automations](/docs/automations). You can write automation scripts which act on new or existing sites to perform tasks such as adding gems, updating configuration, inserting code, copying files, and much more.

Automations are similar in concept to Gatsby Recipies or Rails App Templates. They’re uniquely powerful when combined with plugins, as an automation can install and configure one or more plugins from a single script. This is quite helpful for themes as well, as you can guide a user through the entire setup process for the theme right from the command line.

We also fixed a few bugs related to installing a plugin's NPM package via Yarn, so at this point we feel pretty confident saying the whole theme/plugin subsystem is now ready for primetime.

### Design Systems with Liquid Components

We could have stopped there, but we didn't! We've also shipped a "1.0" implementation of [Liquid Components](/docs/components) and deprecated the previous `include` tag functionality.

Liquid Components let you design your site using discrete, modular building-blocks. Similar in concept to components found in frontend frameworks, you can use these building-blocks to create buttons, cards, boxes, tables, navbars, headers, footers, and other parts comprising a comprehensive design system for your site. You can even combine Liquid Components with Web Components for a one-two punch that offers static rendering and frontend interactivity all in one package. This is true for components in your own site repo as well as for plugins.

As an example of a plugin which provides such a hybrid component, check out the brand new [Quick Search plugin](https://github.com/bridgetownrb/bridgetown-quick-search) available to all Bridgetown 0.15+ sites. In minutes you can drop in a search bar component and have live search working across all your pages, blog posts, and other collection documents. (The search box up top on this website is an example of that plugin in action!)

We think this is a great way to bring Ruby static site generation methodology up to snuff with the latest best-practices in web development, and we can't wait to see what you all come up with!

### Test Your Site with an Automated Test Suite

Speaking of best practices, one of the benefits of deploying Jamstack sites using a build process is you can insert an automated test suite into that workflow. And we've got not one but _two_ different [test strategies ready for you](/docs/testing) to add to your sites!

For an _extremely fast_ method of testing the validity of your output HTML, you can now set up a Ruby + Minitest suite via a simple automation. Using standard DOM assertions borrowed from Rails, you can verify parts of pages and templates right at the point they've all been rendered in memory, and if the tests fail, hosting platforms such as Netlify will halt the deployment so your invalid site won't complete the deployment.

For a slower but more comprehensive E2E (end-to-end) test suite, you can install Cypress and test your site via its headless browser technology. Use this to literally click around, input text into form fields, navigate between pages, and make sure everything is working as designed.

### The Magic of Open Source

One last announcement to make—some of the nifty treats in v0.15 you were just reading about were contributed by [ParamagicDev on GitHub](https://github.com/ParamagicDev), and the cool part is that Bridgetown was the _first project_ to benefit from a code PR (pull request) he submitted! w00t!

We're thrilled to be attracting both new and long-time fans of the Ruby programming language—and we look forward to Bridgetown's continued invigoration of the Ruby ecosystem long into the future.

### Get Started with Bridgetown

So enough with the technobabble. [Give Bridgetown a spin](/docs) and [let us know what you think](/community)!

Also check out [our Core Concepts guide](/docs/core-concepts) to learn more about the fundamentals of Bridgetown.

And stay tuned for further tutorials and community plugin news in the weeks ahead!

repository: bridgetownrb/bridgetown

gha_language: Ruby

repo_name: bridgetownrb/bridgetown


text:
# leo_gateway

[![Build Status](https://secure.travis-ci.org/leo-project/leo_gateway.png?branch=develop)](http://travis-ci.org/leo-project/leo_gateway)

## Overview

* **leo_gateway**, LeoGateway is one of the core components of [LeoFS](https://github.com/leo-project/leofs). Main roles are described below.
  * LeoFS's Gateway use [Cowboy](https://github.com/extend/cowboy) as Erlang's HTTP server.
  * Able to speak [Amazon S3 compatible REST API](http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/Welcome.html?r=5754).
  * Implemented a subset of Caching in HTTP(RFC2616).

## Architecture

LeoFS Gateway consists of the fast HTTP-Server - [Cowboy](https://github.com/ninenines/cowboy), the API handler and [the cache mecanism](https://github.com/leo-project/leo_cache). It provides the REST-API and Amazon S3-API. You’re able to easily access LeoFS with S3-Clients such as `s3cmd`, `DragonDisk`, program languages - `Erlang`, `Java`, `Ruby`, `Python`, `Go` and so on.

![leo_gateway_architecture](https://raw.githubusercontent.com/leo-project/leofs/master/docs/assets/leofs-architecture.002.jpg)

A client requests an object or a bucket operation to LeoFS Gateway then LeoFS Gateway requests the message of operation to a storage-node.

A destination storage node is decided by the routing-table. It is called RING which is generated and provided at LeoFS Manager and which is based on consistent-hashing.

Also, LeoFS Gateway provides built-in support for the object-cache mechanism in order to realize Keeping high performance and reduction of traffic between LeoFS Gateway and [LeoFS Storage](https://github.com/leo-project/leo_storage).

* The detail document is [here](http://leo-project.net/leofs/docs/).
* `leo_gateway` uses [rebar](https://github.com/rebar/rebar) build system. Makefile so that simply running "make" at the top level should work.
* `leo_gateway` requires [Erlang R16B03-1 or later](http://www.erlang.org/).

## Sponsors

* LeoProject/LeoFS was sponsored by [Rakuten, Inc.](https://global.rakuten.com/corp/) from 2012 to Dec of 2018.
* LeoProject/LeoFS is sponsored by [Lions Data, Ltd.](https://lions-data.com/) from Jan of 2019.

repository: leo-project/leofs

gha_language: Erlang

repo_name: leo-project/leofs


text:
---

---

Free for all boxing sessions

Our community sessions are described as a fun place to be for young people aged 4-24. We believe in early intervention as well as long term intervention, that’s why we work so closely with this specific age group.

We deliver non contact boxing sessions alongside with mentoring and career support to local young residents in the community.
We have a vision to scale these free community sessions nationally, allowing us to reach more young people who will benefit from it. For now, we run sessions at the following two locations and welcome all those who meet the age criteria.

KINGSLEY HALL
Parsloes Avenue, Dagenham, RM9 5NB

Age: 13-24        Day: Monday        Time: 7pm-8.30pm

RIPPLE CENTRE
Abbey Road, Barking, IG11 7FN

Age: 4-12        Day: Thursday        Time:5pm-6.30pm


text:
## What is Deep Learning?

Deep learning is a machine learning technique that teaches computers to do what comes naturally to humans: learn by example.

In deep learning, a computer model learns to perform classification tasks directly from images, text, or sound.

Cutting edge of cutting edge in current AI reasearch

While deep learning was first theorized in the 1980s, there are two main reasons it has only recently become useful:

* Deep learning requires large amounts of labeled data. For example, driverless car development requires millions of images and thousands of hours of video.
* Deep learning requires substantial computing power. High-performance GPUs have a parallel architecture that is efficient for deep learning. When combined with clusters or cloud computing, this enables development teams to reduce training time for a deep learning network from weeks to hours or less.

Source: mathworks.com

## TensorFlow - low level deep learning framework with extra control
https://www.tensorflow.org/
![TF](https://www.gstatic.com/devrel-devsite/vb83a207b2a55414d92d639fb84ba39cbee3e66ce3396f68cf5088c06622e4912/tensorflow/images/lockup.svg)

## Keras higher level API that can control TensorFlow
https://keras.io/
![Keras](https://s3.amazonaws.com/keras.io/img/keras-logo-2018-large-1200.png)

It is practical to use tf.keras unless you want the pain of reading TensorFlow documentation...

https://keras.io/#getting-started-30-seconds-to-keras

Google Colab - for hosted notebooks
http://colab.research.google.com/github/ValRCS/RCS_Data_Analysis_Python_2019

http://colab.research.google.com/github/ValRCS/RCS_Data_Analysis_Python_2019/blob/master/Keras_TensorFlow_Image_Recognition/keras_image_recognition_classifier_in_class_25.04.2019.ipynb


text:
# trajectory_tracking

[![Project Image](https://img.youtube.com/vi/8TWlnW2JLhw/0.jpg)](https://www.youtube.com/watch?v=8TWlnW2JLhw)

> ROS based trajectory_tracking GAZEBO simulation.

---

### Table of Contents

- [Description](#description)
- [Installation](#Installation)
- [How To Use](#how-to-use)
- [Author Info](#author-info)

---

## Description

A simple ROS package of a trajectory_tracking GAZEBO simulation using turtlebot3 robot model based on three diffrent controllers (PID, Backstepping, Feedbak linearization, model predictive) .

[Back To The Top](#trajectory_tracking)

---

## Installation

1- Go to your catkin_ws directory
```shell
    cd ~/catkin_ws/src
```
2- Clone the repository
```shell
    git clone https://github.com/alla-eddine/trajectory_tracking.git
```
3- install by
```shell
    cd ..
    catkin_make
```
---

## How To Use

1- Go to your catkin_ws directory
```shell
    cd ~/catkin_ws
    catkin_make
```
2- in the first terminal tap run
```shell
    roslaunch trajectory_tracking gazebo_tb3_sim.launch
```
3- in the second terminal tap run

A- for backstepping controller run
```shell
    roslaunch trajectory_tracking backstepping.launch
```
B- for feedback linearization controller run
```shell
    roslaunch trajectory_tracking feedback.launch
```
C- for pid controller run
```shell
    roslaunch trajectory_tracking pid.launch
```
D- for model predictive controller run
```shell
    roslaunch trajectory_tracking mpc.launch
```

[Back To The Top](#trajectory_tracking)

---

## Author Info

- Twitter - [@D_allaeddine](https://twitter.com/D_allaeddine)
- Website - [ROS in Arabic](arabic-ros.eb2a.com)

[Back To The Top](#trajectory_tracking)


text:
---
layout: post
title: Http POST calls with SimpleHttpServer
description: "Http POST calls with SimpleHttpServer"
modified: 2016-04-03
tags: [python, simplehttpserver, http, post]
image:
  feature: abstract-5.jpg
  credit: dargadgetz
  creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/
---

If you google "single line python server" you can find many references to SimpleHttpServer implementation of python. This is really useful for testing a remote http server
in your local machine by changing output of the service as you wish.

It's usage is really simple, so you can start the web server by typing the following command :

{% highlight bash %}
> python -m SimpleHTTPServer 8000
{% endhighlight %}

Now you have a web server on your local machine listening on port 8000. You can test it by using the url below in your browser :

{% highlight bash %}
> http://<IP_ADDRESS>:8000
{% endhighlight %}

The directory that you run the command is the root of your web server. You can put a simple json file into this directory and return it against your http "get" calls by adding this json file
into your url :

{% highlight bash %}
> http://<IP_ADDRESS>:8000/result.json
{% endhighlight %}

The restriction of this simple http server is that you can use only "get" method for your http calls. If you try to send post requests, you will get the following or any similar error on the console.

{% highlight bash %}
> code 501, message Unsupported method ('POST')
{% endhighlight %}

Let's add "post" method support to the SimpleHttpServer. The following python
script inherits SimpleHttpServer and adds do_POST method for simulating post http calls.

{% highlight python %}
#!/usr/bin/python

import SimpleHTTPServer
import SocketServer
import logging
import cgi
import sys

class PostServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):

    def do_GET(self):
        logging.warning("GET CALL")
        SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)

    def do_POST(self):
        logging.warning("POST CALL")
        form = cgi.FieldStorage(
            fp=self.rfile,
            headers=self.headers,
            environ={'REQUEST_METHOD':'POST',
                     'CONTENT_TYPE':self.headers['Content-Type'],
                     })
        SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)

Handler = PostServerHandler
httpd = SocketServer.TCPServer(("", 8000), Handler)
httpd.serve_forever()

{% endhighlight %}

Save the above python code into a python file like "postServer.py" and start your server with the following command :

{% highlight bash %}
> python postServer.py
{% endhighlight %}

Now you can send http post requests to your local web server.


text:
![Nuget](https://img.shields.io/nuget/v/Aspose.Note) ![Nuget](https://img.shields.io/nuget/dt/Aspose.Note) ![GitHub](https://img.shields.io/github/license/aspose-note/Aspose.Note-for-.NET)

# .NET API for OneNote Document Processing

[Aspose.Note for .NET](https://products.aspose.com/note/net) is OneNote API to read, write and modify Microsoft Office OneNote files. It allows developers to work with .one files in C#, VB.NET, ASP.NET web applications, web services and Windows applications. It makes it possible to open files and manipulate the elements of OneNote books, from text, images and properties to more complex elements, and then export to ONE, PNG, GIF, JPEG, BMP, HTML or PDF formats.

Directory | Description
--------- | -----------
[Demos](Demos)  | Source code for live demos hosted at https://products.aspose.app/note/family.
[Examples](Examples)  | A collection of .NET examples that help you learn the product features.

## Microsoft OneNote File Processing Features

- Load, edit and save Microsoft OneNote documents via API.
- Navigate through the OneNote Document Object Model (DOM).
- Insert an image into an OneNote file.
- Parse and export various numbered list formats.
- Extract text from any part of an OneNote document.
- Export OneNote documents as other popular formats.
- Import content from popular formats to OneNote documents.

## Read & Write OneNote Format

**Microsoft OneNote:** ONE

## Read Formats

ONETOC2

## Import Formats

PDF

## Save OneNote Files As

**Fixed Layout:** PDF\
**Web:** HTML\
**Images:** GIF, JPEG, PNG, BMP, TIFF

## Platform Independence

Aspose.Note for .NET can be used to build both the 32-bit and the 64-bit .NET applications, including ASP.NET, Web Services & WinForms. Its deployment is very easy and consists of a single assembly with no dependencies (except for the .NET framework). Aspose.Note.dll is CLS compliant, written entirely in C# and contains only safe managed code for .NET Framework, .NET Core & Sliverlight 3.

 Simply execute `Install-Package Aspose.Note` from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.Note for .NET and want to upgrade the version, please execute `Update-Package Aspose.Note` to get the latest version.

## Convert Microsoft OneNote to PDF Format

```csharp
// load the document into Aspose.Note.
Document oneFile = new Document(dir + "template.one");
// save the document as PDF
oneFile.Save(dir + "output.pdf", SaveFormat.Pdf);
```

## Extract Images from Microsoft OneNote Document

```csharp
// load the document into Aspose.Note.
Document oneFile = new Document(dir + "template.one");
// get all image nodes
IList<Aspose.Note.Image> nodes = oneFile.GetChildNodes<Aspose.Note.Image>();
foreach (Aspose.Note.Image image in nodes)
{
    using (MemoryStream stream = new MemoryStream(image.Bytes))
    {
        using (Bitmap bitMap = new Bitmap(stream))
        {
            // save image bytes to a file
            bitMap.Save(dir + image.FileName);
        }
    }
}
```
##### [Demos](https://products.aspose.app/note/family):
- [Conversion](https://products.aspose.app/note/conversion)
- [Viewer](https://products.aspose.app/note/viewer)
- [Unlock](https://products.aspose.app/note/unlock)
------------
[Home](https://www.aspose.com/) | [Product Page](https://products.aspose.com/note/net) | [Docs](https://docs.aspose.com/note/net/) | [API Reference](https://apireference.aspose.com/note/net) | [Examples](https://github.com/aspose-note/Aspose.Note-for-.NET) | [Blog](https://blog.aspose.com/category/note/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/note) |  [Temporary License](https://purchase.aspose.com/temporary-license)


text:
# Requirements

In order to use TreeMDown you will need:

 * PHP >= 7.1 with iconv extension
 * [Parsedown-Extra](https://github.com/erusev/parsedown-extra)
   if you do not install via [composer](http://getcomposer.org)
 * A webserver like Apache, nginx, etc.

**Note:** This application is currently tested on linux systems only.

repository: hollodotme/TreeMDown

repo_name: hollodotme/TreeMDown


text:
# Bilimbia lobulata (Sommerf.) Hafellner & Coppins SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Veldkamp, Lichenologist 36(3 & 4): 195 (2004)

#### Original name
Lecidea lobulata (Flörke) Hue

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Building a profile image uploader with automatic image compression in PHP

How to build a image profile uploader, with automatic image compression using the Zara 4 [image optimization](https://zara4.com) service.

View the accompanying
[blog post](https://blog.zara4.com/building-a-profile-image-uploader-with-automatic-image-compression-in-php)

## No Profile Image
![No Image Screenshot](img/screenshot-01.png)

## With Profile Image
![With Image Screenshot](img/screenshot-02.png)

## License
Released under the MIT license. [View license](LICENSE)


text:
# payment-gateway-facade
[![Build Status](https://travis-ci.org/mak1986/payment-gateway-facade.svg?branch=master)](https://travis-ci.org/mak1986/payment-gateway-facade)
## A facade for payment gateways ##

The library is designed to easily add another additional payment gateways.

## Installation ##

Install bower components by running this command:
```
bower install
```

Install node modules by running this command:
```
npm install
```

## To start the app ##

Start mongodb by running this command:
```
sudo service mongod start
```
Note: If you haven't mongdb installed goto https://docs.mongodb.com/manual/installation/

Run this command to start the server and then go to http://localhost:3000.
```
npm start
```

## Adding a new payment gateway ##

__STEP 1:__ Add machine name, pretty name and module name for the new payment gateway in ./lib/gateway/config.json.

```
[
	{
		"machine_name": "paypal",
		"pretty_name": "PayPal",
		"module_name": "PaypalGateway"
	},
	{
		"machine_name": "braintree",
		"pretty_name": "Braintree",
		"module_name": "BraintreeGateway"
	}
]
```

__STEP 2:__ Create a new gateway folder in ./lib/gateway and then add a new config folder in it.

__STEP 3:__ Create a config.json file in the config folder you just created. This file holds your new payment gateway values. The code example below belongs to Braintree gateway.

```
{
	"environment": "Sandbox",
	"credentials": {
		"merchant_id": "xxxxxxxxxx",
		"public_key": "xxxxxxxxxx",
		"private_key": "xxxxxxxxxx",
		"machant_account_id": {
			"THB": "xxxxxxxxxx",
			"HKD": "xxxxxxxxxx",
			"THB": "xxxxxxxxxx"
		}
	},
	"machine_name_mapping": {
		"amex": "AmEx",
		"dankort": null ,
		"diners_club": null,
		"discover": "Discover",
		"interpayment": null,
		"jcb": "JCB",
		"maestro": "Maestro",
		"mastercard": "MasterCard",
		"unionpay": "Unionpay",
		"visa": "Visa",
		"visa_electron": null
	},
	"machine_name": "braintree"
}
```

__STEP 4:__ Create a new file in your new payment gateway folder. Make sure to Implement the methods as showing in the code below.

```
(function(){
	'use strict';

	// Require your new payment gateway module here.
	var config = require('./config/config.json');

	// Constructor method

	function YourNewPaymentGateway(){

		// add configuration files here

		this.connect();

	};

	// Public methods

	YourNewPaymentGateway.prototype.connect = function(){

		// Implement this.

	};

	YourNewPaymentGateway.prototype.makeSinglePayment = function(order, creditCard, options, callback){

		// Implement this.

	};

	// PaypalGateway.prototype.getClientToken = function(callback){

	//	Uncomment and implement this if your new gateway requires the client to get a client token.
	//	If you implement this method you will need to edit the  ./public/js/clientTokenSetup.js file.

	// };

	YourNewPaymentGateway.prototype.isPaymentCreated = function(result){

		return // Implement this.

	};

	YourNewPaymentGateway.prototype.isPaymentApproved = function(result){

		return // Implement this.

	};

	YourNewPaymentGateway.prototype.getMachineName = function(){

		return this.getConfig('machine_name');

	};

	// Helper methods

	YourNewPaymentGateway.prototype.addConfig = function(key, value){

		this.config[key] = value;

	};

	YourNewPaymentGateway.prototype.getConfig = function(key){

		return this.config[key];

	};

	module.exports = YourNewPaymentGateway;

}());
```
__STEP 5:__ That's it now try run the app.


text:
base Cookbook
=============

The is the base cookbook for SmartOS-based Global Zones.  This cookbook install
various tools we use like patched MegaCli for use with MegaRAID SAS 9260-4i,
mbuffer for buffering large streams of data for zfs send/recv, etc.

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

#### packages
- `toaster` - base needs toaster to brown your bagel.

Attributes
----------

Usage
-----
#### base::default

Just include `base` in your node's `run_list`:

```json
{
  "name":"my_node",
  "run_list": [
    "recipe[base]"
  ]
}
```

License and Authors
-------------------
Authors:

 * Jacques Marneweck<EMAIL_ADDRESS>


text:
#ProvideCommentHelp
**Severity Level: Info**

##Description
Comment based help should be provided for all PowerShell commands. This test only checks for the presence of comment based help and not on the validity or format.

For assistance on comment based help, use the command ```Get-Help about_comment_based_help``` or the article, "How to Write Cmdlet Help" (http://go.microsoft.com/fwlink/?LinkID=123415).

##How to Fix
Include comment based help for each command identified.

##Example
###Wrong:
``` PowerShell
function Get-File
{
    [CmdletBinding()]
    Param
    (
        ...
    )

}
```

###Correct:
``` PowerShell
<#
.Synopsis
    Short description
.DESCRIPTION
    Long description
.EXAMPLE
    Example of how to use this cmdlet
.EXAMPLE
    Another example of how to use this cmdlet
.INPUTS
    Inputs to this cmdlet (if any)
.OUTPUTS
    Output from this cmdlet (if any)
.NOTES
    General notes
.COMPONENT
    The component this cmdlet belongs to
.ROLE
    The role this cmdlet belongs to
.FUNCTIONALITY
    The functionality that best describes this cmdlet
#>
function Get-File
{
    [CmdletBinding()]
    Param
    (
        ...
    )

}
```

repository: kapilmb/PSScriptAnalyzer

branch_name: refs/heads/development

gha_language: C#

repo_name: kapilmb/PSScriptAnalyzer


text:
# Contributing to LaunchDarkly SDK for Electron

We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.

The basic client logic that is shared by the Electron SDK and the browser SDK is in the `ldclient-js-common` package within [js-client](https://github.com/launchdarkly/js-client), which is published separately to NPM.

To build and test the project, from the project root directory:
* `npm install`
* `npm test`

repository: fossabot/electron-client

gha_license_id: NOASSERTION

repo_name: fossabot/electron-client


text:
# Index of set axioms

Set Theory Axioms from `Naive Set Theory` by Paul R. Halmos 1960

1.  **Axiom of Union**
   For every collection of sets there exists a set that contains all
   elements that belong to at least one set in the given collection.
   A B
   C
   ∀x. x ∈ C -> x ∈ A ⋁ x ∈ C -> x ∈ B

3. Axiom of Specification
  To every set `A` and to every predicate `P`, there corresponds a set `B` whose elements are exactly those elements `x` in `A` for which `P(x)` holds.

4. Axiom of pairing. For any two sets there exists a set that they both belong to.
5. Axiom of powers. For each set there exists a collection of sets that contains among
its elements all the subsets of the given set.
6. Axiom of infinity. There exists a set containing 0 and the successor of each of its
elements.
7. Axiom of substitution. If S(a,b) is a sentence such that for each a in set A the set
{b: S(a,b)} can be formed, then there exists a function F with domain A such that
F(a) = {b:S(a,b)} for each a in A. (Anything intelligent that one can do to the elements
of a set yields a set.)
8. Axiom of choice. The Cartesian product of a non-empty family of non-empty sets is
non-empty.


text:
Problem Statements
1. Select elements for city ranking
2. Data collection and joint
3. General analysis on four categories
4. Create tools for user to rank their personal living city preference which would be visualized on the US map

- User profile.
  The computational environments the user should be familiar with are listed as:
  - web pages (User need to choose elements and weight them by user's preference)
  - Jupyter notebook (We are planning to create an user interface to ask users to rank city in a board interface and hide the Jupyter notebook)

- Elements
  - There will be four main categories for users to choose in the database: Environmental, Society, Economy and Tertiary Industry.
  - Many cities may only have partial information, so we will only use the information for big cities which have enough data to do the analysis.
  - Visualization on the US map.
  - Create an user interface to make it easier to use.

- Use Cases
  - Users can see the general city ranking on each of the four categories.
  - Users need to pick which element matters to them in a provided list of elements in the user interface.
  - Users need to provide weight values for the elements they picked in the user interface.
  - A rough US map with 5 highest score cities would come out after users' input information


text:
---
Last updated: June 16, 2020
---
# My page

## Education

Xiamen University (XMU)

Bachelor of Science (Sept. 2015 - Jun. 2019)

> Major in Chemistry

> Minor in Mathematical Fiance

> Major GPA: 3.5/4

> Minor GPA: 3.5/4

IELTS: 7.5 (R 9.0, L 7.5, W 6.5, S 6.0)

GRE General: 321 (V151, Q170) + AW3.0

## About Me
### Things I interested

Well, I like vedio games and I would write reviews for them. I have membership of many steam curators, like keylol.

If you are interested in my reviews, [here](https://github.com/morganaxmu/My-reviews-of-games) you are.

## More

You can contact me by e-mail at<EMAIL_ADDRESS>
* * *
> Before contact me, here are something you should know:
>
> [How To Ask Questions The Smart Way](http://www.catb.org/%7Eesr/faqs/smart-questions.html)
>
> [Chinese Version](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md)
* * *


text:
---
title: RabbitMQ Delayed Delivery
summary: Describes the native delayed delivery implementation in the RabbitMQ transport
component: Rabbit
reviewed: 2023-04-14
versions: '[4,]'
redirects:
 - nservicebus/rabbitmq/delayed-delivery
---

partial: v1-warning

In versions 4.3 and above, the RabbitMQ transport no longer relies on the [timeout manager](/nservicebus/messaging/timeout-manager.md) to implement [delayed delivery](/nservicebus/messaging/delayed-delivery.md). Instead, the transport creates infrastructure inside the broker which can delay messages using native RabbitMQ features.

## How it works

When an endpoint is started, the transport declares a set of topic exchanges, queues, and bindings that work together to provide the necessary infrastructure to support delayed messages. Exchanges and queues are grouped to provide 28 delay levels. There is one final delivery exchange in addition to the delay-level exchanges. When a message needs to be delayed, the value of the desired delay is first converted to seconds. The binary representation of this value is used as part of the routing key when the message is sent to the delay-level exchanges. The full routing key has the following format:

```
N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.destination
```

Where `N` is either `0` or `1`, representing the delay value in binary, and `destination` is the name of endpoint the delayed message will be sent to.

As an example, a delay of 10 seconds (`1010` in binary) on a message bound for the `destination` queue is encoded with a routing key of:

```
<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.destination
```

### Delay levels

Each exchange/queue pair that makes up a level represents one bit of the total delay value. By having 28 of these levels, corresponding to `2^27` through `2^0`, the delay infrastructure can delay a message for any value that can be represented by a 28-bit number.

NOTE: With 28 total levels, the maximum delay value is 268,435,455 seconds, or about 8.5 years.

A delay level is created by declaring a topic exchange that is bound to a queue with a routing key of `1`, and to the exchange corresponding to `level - 1` with a routing key of `0`. The queue for the delay level is declared with an [`x-message-ttl`](https://www.rabbitmq.com/ttl.html) value corresponding to `2^level` seconds. The queue is also declared with an [`x-dead-letter-exchange`](https://www.rabbitmq.com/dlx.html) value corresponding to the `level - 1` exchange, so that when a message in the queue expires, it will be routed to the `level - 1` exchange.

The delay levels are connected in this manner, from highest (27) to lowest (0). Each delay level's routing key adds wildcards as needed so that each routing key is looking at the portion of the message's routing key that corresponds to its delay level.

The following diagram illustrates the relationships between the exchanges and queues in the delay infrastructure, which are connected by bindings and `x-dead-letter-exchange` values. It's important to note the wildcard rules for RabbitMQ binding expressions, where *word* describes a dot-delimited segment:

* `*` substitutes for exactly one word
* `#` substitutes for 0 or more words

<style>
.edgeLabel {
    font-family: Consolas, Courier New, monospace;
}
</style>

```mermaid

graph TD

subgraph Delay-Level Exchanges, Queues, Bindings, and TTLs

exchange27(Exchange: nsb.v2.delay-level-27)
queue27[Queue: nsb.v2.delay-level-27]
exchange26(Exchange: nsb.v2.delay-level-26)
queue26[Queue: nsb.v2.delay-level-26]
exchange25(Exchange: nsb.v2.delay-level-25)

hiddenExchanges(Not Shown: nsb.v2.delay-level-24 through nsb.v2.delay-level-2)

exchange1(Exchange: nsb.v2.delay-level-01)
queue1(Queue: nsb.v2.delay-level-01)
exchange0(Exchange: nsb.v2.delay-level-00)
queue0(Queue: nsb.v2.delay-level-00)
delivery(Exchange: nsb.v2.delay-delivery)

exchange27 -->|"Binding: 1.#<br/>(No * wildcards)"| queue27
exchange27 -->|"Binding: 0.#<br/>(No * wildcards)"| exchange26
queue27 -->|"TTL: 2^27s ≈ 4.25 years"| exchange26

exchange26 -->|"Binding: *.1.#<br/>(1 * wildcard)"| queue26
exchange26 -->|"Binding: *.0.#<br/>(1 * wildcard)"| exchange25
queue26 -->|"TTL: 2^26s ≈ 2.13 years"| exchange25

exchange25 -.-> hiddenExchanges
hiddenExchanges -.-> exchange1

exchange1 -->|"Binding:<br/>*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.1.#<br/>(26 * wildcards)"| queue1
exchange1 -->|"Binding:<br/>*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.0.#<br/>(26 * wildcards)"| exchange0
queue1 -->|TTL: 2^1s = 2 seconds| exchange0

exchange0 -->|"Binding:<br/>*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.1.#<br/>(27 * wildcards)"| queue0
exchange0 -->|"Binding:<br/>*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.0.#<br/>(27 * wildcards)"| delivery
queue0 -->|TTL: 2^0s = 1 second| delivery

classDef exchangeClass stroke:#000000,stroke-width:2px,font-weight:bold;
class exchange27,exchange26,exchange25,exchange1,exchange0,delivery exchangeClass

classDef hiddenExchanges font-style:italic,fill:transparent,stroke:transparent;
class hiddenExchanges hiddenExchanges

end
```

To avoid unnecessary traversal through the delay infrastructure, the message is published to the first applicable exchange by identifying the first level that will route to a queue, or in other words, the first `1` in the routing key. In the 10-second example (binary `1010`), the message would first be published to the `nsb.v2.delay-level-03` exchange, and all of that exchange's bindings are evaluated. Only two bindings exist for the exchange, so:

* If the value is a `1`, the exchange will route the message to the `nsb.v2.delay-level-03` queue, where it will wait until the TTL expires (2^3 seconds) before being forwarded to the `nsb.v2.delay-level-02` exchange.
* If the value is a `0`, the exchange will route the message to the `nsb.v2.delay-level-02` exchange.

### Delivery

At the end of this process, the message is routed to the `nsb.v2.delay-delivery` exchange. It is at this final step where the message destination is evaluated to determine where the message should be routed to.

Every endpoint that can receive delayed messages will create bindings like `#.EndpointName` to this exchange to control final routing. The exact process depends upon the [routing topology](routing-topology.md) in use. These bindings match any combination of delay values, but only the binding for the correct destination endpoint will match, resulting in the message being delivered only to the correct endpoint.

### Example

This example illustrates the delay mentioned above, showing a message sent with a delay of 10 seconds to an endpoint called `destination`. For brevity, the number of delay levels has been reduced to 4, so the routing key for this message is `<IP_ADDRESS>.destination`, and it is published to the Level 3 exchange:

|Exchange         |Routing Key Segment    |Routing Value|Routed To        |Delay in Queue|Dead-letter To|
|-----------------|-----------------------|:-----------:|-----------------|:-------:|:---------------:|
|Level 03         |**1**.0.1.0.destination|     `1`     |Level 03 Queue   |8 seconds|Level 02 Exchange|
|Level 02         |1.**0**.1.0.destination|     `0`     |Level 01 Exchange|    -    |        -        |
|Level 01         |1.0.**1**.0.destination|     `1`     |Level 01 Queue   |2 seconds|Level 00 Exchange|
|Level 00         |1.0.1.**0**.destination|     `0`     |Delivery Exchange|    -    |        -        |
|Delivery Exchange|<IP_ADDRESS>.**destination**|`destination`|`destination`    |    -    |        -        |

This example can be visualized using the following

```mermaid
graph LR

subgraph Example: delay of 10 seconds

exchange3(Level 3)
exchange2(Level 2)
exchange1(Level 1)
exchange0(Level 0)
exchange-delivery(delay-delivery)
q3[fa:fa-hourglass-half 8sec]
q2[fa:fa-hourglass-half 4sec]
q1[fa:fa-hourglass-half 2sec]
q0[fa:fa-hourglass-half 1sec]

exchange3 ==> q3
exchange3 .->exchange2
q3 ==> exchange2

exchange2 .-> q2
exchange2 ==>exchange1
q2 .-> exchange1

exchange1 ==> q1
exchange1 .->exchange0
q1 ==> exchange0

exchange0 .-> q0
exchange0 ==>exchange-delivery
q0 .-> exchange-delivery

exchange-delivery ==> dest[destination]

classDef exchangeClass stroke:#000000,stroke-width:2px;
class exchange3,exchange2,exchange1,exchange0,exchange-delivery exchangeClass

classDef usedQueue fill:#11ff00;
class q1,q3 usedQueue

end
```

## Backwards compatibility

### Non-native to native

It is safe to operate a combination of native-delay and non-native-delay endpoints at the same time. Native endpoints can send delayed messages to endpoints that are not yet aware of the native delay infrastructure. Native endpoints can continue to receive delayed messages from non-native endpoints as well.

partial: timeout-manager

#### Migrating timeouts to native delayed delivery

In order to migrate timeouts to the native-delay delivery implementation, the [migration tool](/nservicebus/tools/migrate-to-native-delivery.md) can be used.

partial: v1-to-v2


text:
Note: This is a beta playbook, which lets you implement and test pre-release software. Since the playbook is beta, it might contain bugs. Updates to the playbook during the beta phase might include non-backward compatible features. We appreciate your feedback on the quality and usability of the playbook to help us identify issues, fix them, and continually improve. This playbook processes the survery responses. It updates that the employee responded to the survey and what their health status is. If necessary, it opens IT or HR incidents, and updates the process survey tracker.

## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.

### Sub-playbooks
This playbook does not use any sub-playbooks.

### Integrations
* Builtin

### Scripts
* Set

### Commands
* createNewIndicator
* createNewIncident

## Playbook Inputs
---
There are no inputs for this playbook.

## Playbook Outputs
---
There are no outputs for this playbook.

## Playbook Image
---
![Process_Survey_Response](https://raw.githubusercontent.com/demisto/content/ec6cda315c0d1e15cf36a3c93cc936dd90dfbc48/Packs/CrisisManagement/doc_files/Process_Survey_Response.png)

repository: demisto/content

repo_name: demisto/content


text:
---
layout: page
title: Resources
permalink: /resources/
---

### [API Style Guide](http://htmlpreview.github.io/?https://raw.githubusercontent.com/Haufe-Lexware/api-style-guide/gh-pages/index.html)
A List of rules, best practices, resources and our way of creating REST APIs in the Haufe Group. The style guide addresses API Designers, mostly developers and architects, who want to design an API.

### [Docker Style Guide](http://htmlpreview.github.io/?https://raw.githubusercontent.com/Haufe-Lexware/docker-style-guide/gh-pages/index.html)

A set of documents representing mandantory requirements, recommended best practices and informational resources for using Docker in official (public or internal) Haufe products, services or solutions.


text:
# tigrex
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/ericjaychi?locale.x=en_US) ![Release](https://img.shields.io/github/release/ericjaychi/tigrex)

tigrex is a Python CLI Tool for searching and pricing Magic the Gathering cards using Scryfall's API.

## Installation

**pip**

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install tigrex.

```bash
pip install tigrex
```

**Homebrew**

Use Homebrew to install tigrex.

```bash
brew tap ericjaychi/tigrex
brew install tigrex
```

**Cloning**

Clone the repository and run the script locally. This method will mean that each command has to have `python -m tigrex`.
```bash
git clone https://github.com/ericjaychi/tigrex.git || git@github.com:ericjaychi/tigrex.git
cd tigrex/
python -m tigrex [command]
```

## Usage
All searches leverage a fuzzy search, meaning that the `[card_name]` does not have to be exact. Examples:
- `yuriko` will result in a search result of `Yuriko, the Tiger's Shadow`
- `watery` will result in a search result of `Watery Grave`

If a full name needs to be searched for, wrapping the `[card_name]` in `" "` can achieve this, `"[card_name]"`. Examples:
- `"yuriko, the tiger's shadow"` will result in a search result of `Yuriko, the Tiger's Shadow`
- `"watery grave"` will result in a search result of `Watery Grave`

Fuzzy search will fail if there are multiple results. Examples:`
- `path to` will fail and not bring up the card `Path to Exile``
- `"path to"` will fail and not bring up the card `Path to Exile`

## Commands
**search** - Search for an MTG card.
```bash
tigrex search [card-name]
```
![tigrex search](demo/tigrex-search.gif)

**price** - Search for an MTG card price.
```
tigrex price [card-name]
```
![tigrex search](demo/tigrex-price.gif)

**currency** - Set the currency of the card searches inside of `config.ini` so that price shows in the either USD, EUR, or TIX. Foil prices are only in USD.
```
tigrex currency [usd | eur | tix]
```
![tigrex search](demo/tigrex-currency.gif)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Although this is an open source tool, donations are appreciated greatly!

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: ericjaychi/tigrex

repo_name: ericjaychi/tigrex