text:
# rmvdec

A simple decrypter for RPG-Maker MV resource files (.rpgmvp, .rpgmvo, rpgmvm)

### Usage

`rmvdec <input_file>|<input_dir> [<output_dir>] [-r] [-rm] [-k <decryption_key>|<path_to_System.json>]`

- Rmvdec supports either a single file or a whole folder as input. In folder mode only files with one of the 3 allowed extensions is processed. Subdirectories are ignored per default.
- The encryption/decryption key is needed to extract any file.
  - It can either be specified directly or in form of the path to the games's System.json configuration file.
  - If the 'key' argument is omitted, rmvdec automatically searches up to 5 levels upwards from the input directory for a data folder containing System.json. If the game folder structure is intact, this should always work.

#### Options

| Switch | Alternative switches       | Description                                                      |
| ------ | -------------------------- | ---------------------------------------------------------------- |
| -r     | `--recursive`, `--recurse` | Include files in subdirectories                                  |
| -rm    | `--remove`                 | Delete original files after decryption                           |
| -f     | `--force`                  | Try to decrypt all files, not only those with allowed extensions |

### Technical details

RPG-Maker MV files are encrypted by simply XORing the raw bytes with an encryption key and adding a 16 byte header to the file. The key is saved in System.json, which can be found inside the `/data` folder of the game. The file extension is based on the input type:

| encrypted | original |
| --------- | -------- |
| rpgmvp¹   | png      |
| rpgmvm    | m4a      |
| rpgmvo    | ogg      |

¹ Some games use `.png_` as an extension for images instead. Rmvdec checks for this extension as well.

### Remarks

No reverse engineering has been used to write this tool, it is based on public information about the file format released by other researchers.

I released it as a helper for artists to search games for unlicensed use of their assets. It is not meant to encourage extraction with the sole purpose of using assets in your own products without permission of the copyright holder.

Remember: don't steal assets from other people's games. Respect copyrights. And don't protect your own games - it's unnecessary effort.

repository: Bioruebe/rmvdec

repo_name: Bioruebe/rmvdec


text:
# gitmoo-goog

A [Google Photos](http://photos.google.com/) backup tool.

`gitmoo-goog` tool uses [Google Photos API](https://developers.google.com/photos/library/guides/get-started#enable-the-api) to continously download all photos on a local device.

It can be used as a daemon to keep in sync with a google-photos account.

## Build

![Go](https://github.com/dtylman/gitmoo-goog/workflows/Go/badge.svg)

## Downloading and Installing:

* Go to[Latest](https://github.com/dtylman/gitmoo-goog/releases/latest) release.
* Download gitmoo-goog.zip

Unzip and run, there are no other dependencies.

The zip contains Windows, Linux and MAC OS binaries.

## Usage:

### Enable Google-Photos API:

(There is more than one way to do the following):
* Go to [API](https://developers.google.com/photos/library/guides/get-started#enable-the-api)
* Click on `Enable the Google Photos API` button
* Create a new project, name it whatever you like.
* Write `gitmoo-goog` in the `product name` field, (can be whatever you like)
* On the `when are you calling from`, choose `Desktop app`, click `Create`.
* Download the client configuration.

### Configure gitmoo-goog:

* Copy the downloaded `credentials.json` to the same folder with `gitmoo-goog`.
* Run `gitmoo-goog`, and follow the provided link.
* Sign in, and click `Allow`.
* You will be redirected to a local address and it `This browser window can be now closed...`.
* `gitmoo-goog` will authorize and start downloading content (authorization code will be automically received).
```
$ ./gitmoo-goog
2018/09/12 10:18:07 This is gitmoo-goog ver 0.1
Go to the following link in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=...
4/WACqgFeX5OTB8X4LWd5i2TFH....
Saving credential file to: token.json
2018/09/12 10:20:07 Connecting ...
2018/09/12 10:20:07 Processed: 0, Downloaded: 0, Errors: 0, Total Size: 0 B, Waiting 5s
```

This is probably not what you want, hit `crt-c` to stop it.

### Usage:

```
Usage of ./gitmoo-goog:
  - album
        download only from this album (use google album id)
  -folder string
        backup folder (default current working directory)
  -force
        ignore errors, and force working
  -version
        at startup, print the gitmoo-goog version
  -logfile string
        log to this file
  -credentials-file string
        filepath to where the credentials file can be found (default 'credentials.json')
  -token-file string
        filepath to where the token should be stored (default 'token.json')
  -loop
        loops forever (use as daemon)
  -max int
        max items to download (default<PHONE_NUMBER>)
  -pagesize int
        number of items to download on per API call (default 50)
  -throttle int
        Time, in seconds, to wait between API calls (default 5)
  -folder-format string
        Time format used for folder paths based on https://golang.org/pkg/time/#Time.Format (default "2016/Janurary")
  -use-file-name
        Use file name when uploaded to Google Photos (default off)
  -include-exif
        Retain EXIF metadata on downloaded images. Location information is not included because Google does not include it. (default off)
  -download-throttle
        Rate in KB/sec, to limit downloading of items (default off)
  -concurrent-downloads
        Number of concurrent item downloads (default 5)
  -loopback-port
        Port number bound on `<IP_ADDRESS>` to receive auth code during authentication (default 8080)
```

On Linux, running the following is a good practice:

```
$ ./gitmoo-goog -folder archive -logfile gitmoo.log -use-file-name -include-exif -loop -throttle 45 &
```

This will start the process in background, making an API call every 45 seconds, looping forever on all items and saving them to `{pwd}/archive`. All images will be downloaded with a filename and metadata as close to original as Google offers through the api.

Logfile will be saved as `gitmoo.log`.

#### Naming

Files are created as follows:

`[folder][year][month][day]_[hash].json` and `.jpg`. The `json` file holds the metadata from `google-photos`.

## Building:

To build you may need to specify that module download mode is using a vendor folder.  Failure to do this will mean that modified vendor files will not be used.

`go build -mod vendor`

## Testing:

`go test -mod vendor ./...`

## Docker (Linux only)

You can run gitmoo-goog in Docker. At the moment you have to build the image yourself.
Within the storage directory gitmoo-goog expects the `credentials.json` and will place all the downloaded files.

The part `--user=$(id -u):$(id -g)` ensures that the downloaded files are owned by the user launching the container.

Configuring additional settings is possible by adding command arguments like so:
```
$ docker run -v $(pwd):/app --user=$(id -u):$(id -g) dtylman/gitmoo-goog:latest -loop -throttle 45
```

license: MIT

repository: dtylman/gitmoo-goog

branch_name: refs/heads/master

extension: md

gha_language: Go

gha_license_id: MIT

license_type: permissive

repo_name: dtylman/gitmoo-goog


text:
# Ansible : Playbook SSH

The aim of this project is to easily manage users, groups, SSH and shell prompt on Vagrant instances.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

What things you need to run this Ansible playbook :

*   [Vagrant](https://www.vagrantup.com/docs/installation/) must be installed on your computer
*   Update the Vagrant file based on your computer (CPU, memory), if needed
*   You must have download the ubuntu Xenial64 vagrant box :

```bash
$ vagrant box add https://app.vagrantup.com/ubuntu/boxes/xenial64
```
*   sYou should configure the role with your SSH keys to be able to connect on each instances

### Usage

A good point with Vagrant is that you can create, update and destroy all architecture easily with some commands.

Be aware that you need to be in the Vagrant directory to be able to run the commands.

#### Build Environment

Vagrant needs to init the project to run and build it :

```bash
$ vagrant up
```

After build, you can check which virtual machine Vagrant has created :

```bash
$ vagrant status
```

If all run like it is expected, you should see something like this :

```bash
$ vagrant status

Current machine states:

ssh01.prd                   running (virtualbox)
ssh01.stg                   running (virtualbox)
ssh01.dev                   running (virtualbox)
```

#### Deployment

To deploy this role, you just have to run the Ansible playbook ssh.yml with this command :

```bash
$ ansible-playbook ssh.yml
```

If everything run as expected, you should access any Vagrant instances and see two users : foo and bar

Connect on each user to see the specific prompt and SSH keys associated.

#### Destroy

To destroy the Vagrant resources created, just run this command :

```bash
$ vagrant destroy
```

## Author

Member of Wikitops : https://www.wikitops.io/

## Licence

This project is licensed under MIT license. For the full text of the license, see the LICENSE file.


text:
# [Method needlessly defines parameter with concrete classes](http://fb-contrib.sourceforge.net/bugdescriptions.html#OCP_OVERLY_CONCRETE_PARAMETER)

This method uses concrete classes for parameters when only methods defined in an implemented
			interface or superclass are used. Consider increasing the abstraction of the interface to
			make low impact changes easier to accomplish in the future.

Take the following example:

    private void appendToList(ArrayList<String> list) {
        if (list.size() < 100) {
            list.add("Foo");
        }
    }

				The parameter list is currently defined as an `ArrayList`, which is a concrete implementation of the `List` interface.
				Specifying `ArrayList` is unnecessary here, because we aren't using any `ArrayList`-specific methods (like `ensureCapacity()` or `trimToSize()`).
				Instead of using the concrete definition, it is better to do something like:

    private void appendToList(List<String> list) {
        ...

				If the design ever changes, e.g. a `LinkedList` is used instead, this code won't have to change.

IDEs tend to have tools to help generalize parameters.  For example, in Eclipse, the refactoring tool [Generalize Declared Type](http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-menu-refactor.htm) helps find an appropriate level of concreteness.

repository: codacy/codacy-spotbugs

gha_language: Scala

gha_license_id: NOASSERTION

repo_name: codacy/codacy-spotbugs


text:
per a poder installar l'entorn per a poder programar le nodeMCU
 Open up Arduino, then go to the Preferences (File > Preferences). Then, towards the bottom of the window,
 copy this URL into the “Additional Board Manager URLs” text box:

 http://arduino.esp8266.com/stable/package_esp8266com_index.json

Hit OK. Then navigate to the Board Manager by going to Tools > Boards > Boards Manager.
There should be a couple new entries in addition to the standard Arduino boards.
Look for esp8266. Click on that entry, then select Install.

tutorial interesante
http://www.instructables.com/id/Quick-Start-to-Nodemcu-ESP8266-on-Arduino-IDE/

repository: AngelaFabregues/UABot

repo_name: AngelaFabregues/UABot


text:
At some point during the lifetime of Spilo you may decide that you may need to scale up, scale down or change other
parts of the infrastructure.

The following plan will accomplish this:

1. Change the CloudFormation template to reflect the changes in infrastructure
2. Increase the number of EC2 instances in your AutoScalingGroup (or: Terminate one of the streaming replica's)
3. Kill one of the replica's running on the old configuration
4. Repeat step 2 and 3 until all replica's are running the new configuration
5. Fail over the Spilo cluster
6. Terminate the replica (the previous master)

Only during the fail over will there be some downtime for the master instance.

If your databases' size is significant, these steps may take some time to complete. Optimizations of this process
(think of using EBS snapshots) are on the roadmap but not yet available.

repository: zalando/spilo

gha_language: Python

repo_name: zalando/spilo


text:
### Welcome to Mysqto's OpenWrt Mirror.

This is the personal OpenWrt package mirror maintained by [@Mysqto](https://github.com/mysqto). Currently hosted the following packages for ramips(Xiaomi Wifi Mini) based on the OpenWrt official snapshot builds:

 Name                     | Description
 -------------------------|-----------------------------------
 [redsocks][1]            | redsocks(With OpenSSL) for OpenWRT
 [openwrt-chinadns][2]    | ChinaDNS-C for OpenWRT
 [openwrt-shadowvpn][3]   | ShadowVPN for OpenWrt
 [openwrt-dnsmasq][4]     | Dnsmasq Patch & Makefile for OpenWrt
 [openwrt-shadowsocks][5] | Shadowsocks-libev for OpenWrt
 [openwrt-dist-luci][6]   | LuCI Applications for OpenWrt-dist

### Uasge
Add the following line to your `/etc/opkg.conf` file

```
src/gz openwrt_dist http://dist.openwrt.link/releases/ramips/mt7620/packages/base
```

And run 'opkg update' to update the package source.

Enjoy the free internet.

  [1]: https://github.com/semigodking/redsocks
  [2]: https://github.com/clowwindy/ChinaDNS
  [3]: https://github.com/clowwindy/ShadowVPN
  [4]: https://github.com/semigodking/redsocks
  [5]: https://github.com/shadowsocks/openwrt-shadowsocks
  [6]: https://github.com/aa65535/openwrt-dist-luci

repository: mysqto/openwrt

repo_name: mysqto/openwrt


text:
# Logger Code Review
Scott Bellware
Thu Mar 12 2015

## Tests
- The tests aren't functional
- Align the tests with the current implementation

## SimpleLogger
- This is more of an elaborate product name that a class named for its concern
- This is a logger that writes using `puts`
- `PutsLogger` is inappropriate because `puts` is an informal shortcut for `STDOUT`
- Should be `STDERRLogger`
- However, diagnostics *should not* be written to stdout. They should be written to `STDERR`.
- So, this should be `STDERRLogger`
- However, we already know that due to a mistake in Vert.x that we need to write to `STDOUT`
- At best, this is a `ConsoleLogger`
- This is reinforced by the existing hints in the existing (now deactivated) design.
- It should continue to be switchable between STDERR and STDOUT based on the existing (now deactivated) mechanism of the CONSOLE_DEVICE environment variable, eg: CONSOLE_DEVICE=stdout
- Implementation should include a ConsoleLogger::Defaults.device that returns the STDERR object
- `SimpleLogger` will be referred to as `ConsoleLogger` for the rest of this document

## ConsoleLogger File System Location
- The `logger.rb` file is not the host of the logger. It's the implementation of the outer `Logger` module.
- The `ConsoleLogger` should be in its own file rather than appropriating the `logger.rb` file, which is of a different concern.

## Attributes
- The `level` and `name` attributes are not likely attr_accessors
- They are initializer arguments, which indicates that they are attr_reader attributes

## LEVELS
- The levels are not a constant
- The levels should be implemented as a method
- They are subject to change before the end of time
- Constants are for things that are not ever nor ever will be subject to change due to design or requirements changes, eg: Pi or Avogadro's Number
- Constants harm testability when used inappropriately as constants should never be overridden for the purposes of proving failure paths
- Methods are more readily replaced for the purposes of testing
- There is almost nothing in a business application that is in fact a constant
- Most uses of constants are de facto design mistakes unless modeling something that is a universal, timeless "constant"

## Logic in the Initializer
- The initializer should only be executed when all of the data is ready
- The data isn't ready at the time of construction
- That's known because the initializer executes `@name = name_for(subject)` and `@level = LEVELS.index(level)`
- Don't derive values in an initializer. Only capture values in an initializer. The only exception is setting an optional argument to a primitive value.
- The `@name = name_for(subject)` is factory method logic, eg: A `build` method
- The `@level = LEVELS.index(level)` is also factory method logic

## Assigning the default
- The default level shouldn't be assigned in `get`, which is a method that invokes construction, but is not itself a construction concern
- Once the logic is out of the initializer, the assignment of the default will find a more natural home that will likely reflect instances of this pattern throughout the system.

## Logger#register
- This method really doesn't make sense anymore unless the loggers are recorded inside the Logger namespace, and re-used rather than reconstructed
- This isn't an issue of small object creation, but rather an issue of the code standing on its own and making sense in and of itself
- This should either be made to work as designed, or removed, but not left as the kind of vestigial organ that promotes permissiveness in code rot.

## Line Format
- The line format changed in the replacement of TwP's Logging::Logger with the current emergency stop-gap implementation
- The line format that was lost in the rapid-response implementation is:
[{time}] {class name | string name} {level.upcase}: {message}

## Logger Name
- The logger name is the class name of the subject if the subject is a class
- Otherwise, the logger name is assumed to be a string

## Logger#configure
- This is a long-standing design flaw in the Logger interface that predates recent changes, but the `subject` and `receiver` parameter order should be inverted

## Null Object
- The construction of the null logger no longer makes sense for its design
- Both the null logger and the logger itself should be based off of a common interface
- That interface should have just the level writer methods
- The interface should be implemented as a module, where the methods delegate to the device (or ideally, a writer)
- The module should be used as the basis for the null object
- The null object should not have the explicit definitions of the level writer methods within it
- Those definitions are there only because the Logging::Logger was created dynamically
- I.e.: The current implementation of the null object is coupled to a library that is no longer in use, and won't be used in the future. This leaves behind more questions than it answers, and leaves ambiguity that following contributors will need to clear (or at least, they should) before proceeding with any work.

repository: evt-archive/telemetry-logger

repo_name: evt-archive/telemetry-logger


text:
# ubuntu-xenial-dev
> The only repository you need to setup your local development machine from scratch, reproducible!

* [I want that too](#i-want-that-too)
* [I want to add a command or program to the default setup](#i-want-to-add-a-command-or-program-to-the-default-setup)

## I want that too
### 1. Prerequisites
Not so much:
* Git (Host, obviously) or other means to download the content of this repo.
* Vagrant (Host)
* VirtualBox (Host)
### 2. Installation
Run `vagrant up`. That should be it.
If anything fails or you changed the configuration or playbooks, run `vagrant up --provision`.
Et voilà: VirtualBox opens the GUI with a login window and after a short moment, you're good to go.
> Password? You should really try vagrant 😉
#### What does it do?
> In a nutshell: Taking the configuration from the `Vagrantfile`, spinning up a virtual machine, installing ansible, running the playbook on the virtual machine against the virtual machine, installing updates and some important compilers/developer tools.

### 3. Customization
* Change Keyboard Layout
* Change your password (Hint: `passwd` is your friend)
* [Setup Git(hub) access](https://help.github.com/articles/connecting-to-github-with-ssh/)
* [Open additional ports](https://www.vagrantup.com/docs/networking/forwarded_ports.html)
### 4. Usage
You can spin the machine up with VirtualBox (with GUI) or `vagrant resume` if you suspended your machine.
Consequently, you may interact with the machine via GUI or login via ssh with `vagrant ssh`
### 5. How to remove all of it?
`vagrant destroy` and confirm. Be very sure about this.

## I want to add a command or program to the default setup
You are always installing something else after spinning up the box and wonder how to include this?
**Go no further**: Open a new issue, implement it on your own and open a PR, fork the repository, basically, [whatever you feel like](LICENSE.md).
Just make sure to not commit any secret keys and keep the project reproducible!

license: Unlicense

repository: tommartensen/ubuntu-bionic-dev

repo_name: tommartensen/ubuntu-bionic-dev


text:
# Running the app
Load it from Expo [here](https://expo.io/@natelowry/volunteer-one).

# Getting Started
1. Clone the repo
2. `cd volunteer-one`
3. `yarn start`
4. run Expo on your device

repository: natelowry/volunteerone-mobile

branch_name: refs/heads/main

gha_language: TypeScript

gha_license_id: Unlicense

repo_name: natelowry/volunteerone-mobile


text:
### [CVE-2020-13945](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13945)
![](https://img.shields.io/static/v1?label=Product&message=Apache%20APISIX&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Admin%20API%20default%20access%20token%20vulnerability&color=brighgreen)

### Description

In Apache APISIX, the user enabled the Admin API and deleted the Admin API access IP restriction rules. Eventually, the default token is allowed to access APISIX management data. This affects versions 1.2, 1.3, 1.4, 1.5.

### POC

#### Reference
- http://packetstormsecurity.com/files/166228/Apache-APISIX-Remote-Code-Execution.html

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/ARPSyndicate/kenzer-templates
- https://github.com/CLincat/vulcat
- https://github.com/Threekiii/Vulhub-Reproduce
- https://github.com/YutuSec/Apisix_Crack
- https://github.com/Z0fhack/Goby_POC
- https://github.com/bigblackhat/oFx
- https://github.com/openx-org/BLEN
- https://github.com/t0m4too/t0m4to

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# S-Tool

![S-tool](https://user-images.githubusercontent.com/33047641/125023819-41998700-e09d-11eb-8076-7fad81f98f70.png)

## Selenium wrapper to make your life easy

![python](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python)
![selemium](https://img.shields.io/badge/Selenium-e5dfde?style=for-the-badge&logo=selenium)
![s-tool](https://img.shields.io/badge/S-Tool-3776AB?style=for-the-badge)
![Python-World](https://img.shields.io/badge/Python-World-FFD43B?style=for-the-badge&logo=python&logoColor=white)

## Table of Contents

- [Key Features](#key-features)
- [How To Use](#how-to-use)
- [Examples](#examples)
- [Todo](#todo)
- [License](#license)

## Key Features

- WebDriver
  - Manage multiple web drivers such as chrome,chromium,firefox.
- Different Utilities
  - Retrieve elements with 5 different attributes.
  - Perform clicks on element.
  - Take a full page and element screenshot.
  - Hide and show elements.
  - Information filling on different form elements such as text,radio,checkbox.
  - Retrieves current cookies from the browser.
  - Injecting new cookies into browser.
  - Retrieve url and web page source.
  - Add or modify existing cookies.
  - Retrieve current user agent.
  - Check Existence of an element on the page.
  - Execute JavaScript statment.
- Element Parser
  - table Information.
  - Retrieve dropdown options in the dictionary.

## How To Use

### Install using PYPI

```bash
pip install s-tool
```

### Setup for development

To clone and run this application, you'll need [Git](https://git-scm.com) and
[Poetry](https://python-poetry.org/) and [python Version ^3.8](http://python.org/)

```bash
# Clone this repository
git clone https://github.com/Python-World/s-tool.git

# Go into the repository
cd s-tool

# Install dependencies
poetry config virtualenvs.in-project true
poetry install

# Start Poetry shell
poetry shell
```

Note: If you're doing development setup, [see this guide](CONTRIBUTING)

## Examples

### Example 1

```python
"""Example code with class"""

from s_tool.driver import SeleniumDriver

class SBot(SeleniumDriver):
   """Example Bot using s-tool"""

   def __init__(self, *args, **kwargs):
       super().__init__(*args, **kwargs)

   def run(self):
       self.get("https://google.com")
       sessionid = self.session()
       url = self.url()
       cookies = self.cookies()

       # print sessionid,url,cookies
       print(f"\n url     :   {url} \n session :   {sessionid}\n cookies :   {cookies}\n")

bot = SBot("firefox", headless=True)  # change headless=False to run with gui mode
bot.run()
bot.close()

```

### Example 2

```python
"""Example code with context manager"""

from s_tool.driver import SeleniumDriver as SBot

with SBot("firefox", headless=True) as obj:
   obj.get("https://google.com")
   sessionid = obj.session()
   url = obj.url()
   cookies = obj.cookies()

   # print sessionid,url,cookies
   print(f"\n url     :   {url} \n session :   {sessionid}\n cookies :   {cookies}\n")

```

## Todo

- Web driver utilities
  - Scrolling element and page.
  - Handling popup and alert boxes.
  - Switching windows,frames,tabs,iframes.
  - logger.
- Element Parser
  - list
  - radio and checkboxes

Note: If you have any idea to improve or optimized in better way
[create issue](https://github.com/Python-World/s-tool/issues/new) for discussion.

## License

[MIT](LICENSE)

repository: garora/s-tool

repo_name: garora/s-tool


text:
# pinboard
A total Google-Keep ripoff that i made for practice. You will be able
to create notes and reminders. No libraries or frameworks were used.
Ripping off popular website is actually pretty fun and id recommend anyone
wanting to practice some webdesign to do the same. Might also be useful
to learn a new UI framework or something.

Its up on netlify. Netlify is great btw, totally free and you can deploy from github.

Copy to clipboard
[![Netlify Status](https://api.netlify.com/api/v1/badges/ad357cbe-9286-483c-8516-9cf89b7b443b/deploy-status)](https://app.netlify.com/sites/pinboard/deploys)

repository: mclrc/pinboard

repo_name: mclrc/pinboard


text:
---
name: Feature request
about: Suggest an idea for this project
---

# Feature request

## Overview

A clear and concise description of what the feature or problem addresses.

Include:

- Solution you want
- Alternatives you have considered

## Tasks

- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

## Screenshots & Diagrams

Add any screenshots or diagrams here to help with implementation.

## Additional context

Add any other context.

## Implementation notes

This section will be used by the assigned developer for any additional notes.


text:
---
layout: page
permalink: /traces/index.html
title: Traces
---

#### S3D Traces ####

This page describes how to download and interpret several traces
that we have captured of the Legion implementation of S3D running
on [Titan](https://www.olcf.ornl.gov/titan/). Each trace contains
both the start-up and execution of four time steps. Traces are
captured at the Realm interface on which the Legion runtime is
built. We will detail the types of Realm operations and their
corresponding logging calls in [Realm Event Logging](#eventlogging).

### Downloading Traces ###

Below are the current set of traces that we have been captured. Each
trace is a separate run and comes in a tar ball. The size of the tar
balls is given on the URLs. When unpacked some of the tar balls will
expand to several GBs of data.

All the traces share a common naming convention: mechanism name
followed by mapping strategy followed by node count. The chemical
mechansim is either DME or Heptane.  DME is the smaller mechanism
containing only 30 species while Heptane is the larger mechnaism
with 52 species. The mapping strategy is listed as either `all` or
`mixed`. The `all` mapping strategy is used to place the majority
of the computation on the GPU (hence all-GPU), while the `mixed`
mapping strategy is designed to mix work evenly between CPUs and
GPUs. Finally, the node count says how many nodes where used as
part of the run.

  * [DME - ALL - 2 Nodes](/s3dtraces/dme_all_2nodes.tar.gz) (5.1 MB)
  * [DME - MIXED - 2 Nodes](/s3dtraces/dme_mixed_2nodes.tar.gz) (16 MB)
  * [DME - ALL - 4 Nodes](/s3dtraces/dme_all_4nodes.tar.gz) (11 MB)
  * [DME - MIXED - 4 Nodes](/s3dtraces/dme_mixed_4nodes.tar.gz) (32 MB)
  * [DME - ALL - 32 Nodes](/s3dtraces/dme_all_32nodes.tar.gz) (85 MB)
  * [DME - MIXED - 32 Nodes](/s3dtraces/dme_mixed_32nodes.tar.gz) (255 MB)
  * [Heptane - ALL - 32 Nodes](/s3dtraces/hept_all_32nodes.tar.gz) (98 MB)
  * [Heptane - MIXED - 32 Nodes](/s3dtraces/hept_mixed_32nodes.tar.gz) (175 MB)

###  Realm Event Logging ###

Traces are captured at the Realm interface inside the Legion runtime.
Realm is the low-level component of the Legion runtime. Its design and
architecture are laid out in [this paper](/pdfs/realm2014.pdf) which we
assume as prior knowledge for the description of the logging calls. The
benefit of capturing traces at the Realm level is that we can easily see
the low-level structure of an application in terms of its most basic
operations (e.g. tasks, data movement, and synchronization) without
needing to understand any of the high-level Legion semantics. Furthermore,
these traces can easily be replayed on different machine architectures
as operations and data movement can mapped and executed in any order that
is consistent with the generated event graph. This makes Realm traces
particularly attractive when considering the design of future architectures.

Each trace below is composed of a collection of files. Each file contains
logging calls for each of the different Realm operations invoked on a
different node. While the files contain operations that are local to a
node, the handles and operations are not required to remain local to a
node. For example, a task registered on one node, may end being run on
a different node depending on the processor that it was directed to.
Similarly an event created on one node, may serve as the precondition to
an operation launched on a different node. As we describe in the Realm
paper, we guarantee that all handles are globally unique with each handle
refering to exactly one globally unique thing.

There are 14 logging calls which can appear in the log files. Each logging
call is proceeded with an human readable name which can be used to parse
each logging call unambiguously using a top-down LL parsing algorithm.

 1. Record the existence of a given processor: Processor: %1 %2
    1. Processor ID
    2. Processor Kind (CPU, GPU, Utility)

 2. Record a processor group based on a set of processors: Group: %1 %2 %3 %4 ...
    1. Processor Group ID
    2. Number of contained processors
    3. First Processor ID
    4. Second Processor ID
    ... the given number of contained processors in the group

 3. Record the existence of a given memory: Memory: %1 %2
    1. Memory ID
    2. Processor Kind (GASNet, System, Registered, Socket, Zero-Copy, Framebuffer)

 4. Record a task lauch: Task Request: %1 %2 (%3,%4) (%5,%6) (%7,%8) %9 %10 %11
    1. Function ID for the task to run
    2. Target processor for task
    3. ID of the termination event
    4. Generation of the termination event
    5. ID of the precondition event
    6. Generation of the precondition event
    7. ID of the termination event for the enclosing task
    8. Generation of the termination event for the enclosing task
    9. Priority for the task
    10. Pointer for the arguments
    11. Argument length in bytes

 5. Record the time taken to execute the task: Task Time: (%1,%2) %3
    1. ID of the termination event for the task
    2. Generation of the termination event for the task
    3. Execution time in microseconds

 6. Record when a task waits for an event internally: Task Wait: (%1,%2) (%3,%4) %5
    1. ID of the termination event for the task
    2. Generation of the termination event for the task
    3. ID of the event being waited on
    4. Generation of the event being waited on
    5. Time spent waiting on an event

 7. Record the beginning of event merge: Event Merge: (%1,%2) %3
    1. ID of the merged event
    2. Generation of the merged event
    3. Number of precondition events

 8. Record an event precondition for a merged event: Event Precondition (%1,%2) (%3,%4)
    1. ID of the merged event
    2. Generation of the merged event
    3. ID of the precondition event
    4. Generation of the precondition event

 9. Record an event trigger operation: Event Trigger: (%1,%2) (%3,%4) (%5,%6)
    1. ID of the triggered event
    2. Generation of the triggered event
    3. ID of the precondition event
    4. Generation of the precondition event
    5. ID of the termination event for the enclosing task
    6. Generation of the termination event for the enclosing task

 10. Record the creation of a phase barrier: Barrier Creation: %1 %2
     1. ID of the barrier
     2. Initial expected number of arrivals for all generations

 11. Record an alteration of the expected barrier arrival count: Barrier Alter: (%1,%2) (%3,%4) %5
     1. ID of the barrier
     2. Generation of the barrier
     3. ID of the termination event for the enclosing task
     4. Generation of the termination event for the enclosing task
     5. Delta by which to alter the expected arrival count

 12. Record an arrival on a phase barrier Barrier Arrive: (%1,%2) (%3,%4) (%5,%6) %7
     1. ID of the barrier
     2. Generation of the barrier
     3. ID of the precondition event
     4. Generation of the precondition event
     5. ID of the termination event for the enclosing task
     6. Generation of the termination event for the enclosing task
     7. Arrival count

 13. Record the a copy request between physical regions: Copy Request: (%1,%2) (%3,%4) (%5,%6) %7 %8
     1. ID of the copy termination event
     2. Generation of the copy termination event
     3. ID of the precondition event
     4. Generation of the precondition event
     5. ID of the termination event for the enclosing task
     6. Generation of the termination event for the enclosing task
     7. Source Memory
     8. Destination Memory

 14. Record the total size of a copy in bytes: Copy Size: (%1,%2) %3
     1. ID of the copy termination event
     2. Generation of the copy termination event
     3. Total bytes transfered


text:
# Framework Template

This repository contains a script to generate a new iOS framework. The output framework contains source code, unit test code, and an example project.

## To create a new framework

Clone this repo and open a Terminal window in the resulting directory. Run the following command:

```
$ bin/start_new_project.rb OUTPUT_PATH
```

The script will prompt you for concrete values to substitute into the sample project when copying. Once finished, run the following:

```
$ cd OUTPUT_PATH
$ open .
```

Open the `xcodeproj` file, then build and run the example project.

## To edit the framework template

The template is located in `src/__PRODUCT_NAME__`. This is an ordinary Xcode project that you should be able to build and run.

Note that the project uses certain symbols that are expanded by the Ruby script when copying the project. These are:

* `__PRODUCT_NAME__` is the name of the framework product
* `__ORGANIZATION_NAME__` is the name of the organization (e.g., `Rocket Insights, Inc.`)
* `__ORGANIZATION_ID__` is the bundle identifier prefix (e.g., `com.rocketinsights`)
* `__DATE__` is the date that the script is run, in YYYY-MM-DD format
* `__YEAR__` is the four-digit year

After modifying the template, you should generate a new framework using the Ruby script to verify if compiles and runs.

repository: RocketLaunchpad/FrameworkTemplate

gha_language: Swift

repo_name: RocketLaunchpad/FrameworkTemplate


text:
UO Rust Libs
==========

[![Build Status](https://travis-ci.org/AngryLawyer/uo-rust-libs.svg?branch=master)](https://travis-ci.org/AngryLawyer/uo-rust-libs)

Rust libraries for reading Ultima Online data files. This is still pre-1.0, and has yet to be thoroughly tested, and the API WILL likely change several times before then, so use at your own peril.

This has been tested on a fresh install of Ultima Online: Age of Shadows - I am not sure if more modern clients will work with it, although older clients should. Let me know!

[Documentation](http://angrylawyer.github.io/uo-rust-libs/uorustlibs/)

repository: AngryLawyer/uo-rust-libs

gha_language: Rust

repo_name: AngryLawyer/uo-rust-libs


text:
---
name: PSScriptAnalyzer bug report 🚦
about: PSScriptAnalyzer bugs are tracked in a separate GitHub repo.

---

* Please submit PSScriptAnalyzer issues to the
  [PSScriptAnalyzer](https://github.com/powershell/PSScriptAnalyzer/issues) repo on GitHub.

repository: AzureMentor/vscode-powershell

repo_name: AzureMentor/vscode-powershell


text:
---
layout: post
title:  Reading list 2021
category: Reading
description: 2020 proven to be one of the hardest year in the decade, therefore for 2021, I had picked something that will hopfully help myself to cope with the adversity.
---
![](https://yycglory.github.io/blog/images/reading-list-2021.jpg)

Reading list for past year: [2020](../reading-list-2020/),[2019](../Reading-list-2019/), [2018](../Reading-list-2018/)

## [*Maybe you should talk to someone*](https://yycglory.github.io/blog/Maybe-you-should-talk-to-someone/) by Lori Gottlieb

## *A ride of a life time* by Robert Iger

## *Discourses of Epictetus*
- Suggested by PewDiePie

## *Letters from a Stoic*

List of books to revisit:

## *Meditation* by Marcus Aurelius
Old stable, as a reminder, in some way as a life compress and clear mind under uncertainty. A book to revisit every year.

## *Atomic habbit* by James Clear

## *Ultra learning* by Scott Young

## *Why we sleep* by Matthew Walker

repository: yycglory/blog

repo_name: yycglory/blog


text:
---
title: Can I install persistent memory and a GPU in my system?
layout: doc
categories: [faq]
tags: [persistent memory, pmem, gpu]
author: Steve Scargall
docid: 100000003
creation_date: 2020-03-11
modified_date: 2020-03-11
---

# Applies To

- Intel® Optane™ Persistent Memory
- NVDIMM-N
- GPU

# Answer

It is recommended to seek advice from the server OEM/ODM directly. While it is possible to support GPUs and persistent memory in the same system, several factors need to be considered which include, but are not limited to the following:

- Server size (1U, 2U, 4U, etc)
- Power Supplies
- Internal and external cooling functions - Air cooled, liquid cooled, or hybrid
- The type and quantity of persistent memory modules or devices within the system with their power & thermal requirements
- The make and model of the GPU with its power and cooling requirements

repository: pmem/knowledge-base

gha_language: CSS

repo_name: pmem/knowledge-base


text:
# RonteLtdPushBundle
Provide functions to send push notifications.

Features include:

- Send single notification
- Send notifications on background
- Send bulk notifications

**Note:** For now supports only APNS.

## Install

### Composer
```sh
composer require ronte-ltd/push-bundle
```

## Init

### AppKernel.php
```php
new RonteLtd\PushBundle\RonteLtdPushBundle(),
```

### config.yml
```yaml
ronte_ltd_push:
    push_env: "%push_env%"
    push_sound: true // bool
    push_expiry: 12000 // message expiry, int value in seconds
    bg_worker_id: "%bg_worker_id%"
    gearman_server: "%gearman_server%"
    gearman_port: "%gearman_port%"
```

### parameters.yml
```yaml
push_env: "valid values: 'prod', 'dev'"
gearman_server: "Add gearman server here"
gearman_port: "Add gearman port here"
bg_worker_id: test //This will be a prefix for a background function in case multiple projects on a server using this command.
```

### Certificates
    Puth APNS sertificates files to 'var/apns' folder

## Use

### Send single notification
```php
/**
 * @param string $deviceId - recipient device token
 * @param string $text - text message
 * @param array $payload - payload array
 */
 $payload = [
     'project' => $id,    // int|string name or id of an app, required
     'pushType' => $type, // int type, required
     'badge' => null,     // int|null, optional
     'headers' => [],     // array of headers, optional
     'extra' => [],       // additional info array, optional
 ];

 $credentials = [
     'certificate' => $fullPathToCertificate, // required
     'passPhrase' => $passPhrase,
     'certificationAuthorityFile' => $fullPathToCertificationAuthorityFile,
 ];
$container->get('push.pusher')->send($deviceId, $text, $payload, $creadentials);
```

###Send notifications on background
Run ``push:worker:run`` command on background.
```php
$payload = [
     'project' => $id,    // int|string name or id of an app, required
     'pushType' => $type, // int type, required
     'badge' => null,     // int|null, optional
     'headers' => [],     // array of headers, optional
     'extra' => [],       // additional info array, optional
 ];

$credentials = [
  'certificate' => $fullPathToCertificate, // required
  'passPhrase' => $passPhrase,
  'certificationAuthorityFile' => $fullPathToCertificationAuthorityFile,
];

$pusher = $container->get('push.pusher');
$pusher->addPush($deviceId, $text, $payload, , $creadentials);
```

###Send bulk notifications
```php
$payload = [
     'project' => $id,    // int|string name or id of an app, required
     'pushType' => $type, // int type, required
     'badge' => null,     // int|null, optional
     'headers' => [],     // array of headers, optional
     'extra' => [],       // additional info array, optional
 ];
$pusher = $container->get('push.apns');
$pusher->addMessage(
    $pusher->createMessage($deviceId, $text, $payload)
);
// Use addMessage as much as needed

$credentials = [
  'certificate' => $fullPathToCertificate, // required
  'passPhrase' => $passPhrase,
  'certificationAuthorityFile' => $fullPathToCertificationAuthorityFile,
];

$pusher->runQueue($credentials);

repository: ronte-ltd/PushBundle

repo_name: ronte-ltd/PushBundle


text:
---
layout: page
title: Prereqs
feature-img: ""
tags: [Beginners, Start, Prereqs, Prerequisite, Skills, Stats, Statistics, Math]
---

# Prerequisite Skills

Data science at it's core is mostly applied statistics and mathematics. In order to properly use and interpret a lot of code and output you'll need some background in statistics and probability. Calculus and linear algebra are helpful too. A background in computer science or programming is helpful but not essential, though you will need basic familiarity with file storage, installing programs, etc.

If you have never taken a statistics class before (or if it's been a while), fear not! The internet is full of helpful guides and resources to get you started.

If you would like to take courses organized into a logical path, the [Open Source Society University's Data Science program](https://github.com/ossu/data-science) is a great resource.

## Statistics and Probability Theory

[MIT: Intro to Probability](https://ocw.mit.edu/resources/res-6-012-introduction-to-probability-spring-2018/)

[Udemy: Workshop in Probability and Statistics](https://www.udemy.com/statshelp/)

[EdX: Intro Statistics with R](https://courses.edx.org/courses/course-v1:HarvardX+PH525.1x+2T2018/course/) - Learn introductory R alongside statistics

[EdX: Statistical Thinking for Data Science and Analytics](https://www.edx.org/course/statistical-thinking-for-data-science-and-analytics)

[EdX: Probability and Statistics in Data Science using Python](https://www.edx.org/course/probability-and-statistics-in-data-science-using-python-0)

[MIT: Probabilistic Systems Analysis and Applied Probability](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-041sc-probabilistic-systems-analysis-and-applied-probability-fall-2013/)

[MIT: Statistics for Applications](https://ocw.mit.edu/courses/mathematics/18-650-statistics-for-applications-fall-2016/index.htm)

## Linear Algebra

[EdX: Linear Algebra - Foundations to Frontiers](https://www.edx.org/course/linear-algebra-foundations-to-frontiers-0)

[MIT: Linear Algebra](https://ocw.mit.edu/courses/mathematics/18-06sc-linear-algebra-fall-2011/)

## Other Mathematics
[MIT: Mathematics for Computer Science](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-spring-2015/)

## Computational Thinking and Theoretical Data Science

[MIT: Introduction to Computer Science and Programming in Python](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/index.htm)
[EdX: Same Course](https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python-0)

[MIT: Intro to Computational Thinking and Data Science](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0002-introduction-to-computational-thinking-and-data-science-fall-2016/index.htm)
[EdX: Same Course](https://www.edx.org/course/introduction-computational-thinking-data-mitx-6-00-2x-7)


text:
This control is different from the built-in [GridView](/docs/controls/builtin/GridView/{branch}) and is not derived from it.

The *Business Pack* `GridView` control is a advanced grid control with many features.

The *version 1.1* supports the following features (except of the features supported in the built-in GridView):

* Inline Insert row
* Column Hiding
* Column Reordering
* Column Resizing
* Row Reordering

The following features are planned to be added in the following releases:

* Customizable Filters
* Grouping
* Row Detail

repository: symbiogenesis/dotvvm-docs

repo_name: symbiogenesis/dotvvm-docs


text:
# ngraph.forcelayout

[![build status](https://github.com/anvaka/ngraph.forcelayout/actions/workflows/tests.yaml/badge.svg)](https://github.com/anvaka/ngraph.forcelayout/actions/workflows/tests.yaml)

This is a [force directed](http://en.wikipedia.org/wiki/Force-directed_graph_drawing) graph layout algorithm,
that works in any dimension (2D, 3D, and above).

The library uses quad tree to speed up computation of long-distance forces.

This repository is part of [ngraph family](https://github.com/anvaka/ngraph), and operates on
[`ngraph.graph`](https://github.com/anvaka/ngraph.graph) data structure.

# API

All force directed algorithms are iterative. We need to perform multiple iterations of an algorithm,
before graph starts looking good:

``` js
// graph is an instance of `ngraph.graph` object.
var createLayout = require('ngraph.forcelayout');
var layout = createLayout(graph);
for (var i = 0; i < ITERATIONS_COUNT; ++i) {
  layout.step();
}

// now we can ask layout where each node/link is best positioned:
graph.forEachNode(function(node) {
  console.log(layout.getNodePosition(node.id));
  // Node position is pair of x,y coordinates:
  // {x: ... , y: ... }
});

graph.forEachLink(function(link) {
  console.log(layout.getLinkPosition(link.id));
  // link position is a pair of two positions:
  // {
  //   from: {x: ..., y: ...},
  //   to: {x: ..., y: ...}
  // }
});
```

If you'd like to perform graph layout in space with more than two dimensions, just add one
argument to this line:

``` js
let layout = createLayout(graph, {dimensions: 3}); // 3D layout
let nodePosition = layout.getNodePosition(nodeId); // has {x, y, z} attributes
```

Even higher dimensions are not a problem for this library:

``` js
let layout = createLayout(graph, {dimensions: 6}); // 6D layout
// Every layout with more than 3 dimensions, say N, gets additional attributes:
// c4, c5, ... cN
let nodePosition = layout.getNodePosition(nodeId); // has {x, y, z, c4, c5, c6}
```

Note: Higher dimensionality comes at exponential cost of memory for every added
dimension. See a performance section below for more details.

## Node position and object reuse

Recently immutability became a ruling principle of javascript world. This library
doesn't follow the rules, and results of `getNodePosition()`/`getLinkPosition()` will be
always the same for the same node. This is true:

``` js
layout.getNodePosition(1) === layout.getNodePosition(1);
```

Reason for this is performance. If you are interested in storing positions
somewhere else, you can do it and they still will be updated after each force
directed layout iteration.

## "Pin" node and initial position

Sometimes it's desirable to tell layout algorithm not to move certain nodes.
This can be done with `pinNode()` method:

``` js
var nodeToPin = graph.getNode(nodeId);
layout.pinNode(nodeToPin, true); // now layout will not move this node
```

If you want to check whether node is pinned or not you can use `isNodePinned()`
method. Here is an example how to toggle node pinning, without knowing it's
original state:

``` js
var node = graph.getNode(nodeId);
layout.pinNode(node, !layout.isNodePinned(node)); // toggle it
```

What if you still want to move your node according to some external factor (e.g.
you have initial positions, or user drags pinned node)? To do this, call
`setNodePosition()` method:

``` js
layout.setNodePosition(nodeId, x, y);
```

## Monitoring changes

Like many other algorithms in `ngraph` family, force layout monitors graph changes
via [graph events](https://github.com/anvaka/ngraph.graph#listening-to-events).
It keeps layout up to date whenever graph changes:

``` js
var graph = require('ngraph.graph')(); // empty graph
var layout = require('ngraph.layout')(graph); // layout of empty graph

graph.addLink(1, 2); // create node 1 and 2, and make link between them
layout.getNodePosition(1); // returns position.
```

If you want to stop monitoring graph events, call `dispose()` method:

``` js
layout.dispose();
```

## Physics Simulator

Simulator calculates forces acting on each body and then deduces their position via Newton's law.
There are three major forces in the system:

1. Spring force keeps connected nodes together via [Hooke's law](http://en.wikipedia.org/wiki/Hooke's_law)
2. Each body repels each other via [Coulomb's law](http://en.wikipedia.org/wiki/Coulomb's_law)
3. The drag force slows the entire simulation down, helping with convergence.

Body forces are calculated in `n*lg(n)` time with help of Barnes-Hut algorithm implemented with quadtree.

``` js
// Configure
var physicsSettings = {
  timeStep: 0.5,
  dimensions: 2,
  gravity: -12,
  theta: 0.8,
  springLength: 10,
  springCoefficient: 0.8,
  dragCoefficient: 0.9,
};

// pass it as second argument to layout:
var layout = require('ngraph.forcelayout')(graph, physicsSettings);
```

You can get current physics simulator from layout by checking `layout.simulator`
property. This is a read only property.

## Space occupied by graph

Finally, it's often desirable to know how much space does our graph occupy. To
quickly get bounding box use `getGraphRect()` method:

``` js
var rect = layout.getGraphRect();
// rect.min_x, rect.min_y - left top coordinates of the bounding box
// rect.max_x, rect.max_y - right bottom coordinates of the bounding box
```

## Manipulating bodies

This is advanced technique to get to internal state of the simulator. If you need
to get a node position use regular `layout.getNodePosition(nodeId)` described
above.

In some cases you really need to manipulate physic attributes on a body level.
To get to a single body by node id:

``` js
var graph = createGraph();
graph.addLink(1, 2);

// Get body that represents node 1:
var body = layout.getBody(1);
assert(
  typeof body.pos.x === 'number' &&
  typeof body.pos.y === 'number', 'Body has position');
assert(body.mass, 'Body has mass');
```

To iterate over all bodies at once:

``` js
layout.forEachBody(function(body, nodeId) {
  assert(
    typeof body.pos.x === 'number' &&
    typeof body.pos.y === 'number', 'Body has position');
  assert(graph.getNode(nodeId), 'NodeId is coming from the graph');
});
```

# Section about performance

This library is focused on performance of physical simulation. We use quad tree data structure
in 2D space to approximate long distance forces, and reduce amount of required computations.

When layout is performed in higher dimensions we use analogues tree data structure. By design
such tree requires to store `2^dimensions_count` child nodes on each node. In practice, performing
layout in 6 dimensional space on a graph with a few thousand nodes yields decent performance
on modern mac book (graph can be both rendered and layed out at 60FPS rate).

Additionally, the vector algebra is optimized by a ad-hoc code generation. Essentially this means
that upon first load of the library, we check the dimension of the space where you want to perform
layout, and generate all required data structure to run fast in this space.

The code generation happens only once when dimension is requested. Any subsequent layouts in the same
space would reuse generated codes. It is pretty fast and cool.

# install

With [npm](https://npmjs.org) do:

```
npm install ngraph.forcelayout
```

Or download from CDN:

``` html
<script<EMAIL_ADDRESS>```

If you download from CDN the library will be available under `ngraphCreateLayout` global name.

# license

MIT

# Feedback?

I'd totally love it! Please email me, open issue here, [tweet](https://twitter.com/anvaka) to me,
or join discussion [on gitter](https://gitter.im/anvaka/VivaGraphJS).

If you love this library, please consider sponsoring it at https://github.com/sponsors/anvaka or at
https://www.patreon.com/anvaka

gha_language: JavaScript


text:
# exhaustMap

#### signature: `exhaustMap(project: function, resultSelector: function): Observable`

## Map to inner observable, ignore other values until that observable completes.

[![Ultimate RxJS](https://drive.google.com/uc?export=view&id=1qq2-q-eVe-F_-d0eSvTyqaGRjpfLDdJz 'Ultimate RxJS')](https://ultimatecourses.com/courses/rxjs?ref=4)

### Examples

##### Example 1: exhaustMap with interval

(
[Stackblitz](https://stackblitz.com/edit/typescript-3qydhn?file=index.ts&devtoolsheight=100)
| [jsBin](http://jsbin.com/woposeqobo/1/edit?js,console) |
[jsFiddle](https://jsfiddle.net/btroncone/9ovzapp9/) )

```js
// RxJS v6+
import { interval, merge, of } from 'rxjs';
import { delay, take, exhaustMap } from 'rxjs/operators';

const sourceInterval = interval(1000);
const delayedInterval = sourceInterval.pipe(delay(10), take(4));

const exhaustSub = merge(
  // delay 10ms, then start interval emitting 4 values
  delayedInterval,
  // emit immediately
  of(true)
)
  .pipe(exhaustMap(_ => sourceInterval.pipe(take(5))))
  /*
   *  The first emitted value (of(true)) will be mapped
   *  to an interval observable emitting 1 value every
   *  second, completing after 5.
   *  Because the emissions from the delayed interval
   *  fall while this observable is still active they will be ignored.
   *
   *  Contrast this with concatMap which would queue,
   *  switchMap which would switch to a new inner observable each emission,
   *  and mergeMap which would maintain a new subscription for each emitted value.
   */
  // output: 0, 1, 2, 3, 4
  .subscribe(val => console.log(val));
```

##### Example 2: Another exhaustMap with interval

(
[Stackblitz](https://stackblitz.com/edit/typescript-vxussb?file=index.ts&devtoolsheight=100)
| [jsBin](http://jsbin.com/fizuduzuti/1/edit?js,console) |
[jsFiddle](https://jsfiddle.net/btroncone/5ck8yg5k/3/) )

```js
// RxJS v6+
import { interval } from 'rxjs';
import { exhaustMap, tap, take } from 'rxjs/operators';

const firstInterval = interval(1000).pipe(take(10));
const secondInterval = interval(1000).pipe(take(2));

const exhaustSub = firstInterval
  .pipe(
    exhaustMap(f => {
      console.log(`Emission Corrected of first interval: ${f}`);
      return secondInterval;
    })
  )
  /*
                When we subscribed to the first interval, it starts to emit a values (starting 0).
                This value is mapped to the second interval which then begins to emit (starting 0).
                While the second interval is active, values from the first interval are ignored.
                We can see this when firstInterval emits number 3,6, and so on...

                  Output:
                  Emission of first interval: 0
                  0
                  1
                  Emission of first interval: 3
                  0
                  1
                  Emission of first interval: 6
                  0
                  1
                  Emission of first interval: 9
                  0
                  1
              */
  .subscribe(s => console.log(s));
```

### Related Recipes

- [Swipe To Refresh](/recipes/swipe-to-refresh.md)

### Outside Examples

##### `exhaustMap` for login effect in [@ngrx example app](https://github.com/ngrx/platform/tree/a9e522953832b09bb329bac4524637bc608c450a/example-app)

(
[Source](https://github.com/ngrx/platform/blob/a9e522953832b09bb329bac4524637bc608c450a/example-app/app/auth/effects/auth.effects.ts#L18-L30)
)

```js
@Effect()
  login$ = this.actions$.pipe(
    ofType(AuthActionTypes.Login),
    map((action: Login) => action.payload),
    exhaustMap((auth: Authenticate) =>
      this.authService
        .login(auth)
        .pipe(
          map(user => new LoginSuccess({ user })),
          catchError(error => of(new LoginFailure(error)))
        )
    )
  );
```

### Additional Resources

- [exhaustMap](https://rxjs.dev/api/operators/exhaustMap) 📰 - Official docs
- [exhaustMap](https://indepth.dev/reference/rxjs/operators/exhaust-map) - In Depth Dev Reference

---

> 📁 Source Code:
> [https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/exhaustMap.ts](https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/exhaustMap.ts)

repository: btroncone/learn-rxjs

repo_name: btroncone/learn-rxjs


text:
With this 4.x release topic levels have been refactored for consistency using the following general format
```
ring/<location_id>/<ring_category>/<device_id>/<device_type>/state
ring/<location_id>/<ring_category>/<device_id>/<device_type>/command
```

The <ring_category> is either "alarm", "smart_lighting", "camera", or "chime" based on the type of device.  Cameras are doorbells, stickup, spotlight or floodlight cams.  Alarm devices are any devices connected via the Alarm base station and smart_lighting is any device connected via the smart lighting bridge.

The script monitors hub based devices (alarm and smart lighting) via the websocket connection, and uses the automatical 20 second polling to keep a heartbeat for polled devices (cameras and chimes), automatically updating the online/offline state of the devices based on this connectivity information.  As this is device level connectivity is published to "status" at the device_id level:
```
ring/<location_id>/<product_category>/<device_id>/status
```

Each device also inlcudes an "info" sensor where the state topic includes various supplemental data for the device in JSON format.  This information varies by devies and includes data such as battery level, tamper status, communicaton state, volume, wifi signal strength, and other device specific data.

For the individual device capabilities the state and command topics are simple text strings (not JSON), which use the default values for the equivalent Home Assistant device integration.  Some sensors may have multiple attribues, such as a multi-level-switch as both on/off and brightness, so they will have a standard state/command topic and an additional topic in the format of <attribute>_state and <attribute>_topic.  Below is a listing of all currently supported devices and topics.

Alarm Control Panel (virtual device):
```
ring/<location_id>/alarm/<device_id>/alarm/state     <-- Alarm arming state
                                                         - disarmed
                                                         - armed_home
                                                         - armed_away
                                                         - arming  (Exit delay)
                                                         - pending (Entry delay)
                                                         - triggered (device is in alarm state
                                                           Specific alarm type (fire/police) can be determined from panic switches (if enabled)
                                                           or from alarmState attribute in Info sensor
ring/<location_id>/alarm/<device_id>/alarm/command   <-- Set alarm mode (disarm/arm_home/arm_away)
ring/<location_id>/alarm/<device_id>/bypass/state    <-- Get arming bypass mode
ring/<location_id>/alarm/<device_id>/bypass/command  <-- Set arming bypass mode (When 'ON' arming will
                                                         automatically bypass any faulted contact sensors)
ring/<location_id>/alarm/<device_id>/siren/state     <-- Get Siren ON/OFF
ring/<location_id>/alarm/<device_id>/siren/command   <-- Set Siren ON/OFF
ring/<location_id>/alarm/<device_id>/police/state    <-- Get Polich Panic ON/OFF
ring/<location_id>/alarm/<device_id>/police/command  <-- Set Police Panic ON/OFF
ring/<location_id>/alarm/<device_id>/fire/state      <-- Get Fire Panic ON/OFF
ring/<location_id>/alarm/<device_id>/fire/command    <-- Set Fire Panic ON/OFF
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Alarm Base Station:
```
ring/<location_id>/alarm/<device_id>/volume/state    <-- Get Volume (0-100)
ring/<location_id>/alarm/<device_id>/volume/command  <-- Set Volume (0-100)
                                                         Volume control requires master account, shared accounts do not have permission to control base station volume (same as Ring app)
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Ring Keypad:
```
ring/<location_id>/alarm/<device_id>/volume/state    <-- Get Volume (0-100)
ring/<location_id>/alarm/<device_id>/volume/command  <-- Set Volume (0-100)
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Motion Sensor:
```
ring/<location_id>/alarm/<device_id>/motion/state     <-- ON = Motion Detected
ring/<location_id>/alarm/<device_id>/info/state       <-- Device info sensor
```

Contact Sensor:
```
ring/<location_id>/alarm/<device_id>/contact/state    <-- ON = Contact Open
ring/<location_id>/alarm/<device_id>/info/state       <-- Device info sensor
```

Retrofit Zone:
```
ring/<location_id>/alarm/<device_id>/zone/state      <-- ON = Zone Tripped
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

```
Tilt Sensor:
ring/<location_id>/alarm/<device_id>/zone/state      <-- ON = Tilt Detected
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

```
Temperature Sensor:
ring/<location_id>/alarm/<device_id>/temperature/state  <-- Temperature in celcius
ring/<location_id>/alarm/<device_id>/info/state         <-- Device info sensor
```

Smoke Detector/Alarm:
```
ring/<location_id>/alarm/<device_id>/smoke/state     <-- ON = Smoke Detected
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

CO Detector/Alarm:
```
ring/<location_id>/alarm/<device_id>/co/state        <-- ON = CO Detected
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Ring Smoke/CO Listener:
```
ring/<location_id>/alarm/<device_id>/smoke/state     <-- ON = Smoke Detected
ring/<location_id>/alarm/<device_id>/co/state        <-- ON = CO Detected
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Ring Flood/Freeze Sensor:
```
ring/<location_id>/alarm/<device_id>/flood/state     <-- ON = Flood Detected
ring/<location_id>/alarm/<device_id>/freeze/state    <-- ON = Freeze Detected
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Switch:
```
ring/<location_id>/alarm/<device_id>/switch/state    <-- Get ON/OFF state
ring/<location_id>/alarm/<device_id>/switch/command  <-- Set ON/OF state
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Dimmer Switch:
```
ring/<location_id>/alarm/<device_id>/light/state               <-- Get ON/OFF state
ring/<location_id>/alarm/<device_id>/light/command             <-- Set ON/OF state
ring/<location_id>/alarm/<device_id>/light/brightness_state    <-- Get brightness state (0-100)
ring/<location_id>/alarm/<device_id>/light/brightness_command  <-- Set brightness state (0-100)
```

Fan Switch:
```
ring/<location_id>/alarm/<device_id>/fan/state                 <-- Get ON/OFF state
ring/<location_id>/alarm/<device_id>/fan/command               <-- Set ON/OF state
ring/<location_id>/alarm/<device_id>/fan/speed_state           <-- Get fan preset speed
                                                                   - low (<=33%)
                                                                   - medium (>=34% && <=67%)
                                                                   - high (>=68%)
ring/<location_id>/alarm/<device_id>/fan/speed_command         <-- Set fan preset speed
                                                                   - low (33%)
                                                                   - medium (67%)
                                                                   - high (100%)
ring/<location_id>/alarm/<device_id>/fan/percent_speed_state   <-- Get fan speed in percent (10-100%)
ring/<location_id>/alarm/<device_id>/fan/percent_speed_command <-- Set fan speed in percent (10-100%)
ring/<location_id>/alarm/<device_id>/info/state                <-- Device info sensor
```

Locks:
```
ring/<location_id>/alarm/<device_id>/lock/state      <-- Get LOCKED/UNLOCKED state
ring/<location_id>/alarm/<device_id>/lock/command    <-- Set LOCK/UNLOCK state
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Ring Outdoor Siren:
```
ring/<location_id>/alarm/<device_id>/siren/state     <-- ON = Siren Activated
ring/<location_id>/alarm/<device_id>/info/state      <-- Device info sensor
```

Thermostat:
```
ring/<location_id>/alarm/<device_id>/thermostat/mode_state               <-- Current operating mode
                                                                             - off
                                                                             - cool
                                                                             - heat
ring/<location_id>/alarm/<device_id>/thermostat/mode_command             <-- Set operating mode
ring/<location_id>/alarm/<device_id>/thermostat/action_state             <-- Current action
                                                                             - off
                                                                             - idle
                                                                             - cooling
                                                                             - heating
                                                                             - fan
ring/<location_id>/alarm/<device_id>/thermostat/temerature_state         <-- Current target temperature °C
ring/<location_id>/alarm/<device_id>/thermostat/temerature_state         <-- Set target temperature °C
ring/<location_id>/alarm/<device_id>/thermostat/current_temerature_state <-- Current temperature °C
ring/<location_id>/alarm/<device_id>/thermostat/fan_mode_state           <-- Current fan operating mode
                                                                             Exact modes vary with different thermostat devices, common modes are
                                                                             - Auto
                                                                             - On
                                                                             - Circulate
ring/<location_id>/alarm/<device_id>/thermostat/fan_mode_command         <-- Set fan operating mode
ring/<location_id>/alarm/<device_id>/thermostat/aux_state                <-- ON = Aux heat mode enabled
ring/<location_id>/alarm/<device_id>/thermostat/aux_command              <-- Set aux heat mode
ring/<location_id>/alarm/<device_id>/info/state                          <-- Device info sensor
```

Cameras (available topics vary based by device capabilities):
```
ring/<location_id>/camera/<device_id>/ding/state                <-- ON = Doorbell Ding Detected
ring/<location_id>/camera/<device_id>/ding/attributes           <-- Last ding time
ring/<location_id>/camera/<device_id>/motion/state              <-- ON = Motion Detected
ring/<location_id>/camera/<device_id>/motion/attributes         <-- Last motion time,
                                                                    person detect, motion detect enabled
ring/<location_id>/camera/<device_id>/light/state               <-- Get Light ON/OFF
ring/<location_id>/camera/<device_id>/light/command             <-- Set Light ON/OFF
ring/<location_id>/camera/<device_id>/siren/state               <-- Get Siren ON/OFF
ring/<location_id>/camera/<device_id>/siren/command             <-- Set Siren ON/OFF
ring/<location_id>/camera/<device_id>/info/state                <-- Device info sensor
ring/<location_id>/camera/<device_id>/snapshot/image            <-- Snapshot images (JPEG binary data)
ring/<location_id>/camera/<device_id>/snapshot/attributes       <-- JSON attributes for image (timestamp)
ring/<location_id>/camera/<device_id>/snapshot_interval/state   <-- Get snapshot refresh interval
ring/<location_id>/camera/<device_id>/snapshot_interval/command <-- Set snapshot refresh interval (10-604800)
ring/<location_id>/camera/<device_id>/stream/state              <-- Get live stream ON/OFF
ring/<location_id>/camera/<device_id>/stream/command            <-- Set live stream ON/OFF
ring/<location_id>/camera/<device_id>/stream/attributes         <-- Detailed live stream state:
                                                                    - inactive
                                                                    - activating
                                                                    - active
                                                                    - failed
ring/<location_id>/camera/<device_id>/event_stream/state        <-- Get event stream ON/OFF
ring/<location_id>/camera/<device_id>/event_stream/command      <-- Commands ignored for event stream
ring/<location_id>/camera/<device_id>/event_stream/attributes   <-- Detailed event stream state:
                                                                    - inactive
                                                                    - activating
                                                                    - active
                                                                    - failed
ring/<location_id>/camera/<device_id>/event_select/state        <-- Get selected event stream
ring/<location_id>/camera/<device_id>/event_select/command      <-- Set selected event stream
                                                                    - Motion 1-5
                                                                    - On-demand 1-5
                                                                    - Ding 1-5 (Doorbells only)
                                                                    1 = most recent event
                                                                    2 = 2nd most recent event
                                                                    3 = 3rd most recent event
                                                                    4 = 4th most recent event
                                                                    5 = 5th most recent event
```

```
Chime (available topics vary based by device capabilities):
ring/<location_id>/chime/<device_id>/volume/state              <-- Get Volume (0-11)
ring/<location_id>/chime/<device_id>/volume/command            <-- Set Volume (0-11)
ring/<location_id>/chime/<device_id>/snooze/state              <-- Get snooze state
ring/<location_id>/chime/<device_id>/snooze/command            <-- Set snooze state (ON = snooze)
ring/<location_id>/chime/<device_id>/snooze_minutes/state      <-- Get current minutes to snooze (1-1440)
ring/<location_id>/chime/<device_id>/snooze_minutes/command    <-- Set minutes to snooze (1-1440)
                                                                   Must be set prior to enabling snooze
ring/<location_id>/chime/<device_id>/play_ding_sound/state     <-- ON = Ding chime is playing
ring/<location_id>/chime/<device_id>/play_ding_sound/command   <-- Set ON = Play ding chime
ring/<location_id>/chime/<device_id>/play_motion_sound/state   <-- ON = Motion chime is playing
ring/<location_id>/chime/<device_id>/play_motion_sound/command <-- Set ON = Play motion chime
ring/<location_id>/chime/<device_id>/info/state                <-- Device info sensor
```

Ring Smart Lighting (available topics vary by device capabilities)
```
ring/<location_id>/lighting/<device_id>/motion/state              <-- ON = Motion Detected
ring/<location_id>/lighting/<device_id>/light/state               <-- Get Light ON/OFF
ring/<location_id>/lighting/<device_id>/light/command             <-- Set Light ON/OFF
ring/<location_id>/lighting/<device_id>/light/brightness_state    <-- Get brightness (0-100)
ring/<location_id>/lighting/<device_id>/light/brightness_command  <-- Set brightness (0-100)
ring/<location_id>/lighting/<device_id>/light/duration_state      <-- Get light duration (0-32767)
ring/<location_id>/lighting/<device_id>/light/duration_command    <-- Set light duraiton (0-32757)
ring/<location_id>/lighting/<device_id>/info/state                <-- Device info sensor
```

Modes Control Panel (virtual alarm control panel for setting Ring location modes for
locations with Ring cameras but not Ring alarm):
```
ring/<location_id>/alarm/<device_id>/mode/state      <-- Get location mode: ("disarmed", "armed_home", "armed_away")
ring/<location_id>/alarm/<device_id>/mode/command    <-- Set location mode: ("disarm", "arm_home", "arm_away")
```

repository: david-grey/ring-mqtt

repo_name: david-grey/ring-mqtt


text:
Categorical Encoding Methods
============================

A set of toy problems examining different encoding methods for categorical variables for the purpose of classification.

Encoding Methods
----------------

 * Ordinal
 * One-Hot
 * Binary
 * Helmert Contrast
 * Sum Contrast
 * Polynomial Contrast
 * Backward Difference Contrast

Datasets
--------

The datasets used in these examples are car, mushroom, and splice datasets from the UCI dataset repository, found here:

[datasets](https://archive.ics.uci.edu/ml/datasets)

License
-------

BSD


text:
---
layout: paper
title: "Bud23 promotes the progression of the Small Subunit Processome to the pre-40S ribosome in Saccharomyces cerevisiae"
year: "2020"
shortref: "Black <i>et al.</i> 2020"
nickname: bud23-ssu-processome
journal: "bioRxiv"
volume:
issue:
pages:
authors: "Joshua J Black, Richa Sardana, Ezzeddine W Elmir, Arlen W Johnson"
image: /assets/images/papers/default-paper.svg
redirect_from:
fulltext: https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>6237v1.abstract
pdflink:
github:
pmid:
pmcid:
f1000:
doi: "10.1101/2<IP_ADDRESS>6237"
dryad_doi:
figshare_doi:
altmetric_id:
category: paper
# Note: 'published' is a Jekyll keyword and does not refer to whether the paper is published, but rather to whether this Markdown should be part of the rendered site.
published: true
preprint: true
embargo: false
peerreview: false
review: false
tags: [yeast, Bud23, ribosome biogenesis, SSU processome, Dhr1]
---
{% include JB/setup %}

# Abstract

The Small Subunit Processome is a metastable complex that is thought to represent an early checkpoint in the ribosomal small subunit (SSU) assembly pathway. Progression of the SSU Processome towards a mature state involves dynamic rearrangements of RNAs and proteins, but what drives this progression is not known. Previous studies have suggested that the methyltransferase Bud23 acts during SSU Processome progression. Here, we carried out a comprehensive genetic screen that identified bypass suppressors of bud23Δ and link Bud23 to a network of physical interactions that stabilize the SSU Processome. Moreover, two of these factors, the RNA helicase Dhr1 and the EF-Tu-like GTPase Bms1, are thought to facilitate crucial structural rearrangements. We propose a model in which Bud23 binding to the 3’-domain promotes the release of factors surrounding its binding site to drive rearrangements during the progression of the SSU Processome.


text:
# pactman

Python version of Pact mocking, generation and verification.

Enables [consumer driven contract testing], providing unit test mocking of provider services
and DSL for the consumer project, and interaction playback and verification for the service
provider project. Currently supports versions 1.1, 2 and 3 of the [Pact specification].

For more information about what Pact is, and how it can help you
test your code more efficiently, check out the [Pact documentation].

Contains code originally from the [pact-python](https://github.com/pact-foundation/pact-python) project.

pactman is maintained by the [ReeceTech](https://www.reecetech.com.au/) team as part of their toolkit to
keep their large (and growing) microservices architecture under control.

## pactman vs pact-python

The key difference is all functionality is implemented in Python, rather than shelling out or forking
to the ruby implementation. This allows for a much nicer mocking user experience (it mocks urllib3
directly), is faster, less messy configuration (multiple providers means multiple ruby processes spawned
on different ports).

It also supports a broader set of the pact specification (versions 1.1 through to 3).

The pact verifier has been engineered from the start to talk to a pact broker (both to discover pacts
and to return verification results).

There’s a few other quality of life improvements, but those are the big ones.

# How to use pactman

## Installation

`pactman` requires Python 3.6 to run.

```
pip install pactman
```

## Writing a Pact
Creating a complete contract is a two step process:

1. Create a test on the consumer side that declares the expectations it has of the provider
2. Create a provider state that allows the contract to pass when replayed against the provider

## Writing the Consumer Test

If we have a method that communicates with one of our external services, which we'll call
`Provider`, and our product, `Consumer` is hitting an endpoint on `Provider` at
`/users/<user>` to get information about a particular user.

If the code to fetch a user looked like this:

```python
import requests

def get_user(user_name):
    response = requests.get(f'http://service.example/users/{user_name}')
    return response.json()
```

Then `Consumer`'s contract test might look something like this:

```python
import atexit
import unittest

from pactman import Consumer, Provider

pact = Consumer('Consumer').has_pact_with(Provider('Provider'))
pact.start_mocking()
atexit.register(pact.stop_mocking)

class GetUserInfoContract(unittest.TestCase):
  def test_get_user(self):
    expected = {
      'username': 'UserA',
      'id': 123,
      'groups': ['Editors']
    }

    pact.given(
        'UserA exists and is not an administrator'
    ).upon_receiving(
        'a request for UserA'
    ).with_request(
        'GET', '/users/UserA'
    ) .will_respond_with(200, body=expected)

    with pact:
      result = get_user('UserA')

    self.assertEqual(result, expected)

```

This does a few important things:

 - Defines the Consumer and Provider objects that describe our product and our service under test
 - Uses `given` to define the setup criteria for the Provider `UserA exists and is not an administrator`
 - Defines what the request that is expected to be made by the consumer will contain
 - Defines how the server is expected to respond

Using the Pact object as a [context manager], we call our method under test
which will then communicate with the Pact mock service. The mock service will respond with
the items we defined, allowing us to assert that the method processed the response and
returned the expected value. If you want more control over when the mock service is
configured and the interactions verified, use the `setup` and `verify` methods, respectively:

```python
    pact.given(
        'UserA exists and is not an administrator'
    ).upon_receiving(
        'a request for UserA'
    ).with_request(
        'GET', '/users/UserA'
    ) .will_respond_with(200, body=expected)

    pact.setup()
    try:
        # Some additional steps before running the code under test
        result = get_user('UserA')
        # Some additional steps before verifying all interactions have occurred
    finally:
        pact.verify()
```

### Requests

When defining the expected HTTP request that your code is expected to make you
can specify the method, path, body, headers, and query:

```python
pact.with_request(
    method='GET',
    path='/api/v1/my-resources/',
    query={'search': 'example'}
)
```

`query` is used to specify URL query parameters, so the above example expects
a request made to `/api/v1/my-resources/?search=example`.

```python
pact.with_request(
    method='POST',
    path='/api/v1/my-resources/123',
    body={'user_ids': [1, 2, 3]},
    headers={'Content-Type': 'application/json'},
)
```

You can define exact values for your expected request like the examples above,
or you can use the matchers defined later to assist in handling values that are
variable.

### Some important has_pact_with options

The `has_pact_with(provider...)` call has quite a few options documented in its API, but a couple are
worth mentioning in particular:

`version` declares the pact specification version that the provider supports. This defaults to "2.0.0", but "3.0.0"
is also acceptable if your provider supports [Pact specification version 3]:

```python
from pactman import Consumer, Provider
pact = Consumer('Consumer').has_pact_with(Provider('Provider'), version='3.0.0')
```

`use_mocking_server` defaults to `False` and controls the mocking method used by `pactman`. The default is to
patch `urllib3`, which is the library underpinning `requests` and is also used by some other projects. If you
are using a different library to make your HTTP requests which does not use `urllib3` underneath then you will need
to set the `use_mocking_server` argument to `True`. This causes `pactman` to run an actual HTTP server to mock the
requests (the server is listening on `pact.uri` - use that to redirect your HTTP requests to the mock server.) You
may also set the `USE_MOCKING_SERVER` environment variable to "yes" to force your entire suite to use the server
approach.

```python
from pactman import Consumer, Provider
pact = Consumer('Consumer').has_pact_with(Provider('Provider'), use_mocking_server=True)
```

## Expecting Variable Content
The above test works great if that user information is always static, but what happens if
the user has a last updated field that is set to the current time every time the object is
modified? To handle variable data and make your tests more robust, there are 3 helpful matchers:

### Term(matcher, generate)
Asserts the value should match the given regular expression. You could use this
to expect a timestamp with a particular format in the request or response where
you know you need a particular format, but are unconcerned about the exact date:

```python
from pactman import Term
...
body = {
    'username': 'UserA',
    'last_modified': Term('\d+-\d+-\d+T\d+:\d+:\d+', '2016-12-15T20:16:01')
}

(pact
 .given('UserA exists and is not an administrator')
 .upon_receiving('a request for UserA')
 .with_request('get', '/users/UserA/info')
 .will_respond_with(200, body=body))
```

When you run the tests for the consumer, the mock service will return the value you provided
as `generate`, in this case `2016-12-15T20:16:01`. When the contract is verified on the
provider, the regex will be used to search the response from the real provider service
and the test will be considered successful if the regex finds a match in the response.

### Like(matcher)
Asserts the element's type matches the matcher. For example:

```python
from pactman import Like
Like(123)  # Matches if the value is an integer
Like('hello world')  # Matches if the value is a string
Like(3.14)  # Matches if the value is a float
```
The argument supplied to `Like` will be what the mock service responds with.

When a dictionary is used as an argument for Like, all the child objects (and their child objects etc.) will be matched according to their types, unless you use a more specific matcher like a Term.

```python
from pactman import Like, Term
Like({
    'username': Term('[a-zA-Z]+', 'username'),
    'id': 123, # integer
    'confirmed': False, # boolean
    'address': { # dictionary
        'street': '200 Bourke St' # string
    }
})

```

### EachLike(matcher, minimum=1)
Asserts the value is an array type that consists of elements
like the one passed in. It can be used to assert simple arrays:

```python
from pactman import EachLike
EachLike(1)  # All items are integers
EachLike('hello')  # All items are strings
```

Or other matchers can be nested inside to assert more complex objects:

```python
from pactman import EachLike, Term
EachLike({
    'username': Term('[a-zA-Z]+', 'username'),
    'id': 123,
    'groups': EachLike('administrators')
})
```

> Note, you do not need to specify everything that will be returned from the Provider in a
> JSON response, any extra data that is received will be ignored and the tests will still pass.

For more information see [Matching](https://docs.pact.io/documentation/matching.html)

## Verifying Pacts Against a Service
Run `pactman-verifier -h` to see the options available. To run all pacts registered to a provider in a [Pact Broker]:

    pactman-verifier -b http://pact-broker.example/ <provider name> <provider url> <provider setup url>

You may also specify the broker URL in the environment variable `PACT_BROKER_URL`.

You can pass in a local pact file with `-l`, this will verify the service against the local file instead of the broker:

    pactman-verifier -l /tmp/localpact.json <provider name> <provider url> <provider setup url>

### Provider States
In many cases, your contracts will need very specific data to exist on the provider
to pass successfully. If you are fetching a user profile, that user needs to exist,
if querying a list of records, one or more records needs to exist. To support
decoupling the testing of the consumer and provider, Pact offers the idea of provider
states to communicate from the consumer what data should exist on the provider.

When setting up the testing of a provider you will also need to setup the management of
these provider states. The Pact verifier does this by making additional HTTP requests to
the `<provider setup url>` you provide. This URL could be
on the provider application or a separate one. Some strategies for managing state include:

- Having endpoints in your application that are not active in production that create and delete your datastore state
- A separate application that has access to the same datastore to create and delete,
  like a separate App Engine module or Docker container pointing to the same datastore
- A standalone application that can start and stop the other server with different datastore states

For more information about provider states, refer to the [Pact documentation] on [Provider States].

# Development
Please read [CONTRIBUTING.md](CONTRIBUTING.md)

To setup a development environment:

1. Clone the repository `https://github.com/reecetech/pactman` and invoke `git submodule update --init`
2. Install Python 3.6 from source or using a tool like [pyenv]
3. Its recommended to create a Python [virtualenv] for the project

To run tests, use:
`tox`

To package the application, run:
`python setup.py sdist`

This creates a `dist/pactman-N.N.N.tar.gz` file, where the Ns are the current version.
From there you can use pip to install it:
`pip install ./dist/pactman-N.N.N.tar.gz`

## Release History

1.2.0

- Corrected use of format_path in command line error handling.
- Tweaked README for clarity.

1.1.0

- Renamed the `pact-verifier` command to `pactman-verifier` to avoid
  confusion with other pre-existing packages that provide a command-line
  incompatible `pact-verifier` command.
- Support verification of HEAD requests (oops).

1.0.8

- Corrected project URL in project metadata (thanks Jonathan Moss)
- Fix verbose output

1.0.7

- Added some Trove classifiers to aid potential users.

1.0.6

- Corrected mis-named command-line option.

1.0.5

- Corrected some packaging issues

1.0.4

- Initial release of pactman, including ReeceTech's pact-verifier version 3.17 and pact-python version 0.17.0

[consumer driven contract testing]: https://2018.pycon-au.org/talks/44811-pact-in-python/
[context manager]: https://en.wikibooks.org/wiki/Python_Programming/Context_Managers
[Pact]: https://www.gitbook.com/book/pact-foundation/pact/details
[Pact Broker]: https://docs.pact.io/documentation/sharings_pacts.html
[Pact documentation]: https://docs.pact.io/
[Pact Mock Service]: https://github.com/bethesque/pact-mock_service
[Pact specification]: https://github.com/pact-foundation/pact-specification
[Pact specification version 3]: https://github.com/pact-foundation/pact-specification/tree/version-3
[Provider States]: https://docs.pact.io/documentation/provider_states.html
[pact-provider-verifier]: https://github.com/pact-foundation/pact-provider-verifier
[pyenv]: https://github.com/pyenv/pyenv
[virtualenv]: http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/

repository: RobbieClarken/pactman

repo_name: RobbieClarken/pactman


text:
---

date: 2020-07-10T09:19:09-07:00
title: The Archives

---

I've pulled the early game's records from the dusty confines of an old postgres database and (for now) that unintegrated information can be found here.

The middle game was not recorded, but I have at least the major plot points of how we got to where we are in my head, and at least one of the players has taken some notes.

Maybe I'll convert the big block of archives into backdated posts. Maybe I'll create some content for The Betweentimes.

Maybe.

-----

**Warning: Don't trust any of the links within these dark, forgotten halls!** Though separated into dated posts, the content of The Archives is still just the raw output of a SQL query, and the links were created for a different website and different file structure.

repository: tlake/static-site

repo_name: tlake/static-site


text:
# Create a vagrant-based LAMP stack system from a Windows machine

### Creating the box

1. Install [Git Bash for Windows](https://gitforwindows.org/) and go through the Setup Wizard.
2. If you already have [Oracle VM Virtual Box](https://www.virtualbox.org) installed, proceed to step 3; if not, download and install it.
3. Download the [VirtualBox Oracle VM VirtualBox Extension Pack](https://www.virtualbox.org/wiki/Downloads)

Install by navigating to File>Preferences>Extensions. Click the green plus button (on the right) and add the Extension Pack you just downloaded.
4. Download and install [Vagrant](https://www.vagrantup.com/downloads) and restart your system.

Confirm Vagrant is installed by typing
`vagrant --version`

5. From Git Bash, make a directory named Vagrant, change directories into it, make another directory named trusty64, and change directories into trusty64
```
mkdir Vagrant
cd Vagrant
mkdir trusty64
cd trusty64
```
6. Navigate to [Vagrant Cloud](https://app.vagrantup.com/boxes/search) and click on [ubuntu/trusty64](https://app.vagrantup.com/ubuntu/boxes/trusty64)

Choose “New” (the right tab)
7. In your Git Bash, either copy and paste or type in the first line:

```
vagrant init ubuntu/trusty64
```
The return should read:

"A ‘Vagrantfile' has been placed in this directory.  Please read the comments in the Vagrantfile as well as documentation on 'vagrantup.com' for more information on using Vagrant."

8. In your Git Bash enter:
```
vagrant up
```
9. Your virtual machine should start running, which you will be able to observe within your VirtualBox interface. To open the console, click the green “Show” arrow at the top of the VirtualBox interface.
10. In your virtual machine console, login with the following credentials:

```
Login: vagrant
Password: vagrant
```
(password entry will be hidden)

11. Install and update apt:
```
sudo apt-get install
sudo apt-get update
```
12. We will now install Apache2, MySQL Server, and PHP 5
```sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
```
Choose a new password when prompted, and then continue with the following commands:

```
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
```
go through the setup process, and then continue with the following commands:

```
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo apt-get install php5-cgi php5-cli php5-curl php5-common php5-gd php5-mysql
sudo service apache2 restart
```
13. From here, you can change directories into /etc to confirm all programs have been installed
14. Now, we’ll make the box as small as possible in preparation for publication to Vagrant cloud. From your GitBash, run the following commands:
```
sudo apt-get clean
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
cat /dev/null > ~/.bash_history && history -c && exit
```
15. Next, we’ll repackage the box. From GitBash, run:
```
vagrant package --output examplename.box
```
16. Now we can delete and remove the file we built our box from. From GitBash, run:
```
vagrant destroy
rm Vagrantfile
```
17. Next, add your new box into your vagrant install:
```
vagrant box add examplenamebox examplename.box
```
18. Initialize a vagrant environment from our newly created box and spin it up:
```
vagrant init examplenamebox
vagrant up
```
If your vagrant box is having trouble connecting, you can click the green “Show” in Oracle VM and - within the console - enter the letter “s”

19. Publish the box on [Vagrant Cloud](https://app.vagrantup.com/)!

Once you’ve established a Vagrant Cloud account, from GitBash:

```
vagrant cloud auth login
```
enter your credentials

`vagrant cloud publish` ORGANIZATION/BOX-NAME VERSION PROVIDER-NAME [PROVIDER-FILE]

Example:

```
vagrant cloud publish CourtHans/courtbox 1.0 virtualbox ~/Vagrant/trusty64/chans.box -d “My first vagrant box” --version-description “First iteration” --release --short-description “Download me!”
```
You’ll get confirmation in your terminal, and can see and access the box from Vagrant Cloud.

### Pulling the box onto another machine

1. Repeat above steps 1-4 as necessary.
2. Make a directory to pull your vagrant box into and reference your [Vagrant Cloud](https://app.vagrantup.com/) instance while going through step 7 (`vagrant init` ... )
3. `vagrant up` to get into your vagrant box
4. Again, click on the green “Show” arrow in Oracle VM to open the console, if necessary, and enter “s” to complete the connection.
5. You can navigate to the /etc folder to confirm all your downloads are present.

![Success](images/vagrant_box.png)


text:
# Changelog

## [3.1.0](https://pypi.org/project/directory_ch_client/3.1.0/) (2023-05-23)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/17)
### Implemented enhancements
- KLS-622 - Upgrade Django to 4.2.0

## [3.0.2](https://pypi.org/project/directory_ch_client/3.0.2/) (2023-02-16)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/14/files)
### Implemented enhancements
- KLS-397 - Upgrade Django to less than 4.0.0

## [3.0.1](https://pypi.org/project/directory_ch_client/3.0.1/) (2022-10-26)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/13/files)

### Implemented enhancements
- KLS-110 - Upgrade to Django 3.2.16

## [3.0.0](https://pypi.org/project/directory_ch_client/3.0.0/) (2022-09-07)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/12/files)

### Implemented enhancements
- GLS-412 - Upgrade for Django 3.2

## [2.2.0](https://pypi.org/project/directory_ch_client/2.2.0/) (2019-07-18)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/11/files)

### Implemented enhancements
- GLS-313 - codecov patch

## [2.1.0](https://pypi.org/project/directory_ch_client/2.1.0/) (2019-07-18)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/10/files)

### Implemented enhancements
- Support Django 1.11.22 through 2.x

## [2.0.1](https://pypi.org/project/directory_ch_client/2.0.1/) (2019-07-04)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/9/files)

### Implemented enhancements
- No ticket - Can now import the instantiated client as `from directory_ch_client import ch_search_api_client`
- No ticket - Remove `version.py`

### Bugs fixed
- No ticket - Upgrade vulnerable django version to django 1.11.22

## [2.0.0](https://pypi.org/project/directory_ch_client/2.0.0/) (2019-04-23)
[Full Changelog](https://github.com/uktrade/directory-companies-house-search-client/pull/8/files)

### Implemented enhancements

- Upgraded directory client core to reduce overzealous logging from the fallback cache.
- Improved documentation in readme.
- The client responses are now subclasses of `request.Response`.
- README.md now renders nicely in PyPi.

### Breaking changes

- Directory client core has been upgraded a major version 5.0.0. [See](https://github.com/uktrade/directory-client-core/pull/16)
- Dropped support for Python 3.5
- The client responses dropped the `raw_response` property. The attributes of `raw_response` are now available on the client responses.