text:
### 2017-06-28
diff between today and yesterday

#### python
* [warner/magic-wormhole](https://github.com/warner/magic-wormhole): get things from one computer to another, safely
* [hoburg/gpkit](https://github.com/hoburg/gpkit): Python package for defining and manipulating geometric programming models.
* [requests/requests](https://github.com/requests/requests): Python HTTP Requests for Humans
* [tkipf/gae](https://github.com/tkipf/gae): Implementation of Graph Auto-Encoders in TensorFlow
* [littlecodersh/ItChat](https://github.com/littlecodersh/ItChat): A complete and graceful API for Wechat.
* [ansible/ansible](https://github.com/ansible/ansible): Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.
* [ethereum/pyethereum](https://github.com/ethereum/pyethereum): Next generation cryptocurrency network

#### go
* [junegunn/fzf](https://github.com/junegunn/fzf):  A command-line fuzzy finder written in Go
* [syncthing/syncthing](https://github.com/syncthing/syncthing): Open Source Continuous File Synchronization
* [github/gh-ost](https://github.com/github/gh-ost): GitHub's Online Schema Migrations for MySQL
* [christophberger/goman](https://github.com/christophberger/goman):
* [coreos/etcd](https://github.com/coreos/etcd): Distributed reliable key-value store for the most critical data of a distributed system
* [spf13/cobra](https://github.com/spf13/cobra): A Commander for modern Go CLI interactions
* [hashicorp/terraform](https://github.com/hashicorp/terraform): Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.
* [orderbynull/lottip](https://github.com/orderbynull/lottip): Simple MySQL proxy for query logging with web GUI

#### cpp
* [baidu/Familia](https://github.com/baidu/Familia): A Toolkit for Chinese Topic Modeling
* [qtumproject/qtum](https://github.com/qtumproject/qtum): Beyond the Qtum prototype
* [mozilla/rr](https://github.com/mozilla/rr): Record and Replay Framework
* [v8/v8](https://github.com/v8/v8): The official mirror of the V8 git repository
* [lyft/envoy](https://github.com/lyft/envoy): C++ front/service proxy
* [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
* [fmtlib/fmt](https://github.com/fmtlib/fmt): Small, safe and fast formatting library
* [CMU-Perceptual-Computing-Lab/openpose](https://github.com/CMU-Perceptual-Computing-Lab/openpose): OpenPose: A Real-Time Multi-Person Keypoint Detection And Multi-Threading C++ Library
* [EOSIO/eos](https://github.com/EOSIO/eos):
* [facebook/osquery](https://github.com/facebook/osquery): SQL powered operating system instrumentation, monitoring, and analytics.

#### javascript
* [icymind/VRouter](https://github.com/icymind/VRouter):  Virtualbox  openwrt ,  OSX (MacOS) .
* [narendrashetty/travel-RN](https://github.com/narendrashetty/travel-RN):
* [developit/preact](https://github.com/developit/preact):  Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM.
* [tkh44/emotion](https://github.com/tkh44/emotion):  high performance js for your css
* [airbnb/javascript](https://github.com/airbnb/javascript): JavaScript Style Guide
* [rtsao/styletron](https://github.com/rtsao/styletron):  Universal, high-performance JavaScript styles
* [github/lightcrawler](https://github.com/github/lightcrawler): Crawl a website and run it through Google lighthouse
* [akveo/react-native-ui-kitten](https://github.com/akveo/react-native-ui-kitten):  Customizable and reusable react-native component kit

#### coffeescript
* [sparanoid/chinese-copywriting-guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines): Chinese copywriting guidelines for better written communication
* [cakecatz/flex-toolbar](https://github.com/cakecatz/flex-toolbar): Easily Customizable Toolbar for Atom
* [peerlibrary/meteor-blaze-components](https://github.com/peerlibrary/meteor-blaze-components): Reusable components for Blaze
* [resin-io/resin-sdk](https://github.com/resin-io/resin-sdk): The SDK to make Resin.io powered JavaScript applications.
* [richrace/highlight-selected](https://github.com/richrace/highlight-selected): Highlights the current word selected when double clicking
* [gkoo/hubot-maps](https://github.com/gkoo/hubot-maps): A Hubot script for searching maps and directions
* [slackapi/hubot-slack](https://github.com/slackapi/hubot-slack): Slack Developer Kit for Hubot
* [dodo/node-slug](https://github.com/dodo/node-slug): slugifies even utf-8 chars!


text:
# Metrics

This section describes how to generate, store and query metrics data.

## Overview

These are the units you can embed into your application:

  * `gopi.Metrics` Define and emit metric information;
  * `gopi.MetricWriter` Write metrics to data storage or file.

These are examples you can look at which demonstate the features:

  * (`argonone`)[https://github.com/djthorpe/gopi/tree/master/cmd/argonone] demonstrates storing metrics
    for CPU temperature and fan speed.

repository: windhooked/gopi

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: windhooked/gopi


text:
---
layout: default
---

# 1996-02-09 - Re: Mailing list

## Header Data

From: JOHN MARTIN LEWARS<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: ffedb31b4509632df4a09d2f5d455fee2b5f47d8d2df1439ddf7cb099e4bbbd6

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-02-09 00:14:23 UTC

Raw Date: Fri, 9 Feb 1996 08:14:23 +0800

## Raw message

```
{% raw  %}From: JOHN MARTIN LEWARS<EMAIL_ADDRESS>Date: Fri, 9 Feb 1996 08:14:23 +0800
To<EMAIL_ADDRESS>Subject: Re: Mailing list
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

When I wrote:
>   Please make me apart of your mailing list.
I meant:
    Please take me apart on your mailing list.
Thanks, Jack.

{% endraw %}
```

## Thread

+ Return to [February 1996](/archive/1996/02)

+ Return to "[JOHN MARTIN LEWARS <jml216@psu.edu>](/authors/john_martin_lewars_jml216_at_psu_edu_)"

+ 1996-02-09 (Fri, 9 Feb 1996 08:14:23 +0800) - Re: Mailing list - _JOHN MARTIN LEWARS<EMAIL_ADDRESS>

license: MIT

gha_license_id: MIT


text:
# Contributing

When contributing to this repository, it's better first discuss the change you wish to make via issue, email, or any other method with the maintainers of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

I'll check out your contribution if you have a clear and comprehensive description for your changes in pull request.

repository: AlexandrSafonov/browsers-support-badges

repo_name: AlexandrSafonov/browsers-support-badges


text:
![](https://heatbadger.now.sh/github/readme/contributte/playground/)

Website 🚀 contributte.org | Contact 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte

This is example of `contributte/pdf` usage for Nette Framework.

## Installation

To install use [Composer](https://getcomposer.org).

```bash
composer install
```

## See

Visit HomepagePresenter through browser.

## Documentation

For details on how to use Nettrine packages, check out our documentations:
- [contributte/pdf](https://contributte.org/packages/contributte/pdf.html)

## Development

See [how to contribute](https://contributte.org/contributing.html) to this package.

This package is currently maintaining by these authors.

-----

Consider to [support](https://contributte.org/partners.html) **contributte** development team.
Also thank you for using this package.

repository: MartinKokesCz/playground

repo_name: MartinKokesCz/playground


text:
Vimeo Depth Viewer

An OpenGL application for viewing depth and color video streams from Intel RealSense cameras (D415/D435).

This repository consists of tools and demos presented at the Volumetric Filmmaking meetup at NYC.
 Watch the live-stream from the meetup or checkout the WebVR examples.

Looking for a simpler solution that doesn't require code? head over to Depthkit to learn more, our WebVR examples fully support it

1. [Quick-start](#quick-start)
1. [Features](#features)
1. [Build from source](#build-from-source)
1. [Dependencies](#dependencies)
1. [License](#license)

# Quick-start
Make you get either the Intel [RealSense D415/D435](https://click.intel.com/intelr-realsensetm-depth-camera-d415.html). We peronsally prefered working with the D415, as it proved more reliable, but both work with this software. To quickly get started, download a pre-built release of the depth-viewer [from here](https://github.com/vimeo/depth-viewer/releases) or [build it from source](#build-from-source). Once you have a binary launch it by double clicking it or calling `./VimeoDepthViewer` from the folder and you should be good to go.

# Features
- [x] An easy to use interface based on [nanogui](https://github.com/wjakob/nanogui).
- [x] Depth clipping for easy background removal.
- [x] Seprate stream view and monitor window for capturing and live streaming a full window using [OBS](http://obsproject.com)
- [x] Depth filtering (decimation, spatial and temporal filters)
- [x] Fully `git submodules` and `CMake` for easy set up

# Build from source
All 3rd party libraries used are included as `git submodules` to ease the setup and development process, it should be easy to clone using the `--recursive` flag and build everything from source.
1. Make sure you have `CMake` installed, for macOS, install [Homebrew](https://brew.sh) and run
```sh
brew install cmake
```
2. Clone the repository including all the submodules:
```
git clone https://github.com/vimeo/depth-viewer.git --recursive
```
3. Go inside the folder and create a build folder by running `cd vimeo-depth-viewer && mkdir build`
4. Run `CMake` by calling `cmake ../` from the build folder
5. Run `make` to build an executable
6. Run the executable by running `./VimeoDepthViewer`

> Tested on macOS v10.13.4 & CMake v3.11.4

# Dependencies
1. [GLFW](https://github.com/glfw/glfw)
1. [nanogui](https://github.com/wjakob/nanogui)
1. [Eigen](https://github.com/libigl/eigen)
1. [librealsense2](https://github.com/IntelRealSense/librealsense)

# License
License file could be [found here](https://github.com/vimeo/vimeo-depth-viewer/blob/master/LICENSE)

# Questions, help, and support
For questions and support, [ask on StackOverflow](https://stackoverflow.com/questions/ask/?tags=vimeo). If you found a bug, please file a [GitHub issue](https://github.com/vimeo/vimeo-depth-viewer/issues).

Make pull requests, file bug reports, and make feature requests via a [GitHub issue](https://github.com/vimeo/vimeo-depth-viewer/issues).

repository: gynsolomon/vimeo-depth-viewer

repo_name: gynsolomon/vimeo-depth-viewer


text:
# The `pyveg` Package

## Introduction

The `pyveg` package is developed to study the evolution of vegetation patterns in semi-arid environments using data downloaded from Google Earth Engine.

The code in this repository is intended to perform two main tasks:

**1. Download and process GEE data**:

* Download satellite data from Google Earth Engine (images and weather data).
    * Downloaded images are divided into 50x50 pixel sub-images, network centrality metrics are used to describe the pattern vegetation are then calculated on the sub-image level. Both colour (RGB) and Normalised Difference Vegetation Index (NDVI) images are downloaded and stored on the sub-image level.
    * For weather collections the precipitation and temperature "images" are averaged into a single value at each point in the time series.
* The download job is fully specified by a configuration file that can be generated by specifying the details of the data to be downloaded via prompts (satellite to use, coordinates, time period, number of time points, etc.).

**2. Time series analysis on downloaded data**:

* Time series analysis of the following metrics: raw NDVI mean pixel intensity across the image, vegetation network centrality metric, and precipitation.
    * The time series are processed (outliers removed and resampled to avoid gaps). All time series of each sub-image are aggregated into one summary time series that is used for analysis.
    * The summary time series is de-seasonalised and smoothed.
    * Residuals between the raw and de-seasonalised and smoothed time series are calculated and used for an early warning resilience analysis.

* Time series plots are produced, along with auto- and cross-correlation plots. Early warning signals are also computed using the [ewstools package](https://github.com/ThomasMBury/ewstools), including Lag-1 autocorrelation and standard deviation moving window plots. A sensitivity and significance analysis is also performed in order to determine whether any trends are statistically significant.
* Time series summary statistics and resilience metrics are saved into files.
* A PDF report is created showcasing the main figures resulting from the analyses.

**Other functionalities**:

`pyveg` also has other minor functionalities:

* Analysis of a collection of summary data that has been created with the `pyveg` pipeline (downloading + time series analysis).
* Simulate the generation and evolution of patterned vegetation
* A stand-alone network centrality estimation for a 50x50 pixel image.
* A functionality to upload results to the Zenodo open source repository

### `pyveg` flow

The diagram below represents the high level flow of the main functionalities of the `pyveg` package. For each main component there is a CLI console scripts defined, that is shown in the diagram.

![The`pyveg` program flow.](paper/pveg_flow.png)

The full ReadTheDocs documentation for this `pyveg` can be found in this [link](https://pyveg.readthedocs.io/en/latest/).

This page contains an installation guide, and some usage examples for this package.

## Installation

`pyveg` requires Python 3.6 or greater. To install, start by creating a fresh `conda` environment.
```
conda create -n veg python=3.7
conda activate veg
```
Get the source.
```
git clone https://github.com/alan-turing-institute/monitoring-ecosystem-resilience.git
```
Enter the repository and check out a relevant branch if necessary (the default `master` branch contains the most up to date stable version of the code).
```
cd monitoring-ecosystem-resilience
```
Install the package using `pip`.
```
pip install .
```
If you are using Windows and encounter issues during this stage, a solution may be found here: https://github.com/NREL/OpenOA/issues/37. If you plan on making changes to the source code, you can instead run `pip install -e .`.

Before using the Google Earth Engine API, you need to sign up with a Google account [here](https://earthengine.google.com/new_signup/), and authenticate.  To authenticate, run
```
earthengine authenticate
```
A new browser window will open. Copy the token from this window to the terminal prompt to complete the authentication process.

### Google Earth Engine

[Google Earth Engine](https://earthengine.google.com) (GEE) is a powerful tool for obtaining and analysing satellite imagery. This directory contains some useful scripts for interacting with the Earth Engine API. The earth engine API is installed automatically as part of the `pyveg` package installation. If you wish to install it separately, you can follow the instructions [here](https://developers.google.com/earth-engine/python_install_manual).

## Downloading data from GEE with ``pyveg``

### Downloading data from GEE using the CLI

To run a `pyveg` download job, use
```
pyveg_run_pipeline --config_file <path to config>
```

The download job is fully specified by a configuration file, which you point to using the `--config_file` argument. A sample config file is found at `pyveg/configs/config_all.py`. You can also optionally specify a string to identify the download job using the `--name` argument.

Note that we use the GEE convention for coordinates, i.e. `(longitude,latitude)`.

#### Generating a download configuration file

To create a configuration file for use in the pyveg pipeline described above, use the command
```
pyveg_generate_config
```
this allows the user to specify various characteristics of the data they want to download via prompts. The list in order is as follows:

* `--configs_dir`: The path to the directory containing the config file, with a default option `pyveg/configs`.

* `--collection_name`: The name of the dataset used in the collection, either Sentinel2, or Landsat 8, 7, 5 or 4.
    *    Sentinel2: [Available from 2015-06-23 at 10m resolution.](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2)
    *    Landsat8: [Available from 2013-04-11 at 30m resolution.](https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C01_T1)
    *    Landsat7: [Available from 1999-01-01 at 30m resolution.](https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LE07_C01_T1)
    *    Landsat5: [Available from 1984-03-10 to 2013-01-31 at 60m resolution.](https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C01_T1)
    *    Landsat4: [Available from 1982-07-16 to 1993-12-14 at 60m resolution.](https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT04_C01_T1)

* `--latitude`: The latitude (in degrees north) of the centre point of the image collection.

* `--longitude`: The longitude (in degrees east) of the centre point of the image collection.

* `--country`: The country (for the file name) can either be entered, or use the specified coordinates to look up the country name from the OpenCage database.

* `--start_date`: The start date in the format ‘YYYY-MM-DD’, the default is ‘2015-01-01’ (or ‘2019-01-01’ for a test config file).

* `--end_date`: The end date in the format ‘YYYY-MM-DD’, the default is today’s date (or ‘2019-03-01’ for a test config file).

* `--time_per_point`: The option to run the image collection either monthly (‘1m’) or weekly (‘1w’), with the default being monthly.

* `--run_mode`: The option to run time-consuming functions on Azure (‘batch’) or running locally on your own computer (‘local’). The default is local. For info about running on Azure go [here](UsingAzure.md).

* `--output_dir`: The option to write the output to a specified directory, with the default being the current directory.

* `--test_mode`: The option to make a test config file, containing fewer months and a subset of sub-images, with a default option to have a normal config file.
    *    By choosing the test config file, the start and end dates (see below) are defaulted to cover a smaller time span.
    *    It is recommended that the test config option should be used purely to determine if the options specified by the user are correct.

* `--n_threads`:  Finally, how many threads the user would like to use for the time-consuming processes, either 4 (default) or 8.

For example:
```
 pyveg_generate_config --configs_dir "pyveg/configs" --collection_name "Sentinel2" --latitude 11.58 --longitude 27.94 --start_date "2016-01-01" --end_date "2020-06-30" --time_per_point "1m" --run_mode "local" --n_threads 4
```

This generates a file named `config_Sentinel2_11.58N_27.94E_Sudan_2016-01-01_2020-06-30_1m_local.py` along with instructions on how to use this configuration file to download data through the pipeline, in this case the following:

```
pyveg_run_pipeline --config_file pyveg/configs/config_Sentinel2_11.58N_27.94E_Sudan_2016-01-01_2020-06-30_1m_local.py
```

Individual options can be specified by the user via prompt. The options for this can be found by typing ```pyveg_generate_config --help```.

### More Details on Downloading

During the download job, `pyveg` will break up your specified date range into a time series, and download data at each point in the series. Note that by default the vegetation images downloaded from GEE will be split up into 50x50 pixel images, vegetation metrics are then calculated on the sub-image level. Both colour (RGB) and Normalised Difference Vegetation Index (NDVI) images are downloaded and stored. Vegetation metrics include the mean NDVI pixel intensity across sub-images, and also network centrality metrics, discussed in more detail below.

For weather collections e.g. the ERA5, due to coarser resolution, the precipitation and temperature "images" are averaged into a single value at each point in the time series.

### Rerunning partially succeeded jobs

The output location of a download job is datestamped with the time that the job was launched.  The configuration file used will also be copied and datestamped, to aid reproducibility.  For example if you run the job
```
pyveg_run_pipeline --config_file pyveg/configs/my_config.py
```
there will be a copy of `my_config.py` saved as `pyveg/configs/cached_configs/my_config_<datestamp>.py`. This also means that if a job crashes or timeouts partway through, it is possible to rerun, writing to the same output location and skipping parts that are already done by using this cached config file.  However, in order to avoid a second datestamp being appended to the output location, use the ```--from_cache``` argument.  So for the above example, the command to rerun the job filling in any failed/incomplete parts would be:
```
pyveg_run_pipeline --config_file pyveg/configs/cached_configs/my_config_<datestamp>.py --from_cache
```

### Using Azure for downloading/processing data

If you have access to Microsoft Azure cloud computing facilities, downloading and processing data can be sped up enormously by using batch computing to run many subjobs in parallel.  See [here](UsingAzure.md) for more details.

### Downloading data using the API

Although `pyveg` has been mostly designed to be used with the CLI as shown above, we can also use `pyveg` functions through the API. A tutorial of how to download data this way is included in the ``notebooks/tutorial_download_and_process_gee_images.ipynb`` notebook tutorial.

## Analysing the Downloaded Data with `pyveg`

### Analysing the Downloaded Data using the CLI

Once you have downloaded the data from GEE, the `pyveg_gee_analysis` command allows you to process and analyse the output. To run:
```
pyveg_gee_analysis --input_dir <path_to_pyveg_download_output_dir>
```
The analysis code preprocesses the data and produces a number of plots. These will be saved in an `analysis/` subdirectory inside the `<path_to_pyveg_download_output_dir>` directory.

Note that in order to have a meaningful analysis, the dowloaded time series should have at least 4 points (and more thant 12
for an early warning analysis) and not being the result of a "test" config file, in this case the analysis fails.

The commands also allows for other options to be added to the execution of the script (e.g. run analysis from a downloaded data in Azure blob storage, define a different output directly, don't include a time series analysis, etc), which can be displayed by typing:

```
pyveg_gee_analysis --help
```

The analysis script executed with the ```pyveg_gee_analysis``` command runs the following steps:

#### Preprocessing

`pyevg` supports the following pre-processing operations:
- Identify and remove outliers from the time series.
- Fill missing values in the time series (based on a seasonal average), or resample the time series using linear interpolation between points.
- Smoothing of the time series using a LOESS smoother.
- Calculation of residuals between the raw and smoothed time series.
- De-seasonalising (using first differencing), and detrending using STL.

#### Plots

In the `analysis/` subdirectory, `pyveg` creates the following plots:
- Time series plots containing vegetation and precipitation time series (seasonal and de-seasonalised). Plots are labelled with the AR1 of the vegetation time series, and the maximum correlation between the Vegetation and precipitation time series.
- Auto-correlation plots for vegetation and precipitation time series (seasonal and de-seasonalised).
- Vegetation and precipitation cross-correlation scatterplot matrices.
- STL decomposition plots.
- Resilience analysis:
     - `ewstools` resilience plots showing AR1, standard deviation, skewness, and kurtosis using a moving window.
     - Smoothing filter size and moving window size Kendall tau sensitivity plots.
     - Significance test.

### Running the analysis using the API

Although `pyveg` has been mostly designed to be used with the CLI as shown above, we can also use `pyveg` functions through the API. A tutorial of how to run the data analysis in this way is included in the ```notebooks/tutorial_analyse_gee_data.ipynb``` notebook  tutorial.

## Other functionalities of `pyveg`

### Analysis summary statistics data

The ```analyse_pyveg_summary_data.py``` functionality processes collections of data produced by the main `pyveg` pipeline described in the section above (download + time series analysis for different locations and time periods) and creates a number of plots of the summary statistics of these time series.

To run this analysis in Python, there is an entrypoint defined.  Type:

```
pyveg_analysis_summary_data --input_location  <path_to_directory_with_collection_summary_statistics>
```

if you wish you can also specify the ```outpur_dir``` where plots will be saved.  Type:
```
pyveg_analysis_summary_data --help
```
to see the extra options.

### Pattern simulation

The ```generate_patterns.py``` functionality originates from some Matlab code by Stefan Dekker, Willem Bouten, Maarten Boerlijst and Max Rietkerk (included in the "matlab" directory), implementing the scheme described in:

Rietkerk et al. 2002. Self-organization of vegetation in arid ecosystems. The American Naturalist 160(4): 524-530.

To run this simulation in Python, there is an entrypoint defined.  Type:
```
pyveg_gen_pattern --help
```
to see the options.  The most useful option is the `--rainfall` parameter which sets a parameter (the rainfall in mm) of the simulation - values between 1.2 and 1.5 seem to give rise to a good range of patterns. Other optional parameters for `generate_patterns.py` allow the generated image to be output as a csv file or a png image.  The `--transpose` option rotates the image 90 degrees (this was useful for comparing the Python and Matlab network-modelling code). Other parameters for running the simulation are in the file `patter_gen_config.py`, you are free to change them.

#### Running the pattern simulation using the API

Although `pyveg` has been mostly designed to be used with the CLI as shown above, we can also use `pyveg` functions through the API. A tutorial of how to run the simulation of the pattern generation in this way is included in [here](notebooks/tutorial_simulate_patterned_vegetation.ipynb).

### Network centrality

There is an entrypoint defined in `setup.py` that runs the *main* function of `calc_euler_characteristic.py`:
```
pyveg_calc_EC --help
```
will show the options.

* `--input_txt` allows you to give the input image as a csv, with one row per row of pixels.  Inputs are expected to be "binary", only containing two possible pixel values (typically 0 for black and 255 for white).
* `--input_img` allows you to pass an input image (png or tif work OK).  Note again that input images are expected to be "binary", i.e. only have two colours.
* `--sig_threshold` (default value 255) is the value above (or below) which a pixel is counted as signal (or background)
* `--upper_threshold` determines whether the threshold above is an upper or lower threshold (default is to have a lower threshold - pixels are counted as "signal" if their value is greater-than-or-equal-to the threshold value).
* `--use_diagonal_neighbours` when calculating the adjacency matrix, the default is to use "4-neighbours" (i.e. pixels immediately above, below, left, or right).  Setting this option will lead to "8-neighbours" (i.e. the four neighbours plus those diagonally adjacent) to be included.
* `--num_quantiles` determines how many elements the output feature vector will have.
* `--do_EC` Calculate the Euler Characteristic to fill the feature vector.  Currently this is required, as the alternative approach (looking at the number of connected components) is not fully debugged.

Note that if you use the `-i` flag when running python, you will end up in an interactive python session, and have access to the `feature_vec`, `sel_pixels` and `sc_images` variables.

Examples:
```
pyveg_calc_EC --input_txt ../binary_image.txt --do_EC
>>> sc_images[50].show() # plot the image with the top 50% of pixels (ordered by subgraph centrality) highlighted.
>>> plt.plot(list(sel_pixels.keys()), feature_vec, "bo") # plot the feature vector vs pixel rank
>>> plt.show()
```

### Uploading results to the Zenodo open source repository

See [here](UsingZenodo.md) for more details.

# Contributing

We welcome contributions from anyone who is interested in the project. There are lots of ways to contribute, not just writing code. See our [Contributor Guidelines](CONTRIBUTING.md) to learn  more about how you can contribute and how we work together as a community.

# Licence

This project is licensed under the terms of the MIT software license.


text:
# SAFR

## Description
Our ultimate goal is to use crime and police response time data (data.seattle.gov API)  to allow people to discover places that are underserved by municipalities in terms of police response times. This allows the public to start a conversation about potential improvements and empowers residents and visitors to make informed decisions about their safety.

To be able to stay within the time constraints of this final project, we are starting with loading the 911 calls that had officer responses and map those locations using Google Maps API. This does not yet include the response time.

## Getting Started
* Used the .eslintrc.json and the .gitignore from the class repo
* Used the normalize.css rules that we've used in class
* We each got personal keys for the data.seattle.gov's API
* We are using Google Maps free API which allows up to 1,000 calls daily without an API key or 2,500 with the key.

## Prerequisites
There are no prerequisites for using this program.

## Built With
This was built using JavaScript, jQuery, PostgresQL, HTML, and CSS.  We also used Node.js, Express, SuperAgent, and two different API's as discussed above.

## Authors
### Karen Lai
* [Linked In](https://www.linkedin.com/in/karenddlai/)
* [Git Hub](https://github.com/karenbtlai)

### Justin Whitaker
* Twitter: @imaginarytrend
* [Linked In](https://www.linkedin.com/in/justin-whitaker/)
* [Git Hup](https://github.com/Trendswithbenefits)

### Jermaine Walker
* Twitter: @stateofjermaine
* [Linked In](https://www.linkedin.com/in/jermainemwalker)
* [Git Hub](https://github.com/stateofjermaine)

### Amy Cohen
* Twitter: @cohenamyv
* [Linked In](https://www.linkedin.com/in/amyvcohen/)
* [Git Hub](https://github.com/AmyCohen)

## Contributing
Please see the CONTRIBUTING.md for more inforamtion on our code of conduct, branch naming conventions, and work plan.

## License
This project is licensed under the MIT License. Please see the LICENSE.md for more details.

## Acknowledgments and References
Sites that we utilized to either gather informaiton for the database (API) or sites that we pulled code from to make our project work.
* [Google Maps API](https://developers.google.com/maps/documentation/javascript/examples/)
* [Seattle Open Data Program](https://data.seattle.gov/)
* [Seattle Police Department Police Report Incident API](https://data.seattle.gov/Public-Safety/Seattle-Police-Department-Police-Report-Incident/7ais-f98f)
* Help with Google Maps Events: [Stackoverflow_Marker_Events](https://stackoverflow.com/questions/15792655/add-marker-to-google-map-on-click)

## Deployment
Git Hub: [SAFR Repositories](https://github.com/safr-SEA)
GH Pages: [SAFR-Client](https://safr-sea.github.io/safr-client/)
Heroku: [SAFR-Server](https://safr-sea.herokuapp.com/)

repository: safr-SEA/safr-client

gha_language: JavaScript

repo_name: safr-SEA/safr-client


text:
# How Gateway handles state

When gateway handles a request, some information about that request is
stored in the session data of the user. This document describes the
various flows within Stepup, in what parts of the code the flows are
implemented and what the implementation stores and reads from the user
session.

## Gateway login flow

![flow](diagrams/gateway-state-login-flow.png)
<!---
regenerate this diagram with `plantuml GatewayState.md` or with http://www.plantuml.com/plantuml
@startuml diagrams/gateway-state-login-flow.png

title Stepup Gateway login flow
actor User

participant "Service provider" as SP
participant "Identity provider" as IDP
box "Stepup"
    participant "GatewayController" as GW
    participant "SecondFactorController" as SF
end box

User -> SP: Login
activate SP

    SP -> GW: AuthnRequest <AR1>
    activate GW

        group ssoAction()
            rnote over GW #aqua
            **Store to state:**

              - ""[setRequestId]                          ""request ID of <AR1>
              - ""[setRequestServiceProvider]             ""entity ID of service provider
              - ""[setRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[setRelayState]                         ""relay state <AR1>
              - ""[setResponse*]                          ""some internal configuration
                ""                                        ""so gateway knows the request
                ""                                        ""was not SFO or GSSP
              - ""[setRequiredLoaIdentifier]              ""required LoA found in <AR1>
              - ""[setGatewayRequestId]                   ""request ID of <AR2>
            end note
        end

        GW -> IDP: AuthnRequest <AR2>
        activate IDP
            IDP -> GW: AuthnResponse <AR2>
        deactivate IDP

        group consumeAssertionAction()
            rnote over GW #green
            **Read from state:**

              - ""[getRequestId]        ""request ID <AR1>
              - ""[getGatewayRequestId] ""request ID <AR2>

            **In case of error:**
              - ""[getRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[getRequestId]                          ""request ID of <AR1>
            end note

            rnote over GW #aqua
            **Store to state:**

              - ""[saveAssertion]            ""the assertion in response to <AR2>
              - ""[setSchacHomeOrganization] ""schacHomeOrg of IDP
              - ""[saveIdentityNameId]       ""name ID of authenticated user
              - ""[setAuthenticatingIdp]     ""entity ID of the IDP
            end note
        end

        GW -> SF: Start second factor verification
        activate SF
            rnote over SF
                Verification is handled inside the
                gateway (yubikey, sms) or an
                "inner" SAML authentication request
                is started to an external GSSP
                application (tiqr, irma, ...).
            end note
            rnote over SF #green
            **Read from state:**

              - ""[getRequestId]              ""request ID of <AR1>
              - ""[getRequestServiceProvider] ""entity ID of service provider
                ""                            ""to determine SP-specific configuration
              - ""[getRequiredLoaIdentifier]  ""required LoA
              - ""[getSchacHomeOrganization]  ""schacHomeOrg of IDP
              - ""[getIdentityNameId]         ""name ID of authenticated user
            end note

            rnote over SF #aqua
            **Store to state:**

              - ""[setSelectedSecondFactorId] ""unique ID of selected token
              - ""[setPreferredLocale]        ""preffered locale of token
              - ""[setSecondFactorVerified]   ""verification success or fail
              - ""[setVerifiedBySsoOn2faCookie] ""opt: set flag when using SSO on 2FA cookie to skip 2FA
              - ""[setSsoOn2faCookieFingerprint] ""opt: set fingerprint of SSO on 2FA cookie
            end note

            SF -> GW: Process verification result
        deactivate SF

        group respondAction()
            rnote over GW #green
            **Read from state:**

              - ""[getRequestId]                          ""request ID of <AR1>
              - ""[getRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[getRequestServiceProvider]             ""entity ID of service provider
              - ""[getAssertion]                          ""assertion in response to <AR2>
                ""                                        ""used to generate response to <AR1>
              - ""[getSelectedSecondFactorId]             ""token ID
              - ""[isSecondFactorVerified]                ""verification result
            end note

            rnote over SF #aqua
            **Store to state:**

              - ""[setSelectedSecondFactorId] ""clear the tokenID
              - ""[setSecondFactorVerified]   ""clear the verification flag
              - ""[setVerifiedBySsoOn2faCookie] ""opt: clear flag when using SSO on 2FA cookie to skip 2FA
              - ""[setSsoOn2faCookieFingerprint] ""opt: clear fingerprint of SSO on 2FA cookie
            end note

        end

        GW -> SP: AuthnResponse <AR1>
    deactivate GW

    SP -> User
deactivate SP

@enduml
--->

## Gateway SFO flow

![flow](diagrams/gateway-state-sfo-flow.png)
<!---
regenerate this diagram with `plantuml GatewayState.md` or with http://www.plantuml.com/plantuml
@startuml diagrams/gateway-state-sfo-flow.png

title Stepup Gateway SFO flow
actor User

participant "Service provider" as SP
box "Stepup"
    participant "SecondFactorOnlyController" as SFO
    participant "SecondFactorController" as SF
end box

User -> SP: Login
activate SP

    SP -> SFO: AuthnRequest <AR1>
    activate SFO

        group ssoAction()
            rnote over SFO #aqua
            **Store to state:**

              - ""[setRequestId]                          ""request ID of <AR1>
              - ""[setRequestServiceProvider]             ""entity ID of service provider
              - ""[setRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[setRelayState]                         ""relay state <AR1>
              - ""[setResponse*]                          ""some internal configuration so
                ""                                        ""gateway knows the request was SFO
              - ""[saveIdentityNameId]                    ""name ID in <AR1>
              - ""[setRequiredLoaIdentifier]              ""required LoA found in <AR1>

            **Additional, in case of ADFS:**

              - ""[Adfs::setAuthMethod] ""Auth method
              - ""[Adfs::setContext]    ""Context
            end note
        end

        SFO -> SF: Start second factor verification
        activate SF

            rnote over SF
            Verification is handled inside the
            gateway (yubikey, sms) or an
            "inner" SAML authentication request
            is started to an external GSSP
            application (tiqr, irma, ...).
            end note

            rnote over SF #green
            **Read from state:**

              - ""[getRequestId]              ""request ID of <AR1>
              - ""[getRequestServiceProvider] ""entity ID of service provider
                ""                            ""to determine SP-specific configuration
              - ""[getRequiredLoaIdentifier]  ""required LoA
              - ""[getSchacHomeOrganization]  ""schacHomeOrg of IDP
              - ""[getIdentityNameId]         ""name ID of authenticated user
            end note

            rnote over SF #aqua
            **Store to state:**

              - ""[setSelectedSecondFactorId] ""unique ID of selected token
              - ""[setPreferredLocale]        ""preffered locale of token
              - ""[setSecondFactorVerified]   ""verification success or fail
              - ""[setVerifiedBySsoOn2faCookie] ""opt: set flag when using SSO on 2FA cookie to skip 2FA
              - ""[setSsoOn2faCookieFingerprint] ""opt: set fingerprint of SSO on 2FA cookie
            end note

            SF -> SFO: Process verification result
        deactivate SF

        group respondAction()
            rnote over SFO #green
            **Read from state:**

              - ""[getRequestId]                          ""request ID of <AR1>
              - ""[getRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[getRequestServiceProvider]             ""entity ID of service provider
              - ""[getIdentityNameId]                     ""name ID of authenticated user
              - ""[getSelectedSecondFactorId]             ""token ID
              - ""[isSecondFactorVerified]                ""verification result

            **Additional, in case of ADFS:**

              - ""[Adfs::getAuthMethod] ""Auth method
              - ""[Adfs::getContext]    ""context
            end note

            rnote over SF #aqua
            **Store to state:**

              - ""[setSelectedSecondFactorId] ""clear the tokenID
              - ""[setSecondFactorVerified]   ""clear the verification flag
              - ""[setVerifiedBySsoOn2faCookie] ""opt: clear flag when using SSO on 2FA cookie to skip 2FA
              - ""[setSsoOn2faCookieFingerprint] ""opt: clear fingerprint of SSO on 2FA cookie
            end note
        end

        SFO -> SP: AuthnResponse <AR1>
    deactivate SFO

    SP -> User
deactivate SP

@enduml
--->

## Gateway GSSP verification flow

This flow happens when a user is asked to verify his second factor token,
the service provider in this diagram can be any (external) service provider,
or SelfService when the "Test a token" button is used.

![flow](diagrams/gateway-state-gssp-verification-flow.png)
<!---
regenerate this diagram with `plantuml GatewayState.md` or with http://www.plantuml.com/plantuml
@startuml diagrams/gateway-state-gssp-verification-flow.png

title Stepup Gateway GSSP verification flow
actor User

box "Details omitted, see login flow diagram"
    participant "Service provider" as SP
    participant "Identity provider" as IDP
    participant "GatewayController" as GW
    participant "SecondFactorController" as SF
end box
box "Stepup"
    participant "SamlProxyController" as PROXY
end box
participant "GSSP application" as GSSP

User -> SP: Login
activate SP

    SP -> GW: AuthnRequest <AR1>
    activate GW

        GW -> IDP: AuthnRequest <AR2>
        activate IDP
            IDP -> GW: AuthnResponse <AR2>
        deactivate IDP

        GW -> SF: Start second factor verification
        activate SF
            SF -> PROXY: Internal redirect
            activate PROXY
                rnote over PROXY
                Internal redirect to the SamlProxyController
                A new AuthnRequest <AR3> is sent to the GSSP
                application.
                end note

                group sendSecondFactorVerificationAuthnRequestAction()
                    rnote over PROXY #green
                    **Read from login/SFO state:**

                      - ""[getRequestId] ""request ID <AR1> (for logging)
                    end note

                    rnote over PROXY #aqua
                    **Store to GSSP-specific state:**

                      - ""[setRequestId]                          ""request ID <AR1>
                      - ""[setGatewayRequestId]                   ""request ID <AR3>
                      - ""[setSubject]                            ""name ID on token
                      - ""[setRelayState]                         ""relay state
                      - ""[markRequestAsSecondFactorVerification] ""flag to
                        ""                                        ""indicate this is not registration
                    end note
                end

                PROXY -> GSSP: AuthnRequest <AR3>

                activate GSSP
                    GSSP -> PROXY: AuthnResponse <AR3>
                deactivate GSSP

                group consumeAssertionAction()
                    rnote over PROXY #green
                    **Read from state:**

                      - ""[getRequestId]                      ""request ID <AR2> (logging)
                      - ""[getGatewayRequestId]               ""request ID <AR3> (in-response-to check)
                      - ""[getSubject]                        ""name ID <AR2>
                      - ""[getRelayState]                     ""Relay state <AR2>
                      - ""[secondFactorVerificationRequested] ""flag (registration or verification)

                    **Read from GW login/SFO state (error case):**

                      - ""[getRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
                      - ""[getRequestServiceProvider]             ""entity ID of SP <AR1>
                    end note
                end

                PROXY -> SP: Error AuthnResponse <AR3> (verification failed)
                PROXY -> SF: Internal redirect to gssfVerified() (main flow)
            deactivate PROXY

            SF -> GW: Process verification result
        deactivate SF

        GW -> SP: AuthnResponse <AR1>
    deactivate GW

    SP -> User
deactivate SP

@enduml
--->

## Gateway GSSP registration flow

This flow happens when users register their token in SelfService and when this token is
verified in RA. So the service provider in this diagram is always SelfService or RA.

![flow](diagrams/gateway-state-gssp-registration-flow.png)
<!---
regenerate this diagram with `plantuml GatewayState.md` or with http://www.plantuml.com/plantuml
@startuml diagrams/gateway-state-gssp-registration-flow.png

title Stepup Gateway GSSP registration flow
actor User

participant "Service provider" as SP
box "Stepup"
    participant "SamlProxyController" as PROXY
end box
participant "GSSP application" as GSSP

User -> SP: Login
activate SP

    SP -> PROXY: AuthnRequest <AR1>
    activate PROXY

        rnote over PROXY
        AuthnRequest <AR1> is received in
        singleSignOnAction(), a new
        AuthnRequest <AR2> is sent to the
        GSSP application.
        end note

        group singleSignOnAction()
            rnote over PROXY #aqua
            **Store to GSSP-specific state:**

             - ""[setRequestId]                          ""request ID <AR1> (in-response-to check)
             - ""[setRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
             - ""[setRequestServiceProvider]             ""entity ID of service provider <AR1>
             - ""[setResponseContextServiceId]           ""The (SF) service identifier for the authentication context (used to retrieve the original issuer when a SAML authn failed response is encountered <AR1>
             - ""[setRelayState]                         ""relay state <AR1>
             - ""[setSubject]                            ""name ID <AR1>
             - ""[setGatewayRequestId]                   ""request ID <AR2>
            end note
        end

        PROXY -> GSSP: AuthnRequest <AR2>

        activate GSSP
            GSSP -> PROXY: AuthnResponse <AR2>
        deactivate GSSP

        group consumeAssertionAction()
            rnote over PROXY #green
            **Read from state:**

              - ""[getRequestId]                      ""request ID <AR1> (logging)
              - ""[getGatewayRequestId]               ""request ID <AR2> (in-response-to check)
              - ""[getSubject]                        ""name ID <AR1>
              - ""[getRelayState]                     ""Relay state <AR1>
              - ""[secondFactorVerificationRequested] ""flag (registration or verification)

            **In case of error**

              - ""[getRequestAssertionConsumerServiceUrl] ""ACS location of <AR1>
              - ""[getRequestServiceProvider]             ""entity ID of service provider <AR1>
            end note
        end

        PROXY -> SP: AuthnResponse <AR1>
    deactivate PROXY

    SP -> User
deactivate SP

@enduml
--->

repository: OpenConext/Stepup-Gateway

branch_name: refs/heads/develop

gha_language: PHP

repo_name: OpenConext/Stepup-Gateway


text:
# Performance

## Sizing (px -> dp)
Any pixel values in After Effects will get converted to density independent pixels (points on iOS and dp on Android). For example, if you want an animation to be 24dp x 24dp, the After Effects composition should be 24px x 24px. You can find a list of common screen sizes in dps [here](https://material.io/devices/).

## Masks and Mattes
Masks and mattes on android have the larges performance hit. Their performance hit is also proportional to the intersection bounds of the masked/matted layer and the mask/matte so the smaller the mask/matte, the less of a performance hit there will be.
On Android, if you are using masks or mattes, there will be a several X performance improvement when using hardware acceleration.

## Hardware Acceleration
Android can render animations with hardware or software acceleration. Hardware acceleration is much faster but has some limitations.
The following features have limited support
* Anti aliasing (API 16+ only)
* Clip to composition bounds (API 18+ only)
* Stroke caps (API 19+ only)

For more information, read [this](https://developer.android.com/guide/topics/graphics/hardware-accel.html).

In general, try your animation with hardware acceleration and use it if it works. You can try toggling it in the sample app.

## Render Graph (Android)
The Lottie sample app has a real time render graph that can be enabled from the menu in the top right.
![Render Graph](/images/render-graph.png)


text:
# capistrano-syncfiles

This gem provides up and down file syncing with rsync, tar or sftp. This could be usefull if you are in a shared hosting environment.

Supports folder excludes.

## Installation
First make sure you install the capistrano-syncfiles by adding it to your `Gemfile`:

    gem "capistrano-syncfiles"

Add to Capfile

    require 'capistrano/syncfiles'

## Configuration (deploy.rb)
Configure your files and folders like these:
```
set :syncfiles, {
  'wordpress/wp-content/uploads' => {                     # local path
      remote: 'wordpress/wp-content/uploads',             # remote path
      exclude: ['fvm', 'ithemes-security', 'wc-logs']     # excluded folders/files, based on local path, works also for remote
  }
}
set :syncfiles_rsync_options, '-avzuO'

set :syncfiles_roles, :all  # roles to run on, default: :all

set :syncfiles_temp_file    # applies only to tar strategy, default: "/tmp/transfere-#{local_path.hash}.tar.gz"

set :syncfiles_tar_verbose  # applies only to tar strategy, default: true

set :syncfiles_sftp_password # password for sftp connection
```

## Usage
The following tasks will be added
```
cap syncfiles:rsync:down
cap syncfiles:rsync:up

cap syncfiles:tar:down
cap syncfiles:tar:up

cap syncfiles:sftp:down
cap syncfiles:sftp:up
```

You can invoke this tasks(Rake) as you do normally: https://github.com/ruby/rake

Capistrano tasks: http://capistranorb.com/documentation/getting-started/flow/

### License
The MIT License (MIT)

### Changelog
##### 1.0.0
  * add `syncfiles_rsync_options` default options

##### 0.3.0
  * use `current_path` instead of `release_path`

##### 0.2.0
  * add sftp strategy

##### 0.1.0
  * Initial release

repository: creative-workflow/capistrano-syncfiles

repo_name: creative-workflow/capistrano-syncfiles


text:
## Weekly diary

26.4.2021
* still working game engine
* time estimate 2 hours

28.4.2021
* game engine "works" for both sides
* simple board evaluation
* time estimate 5h

29.4.2021
* evaluation works
* first version of minimax algo works
* some fixes to game logic --> causing still problems
* first test added
* time estimate 6h

30.4.2021
* Peer review
* Gamebot2. I don't understand why my gamebot sometimes returns null move in xboard. For some reason, it do not move piecel. I need to fix this next week.
* time estimate 2h

## What I have done this week?
* refactoring game logic
* minimax algo
* board evaluation
* some tests
* working gamebot

## How has the program progressed?
* minimax algo
* board evaluation
* game logic refactored

## What did I learn this week / today?
* minimax algo
* evaluation

## What remained unclear or caused difficulties?
* I don't understand why xboard causes weird moves
* There is problem with either my own game logic or gamestate logic

## What do I do next?
* Alpha beta pruning
* Own data structures
* Test
* Commenting code
* documents
* if time, I want to make better board evaluation
* if time, I want to order my leagal moves

Time estimate: 15 hours

branch_name: refs/heads/main


text:
# Larger post avatars

A Discourse theme component for easily changing the size of post avatars on Desktop, and the shape of avatars across the whole forum.

Also contains a setting that allows you to add some spacing between the avatar and the post content, which may be required to achieve a balanced layout when larger avatars are being used.

**Why create another theme component when discourse-avatar-component exists?**

Good question! See [discourse-avatar-component](https://github.com/discourse/discourse-avatar-component) for a more fully-featured theme component that also allows you to change the size of mobile avatars.

For my forum, I only wanted to increase the size of avatars on desktop browsers without loading larger images on mobile devices, and I only wanted to increase the size of avatars on topic pages, nowhere else.
I also needed a way to increase the spacing next to the avatar as I increased its size – I could've done it with some custom CSS, but having all the avatar-related settings in one place made more sense to me.


text:
---
title: Accessing RadForm Elements
page_title: Accessing RadForm Elements - WinForms RadForm
description: Learn how to access and modify RadFormTitleBarElement, FormBorderPrimitive and FormImageBorderPrimitive.
slug: winforms/forms-and-dialogs/form/accessing-radform-elements
tags: accessing,radform,elements
published: True
position: 3
previous_url: forms-and-dialogs-form-accessing-radform-elements
---

# Accessing RadForm Elements

The __RadForm__ is build of a __RadFormTitleBarElement__, __FormBorderPrimitive__ and a __FormImageBorderPrimitive.__ The following topic demonstrates how to access and modify these elements.

## Accessing the RadTitleBarElement

The __RadFormTitleBarElement__ is positioned on the top of the form and its default behavior is to display an icon, text, and the help, minimize, maximize/restore and close buttons. You can access the __RadFormTitleBarElement__ the following way:

#### Accessing RadForm elements

{{source=..\SamplesCS\Forms and Dialogs\Form1.cs region=accessingRadFormElements}}
{{source=..\SamplesVB\Forms and Dialogs\Form1.vb region=accessingRadFormElements}}

````C#
void Form1_Shown(object sender, EventArgs e)
{
    this.FormElement.TitleBar.MaximizeButton.Enabled = false;
    this.FormElement.TitleBar.MinimizeButton.Enabled = false;
    this.FormElement.TitleBar.HelpButton.Visibility = Telerik.WinControls.ElementVisibility.Visible;
}

````
````VB.NET
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
    Me.FormElement.TitleBar.MaximizeButton.Enabled = False
    Me.FormElement.TitleBar.MinimizeButton.Enabled = False
    Me.FormElement.TitleBar.HelpButton.Visibility = Telerik.WinControls.ElementVisibility.Visible
End Sub

````

{{endregion}}

>caption Figure 1: TitleBar

![WinForms RadForm TitleBar](images/forms-and-dialogs-accessing-radform-elements001.png)

>note By default, the __HelpButton__ is not shown. Set the __HelpButton__ property to *true* to display a Help button in the form's caption bar.The value of the __HelpButton__ property is ignored if the Maximize or Minimize buttons are shown.
> An alternative solution is to set its __Visibility__ property to *ElementVisibility.Visible* in order to be displayed. The __HelpButtonClicked__ event is fired when Help button in the title bar is clicked. It can be canceled. However, if it is not canceled, the __HelpRequested__ event will be fired when the Help cursor is clicked on any Control.

## Adding a new button to the title bar

You can easily extend the __RadFormTitleBarElement__ 's functionality by adding new elements to its hierarchy. The following code snippet demonstrated how to add a __RadButtonElement__ before the minimize button in the __RadFormTitleBarElement__:

#### Adding new button to the title bar

{{source=..\SamplesCS\Forms and Dialogs\Form1.cs region=addingNewButtonToTheTitleBar}}
{{source=..\SamplesVB\Forms and Dialogs\Form1.vb region=addingNewButtonToTheTitleBar}}

````C#
void Form1_Load(object sender, EventArgs e)
{
    RadButtonElement buttonElement = new RadButtonElement();
    buttonElement.Text = "TitleBar Button";
    this.FormElement.TitleBar.Children[2].Children[0].Children.Insert(0, buttonElement);
}

````
````VB.NET
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim buttonElement As New RadButtonElement()
    buttonElement.Text = "TitleBar Button"
    Me.FormElement.TitleBar.Children(2).Children(0).Children.Insert(0, buttonElement)
End Sub

````

{{endregion}}

## Accessing the Form Borders

The border of a __RadForm__ control is composed of two border primitives which, together, define the visual appearance of the whole border: __FormBorderPrimitive__ and __FormImageBorderPrimitive__.

## Accessing the FormBorderPrimitive

The __FormBorderPrimitive__ represents the outer thin border that surrounds a __RadForm__ control. The following code snippet demonstrates how to modify the color of this primitive:

#### Accessing the FormBorderPrimitive

{{source=..\SamplesCS\Forms and Dialogs\Form1.cs region=accessingTheFormBorderPrimitive}}
{{source=..\SamplesVB\Forms and Dialogs\Form1.vb region=accessingTheFormBorderPrimitive}}

````C#
this.FormElement.Border.ForeColor = System.Drawing.Color.Green;

````
````VB.NET
Me.FormElement.Border.ForeColor = System.Drawing.Color.Green

````

{{endregion}}

>note The visual appearance of the border and also for the whole RadForm control can be designed in the Visual Style Builder.
>

## Accessing the FormImageBorderPrimitive

The __FormImageBorderPrimitive__ represents the inner thick border that starts from the bottom-left corner of the title bar, surrounds the __RadForm__ control and ends at the bottom-right corner of the title bar. The __FormImageBorderPrimitive__ provides you with the possibility to define borders for your form which are built of images and thus achieve better look-and-feel for your form. Without images set, the __FormImageBorderPrimitive__ paints as a one-color-border with the color set to the __BackColor__ property of the primitive.

The following code snippet demonstrates how to set the __BackColor__ of the __FormImageBorderPrimitive__ which is painted when no images are defined:

#### Accessing the FormImageBorderPrimitive

{{source=..\SamplesCS\Forms and Dialogs\Form1.cs region=accessingTheFormImageBorderPrimitive}}
{{source=..\SamplesVB\Forms and Dialogs\Form1.vb region=accessingTheFormImageBorderPrimitive}}

````C#
this.FormElement.ImageBorder.BackColor = Color.Lime;

````
````VB.NET
Me.FormElement.ImageBorder.BackColor = Color.Lime

````

{{endregion}}

>note More information on how to use the __FormImageBorderPrimitive__ can be found in the separate topic: [Using the FormImageBorderPrimitive]({%slug winforms/forms-and-dialogs/form/using-the-formimageborderprimitive%}).
>

repository: telerik/winforms-docs

repo_name: telerik/winforms-docs


text:
# spring-exception-handling

This project is a simple example of handling exception to the REST services based on
```I18N``` and database driven message source(```AbstractMessageSource```).

repository: celikfatih/spring-exception-handling

repo_name: celikfatih/spring-exception-handling


text:
FPGA-SoC-Linux-Example-1-ZYBO
=============================

FPGA-SoC-Linux example(1) binary and project and test code for ZYBO

### Requirement

* Board: ZYBO
* OS: [FPGA-SoC-Linux](https://github.com/ikwzm/FPGA-SoC-Linux.git)

## Install

### Install python3-numpy

```
shell# apt-get install python3-numpy
```

### Download FPGA-SoC-Linux-Example-1-ZYBO

```
shell$ git clone https://github.com/ikwzm/FPGA-SoC-Linux-Example-1-ZYBO
shell$ cd FPGA-SoC-Linux-Example-1-ZYBO
```

### Install to FPGA and Device Tree

```
shell# rake install
cp pump_axi4.bin /lib/firmware/pump_axi4.bin
dtbocfg.rb --install uio_irq_sample --dts uio_irq_sample.dts
<stdin>:22.13-27.20: Warning (unit_address_vs_reg): /fragment@1/__overlay__/pump-uio: node has a reg or ranges property, but no unit name
<stdin>:9.13-41.4: Warning (avoid_unnecessary_addr_size): /fragment@1: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
[  712.822208] fpga_manager fpga0: writing pump_axi4.bin to Xilinx Zynq FPGA Manager
[  712.867038] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /amba/fpga-region0/firmware-name
[  712.881097] fclkcfg amba:fclk0: driver installed.
[  712.885809] fclkcfg amba:fclk0: device name    : amba:fclk0
[  712.891989] fclkcfg amba:fclk0: clock  name    : fclk0
[  712.897132] fclkcfg amba:fclk0: clock  rate    : 100000000
[  712.902684] fclkcfg amba:fclk0: clock  enabled : 1
[  712.914833] u-dma-buf udmabuf4: driver version = 3.0.1
[  712.924993] u-dma-buf udmabuf4: major number   = 242
[  712.930088] u-dma-buf udmabuf4: minor number   = 0
[  712.934879] u-dma-buf udmabuf4: phys address   = 0x1f100000
[  712.940506] u-dma-buf udmabuf4: buffer size    = 1048576
[  712.945814] u-dma-buf udmabuf4: dma device     = amba:pump-udmabuf4
[  712.952119] u-dma-buf udmabuf4: dma coherent   = 1
[  712.956908] u-dma-buf amba:pump-udmabuf4: driver installed.
[  712.970810] u-dma-buf udmabuf5: driver version = 3.0.1
[  712.975963] u-dma-buf udmabuf5: major number   = 242
[  712.981042] u-dma-buf udmabuf5: minor number   = 1
[  712.985830] u-dma-buf udmabuf5: phys address   = 0x1f200000
[  712.991452] u-dma-buf udmabuf5: buffer size    = 1048576
[  712.996757] u-dma-buf udmabuf5: dma device     = amba:pump-udmabuf5
[  713.003061] u-dma-buf udmabuf5: dma coherent   = 1
[  713.007850] u-dma-buf amba:pump-udmabuf5: driver installed.
```

## Run sample1 or sample2

### Compile sample1 or sample2

```
shell# rake sample1 sample2
```

### Run sample1

```
shell# ./sample1
time = 0.005702 sec
time = 0.005685 sec
time = 0.005668 sec
time = 0.005681 sec
time = 0.005690 sec
time = 0.005677 sec
time = 0.005698 sec
time = 0.005707 sec
time = 0.005662 sec
time = 0.005692 sec
```

### Run sample2

```
shell$ ./sample2
time = 0.005713 sec
time = 0.005694 sec
time = 0.005688 sec
time = 0.005720 sec
time = 0.005708 sec
time = 0.005687 sec
time = 0.005693 sec
time = 0.005701 sec
time = 0.005723 sec
time = 0.005718 sec
```

## Run sample.py

```
shell# python3 sample.py
elapsed_time:5.912[msec]
elapsed_time:5.847[msec]
elapsed_time:5.833[msec]
elapsed_time:5.839[msec]
elapsed_time:5.826[msec]
elapsed_time:5.841[msec]
elapsed_time:5.832[msec]
elapsed_time:5.842[msec]
elapsed_time:5.84[msec]
average_time:5.846[msec]
thougput    :179.374[MByte/sec]
udmabuf4 == udmabuf5 : OK
```

## Uninstall

```
shell# rake uninstall
dtbocfg.rb --remove uio_irq_sample
dtbocfg.rb --remove uio_irq_sample
[  779.549516] u-dma-buf amba:pump-udmabuf5: driver removed.
[  779.556223] u-dma-buf amba:pump-udmabuf4: driver removed.
[  779.565252] fclkcfg amba:fclk0: driver unloaded
```

## Build Bitstream file

### Requirement

* Vivado 2016.1 or 2016.2 or 2016.2.1

### Download FPGA-SoC-Linux-Example-1-Base

```
shell$ pushd FPGA-SoC-Linux-Example-1-Base
shell$ git submodule init
shell$ git submodule update
shell$ popd
```

### Create Project

```
Vivado > Tools > Run Tcl Script > project/create_project.tcl
```

### Implementation

```
Vivado > Tools > Run Tcl Script > project/implementation.tcl
```

### Convert from Bitstream File to Binary File

```
shell$ tools/fpga-bit-to-bin.py --flip project/project.run/impl_1/design_1_wrapper.bit pump_axi4.bin
```

gha_language: Tcl


text:
Pattern: Use of tab

Issue: -

## Description

This rule enforces use of spaces for indentation instead of tabs.

## Further Reading

* [Google C++ Style Guide - Spaces vs. Tabs](https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs)

repository: Adroiti/docs-for-code-review-tools

repo_name: Adroiti/docs-for-code-review-tools


text:
https://www.businessinsider.com/goldstar-ceo-jim-mccarthy-groupon-2011-11

How This Guy Launched A Multi-Million Dollar Startup Without Any VC Money

Entrepreneurship isn't solely about selling things. It's also about creating something useful that people need, and executing it to its full potential.
That was what Gary Levitt did when he founded his startup Mad Mimi, a bootstrapped email marketing startup that he says now hauls in between $4-8 million in revenue each year.

But it was a strange, long road to get there. Born and raised in South Africa, Levitt was a pro skateboarder and musician before becoming an entrepreneur. He went to Boston when he was 19 to study bass guitar, where he would stay to play jazz for the next five years. His first foray into business reflected that background.

Levitt started a commercial music company in the late '90s, writing jingles. That was when the power of email changed his life, giving him the foundation for the multi-million dollar company he would later found.

"When I was promoting my music company, I wanted to send an email out because that was sort of a cheap way to get people around you to know about you," Levitt says. "And me coming from an arts background, I struggled to try to create this email, and eventually I hacked it together using DreamWeaver and whatever available software there was to me."

One of those emails made its way to the Oprah Winfrey Show in 2000, and it earned him a big time gig. He would create original music for the show for the next six years.

Then, Levitt decided to switch paths. No more music. There may be something to that whole email thing, he thought, so he began to put together the first pieces of what would become Mad Mimi.

"It took about three or four months of me messing around to spend my dev budget of around $13,000," he says. "It really wasn't enough to get anywhere, and I started again with another budget -- cobbled together from friends and family -- of $100,000, which bought me a year of life and a bunch of debt."

Money wasn't the only struggle. Levitt had no technical experience whatsoever, and needed to find help. He bought stacks of books to help him learn everything he could about the business, tech and design of email marketing.

But it would take more than just books to make Mad Mimi a reality.

Levitt scoured the web for strong, visionary coders. "I went through 86 of the most authoritative developers," he says. "I went through each one, researched them, sent them a personal email and told them a little about the project. Between 30 and 40 of them responded, and one of these people was Dave Hoover."

Hoover, once a family therapist that got into coding to escape the profession, worked for software development firm Obtiva. He thought that Levitt's project had major potential.

"He was really hungry for the gig and thought that it would help build up this new company he was working for," says Levitt. "He just gave me really good energy. So yeah, I thought, Dave is the man."

Levitt's instincts were correct, and the two of them built Mad Mimi from the ground up.

"It was basically me handling all the design, branding and customer service, while Dave would do the whole back end side," says Levitt.

But as with any startup, there were struggles. Things were still rough after raising the money, starting the company and getting Hoover on board, as Levitt worked tirelessly on his new website.

"I was living in a one-bedroom apartment with a family of four. I actually used to work from a coffee shop," says Levitt. "But eventually a couple people find out [about the company], and another few find out, and it just started growing."

Hoover's company happened to grow too. Obtiva was acquired by daily deals behemoth Groupon in August, and Hoover is now a senior engineer there.

As for Mad Mimi, Levitt says that the company has grown to 20 employees, and the service has around 90,000 users, sending out about 30 million emails each day. Its clients range from big brands like Air Canada and Squidoo to local mom-and-pops stores. He stresses that the business is "highly profitable," and that he hasn't accepted any VC money. His crew has been working for the past two years on a new version, which Levitt plans to finally unveil this month.

广告

How'd it manage to be so successful? Levitt attributes it to Mad Mimi's relationship with its customers and product design.

"We've never done any marketing," says Levitt. "One of our main ways of growth is shocking people into evangelism. I just pumped every little bit of energy into customer service. When a customer writes in a question, we suggest improvements, redesign their theme, and do all these cool things they wouldn't expect. And they get wowed, adding this virality that spreads on Twitter and Facebook."

Pretty savvy for someone that doesn't have a business background.

"As an artist, as a musician, I try to make the best possible music," says Levitt. "I don't do something in order to get something back. I don't think about how I'm going to sell it -- typical starving artist strategy, huh? But I just use all that to produce an impeccably executed product."

So far, it's working.

path: /_posts/2020-1-29-story map.md


text:
# Angular directive for matching styles to background color depending on it's contrast
[![Build Status](https://travis-ci.org/kolory/angular-match-style-to-background.svg?branch=master)](https://travis-ci.org/kolory/angular-match-style-to-background)
[![Code Climate](https://codeclimate.com/github/kolory/angular-match-style-to-background/badges/gpa.svg)](https://codeclimate.com/github/kolory/angular-match-style-to-background)
[![Test Coverage](https://codeclimate.com/github/kolory/angular-match-style-to-background/badges/coverage.svg)](https://codeclimate.com/github/kolory/angular-match-style-to-background/coverage)

The directive makes sure the color of texts and other elements inside the parent with dynamically changed
background color will stay readable and visible. The new style is chosen from optionally provided styles declarations
by calculating it's contrast ratio with the current value of the background color.

## Installation and usage

```
npm install @kolory/angular-match-style-to-background
```

```
// 1. Import the directive's module.

import {NgModule, Component} from '@angular/core'
import {MatchStyleModule} from '@kolory/angular-match-style-to-background'

@NgModule({
  ...
  import: [MatchStyleModule, ...],
})
class App {}

// 2. Use in a component. For more advanced use case, refer to #examples
@Component({
  template: `<div [match-style-to-background]="backgroundColor"> ... </div>`
})
class MyComponent {
  backgroundColor = '#FFFFFF'
}
```

## Configuration

### Background color

```
match-style-to-background: string | Color
```
Directive expect at least the `match-style-to-background` to be set on the element to actually make it work.
This property holds the current value of the background color that will be used when choosing a proper style.

The property can handle a string of the valid hex, RGB or HSL color or
a [Color object](https://github.com/kolory/color-utilities#color-object).

### Styles

```
styles: {[index: string]: anyColor | Color}
```

The `styles` property is a kew-value map of the style name (the key) and it's corresponding color (a hex, RGB
or HSL string or a [Color object](https://github.com/kolory/color-utilities#color-object)). The name is later
used as a part of the class name set on the parent element and in the style definition object in the `styleChange`
event. It can be any valid string you want to name your style.

For example:
```
// Using the stirng values.
const myStyles = {
  radiant: '#FFFFFF',
  dire: '#000000'
}

// Using the Color object
const myStyles = {
  radiant: Color.white,
  dire: Color.black
}
```

### Setting the color style

By default, the directive changes the element's color CSS property to the color of the matched style to make
texts readable. This means that in the simplest scenario, when there's only the required `match-style-to-background`
property set, everything is still usable. Default colors are black for light backgrounds and white for dark ones.

Since setting the style attribute might be too intrusive in some designs, this behavior can be turned off
by setting the `setColor` property to false. In this case, the text readability and it's color are responsibilities
of the component using this directive.

```
<!-- Turn off the automatic color changes. -->
<div [match-style-to-background]="color" [setColor]="false"> ... </div>
```

## Events

When the new style is selected, directive emits the `styleChange` event with the selected style's properties as
an event value. The object looks like this:
```
{
  name: 'light-style', // the style's name defined in the `styles` property
  color: Color('#FFFFFF'), // Color object made from the style's color
  contrast: 21 // the style's color contrast to the active background color
}
```

Example:

```
<div [match-style-to-background]="color" [styles]={light: Color('#FFFFFF'), ...}
     (styleChange)="handleStyleChange($event)"> ... </div>

// In a component
handleStyleChange(event) {
  // If the light style was matched, the event object is {name: 'light', color: Color('#FFFFFF'), contrast: 21}.
}
```

## Classes set on the host element

When the style is matched, the style match directive sets a class name on the host element to allow custom
styling and more advanced changes of design.

Class name added in this way is constructed from two parts: "matched-" prefix and the matched style's name.
For example, if the matched style was named "dark", then the newly appended class will be "matched-dark".

## Examples

### Text color is set automatically to match the unknown background color

The simples use of the directive is to only set the `match-style-to-background` property. The text color will be
changed using default black and white colors.

```
@Component({
  template: `
    <div [match-style-to-background]="randomlyPickColor()">
      This text will have a different color depending on which button was clicked.
    </div>`
})
class MyComponent {}
```

### Changing the text color when an action changes the background

Color is updated after user picks a color.

```
@Component({
  template: `
    <button (click)="background = '#000000'">Black</button>
    <button (click)="background = '#FFFFFF'">White</button>
    <div [match-style-to-background]="background" [styles]="{'light': '#EEEEEE', dark: '#101010'}">
      This text will have a different color depending on which button was clicked.
    </div>`
})
class MyComponent {}
```

### Changing the child elements look

Style change is defined in the stylesheet using the `.matched-` class names. Automatic color change is disabled
to make sure the CSS rules will be applied.

```
@Component({
  styles: [`
    .matched-light .child {
      color: purple;
    }
    .matched-dark .child {
      color: pink;
    }
  `],
  template: `
    <div [match-style-to-background]="background" [styles]="{'light': '#EEEEEE', dark: '#101010'}" [setColor]="false">
      <p class="child"> ... </p>
    </div>`
})
class MyComponent {}
```

### Defining styles and handling events

```
// Import the Color constructor. Color utilities is a dependency of this directive, so it's already available.
import {Color} from '@kolory/color-utilities'

// Import style interfaces.
import {StylesDeclaration, Style} from '@kolory/angular-match-style-to-background'

@Component({
  template: `
    <div [angular-match-style-to-background]="background" [styles]="styles" (styleChange)="handleChange($event)"></div>`
})
class MyComponent {
  styles: StylesDeclaration = {
    'ultra-red': Color.create('#FF0000'),
    'eco-green': Color.create('#00FF00'),
    'sky-blue': Color.create('#0000FF')
  }

  handleChange(changedStyle: Style) {
    // If 'ultra-red` was matched, then the method is called witn the object:
    // {name: 'ultra-red', color: Color('#FF0000'), contrast: 9}

    if (changedStyle.contrast < 10) {
      alert(`The ${changedStyle.name}` constrast is too low. ${changedStyle.color.hex}" won't work.`)
    }
  }
}
```

## License
MIT


text:
# Installation
> `npm install --save @types/node-cron`

# Summary
This package contains type definitions for node-cron (https://github.com/node-cron/node-cron).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-cron

Additional Details
 * Last updated: Mon, 15 Oct 2018 22:47:50 GMT
 * Dependencies: none
 * Global values: none

# Credits
These definitions were written by morsic <https://github.com/maximelkin>, burtek <https://github.com/burtek>.

repository: aslamcode/super-session

repo_name: aslamcode/super-session


text:
# gcn for prediction of protein interactions

利用各种图神经网络进行link prediction of protein interactions。

**Guide**

- [Intro](#Intro)
- [Model](#Model)
- [Dataset](#Dataset)
- [Install](#install)
- [Cite](#Cite)
- [Reference](#reference)

## Intro

目前主要实现基于【data/yeast/yeast.edgelist】下的蛋白质数据进行link prediction。

## Model
### 模型
模型主要使用图神经网络，如gae、vgae等
* 1.GCNModelVAE(src/vgae)：图卷积自编码和变分图卷积自编码(config中可配置使用自编码或变分自编码)，利用gae/vgae作为编码器，InnerProductDecoder作解码器。 [Variational Graph Auto-Encoders](https://arxiv.org/pdf/1611.07308.pdf) 。

    ![image](https://raw.githubusercontent.com/jiangnanboy/gcn_for_prediction_of_protein_interactions/master/image/vgae.png)
* 2.GCNModelARGA(src/arga)：对抗正则化图自编码，利用gae/vgae作为生成器；一个三层前馈网络作判别器。 [Adversarially Regularized Graph Autoencoder for Graph Embedding](https://arxiv.org/pdf/1802.04407v2.pdf) 。

    ![image](https://raw.githubusercontent.com/jiangnanboy/gcn_for_prediction_of_protein_interactions/master/image/arga.png)
* 3.GATModelVAE(src/graph_att_gae)：基于图注意力的图卷积自编码和变分图卷积自编码(config中可配置使用自编码或变分自编码)，利用gae/vgae作为编码器，InnerProductDecoder作解码器。这是我在以上【1】方法的基础上加入了一层图注意力层，关于图注意力可见【Reference】中的【GRAPH ATTENTION NETWORKS】。
* 4.GATModelGAN(src/graph_att_gan)：基于图注意力的对抗正则化图自编码，利用gae/vgae作为生成器；一个三层前馈网络作判别器，这是我在以上【2】方法的基础上加入了一层图注意力层，关于图注意力可见【Reference】中的【GRAPH ATTENTION NETWORKS】。
* 5.NHGATModelVAE(src/graph_nheads_att_gae)：基于图多头注意力的图卷积自编码和变分图卷积自编码(config中可配置使用自编码或变分自编码)，利用gae/vgae作为编码器，InnerProductDecoder作解码器。此方法是在【3】方法的基础上将图注意力层改为多头注意力层。
* 6.NHGATModelGAN(src/graph_nheads_att_gan)：基于图多头注意力的对抗正则化图自编码，利用gae/vgae作为生成器；一个三层前馈网络作判别器，此方法在【4】方法的基础上将图注意力层改为多头注意力层。

#### Usage
- 相关参数的配置config见每个模型文件夹中的config.cfg文件，训练和预测时会加载此文件。

- 训练及预测

  ##### 1.GCNModelVAE(src/vgae)

     (1).训练
    ```
    from src.vgae.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
  ```
    Epoch: 0001 train_loss =  1.84734 val_roc_score =  0.76573 average_precision_score =  0.68083 time= 0.80005
    Epoch: 0002 train_loss =  1.83824 val_roc_score =  0.87289 average_precision_score =  0.86317 time= 0.80361
    Epoch: 0003 train_loss =  1.80761 val_roc_score =  0.87641 average_precision_score =  0.86590 time= 0.80121
    Epoch: 0004 train_loss =  1.77976 val_roc_score =  0.87737 average_precision_score =  0.86656 time= 0.79843
    Epoch: 0005 train_loss =  1.76685 val_roc_score =  0.87759 average_precision_score =  0.86664 time= 0.79843
    Epoch: 0006 train_loss =  1.71661 val_roc_score =  0.87767 average_precision_score =  0.86667 time= 0.80479
    Epoch: 0007 train_loss =  1.67656 val_roc_score =  0.87775 average_precision_score =  0.86670 time= 0.80509
    Epoch: 0008 train_loss =  1.62324 val_roc_score =  0.87785 average_precision_score =  0.86679 time= 0.80446
    Epoch: 0009 train_loss =  1.57730 val_roc_score =  0.87781 average_precision_score =  0.86680 time= 0.80424
    Epoch: 0010 train_loss =  1.51882 val_roc_score =  0.87789 average_precision_score =  0.86675 time= 0.80852
    Epoch: 0011 train_loss =  1.46346 val_roc_score =  0.87792 average_precision_score =  0.86678 time= 0.80625
    Epoch: 0012 train_loss =  1.37688 val_roc_score =  0.87795 average_precision_score =  0.86684 time= 0.80474
    Epoch: 0013 train_loss =  1.31243 val_roc_score =  0.87795 average_precision_score =  0.86685 time= 0.80574
    Epoch: 0014 train_loss =  1.25133 val_roc_score =  0.87791 average_precision_score =  0.86677 time= 0.80267
    Epoch: 0015 train_loss =  1.19762 val_roc_score =  0.87802 average_precision_score =  0.86693 time= 0.80540
    Epoch: 0016 train_loss =  1.15079 val_roc_score =  0.87812 average_precision_score =  0.86698 time= 0.80784
    Epoch: 0017 train_loss =  1.09600 val_roc_score =  0.87802 average_precision_score =  0.86688 time= 0.79920
    Epoch: 0018 train_loss =  1.05011 val_roc_score =  0.87820 average_precision_score =  0.86711 time= 0.80777
    Epoch: 0019 train_loss =  1.00610 val_roc_score =  0.87840 average_precision_score =  0.86714 time= 0.80412
    Epoch: 0020 train_loss =  0.95014 val_roc_score =  0.87838 average_precision_score =  0.86713 time= 0.80210

    test roc score: 0.8814614254330005
    test ap score: 0.8708329314774368
    ```

    (2).预测

    ```
    from src.vgae.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

  ##### 2.GCNModelARGA(src/arga)

     (1).训练
    ```
    from src.arga.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
  ```
    Epoch: 0001 train_loss =  2.08252 val_roc_score =  0.75422 average_precision_score =  0.66179 time= 0.80230
    Epoch: 0002 train_loss =  2.03940 val_roc_score =  0.86953 average_precision_score =  0.85636 time= 0.79571
    Epoch: 0003 train_loss =  2.00348 val_roc_score =  0.87872 average_precision_score =  0.86847 time= 0.79245
    Epoch: 0004 train_loss =  1.97120 val_roc_score =  0.87997 average_precision_score =  0.86995 time= 0.79640
    Epoch: 0005 train_loss =  1.93477 val_roc_score =  0.88017 average_precision_score =  0.87027 time= 0.79548
    Epoch: 0006 train_loss =  1.89215 val_roc_score =  0.88046 average_precision_score =  0.87038 time= 0.79972
    Epoch: 0007 train_loss =  1.84537 val_roc_score =  0.88072 average_precision_score =  0.87058 time= 0.79561
    Epoch: 0008 train_loss =  1.78754 val_roc_score =  0.88063 average_precision_score =  0.87049 time= 0.79802
    Epoch: 0009 train_loss =  1.72469 val_roc_score =  0.88053 average_precision_score =  0.87043 time= 0.79486
    Epoch: 0010 train_loss =  1.65402 val_roc_score =  0.88063 average_precision_score =  0.87049 time= 0.79423
    Epoch: 0011 train_loss =  1.57884 val_roc_score =  0.88052 average_precision_score =  0.87045 time= 0.79348
    Epoch: 0012 train_loss =  1.49870 val_roc_score =  0.88049 average_precision_score =  0.87046 time= 0.79649
    Epoch: 0013 train_loss =  1.42083 val_roc_score =  0.88056 average_precision_score =  0.87046 time= 0.79063
    Epoch: 0014 train_loss =  1.34764 val_roc_score =  0.88060 average_precision_score =  0.87056 time= 0.79889
    Epoch: 0015 train_loss =  1.27635 val_roc_score =  0.88038 average_precision_score =  0.87043 time= 0.79485
    Epoch: 0016 train_loss =  1.20521 val_roc_score =  0.88050 average_precision_score =  0.87058 time= 0.79927
    Epoch: 0017 train_loss =  1.13763 val_roc_score =  0.88035 average_precision_score =  0.87045 time= 0.79072
    Epoch: 0018 train_loss =  1.07326 val_roc_score =  0.88035 average_precision_score =  0.87049 time= 0.79284
    Epoch: 0019 train_loss =  1.01548 val_roc_score =  0.88023 average_precision_score =  0.87044 time= 0.78869
    Epoch: 0020 train_loss =  0.96069 val_roc_score =  0.88014 average_precision_score =  0.87037 time= 0.79441

    test roc score: 0.8798092171308727
    test ap score: 0.8700487009596252
    ```

    (2).预测

    ```
    from src.arga.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

  ##### 3.GATModelVAE(src/graph_att_gae)
    (1).训练
    ```
    from src.graph_att_gae.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
    ```
    Epoch: 0001 train_loss =  1.83611 val_roc_score =  0.73571 average_precision_score =  0.62940 time= 0.81406
    Epoch: 0002 train_loss =  1.83237 val_roc_score =  0.87094 average_precision_score =  0.85831 time= 0.81499
    Epoch: 0003 train_loss =  1.82761 val_roc_score =  0.87429 average_precision_score =  0.86431 time= 0.81297
    Epoch: 0004 train_loss =  1.78672 val_roc_score =  0.87509 average_precision_score =  0.86525 time= 0.80870
    Epoch: 0005 train_loss =  1.76815 val_roc_score =  0.87523 average_precision_score =  0.86550 time= 0.81497
    Epoch: 0006 train_loss =  1.72495 val_roc_score =  0.87523 average_precision_score =  0.86551 time= 0.81070
    Epoch: 0007 train_loss =  1.69047 val_roc_score =  0.87593 average_precision_score =  0.86601 time= 0.80948
    Epoch: 0008 train_loss =  1.63153 val_roc_score =  0.87573 average_precision_score =  0.86593 time= 0.80709
    Epoch: 0009 train_loss =  1.57143 val_roc_score =  0.87551 average_precision_score =  0.86580 time= 0.80653
    Epoch: 0010 train_loss =  1.50240 val_roc_score =  0.87587 average_precision_score =  0.86594 time= 0.81233
    Epoch: 0011 train_loss =  1.44139 val_roc_score =  0.87567 average_precision_score =  0.86589 time= 0.80861
    Epoch: 0012 train_loss =  1.37266 val_roc_score =  0.87557 average_precision_score =  0.86571 time= 0.80932
    Epoch: 0013 train_loss =  1.32811 val_roc_score =  0.87578 average_precision_score =  0.86597 time= 0.80686
    Epoch: 0014 train_loss =  1.30064 val_roc_score =  0.87607 average_precision_score =  0.86603 time= 0.80962
    Epoch: 0015 train_loss =  1.25788 val_roc_score =  0.87592 average_precision_score =  0.86611 time= 0.80796
    Epoch: 0016 train_loss =  1.23810 val_roc_score =  0.87607 average_precision_score =  0.86617 time= 0.80750
    Epoch: 0017 train_loss =  1.18570 val_roc_score =  0.87594 average_precision_score =  0.86613 time= 0.80911
    Epoch: 0018 train_loss =  1.14961 val_roc_score =  0.87607 average_precision_score =  0.86626 time= 0.81035
    Epoch: 0019 train_loss =  1.10372 val_roc_score =  0.87593 average_precision_score =  0.86598 time= 0.81094
    Epoch: 0020 train_loss =  1.05262 val_roc_score =  0.87605 average_precision_score =  0.86613 time= 0.81442

    test roc score: 0.8758194438300309
    test ap score: 0.8629482273490456
    ```

    (2).预测

    ```
    from src.graph_att_gae.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

  ##### 4.GATModelGAN(src/graph_att_gan)
    (1).训练
    ```
    from src.graph_att_gan.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
    ```
    Epoch: 0001 train_loss =  3.24637 val_roc_score =  0.77403 average_precision_score =  0.68203 time= 0.81267
    Epoch: 0002 train_loss =  3.21157 val_roc_score =  0.87269 average_precision_score =  0.86088 time= 0.81181
    Epoch: 0003 train_loss =  3.15047 val_roc_score =  0.87391 average_precision_score =  0.86203 time= 0.81182
    Epoch: 0004 train_loss =  3.08302 val_roc_score =  0.87457 average_precision_score =  0.86271 time= 0.81055
    Epoch: 0005 train_loss =  3.03024 val_roc_score =  0.87410 average_precision_score =  0.86226 time= 0.81125
    Epoch: 0006 train_loss =  2.95011 val_roc_score =  0.87450 average_precision_score =  0.86264 time= 0.81162
    Epoch: 0007 train_loss =  2.82191 val_roc_score =  0.87460 average_precision_score =  0.86275 time= 0.81088
    Epoch: 0008 train_loss =  2.73079 val_roc_score =  0.87442 average_precision_score =  0.86256 time= 0.80648
    Epoch: 0009 train_loss =  2.61711 val_roc_score =  0.87454 average_precision_score =  0.86268 time= 0.81021
    Epoch: 0010 train_loss =  2.50720 val_roc_score =  0.87480 average_precision_score =  0.86288 time= 0.80921
    Epoch: 0011 train_loss =  2.42761 val_roc_score =  0.87506 average_precision_score =  0.86298 time= 0.81137
    Epoch: 0012 train_loss =  2.36874 val_roc_score =  0.87497 average_precision_score =  0.86282 time= 0.81466
    Epoch: 0013 train_loss =  2.29911 val_roc_score =  0.87504 average_precision_score =  0.86291 time= 0.81193
    Epoch: 0014 train_loss =  2.21190 val_roc_score =  0.87526 average_precision_score =  0.86297 time= 0.80965
    Epoch: 0015 train_loss =  2.12611 val_roc_score =  0.87511 average_precision_score =  0.86290 time= 0.81013
    Epoch: 0016 train_loss =  2.03527 val_roc_score =  0.87528 average_precision_score =  0.86314 time= 0.81365
    Epoch: 0017 train_loss =  1.96965 val_roc_score =  0.87524 average_precision_score =  0.86309 time= 0.81125
    Epoch: 0018 train_loss =  1.90381 val_roc_score =  0.87515 average_precision_score =  0.86312 time= 0.80971
    Epoch: 0019 train_loss =  1.85955 val_roc_score =  0.87487 average_precision_score =  0.86288 time= 0.80996
    Epoch: 0020 train_loss =  1.81664 val_roc_score =  0.87483 average_precision_score =  0.86293 time= 0.81270

    test roc score: 0.8826745834179653
    test ap score: 0.8715261230395998
    ```

    (2).预测

    ```
    from src.graph_att_gan.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

  ##### 5.NHGATModelVAE(src/graph_nheads_att_gae)
    (1).训练
    ```
    from src.graph_nheads_att_gae.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
    ```
    Epoch: 0001 train_loss =  1.85570 val_roc_score =  0.80750 average_precision_score =  0.72917 time= 0.84645
    Epoch: 0002 train_loss =  1.78607 val_roc_score =  0.88103 average_precision_score =  0.87114 time= 0.84186
    Epoch: 0003 train_loss =  1.68021 val_roc_score =  0.88117 average_precision_score =  0.87144 time= 0.84135
    Epoch: 0004 train_loss =  1.52555 val_roc_score =  0.88115 average_precision_score =  0.87141 time= 0.84212
    Epoch: 0005 train_loss =  1.38254 val_roc_score =  0.88070 average_precision_score =  0.87098 time= 0.83917
    Epoch: 0006 train_loss =  1.40003 val_roc_score =  0.88106 average_precision_score =  0.87134 time= 0.84185
    Epoch: 0007 train_loss =  1.31239 val_roc_score =  0.88081 average_precision_score =  0.87110 time= 0.83766
    Epoch: 0008 train_loss =  1.17827 val_roc_score =  0.88102 average_precision_score =  0.87134 time= 0.84063
    Epoch: 0009 train_loss =  1.08710 val_roc_score =  0.88086 average_precision_score =  0.87126 time= 0.84173
    Epoch: 0010 train_loss =  1.01816 val_roc_score =  0.88136 average_precision_score =  0.87162 time= 0.84121
    Epoch: 0011 train_loss =  0.95128 val_roc_score =  0.88128 average_precision_score =  0.87133 time= 0.84128
    Epoch: 0012 train_loss =  0.87212 val_roc_score =  0.88127 average_precision_score =  0.87142 time= 0.84218
    Epoch: 0013 train_loss =  0.80497 val_roc_score =  0.88134 average_precision_score =  0.87154 time= 0.84077
    Epoch: 0014 train_loss =  0.75538 val_roc_score =  0.88088 average_precision_score =  0.87120 time= 0.83701
    Epoch: 0015 train_loss =  0.70903 val_roc_score =  0.88063 average_precision_score =  0.87073 time= 0.83698
    Epoch: 0016 train_loss =  0.68525 val_roc_score =  0.88035 average_precision_score =  0.87055 time= 0.83837
    Epoch: 0017 train_loss =  0.66079 val_roc_score =  0.87995 average_precision_score =  0.87053 time= 0.83806
    Epoch: 0018 train_loss =  0.65187 val_roc_score =  0.87924 average_precision_score =  0.86958 time= 0.84210
    Epoch: 0019 train_loss =  0.64572 val_roc_score =  0.87929 average_precision_score =  0.86995 time= 0.84069
    Epoch: 0020 train_loss =  0.64103 val_roc_score =  0.87951 average_precision_score =  0.87026 time= 0.83967

    test roc score: 0.877033361471422
    test ap score: 0.867286248500891
    ```

    (2).预测

    ```
    from src.graph_nheads_att_gae.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

    ##### 6.NHGATModelGAN(src/graph_nheads_att_gan)
    (1).训练
    ```
    from src.graph_nheads_att_gan.train import Train
    train = Train()
    train.train_model('config.cfg')
    ```
    ```
    Epoch: 0001 train_loss =  3.24091 val_roc_score =  0.77050 average_precision_score =  0.66992 time= 0.85475
    Epoch: 0002 train_loss =  3.18022 val_roc_score =  0.87671 average_precision_score =  0.86657 time= 0.84643
    Epoch: 0003 train_loss =  3.09047 val_roc_score =  0.87715 average_precision_score =  0.86704 time= 0.84354
    Epoch: 0004 train_loss =  2.95696 val_roc_score =  0.87695 average_precision_score =  0.86698 time= 0.84279
    Epoch: 0005 train_loss =  2.87052 val_roc_score =  0.87747 average_precision_score =  0.86741 time= 0.84714
    Epoch: 0006 train_loss =  2.88739 val_roc_score =  0.87742 average_precision_score =  0.86727 time= 0.84777
    Epoch: 0007 train_loss =  2.78251 val_roc_score =  0.87757 average_precision_score =  0.86748 time= 0.84134
    Epoch: 0008 train_loss =  2.65458 val_roc_score =  0.87766 average_precision_score =  0.86745 time= 0.84429
    Epoch: 0009 train_loss =  2.60484 val_roc_score =  0.87798 average_precision_score =  0.86780 time= 0.84680
    Epoch: 0010 train_loss =  2.56642 val_roc_score =  0.87806 average_precision_score =  0.86766 time= 0.84952
    Epoch: 0011 train_loss =  2.49832 val_roc_score =  0.87826 average_precision_score =  0.86771 time= 0.84535
    Epoch: 0012 train_loss =  2.38511 val_roc_score =  0.87799 average_precision_score =  0.86763 time= 0.84903
    Epoch: 0013 train_loss =  2.28920 val_roc_score =  0.87781 average_precision_score =  0.86762 time= 0.84161
    Epoch: 0014 train_loss =  2.23039 val_roc_score =  0.87791 average_precision_score =  0.86761 time= 0.84422
    Epoch: 0015 train_loss =  2.14044 val_roc_score =  0.87782 average_precision_score =  0.86750 time= 0.84063
    Epoch: 0016 train_loss =  2.05134 val_roc_score =  0.87774 average_precision_score =  0.86754 time= 0.84043
    Epoch: 0017 train_loss =  1.95402 val_roc_score =  0.87745 average_precision_score =  0.86740 time= 0.84461
    Epoch: 0018 train_loss =  1.89405 val_roc_score =  0.87714 average_precision_score =  0.86720 time= 0.84435
    Epoch: 0019 train_loss =  1.83182 val_roc_score =  0.87690 average_precision_score =  0.86693 time= 0.84567
    Epoch: 0020 train_loss =  1.74144 val_roc_score =  0.87683 average_precision_score =  0.86717 time= 0.84130

    test roc score: 0.8767371798715641
    test ap score: 0.8680650766563964
    ```

    (2).预测

    ```
    from src.graph_nheads_att_gan.predict import Predict

    predict = Predict()
    predict.load_model_adj('config_cfg')
    # 会返回原始的图邻接矩阵和经过模型编码后的hidden embedding经过内积解码的邻接矩阵，可以对这两个矩阵进行比对，得出link prediction.
    adj_orig, adj_rec = predict.predict()
    ```

## Dataset

   数据来自酵母蛋白质相互作用[yeast](http://snap.stanford.edu/deepnetbio-ismb/ipynb/yeast.edgelist) 。
   数据集的格式如下，具体可见[data](data/yeast/yeast.edgelist)。
   ```
    YLR418C	YOL145C
    YOL145C	YLR418C
    YLR418C	YOR123C
    YOR123C	YLR418C
    ......         ......
   ```

## Install
* 安装：pip install GCN4LP
* 下载源码：
```
git clone https://github.com/jiangnanboy/gcn_for_prediction_of_protein_interactions.git
cd gcn_for_prediction_of_protein_interactions
python setup.py install
```

通过以上两种方法的任何一种完成安装都可以。如果不想安装，可以下载[github源码包](https://github.com/jiangnanboy/gcn_for_prediction_of_protein_interactions/archive/refs/heads/main.zip)

## Cite

如果你在研究中使用了GCN4LP，请按如下格式引用：

```latex
@software{GCN4LP,
  author = {Shi Yan},
  title = {GCN4LP: gcn for prediction of protein interactions},
  year = {2021},
  url = {https://github.com/jiangnanboy/gcn_for_prediction_of_protein_interactions},
}
```

## Reference

* [Variational Graph Auto-Encoders](https://arxiv.org/pdf/1611.07308.pdf)
* https://github.com/zfjsail/gae-pytorch/blob/master/gae/utils.py
* https://github.com/tkipf/gae/tree/master/gae
* http://snap.stanford.edu/deepnetbio-ismb/ipynb/Graph+Convolutional+Prediction+of+Protein+Interactions+in+Yeast.html
* [Adversarially Regularized Graph Autoencoder for Graph Embedding](https://arxiv.org/pdf/1802.04407v2.pdf)
* https://github.com/pyg-team/pytorch_geometric
* [GRAPH ATTENTION NETWORKS](https://arxiv.org/pdf/1710.10903.pdf)