text:
🕹 Help you connect and organize fun time and play with friends 🕹

## 💻 About the Project

📱🕹 This application was created to help you connect and organize fun time and play with friends. Create groups to play your favorite games with your friends and that has Discord authentication. 🕹📱

GamePlay allows you to **SignIn** authenticating with Discord. You can schedule a game and invite your friend by sharing a **link**. In order to invite people you need to be a server owner. So, you need create your own server on Discord. It has **SignIn** and **SignOut** functionalities.

Application built on the React Native track from Next Level Week NLW#06 from @rocketseat during June 20-24, 2021.

![cover](.github/cover.png?style=flat)

## 🛠 Features

- [x] `OAuth2 Social Authentication` with Discord server
- [x] Gets user registration profile in `Discord` (username and avatar)
- [x] Lists the `Discord servers` that the user is part of
- [x] Allows you to schedule matches
- [x] Allows you to filter matches by category
- [x] Displays if the match was scheduled on its own server **host** or on other servers **guest**
- [x] Share the invitation to join the user's server
- [x] Allows you to redirect the user to your own server
- [x] Provides the `Logout` function

## 🚀 Requirements

- [React Native](https://reactnative.dev/)
- [TypeScript](https://www.typescriptlang.org/)
- [Expo](https://docs.expo.dev/)

## ✨ Technologies

- [Context API](https://reactjs.org/docs/context.html)
- [Async Storage](https://reactnative.dev/docs/asyncstorage)
- [Vector Icons](https://docs.expo.dev/guides/icons/)
- [React Native Svg](https://github.com/react-native-svg/react-native-svg) & [Svg Transform](https://github.com/kristerkari/react-native-svg-transformer)
- [Axios](https://axios-http.com/docs/intro)
- [Gradient colors](https://github.com/react-native-linear-gradient/react-native-linear-gradient)
- [OAuth2 Discord](https://discord.com/developers/docs/topics/oauth2)
- [Expo Google Fonts](https://docs.expo.dev/guides/using-custom-fonts/)
- [React Navigation Stack](https://reactnavigation.org/docs/stack-navigator/)
- [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/docs/)
- [Expo Authentication/Auth Session](https://docs.expo.dev/versions/latest/sdk/auth-session/)
- [React Native Share](https://docs.expo.dev/versions/latest/react-native/share/)
- [Deep Link](https://reactnavigation.org/docs/deep-linking/)

## 🎨 Layout

You can view the project layout through [this link](https://www.figma.com/file/0kv33XYjvOgvKGKHBaiR07/GamePlay-NLW-Together?node-id=58913%3A83). You must have an account on [Figma](http://figma.com/) to access it.

## ✅ Getting started

Use **yarn** or **npm install** to install project dependencies. Then start the project.

```bash
# Clone this repository
$ gh repo clone sestevao/gameplay

# install dependencies
$ yarn install

# start the application
$ expo start

# Set the .env file to your App settings (remove the example from the .env.example file)
REDIRECT_URI=
SCOPE=
RESPONSE_TYPE=token
CLIENT_ID=
CDN_IMAGE=
```

Remember to create your App on the Discord server to get the authentication credentials. Then define your App settings in the **.env** file (remove the example from the .env.example file).

## 🔥 Additional functionalities

- Improved the **SignOut** functionality by implementing a Modal with Buttons ✅
- Toasts
- Delete match
- Empty list component ✅
- Customize Animated **Loading**
- Show game banner in server details
- Validate Date and Time
  - valid date
  - valid time
  - date and time in the future
- Logout modal
- Animations in Toasts

## 📄 Licence

This project is under the MIT license. See the [LICENSE](LICENSE.md) file for more details.

---

made with 💜 by sestevao

repository: sestevao/gameplay

repo_name: sestevao/gameplay


text:
# Downloading and Preprocessing Gutenberg Books
## Downloading the Data

Pretending you’re a search indexer and hitting the `robots` endpoint will allow you to not get rate limited by Cloudflare. `harvest` is perfect for getting everything else.

```
wget -m -H -nd "http://www.gutenberg.org/robot/harvest?filetypes[]=txt&langs[]=en"
```

The above will take 2-3 hours to run depending on your connection. The result will be `~11 GB`, but this may change over time as books are added/removed.

### Removing and Unzipping

Remove some extra garbage:

```
rm harvest*
rm robots.txt
```

Remove duplicate encodings of books:

```
ls | grep "\-0.zip" | xargs rm
ls | grep "\-8.zip" | xargs rm
```

Remove some other weird nonsense (which have non-standard formatting):

```
rm 89-Contents.zip
rm 89-AnnexI.zip
rm 10681-body.zip
rm 5192-tex.zip
rm 10681-index.zip
rm 15824-h.zip
rm 3290-u.zip
rm 13526-page-inames.zip
rm 18251-mac.zip
rm 89-Descriptions.zip
```

A super broken book:

```
rm -rf 12hgp10a.*
```

Unzip:

```
unzip "*.zip"
rm "*.zip"
```

## Preparing Raw Files

Move text files out from nested directories (some have this):

```
mv */*.txt ./
```

A straggler:

```
mv ./10376/10376.TXT ./10376.txt
```

### Removing Cruft

Unzipping also adds media/random other stuff. Delete it, along with empty directories (or anything that’s not a `txt` file):

```
ls | grep -v "\.txt" | xargs rm -rf
```

As of December 17, 2019, the resulting data is `14 GB` and has `37445` texts.

## Removing Headers

The following creates a `[book_id].body.txt` given a Gutenberg `book.txt` file

```
python3 process_raw_text.py \
    --indir [dir containing txt files]
```

Combine into a new directory:

```
mkdir [some new dir]
cp *.body.txt [some new dir]
```

A few books which have extremely broken headers may not be included (this number is < 50).

## Preprocessing Metadata

### Extracting Metadata

Download `rdf` metadata files:

```
wget http://www.gutenberg.org/cache/epub/feeds/rdf-files.tar.bz2
```

Unzip:

```
tar xjf rdf-files.tar.bz2
```

### Generating an ID List

In the directory containing the Gutenberg `txt` files with headers already stripped:

```
cd [directory] && find . -type f | sed "s/\.body.txt//g" > manifest.out
```

### Getting Titles and Creating a Title ↔ ID Map

Run the XML parsing script which uses some hard-coded XQuery/XPath to obtain title the title given the book ID.

```
python get_titles.py \
    --infile manifest.out \
    --outfile title_id_map.out
```

which produces a file that looks like:

```
10000|the magna carta
10001|apocolocyntosis
10002|the house on the borderland
...
```

### Normalizing the Title Table

Generate a sorted list of IDs and a sorted title list with the the same relative ordering:

```
awk -F"|" '{print $1}' title_id_map.out > title_id_map.ids.out
awk -F"|" '{print $1}' title_id_map.out > title_id_map.titles.out
```

Normalize the title text (see `../lm_corpus_and_PL_generation/normalize_title.sh`):
```
../lm_corpus_and_PL_generation/normalize_title.sh title_id_map.titles.out title_id_map.titles.out.norm
```

Recombine into a ID/title table:

```
paste -d "|" title_id_map.ids.out title_id_map.titles.out.norm | sort \
    > title_id_map.sort_by_id.norm.table
```

Create a map sorted by tables:

```
cat title_id_map.sort_by_id.norm.table | sort -k 2 -t "|" \
    > title_id_map.sort_by_title.norm.table
```

Create an ID list:

```
awk -F"|" '{print $1}' title_id_map.sort_by_id.norm.table \
    > title_id_map.sort_by_id.ids.norm.table
```

### Create a Split Title List

For later use in distributed fuzzy matching, split the title list up into pieces. Splitting into `NPIECES=([lines in title file] + $(nproc) - 1)/($(nproc))` is recommend for optimal parallelization:

```
mkdir gutenberg_title_splits && cd gutenberg_title_splits && \
    split --lines=$NPIECES title_id_map.titles.out.norm
```

## Generating a LibriSpeech LM Corpus with Raw Gutenberg Text

Download the LibriSpeech LM corpus from http://www.openslr.org/11/ and unzip. Extract a collection of Gutenberg IDs:

```
cut -d '|' -f 1  BOOKS.TXT | sed 's/^ *//;s/ *$//' \
    | sed '/^;/ d' > librispeech.corpus.ids
```

Repeat the below steps with this ID list.

## Removing Headers

The following creates a `[book_id].body.txt` given a Gutenberg `book.txt` file

```
python3 process_raw_text.py \
    --indir [dir containing txt files]
```

Combine into a new directory:

```
mkdir [some new dir]
cp *.body.txt [some new dir]
```

A few books which have extremely broken headers may not be included (this number is < 50).

branch_name: refs/heads/main

extension: md

gha_license_id: NOASSERTION

license_type: permissive


text:
# How to build OSRE on Windows

You need to add one ENV-var called SDL_PATH showing to the place where your SDL2-installation is located.

Doing this in the console:
```
set SDL_PATH=<Your_SDL_installation>
```
Or do this globally: [Introducing a global ENV-variable](https://stackoverflow.com/questions/3803581/setting-a-system-environment-variable-from-a-windows-batch-file)

Now you can call CMake as usual. A solution for your visual project will be generated.

license: MIT

repository: NeroBurner/osre

branch_name: refs/heads/master

gha_license_id: MIT

repo_name: NeroBurner/osre


text:
# AVALON

## Get a node running

#### Dependencies
* [MongoDB](https://mongodb.com)
* [NodeJS](https://nodejs.org/en/download/) **v10** (LTS)
* [ntpd](https://linux.die.net/man/8/ntpd) or any NTP alternative for your system. ntpd comes pre-installed on most linux distributions

#### Install
* `npm install` to install nodejs dependencies
* Get your own keys with `node src/cli.js keypair`
* Save your keys
* Add your keys to `scripts/start.sh`
* `chmod +x scripts/start.sh`
* `./scripts/start.sh`

## Get helped
We have a discord channel dedicated to node owners (aka leaders), where you can get support to get set up. Join [discorg.gg/dtube](https://discord.gg/dtube) and go to `DTube Chain -> #leader-candidates`

## Using the CLI
You can use the CLI tool to transact with avalon. Simply try `node src/cli --help` or `node src/cli <command> --help` for a full help.

## Using Javalon
There is also a [Javascript module](https://www.npmjs.com/package/javalon) available and working on both browser and nodejs.

Necessary for all transactions:
* *key*: your private key
* * Use -K MyKeyHere to use a plain-text key
* * Use -F file.json to use a key inside a file to sign
* *user*: your username

#### Vote for a leader
* *target*: the node owner to approve
```
node src/cli.js vote-leader -K <key> -M <user> <target>
```

#### Unvote a leader
* *target*: the node owner to approve
```
node src/cli.js unvote-leader -K <key> -M <user> <target>
```

#### Transfer tokens
* *receiver*: username of the receiver of the transfer
* *amount*: number of tokens to transfer to the receiver
* *memo*: arbitrary short text content
```
node src/cli.js transfer -K <key> -M <user> <receiver> <amount> <memo>
```

#### Add a post / Commenting
* *link*: a short string to be used as the index of the content
* *parent_author*: the username of the author of the parent post
* *parent_link*: the link of the parent post
* *json*: arbitrary json input. example: `{"string":"aye", array:[1,2,3]}`
* *tag*: arbitrary short text content
* *weight* : the number of vote tokens to spend on this vote
```
node src/cli.js comment -K <key> -M <user> <link> <parent_author> <parent_link> <json>
```

#### Vote a post
* *link*: the link of the post to vote on
* *author*: the username of the author to vote on
* *weight*: the number of vote tokens to spend on this vote
* *tag*: arbitrary short text content
```
node src/cli.js vote -K <key> -M <user> <link> <author> <weight> <tag>
```

#### Edit your user json object
* *json*: arbitrary json input. example: `{"string":"aye", array:[1,2,3]}`
```
node src/cli.js profile -K <key> -M <user> <json>
```

#### Follow a user
* *target*: the user to follow
```
node src/cli.js follow -K <key> -M <user> <target>
```

#### Unfollow a user
* *target*: the user to unfollow
```
node src/cli.js unfollow -K <key> -M <user> <target>
```

#### Signing a raw transaction

To create a transaction and export it to a file, you can use the `sign` CLI tool
```
node src/cli.js sign <priv_key> <user> <tx> > tmptx.json
```
For example to approve a node owner and publishing it only 5 seconds later:
```
node src/cli.js sign -K 4L1C3553KRETK3Y -M alice '{"type":1,"data":{"target":"miner1"}}' > tmptx.json
sleep 5
curl -H "Content-type:application/json" --data @tmptx.json http://localhost:3001/transact
```

## POST Calls

#### Mine Block
Will force the node to try to produce a block even if it's unscheduled. Useful for block #1 and working on development
```
curl  http://localhost:3001/mineBlock
```

#### Add peer
Manually force connection to a peer without having to restart the node
```
curl -H "Content-type:application/json" --data '{"peer" : "ws://localhost:6001"}' http://localhost:3001/addPeer
```

## MongoDB Storage
Avalon saves the state of the chain into mongodb after each block. You can easily query mongodb directly to get any data you want, that wouldn't be provided by the API itself.
```
mongo <db_name>
db.accounts.findOne({name:'master'})
db.blocks.findOne({_id: 0})
```

## Elastic Search Storage
Avalon can also copy the accounts and contents into an elastic search database with [monstache](https://github.com/rwynn/monstache). A configuration file for monstache is provided in the root of this repository.  This will do a complete replay and verification of the chain. Depending on your CPU/RAM it might be extremely slow and take a long time on a long chain with many transactions.

#### Replaying from a dump
An alternative way to resync your node faster is to use one of the backups provided by backup.d.tube. Example:

```
wget https://backup.d.tube/16.tar.gz
tar xfvz ./16.tar.gz
mongorestore -d avalon .
```

Will download and restore your avalon node up to 16:00 UTC.

## Being a good node owner
If you are in the top 20 node owners, please add a `node.ws` field to your profile as so:
```
node src/cli.js profile -K <key> -M <user> '{"node":{"ws":"ws://yourip:yourport"}}'
```

repository: johndpope/avalon

repo_name: johndpope/avalon


text:
###2016-06-16
diff between today and yesterday

####python
* [coffeehb/Some-PoC-oR-ExP](https://github.com/coffeehb/Some-PoC-oR-ExP): pocExp
* [minimaxir/facebook-page-post-scraper](https://github.com/minimaxir/facebook-page-post-scraper): Data scraper for Facebook Pages, and also code accompanying the blog post How to Scrape Data From Facebook Page Posts for Statistical Analysis
* [vvalien/win_exp](https://github.com/vvalien/win_exp): Python
* [karandesai-96/yolog](https://github.com/karandesai-96/yolog): Beautify your Git Logs ! { pre release - better features in newer versions, "Watch" to keep a track }
* [tensorflow/magenta](https://github.com/tensorflow/magenta): Magenta: Music and Art Generation with Machine Intelligence
* [phodal/toolbox](https://github.com/phodal/toolbox): Phodal's Toolbox
* [protream/tickets](https://github.com/protream/tickets): tickets query via command line.
* [josephmisiti/awesome-machine-learning](https://github.com/josephmisiti/awesome-machine-learning): A curated list of awesome Machine Learning frameworks, libraries and software.
* [seominjoon/qrn](https://github.com/seominjoon/qrn): Query-Regression Networks
* [groveco/content-engine](https://github.com/groveco/content-engine): A very simple content-based recommendation engine. Great for learning, but also ready for real-world use.
* [Wikidata/StrepHit](https://github.com/Wikidata/StrepHit): An intelligent reading agent that understands text and translates it into Wikidata statements.
* [sourcegraph/sourcegraph-vim](https://github.com/sourcegraph/sourcegraph-vim): See global cross-references and live usage examples for Go code, as you type. For Vim.

####go
* [go-playground/pool](https://github.com/go-playground/pool):  a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation
* [jmhobbs/terminal-parrot](https://github.com/jmhobbs/terminal-parrot): Go
* [henrylee2cn/pholcus](https://github.com/henrylee2cn/pholcus): [ (golang)] PholcusGoWebGUImysql/mongodb/csv/excelDemo
* [hashicorp/terraform](https://github.com/hashicorp/terraform): Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.
* [amyhaber/cnki-downloader](https://github.com/amyhaber/cnki-downloader): CNKI
* [segmentio/terraform-docs](https://github.com/segmentio/terraform-docs): Generate docs from terraform modules

####cpp
* [bkaradzic/bgfx](https://github.com/bkaradzic/bgfx): Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
* [drummyfish/proctextures](https://github.com/drummyfish/proctextures): Procedural textures library plus GUI tool.
* [vnpy/vnpy](https://github.com/vnpy/vnpy): python
* [colormotor/gfx_ui](https://github.com/colormotor/gfx_ui): A minimal geometry editing UI based on IMGUI
* [SaschaWillems/Vulkan](https://github.com/SaschaWillems/Vulkan): Examples and demos for the new Vulkan API
* [amznlabs/amazon-dsstne](https://github.com/amznlabs/amazon-dsstne): Deep Scalable Sparse Tensor Network Engine (DSSTNE) is an Amazon developed library for building Deep Learning (DL) machine learning (ML) models
* [mongodb/mongo](https://github.com/mongodb/mongo): The Mongo Database
* [googlesamples/android-ndk](https://github.com/googlesamples/android-ndk): Android NDK samples
* [facebook/rocksdb](https://github.com/facebook/rocksdb): A library that provides an embeddable, persistent key-value store for fast storage.
* [dmlc/xgboost](https://github.com/dmlc/xgboost): Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Flink and DataFlow
* [nwjs/nw.js](https://github.com/nwjs/nw.js): Call all Node.js modules directly from DOM and enable a new way of writing applications with all Web technologies.

####javascript
* [tj/react-enroute](https://github.com/tj/react-enroute): React router with a small footprint for modern browsers
* [algolia/places](https://github.com/algolia/places):  Turn any <input> into an address autocomplete
* [justjavac/free-programming-books-zh_CN](https://github.com/justjavac/free-programming-books-zh_CN):
* [dli/fluid](https://github.com/dli/fluid): Fluid Particles - http://david.li/fluid
* [deNULL/Az.js](https://github.com/deNULL/Az.js): A NLP library for Russian language
* [zeit/micro](https://github.com/zeit/micro): Micro  Async HTTP microservices
* [abalone0204/Clairvoyance](https://github.com/abalone0204/Clairvoyance): Make Taiwan a Better Place to Work
* [luruke/barba.js](https://github.com/luruke/barba.js): Create badass, fluid and smooth transition between your website's pages.
* [yoshuawuyts/choo](https://github.com/yoshuawuyts/choo):  - sturdy frontend framework

####coffeescript
* [apiaryio/dredd](https://github.com/apiaryio/dredd): Language-agnostic HTTP API Testing Framework
* [sroze/ngInfiniteScroll](https://github.com/sroze/ngInfiniteScroll): Infinite Scrolling for AngularJS
* [HubSpot/BuckyClient](https://github.com/HubSpot/BuckyClient): Collect performance data from the client. #hubspot-open-source
* [dudleycarr/nsqjs](https://github.com/dudleycarr/nsqjs): NodeJS client library for NSQ
* [miyagawa/hubot-standup](https://github.com/miyagawa/hubot-standup): Agile style standup bot with hubot, ala tender
* [atom/language-javascript](https://github.com/atom/language-javascript): JavaScript language package for Atom
* [drapanjanas/re-natal](https://github.com/drapanjanas/re-natal): Bootstrap ClojureScript React Native apps
* [skandasoft/browser-plus](https://github.com/skandasoft/browser-plus): Browser For Atom
* [lee-dohm/language-r](https://github.com/lee-dohm/language-r): An Atom language package for R.
* [pushandplay/cordova-plugin-apprate](https://github.com/pushandplay/cordova-plugin-apprate): This plugin provide the "rate this app" functionality into your Cordova/Phonegap application
* [atom/language-css](https://github.com/atom/language-css): CSS package for Atom
* [blockchain/My-Wallet-V3](https://github.com/blockchain/My-Wallet-V3): CoffeeScript

gha_language: Python


text:
## **Reconstruction**

For training/running a model, you will need to set up a configuration file.
Please check the [model_zoo](projects/reconstruction/model_zoo/conf) for example configurations.
Then, you can run the training/running script with the following command:

`python -m mridc.launch --config-path path_to_config --config-name config.yaml`

For example, to train a CIRIM:

`python -m mridc.launch --config-path mridc/projects/reconstruction/model_zoo/conf/ --config-name base_cirim_train.yaml`

### Datasets

The recommended public datasets to use with this repo for accelerated MRI reconstruction are the:

- [fastMRI](http://arxiv.org/abs/1811.08839) dataset, and the
- [Fully Sampled Knees](http://old.mridata.org/fullysampled/knees/) dataset.

## **Quantitative**

For training/running a model, you will need to set up a configuration file.
Please check the [model_zoo](projects/quantitative/model_zoo/conf) for example configurations.
Then, you can run the training/running script with the following command:

`python -m mridc.launch --config-path path_to_config --config-name config.yaml`

For example, to train a qRIM:

`python -m mridc.launch --config-path mridc/projects/quantitative/model_zoo/conf/ --config-name base_qrim_train.yaml`

### Datasets
The recommended public dataset to use with this repo for quantitative imaging is the [AHEAD](https://doi.org/10.34894/IHZGQM) dataset.
The raw data are in NIfTI format; including 3D complex data, coil sensitivity maps, and brain mask (needed for constraining the loss in training).
The data should be saved as 2D slices and converted in h5 format.
Please run the [preprocessing script](projects/quantitative/datasets/ahead/preprocessing.py) and the [reformat script](projects/quantitative/datasets/ahead/reformat.py) to prepare the data for training and testing.

Note that in the "_A unified model for reconstruction and R2* mapping of accelerated 7T data using the quantitative Recurrent Inference Machine_" paper, the RIM image reconstruction + least squares fitting is performed as initialization of the parameters for qRIM. The qRIM code can process the least squares fitting, however, the reconstructed images are expected to be provided for data loading.

---
## Notes
For running Parallel-Imaging Compressed Sensing (PICS) you need to install the
[BART](https://mrirecon.github.io/bart/). Important! To be able to run BART with a GPU, make sure to compile it with
NVCC.

Unfortunately, the BART package does not support straight-forward import.
So, few things are needed to run BART:

-  After installation, set the TOOLBOX_PATH and PYTHONPATH environment variables for BART on projects/reconstruction/export_bart_path.sh .
-  Finally export tha paths included in the following script (running the script won't work):

    ```
    bash ./projects/export_bart_path.sh
    ```
  Apparently, this need to be done every time you want to run BART.
- Uncomment lines 7 and 114-117 in the [pics module](mridc/collections/reconstruction/models/pics.py).

repository: wdika/mridc

repo_name: wdika/mridc


text:
## Introduction

Walley Checkout for Magento 2 is an extension for Magento 2, allowing you to take payments via Walley.

Walley Checkout is an embedded checkout, a checkout solution that replaces the standard Magento One Page Checkout. This setup provides an easy way for the customer to complete the purchase and a convenient way for the merchant to offer multiple payment options in the same solution.

#### Limitations in functionality

An embedded checkout can imply certain limitations in functionality. Compatibility with other plugins that extend the functionality of the standard checkout might in some cases be limited. However some functionality is built into the module like automatically creating customer accounts on new orders, checkbox for signing up to newsletter and GTM datalayer.

#### Sign up with Walley

To get started with Walley Checkout, you need to create an account with Walley. If you’re not a customer yet you can register here [https://www.walley.se/foretag/checkout/](https://www.walley.se/foretag/checkout/).

#### Demo

If you want to try the checkout before installing it in your store you can check out our demo stores

* Sweden: https://e57aca208f.nxcli.io/
* Norway: https://e57aca208f.nxcli.io/no/
* Finland: https://e57aca208f.nxcli.io/fi/
* Denmark: https://e57aca208f.nxcli.io/dk/
* Germany: https://e57aca208f.nxcli.io/de/

To make test purchases you will need customer test data. This information can be found here: [https://dev.walleypay.com/docs/checkout/test-data/](https://dev.walleypay.com/docs/checkout/test-data/).

## Installation

#### Technical installation

The latest installation instructions can be found in the README.md file in the official repo [https://github.com/collector-bank/Checkout-Magento-2](https://github.com/collector-bank/Checkout-Magento-2).

#### Magento setup

* Installing HTTPS (a SSL/TLS certificate) in your web store is strongly recommended.
* Currency for the store must be the same as you are using in Walley (however base currency may differ). Currency for the Walley checkout is set in the Country setting, see below Walley Magento configuration below.
* The module is tested with the common tax settings for B2C and B2B. If you are using non-standard tax settings and/or additional testing on your side will be to recommend.
* If you are using currency switches it might require additional testing.

#### Walley Magento configuration

 Navigate to: Magento Admin → Stores → Configuration →  Sales → Payment Methods → In the list of Payment Methods you should see:

 ![alt text](images/magento-admin-configuration.png "Magento admin configuration")

 Click on Configure and then expand the list of configuration fields:

 | Field | Comment|
 |-------|:-------|
 |Enabled| Enables or disables the module. If enabled, Walley will try to override all payment methods in the current Magento scope. It will also override the non-hard coded link to the checkout page in the current theme so that they lead to Walley checkout and not the standard one.|
 |Username|Walley Username – provided by Walley|
 |Password|Walley Password – provided by Walley. Sometimes also referred to as shared key or shared secret.  Normally a long text string like: Hh68d!xkV8bY_z_?T!_oJCNcxa$Rgy6A|
 |B2C StoreId|Merchant ID for B2C purchases for the selected country - Provided by Walley.|
 |B2B StoreId|Merchant ID for B2B purchases for the selected country - Provided by Walley.|
 |Country|The country where the checkout is used. The country selected here also defines the currency to use in Walley checkout, this needs to match the Magento configuration of the currency for that scope.|
 |Test mode|Enables test mode. If enabled the checkout will initiate a test session to Walley and use the test mode credentials below.|
 |Test mode Username|Test Mode Walley Username – provided by Walley.|
 |Test mode Password|Test Mode Walley Password – provided by Walley. Sometimes also referred to as shared key or shared secret. |
 |Test mode B2C StoreId|Test Mode Merchant ID for B2C purchases for the selected country - Provided by Walley.|
 |Test mode - B2B StoreId|Test Mode Merchant ID for B2B purchases for the selected country - Provided by Walley.|
 |Allowed Customers|Walley checkout supports private and business customers. Here you can select which of these you want to allow in the checkout or both. If both are selected and switch will appear on the checkout page where the customer can switch between them. If you are using different websites in Magento for different customer types you should only allow one customer type per website and not select both here. Selecting both here is only when you have both private and business customers in the same scope.|
 |Default Customer Type|The customer type selected here will be preselected when the checkout is loaded.|
 |Order status - Payment review order|A temporary order status for payment review orders before they are acknowledged by Walley as being paid. Payment review order has not been paid and should never be shipped or touched from the backend. Sometimes new orders are never acknowledged for different reasons e.g. the customer is not credit accepted, then the new order will automatically be deleted within 5 hours using a Magento cron job. It is highly recommended to use the default value.|
 |Order status - Acknowledged order|The order status for orders that have a valid payment and is acknowledged by Walley when orders are acknowledged they can be invoiced in Magento.  |
 |Order status - On Hold|The order status for orders on hold|
 |Order status - Denied order|The order status for orders that have been denied. This can e.g. be because of a suspected fraud.|
 |Terms and Conditions URL|The url to the webshop that has the terms and conditions. It must be provided as a complete link starting with http:// or https://e.g. https://www.democommunity.com/terms|
 |Create Customer Accounts|If set to yes a customer account will be automatically created for the customer /guest  that places. Yes = Customer accounts are created automatically for new email addresses. Orders are placed on the customer account. New customers get new customer email sent. No = Customers are checked out as guests no customer accounts are created.|
 |Custom base URL - Used during development|This only needs to be set in development if the development is done behind a firewall on a server/computer that has no direct url accessible from internet and you are using a proxy.|
 |Profile Name B2C|Optional field provided by Walley if needed. If you have been provided with a profile name from Walley Bank, enter it here, otherwise leave this field empty.|
 |Profile Name B2B|Optional field provided by Walley if needed. If you have been provided with a profile name from Walley Bank, enter it here, otherwise leave this field empty.|
 |Style iframe data-lang|(optional) The display language. Currently supported combinations are: sv-SE, en-SE, nb-NO, fi-FI, da-DK and en-DE. Both sv-SE and en-SE are available for use with swedish partners. In the other cases, the country part must match the country code used when initializing the checkout session or it will be ignored. Setting this attribute is optional and will only be of interest when there is more than one language for any single country.|
 |Style iframe data-padding|(optional) Set this to none in order to cancel out the left and right padding inside the iframe (by adjusting its margins and width).|
 |Style iframe data-container-id|(optional) Set this to the id of an element on the page and the iframe will render inside this element instead of immediately above the script element of the loader script. Put the container element somewhere above the script element. This is to make sure the container element is loaded before trying to populate it with the iframe.|
 |Style iframe data-action-color|(optional) Set this to a hexadecimal color code to change the background color of call to action buttons, formatted as the following example #582f87. Button text color will automatically be set to dark gray instead of white if not enough contrast according to WCAG 2.0 level AA for large text.|
 |Style iframe data-action-text-color|(optional) Set this to override the automatic text color of call to action buttons. Valid values are black, white, #000000 and #ffffff. Other hexadecimal color values are also valid, but will be interpreted as either black or white (and instead of black, the actual text color will be dark gray).|

#### Setting up the delivery checkout

The delivery checkout will allow you to integrate your checkout experience with a third party shipping provider like unifaun.

When this is set up, the available shipping methods will not be fetched from Magento, instead you will add your shipping methods from an external source e.g. unifaun delivery checkout. The shipping methods will be fetched dynamically depending on information about the current customer quote e.g. like weight, shipping address or cart subtotal.

The choice of shipping methods will be integrated into the payment iframe after the shipping address.

![alt text](images/deliveryCheckout.png "Delivery checkout")

Steps to set up the delivery checkout:
* Contact our merchant services and provide them with your shipping / unifaun API details.
* You will be provided with a profileName which you will have to enter in the Magento admin configuration under Profile Name B2C or Profile Name B2B (see above).
* Enable delivery checkout in the admin:

![alt text](images/enable-delivery-checkout.png "Enble delivery checkout")

**Note**: In Unifaun delivery checkout it is possible to set up rules for shipment methods. Cart total and order weight are automatically sent to Unifaun, additional variables might need custom configuration.

Technical information how to retreive shipping data from orders, for e.g. integrating to business systems or printing address labels automatically. [Delivery checkout technical integration](deliveryCheckoutIntegration.md)

#### Swish orders

Swish orders follow the normal order flow however they are not registered as transactions in Walley settlements. Check out [https://dev.walleypay.com/docs/checkout/optional/swishformerchants](https://dev.walleypay.com/docs/checkout/optional/swishformerchants) for more information.

#### Test mode

After you have installed the module on your Magento 2 installation you can test it by running it in test mode. Test credentials for different scenarios can be found here [https://dev.walleypay.com/docs/checkout/test-data/](https://dev.walleypay.com/docs/checkout/test-data/).

#### Production mode

When ready activate production mode and start receiving orders!

## Common errors

#### The checkout loads as a blank page

If a blank page loads instead of the checkout page it is likely something in the Magento configuration is not entered correctly, check the Walley debug / error log for more specific information. Recheck your credentials, store ids and “Terms and Conditions URL”.

#### Items not in stock error message when placing orders

If you are receiving this error message directly after installing the checkout for all cases:

![alt text](images/complete-purchase-failure.png "Magento admin configuration")

It is likely that you can not receive callbacks from Walley, possible reasons are:
* The Magento installation is behind a firewall and your “Custom base URL” proxy is not working.
* The Magento installation is on a password protected environment (common for stage environment).

#### Currencies are not matching

When the iframe loads there is an error message on top:

![alt text](images/currency-missmatch.png "Magento admin configuration")

This is because the “Country” selected in the Walley Magento Configuration is not matching the currency selected.

The Magento configuration in Stores -> Configuration-> General -> Currency Setup must match the currency for the “Country” selected for the same Magento configuration scope.

![alt text](images/magento-currency-config.png "Magento admin configuration")

## The checkout in action

#### Checkout process flow

Since Walley Checkout is an embedded checkout solution, order/cart data & customer data is passed between Magento and the Walley payment session. The extension uses Magento standard way of integrating payment methods and uses the Magento Gateway Command Pool [https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/command-pool.html](https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/command-pool.html).

The diagram below shows the simple happy case. It illustrates the communication that happens in the background while the checkout is in process:

![alt text](images/happy-case.png "Happy case")

#### Cleaning of New order

Before orders are acknowledged and a payment is accepted the orders have status:

![alt text](images/new.png "Order payment review")

It can happen that orders are created in Magento and never get acknowledged. As a merchant you will see these orders in the Magento Order view, it is important not to touch them and let them be either until they get Acknowledged by Walley or until they are automatically deleted by a cron job after 5 hours.

#### Order management

When an order is created in Magento and is acknowledged a reservation number is created in the Walley system, you have the possibility to handle the order management in Walley directly from Magento. This way you can save time and don’t have to work in both systems simultaneously.

**Note**: If you do operations on order in the Walley Merchant portal, e.g. activating it, you won’t be able to invoice it from Magento unless you select the Invoice offline option.

###### Invoice orders - Activate / Part activate

The Magento order management process starts when an order has status:

![alt text](images/acknowledged.png "Acknowledged")

If you open an Acknowledged order in Magento admin it should have Payment information similar to:

![alt text](images/payment-information.png "Payment information")

To invoice the order open it in Magento and create an invoice as usual. Note that it is possible to part activate the invoice by online invoicing some items in on the order and not others:

![alt text](images/items-to-invoice.png "Items to invoice")

When the invoice has been submitted in Magento:

![alt text](images/invoice-submitted.png "Invoice submitted")

The invoice is now activated in Walley merchant portal.

###### Refund orders - Credit / Part credit

When an invoice has been created it can be refunded (credited / part credited) from Magento backend. Open the invoiced order. In the tab invoices you will see a list of invoices created for that order (if the invoice has been part activated there will be one invoice for every activation), Click on View for the invoice:

![alt text](images/view-the-invoice.png "View the invoice")

Then click on Credit Memo:

![alt text](images/credit-memo.png "Credit memo")

As for part activations it is possible to part credit items here by modifying the Qtys in the Items list:

![alt text](images/items-to-refund.png "Items to refund")

Furthermore it is possible to add adjustments using “Adjustment Refund” and “Adjustment Fee”, these will be added on the invoice in Walley merchant portal:

![alt text](images/refund-totals.png "Refund totals")

**Note**: Refund Shipping can not be part credited, either refund the whole amount or zero.

###### Cancel orders

An order can be cancelled if it has not yet been invoiced. Cancelling an order will remove the Walley reservation for that order, if the customer has paid here the payment will be automatically refunded and returned to the customer.

The cancel option will not be available for orders that are in a state that do not allow them to be cancelled. If an order has been invoiced, you should use the Refund / Credit functionality.

###### Complete order status flow chart

Below is a complete flow chart of the order states and statuses:

![alt text](images/checkout-flow-chart.png "Order payment review")

#### Debugging the checkout

For debugging purposes a dedicated error log is stored for errors related to the checkout in:
/magento-root/var/log/collectorbank.log

## Miscellaneous

#### GTM tracking and Data Layer

The Walley checkout adds standard GTM Data Layer for Google Analytics and Google Analytics Enhanced Ecommerce on the success page.

Example of Google Analytics Data Layer on Checkout page:

![alt text](images/ga-data.png "GA")

Example of Google Analytics Enhanced Ecommerce Data Layer on Checkout page:

![alt text](images/ecommerce-data.png "GA")

#### Order confirmation emails

Standard functionality for sending out order confirmation email has been overridden. Normally in Magento emails are sent when an order is created / placed and has status payment review / pending. In the case of Walley checkout the order confirmation email is sent when the order has a confirmed payment and get status Acknowledged.

#### Orders placed by existing customers

As described in the Magento Walley configuration section there is a setting whether to create customers automatically or not on new orders, if this is set to yes a customer in Magento is created in Magento if it does not exist since before.
However, in addition to this there is an automatic association built in to the module that is good to be aware of:

If an order is placed and a customer with that email exists for that scope, the order will be associated with that customer and not registered as guest order, even though the customer is not logged in when placing the order.

#### Available countries and stores

 | Country | Currency | Language code | B2C | B2B |
 |---------|----------|---------------|-----|-----|
 | Sweden | SEK |sv-SE | Yes | Yes |
 | Norway | NOK | nb-NO | Yes | Yes |
 | Finland | EUR | fi-FI | Yes | Yes |
 | Denmark | DKK | da-DK | Yes | Yes |
 | Germany | EUR | en-DE | Yes | No |

## Troubleshooting

In order to make the troubleshooting as effective please provide the below information when in contact with Walley Merchant Services.

* Which browser was used and what version. This will give support a possibility to exclude if the problem only occurs in a specific browser or version.
* A step by step instruction how the merchant or customer came across the issue, if possible please provide as much details as possible in order to make the troubleshooting as effective and quick as possible.
* Login/account details to the merchant/customers Magento admin.
* All information from Walley regarding their privateToken, all requests that have been sent is preferable.
* What version of the module has been used, please specify.

gha_language: PHP


text:
# About
The source code for Will Fight for Food: Super Actual Sellout: Game Of The Hour, a RPG / Beat 'em up hybrid by Pyrodactyl Games.
It's the second game built using my own homebrew engine named CRAB (which stands for Conversation Roleplaying Allpurpose Brawler).

I hope this helps someone out there learning to make games, or someone interested in learning how Unrest works.

# How to Compile
After cloning the repository, you will need to set a valid Boost source and lib directories in Visual Studio settings.
For more information on how to set up Boost, visit https://www.boost.org/

# Running the Game

After successfully compiling and building the executable, you will need the game's assets.
If you have a copy of the game, navigate to the install directory and:
1. Copy the "res" folder to the binary location
2. Copy the various DLL files to the binary location

If you're having any issues with getting the code up and running, or just want to chat about the game, feel free to contact me!


text:
# ImageNation

Small project that was made to make it easier for APCSA students to experiment with image manipulation.

The original APCSA assignment that inspired this project was somewhat unwieldy,
requiring students to specify the image file to load and statically compile all functions they intend to run on it.

This project instead allows students to load images after the program is started,
as well as select one of many runtime loaded functions that they write.
They can choose to run any function in any order to see the effect, as well as undo and redo actions.

There is a color manipulation API that allows students to adjust the color against multiple color spaces, including:
- RGB
- HSL
- HSV
- HCL

The API stores the last used "mode",
and makes a best attempt to reduce artifacting that occurs from converting between color spaces.
That is to say, if all functions are only dealing with HSV, the API won't convert color to RGB and back over and over.

The interface also allows fluid panning and zooming,
and gives helpful information like pixel position and the values of the various color properties,
such as the values of red, green, blue,
as well as all the values of all the other dimensions of the other color spaces.

Finally the program allows students to easily export any processed images to a file, at any point.

repository: gravityfox/ImageNation

repo_name: gravityfox/ImageNation


text:
---
title: TNA Datathon - 20-21 June 2019
permalink: /tna/
---

Explorations by the Legislation Data Working Group

20-21 June, 2019, The National Archives.

As part of the AHRC-funded Computational Archival Science network (February 2019-January 2020), a datathon on Exploring data, investigating methodologies was held in June 2019.

As part of the datathon a working group including King’s Digital Lab TCL team members focused on exploring the visualisation of legislation datasets curated and published by the National Archives at http://www.legislation.gov.uk.

From this page you can access the preliminary visualisations produced by this group. The code is available from this repository branch under Open Government licence v.3.0.

Working group

Arianna Ciula (Deputy Director & Senior Research Software Analyst, King’s Digital Lab)

Ginestra Ferraro (Senior Research Software UX/UI Designer, King’s Digital Lab)

Tamara Izzo (Legislation Data Analyst, The National Archives)

Jack Roberts (Research Data Scientist, The Alan Turing Institute)

Catherine Tabone (Data Manager, The National Archives)

Miguel Vieira (Principal Research Software Engineer, King’s Digital Lab)

Paul Young (Digital Preservation Specialist/researcher, The National Archives)

repository: kingsdigitallab/tcl

gha_language: JavaScript

repo_name: kingsdigitallab/tcl


text:
Temporalia-TQIC
===============

Our work for the NTCIR-11 Temporalia challenge, Temporal Query Intent Classification sub-task: predicting the temporal orientation of search engine user queries.

![ScreenShot](http://www.cs.man.ac.uk/~filannim/projects/temporalia/gfx/temporalia.jpg)

We tackled the task as a machine learning classification problem, by proposing th use of temporal-oriented attributes specifically designed to minimise the sparsity of the models.

The best submitted run achieved 66.33% of accuracy, by correctly predicting the temporal orientation of 199 test instances out of 300.

##Requirements

Python libraries:

* NLTK ([web page](http://www.nltk.org/))

Non-Python resources:

* ManTIME ([web page](https://github.com/filannim/ManTIME))
* Temporal NorMA ([web page](https://github.com/filannim/timex-normaliser)) [already in `/external`]

please update the `feature_extractor.py` file with the right paths.

##Contact
- Email<EMAIL_ADDRESS>- Web: http://www.cs.man.ac.uk/~filannim/

repository: filannim/Temporalia-TQIC

repo_name: filannim/Temporalia-TQIC


text:
---
layout: post
title: Implementing the new syntaxes
---
This blogpost contains few sample spiders, so one can use them to try out the new syntax.

## Sample spiders which uses new support

While the scrapy codebase has been supported with the new syntax, users can make new spiders using the above new syntax. This blog post deals with new spiders, that can be used, for utilising the new syntaxes.

> Few Instructions to try out new syntactic sugar

While the new syntax haven't been supported in the official scrapy codebase, you can clone the project locally, and then install scrapy using `python setup.py install` to use scrapy locally.

[My Codebase](https://github.com/yashrsharma44/scrapy/tree/devel_parse)

> Some Sample Spiders

Here is the link to my spider [Spider_Coroutine](https://scrapinghub.slack.com/files/UAE09M7PU/FAZPASWUT/spider_coroutine.py)


text:
General information
===================
* Contributors: [michaelsauter](https://github.com/michaelsauter)
* Tags: symfony2, mvc, options, form
* Requires at least: 3.5
* Stable tag: 1.1
* License: MIT

Orchestra is a solid plugin development base formed of Symfony2 components. It was originally created during a TripleTime project at [SitePoint](http://www.sitepoint.com)

Description
===========

Orchestra integrates Doctrine2 and some Symfony2 components into Wordpress to allow developers to easily build admin pages that exceed the built-in Wordpress functionality.

The basic architecture is as follows:
* Orchestra mainly has 3 building blocks (components): Doctrine (ORM), Form, Twig. These can form a foundation for the development of arbitary plugins.
* The components used to form these building blocks are included via Composer
* Orchestra wires the building blocks together and provides additional functionality like class loading as well as a basic router and a controller modelled after the Symfony2 controller.
* Orchestra is initialized during the "_admin_menu" hook
* Then, during the "admin_menu" hook, every plugin based on Orchestra calls the Framework class of Orchestra, which then decides if the calling plugin is active (e.g. the user requested this plugin in the backend). If so, it passes control back to the plugin by executing the correct controller and stores the rendered output. The output must be rendered and stored at this stage, because later on, the headers are already sent.
* The generated output is then retrieved inside the callback of e.g. "add_meu_page".

Installation
============

1. Put `orchestra` into the `/wp-content/plugins/` directory
2. Run `composer install` (requires composer to be installed globally)
3. (Optionally) edit `config.php` to match your setup
4. Activate the plugin through the 'Plugins' menu in WordPress

General Usage
=============

1. Go to `wp-content/plugins/orchestra`
2. Execute `./console plugin:create your-plugin-name-here`
3. Activate the plugin through the 'Plugins' menu in WordPress
4. While you're developing, make sure to set `WP_DEBUG` in `wp-config.php` to `true` in order to have the caches rewritten automatically

Interacting With the Database
=============================
Orchestra interacts with the database via Doctrine2. It also supports multisite setup out-of-the-box. When creating entities, you should specify the table name explicitly, but leave out the prefix as this is determined by Orchestra.
To create or modify the database schema, you need to provide install / update routines in your plugin and run SQL from there. Unfortunately, the Doctrine CLI tools are not supported. That being said, it is often more comfortable to handle schema changes upon install/update anyway.

Writing Tests
=============
You can write unit tests just like for every other PHP project. Orchestra uses PHPUnit to test its code. If you want to test your plugin with PHPUnit, take a look inside `tests/` to get started.

Deployment
==========
The repository intentionally does not contain the vendors. The vendor directory is configured by default to be `wp-content/vendors/orchestra`. Exclude this folder from version control if you want to install the dependencies via composer upon install. If you want to manage the dependencies locally however, commit the folder to your repository.

Frequently Asked Questions
==========================

Can I use other Composer libraries, too?
----------------------------------------

Yes, it is very easy to do so inside your plugin. You just need to  install Composer, create a composer.json file with your dependencies, install them and pass the namespaces to register as a 3rd parameter to the Framework::setupPlugin() call.

What Coding Style Guidelines to use?
------------------------------------

I recommend following the [Symfony2 Coding Standards](http://symfony.com/doc/2.0/contributing/code/standards.html) instead of the Wordpress Coding Guidelines. Orchestra itself and the templates use the Symfony2 Coding Standards.

Changelog
=========

1.1
---
* Removed Doctrine Migrations
* Fixed unit tests
* Updated readme

1.0
---
* Initial release

repository: idlweb/orchestra

repo_name: idlweb/orchestra


text:
# Open CAS Linux

[![Build Status](https://d1rxsi9lvcwnz5.cloudfront.net/master-status/ocl/build/curr-badge.svg)](https://d1rxsi9lvcwnz5.cloudfront.net/master-status/ocl/build/build.html)
[![Tests Status](https://d1rxsi9lvcwnz5.cloudfront.net/master-status/ocl/tests/curr-badge.svg)](https://d1rxsi9lvcwnz5.cloudfront.net/master-status/ocl/tests/tests.html)
[![Coverity status](https://scan.coverity.com/projects/19084/badge.svg)](https://scan.coverity.com/projects/open-cas-open-cas-linux)
[![License](https://d1rxsi9lvcwnz5.cloudfront.net/master-status/license-badge.svg)](LICENSE)

Open CAS  accelerates Linux applications by caching active (hot) data to
a local flash device inside servers. Open CAS implements caching at the
server level, utilizing local high-performance flash media as the cache drive
media inside the application server as close as possible to the CPU, thus
reducing storage latency as much as possible.
The Open Cache Acceleration Software installs into the GNU/Linux operating
system itself, as a kernel module. The nature of the integration provides a
cache solution that is transparent to users and  applications, and your
existing storage infrastructure. No storage migration effort or application
changes are required.

Open CAS is distributed on BSD-3-Clause license (see
https://opensource.org/licenses/BSD-3-Clause for full license texts).

Open CAS uses Safe string library (safeclib) that is MIT licensed.

## Installation

We recommend using the latest version, which contains all the important fixes
and performance improvements. Bugfix releases are guaranteed only for the
latest major release line (currently 22.6.x).

To download the latest Open CAS Linux release run following commands:

```
wget https://github.com/Open-CAS/open-cas-linux/releases/download/v22.6.1/open-cas-linux-<IP_ADDRESS>2.release.tar.gz
tar -xf open-cas-linux-<IP_ADDRESS>2.release.tar.gz
cd open-cas-linux-<IP_ADDRESS>2.release/
```

Alternatively, if you want recent development (unstable) version, you can clone GitHub repository:

```
git clone https://github.com/Open-CAS/open-cas-linux
cd open-cas-linux
git submodule update --init
```

### Source compile and install

To install all required python packages run the following command:

```
python3 -m pip install -r requirements.txt
```

To configure, build and install Open CAS Linux run following commands:

```
./configure
make
make install
```

The `./configure` performs check for dependencies, so if some of them are missing,
command will print their names in output. After installing missing dependencies
you need to run `./configure` once again - this time it should succeed.

> NOTE: If after installing CAS, your system boots into emergency mode due to the
> **"Failed to start opencas initialization service."** error, you need to force SELinux
> relabelling in permissive mode on your filesystem.\
> Refer to the [Open CAS documentation](https://open-cas.github.io/guide_running.html#rebooting-power-cycling-and-open-cas-linux-autostart) for details.

### RPM/DEB install

Alternatively, you can generate RPM/DEB packages from downloaded sources and
install those packages instead. To do so, simply run:

__on RPM based systems:__
```
make rpm
rm -f packages/*debug*
dnf install ./packages/open-cas-linux*.rpm
```

__on DEB based systems:__
```
make deb
apt install ./packages/open-cas-linux*.deb
```

Package generating script will inform you of any missing dependencies.
You can find detailed instructions in the [Open CAS documentation](https://open-cas.github.io/guide_installing.html#creating-rpmdeb-packages)

## Getting Started

To quickly deploy Open CAS Linux in your system please follow the instructions
available [here](https://open-cas.github.io/getting_started_open_cas_linux.html).

## Documentation

The complete documentation for Open CAS Linux is available in the
[Open CAS Linux Administration Guide](https://open-cas.github.io/guide_introduction.html).

## Running Tests

Before running tests make sure you have a platform with at least 2 disks (one for cache and one for core). Be careful as these devices will be most likely overwritten with random data during tests. Tests can be either executed locally or on a remote platform (via ssh) specified in the dut_config.

1. Go to test directory `cd test/functional`.
1. Install dependencies with command `pip3 install -r requirements.txt`.
1. Create DUT config. See example [here](test/functional/config/example_dut_config.yml).
    a) Set disks params. You need at least two disks, of which at least one is an SSD drive.
    b) For remote execution uncomment and set the `ip`, `user` and `password` fields.
    c) For local execution just leave these fields commented.
1. Run tests using command `pytest-3 --dut-config=<CONFIG>` where `<CONFIG>` is path to your config file, for example `pytest-3 --dut-config="config/dut_config.yml"`.

## Contributing

Feel like making Open CAS Linux better? Don't hesitate to submit a pull request!
You can find more information about our contribution process
[here](https://open-cas.github.io/contributing.html).
In case of any questions feel free to contact [maintainer](mailto:robert.baldyga@huawei.com).

repository: Open-CAS/open-cas-linux

repo_name: Open-CAS/open-cas-linux


text:
> Note: as of redis-helper v0.4.0, version 3.0 of redis-py is in use, which has
> backwards incompatible changes withe redis-py 2.x. See
> <https://github.com/redis/redis-py/tree/70ef9ec68f9163c86d4cace2941e2f0ae4ce8525#upgrading-from-redis-py-2x-to-30>

## About

[redis-helper project]: https://github.com/kenjyco/redis-helper
[beu-fork]: https://github.com/kenjyco/beu/tree/4aea6146fc5f01df3e344b9fadddf28b795dac89
[Redis]: http://redis.io/topics/data-types-intro
[redis-helper package]: https://pypi.python.org/pypi/redis-helper
[request logging demo]: https://asciinema.org/a/101422?t=1:10
[urls demo]: https://asciinema.org/a/75kl95ty9vg2jl93pfz9fbs9q?t=1:00
[examples]: https://github.com/kenjyco/redis-helper/tree/master/examples
[settings.ini]: https://github.com/kenjyco/redis-helper/blob/master/redis_helper/settings.ini
[bg-helper docker tools]: https://github.com/kenjyco/bg-helper#helper-functions-in-bg_helpertools-that-use-docker-if-it-is-installed

Install redis-helper, create an instance of `redis_helper.Collection`
(**the args/kwargs define the model**) and use the `add`, `get`, `update`,
`delete`, and `find` methods to:

- quickly store/retrieve/modify Python dicts in Redis
- filter through indexed fields with simple/flexible find arguments
- power real-time dashboards with metrics at a variety of time ranges
- super-charge event logging and system debugging
- build FAST prototypes and simulators
- greatly simplify data access patterns throughout application

See the [request logging demo][] and [urls demo][] (with `unique_field`
defined). The [examples][] they reference are **short** and **easy to
read**.

The [redis-helper project][] evolved from a [reference Python project][beu-fork]
that would be **easy to teach** and follow many practical best practices and
useful patterns.  Main purpose was to have something that was super **easy to
configure** (a single `~/.config/redis-helper/settings.ini` file for multiple
application environments) that did cool things with [Redis][].

The [redis-helper package][] provides a `Collection` class that was designed to
be **easy to interact with** in the shell (for exploration, experimentation, and
debugging). Most methods on a `Collection` help **minimize typing** (passing
multiple arguments in a single delimited string when appropriate) and do "the
most reasonable thing" whenever possible.

The first time that `redis_helper` is imported, the sample
[settings.ini][] file will be copied to the `~/.config/redis-helper`
directory.

```
[default]
image_version = 6-alpine

[dev]
container_name = redis-helper
port = 6379
rm = False
redis_url = redis://localhost:6379/1

[test]
container_name = redis-helper-test
port = 6380
rm = True
redis_url = redis://localhost:6380/9
```

If docker is installed to your system and your user has permission to use it,
the [bg-helper docker tools][] will be used to start a redis container for
development or running tests, if Redis is not already installed locally.

## (Optionally) install Redis and start server locally

```
% sudo apt-get install -y redis-server

or

% brew install redis
% brew services start redis
```

## Install redis-helper

- install latest tag/release of [redis-helper package][]

    ```
    % pip3 install redis-helper
    ```
- or, install latest commit on master of [redis-helper project][]

    ```
    % pip3 install git+git://github.com/kenjyco/redis-helper
    ```

## Intro

[redis-py]: https://github.com/andymccurdy/redis-py
[StrictRedis]: https://redis-py.readthedocs.org/en/latest/#redis.StrictRedis
[ujson]: https://pypi.python.org/pypi/ujson
[dict]: https://docs.python.org/3/tutorial/datastructures.html#dictionaries
[hash]: https://redis.io/topics/data-types#hashes
[set]: https://redis.io/topics/data-types#sets
[sorted set]: https://redis.io/topics/data-types#sorted-sets
[hash commands]: http://redis.io/commands#hash
[set commands]: https://redis.io/commands#set
[sorted set commands]: https://redis.io/commands#sorted_set

[Redis][] is a fast in-memory **data structure server**, where each stored
object is referenced by a key name. Objects in Redis correspond to one of
several basic types, each having their own set of specialized commands to
perform operations. The [redis Python package][redis-py] provides the
[StrictRedis][] class, which contains methods that correspond to all of the
Redis server commands.

When initializing Collection objects, you must specify the "namespace" and
"name" of the collection (which are used to create the internally used
`_base_key` property). All Redis keys associated with a Collection will have a
name pattern that starts with the `_base_key`.

```python
import redis_helper as rh

request_logs = rh.Collection(
    'log',
    'request',
    index_fields='status, uri, host',
    json_fields='request, response, headers'
)

urls = rh.Collection(
    'web',
    'url',
    unique_field='name',
    index_fields='domain, _type'
)

notes = rh.Collection(
    'input',
    'note',
    index_fields='topic, tag',
    insert_ts=True
)

sample = rh.Collection(
    'ns',
    'sample',
    unique_field='name',
    index_fields='status',
    json_fields='data',
    rx_name='\S{4,6}',
    rx_status='(active|inactive|cancelled)',
    rx_aws='[a-z]+\-[0-9a-f]+',
    insert_ts=True
)

uses_sample = rh.Collection(
    'ns',
    'uses_sample',
    index_fields='z',
    rx_thing='\S{4,6}',
    reference_fields='thing--ns:sample'
)
```

- a `unique_field` can be specified on a collection if items in the collection
  should not contain duplicate values for that particular field
    - the `unique_field` cannot also be included in `json_fields` or
      `pickle_fields`
    - if you specify a `unique_field`, that field must exist on each item you
      add to the collection
- use `index_fields` to specify which fields you will want to filter on when
  using the `find` method
    - the values for data fields being indexed MUST be simple strings or numbers
    - the values for data fields being indexed SHOULD NOT be long strings, as
      the values themselves are part of the index keys
- use `json_fields` to specify which fields should be JSON encoded before
  insertion to Redis (using the very fast [ujson][] library)
- use `rx_{field}` to specify a regular expression for any field with strict
  rules for validation
- use `reference_fields` to specify fields that reference the `unique_field` of
  another collection
    - uses field--basekey combos
- use `pickle_fields` to specify which fields should be pickled before insertion
  to Redis
- set `insert_ts=True` to create an additional index to store insert times
    - only do this if you are storing items that you are likely to update and
      also likely to want to know the original insert time
        - each time an object is updated, the score associated with the
          `hash_id` (at the `_ts_zset_key`) is updated to the current timestamp
        - the score associated with the `hash_id` (at the `_in_zset_key`) is
          never updated

Essentially, you can store a Python [dict][] in a Redis [hash][] and index some
of the fields in Redis [sets][set]. The collection's `_ts_zset_key` is the Redis
key name for the [sorted set][] containing the `hash_id` of every hash in the
collection (with the `score` being a `utc_float` corresponding to the UTC time
the `hash_id` was added or modified).

- if `insert_ts=True` was passed in when initializing the `Collection` (or
  sub-class), then the collection will also define `self.in_zset_key` to be the
  Redis key name for the sorted set (for `hash_id` and `utc_float` of insert
  time)

```python
request_logs.add(
    method='get',
    status=400,
    host='blah.net',
    uri='/info',
    request={'x': 50, 'y': 100},
    response={'error': 'bad request'},
)

urls.add(
    name='redis-helper github',
    url='https://github.com/kenjyco/redis-helper',
    domain='github.com',
    _type='repo',
)
```

The `get` method is a wrapper to [hash commands][] `hget`, `hmget`, or
`hgetall`. The actual hash command that gets called is determined by the number of
fields requested.

- a Python dict is typically returned from `get`
- if `item_format` is specified, a string will be returned matching that format
  instead

```python
request_logs.get('log:request:1')
request_logs.get('log:request:1', 'host,status')
request_logs.get('log:request:1', item_format='{status} for {host}{uri}')
request_logs.get_by_position(0, item_format='{status} for {host}{uri}')
urls.get_by_position(-1, 'domain,url')
urls.get_by_unique_value('redis-helper github', item_format='{url} points to a {_type}')
```

- the `get_by_position` and `get_by_unique_value` methods are wrappers to `get`
    - the `get_by_unique_value` method is only useful if a `unique_field` was
      set on the Collection

The `find` method allows you to return data for items in the collection that
match some set of search criteria. Multiple search terms (i.e.
`index_field:value` pairs) maybe be passed in the `terms` parameter, as long as they are
separated by one of `,` `;` `|`. Any fields specified in the `get_fields`
parameter are passed along to the `get` method (when the actual fetching takes
place).

- when using `terms`, all terms that include the same field will be treatead
  like an "or" (union of related sets), then the intersection of different sets
  will be computed
- see the Redis [set commands][] and [sorted set commands][]

There are many options for specifying time ranges in the `find` method
including:

- `since` and `until` when specifying `num:unit` strings (i.e. 15:seconds,
  1.5:weeks, etc)
- `start_ts` and `end_ts` when specifying timestamps with a form between `YYYY`
  and `YYYY-MM-DD HH:MM:SS.f`
- `start` and `end` when specifying a `utc_float`
- for `since`, `until`, `start_ts`, and `end_ts`, multiple values may be passed
  in the string, as long as they are separated by one of `,` `;` `|`.
    - when multiple time ranges are specified, the `find` method will determine
      all reasonable combinations and return a result-set per combination
      (instead of returning a list of items, returns a dict of list of items)

If `count=True` is specified, the number of results matching the search criteria
are returned instead of the actual results

- if there are multiple time ranges specified, counts will be returned for each
  combination

```python
request_logs.find('status:400, host:blah.net', get_fields='uri,error')
request_logs.find(since='1:hr, 30:min', until='15:min, 5:min')
request_logs.find(count=True, since='1:hr, 30:min', until='15:min, 5:min')
urls.find(count=True, since='1:hr, 30:min, 10:min, 5:min, 1:min')
urls.find(start_ts='2017-02-03', end_ts='2017-02-03 7:15:00')
urls.find(start_ts='2017-02-03', item_format='{_ts} -> {_id}')
```

The `update` method allows you to change values for some fields (modifying the
`unique_field`, when it is specified, is not allowed).

- every time a field is modified for a particular `hash_id`, the previous value
  and score (timestamp) are stored in a Redis hash
- the `old_data_for_hash_id` or `old_data_for_unique_value` methods can be used
  to retrieve the history of all changes for a `hash_id`

```python
urls.update('web:url:1', _type='fancy', notes='this is a fancy url')
urls.old_data_for_hash_id('web:url:1')
urls.old_data_for_unique_value('redis-helper github')
```

The `load_ref_data` option on `get`, `get_by_unique_value`, or `find` methods
allow you to load the referenced data object from the other collection (where
`reference_fields` are specified)

```python
In [1]: sample.add(name='hello', aws='ami-0ad5743816d822b81', status='active')
Out[1]: 'ns:sample:1'

In [2]: uses_sample.add(thing='hello', z=500, y=True)
Out[2]: 'ns:uses_sample:1'

In [3]: uses_sample.get('ns:uses_sample:1')
Out[3]: {'thing': 'hello', 'z': 500, 'y': True}

In [4]: uses_sample.get('ns:uses_sample:1', load_ref_data=True)
Out[4]:
{'thing': {'name': 'hello',
  'aws': 'ami-0ad5743816d822b81',
  'status': 'active',
  '_id': 'ns:sample:1',
  '_ts':<PHONE_NUMBER>0044.875},
 'z': 500,
 'y': True}

In [5]: uses_sample.add(thing='byebye', z=100, y=True)
Out[5]: 'ns:uses_sample:2'

In [6]: uses_sample.get('ns:uses_sample:2', load_ref_data=True)
Out[6]: {'thing': 'byebye', 'z': 100, 'y': True}
```

## Tip

There may be times where you want to use redis-helper (if it's already
installed), but don't want to make it an explicit requirement of your project.
In cases like this you can do the following:

```
try:
    import redis_helper as rh
    from redis import ConnectionError as RedisConnectionError
except (ImportError, ModuleNotFoundError):
    SomeCollection = None
else:
    try:
        SomeCollection = rh.Collection(
            ...
        )
    except RedisConnectionError:
        SomeCollection = None
```

Then in whatever function, you can just do:

```
def some_func():
    if SomeCollection is None:
        return

    # Do stuff with SomeCollection
```

## Local development setup

[dev-setup.bash]: https://github.com/kenjyco/redis-helper/blob/master/dev-setup.bash

```
% git clone https://github.com/kenjyco/redis-helper
% cd redis-helper
% ./dev-setup.bash
```

The [dev-setup.bash][] script will create a virtual environment in the
`./venv` directory with extra dependencies (ipython, pdbpp, pytest), then copy
`settings.ini` to the `~/.config/redis-helper` directory.

## Running tests in development setup

[setup.cfg]: https://github.com/kenjyco/redis-helper/blob/master/setup.cfg
[pdb++]: https://pypi.python.org/pypi/pdbpp/
[debugging section]: https://github.com/kenjyco/redis-helper#settings-environments-testing-and-debugging
[project code]: https://github.com/kenjyco/redis-helper/tree/master/redis_helper
[test code]: https://github.com/kenjyco/redis-helper/tree/master/tests

The [setup.cfg][] file contains the options for `py.test`, currently
`-vsx -rs --pdb`.

The `-vsx -rs --pdb` options will run tests in a verbose manner and output the
reason why tests were skipped (if any were skipped). If there are any failing
tests, `py.test` will stop on the first failure and drop you into a [pdb++][]
debugger session.

See the [debugging section][] of the README for tips on using the debugger and
setting breakpoints (in the actual [project code][], or in the [test code][]).

```
% venv/bin/py.test
```

or

```
% venv/bin/python3 setup.py test
```

> Note: This option requires `setuptools` to be installed.

## Usage

The `rh-download-examples`, `rh-download-scripts`, `rh-notes`, and `rh-shell`
scripts are provided.

```
$ venv/bin/rh-download-examples --help
Usage: rh-download-examples [OPTIONS] [DIRECTORY]

  Download redis-helper example files from github

Options:
  --help  Show this message and exit.

$ venv/bin/rh-download-scripts --help
Usage: rh-download-scripts [OPTIONS] [DIRECTORY]

  Download redis-helper script files from github

Options:
  --help  Show this message and exit.

$ venv/bin/rh-notes --help
Usage: rh-notes [OPTIONS] [TOPIC]

  Prompt user to enter notes (about a topic) until finished; or review notes

Options:
  -c, --ch TEXT  string appended to the topic (default "> ")
  -s, --shell    Start an ipython shell to inspect the notes collection
  --help         Show this message and exit.

$ venv/bin/rh-shell --help
Usage: rh-shell [OPTIONS]

  Interactively select a Collection model and start ipython shell

Options:
  --help  Show this message and exit.
```

```python
>>> import redis_helper as rh
>>> collection = rh.Collection(..., index_fields='field1, field3')
>>> hash_id = collection.add(field1='', field2='', field3='', ...)
>>> collection.add(...)
>>> collection.add(...)
>>> collection.update(hash_id, field1='', field4='', ...)
>>> change_history = collection.old_data_for_hash_id(hash_id)
>>> data = collection.get(hash_id)
>>> some_data = collection.get(hash_id, 'field1, field3')
>>> results = collection.find(...)
>>> results2 = collection.find('field1:val, field3:val', ...)
>>> results3 = collection.find(..., get_fields='field2, field4')
>>> counts = collection.find(count=True, ...)
>>> top_indexed = collection.index_field_info()
>>> collection.delete(hash_id, ...)
```

## Basics - Part 1 (request logging demo)

[rh-basics-1 1:10]: https://asciinema.org/a/101422?t=1:10
[rh-basics-1 3:14]: https://asciinema.org/a/101422?t=3:14
[rh-basics-1 4:22]: https://asciinema.org/a/101422?t=4:22
[rh-basics-1 6:11]: https://asciinema.org/a/101422?t=6:11
[rh-basics-1 7:00]: https://asciinema.org/a/101422?t=7:00
[rh-basics-1 8:37]: https://asciinema.org/a/101422?t=8:37
[rh-basics-1 10:33]: https://asciinema.org/a/101422?t=10:33
[rh-basics-1 11:27]: https://asciinema.org/a/101422?t=11:27
[rh-basics-1 14:30]: https://asciinema.org/a/101422?t=14:30
[rh-basics-1 15:54]: https://asciinema.org/a/101422?t=15:54
[request_logs.py]: https://github.com/kenjyco/redis-helper/blob/master/examples/request_logs.py

[Demo][request logging demo] bookmarks:

- [1:10][rh-basics-1 1:10] is when the `ipython` session is started with
  `venv/bin/ipython -i request_logs.py`
- [3:14][rh-basics-1 3:14] is when a second `ipython` session is started (in a
  separate tmux pane) to simulate a steady stream of requests with
  `slow_trickle_requests(randomsleep=True, show=True)`
- [4:22][rh-basics-1 4:22] is when the `index_field_info` method is used to
  get the latest counts of top indexed items
- [6:11][rh-basics-1 6:11] is when `slow_trickle_requests(.001)` is run to
  simulate a large quick burst in traffic
- [7:00][rh-basics-1 7:00] is when multiple values are passed in the `since`
  argument of `find`... `request_logs.find(count=True, since='5:min, 1:min,
  30:sec')`
- [8:37][rh-basics-1 8:37] is when `get` and `get_by_position` methods are used
  with a variety of arguments to change the structure of what's returned
- [10:33][rh-basics-1 10:33] is when the `redis_helper.ADMIN_TIMEZONE` is
  changed at run time from `America/Chicago` to `Europe/London`
- [11:27][rh-basics-1 11:27] is when `find` is used with a variety of arguments
  to change the structure of what's returned
- [14:30][rh-basics-1 14:30] is when `find` is used with multiple search terms
  and multiple `since` values... `request_logs.find('host:dogs.com,
  uri:/breeds', count=True, since='5:min, 1:min, 10:sec')`
- [15:54][rh-basics-1 15:54] is when the `update` method is used to modify data
  and change history is retrieved with the `old_data_for_hash_id` method

The first demo walks through the following:

- creating a virtual environment, installing redis-helper, and downloading
  example files

    ```
    $ python3 -m venv venv
    $ venv/bin/pip3 install redis-helper ipython
    $ venv/bin/rh-download-examples
    $ cat ~/.config/redis-helper/settings.ini
    $ venv/bin/ipython -i request_logs.py
    ```
- using the sample `Collection` defined in [request_logs.py][] to
    - show values of some properties on a `Collection`
        - `redis_helper.Collection._base_key`
        - `redis_helper.Collection.now_pretty`
        - `redis_helper.Collection.now_utc_float`
        - `redis_helper.Collection.keyspace`
        - `redis_helper.Collection.size`
        - `redis_helper.Collection.first`
        - `redis_helper.Collection.last`
    - show values of some settings from `redis_helper`
        - `redis_helper.APP_ENV`
        - `redis_helper.REDIS_URL`
        - `redis_helper.REDIS`
        - `redis_helper.SETTINGS_FILE`
        - `redis_helper.ADMIN_TIMEZONE`
    - show output from some methods on a `Collection`
        - `redis_helper.Collection.index_field_info()`
        - `redis_helper.Collection.find()`
        - `redis_helper.Collection.find(count=True)`
        - `redis_helper.Collection.find(count=True, since='30:sec')`
        - `redis_helper.Collection.find(since='30:sec')`
        - `redis_helper.Collection.find(since='30:sec', admin_fmt=True)`
        - `redis_helper.Collection.find(count=True, since='5:min, 1:min, 30:sec')`
        - `redis_helper.Collection.find('index_field:value')`
        - `redis_helper.Collection.find('index_field:value', all_fields=True, limit=2)`
        - `redis_helper.Collection.find('index_field:value', all_fields=True, limit=2, admin_fmt=True, item_format='{_ts} -> {_id}')`
        - `redis_helper.Collection.find('index_field:value', get_fields='field1, field2', include_meta=False)`
        - `redis_helper.Collection.find('index_field1:value1, index_field2:value2', count=True)`
        - `redis_helper.Collection.find('index_field1:value1, index_field2:value2', count=True, since='5:min, 1:min, 10:sec')`
        - `redis_helper.Collection.get(hash_id)`
        - `redis_helper.Collection.get(hash_id, 'field1,field2,field3')`
        - `redis_helper.Collection.get(hash_id, include_meta=True)`
        - `redis_helper.Collection.get(hash_id, include_meta=True, fields='field1, field2')`
        - `redis_helper.Collection.get(hash_id, include_meta=True, item_format='{_ts} -> {_id}')`
        - `redis_helper.Collection.get_by_position(0)`
        - `redis_helper.Collection.get_by_position(0, include_meta=True, admin_fmt=True)`
        - `redis_helper.Collection.update(hash_id, field1='value1', field2='value2')`
        - `redis_helper.Collection.old_data_for_hash_id(hash_id)`

## Basics - Part 2 (urls demo, with unique field)

[urls.py]: https://github.com/kenjyco/redis-helper/blob/master/examples/urls.py

[Demo][urls demo] bookmarks:

- `TODO`

The second demo walks through the following:

- using the sample `Collection` defined in [urls.py][] to
    - `TODO`

## Settings, environments, testing, and debugging

To trigger a debugger session at a specific place in the [project code][],
insert the following, one line above where you want to inspect

```
import pdb; pdb.set_trace()
```

To start the debugger inside [test code][], use

```
pytest.set_trace()
```

- use `(l)ist` to list context lines
- use `(n)ext` to move on to the next statement
- use `(s)tep` to step into a function
- use `(c)ontinue` to continue to next break point (i.e. `set_trace()` lines in
  your code)
- use `sticky` to toggle sticky mode (to constantly show the currently executing
  code as you move through with the debugger)
- use `pp` to pretty print a variable or statement

If the redis server at `redis_url` (in the **test section** of
`~/.config/redis-server/settings.ini`) is not running or is not empty, redis
server tests will be skipped.

Use the `APP_ENV` environment variable to specify which section of the
`settings.ini` file your settings will be loaded from. Any settings in the
`default` section can be overwritten if explicity set in another section.

- if no `APP_ENV` is explicitly set, `dev` is assumed
- the `APP_ENV` setting is overwritten to be `test` no matter what was set when
  calling `py.test` tests

repository: kenjyco/redis-helper

repo_name: kenjyco/redis-helper


text:
# SafeQueue
This thread-safe queue implementation supports multiple providers and consumers. The `Provide(T&& item)` function can be called with a rvalue reference.  The `Consume(T& item)` function returns immediately with a boolean value, indicator of success. The `ConsumeSync(T& item)` method will block the calling thread until it can take an item from the queue. The `Finish` method stops all the waiting consumers (ConsumeSync), and make them return false.

## Example

Privider:

```c++
SafeQueue<MyType> queue;

// insert elements
queue.Provide(std::move(var1));
queue.Provide(std::move(var2));
```
Non-blocking consumer:

```c++
SafeQueue<MyEvent> event_queue;

// Game loop
while(!quit) {

	MyEvent event;
	while(event_queue.Consume(event)) {
		// Process the event
	}

	UpdateWorld();
	Render();
}
```

Blocking consumer:

```c++
SafeQueue<MyMessage> message_queue;

std::thread consumer([&](){
	MyMessage message;
	while(message_queue.ConsumeSync(message)) {
		// Process the message
	}
});

// ...
```

repository: lxlyh/SafeQueue

repo_name: lxlyh/SafeQueue


text:
---
title: "Somatic awakening"
created_at: 2020-01-26T22:22:29.000Z
published_at: 2020-01-26T22:39:49.000Z
---
I recently learned these two words from a friend who's into biohacking. He related his own experience of doing fasting, and how he went from having no boundaries between work and life, to now having no 'choice' but be dictated by what his body needs for optimal health.

It's as if the body had awakened to its own power, and now has a voice that makes us do what it needs to thrive. On the outside, it looks like we simply start to take heed and listen to the body, rather than drive it like a slave to your goals and ambitions.

Indeed, once I ceded ground in my priorities and my mind to my body and my health, I now cannot help but get stopped by my body whenever I push myself too hard. Just like this month. Strained a muscle during a workout. Getting ill again. Feeling low energy and hardly operating at peak.

The body is my harshest teacher.

All these are signals telling me I'm doing something wrong. AGAIN. And I cannot help but hear and heed. It sounds like it's an intellectual choice, but it isn't. Intellect has nothing here. A certain somatic/bodily wisdom is at play here.

A somatic awakening.


text:
## Release summary

This is a small release to fix a few bugs that have become apparent since initial release.

## Test environments
* local OS X install, R 3.4.0
* ubuntu 12.04 (on travis-ci), R 3.4.0
* win-builder (devel and release)

## R CMD check results

0 errors | 0 warnings | 0 notes

## Reverse dependencies

I ran R CMD check all 9 reverse dependencies with no problems

repository: refik/dbplyr

repo_name: refik/dbplyr


text:
# This project is being abandonned in favor of bindings with telegram's tdlib

**Telegram released a C++ library with a JSON interface. Since MTProto is a
pain to implement, I drop this project (= native implementation in elixir) in
favor of [elixir-tdlib](https://gitlab.com/Fnux/elixir-tdlib).**

----

# Telegram MT(Proto)

[MTProto](https://core.telegram.org/mtproto) implementation in elixir.
The project is still in *alpha* : **Expect things to break**.
Note that it's my fisrt real elixir project, so it's probably awful.

This library is on [hex.pm](https://hex.pm/packages/telegram_mt) and
the documentation is available [here](https://hexdocs.pm/telegram_mt/MTProto.html).

## Useful links

  * [Github repository](https://github.com/Fnux/telegram-mt-elixir)
  * [Demo app](https://github.com/Fnux/telegram-client-elixir-demo)
  * [Telegram API](https://core.telegram.org/api#telegram-api)
  * [MTProto's documentation](https://core.telegram.org/mtproto)

## Status & Roadmap

Version `v0.1.1-alpha` has been released ([changelog](changelog.md)).

**Status :** you currently can signin, receive and send message, fetch
contacts and chats, save and restore sessions.

## Configuration

Don't forget to add (and fill!) the following to your `config.exs` :

```
# You can find your API ID and API HASH on https://my.telegram.org/
config :telegram_mt,
  api_id: "00000", # Required.
  api_hash: "00000", # Required.
  msg_max_retry_count: 2, # Required. Maximum number of retry for a failed message.
  public_key: "public_key" # Optional. Custom path for Telegram's public key.

# Optional. Custom configuration for the `telegram_tl` library.
config :telegram_tl, tl_path: "/path/to/mtproto.json",
  api_version: 57,
  api_path: "/path/to/api-layer-57.json"
```

## Overview

This library allows you to handle mutiple users, which is fondamental since
it was originally designed to build bridges between Telegram
and other messaging services. Each session is equivalent to an user and has
its own connection to Telegram's servers. Note that you have to set
(see `MTProto.Session.set_client/2`) a process to be notified of incoming
messages for every session.

* `MTProto` (this module) - provides a "friendly" way to interact with
'low-level' methods. It allow you to connect/login/logout/send messages.
* `MTProto.API` (and submodules) - implementation of the Telegram API, as explained
[here](https://core.telegram.org/api#telegram-api) and
[here](https://core.telegram.org/schema).
* `MTProto.Session` : Provides manual control over sessions.
* `MTProto.DC` : Provides manual control over DCs.
* Many modules **[1]** are not designed to be used by
the "standard" user hence not documented here.

**[1]** : `MTProto.Session.Brain`, `MTProto.Session.Handler`,
  `MTProto.Session.HandlerSupervisor`, `MTProto.Session.Listener`,
  `MTProto.Session.ListenerSupervisor`, `MTProto.Auth`, `MTProto.Crypto`,
  `MTProto.Method`, `MTProto.Payload`, `MTProto.Registry`,
  `MTProto.Supervisor` and `MTProto.TCP`.

Each session has one listener and one handler (they are registered in the
`SessionRegistry` registry). The `DCRegistry` registry saves the data related to each specific DC
(Telegram uses 5 DCs) such as the address or the authorization key.

## Example

```
» iex -S mix

Interactive Elixir (1.4.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> MTProto.start()

09:41:19.160 [info]  Starting Telegram MT.
{:ok, #PID<0.164.0>}

iex> {:ok, session_id} = MTProto.connect(4) # Connect to DC 4

09:42:02.934 [debug] [Handler]<PHONE_NUMBER>678255187 : starting handler.
09:42:02.935 [debug] [Listener]<PHONE_NUMBER>678255187 : starting listener.
{:ok,<PHONE_NUMBER>678255187}

iex> MTProto.request_authkey(session_id)

09:43:21.153 [debug] Requesting authorization key for session<PHONE_NUMBER>678255187...
09:43:21.993 [debug] The authorization key was successfully generated.

iex> MTProto.send_code(session_id, "0041123456789")

No client for<PHONE_NUMBER>678255187, printing to console.
{5144610857678255187,
 %{msg_id:<PHONE_NUMBER>561167361, name: "rpc_result",
   req_msg_id:<PHONE_NUMBER>160060928,
   result: %{is_password: %{name: "boolFalse"}, name: "auth.sentCode",
     phone_code_hash: "qwertzuiopasdfg123",
     phone_registered: %{name: "boolTrue"}, send_call_timeout: 120}}}

iex> MTProto.sign_in(session_id, "0041123456789", "01234")

No client for<PHONE_NUMBER>678255187, printing to console.
{5144610857678255187,
 %{msg_id:<PHONE_NUMBER>308812801, name: "rpc_result",
   req_msg_id:<PHONE_NUMBER>153065984,
   result: %{expires:<PHONE_NUMBER>, name: "auth.authorization",
     user: %{first_name: "Fnux", id: 122205918, inactive: %{name: "boolFalse"},
       last_name: "", name: "userSelf", phone: "41123456789",
       photo: %{name: "userProfilePhoto",
         photo_big: %{dc_id: 4, local_id: 52832, name: "fileLocation",
           secret:<PHONE_NUMBER>0123456789, volume_id: 430507451},
         photo_id:<PHONE_NUMBER>43897743,
         photo_small: %{dc_id: 4, local_id: 52830, name: "fileLocation",
           secret:<PHONE_NUMBER>12345678, volume_id: 430507451}},
       status: %{name: "userStatusOffline", was_online:<PHONE_NUMBER>},
       username: "fnux_ch"}}}}
```

repository: iCodexDev/telegram-mt-elixir

repo_name: iCodexDev/telegram-mt-elixir


text:
---
layout: default
---

# 1997-10-10 - Re: What's really in PGP 5.5?

## Header Data

From: Adam Back<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 64f7a3260e78fffc367d6d4730186d78cf4635eb4e2ba27b2019df4505beb5d9

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-10-10 10:51:06 UTC

Raw Date: Fri, 10 Oct 1997 18:51:06 +0800

## Raw message

```
{% raw  %}From: Adam Back<EMAIL_ADDRESS>Date: Fri, 10 Oct 1997 18:51:06 +0800
To<EMAIL_ADDRESS>Subject: Re: What's really in PGP 5.5?
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

James Donald<EMAIL_ADDRESS>writes:
> At 02:27 PM 10/7/97 -0700, Jon Callas wrote:
> [Explaining PGP's rather alarming "data recovery" features.]
>
> Sending a copy to the boss of everything Alice sends is OK.
>
> If Alice wants to send something her boss should not read, perhaps she
> should use her private account, rather than a company paid account.
>
> Sending a copy of everything Alice receives to the boss or HR is not OK.
>
> Alice should get to control it.

I'm not sure I see why you draw this distinction.

Is it because the person sending may intend the message for Alice
only?  If so I think Jon said that all current versions of PGP warn
the user that their is a company escrow situation when you send to the
key (this information being in attributes of the key).

Snooping Alice's outgoing traffic, and snooping Alice's incoming
traffic are similarly little brotherish in my view.

If the company has an approval system for official statements (seems
reasonable, if it's a press release, important contractual decision,
etc), then Alice can send a copy to the legal beagles for the ok, and
they can send it on.

> It would be acceptable for the company system to keep track of what
> Alice has received, and flag "Alice received something, and has not
> yet filed the cleartext copy with us"

I figure this is fair game also... clearly they can see the traffic
coming into LAN and being delivered to Alice's mailbox.

> It is not acceptable to just plain snoop on what Alice receives.

I don't like it either.  But how is this so different from snooping on
what Alice sends.

> Furthermore any auto-snoop feature sets a very dangerous precedent.

Agree.

> It is politically a lot more difficult for the FBI to mandate that they
> can recover your data, if such a mandate leads to the message flashing up,
> "now sending a copy to the FBI" every time you decrypt something.

I was arguing earlier that the way for the company to do archiving of
received encrypted email was for archive copy to be taken after the
employee has decrypted it.  The employee should be made aware that the
received email is being archived.

Adam
--
Now officially an EAR violation...
Have *you* exported RSA today? --> http://www.dcs.ex.ac.uk/~aba/rsa/

print pack"C*",split/\D+/,`echo "16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<>
)]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`

{% endraw %}
```

## Thread

+ Return to [October 1997](/archive/1997/10)

+ Return to "[Adam Back <aba@dcs.ex.ac.uk>](/authors/adam_back_aba_at_dcs_ex_ac_uk_)"
+ Return to "["James A. Donald" <jamesd@echeque.com>](/authors/james_a_donald_jamesd_at_echeque_com_)"
+ Return to "[Kent Crispin <kent@bywater.songbird.com>](/authors/kent_crispin_kent_at_bywater_songbird_com_)"

+ 1997-10-09 (Fri, 10 Oct 1997 07:13:15 +0800) - [Re: What's really in PGP 5.5?](/archive/1997/10/25866d3eb41f2adc825030cbec9c1792f46a306665364df184447a26f2e1c44a) - _"James A. Donald"<EMAIL_ADDRESS>  + 1997-10-10 (Fri, 10 Oct 1997 18:51:06 +0800) - Re: What's really in PGP 5.5? - _Adam Back<EMAIL_ADDRESS>  + 1997-10-13 (Mon, 13 Oct 1997 17:30:48 +0800) - [Re: What's really in PGP 5.5?](/archive/1997/10/6e29fc89f454468ea7e17fa60ef6f2f70f5f2711009dc448b68e3cb3c864beb3) - _Kent Crispin<EMAIL_ADDRESS>


text:
---
title: 1U Rack UPS Units
date: 2016-05-21T05:24:00+00:00
author: gerryw1389
layout: single
classes: wide
permalink: /2016/05/1u-rack-ups-units/
categories:
  - Hardware
---
<!--more-->

### Description:

At my current job, we use in-line UPS units to power our servers. There is a couple advantages to this but the main ones include:

1. The servers get filtered power to them at a constant rate. Spikes in power don't effect our servers because they plug into the batteries which are then plugged into the wall. In event of a brief power surge, they will keep going like nothing ever happened.

2.  Our servers have run times of over a couple hours each. Not just servers, but our networking equipment rack as well.

### To Resolve:

1. We have 3 networking racks with sets of 3 “SMX2000RMLV2U APC Smart-UPS X 2000VA Rack/Tower LCD 100-127V” units on each. The way it works is you place each battery on bottom and then the unit with the LCD display on top. You then plug battery 3 into battery 2 and then battery 2 into the controler unit.

2. In the event the batteries go bad in these, you just buy replacement batteries and hook them up as follows:

   - ![battery-alignment](https://automationadmin.com/assets/images/uploads/2016/09/battery-alignment.jpg){:class="img-responsive"}


text:
# Spatial-RNN

It is the repository of pytorch implementation of the ECCV 2016 paper:
Learning Recursive Filters for Low-Level Vision via a Hybrid Neural Network.

The official implementation (Caffe version) can be accessed from
[here](https://github.com/Liusifei/caffe-lowlevel).

## Introduction
This paper proposed a hybrid neural network incorporating several spatially variant recurrent neural networks (RNNs)
as equivalents of a group of distinct recursive filters for each pixel. With the spatial RNN, we can tackle a lot of
low-level task including Edge-preserving Smoothing, Denoising, Inpainting and color interpolation.

Although the spatial RNN introduce a deep CNN, however, the deep CNN only learns regulations of recurrent propagation
to guide recurrent propagation over an entire image. That is to say, the deep CNN is not responsible
for extracting complicated image features, so that it doesn't require convolutional layer with large channels,
which makes it lighter for Image Processing. Therefore, the spatial RNN can be faster than the traditional CNN methods.

## Prerequisites
### PyTorch
Our implementation is based on PyTorch 1.4.0 ([https://pytorch.org/](https://pytorch.org/)) .

### matplotlib
For loading and saving images. Version: 2.2.2

### CUDA \[optional\]
CUDA is suggested ([https://developer.nvidia.com/cuda-toolkit]https://developer.nvidia.com/cuda-toolkit) for fast inference.
The demo code is still runnable without CUDA, but much slower.

## Installation
Our current release has been tested on Ubuntu 16.04 LTS.

### Clone the repository
```shell script
git clone https://github.com/Coldog2333/Spatial-RNN.git
```

### Install some required packages

### Download tiny MSCOCO dataset (1% of MSCOCO)
You would like to have a quick start to understand how Spatial-RNN does.
Then you can download the tiny MSCOCO dataset and have a try.
The tiny MSCOCO dataset is chosen randomly from
the origin [MSCOCO 2017 dev dataset](http://images.cocodataset.org/zips/val2017.zip).

You can download the tiny-MSCOCO from [here](http://coldog.cn/dataset/tiny-MSCOCO.zip) and unzip the data.
Or you can just simply run the shell script like

```shell script
sh download_dataset.sh
```

### Preprocessing
After downloading and unziping the dataset, you should do some preprocessing to generate the data for training and testing.

Here provided a preprocessing script for generate 96x96 image patches as the paper suggested.
And it can also generate the corresponding patches with white Gaussian noise.

```shell script
python3 preprocessing.py --command generate_train_test_set --augment 10
```

## Train
```shell script
python3 main.py
```

## References
1. Liu, Sifei, Jinshan Pan, and Ming-Hsuan Yang. "Learning recursive filters for low-level vision via a hybrid neural network." European Conference on Computer Vision. Springer, Cham, 2016.


text:
---
layout: default
---

# 1997-07-07 - Re: Hoarding

## Header Data

From: Tim May<EMAIL_ADDRESS>To: Steve Schear<EMAIL_ADDRESS>Message Hash: c650f5a42f205a0b08d25cd0db5a8b5af3222b471fb6aaee4fcec90a38a8a482

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-07-07 20:46:55 UTC

Raw Date: Tue, 8 Jul 1997 04:46:55 +0800

## Raw message

```
{% raw  %}From: Tim May<EMAIL_ADDRESS>Date: Tue, 8 Jul 1997 04:46:55 +0800
To: Steve Schear<EMAIL_ADDRESS>Subject: Re: Hoarding
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 12:48 PM -0700 7/7/97, Steve Schear wrote:
>I heard yesterday, second hand, that hoarding of large amounts of food is
>now a federal crime.  The explanation I heard was that it was intended to
>thwart militias.  Has anyone else on the list heard this loony info?
>

This rumor floats through alt.survival and misc.survival about once every
few weeks. Usually someone claims they "heard" this, but no one can produce
a cite for an actual law.

(Eventually someone steps forward and mentions the various Economic
Emergency Powers Act provisions, and this feeds the rumors further...in a
few weeks, when someone else announces they've "heard" this.)

The Mormons and other religious groups are well known to stockpile large
amounts of food. I recall that good Mormons are supposed to have on the
order of  a year's supply of food.

The effect on militia activities is nil, and even a law which made felons
of most Mormons and prepared folks would have no effect on militias.

--Tim May

There's something wrong when I'm a felon under an increasing number of laws.
Only one response to the key grabbers is warranted: "Death to Tyrants!"
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Higher Power: 2^1398269     | black markets, collapse of governments.
"National borders aren't even speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [July 1997](/archive/1997/07)

+ Return to "[Alan <alano@teleport.com>](/authors/alan_alano_at_teleport_com_)"
+ Return to "[Mismatched NFS IDs <nobody@toad.com>](/authors/mismatched_nfs_ids_nobody_at_toad_com_)"
+ Return to "[Robert Hettinga <rah@shipwright.com>](/authors/robert_hettinga_rah_at_shipwright_com_)"
+ Return to "[Steve Schear <azur@netcom.com>](/authors/steve_schear_azur_at_netcom_com_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1997-07-07 (Tue, 8 Jul 1997 03:55:41 +0800) - [Hoarding](/archive/1997/07/c1919bf77404af936d0cc4056e6603119fbbcfa4e5329e66cf3629a4b339aa7b) - _Steve Schear<EMAIL_ADDRESS>  + 1997-07-07 (Tue, 8 Jul 1997 04:15:50 +0800) - [Re: Hoarding](/archive/1997/07/360b80ab3754f104d7e06c009fe80b10008d33e56ba9024177e749d0038c2c54) - _Alan<EMAIL_ADDRESS>  + 1997-07-07 (Tue, 8 Jul 1997 04:20:12 +0800) - [Re: Hoarding](/archive/1997/07/5439d33b27ac44e8f8728a6fe549123d368060b946c42a0cc0a546243284e9d1) - _Robert Hettinga<EMAIL_ADDRESS>    + 1997-07-07 (Tue, 8 Jul 1997 06:26:07 +0800) - [Re: Hoarding](/archive/1997/07/97439c01db3e582c6fc80b8fe2c45fb8c71b51d641ae3c65227390b642b177bd) - _Mismatched NFS IDs<EMAIL_ADDRESS>  + 1997-07-07 (Tue, 8 Jul 1997 04:46:55 +0800) - Re: Hoarding - _Tim May<EMAIL_ADDRESS>    + 1997-07-07 (Tue, 8 Jul 1997 06:06:59 +0800) - [Re: Hoarding](/archive/1997/07/dd2745d821f7290be9391d7c4cec18cd71756936a811d3f6da31e3e880edbc4c) - _Alan<EMAIL_ADDRESS>