text:
[![Build Status](
https://travis-ci.org/nickrusso42518/perf.svg?branch=master)](
https://travis-ci.org/nickrusso42518/perf)

[![published](
http://cs.co/codeex-badge)](
https://developer.cisco.com/codeexchange/github/repo/nickrusso42518/perf)

# Performance Testers
This series of playbooks accomplishes a number of performance test
tasks in the network. They are briefly described below, with each
one becoming more time consuming and comprehensive than the one before it.

  * `sperf`: Short-term performance test that builds a matrix of average
    RTT times. This is suitable for general public distribution. Unlike
    other tests, the number of columns is dynamic based on the target
    list.

  * `mperf`: Mid-term performance test that builds a matrix of data from
    many subcomponents, listed below. It is provided to engineers only.
    * IP SLA udp-jitter to capture detailed performance metrics
    * ICMP ping to probe for MTU/fragmentation problems
    * MPLS ping (LSPV) to test MPLS label switch path health

  * `lperf`: Long-term performance test that focuses on detailed performance
    data collected over hours. It is provided in support of sustained
    efforts or as proof to your SP that they are not meeting their SLAs.

Given these reachability results, some basic conclusions about the
state of the network are drawn and summarized in a synopsis for each target.
Collected information is rolled up in a master CSV file for quick reference.
Again, the length and composition of each CSV file differs between the 3 tests.

> Contact information:\
> Email<EMAIL_ADDRESS>> Twitter:  @nickrusso42518

  * [Supported platforms](#supported-platforms)
  * [Hosts](#hosts)
  * [Variables](#variables)
  * [Templates](#templates)
  * [LSPV Codes](#lspv-codes)
  * [IP SLA Columns](#ip-sla-columns)

## Supported platforms
Cisco IOS routers are supported today. The routers need to be on a version
that supports the exec command set `ip sla udp-jitter` and `ping mpls ipv4`
in order to function with the `mperf` and `lperf` playbooks. All three
playbooks require basic ICMP `ping` functionality, which all Cisco IOS
routers support.

Testing was conducted on the following platforms and versions:

  * Cisco CSR1000v, version 16.07.01a, running in AWS

## Hosts
All Cisco IOS MPLS routers in the `perf_routers` group are in scope. Normally,
the playbook runs what is effectively a full IP/MPLS reachability test in the
global table. For a more rapid test, you can modify the `targets` list to
include only some routers, while also changing the hosts in scope. A
combination of approaches are also supported. For example, maybe logging into
one router per region then targeting 2 routers in every other region
provides a sufficient picture of the current network performance.

The following are __REQUIRED__ for this playbooks to work:

  * All routers must be in a group containing the string `"region"`
  * All routers must be in exactly one of these regional groups
  * All regional groups must be children of `perf_routers`
  * Each regional group must have a corresponding `regional_sla` dict.
    This provides the SLA committments to all other regions, including
    its own (intra-regional SLA).

```
# hosts.yml
---
all:
  hosts:
    localhost:
  children:
    perf_routers:
      children:
        usa_region:  # AWS North Virginia, USA
          hosts:
            csr1:
            csr2:
        emear_region:  # AWS Frankfurt, Germany
          hosts:
            csr3:
...
```

Below are two examples of group variables files, one per region.

```
# group_vars/usa_region.yml
---
regional_sla:
  usa_region: 30
  emear_region: 88  # Aggressive SLA chosen to show over threshold counters
...
```

```
# group_vars/emear_region.yml
---
regional_sla:
  usa_region: 120  # Conservative SLA chosen to show good performance
  emear_region: 40
...`
```

## Variables
These playbooks rely only on `group_vars` that are defined for the general
router group. The main variable is a sequence called `targets` that lists the
__global__ hostname of any remote host. Nodes not yet activated/configured
should still be added to the list; the playbook has the intelligence to
only consider "online" targets based on /32 FIB entries present.
To save processing time, this collection of "online" targets is only run
on one host then referenced from the rest. The output parsing
is accomplished using the `intersect_block` custom filter.

Regional SLA values were discussed above as they are more relevant to
hosts (and their geographic locations) than they are to general playbook
operation.

As a minor `mperf` option, operators can modify the IP SLA repeat count.
For quick reachability testing, the repeat count should be small. For
reliable performance testing, the repeat count should be high. __Note that
probes that run too long or incur too much loss will simply fail to provide
any results, which is a shortcoming of the IP SLA feature when invoked
from the exec shell.__

The `state` variable is only relevant for long-term probes since the
`lperf_put` playbook will add or remove them, depending. The `time_hrs`
variable is the number of hours the probe should run and must be between 1-24.
The state can be `present`, `absent`, or `restarted` only.
Only the most recent complete hour of statistics is available
when long-term performance metrics are retrieved. This is a limitation
of the current playbook implementation, and may be improved in a
future revision. The repeat count is only valid for the
`mperf` playbook.

One final note: The targets in this list __must__ be loopback0 IP addresses.
This limitation may seem arbitrary, but it simplifies the code and generally
makes sense, since we are testing reachability of MPLS LSPs in many cases.
These IPs may not be the same IPs as those used for management of a given node
as specified in the inventory. For networks where devices are managed in-band
by their loopback0 IP addresses, the target name and the inventory name can
be the same.

```
---
state: present
time_hrs: 1
repeat: 10
targets:
  - id: 100101
    target: csr1_lb0
  - id: 100102
    target: csr2_lb0
...
```

Finally, there is a common variable called `scp` to assist with copying
rollups off the control machine onto an SCP server:

  * `user`: The SCP username that can write files to the SCP server.
  * `host`: The SCP server FQDN/IP address. Under its root directory, a
    directory called `perf/` should be created. This is where the archives
    generated by this playbook are copied.

## Templates
The templates are __NOT__ commented for readability in this playbook since
they are not used for issuing commands to a network device. Rather, the
template is used for transforming IOS output into a human-readable CSV file
for further analysis and archival. Many custom filters are used and are
individually documented in the Python source code, which can be
found in the `plugins/filter/filter.py` file.

__The templates should not be changed at the operator level.__

## LSPV Codes
The table below provides the LSPV codes that may appear in the `mperf`
sheets when testing MPLS reachability.

```
+------+-----------------------------------------------------------------------+
| CODE | MEANING                                                               |
+------+-----------------------------------------------------------------------+
| !    | success                                                               |
| Q    | request not sent                                                      |
| .    | timeout                                                               |
| L    | labeled output interface                                              |
| B    | unlabeled output interface                                            |
| D    | DS Map mismatch                                                       |
| F    | no FEC mapping                                                        |
| f    | FEC mismatch                                                          |
| M    | malformed request                                                     |
| m    | unsupported tlvs                                                      |
| N    | no label entry                                                        |
| P    | no rx intf label prot                                                 |
| p    | premature termination of LSP                                          |
| R    | transit router                                                        |
| I    | unknown upstream index                                                |
| l    | Label switched with FEC change                                        |
| d    | see DDMAP for return code                                             |
| X    | unknown return code                                                   |
| x    | return code 0                                                         |
+------+-----------------------------------------------------------------------+
```

## IP SLA Columns
The table below provides the detailed explanations for the abbreviated
column headers in the spreadsheet. This is used only for `mperf` and `lperf`
playbooks as `sperf` only shows average RTT for brevity.

```
+---------------+-------------------------------------------------------------+
| COLUMN NAME   | DETAILED EXPLANATION                                        |
+---------------+-------------------------------------------------------------+
| rtt_cnt       | Number Of RTT received                                      |
| rtt_min       | RTT Minimum (ms)                                            |
| rtt_avg       | RTT Average (ms)                                            |
| rtt_max       | RTT Maximum (ms)                                            |
| rtt_ovthr     | Number Of RTT Over Threshold                                |
| rtt_ovthp     | Percentage Of RTT Over Threshold                            |
| lat_cnt       | Number of Latency one-way Samples                           |
| lat_sd_min    | Source to Destination Latency one way Minimum (ms)          |
| lat_sd_avg    | Source to Destination Latency one way Average (ms)          |
| lat_sd_max    | Source to Destination Latency one way Maximum (ms)          |
| lat_ds_min    | Destination to Source Latency one way Minimum (ms)          |
| lat_ds_avg    | Destination to Source Latency one way Average (ms)          |
| lat_ds_max    | Destination to Source Latency one way Maximum (ms)          |
| jit_sd_cnt    | Number of Source to Destination Jitter Samples              |
| jit_sd_min    | Source to Destination Jitter Minimum (ms)                   |
| jit_sd_avg    | Source to Destination Jitter Average (ms)                   |
| jit_sd_max    | Source to Destination Jitter Maximum (ms)                   |
| jit_ds_cnt    | Number of Destination to Source Jitter Samples              |
| jit_ds_min    | Destination to Source Jitter Minimum (ms)                   |
| jit_ds_avg    | Destination to Source Jitter Average (ms)                   |
| jit_ds_max    | Destination to Source Jitter Maximum (ms)                   |
| los_sd        | Loss Source to Destination                                  |
| los_sd_per    | Source to Destination Loss Periods Number                   |
| los_sd_pmin   | Source to Destination Loss Period Length Minimum (ms)       |
| los_sd_pmax   | Source to Destination Loss Period Length Maximum (ms)       |
| los_sd_imin   | Source to Destination Inter Loss Period Length Minimum (ms) |
| los_sd_imax   | Source to Destination Inter Loss Period Length Maximum (ms) |
| los_ds        | Loss Destination to Source                                  |
| los_ds_per    | Destination to Source Loss Periods Number                   |
| los_ds_pmin   | Destination to Source Loss Period Length Minimum (ms)       |
| los_ds_pmax   | Destination to Source Loss Period Length Maximum (ms)       |
| los_ds_imin   | Destination to Source Inter Loss Period Length Minimum (ms) |
| los_ds_imax   | Destination to Source Inter Loss Period Length Maximum (ms) |
| pkt_ooseq     | Packets Out Of Sequence                                     |
| pkt_tdrop     | Packets Tail Dropped                                        |
| pkt_late      | Packets Arrived Late                                        |
| pkt_skip      | Packets Skipped                                             |
| voc_mos_min   | Mean Opinion Score (MOS) Minimum: 0.00-5.00                 |
| voc_mos_max   | Mean Opinion Score (MOS) Maximum: 0.00-5.00                 |
| voc_icpif_min | Calculated Planning Impairment Factor (ICPIF) Minimum: 1-20 |
| voc_icpif_max | Calculated Planning Impairment Factor (ICPIF) Maximum: 1-20 |
+---------------+-------------------------------------------------------------+
```

repository: dthirumalaibe/perf

repo_name: dthirumalaibe/perf


text:
# `cmake` Code Generator

If you desire to build and execute these programs from the command line, this can be made easier with `cmake` by issuing the following commands:

```bash
$ cmake -G "Unix Makefiles" ../..
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jim/CLionProjects/lab05/generator/unix
$ make
Scanning dependencies of target lab05
[  6%] Building CXX object CMakeFiles/lab05.dir/src/main/cpp/Main.cpp.o
[ 13%] Building CXX object CMakeFiles/lab05.dir/src/main/cpp/TopDownFibCalculator.cpp.o
[ 20%] Building CXX object CMakeFiles/lab05.dir/src/main/cpp/BottomUpFibCalculator.cpp.o
[ 26%] Linking CXX executable ../../out/lab05
[ 26%] Built target lab05
Scanning dependencies of target lab05Demo
[ 33%] Building CXX object CMakeFiles/lab05Demo.dir/src/main/cpp/Demo.cpp.o
[ 40%] Building CXX object CMakeFiles/lab05Demo.dir/src/main/cpp/TopDownFibCalculator.cpp.o
[ 46%] Building CXX object CMakeFiles/lab05Demo.dir/src/main/cpp/BottomUpFibCalculator.cpp.o
[ 53%] Linking CXX executable ../../out/lab05Demo
[ 53%] Built target lab05Demo
Scanning dependencies of target lab05Test
[ 60%] Building CXX object CMakeFiles/lab05Test.dir/src/test/cpp/UnitTestRunner.cpp.o
[ 66%] Building CXX object CMakeFiles/lab05Test.dir/src/main/cpp/TopDownFibCalculator.cpp.o
[ 73%] Building CXX object CMakeFiles/lab05Test.dir/src/main/cpp/BottomUpFibCalculator.cpp.o
[ 80%] Building CXX object CMakeFiles/lab05Test.dir/src/test/cpp/TestUtils.cpp.o
[ 86%] Building CXX object CMakeFiles/lab05Test.dir/src/test/cpp/TopDownFibCalculatorTest.cpp.o
[ 93%] Building CXX object CMakeFiles/lab05Test.dir/src/test/cpp/BottomUpFibCalculatorTest.cpp.o
[100%] Linking CXX executable ../../out/lab05Test
[100%] Built target lab05Test
$
```

And now you have three different executable files that you can execute:

* `lab05` - This will execute the code found in `Main.cpp`
* `lab05Demo` - This will execute the map demo code found in `Demo.cpp`
* `lab05Test` - This will execute the CPPUNIT tests found in the `src/test/cpp` folder

If you want to generate different types of project files, just type

```bash
$ cmake -g "some gibberish" ../..
CMake Error: Could not create named generator some gibberish

Generators
  Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
  KDevelop3                    = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles   = Generates KDevelop 3 project files.

```

which of course will generate an error, but it'll also tell what generators are available on your system.

If you're a Windows user trying to generate Visual Studio solutions, you're best bet is to not use `cmake` that comes with Cygwin, but rather to install it natively on your Windows box. See [https://cmake.org/download/](https://cmake.org/download/)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Game Engine Math

This is a bunch of random mathematics code related to working through [Foundations of Game Engine Development, Volume 1: Mathematics](https://www.amazon.com/Foundations-Game-Engine-Development-Mathematics/dp/0985811749) and experimenting.

See also, Liam's C++ version in [liamcoal/game-engine-math](https://github.com/liamcoal/game-engine-math).


text:
Changelog
=========

Here you can see the full list of changes between each release.

Version 1.1.1
-------------

Released June 7th, 2022

* Removes an unused import which in turn fixes a dependency error

Version 1.0.7
-------------

Released October 10th, 2019

* Fix translations not working correctly due to missing babel.cfg config
  file.

Version 1.0.6
-------------

Released March 30th, 2019

* Fixes an IntegrityError when deleting a user with conversations.

Version 1.0.5
-------------

Released March 29th, 2019

* Include migrations/ directory in wheel and sdist distribution

Version 1.0.4
-------------

Released March 28th, 2019

* Fixes some pluggy related deprecation warnings

Version 1.0.3
-------------

Released June 2nd, 2018

* Add translations
* Fixes a 'null' endpoint
* Fixes Quick Reply

Version 1.0.2
-------------

Released March 26th, 2018

* Include source distribution in releases
* Fixes an old url_for reference

Version 1.0.1
-------------

Released March 23rd, 2018

* Fixes some hooks

Version 1.0.0
-------------

Released February 23rd, 2018

* Initial release

repository: flaskbb/flaskbb-plugin-conversations

repo_name: flaskbb/flaskbb-plugin-conversations


text:
---
title: "Filter expressions"
menu:
    concepts:
        weight: 4
---

# Filter expressions

Many commands in the mitmproxy tool make use of filter expressions. Filter
expressions consist of the following operators:

{{< readfile file="/generated/filters.html" >}}

- Regexes are Python-style
- Regexes can be specified as quoted strings
- Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".
- Strings with no operators are matched against the request URL.
- The default binary operator is &.

## View flow selectors

In interactive contexts, mitmproxy has a set of convenient flow selectors that
operate on the current view:

@all	All flows

@focus	The currently focused flow

@shown	All flows currently shown

@hidden	All flows currently hidden

@marked	All marked flows

@unmarked	All unmarked flows

These are frequently used in commands and key bindings.

## Examples

URL containing "google.com":

    google\.com

Requests whose body contains the string "test":

    ~q ~b test

Anything but requests with a text/html content type:

    !(~q & ~t "text/html")

Replace entire GET string in a request (quotes required to make it work):

   ":~q ~m GET:.*:/replacement.html"

repository: mhils/mitmproxy

branch_name: refs/heads/main

gha_language: Python

gha_license_id: MIT

repo_name: mhils/mitmproxy


text:
# pub-src-dropbox
[![CI](https://github.com/jldec/pub-src-dropbox/workflows/CI/badge.svg)](https://github.com/jldec/pub-src-dropbox/actions)

dropbox source for pub-server and pub-generator

* provides `get()` and `put()` for bulk reads and writes
* works in conjunction with `pub-src-fs/fs-base`
* assumes that all files are utf-8 text (does NOT currently handle binary files)
* globs and descends directories

## src(options)

```javascript
var src = require('pub-src-dropbox');

// instantiate source
// options become properties of source
var source = src(
{ path:'/',
  glob:'*.md' } );

source.get(function(err, files) {
  if (err) return console.log(err);
  console.log(_.pluck(files, 'path'));
});

```

### source.path
- defaults to '/'

### source.glob
- `glob` is a [node-glob](https://github.com/isaacs/node-glob) pattern

### source.depth
- `depth` limits the depth of directory descent when source.glob includes `**/` (globstar)

### source.get(cb)
- `get()` fetches all matching files in one async operation
- the result is an array of file objects each with a `path:` and a `text:` property
- the array is sorted alphabetically by path
- results do not include directories, but do include files in subdirectories
- if the source is writable, `get()` is atomic with respect to `put()` or other `source.get()` operations

```javascript
[ { path: '/README.md',
    text: '...' } ]
```

### source.put(files, cb)
- does nothing unless `writable` is set on the source
- stores an array of file objects in a single commit
- is atomic with respect to `source.get()` or other `source.put()` operations
- returns an array of the paths written

```javascript
source.put(
  files,
  function(err, result) {
    if (err) return console.log(err);
    console.log(result);
  }
);
```

### configuring access to the pub-server folder on dropbox
To configure access to the pub-server folder on dropbox, set the following variable in your environment
(this is requird for running tests)

```sh
export DBAC={access code}
```

repository: jldec/pub-src-dropbox

repo_name: jldec/pub-src-dropbox


text:
# Search Loyalty Rewards Response

A response that includes the loyalty rewards satisfying the search criteria.

## Structure

`Search Loyalty Rewards Response`

## Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. |
| `rewards` | [`List Loyalty Reward`](../../doc/models/loyalty-reward.md) | Optional | The loyalty rewards that satisfy the search criteria.
These are returned in descending order by `updated_at`. |
| `cursor` | `str` | Optional | The pagination cursor to be used in a subsequent
request. If empty, this is the final response. |

## Example (as JSON)

```json
{
  "rewards": [
    {
      "created_at": "2020-05-08T22:00:44Z",
      "id": "d03f79f4-815f-3500-b851-cc1e68a457f9",
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
      "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY",
      "points": 10,
      "redeemed_at": "2020-05-08T22:01:17Z",
      "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
      "status": "REDEEMED",
      "updated_at": "2020-05-08T22:01:17Z"
    },
    {
      "created_at": "2020-05-08T21:55:42Z",
      "id": "9f18ac21-233a-31c3-be77-b45840f5a810",
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
      "points": 10,
      "redeemed_at": "2020-05-08T21:56:00Z",
      "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
      "status": "REDEEMED",
      "updated_at": "2020-05-08T21:56:00Z",
      "order_id": "order_id0"
    },
    {
      "created_at": "2020-05-01T21:49:54Z",
      "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943",
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
      "order_id": "5NB69ZNh3FbsOs1ox43bh1xrli6YY",
      "points": 10,
      "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
      "status": "DELETED",
      "updated_at": "2020-05-08T21:55:10Z"
    },
    {
      "created_at": "2020-05-01T20:20:37Z",
      "id": "a051254c-f840-3b45-8cf1-50bcd38ff92a",
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
      "order_id": "LQQ16znvi2VIUKPVhUfJefzr1eEZY",
      "points": 10,
      "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
      "status": "ISSUED",
      "updated_at": "2020-05-01T20:20:40Z"
    }
  ],
  "errors": [
    {
      "category": "REFUND_ERROR",
      "code": "MERCHANT_SUBSCRIPTION_NOT_FOUND",
      "detail": "detail1",
      "field": "field9"
    },
    {
      "category": "MERCHANT_SUBSCRIPTION_ERROR",
      "code": "BAD_REQUEST",
      "detail": "detail2",
      "field": "field0"
    },
    {
      "category": "EXTERNAL_VENDOR_ERROR",
      "code": "MISSING_REQUIRED_PARAMETER",
      "detail": "detail3",
      "field": "field1"
    }
  ],
  "cursor": "cursor6"
}
```

repository: square/square-python-sdk

gha_license_id: NOASSERTION

repo_name: square/square-python-sdk


text:
[![Build Status](https://travis-ci.org/SIMPATICOProject/CDV.svg?branch=master)](https://travis-ci.org/SIMPATICOProject/CDV)
[![codecov](https://codecov.io/gh/SIMPATICOProject/CDV/branch/master/graph/badge.svg)](https://codecov.io/gh/SIMPATICOProject/CDV)

# Citizen Data Vault
Citizen Data Vault (CDV) is a Personal Data Service and Repository that enables citizen (and company) to gather, store, update, correct, analyse, and share personal data.
Of particular importance is the ability to grant and withdraw consent to third parties for access to data about oneself.
With CDV Citizens have a practical mean to manage their data and privacy.

# CDV features
- Manage Personal Data and Metadata (Ontology)
- Register Services
- Data service and Personal Data Ontology Mapping
- Manage Data consent
- Store Personal Data
- Retrieve Personal Data

# CDV Architecture
All the above features are provided by a set of components. The CDV architecture, multilayered and service based is depicted in the figure below. A set of internal and external APIs are provided by the Service Data Service enabling the interaction with the data owner (user) via the CDV Dashboard or with external modules/services via a set of secure REST API.

![CDV Architecture](doc/architecture.png)

# CDV Components

CDV Components are split to their own folders

- [ Account Manager ](cdv-server/account-manager/README.md)
- [ Service Manager ](cdv-server/service-manager/)
- [ Consent Manager ](cdv-server/consent-Manager/)
- [ AuditLog Manager ](cdv-server/auditlog-Manager/)
- [ PData Manager ](cdv-server/pdata-manager/)
- [ Auth Manager ](cdv-server/auth-manager/)
- [ PData Repository ](cdv-server/pdata-repository/)
- [ Data Security Manager ](cdv-server/data-security-manager/)
- [ PData Source Connectors ](cdv-server/pdata-source-connectors/)

## Prerequisites

-   [Git](https://git-scm.com/downloads)
-   [Maven](https://maven.apache.org/download.cgi)
-   [MySQL 5.7.*](https://dev.mysql.com/downloads/mysql/)
- 	Java 1.8.*+
- 	Tomcat 8.*+
- 	MongoDB 3.3.*+

### Proxy configurations

In order to use the different tools behind a proxy please execute the
following commands (*username* and *password* are your credential,
*proxyhost* is the host name or the IP address of the proxy and
*proxyport* is the TCP port of the proxy):

-   **Git**: open a command prompt and execute:

    -   `git config --global http.proxy http://username:password@proxyhost:proxyport`

    -   `git config --global https.proxy http://username:password@proxyhost:proxyport`

-   **Maven**: edit the file “*Path\_Of\_Maven/conf/settings.xml*”:
    -   add to the “*<proxies>*” section the proper configuration following the example provided in the same file (please refer to maven guide https://maven.apache.org/guides/mini/guide-proxies.html)

## Create WAR packages

Open a command prompt and Execute the following command to clone the
repository:

-   `git clone <Git repository path>/CDV.git`

Move in the specific CDV module folder

-   `cd CDV`

In this folder you will find the CDV modules subfolders. In order to create all war packages please run the following command:

-   `mvn package`

All generated war packages will be located inside each module "target" subfolder. Copy all the WAR artifacts to the “webapps” folder of Tomcat installation, start it up and wait until they are deployed.

Currently the implemented and mandatory modules are the following:

-   CDV APIs
    -   account-manager.war
    -   data-security-manager.war
    -   pdata-manager.war
    -   service-manager.war
	-   consent-manager.war
	-	auditlog-manager.war

-   CDV Dashboard
    -   cdv-dashboard

## Deployment

Deployment and configuration instructions for each component can be found in each module's documentation.

## Documentation

Documentation is available for each component in their respective folders.

## Installation with docker

### Configuration

Create keystore with the script:

* `cdv-server/generate-keystore.sh <alias> <password> <filename>`

if no parameters are supplied defaults value will be: <alias>=masterkey, <password>=password, <filename>=keystore

The inserted <alias> <password> <filename> should be used inside the following properties.

Configure properties :

* `cdv-server/docker_config/*`
* `cdv-dashboard/docker_config/config.json`

see documentation in each component for further info for each property.

About CORS problems please see the following CORS Problems section

### build and run

update `cdv.env` file configuration.
input your database credentials (should be the same as the ones you used to configure the component)

* to start the daemon execute `docker-compose start`
* to force rebuilding of the docker containers, use `docker-compose start --build`

* to stop the daemon execute `docker-compose stop`
* to restart as a daemon execute `docker-compose start`

## CORS Problems

To solve possible problems on Cross-Origin Resource Sharing (CORS) between CDV server modules and CDV Dashboard or other clients, you can:
* just tell your browser to ignore CORS (for example chromium-browser --disable-web-security --user-data-dir) - this is the fastest if you just want to play around, but of course it is not a production solution.
* set CORS headers on CDV server machine to allow access from the client ones, for example using CORS filter:

```
<!--CORS Filter-->
  <filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization,accountId</param-value>
  </init-param>
  <init-param>
    <param-name>cors.exposed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
  <init-param>
    <param-name>cors.support.credentials</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>cors.preflight.maxage</param-name>
    <param-value>1800</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
```

* use an "edge" (or "gateway") server that internally re-routes requests via reverse-proxying.

## Support / Contact / Contribution
[Citizen Data Vault](Link|email|contact)

## Copying and License
This code is licensed under [MIT License](LICENSE)

repository: SIMPATICOProject/CDV

gha_language: Java

repo_name: SIMPATICOProject/CDV


text:
# How to start
Below you will find the process and workflow used to review and merge your changes.

## Step 0 : Find an issue  🔍
- Take a look at the Existing Issues or create your **own** Issues!
- Comment on the issue if you want to work on it
- Wait for the Issue to be assigned to you after which you can start working.
- Note : Every change in this project must have an associated issue.

## Step 1 : Fork the Project 🍴 and clone it
- Fork this Repository. This will create a Local Copy of this Repository on your Github Profile. Keep a reference to the original project in `upstream` remote.

- After this go to your terminal and clone this project on your desktop( git should be installed before - [link](https://git-scm.com/) ).

```
$ git clone https://github.com/<username>/FitMate.git
$ cd <repo-name>
$ git remote add upstream https://github.com/Code-Sauce-Official/FitMate.git
```
- Update your forked repo before working.
```
$ git remote update
$ git checkout <branch-name>
$ git rebase upstream/<branch-name>
```
## Step 2 : Branch  🔖
Create a new branch. Use its name to identify the issue you are addressing.

```
# It will create a new branch with name Branch_Name and switch to that branch.
$ git checkout -b branch_name
```

## Step 3 : Work on the issue assigned  📕
- Work on the issue(s) assigned to you.
- Add all the files/folders needed.
- After you've made changes or made your contribution to the project add changes to the branch you've just created by using terminal:
```
# To add all new files to branch Branch_Name
$ git add .

# To add only a few files to Branch_Name
$ git add <some files>
```

## Step 4 : Commit
- To commit give a descriptive message for the convenience of reviewer by using terminal:
```
# This message get associated with all files you have changed.
$ git commit -m "message"
```

### Commit message guidelines
- Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

The type is contained within the title and can be one of these types:
- feat: a new feature
- update: adding new changes
- fix: a bug fix
- docs: changes to documentation
- style: formatting, missing semi colons, etc; no code change
- refactor: refactoring production code
- test: adding tests, refactoring test; no production code change
- chore: updating build tasks, package manager configs, etc; no production code change
```
<type>(<scope>): <subject>

```
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

### Example commit message
```
feat: added insights layout
```
A good rule of thumb for the commit message is to have a present tense verb, followed by whatever it is you're doing in as much detail as possible in 50 chars. Capitalize words correctly and follow general English.
### For more details, visit
- [Git commit message guidelines](http://karma-runner.github.io/0.13/dev/git-commit-msg.html)
- [Writing Good Commit Messages: A Practical Git Guide](https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/)

## Step 5 : Work Remotely
- Now you are ready to work in the remote repository.
- When your work is ready and complies with the project conventions, upload your changes to your fork:

```
# To push your work to your remote repository.
$ git push -u origin <branch_name>
```

## Step 6 : Pull Request  🎣
- Go to your repository in browser and click on compare and pull requests. Then add a title and description to your pull request that explains your contribution.
- Compare
- Create pull request
- Voila! Your Pull Request has been submitted and will be reviewed by the moderators and merged.🥳

## Need more help?🤔
You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, in case you are stuck:
- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request)
- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github)
- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6)
- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github)

## Tip from us😇
It always takes time to understand and learn. So, do not worry at all. We know **you have got this**!💪

branch_name: refs/heads/develop


text:
# indigo

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nfqakademija/indigo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nfqakademija/indigo/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/nfqakademija/indigo/badges/build.png?b=master)](https://scrutinizer-ci.com/g/nfqakademija/indigo/build-status/master)

NFQ Academy '15 Spring semester Team#1 project repository

**Team members**: Darius Vičiulis, Tadas Surgailis, Tadas Butė

**Team mentor**: Paulius Kaminskas

repository: nfqakademija/indigo

gha_language: PHP

repo_name: nfqakademija/indigo


text:
# substatus

substatus is a tool for quickly checking status codes of a common URL pattern in subdomains.

## Install

```
go get -u github.com/huwwp/substatus
```

## Usage

httprobe takes a list of webservers on stdin, extracts the last level subdomain and appends it to the URL (with and without a slash), and then quickly checks response codes.

```
# cat webservers.txt
https://www.example.com
https://images.example.com
# cat webservers.txt | substatus
https://www.example.com/www [404]
https://www.example.com/www/ [404]
https://images.example.com/images/ [404]
https://images.example.com/images [302]
https://images.example.com [200]
https://www.example.com [200]
```

## Credits

Inspired by [tomnomnom's](https://github.com/tomnomnom) various tools.

repository: huwwp/substatus

repo_name: huwwp/substatus


text:
# Speculator

Speculator is a Ruby tool to generate RSpec tests automatically by tracing live/fixture code execution.

The general use case is that you have some code that works as expected within a Rails app or in some sort of integration
test harness or fixture. Speculator will record the execution of that code up to any calls into classes you plan to stub
and then produce a \_spec file that calls your methods using the recorded parameters. Classes specified for stubbing
will have stubs generated appropriately.

## Status

This is all at an early stage. Currently, the package is able to run a test harness in __test/examples/run_example.rb__
and produce a spec for the test class __test/examples/target.rb__. It can also (using the __--dogfood__ option) generate
tests for selected classes/methods within the Speculator codebase.

## TODO (initial)

- Integrate with Rails
- Provide a command line tool to specify testing for a class/method in a Rails web application
- Improve stub handling (for multiple congruent method calls, etc)
- Support use of FactoryGirl in mocking ActiveRecord
- Deal with non-determinacy (updated_at)

## Installation

Add this line to your application's Gemfile:

    gem 'speculator'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install speculator

## Usage

Run the test harness with:

    bundle exec ruby test/examples/run_example.rb [method] [--all] [--dogfood]

__method__ is a method name on Target (__test/examples/target.tb__)

__--all__ generates tests on all methods

__--dogfood__ generates test for internal code

Run the generated example tests with:

    bundle exec rspec test/examples/gen_specs

Run the internal dogfood tests with:

    bundle exec rspec test/gen_specs

TODO: Write proper usage instructions here

## Contributing

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

## Flaming

    gem uninstall speculator

    mail<EMAIL_ADDRESS><
    How can you even try and make such a thing? Tests should be written before examples, do you here.
    Considered Harmful! Go to the back of the class at once.

    {browser} http://www.youtube.com/watch?v=gx4jn77VKlQ

repository: richdrich/speculator

repo_name: richdrich/speculator


text:
# Resource Actions

## Overview
Argo CD allows operators to define custom actions which users can perform on specific resource types. This is used internally to provide actions like `restart` for a `DaemonSet`, or `retry` for an Argo Rollout.

Operators can add actions to custom resources in form of a Lua script and expand those capabilities.

## Custom Resource Actions

Argo CD supports custom resource actions written in [Lua](https://www.lua.org/). This is useful if you:

* Have a custom resource for which Argo CD does not provide any built-in actions.
* Have a commonly performed manual task that might be error prone if executed by users via `kubectl`

The resource actions act on a single object.

You can define your own custom resource actions in the `argocd-cm` ConfigMap.

### Custom Resource Action Types

#### An action that modifies the source resource

This action modifies and returns the source resource.
This kind of action was the only one available till 2.8, and it is still supported.

#### An action that produces a list of new or modified resources

**An alpha feature, introduced in 2.8.**

This action returns a list of impacted resources, each impacted resource has a K8S resource and an operation to perform on.
Currently supported operations are "create" and "patch", "patch" is only supported for the source resource.
Creating new resources is possible, by specifying a "create" operation for each such resource in the returned list.
One of the returned resources can be the modified source object, with a "patch" operation, if needed.
See the definition examples below.

### Define a Custom Resource Action in `argocd-cm` ConfigMap

Custom resource actions can be defined in `resource.customizations.actions.<group_kind>` field of `argocd-cm`. Following example demonstrates a set of custom actions for `CronJob` resources, each such action returns the modified CronJob.
The customizations key is in the format of `resource.customizations.actions.<apiGroup_Kind>`.

```yaml
resource.customizations.actions.batch_CronJob: |
  discovery.lua: |
    actions = {}
    actions["suspend"] = {["disabled"] = true}
    actions["resume"] = {["disabled"] = true}

    local suspend = false
    if obj.spec.suspend ~= nil then
        suspend = obj.spec.suspend
    end
    if suspend then
        actions["resume"]["disabled"] = false
    else
        actions["suspend"]["disabled"] = false
    end
    return actions
  definitions:
  - name: suspend
    action.lua: |
      obj.spec.suspend = true
      return obj
  - name: resume
    action.lua: |
      if obj.spec.suspend ~= nil and obj.spec.suspend then
          obj.spec.suspend = false
      end
      return obj
```

The `discovery.lua` script must return a table where the key name represents the action name. You can optionally include logic to enable or disable certain actions based on the current object state.

Each action name must be represented in the list of `definitions` with an accompanying `action.lua` script to control the resource modifications. The `obj` is a global variable which contains the resource. Each action script returns an optionally modified version of the resource. In this example, we are simply setting `.spec.suspend` to either `true` or `false`.

#### Creating new resources with a custom action

!!! important
    Creating resources via the Argo CD UI is an intentional, strategic departure from GitOps principles. We recommend
    that you use this feature sparingly and only for resources that are not part of the desired state of the
    application.

The resource the action is invoked on would be referred to as the `source resource`.
The new resource and all the resources implicitly created as a result, must be permitted on the AppProject level, otherwise the creation will fail.

##### Creating a source resource child resources with a custom action

If the new resource represents a k8s child of the source resource, the source resource ownerReference must be set on the new resource.
Here is an example Lua snippet, that takes care of constructing a Job resource that is a child of a source CronJob resource - the `obj` is a global variable, which contains the source resource:

```lua
-- ...
ownerRef = {}
ownerRef.apiVersion = obj.apiVersion
ownerRef.kind = obj.kind
ownerRef.name = obj.metadata.name
ownerRef.uid = obj.metadata.uid
job = {}
job.metadata = {}
job.metadata.ownerReferences = {}
job.metadata.ownerReferences[1] = ownerRef
-- ...
```

##### Creating independent child resources with a custom action

If the new resource is independent of the source resource, the default behavior of such new resource is that it is not known by the App of the source resource (as it is not part of the desired state and does not have an `ownerReference`).
To make the App aware of the new resource, the `app.kubernetes.io/instance` label (or other ArgoCD tracking label, if configured) must be set on the resource.
It can be copied from the source resource, like this:

```lua
-- ...
newObj = {}
newObj.metadata = {}
newObj.metadata.labels = {}
newObj.metadata.labels["app.kubernetes.io/instance"] = obj.metadata.labels["app.kubernetes.io/instance"]
-- ...
```

While the new resource will be part of the App with the tracking label in place, it will be immediately deleted if auto prune is set on the App.
To keep the resource, set `Prune=false` annotation on the resource, with this Lua snippet:

```lua
-- ...
newObj.metadata.annotations = {}
newObj.metadata.annotations["argocd.argoproj.io/sync-options"] = "Prune=false"
-- ...
```

(If setting `Prune=false` behavior, the resource will not be deleted upon the deletion of the App, and will require a manual cleanup).

The resource and the App will now appear out of sync - which is the expected ArgoCD behavior upon creating a resource that is not part of the desired state.

If you wish to treat such an App as a synced one, add the following resource annotation in Lua code:

```lua
-- ...
newObj.metadata.annotations["argocd.argoproj.io/compare-options"] = "IgnoreExtraneous"
-- ...
```

#### An action that produces a list of resources - a complete example:

```yaml
resource.customizations.actions.ConfigMap: |
  discovery.lua: |
    actions = {}
    actions["do-things"] = {}
    return actions
  definitions:
  - name: do-things
    action.lua: |
      -- Create a new ConfigMap
      cm1 = {}
      cm1.apiVersion = "v1"
      cm1.kind = "ConfigMap"
      cm1.metadata = {}
      cm1.metadata.name = "cm1"
      cm1.metadata.namespace = obj.metadata.namespace
      cm1.metadata.labels = {}
      -- Copy ArgoCD tracking label so that the resource is recognized by the App
      cm1.metadata.labels["app.kubernetes.io/instance"] = obj.metadata.labels["app.kubernetes.io/instance"]
      cm1.metadata.annotations = {}
      -- For Apps with auto-prune, set the prune false on the resource, so it does not get deleted
      cm1.metadata.annotations["argocd.argoproj.io/sync-options"] = "Prune=false"
      -- Keep the App synced even though it has a resource that is not in Git
      cm1.metadata.annotations["argocd.argoproj.io/compare-options"] = "IgnoreExtraneous"
      cm1.data = {}
      cm1.data.myKey1 = "myValue1"
      impactedResource1 = {}
      impactedResource1.operation = "create"
      impactedResource1.resource = cm1

      -- Patch the original cm
      obj.metadata.labels["aKey"] = "aValue"
      impactedResource2 = {}
      impactedResource2.operation = "patch"
      impactedResource2.resource = obj

      result = {}
      result[1] = impactedResource1
      result[2] = impactedResource2
      return result
```

repository: argoproj/argo-cd

gha_language: Go

repo_name: argoproj/argo-cd


text:
# talkNgo
This is a React/Firebase social media app project

## Technologies/Tools Used
* [Firebase](https://firebase.google.com) - Firebase is a mobile and web app development platform that provides developers with a plethora of tools and services to help them develop high-quality apps.
* [React/Redux](https://reactjs.org/) - A JavaScript library for building user interfaces.
* [Express.js](https://expressjs.com) - Web framework based on Node.js.
* [Material UI](https://material-ui.com/getting-started/learn/) - Material UI provides us React components that implement google material design.

repository: Joyce-O/talkNgo

repo_name: Joyce-O/talkNgo


text:
## Pull Request template

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

1. Make sure that your PR is not a duplicate.
2. If not, then make sure that:

    a. You have done your changes in a separate branch. Branches MUST have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/signin-issue` or `feature/issue-templates`.

    b. You have a descriptive commit message with a short title (first line).

    c. You have only one commit (if not, squash them into one commit).

    d. `test` doesn't throw any error.

3. **After** these steps, you're ready to open a pull request.

    a. Your pull request MUST NOT target the `master` branch on this repository. You probably want to target `staging` instead.

    b. Give a descriptive title to your PR.

    c. Provide a description of your changes.

    d. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

IMPORTANT: Please review the [CONTRIBUTING.md](../docs/CONTRIBUTING.md) file for detailed contributing guidelines.

## Types of changes

What types of changes does your code introduce?
_Put an `x` in the boxes that apply_

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update (if none of the other choices apply)

## Checklist

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING](../docs/CONTRIBUTING.md) document
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
- [ ] Any dependent changes have been merged and published in downstream modules

## Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...


text:
# Blendo steam uploader
[![Generic badge](https://img.shields.io/badge/Download-itch.io-red.svg)](https://blendogames.itch.io/blendo-steam-uploader) [![Donate](https://img.shields.io/badge/donate-$$$-brightgreen.svg)](https://blendogames.itch.io/blendo-steam-uploader/purchase)

## About
I wanted a more visual way of managing my builds, so I made a gui wrapper around Steam's command-line Steampipe tools.

[![screenshot of Blendo steam uploader](screenshot.png)](screenshot.png)

This is written in C# and a .sln solution for Visual Studio 2010 is provided. Windows only.

Pre-compiled binaries are available at [my itch.io page](https://blendogames.itch.io/blendo-steam-uploader).

## License
This source code is licensed under the zlib license. Read the license details here: [LICENSE.md](https://github.com/blendogames/steam_uploader/blob/master/license.md)

## Credits
by [Brendon Chung](http://blendogames.com)

## Libraries used
- [Json.NET](https://www.newtonsoft.com/json)

license: Zlib


text:
---
title: Introducing Flex
slug: introducing-flex
updated: 2019-11-21
category: introduction
ingress:
  Overview of how Sharetribe Flex works, and how you can build your
  online marketplace platform using it.
published: true
---

## Introduction

Sharetribe Flex is a complete solution for building a powerful online
marketplace for rentals, services, events or experiences. Flex provides
you with all the necessary marketplace infrastructure out of the box. At
the same time, because of its headless architecture, Flex gives you
total freedom to customize your user experience.

This makes Flex the fastest and most affordable way to build a unique
platform that adapts to the entire lifecycle of your business. As your
business grows, Flex takes care of running and scaling your backend —
allowing you to focus on the unique value of your platform.

## Flex Components

![Flex customer architecture](./flex-customer-architecture.png)

### Your marketplace UI

Your marketplace user interface (UI), also known as the "front end", is
what your users see and interact with. They use the UI to sign up to
your platform as well as to post, find, book, and pay for listings.
Whether a web-based UI, a mobile application, or both, the user
interface is the face of your solution. That's why you have total
control over it.

You can fully choose things like which fonts and colors to use in your
user interface, what kind of pages or views there should be, and how
those should be laid out. There are no limits to what you can do in
terms of visual design.

[Sharetribe Web Template](/introduction/getting-started-with-web-template/)
is a web template that implements a full-feature marketplace experience
powered by Flex. The template can be configured to three types of
marketplaces out of the box:

- a rental marketplace with daily or nightly bookings
- a service marketplace with time-based bookings
- a product marketplace with stock management

With a Sharetribe Web Template, you can get started with your
marketplace UI straight away: just download the latest version and start
customizing it for your marketplace. There are no limits to how much you
can customize the template. You can freely design the user interactions
and alter the look and feel of your marketplace. You can also integrate
any web analytics or customer service solutions directly into your UI.

Your users won't see Sharetribe mentioned anywhere. The web address is
your own domain, the email notifications get sent from your email
address, and the entire user experience is fully tailored to match your
brand.

If you prefer to start from scratch, you can build your own UI on top of
Flex's Marketplace API yourself. For instance, if you want to build a
mobile application for your marketplace, you will need to build a fully
custom user interface. You can also have several UI applications for the
same marketplace, so the user can manage their listings and transactions
on a native mobile app as well as on the web.

### The Marketplace API

The Marketplace API is how your UI connects to the Flex services. It's
an HTTP interface with a design influenced by the
[JSON API specification](https://jsonapi.org/) and the
[CQRS pattern](https://martinfowler.com/bliki/CQRS.html). The
Marketplace API allows you to implement all the standard marketplace
functionality that Flex supports.

Sharetribe handles running and scaling the Marketplace API. To take full
advantage of this, you should design your Marketplace UI to point a
majority of the traffic directly to the Marketplace API. For example,
Sharetribe Web Template only handles the initial page load when a user
opens their browser. After that, the template lets the client
application (Single-page application) talk directly with the Marketplace
API, and the API powers all further interactions.

To learn more about the capabilities of the Marketplace API and Flex,
visit the [API reference documentation](/concepts/api/).

### Flex JavaScript SDK

[The Flex JavaScript SDK](/concepts/js-sdk/) is a small JavaScript
library that helps you with integrating the Marketplace API. It handles
tasks like authentication and session management and makes it easy to
use correct data types with the API. Using the Flex JS SDK is not
required, but if you are working with JavaScript, we strongly encourage
you to have a look.

### Console

[Console](https://flex-console.sharetribe.com/) is where you to manage
all your marketplace data, such as users, listings and transactions.
Console also offers tools to develop your marketplace, for example, an
editor for email templates. Console is accessed via a web UI that we
provide out of the box. Think of it as an admin interface you never have
to build!

### The Integration API

The Integration API is how you can integrate third party solutions to
your Flex marketplace. It provides full access to your marketplace data
and operations, so you can integrate a vast range of services to your
marketplace behind the scenes. To read more about the capabilities of
the Integration API, visit the
[API reference documentation](/concepts/api/). You can also read more
about [integrations in Flex](/concepts/integrations-introduction/).

### Flex CLI

Flex CLI (Command-line interface) is a tool for changing your
marketplace's advanced configurations such as transaction processes and
email templates.

See the
[Getting started with Flex CLI](/introduction/getting-started-with-flex-cli/)
tutorial for more information.

## Is Flex the right fit for you?

Now you know roughly what Flex is all about. Next, it's time to evaluate
[whether Flex is the right fit for your specific marketplace idea](/introduction/is-flex-right-for-you/).

repository: sharetribe/flex-docs

gha_language: JavaScript

repo_name: sharetribe/flex-docs


text:
### Summary of Changes

_Please offer a description of the code changes in your pull request._

### Addresses

_Tag any [issues](https://github.com/justin/Aspen/issues) that are being addressed._

repository: justin/Aspen

gha_language: Swift

repo_name: justin/Aspen


text:
If you don't specify a language for your Web pages, it can confuse Screen Readers and other Assistive Technology.

This is [a demo site](https://russelljqa.github.io/your-site-speaks-what-language/) to demonstrate the problem.

For more information, read my
"Your Site Speaks What Language? Don't Keep Screen Readers Guessing!" blog post.


text:
# CSS documentation generator

A small Ruby executable (shell) script to generate HTML documentation for CSS files.

More exactly:

  1. It takes a .css file
  2. Takes all comments in Markdown format and generates a HTML

## Why?

* There are no proper CSS documenting tools.
* It is more straightforward to document your frontend code in CSS than in HTML

## Based on

  1. rdiscount

## Usage

Comment your CSS as usual but use [Markdown](http://daringfireball.net/projects/markdown/syntax ) instead of plain text.

Example:

    /*
    documentation line 1
    documentation line 2
    */

Inline comments are ignored to make the final output more readable.

    /* This comment in your CSS will be ignored ! */

Then run `cssd` on your CSS file. It will generate a HTML file named as your CSS.

## Examples

Check the `base.css` and `base.html` files. The first was the input, the second the output.

## Licence

MIT

repository: metamn/cssd

repo_name: metamn/cssd


text:
# _Pizza Ordering App_

#### _A web application that allows a user to order a pizza from a list of preferences, and receive a price relative to those choices, {4/6/18}_

#### By _**Andrew Lupton**_

## Description
A program for a pizza ordering web application. The user enters their name, address, and pizza preferences, and in return is quoted a price.

## Specs
- One user is required to operate the app.
- User enters their name, address, and pizza preferences (size, meat topping, vegetable topping, and extra topping), and then presses the button marked "submit".
- The price of each specified pizza is calculated by an algorithm using simple if/else statements.
- For example, a user specifying a medium pizza with pepperoni, olives, and any of the extra toppings would be quoted $17.99, whereas a user specifying a large pizza with prosciutto, artichokes, and any of the extra toppings would be quoted $23.99.
- The user may press the button marked "refresh" at any time to clear the inputs.
- After submitting, the user is shown a summary of their order, the price of the pizza, and their address for confirmation.

## Setup/Installation Requirements

* Clone from Github repository.
* Open in Chrome browser.

## Known Bugs

_Currently bug-free._

## Technologies Used

_HTML, CSS, Javascript, Jquery, and Bootstrap_

### License

*MIT License*

Copyright (c) 2018 **_Andrew Lupton_**

repository: aflupton/order-pizza-JS

repo_name: aflupton/order-pizza-JS


text:
# vue-node-bulletin-board-app

**Docker Test Image**

To run the docker container in your localmachine install docker and run
```
docker pull sanjaypaulcharles/bulletinboard:1.0
```
All the dependencies and environments are packaged inside the image.

repository: charliebaer/node-bulletin-board-app

repo_name: charliebaer/node-bulletin-board-app


text:
---
title: "Climax RS-23ZBS Homebridge/HomeKit integration"
description: "Add HomeKit support to your Climax RS-23ZBS, using Homebridge, Zigbee2MQTT and homebridge-z2m."
---
<!---
This file has been GENERATED using src/docgen/docgen.ts
DO NOT EDIT THIS FILE MANUALLY!
-->
# Climax RS-23ZBS
> Temperature & humidity sensor

# Services and characteristics
The following HomeKit Services and Characteristics are exposed by
the Climax RS-23ZBS

* [HumiditySensor](../../sensors.md)
  * CurrentRelativeHumidity
* [TemperatureSensor](../../sensors.md)
  * CurrentTemperature

# Related
* [Other devices from Climax](../index.md#climax)
* [Zigbee2MQTT documentation for this device](https://www.zigbee2mqtt.io/devices/RS-23ZBS.html)


text:
---
title: "Superbikes: Whanganui's Richie Dibben declared 600cc national champion
  after season called"
feature_image:
  description: "Whanganui's Richie Dibben (Suzuki GSX-R600), the national 600cc
    road-race champion in his first full season. "
  credit: Andy McGechan, BikesportNZ.com
  image: https://res.cloudinary.com/whanganuihigh/image/upload/v1586737406/News/Dibben._chron_11.4.20.jpg
news_author:
  date: 2020-04-11T00:17:09.792Z
  publication: Whanganui Chronicle
  name: Andy McGechan
image_gallery:
  - image: https://res.cloudinary.com/whanganuihigh/image/upload/v1586737446/News/Dibben.2._chron_11.4.20.jpg
    description: Dibben had a big lead in the 600cc series after winning or
      finishing runnerup in each of the nine races across the three rounds
      contested in January and March.  Photo / Andy McGechan, BikesportNZ.com.
  - image: https://res.cloudinary.com/whanganuihigh/image/upload/v1586737470/News/Dibben.3._chron_11.4.20.jpg
    description: In his first season of this class, Dibben also had the fastest
      qualifying times to sit on the pole in two of the three rounds.  Photo /
      Andy McGechan, BikesportNZ.com.
show_in_slider: false
date: 2020-04-13T00:17:09.983Z
---
Imagine celebrating your 31st birthday, sitting on your couch at home, and being told "you've just been declared national champion"?

That's what happened to Whanganui's Richie Dibben on Wednesday.

It had been a case of "hurry up and wait" for the nation's elite motorcycle riders, but now the waiting is over for these athletes, their sponsors and fans.

Three of the five rounds of the 2020 New Zealand Superbike Championships had been run before the Covid-19 pandemic forced the final two rounds of the series to be postponed.

A nationwide lock-down was then imposed on the population and, while the competitors continued their training regimes as best they could behind closed doors, most of them anticipating a resumption of the series later in the year.

But a Motorcycling NZ announcement went out via email and social media this week to report that the series had "been called".

So now, even with just over half of the scheduled the races completed, the NZ Superbike Championships have been declared and winners named for each of the championship categories.

It was especially pleasing news for Suzuki ace Dibben, with the bike shop owner a comfortable leader anyway in his Supersport 600 class title chase, despite this year being his first full bid for the title.

"It came as a bit of a surprise, but was still a fantastic way for me to celebrate my 31st birthday," said Dibben.

"I thought the organisers would try to get the rest of the races run. This is not how I wanted it to end, but that's it wrapped up."

It's certainly no hollow victory for Dibben – the latest news really coming as mere confirmation that he was indeed the best rider in his class for 2020.

In all, the Suzuki star won five of the nine races – three races at each of the three rounds that were run – and he finished runner-up in each of the other four races.

In addition to that, he qualified his Suzuki GSX-R600 fastest, therefore earning pole position, at two of those three events.

Dibben was a whopping 60 points clear of his nearest challenger - Upper Hutt's Rogan Chandler - after Round 3, and this meant Whanganui's road-race "rookie" already had more than two races maximum points up his sleeve with just six more to come.

"I probably would have had to crash out of at least two of those remaining races for me not to take the title," said Dibben.

"Regardless of how the season was going to pan out, I had already decided that I will be in the [1000cc] superbike class for next season's nationals.

"It should be a good challenge. I have never even ridden a superbike before," Dibben laughed.

So is it optimistic and ambitious to jump up to a 1000cc Suzuki?

"Yes, but it's the same as for me racing the GSX-R600 this year.

"I never really knew whether I would feel comfortable with it to start with.

"It will just be a time thing to get used to another bike and try to go fast," said the amiable father-of-two.

Meanwhile, the champion in the Superbike class is Canterbury's Alastair Hoogenboezem – the Christchurch rider a meager three points ahead of Taupo's Scott Moir after three rounds – while Whakatane's Damon Rees was third overall.

Rees won the first two rounds of the series before heading overseas to race at the end of January, while Moir won the superbike class for Round 3, at Hampton Downs on March 7-8.

All of the nine race wins were shared exclusively between this talented trio – Rees won five of the six races he contested before he left the country, while Hoogenboezem and Moir won two races apiece.

However, this class result is deemed provisional, with technical checks still to be conducted on a number of motorcycles.

Other class champions declared this week were Auckland's Nathanael Diprose (Supersport 300, provisional only); Whangaparoa's Nathan Jane (650 Pro Twins); Taupo's Andy Scrivener and Tina McKeown (Sidecars); Invercargill's Cormac Buchanan (Supersport 150) and Nelson's Tyrone Kuipers (Gixxer Cup 150).

gha_language: Blade


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v1.0.0] - 2021-07-31

### Added
- This CHANGELOG file to hopefully serve as an evolving example of a
  standardized open source project CHANGELOG.
- Golang CLI using [cobra](https://github.com/spf13/cobra)
- goreleaser config to help release versions of the cli
- github action to release new tags through goreleaser
- README explaining how to install and use the cli

[Unreleased]: https://github.com/lucassabreu/gh-collab-manager/compare/v1.0.0...HEAD
[v1.0.0]: https://github.com/lucassabreu/gh-collab-manager/releases/tag/v1.0.0

repository: lucassabreu/gh-collab-manager

repo_name: lucassabreu/gh-collab-manager


text:
# kdb-namespace(1) -- Get the namespace of a key name

## SYNOPSIS

`kdb namespace <key name>`

Where `key name` is the name of the key.

## DESCRIPTION

This command is used to retrieve the namespace of a key, including the eventual trailing ':'.
For the cascading namespace, the empty string is returned.

## RETURN VALUES

This command will return the following values as an exit status:

- 0:
  No errors.
- 7:
  invalid key name passed, see [kdb(1)](kdb.md) for a list of return codes used by kdb.

## OPTIONS

- `-n`, `--no-newline`:
  Suppress the newline at the end of the output.

## EXAMPLES

```sh
kdb namespace user:/key/subkey
#> user:

kdb namespace /key/subkey
#>
```

## SEE ALSO

- See [kdb-basename(1)](kdb-basename.md) and [kdb-dirname(1)](kdb-dirname.md) for other namepart extraction operations.
- To get keys in shell scripts, you can use [kdb-sget(1)](kdb-sget.md).
- [elektra-key-names(7)](elektra-key-names.md) for an explanation of key names.

repository: ElektraInitiative/libelektra

gha_language: C

repo_name: ElektraInitiative/libelektra


text:
# The Austroporean Cards

### Info
This is a game made by BeeverFeever and Naruto Uzumaki. It is an RPG card style game that runs in the console and is all text based. It has been designed to be replayed as all the stats are randomly generated each time.

---

### How to play
- You will be shown 4 cards. All cards are randomly generated.
- You have to choose one of them.
- Computer will choose a random card then.
- Then you will be in the ShowTime stage.
- In showtime, you are allowed to play some defined moves (Attack, Dodge, Defence, and Block).
- The first player, whose card's health will be 0, will lose.

---

### How stats are generated
- health stat is random
- crit stat is determined by attack stat
- defence stat is determined by health stat
- speed stat is determined by attack stat
- attack stat is determined by defence stat

---

### All predefined moves
1. Attack - attacks other player and deals damage
2. Dodge - has chance to dodge away from attack(chance can be stacked)
3. Block - Incomming attack does low damage
4. Special attack - can be used when crit stats hits 100. this will be a special magical move (powered by dark)

---

### ROADMAP
- [x] Randomly generate cards
- [x] Show animation when computer is choosing card
- [ ] Define all the moves
- [ ] Refine stat generation


text:
Cactus started out as a library that was supposed to fix cross browser
issues. It expanded into a collection of utilies useful... pretty much
always.

It has now been refactored to use with the Joose (http://www.joose.it)
meta object system and it runs on both node and in the browser.

Quick run-through of current functionality:

 * The Addon module contains addons to the built in data types.

 * Data contains data structures (Map, Set, Tree) and more high-level
   structures (ArrayController, KeyValueCoding).

 * Util contains stuff that doesn't belong anywhere else.

 * Web contains helpers for cross browser functionality, selectors, and
   wrappers that simplifies working with the DOM a lot.

Code Conventions (work in progress)

 * _ may be used for argument names in callbacks that are not used.

 * Camelcase abbreviations, `Id` and `Url`.

 * Set default values for parameters at the top of a functions body,
   or use TypeChecker to set them (also use at top.)

 * Events should be named in the correct grammatical form, most often
   in preterite to avoid confusion. `onAdd` is ambiguous,
   `onBeforeAdd` or `onAdded` (prefer over `onAfterAdd` for
   conciseness) is not.

 * Comments should not stretch over 80 columns wide.

 * Don't marginal adjust comments.

 * Lines should not be wider than ~120 characters.

 * Functions that may return null, or variables that may contain null
   as well as the intended type should be suffixed with maybe.
   `var userMaybe = getUserMaybe();`.

 * Boolean names should have a predicate prefix. `hasUser` and
   `isAdmin`.

 * Use hungarian notation instead of constraining a value's type
   implicitly. Use `plainPassword` and `hashedPassword` over
   `password`.

Don't use these constructs:

 * `with`. Confusing. Instead do `var o = longName; o.x = 1;`.

 * `new Boolean`/`new String`/`new Number`, messes up `typeof` and comparisons.

 * `typeof x === "object"`, since `typeof null => "object"`, use `instanceof` instead.

 * `[new] Array()`. `new Array(1)` vs `new Array(1,2)` is
   confusing. `[1]`, `[1,2]` is not. And `[]` is more concise.

 * `[new] Object()`. `{}` is more concise.

Types in documentation

 * primitive types (number, boolean, string) => as is
 * an instance of class C => C
 * an implementer of a role R => R
 * collection => numbered by indices 0..length-1, has length property
 * hash => Object with properties that may contain different values
 * map => Object where each property has the same type
 * entity => any value that can be compared with ===
 * Object => any non-primitive value
 * null/undefined is never allowed for any type unless explicitly stated in documentation.
 * Number/Boolean/String => don't use.

* Exceptions
 * Declare exceptions with @throws in documentation.
 * Errors should not have a @throws declaration.
 * Prefer to not use exceptions.

Iteration:
 * Core should use for loops for iteration as much as possible.
 * Other modules may decide.

repository: bergmark/Cactus

repo_name: bergmark/Cactus


text:
# HandHoldingHand

```text
fontawesome-6/Solid/HandHoldingHand
```

```text
include('fontawesome-6/Solid/HandHoldingHand')
```

| Illustration | HandHoldingHand |
| :---: | :---: |
| ![illustration for Illustration](../../fontawesome-6/Solid/HandHoldingHand.png) | ![illustration for HandHoldingHand](../../fontawesome-6/Solid/HandHoldingHand.Local.png) |

## Sprites
The item provides the following sriptes:

- `<$HandHoldingHandXs>`
- `<$HandHoldingHandSm>`
- `<$HandHoldingHandMd>`
- `<$HandHoldingHandLg>`

## HandHoldingHand

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element HandHoldingHand
include('fontawesome-6/Solid/HandHoldingHand')

' renders the element
HandHoldingHand('HandHoldingHand', 'Hand Holding Hand', 'an optional tech label', 'an optional description')
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element HandHoldingHand
include('fontawesome-6/Solid/HandHoldingHand')

' renders the element
HandHoldingHand('HandHoldingHand', 'Hand Holding Hand', 'an optional tech label', 'an optional description')
@enduml
```

repository: tmorin/plantuml-libs

gha_language: TypeScript

repo_name: tmorin/plantuml-libs


text:
# Image Calssifier using Deep Learning
Final project of Udacity's AI Programming with Python Nanodegree program was designed to predict flower among 102 flower categories. Learning from pre-tranined models from torchvision was transfered to achieve the goal. Models were trained using [this dataset](http://www.robots.ox.ac.uk/~vgg/data/flowers/102/index.html). Dataset was loaded using torchvision and split into three train, valid, and test for training, validating, and testing the models respectfully.

# Getting started
This project was developed on Python 3.7.2. Required additional packages are NumPy, Pandas, MatplotLib, PIL, and Pytorch.

These dependencies should be install before the application can be executed. Using [conda](https://anaconda.org/anaconda/python), this packages can be intalled as below:

`conda install numpy pandas matplotlib pil`

# Training a model

## Commands to train:

Basic command: `python train.py data_directory`
Program expects data_directory to be existing with train, valid, and test subdirectories.

Optional arguments for training command:

| Argument | Exmaple |
| :------ | :----- |
| --save_dir | `python train.py data_dor --save_dir save_directory` |
|--arch|`pytnon train.py data_dir --arch vgg16`|
|--learning_rate|`python train.py data_dir --learning_rate 0.001`|
|--hidden_layer|`python train.py data_dir --learning_rate 0.001 --hidden_layer 512`|
|--epochs|`pytnon train.py data_dir --epochs 20`|
|--gpu|`python train.py data_dir --gpu`|

## Adding new model to this project

The project currently supports alexnet, vgg11, vgg13, vgg16, vgg19, resnet18, resnet34, resnet50, resnet101, resnet152, densenet121, densenet161, densenet169, and densenet201 from torchvision. To train new model, following changes need to be applied to model_factory.py.

Add a new identifier which will be used as a flag to train:
`supported_arch = ['alexnet', 'vgg11', 'vgg13', 'vgg16', 'vgg19', 'resnet18',
                  'resnet34', 'resnet50', 'resnet101', 'resnet152',
                  'densenet121', 'densenet161', 'densenet169', 'densenet201']`

Extend Flower_Classifier class to define the new model specific configuration, below is an example for Alexnet implementation:

```
class Alexnet_Classifier(Flower_Classifier):
    def __init__(self, *args, **kwargs):
        super(Alexnet_Classifier, self).__init__(*args, **kwargs)

    def _set_model(self):
        self._model = models.alexnet(pretrained=True)

    def define_classifier(self):
        self._model.classifier = nn.Sequential(OrderedDict([
                          ('fc1', nn.Linear(self._input_size, self._hidden_units)),
                          ('relu1', nn.ReLU()),
                          ('dp1', nn.Dropout(0.5)),
                          ('fc2', nn.Linear(self._hidden_units, self._hidden_units)),
                          ('relu2', nn.ReLU()),
                          ('fc3', nn.Linear(self._hidden_units, 102)),
                          ('output', nn.LogSoftmax(dim=1))
                          ]))
    def _set_input_size(self):
        self._input_size = 9216
```

instantiate the previously defined class in instantiate_new_model function, an example is given for alexnet implementation:
```
if in_args.arch=='alexnet':
      return set_optional_attr(in_args, Alexnet_Classifier(in_args.data_dir, Flower_Classifier.EXEC_MODES[0]))
```

# Inference a flower

## Commands to predict:

Basic command: `python predict.py /path/to/image checkpoints`

| Argument | Exmaple |
| :------ | :----- |
| --top_k | `python predict.py input checkpoint --top_k 3` |
| --category_names | `python predict.py input checkpoint --category_names cat_to_name.json` |
| --gpu | `python predict.py input checkpoint --gpu` |

repository: dipans/image-classifier

repo_name: dipans/image-classifier


text:
# Password locker App

#### A python 3 password manager. , 2019

#### By **Ian Kurao**

## Description

The application runs on the command line.

## Setup/Installation Requirements

-   Search for repository name
-   Click on clone/download to get import link
-   ensure you have python 3 or higher installed on your local machine
-   The app depends on git for versioning and git hub for publishing.
-   Use of source code for malicious intent may be followed up with legal action and is independent of the source code.
- To run the application, pass the command  'chmod +x run.py' on terminal
- Follow this command with ./run.py to use application

#### Behaviour Driven Development
| Behaviour   | Input   | Output|
| :------------- | :------------- |:---------|
| login credentials| User name & password     | Welcome 'User-name'|
| Select option| Select one of the short codes| Enable feature for that particular code|
| Take user data| User data| User information|
| Generate password| Select password generate option| New password|
| Delete credentials| Choose delete credentials| Credentials are deleted|
|Exit app| Select exit choice| App closes|

## Known Bugs

None at the moment

## Technologies Used

-   Python 3.6

## Support and contact details

In case of any questions, contact me by:

-   EMAIL<EMAIL_ADDRESS>-   SLACK: Ian Kurao

#### Licencing
MIT License

Copyright (c) [2019] [Ian Kurao]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
# Synaptospora Cain GENUS

#### Status
ACCEPTED

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

#### Published in
Beih. Sydowia 1: 4 (1957)

#### Original name
Synaptospora Cain

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# LoveCurrency
Realtime currency convertor desktop application

## Status
Development.

## Installation
Make sure you installed node.js and electron.

Once you download the source code from here, use `npm install` to install all the dependency packages.

then, use `npm start` to start the application.

## How to build
I have updated the build settings for Mac in package.json with build.

you have to use `npm run build` to build the application in Mac. (Tested in MacOS Sierra. Version : 10.12.1)

Latest stable build app is stored in [LoveCurrency.app](https://github.com/learnsomuch/LoveCurrency/tree/master/LoveCurrency-darwin-x64)

## Sample Screenshot for Mac

![Alt text](/media/screenshot.png?raw=true "Desktop LoveCurrency Mac application")

## Contribution
If you like this project, I would be greatful if you can contribute.
You can email me to<EMAIL_ADDRESS>for more information.

### Todos
* Support all currencies
* Use angular or anyother to have realtime change in input field
* Add option to have favourite currencies
* should have ability to download currency status in PDF
* optimise code

### License
Look for License file in source code.

MIT © 2016

repository: learnsomuch/LoveCurrency

repo_name: learnsomuch/LoveCurrency


text:
# Ask EECS

A stackoverflow like site for the WSU EECS Community.

![Ask EECS](http://i.imgur.com/MvlS2yt.png)
*I'm sorry for the spelling errors in the screenshot, I edited it in the developer console*

## How To Use

 1. Install [Go](http://golang.org)
 2. Make sure your `GOPATH` is configured properly.
 3. Install [Martini](http://martini.codegangsta.io):
  - `go get github.com/codegangsta/martini`
  - `go get github.com/martini-contrib/sessions`
 4. Install [MongoDB](http://www.mongodb.org).
 5. Install the [Mongo bindings for Go](http://labix.org/mgo):
  - `go get labix.org/v2/mgo`
  - `go get labix.org/v2/mgo/bson`
 6. Run `make`!
 7. Spin up MongoDB:
  - `mkdir data && mongodb --dbpath data`
 8. Finally, run `./askeecs`.

By default, martini serves to localhost at port 3000.

## Contributors:
- Jeromy Johnson
- Travis Person

repository: changjchoi/askeecs

repo_name: changjchoi/askeecs


text:
# How To Use NDB

The `ndb` library provides a general means of using SQL relational databases in Nim. Specifically, it supports:

* [SQLite](https://sqlite.org/index.html)
* [PostgreSQL](https://www.postgresql.org/)
* [MySQL](https://www.oracle.com/mysql/) / [MariaDB](https://mariadb.org/)

This document will take through a tour of using `ndb` and it's features. This document assumes you already understand the SQL language. If you are not familiar with SQL, I recommend visiting [this free CodeAcademy course](https://www.codecademy.com/learn/learn-sql) or searching for the many other resources online for learning SQL first.

## CONNECTING

When writing your nim program, you will want to first import the specific sub-library for your database.

For SQLite:

```nim
import ndb / sqlite
```

For PostgreSQL:

```nim
import ndb / postgresql
```

For MySQL or MariaDB:

```nim
import ndb / mariadb
```

The remaining examples in this document assume you are working SQLite, but the other database types should behave mostly the same.

Connect to the database using the `open` function and assign the result to a variable to hold the connection. And, later close it using the 'close' function.

```nim
import ndb / sqlite

let db = open("example.db", "", "", "")

# Add the database commands here.

db.close()
```

**EXTRA:** [Behind the Scenes](How-To-Use-NDB-behind-the-scenes.md)

**EXTRA:** [Connecting to Multiple Databases](How-To-Use-NDB-connecting-to-multiple-databases.md)

## MAKING TABLES

There are no specific functions for making new tables in `ndb`, instead you will simply rely on sending direct SQL statements to do it. That is done using the `exec` function.

This function, `exec` is fairly powerful and can also do parameter substitution. We will see more of that the CREATING RECORDS section below.

An example of making a new table:

```nim
import ndb / sqlite
let db = open("example.db", "", "", "")

let creation_query = """
    CREATE TABLE myGarden (
        id INTEGER PRIMARY KEY,
        name STRING NOT NULL,
        qty INTEGER,
        price FLOAT,
    )
"""
db.exec(creation_query)

db.close()
```

## CREATING RECORDS

You can, of course, simply create new records in a table by issueing a `exec` query to do so:

```nim
db.exec("""
    INSERT INTO MyGarden (id, name, qty, price) VALUES (1, "carrot", 20, 0.33)
""")
db.exec("""
    INSERT INTO MyGarden (id, name, qty, price) VALUES (2, "squash", 32, 0.5)
""")
```

Or you can use `exec`'s parameter substitution:

```nim
db.exec("""
    INSERT INTO MyGarden (id, name, qty, price) VALUES (?, ?, ?, ?)
""", 3, "cucumber", 22, 1632.2)
```

But `ndb` also supports a special function called `tryInsertID` which not only inserts the row but also create a new unique number for a matching `id` column and returns the value of that new id (`int64`).

```nim
var new_id = db.insertID("""
    INSERT INTO MyGarden (name, qty, price) VALUES (?, ?, ?)
""", "green bean", 100, 0.92)
```

If an error is found during the insertion, the returned number is -1. If you are wanting to do your own error catching, then use the alternate `insertID` function. See [CATCHING ERRORS] .

**EXTRA:** [Understanding Types](How-To-Use-NDB-understanding-types.md)

## READING RECORDS

The primary means of getting records from the database is the `rows` function. Simply pass a SQL statement to the function, the query is made and an *iterator* to a sequence of records is returned. Essentially, the iterator is for a `seq[Row]`, where a `Row` is a `seq[DbValue]`. And a `DbValue` is an object that can hold multiple types of values, including strings, integers, nulls, etc.

So, to illustrate this with an example:

```nim
import ndb / sqlite
let db = open("example.db", "", "", "")

var cheap_vegs = db.rows("SELECT name, qty FROM MyGarden WHERE price < 1.00 ORDER BY name")
```

We are going to assume that there are three matching records. So, the variable `cheap_vegs` is now pointing to the first record as an iterator. For example, it might be:

|ptr  |name       |qty
|-----|-----------|---
|*    |carrot     | 20
|     |green bean |100
|     |squash     | 32

Now the variable `cheap_vegs` can be called to get a record.

```nim
var first_veg = cheap_vegs()
echo $first_veg[0] & ": " & $first_veg[1]  # prints "carrot: 20"
```

Notice that the record `first_veg` is a sequence, so the columns are referenced by number.
And, now the `cheap_vegs` iterator has moved to the next row.

|ptr  |name       |qty
|-----|-----------|---
|     |carrot     | 20
|*    |green bean |100
|     |squash     | 32

Since `first_veg` contains the record, we can also access the column's data based on what type of column it is. In this case, the first column is a string, so use `.s`. The second column is an integer, so use `.i`.

```nim
if first_veg[1].isNotNull:
  echo first_veg[0].s & ": " & $(first_veg[1].i * 100) # prints "carrot: 2000"
```

And since 'cheap_vegs' it is an iterator, we can also use it in a `for` loop:

```nim
for v in cheap_vegs:
  echo $v[0] & ": " & $v[1]
```

which prints the remaining items

```
green bean: 100
squash: 32
```

#### READING RECORDS: HANDLING NO RESULTS

If the query has no rows to return (no matches found), then the iterator points to no results. Simply check the iterator for the `finished` condition:

```nim
import ndb / sqlite
let db = open("example.db", "", "", "")

var super_expensive = db.rows(sql"SELECT name, qty FROM MyGarden WHERE price > 1000.00")

if finished(super_expensive):
    echo "nothing super-expensive found"
else:
    echo "1 or more super-expensive found"
```

#### READING RECORDS: GETTING FEWER (OR ONE)

You can set a limit on the results by either passing that limit in the SQL. Or you can add an optional parameter to your `rows` call.

```nim
import ndb / sqlite
let db = open("example.db", "", "", "")

var some = db.rows("SELECT name, qty FROM MyGarden LIMIT 2")
# or you can do:
some = db.rows("SELECT name, qty FROM MyGarden", 2)
```

If you are only wanting _one_ result, you can also use the `getRow` function to get the *first* row found. The function returns an `Option[Row]`

```nim
import ndb / sqlite

let db = open("example.db", "", "", "")

var cucumber = db.rows("SELECT qty FROM MyGarden WHERE name='cucumber")

if cucumber.isNone:
  echo "No cucumber found."
else:
  echo "cucumber: " & $cucumber.get()  # prints "cucumber: 22"

db.close()
```

**EXTRA:** [Understanding Types](How-To-Use-NDB-understanding-types.md)

## UPDATING RECORDS

Updates are best done using the `execAffectedRows` function. You pass the SQL UPDATE query in a manner similar to the exec function, but this function returns the number of rows that it affected.

```nim
var count = db.execAffectedRows("""
    UPDATE MyGarden SET price = 0.90 WHERE name=?
""", "green bean")

echo $count  # prints "1"
```

If no rows are updates, you will get a zero (0) returned.

## DELETING RECORDS

Deletions are best done using the `execAffectedRows` function. You pass the SQL DELETE query in a manner similar to the exec function, but this function returns the number of rows that it affected.

```nim
var count = db.execAffectedRows("""
    DELETE FROM MyGarden WHERE name=?
""", "carrot")

echo $count  # prints "1"
```

If no rows are deleted, you would get a zero (0) returned.

## CATCHING ERRORS

TODO

## [NOTES ABOUT THIS DOC]

This notes section will go away on first release. Some stuff jotted down.

This doc is written with the presumption that the notes marked here are implemented rather than how things work right now.

* Adding a `isNull` function. (and possibly `isNotNull`)
* We deprecate the `sql` string distinction as it seems to do nothing more than add complexity. However, for legacy purposes, the sql type is not removed.
* db_common is made part of the library in preparation of movement of `ndb` to the standard library. As such:
  - embrace the "kinds" from db_common (do the migration)
  - All of the variants will uniquely interpret all of the types. If a type is specifically not supported, a compile-time error (rather than run-time) is generated. However, I don't think this will ever be needed. If nothing else, a type can be a string conversion.
  - nim can't do decimals. As such, make sure that `DECIMAL` columns can be exported as strings to avoid the faulty `float` conversion.
* Add ref links to each introduction to a new function or type.


text:
---
layout: post
title: experience from fundamental matrix
tags: ComputerVision
date: 2016-11-23 09:32:00
postPatterns: 'circuitBoard'
---

An example of the fundamental matrix and the epipolar line, please refer to
[fundamental matrix coding](https://github.com/beandrewang/computer_vision/tree/master/georgiatech_cs4495/ps3_octave)

# Fundamental matrix

It is an approach of finding the epipolar line in stereo. Epipolar line is a
line that you can find the corresponding points or features along this line
between image A and image B.

Suppose I know a point in image A, how to find the matched points in image
B? Find the epipolar line.

Suppose I already know some corresponding points (at least 8) between two
images, A and B. I would solve the fundamental matrix by the following equation.

$$
P'^{T}FP = 0
$$

$$
\begin{bmatrix}
u' & v' & 1 \\
\end{bmatrix} \
\begin{bmatrix}
f11 & f12 & f13 \\
f21 & f22 & f23 \\
f31 & f32 & f33 \\
\end{bmatrix} \
\begin{bmatrix}
u \\
v \\
1
\end{bmatrix} = 0
$$

if we change the patten it would be like this.

$$
\begin{bmatrix}
u'u & u'v & u' & v'u & v'v & v' & u & v & 1 \\
\end{bmatrix} \
\begin{bmatrix}
f11 \\
f12 \\
f13 \\
f21 \\
f22 \\
f23 \\
f31 \\
f32 \\
f33 \\
\end{bmatrix} = 0
$$

how to resolve the F matrix? Two ways.

1.  svd, use at least 9 corresponding points and then do svd with the matrix
generated by the 9 corresponding points. The F would be the last colume vector
of V.

2. least square, set the f33 as 1. And we would get a different equation as
below:

$$
\begin{bmatrix}
u'u & u'v & u' & v'u & v'v & v' & u & v \\
\end{bmatrix} \
\begin{bmatrix}
f11 \\
f12 \\
f13 \\
f21 \\
f22 \\
f23 \\
f31 \\
f32 \\
\end{bmatrix} = -1
$$

solve it by least square, in this way, we has to have 8 corresponding points or
more.

in matlab, it is very easy,

```matlab
F = P \ -ones(8, 1);
```

once we get the F by svd or least square, the rank of F is 3, but the corrent F
should be have rank of 2.

How to reduce the rank of F? svd.

## rank 2

Set the 3rd singular value 0 and then get the new F, in matlab,

```matlab
[U D V] = svd(F);
D(3, 3) = 0;
F = U * D * V';
```

Then reshape the F to a 3x3 matrix; in matlab

```matlab
F = reshape(F, 3, 3)';
```

# epipolar line

$El = FP$ is the epipolar line. This is a vector in homogeneous coordinate? We
cannot draw this line by the regular way of two points to a line.

## how to draw the epipolar line

In a image, we can get the intersection points of the epipolar line with the
left and right boundary lines of the image.

Suppose I the image size is w x h,

### left and right boundary lines

up-left point A is $(1, 1)$

bottom-left point B is $(1, h)$

up-right point is C $(w, 1)$

bottom-right point D is $(w, h)$

then,

left boundary line Ll is $A \times B$

right boundary line Rl is $C \times D$

### the intersection points between epipolar line and the boundary lines

intersection point with left boundary line Pl is $El \times Ll$

intersection point with right boundary line Pr is $El \times Rl$

We obtain two points now then draw it.

### draw the epipolar line

Though we get the two point, they are still in homogeneous coordinate, we have
to convert to inhomogeneous coordinate first.

convert the points from homogeneous coordinate to inhomogeneous coordinate, in
matlab,

```matlab
Pl = [Pl(1) / Pl(3), Pl(2) / Pl(3)];
Pr = [Pr(1) / Pr(3), Pr(2) / Pr(3)];
```

then plot the line, it is easy in matlab.

```matlab
x = 1 : w;
y = Pr(2) + (x - Pr(1)) * (Pl(2) - Pr(2)) / (Pl(1) - Pr(1));
plot(x, y, 'color', 'green');
```

# Additional

Normally, once we get the corresponding points in two images, normalized them
first, make the mean be 0, and the maximum is 1 and minimum is -1 or not too far
from the 1 and -1.

```matlab
function [normpt T] = norm_pt(pt)
    cu = mean(pt(:, 1));
    cv = mean(pt(:, 2));

    s = 1 / std(pt(:));

    T = [s 0 0; 0 s 0; 0 0 1] * [1 0 -cu; 0 1 -cv; 0 0 1];
    normpt = T * [pt ones(size(pt, 1), 1)]';
    normpt = normpt(1 : 2, :)';
end
```

Then use the normalized points to compute the Fnorm and then convert the Fnorm
to F.

```matlab
F = Tb' * Fnorm * Ta;
```

Then use this F to draw the epipolar line.

gha_language: CSS