text:
# Example configurations of mercury

Below is a list of example configurations suiting your purpose
Note that these examples provide configuration for 1 out of 2+ nodes. It is recommended to have at least 2 Mercury hosts that can form a cluster.

## Adding Mercury as Global Loadbalancer to existing Loadbalance solutions
If you are using multiple cloud environment you'll notice that they have their 'internal' Global loadbalance mechanisms across their datacenter locations. But very few have the option to add nodes outside of their network. Which results in the need of a extra layer, using DNS to loadbalance across multiple providers or datacenter

Diagram:
![](images/mercury_gslb_with_existing_lb.png)

Configuration:
```
[settings]
  manage_network_interfaces = "yes" # change this to "no" to not add the listener IP address to the host running Mercury
  enable_proxy = "no"               # this disables all proxy capabilities of Mercury. Useful when only serving as DNS loadbalancer

[cluster]                           # All cluster related documentation
  name = "MY_GLB_POOL"              # Cluster name for all nodes

  [cluster.binding]
  name = "localhost1"               # Our local node name
  addr = "<IP_ADDRESS>:9000"           # Our local binding ip/port
  authkey = "test"                  # key other clusters need to use to talk to us

  [[cluster.nodes]]
  name = "localhost2"               # Secondary cluster nodes name
  addr = "<IP_ADDRESS>:10000"          # Secondary cluster node ip/port binding
  authkey = "test"                  # Key we need to use to talk to the remote node

[dns]
  binding = "loadbalancer1.example.com"                               # local binding address for dns service
  port = 15353                                                        # local binding port for dns service
  [dns.domains."example.com"]                                         # config for domain 'domain.nl'
    ttl = 11                                                          # set default ttl to 11 seconds

[loadbalancer.settings]
  default_balance_method = "roundrobin"                               # default balance method for all backends

[loadbalancer.pools.INTERNAL_VIP.listener]                            # Define a pool 'INTERNAL_VIP' but with an empty listener
                                                                      # Since we will not be serving requests, but do dns only
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp]                    # in the pool 'INTERNAL_VIP' add a backend with the name 'myapp'
    hostnames = ["default"]                                           # the backend called 'myapp' listens to any hostname
                                                                      # if no exact match for hostheader request is found, default is where users are sent
    connectmode="http"                                                # we connect to the backends using http protocol
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.dnsentry]           # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                            # domain name this GLB entry belongs to
    hostnames = "www"                                                 # hostname to add when this backend is online
    ttl = 30                                                          # alternative TTL for this GLB host entry
    ip = "<IP_ADDRESS>"                                                    # ip for the above hostname if a node is up
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.healthcheck]        # define a healthcheck for the backend called 'myapp'
    type = "tcpconnect"                                               # use a tcpconnect to test if the backend is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]            # add a backend node to backend of 'myapp'
    hostname = "aws.cloud.vip"                                        # friendly name of the host
    ip = "<IP_ADDRESS>"                                                    # ip address of the backend host to serve requests to
    port = 80                                                         # port of the backend host to serve requests to

  # Note that we have only 1 backend node here, with multi-cloud setups,
  # it is recommended to add a mercury cluster node in each cloud,
  # and let mercury server requests for the cloud instance it is in.
  # As a result the config will be almost the same, but the node will point to a different host, as well as the GLB dns entry

  # Other Cluster node:
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.dnsentry]           # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                            # domain name this GLB entry belongs to
    hostnames = "www"                                                 # hostname to add when this backend is online
    ttl = 30                                                          # alternative TTL for this GLB host entry
    ip = "<IP_ADDRESS>"                                                    # ip for the above hostname if a node is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]            # add a backend node to backend of 'myapp'
    hostname = "azure.cloud.vip"                                      # friendly name of the host
    ip = "<IP_ADDRESS>"                                                    # ip address of the backend host to serve requests to
    port = 80                                                         # port of the backend host to serve requests to

```
Note that the IP of the webserver in this case does not have to be the Webserver its self, but can also be the existing loadbalancer at your existing datacenter, which in turn contains many more servers for local Loadbalancing.

## Adding Mercury as Global Loadbalancer with its internal Loadbalance solution (with SSL offloading)
If you are using multiple cloud environment you'll notice that they have their 'internal' Global loadbalance mechanisms across their datacenter locations. But very few have the option to add nodes outside of their network. Which results in the need of a extra layer, using DNS to loadbalance across multiple providers or datacenter. This option also replaces any existing loadbalancer, making Mercury your primary entry point for all traffic.

Diagram:
![](images/mercury_gslb.png)

Configuration:
```
[cluster]                  # All cluster related documentation
  name = "MY_GLB_POOL"     # Cluster name for all nodes

  [cluster.binding]
  name = "localhost1"      # Our local node name
  addr = "<IP_ADDRESS>:9000"  # Our local binding ip/port
  authkey = "test"         # key other clusters need to use to talk to us

  [[cluster.nodes]]
  name = "localhost2"      # Secondary cluster nodes name
  addr = "<IP_ADDRESS>:10000" # Secondary cluster node ip/port binding
  authkey = "test"         # Key we need to use to talk to the remote node

  [cluster.settings.tls]
    certificatekey = "build/test/ssl/self_signed_certificate.key"     # Certificate key for encrypted cluster communication
    certificatefile = "build/test/ssl/self_signed_certificate.crt"    # Certificate file for encrypted cluster communication
    insecureskipverify = true                                         # Ignore invalid hostnames (for use of self-signed certificates)

[web]
  [web.tls]
    certificatekey = "build/test/ssl/self_signed_certificate.key"     # Certificate key for GUI using ssl
    certificatefile = "build/test/ssl/self_signed_certificate.crt"    # Certificate file for GUI using ssl

[dns]
  binding = "loadbalancer1.example.com"                               # local binding address for dns service
  port = 15353                                                        # local binding port for dns service
  [dns.domains."example.com"]                                         # config for domain 'domain.nl'
    ttl = 11                                                          # set default ttl to 11 seconds

[loadbalancer.settings]
  default_balance_method = "roundrobin"                               # default balance method for all backends

  [loadbalancer.pools.INTERNAL_VIP.listener]                          # define a pool with the name 'INTERNAL_VIP' with an empty listener
    ip = "<IP_ADDRESS>"                                                  # ip address to listen for requests
    port = 8080                                                       # port number to listen for requests
    mode = "https"                                                    # protocol to accept
    [loadbalancer.pools.INTERNAL_VIP.listener.tls]                    # since the protocol is https, we need a ssl certificate for the listener
      certificatekey = "build/test/ssl/self_signed_certificate.key"   # certificate key for the vip (SNI is supported)
      certificatefile = "build/test/ssl/self_signed_certificate.crt"  # certificate file for the vip (SNI is supported)

  [loadbalancer.pools.INTERNAL_VIP.backends.myapp]                    # in the pool 'INTERNAL_VIP' add a backend with the name 'myapp'
    hostnames = ["default"]                                           # the backend called 'myapp' listens to any hostname
                                                                      # if no exact match for hostheader request is found, default is where users are sent
    connectmode="http"                                                # we connect to the backends using http protocol
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.dnsentry]           # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                            # domain name this GLB entry belongs to
    hostnames = "www"                                                 # hostname to add when this backend is online
    ttl = 30                                                          # alternative TTL for this GLB host entry
                                                                      # since no ip is defined, the record will point to the listener IP
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.healthcheck]        # define a healthcheck for the backend called 'myapp'
    type = "tcpconnect"                                               # use a tcpconnect to test if the backend is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]            # add a backend node to backend of 'myapp'
    hostname = "webserver1"                                           # friendly name of the host
    ip = "<IP_ADDRESS>"                                                    # ip address of the backend host to serve requests to
    port = 80                                                         # port of the backend host to serve requests to
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]            # add a second backend node to backend of 'myapp'
    hostname = "webserver2"                                           # friendly name of the host
    ip = "<IP_ADDRESS>"                                                    # ip address of the backend host to serve requests to
    port = 80                                                         # port of the backend host to serve requests to
```
In this example we still enable global loadbalancing using DNS, however we now add a listener IP which will accept incomming connections on HTTPS using the provided SSL certificates. This listener exists on both loadbalancers, and once a client connects to this listener on the port specified (8080) the loadbalancer will create a new connection to the local node, and forward the request.

## Adding Mercury as Global Loadbalancer serving multiple Hostnames
Quite often are you loadbalancing multiple domains which point to different servers. If this is the case you can specify the hostname which the backend serves. Mercury will look at the requested host header, and forward the request to the backend which has this host header configured.

Configuration:
```
[cluster]                  # All cluster related documentation
  name = "MY_GLB_POOL"     # Cluster name for all nodes
  [cluster.binding]
  name = "localhost1"      # Our local node name
  addr = "<IP_ADDRESS>:9000"  # Our local binding ip/port
  authkey = "test"         # key other clusters need to use to talk to us
  [[cluster.nodes]]
  name = "localhost2"      # Secondary cluster nodes name
  addr = "<IP_ADDRESS>:10000" # Secondary cluster node ip/port binding
  authkey = "test"         # Key we need to use to talk to the remote node

[dns]
  binding = "localhost"        # local binding address for dns service
  port = 15353                 # local binding port for dns service
  [dns.domains."example.com"]  # config for domain 'domain.nl'
    ttl = 11                   # set default ttl to 11 seconds

[loadbalancer.settings]
  default_balance_method = "roundrobin"                         # default balance method for all backends

[loadbalancer.pools.INTERNAL_VIP.listener]                      # define a pool with the name 'INTERNAL_VIP' with an empty listener
    ip = "<IP_ADDRESS>"                                            # ip address to listen for requests
    port = 8080                                                 # port number to listen for requests
    mode = "http"                                               # protocol to listen for
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp]              # in the pool 'INTERNAL_VIP' add a backend with the name 'myapp'
    hostnames = ["www.example.com"]                             # the backend called 'myapp' listens to the hostname 'www.example.com'
    connectmode="http"                                          # we connect to the backends using http protocol
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.dnsentry]     # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                      # domain name this GLB entry belongs to
    hostnames = "www"                                           # hostname to add when this backend is online
                                                                # since no ip is defined, the record will point to the listener IP
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.healthcheck]  # define a healthcheck for the backend called 'myapp'
    type = "tcpconnect"                                         # use a tcpconnect to test if the backend is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]      # add a backend node to backend of 'myapp'
    hostname = "webserver1"                                     # friendly name of the host
    ip = "<IP_ADDRESS>"                                              # ip address of the backend host to serve requests to
    port = 80                                                   # port of the backend host to serve requests to
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]      # add a second backend node to backend of 'myapp'
    hostname = "webserver2"                                     # friendly name of the host
    ip = "<IP_ADDRESS>"                                              # ip address of the backend host to serve requests to
    port = 80                                                   # port of the backend host to serve requests to

  # Add a second backend listening to a different host header request

  [loadbalancer.pools.INTERNAL_VIP.backends.myimageapp]              # in the pool 'INTERNAL_VIP' add a backend with the name 'myimageapp'
    hostnames = ["image.example.com"]                                # the backend called 'myimageapp' listens to the hostname 'www.example.com'
    connectmode="http"                                               # we connect to the backends using http protocol
  [loadbalancer.pools.INTERNAL_VIP.backends.myimageapp.dnsentry]     # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                           # domain name this GLB entry belongs to
    hostnames = "image"                                              # hostname to add when this backend is online
                                                                     # since no ip is defined, the record will point to the listener IP
  [loadbalancer.pools.INTERNAL_VIP.backends.myimageapp.healthcheck]  # define a healthcheck for the backend called 'myimageapp'
    type = "tcpconnect"                                              # use a tcpconnect to test if the backend is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myimageapp.nodes]]      # add a backend node to backend of 'myimageapp'
    hostname = "webserver3"                                          # friendly name of the host
    ip = "<IP_ADDRESS>"                                                   # ip address of the backend host to serve requests to
    port = 80                                                        # port of the backend host to serve requests to
  [[loadbalancer.pools.INTERNAL_VIP.backends.myimageapp.nodes]]      # add a backend node to backend of 'myimageapp'
    hostname = "webserver4"                                          # friendly name of the host
    ip = "<IP_ADDRESS>"                                                   # ip address of the backend host to serve requests to
    port = 80                                                        # port of the backend host to serve requests to
```
In this example we have 2 domains: www.example.com and image.example.com, requests made to www will be forwarded to webserver1+2 and requests made to images.example.com will be forwarded to webserver3+4

## Adding Mercury as Global Loadbalancer without the use of a local loadbalancer (DNS only)
For Small setups where you only have 2 hosts serving a website, and where stickyness is not required, you might skip the use of a local loadbalancer all together.
This will make Mercury do the health check, and send the client directly to one of the available servers in your pool

Diagram:
![](images/mercury_gslb_direct_app.png)

Configuration:
```
[cluster]                      # All cluster related documentation
  name = "MY_GLB_POOL"         # Cluster name for all nodes
  [cluster.binding]
  name = "localhost1"          # Our local node name
  addr = "<IP_ADDRESS>:9000"      # Our local binding ip/port
  authkey = "test"             # key other clusters need to use to talk to us
  [[cluster.nodes]]
  name = "localhost2"          # Secondary cluster nodes name
  addr = "<IP_ADDRESS>:10000"     # Secondary cluster node ip/port binding
  authkey = "test"             # Key we need to use to talk to the remote node

[dns]                          # dns configuration
  binding = "localhost"        # local binding address for dns service
  port = 15353                 # local binding port for dns service
  [dns.domains."example.com"]  # config for domain 'domain.nl'
    ttl = 11                   # set default ttl to 11 seconds

[loadbalancer.settings]                                         # generic load balancer settings
  default_balance_method = "roundrobin"                         # default balance method for all backends

[loadbalancer.pools.INTERNAL_VIP.listener]                      # define a pool with the name 'INTERNAL_VIP' with an empty listener
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp]              # in the pool 'INTERNAL_VIP' add a backend with the name 'myapp'
    hostnames = ["www.example.com"]                             # the backend called 'myapp' listens to the hostname 'www.example.com'
    connectmode="http"                                          # we connect to the backends using http protocol
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.dnsentry]     # add a GLB dns entry that will register the domain if this backend is online
    domain = "example.com"                                      # domain name this GLB entry belongs to
    hostnames = "www"                                           # hostname to add when this backend is online
    ip = "<IP_ADDRESS>"                                              # ip to point this record to if it is online
  [loadbalancer.pools.INTERNAL_VIP.backends.myapp.healthcheck]  # define a healthcheck for the backend called 'myapp'
    type = "tcpconnect"                                         # use a tcpconnect to test if the backend is up
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]      # add a backend node to backend of 'myapp'
    hostname = "webserver1"                                     # friendly name of the host
    ip = "<IP_ADDRESS>"                                              # ip address of the backend host to serve requests to
    port = 80                                                   # port of the backend host to serve requests to
  [[loadbalancer.pools.INTERNAL_VIP.backends.myapp.nodes]]      # add a second backend node to backend of 'myapp'
    hostname = "webserver2"                                     # friendly name of the host
    ip = "<IP_ADDRESS>"                                              # ip address of the backend host to serve requests to
    port = 80                                                   # port of the backend host to serve requests to
```
In this example the DNS server will reply to the client using the node ip, connecting your clients directly to one of your servers, by load balancing the dns requests to the available servers.

## Sticky Cookies
To use Stickyness you Must apply the following 2 outbound ACLs. this will ensure that the correct cookie gets set to direct the client to its sticky backend node

```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
cookie_expire = "24h"
cookie_httponly = false
cookie_key = "stky"
cookie_secure = true
cookie_value = "###NODE_ID###"
```
should the client be directed to another node that its initial sticky cookie, because its unavailable, we need to make sure that this new node is the sticky node for all future requests.

we do this by overwriting the node id with the ID of the new node.
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "replace"
cookie_expire = "24h"
cookie_httponly = false
cookie_key = "stky"
cookie_secure = true
cookie_value = "###NODE_ID###"
```
adds a stky cookie with the node_id the client is connected to

## X-Forwarded-For header
To pass the X-Forwarded-For header you need to add a inbound ACL
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
header_key = "X-Forwarded-For"
header_value = "###CLIENT_IP###"
```
This will add the X-Forwarded-For header to all requests towards the backend server, with the IP of the client

## X-Forwarded-Proto header
To pass the X-Forwarded-Proto header you need to add a inbound ACL
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
header_key = "X-Forwarded-Proto"
header_value = "###REQ_PROTO###"
```
This will add the X-Forwarded-Proto header to all requests towards the backend server, with the value 'http' or 'https'

## X-Forwarded-Host header
To pass the X-Forwarded-Host header you need to add a inbound ACL
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
header_key = "X-Forwarded-Host"
header_value = "###REQ_HOST###"
```
This will add the X-Forwarded-Host header to all requests towards the backend server, with the host value from the incoming request without port number

## X-Forwarded-Port header
To pass the X-Forwarded-Port header you need to add a inbound ACL
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
header_key = "X-Forwarded-Port"
header_value = "###LB_PORT###"
```
This will add the X-Forwarded-Port header to all requests towards the backend server, with the port that received the incoming request

## X-Forwarded-Client-Cert header
To pass the X-Forwarded-Cert header you need to add a inbound ACL
```
[[loadbalancer.pools.INTERNAL_VIP_LB.outboundacls]]
action = "add"
header_key = "X-Forwarded-Cert"
header_value = "###CLIENT_CERT###"
```
This will add the X-Forwarded-Cert header to all requests towards the backend server, with the base64 PEM encoded client certificate when connection is mTLS

## Balancing Kerberos tickets
To forward Kerberos requests you need to create a new TCP VIP, and ensure that the DNS name of this VIP contains the same hostname as the requests its serves.
so if you have a vip with ip: <IP_ADDRESS> listening on TCP port 88 and forwarding them to your domain server (your.domain.com) listening on <IP_ADDRESS>

ensure that:
* the GLB entry that mercury servers is your.domain.com,
* that this dns entry points to <IP_ADDRESS>, the vip of Mercury
* that all requests from Mercury to your DNS server also come from source ip <IP_ADDRESS>
* and that the reverse dns of ip <IP_ADDRESS> is your.domain.com

that ensures that the domain that the client will get requests from will always be the same as the domain we serve using mercury.

## Web Interface Authentication
The following authentication methods are possible: LDAP or Username/Password
Note that when local users are configured, it will automatically disable LDAP. you can only use 1 authentication.

### LDAP
You can add any number of users by adding a new line per user with its username and sha256 password hash
```
[web]
  [web.auth.password.users]
    test = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" # username = test / password = sha256 hash of password
    user2 = "sha256hashOfPassword"

```

### Username/Password
To use LDAP specify the LDAP host, and the DN+Filter to find the users in
LDAP first does the authentication with provided credentials, and then verifies if the username also exists in the binddn with the applied filter.
If user exists in the filter, then login is successful
```
[web]
  [web.auth.ldap]
    host = "localhost"                      # Ldap Host to connect to
    port = 389                              # Ldap Port to connect to
    method = "tls"                          # Protocol to connect to LDAP
    binddn = "ou=users,dc=example,dc=org"   # DN to execute filter in
    filter = "(&(objectClass=organizationalPerson)(uid=%s))" # Filter to apply to find the user, where %s replaces the username
    domain = "example"                      # Domain to prepend to the username provided

    [web.auth.ldap.tls]
    insecureskipverify = true               # Ignore SSL certificate hostname mismatches (for self-signed certificates)
```

### Healthchecks via Commandline
You can execute health checks using the commandline for use with Sensu, Nagios or another tool

Checking a specific backend:
```
mercury --config-file ./test/mercury.toml --pid-file /tmp/mercury.pid --check-backend --pool-name INTERNAL_VIP --backend-name example
```

Checking a specific GLB entry/DNS Name:
```
mercury --config-file ./test/mercury.toml --pid-file /tmp/mercury.pid --check-glb --dns-name random.glb.example.com
```

Checking the cluster status:
```
mercury --config-file ./test/mercury.toml --pid-file /tmp/mercury.pid --check-glb --cluster-only
```

repository: schubergphilis/mercury

repo_name: schubergphilis/mercury


text:
zabbenchmark
============

Benchmark for [Jzab](https://github.com/zk1931/jzab)

### Compilation
```
mvn clean compile assembly:single
```

### Configuration
You can configure it by creating a configuration file ```benchmark_config``` in root directory of the project. The default configuration is
```
membersCount = 1
txnSize = 128
txnCount = 1000000
```

### Usage
Let's say if you run the benchmark on a cluster of 3 servers.

    mvn -DserverId="host1:port1" exec:java
    mvn -DserverId="host2:port2" -Djoin="host1:port1" exec:java
    mvn -DserverId="host3:port3" -Djoin="host1:port1" exec:java

### Performance
- Configuration :
 - transaction size = 128 bytes
 - batch size = 1000
 - number of servers = 3
 - 3 servers with normal hard disks(not SSD).
 - number of transactions = 100000
- Throughput
 - 25000 transactions/s

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
#  etcd roadmap

**work in progress**

This document defines a high level roadmap for etcd development.

The dates below should not be considered authoritative, but rather indicative of the projected timeline of the project. The [milestones defined in GitHub](https://github.com/etcd-io/etcd/milestones) represent the most up-to-date and issue-for-issue plans.

etcd 3.3 is our current stable branch. The roadmap below outlines new features that will be added to etcd, and while subject to change, define what future stable will look like.

### etcd 3.4 (2019)

- Stabilization of 3.3 experimental features
- Support/document downgrade
- Snapshot restore as Go library
- Improved client balancer with new gRPC balancer interface
- Improve single-client put performance
- Improve large response handling
- Improve test coverage
- Decrease test runtime
- Migrate to Go module for dependency management

repository: ghostunnel/ghostunnel

gha_language: Go

repo_name: ghostunnel/ghostunnel


text:
node-chart
==========

Time Series Charting Canvas API

[Example](http://rook2pawn.com)

Use
===

    var Chart = require('chart');
    var chart = new Chart;
    var ee = require('events').EventEmitter;
    var datasource = new ee;

    chart.series(datasource);
    chart.to(document.getElementById('mychart'));

    setInterval(function() {
        var random = Math.floor(Math.random()*100);
        datasource.emit('data',{y:random});
    },1000);

Multiple Data sources
=====================

    var d1 = new ee;
    var d2 = new ee;

    chart.series(d1);
    chart.series(d2);

    // or
    chart.series([d1,d2])

    // or
    chart.series(d1,d2);

Multiple Y-Axises
=================

To have the data you emit treated as separate y-axises with different scaling, simply
pass a second object {multiple:true} in your emit

    datasource.emit('data',{stockPrice:235,temperature:88},{multiple:true});

chart.series
============

Event types that chart.series responds to are

'data' - provides data for timeseries and optional labels

'stop' - stops the timeseries for that datastream

chart.legend
============

    chart.legend(document.getElementById('legend'));

Legend is automatically created with the data that is sent.
To visualize and interact with a legend, use the .legend callback

legend.css
==========

    <link type='text/css' rel='stylesheet' href='legend.css' />

Also in the root directory of this package is a file called legend.css that you should include.

Labels go with the value
------------------------

    datasorce.emit('data',{'units sold':9.2})

You can supply multiple labels
------------------------------

    datasorce1.emit('data',{'units sold':9.2})
    datasorce2.emit('data',{'current energy consumption':30})

Colors
======

You can set the following colors. Defaults to below.

    chart.color.bg = '#FFF'; // the background color
    chart.color.grid = '#c9d6de'; // a pleasant grid
    chart.color.xlabel = '#000'; // the color of the x-axis labels
    chart.color.xline = '#000'; // the color the x-axis line
    chart.color.ylabel = '#000'
    chart.color.yline = '#000';
    chart.color.interactionline = '#000';

You can also create a preferred ordered set of colors for the lines.
You must supply the lines in six digit RGB hexadecimal like so:

    chart.color.line = ['#FF0000','#00FF'];

Any colors you do not supply will be provided for.

    chart.color.line = ['#FF0000',undefined,'#00FF'];
    // will choose '#FFFF00' for the second element automatically.

You can also set colors for the legend, through these CSS classes

    div.legend {
    }
    div.legend div.axisname {
    }

Render Modes
============

You can set the render modes any time, change them at any time like so:

    chart.rendermode = "line"; // defaults to line, also can use "linefill", "bar"

You can also set the rendermode from a specific event and it will take precedence.
You can switch this at will.

    datasource.rendermode = "linefill";

MISC
====

chart.inspect
=============

chart.inspect() returns the current data passing through.

Tests
=====

    // to install tap, simply npm install tap

    tap ./test

MISC
====

Author: David Wee<EMAIL_ADDRESS>License: MIT/X11

license: MIT

repository: Bos-Bakso/client-template

gha_language: CSS

gha_license_id: MIT

repo_name: Bos-Bakso/client-template


text:
---
id: 380
title: 'dotLang – Writing a Compiler using LLVM – Part 1'
date: 2017-12-01T13:44:32+00:00
author: Mahdi M.
layout: post
guid: http://www.mahdix.com/?p=380
permalink: /blog/2017/12/01/dotlang-writing-a-compiler-using-llvm-part-1/
medium_post:
  - 'O:11:"Medium_Post":11:{s:16:"author_image_url";s:68:"https://cdn-images-1.medium.com/fit/c/200/200/0*a70L__x5V0qVwdcB.jpg";s:10:"author_url";s:26:"https://medium.com/@mahdix";s:11:"byline_name";N;s:12:"byline_email";N;s:10:"cross_link";s:2:"no";s:2:"id";s:12:"d0e630184f64";s:21:"follower_notification";s:3:"yes";s:7:"license";s:19:"all-rights-reserved";s:14:"publication_id";s:2:"-1";s:6:"status";s:6:"public";s:3:"url";s:84:"https://medium.com/@mahdix/dotlang-writing-a-compiler-using-llvm-part-1-d0e630184f64";}'
categories:
  - Uncategorized
---
So, I have been working on “dotLang” for more than 2 years now. It has been a great journey up to now. I have been working mostly on the language spec (memory model, type system, function call dispatch, operators, …). But it’s time to move on to the next step which is writing the compiler. I will try to update this series regularly with the latest status on writing the compiler.

I chose to write the compiler in C because of its simplicity. That is my main goal in creating dotLang so it made sense for me. Also I will be using LLVM to generate native code because I am not going to invent the wheel again!

The first step is writing the grammar of the language. Now this grammar will definitely get updated during the compiler implementation project but right now it can be viewed [here](https://github.com/dotlang/language/blob/master/syntax.md).

I have used a modified EBNF notation to describe the grammer. First I was thinking that a grammar is not really an important part but soon I found out that it will act like a map in an uncharted territory. It helps you maintain the big picture while working on the smallest details. Another important advantage is that it makes you think really carefully about the notations and semantics in your language and this helps you find out if there are any inconsistencies or ambiguities in the rules of your language.

So the basic building block of the language is a `Module`. A module can contain three different elements:

  1. Named type definitions: Assigning a name for a specific type (For example “`MyInt := int`” ).
  2. Imports: Including definitions from another module (“`_ := @{"module"}`“, here underscore means we want to filter the output of the command and want to import everything).
  3. Bindings: Defining a function or a value to be used/invoked later (Bindings are immutable data definitions, e.g. “`PI := 3.1415`” or “`inc := (x:int) -> x+1`“).

A binding in dotLang can be any immutable value. Note that even functions are considered values in dotLang.

I will start with manually writing a lexer and parser. The parser will be a Recursive Descent parser. I tried to use Flex/Bison before but did not really like the huge volume of code they generated. Also, it was difficult to track errors in the code being compiled.

About LLVM one thing that really shocked me was how scarce the documentation/reference material is for C bindings. So all I got was something like this:

[<img class="alignnone  wp-image-383" src="http://www.mahdix.com/wp-content/uploads/2017/12/llvm-doc.png" alt="" width="536" height="190" />](http://www.mahdix.com/wp-content/uploads/2017/12/llvm-doc.png)

Well, does not say a lot of things about how the function works, what are its inputs and outputs. There is also a ton of blog posts for writing a simple tiny compiler using LLVM C bindings but they don’t compiler with the current version of LLVM. I guess they are so busy adding new functionalities or removing/deprecating stuff in LLVM that they do not have enough time to document their code.

However, I managed to find some sort of documentation/manual which proves to be very useful when implementing the compiler.

Here is the list:

  * [LLVM Programmer’s Manual](http://llvm.org/docs/ProgrammersManual.html#id79)
  * [LLVM Language Reference Manual](https://llvm.org/docs/LangRef.html)
  * [Summus: Simple compiler frontend using LLVM as backend](https://github.com/igor84/summus)

In the next post, I will start to explain the process of writing the compiler.


text:
# Tarot

Tarot is a light-weight, mobile-first, card-based SASS boilerplate framework.

# Current Status

Tarot is currently in Alpha Status 0.3. This means that variables and syntax are subject(but unlikely) to change and that there is very little documentation.

# To-Do

- ~~Add plugins for sidebar~~
- Add more colors for initial theme
- Add different button colors
- Add 'Alternative' colors and styles
- Add different button sizes
- Add more click button effects
- ~~Add flipcheck styles~~
- Add 'Bigflip' flipcheck
- (When Tarot hits version 0.5) Rails gem

# Contributors

Donald Beals and Matt McCullar.

We would appreciate any wishlist items or wants from all Tarot users - help us make Tarot better for you. Tell us what you want!

# Design

There are two major design principles in play in Tarot:

First is "cards" - everything in the design should be a card or be designed specifically to work in a card.

Second is modifiers - the majority of the classes are designed as modifiers to be applied to any element. For sake of a definition, we are defining a modifier as a CSS class that is designed to provide a specific aesthetic or work in conjunction with another class. For example, **primary-back** can be applied to any element to change it's background color to the primary color. You can then apply **dark-back** to make the primary-color-background darker.

# Generic Modifiers

These are modifiers that can be used on any element.

![Example colors](https://github.com/dbeals/Tarot/blob/master/Examples/Content/tarotcolors.PNG)
- **[primary/secondary/success/warning/error]**: changes the color of the accent (3px border at the top.)
- **[primary/secondary/success/warning/error]-back**: changes the color of the background.
- **[dark/darker/darkest/light/lighter/lightest]-back**: changes the brightness of the background based on the current -back modifier.
- **[primary/secondary/success/warning/error]-border**: changes the color of the border.
	- Please note that the -border colors are a little darker than the -back colors so that the border sticks out.
- **[dark/darker/darkest/light/lighter/lightest]-border**: changes the brightness of the border based on the current -border modifier.
- **[primary/secondary/success/warning/error]-text**: changes the color of the text.
	- Please note that the -text colors DO NOT match the -back colors; these modifiers are used to change the color of the text so that it shows up properly on the matching back color.
- **square**: removes rounded corners.
- **rounded**: adds rounded corners (0.25rem.)
- **inline**: forces block display on mobile, inline-flex on the default breakpoint. It also removes the bottom border of list-items.
- **pad-none**: sets padding to 0.
- **pad-left, pad-top, pad-right, pad-bottom, pad-all, pad-horizontal, pad-vertical**: sets the respective padding to @basePadding.
- **thin-padding, thick-padding**: changes the padding to be half or double, respectively.
- **thin-margin, thick-margin**: changes the margin to be half or double, respectively.

# Flipcheck

- **flip-switch, flip-switch-icon, flip-switch-text**: Respective class names for flip check content.
![Flipcheck](http://i.makeagif.com/media/8-16-2016/BcfvAE.gif)

# Typography

- **text-left, text-center, text-right**: aligns the text to the left, center, and right respectively.
- **small-text, normal-text, large-text, extra-large-text**: changes the font-size to .75rem, 1rem, 1.25rem, and 1.5rem respectively.
- **strong**: bolds the font.
- **emphasis**: applies italic font-style.
- **ellipsis**: attempts to force the element to cut off text with an ellipsis.

# Media
- **rounded-image**: gives the image rounded corners (0.25rem.)
- **circle-image**: rounds a square image into a circle. (50% border radius.)

# Visibility
- **hide-on-[small/medium/large/extra-large]**: hides the element based on the respective breakpoints (see GlobalVariables.less for pixel size.)
- **show-only-on-[small/medium/large/extra-large]**: hides the elements until the respective breakpoint is hit (see GlobalVariables.less for pixel size.)

# Badges / Pills
- **badge**: changes the line-height and font-size to accomodate smaller text. Adds rounded corners and removes word wrap.
- **pill**:  same as *badge*, but more rounded corners (to give it the pill aesthetic.)

# Cards

You can create a card by simply assigning the class "card" to any div. This will give the div a margin of 1rem, a 1px border around the side, a 3px border at the top, a background color determined by the theme, and rounded corners.

## Modifiers

- **no-accent**: removes the accent (changes the 3px border at the top to a 1px border.)
- **hover** *(theme only)*: list-items will have a hover affect applied.
- **three-d** *(theme only): gives the card a 3D appearance.

## Typography

- **header**: bolded text.

## Lists

- **list**: removes list-style and padding so that the list appears to be part of the card.
- **list-item**: used for lists that are never inline. Adds borders.
- **inline-list-item**: used for lists that are inline, but vertical on mobile. Adds borders on mobile.

## Blocks

- **block**: defines a section of a card; adds a top border. The default theme also darkens the background color.

# Grid
Tarot includes a 12 column grid system utilizing a simple naming standard: [number]-column[s]:

- one-column
- two-columns
- three-columns
- etc.

To simplify design, we have included quarters and thirds:
- one-quarter
- two-quarters
- one-third
- etc.

*Please note that there is not a twelve-columns, four-quarters, or three-thirds; you would utilize full-width for this.*

Finally, append -offset to the end of any of these to push the element to the right.

#Icons
Some of our css parts do require you to use icons, but only in obvious places. If you want to use icons, we recommend Font Awesome. We include Font Awesome easily with this simple import in Framework.css:

```javascript
@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css);
```

If you would like to use different/custom fonts, simply replace this for your own preferred style.

# Themes
If you just want to adjust theme colors, assign the new values in CustomThemeStyles.less; these values are import after the default values, but before the styles.

If you want to add/adjust built-in theme styles, do so in CustomThemeStyles.less. These are imported after everything else.

# Examples

- Examples of Tarot can be found in https://github.com/dbeals/Tarot/tree/master/Examples
- Screen captures of the examples can be found at https://github.com/dbeals/Tarot/tree/master/Examples/Content

# Contributing

These are just a few notes about contributing.
- Keep selector specificity as low as possible.
- Do not use ID selectors - all styles should be designed to be applied to any element.
- Use specific styles; for example, use border[-side]-width instead of border: none as border: none will mess with subsequent styles.
- Make sure to compile the SASS files down to CSS.
	- As a side-note, make sure to compile all other files after changes to GlobalVariables.scss. Most auto-compile extensions I've used will not detect the change and force the other files to compile.
- SASS files go in the Source folder, CSS files go in the Distribution folder.
- All SASS files should import GlobalVariables.scss.
- Only variables and mixins (must always have parenthesis) are allowed in GlobalVariables.scss. This way the contents of GlobalVariables.scss does not affect the file that is importing it.
- Colors should be avoided at all cost - these will be set in the Theme.scss.
- If you need to use padding/margins use the predefined variables (see GlobalVariables.scss.)
- If you need to use colors, use the predefined variables (see top of ThemeVariables.scss.)
- If a modifier is theme only (defined in Theme.scss), then ensure you note that in the readme (see Cards > hover.)

repository: dbeals/Tarot

repo_name: dbeals/Tarot


text:
Pulsar
======

An [Ansible][ansible] role for installing and managing [Pulsar][pulsar]
servers.

[ansible]: http://www.ansible.com/
[pulsar]: https://github.com/galaxyproject/pulsar/

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

This role has the same dependencies as the `git` module, namely,
[git][git]. In addition, [Python virtualenv][venv] is required (as is
[pip][pip], but pip will automatically installed with virtualenv). These can
easily be installed via a pre-task in the same play as this role:

    - hosts: pulsarservers
        pre_tasks:
          - name: Install Mercurial
            apt: pkg={{ item }} state=installed
            sudo: yes
            when: ansible_os_family = 'Debian'
            with_items:
              - git
              - python-virtualenv
          - name: Install Mercurial
            yum: pkg={{ item }} state=installed
            sudo: yes
            when: ansible_os_family = 'RedHat'
            with_items:
              - git
              - python-virtualenv
        roles:
          - galaxyprojectdotorg.pulsar

If your `virtualenv` executable is not on `$PATH`, you can specify its location with
the `pip_virtualenv_command` variable.

[git]: http://git-scm.com/
[venv]: http://virtualenv.readthedocs.org/
[pip]: http://pip.readthedocs.org/

Role Variables
--------------

### Required variables ###

- `pulsar_server_dir`: Filesystem path where the Pulsar server code will be
  installed (cloned).

### Optional variables ###

You can control various things about where you get Pulsar from, what version
you use, and where its configuration files will be placed:

- `pulsar_git_repo` (default: `https://github.com/galaxyproject/pulsar`):
  Upstream git repository from which Pulsar should be cloned.
- `pulsar_changeset_id` (default: `master`): A changeset id, tag, branch, or
  other valid git identifier for which changeset Pulsar should be updated to.
- `pulsar_venv_dir` (default: `<pulsar_server_dir>/.venv`): The role will
  create a [virtualenv][virtualenv] from which Pulsar will run, this controls
  where the virtualenv will be placed.
- `pulsar_config_dir` (default: `<pulsar_server_dir>`): Directory that will be
  used for Pulsar configuration files.
- `pulsar_optional_dependencies` (default: None): List of optional dependency
  modules to install. Whether or not you need these depends on what features
  you are enabling.
- `pulsar_install_environments` (default: None): Installing dependencies may
  require setting certain environment variables to compile successfully.

Additional options from Pulsar's `server.ini` are configurable via the
following variables (these options are explained in the [Pulsar
documentation][pulsardocs] and `server.ini.sample`):

- `pulsar_host` (default: `localhost`)
- `pulsar_port` (default: `8913`)
- `pulsar_dependencies_dir` (default: `<pulsar_server_dir>/deps`)
- `pulsar_persistence_dir` (default:
  `<pulsar_server_dir>/files/persisted_data`)
- `pulsar_staging_dir` (default: `<pulsar_server_dir>/files/staging`)
- `pulsar_drmaa_library_path`
- `pulsar_job_managers` (default: `_default_`, type `queued_python`): The
  contents of the job managers configuration file (job_managers.ini by default)
  are controlled by this variable. It is a hash of hashes (or dictionaries)
  that will be translated in to the configuration file. See the definition in
  the defaults for syntax hints.

### pulsar_optional_dependencies ###

Currently, the list of optional dependencies is:

    pulsar_optional_dependencies:
      - pyOpenSSL
      # For remote transfers initiated on the Pulsar end rather than the Galaxy end
      - pycurl
      # uwsgi used for more robust deployment than paste
      - uwsgi
      # drmaa required if connecting to an external DRM using it.
      - drmaa
      # kombu needed if using a message queue
      - kombu
      # requests and poster using Pulsar remote staging and pycurl is unavailable
      - requests
      - poster
      # psutil and pylockfile are optional dependencies but can make Pulsar
      # more robust in small ways.
      - psutil

Many of these dependencies have their own dependencies. A nice future
enhancement to this role would be to install the dependencies' dependencies via
the system package manager if desired.

### pulsar_install_environments ###

Some sites may need to set environment variables when installing certain
modules, e.g. to point pyOpenSSL at a non-standard OpenSSL or libffi locations,
or to instruct pycurl to use the NSS library:

    pulsar_install_environments:
      pyOpenSSL:
        PKG_CONFIG_PATH: "/opt/site/libffi/lib64/pkgconfig"
        CFLAGS: "-I/opt/site/openssl/include"
        LDFLAGS: "-L/opt/site/openssl/lib"
      pycurl:
        PYCURL_SSL_LIBRARY: "nss"

[pulsardocs]: http://pulsar.readthedocs.org/

Dependencies
------------

None

Example Playbook
----------------

Install Pulsar on your local system with all the default options:

    - hosts: localhost
      connection: local
      vars:
        pulsar_server_dir: /home/nate/pulsar
      roles:
        - role: galaxyprojectdotorg.pulsar

Install Pulsar with directory separation and also install Galaxy:

    - hosts: pulsarservers
      vars:
        pulsar_venv_dir: /opt/pulsar/venv
        pulsar_server_dir: /opt/pulsar/server
        pulsar_config_dir: /opt/pulsar/config
        pulsar_persistence_dir: /var/opt/pulsar/persisted_data
        pulsar_staging_dir: /var/opt/pulsar/staging"
        pulsar_optional_dependencies:
          - pyOpenSSL
          - pycurl
          - uwsgi
          - drmaa
          - kombu
          - requests
          - poster
          - psutil
        galaxy_server_dir: /opt/galaxy/server
        galaxy_config_dir: /opt/galaxy/config
        galaxy_config_files:
          - name: files/galaxy/config/datatypes_conf.xml
            dest: "{{ galaxy_config_dir }}/datatypes_conf.xml"
      pre_tasks:
        - name: Install Mercurial
          pip: name=mercurial virtualenv={{ hg_virtualenv }} virtualenv_command={{ pip_virtualenv_command | default( 'virtualenv' ) }}
      roles:
        - role: galaxyprojectdotorg.pulsar
        # Install with:
        #   % ansible-galaxy install natefoo.postgresql_objects
        - role: galaxyprojectdotorg.galaxy
          galaxy_manage_mutable_setup: no
          galaxy_manage_database: no

License
-------

[Academic Free License ("AFL") v. 3.0][afl]

[afl]: http://opensource.org/licenses/AFL-3.0

Author Information
------------------

[John Chilton](https://github.com/jmchilton)
[Nate Coraor](https://github.com/natefoo)

repository: galaxyproject/galaxy-cloudman-playbook

repo_name: galaxyproject/galaxy-cloudman-playbook


text:
# The sourdough baking process

## Glossary

* Starter: the sourdough culture that I use to start baking. Never use this directly in the bread (see below)
* Levain: an offshoot of your starter. This is what goes into the bread. This way, you don't risk using all your starter by mistake.

## My baking routine

### Day 1: Prepare

* Morning or early afternoon: Take starter out of the fridge
* Evening (before bed): Prepare the levain at 100% hidration using a tablespoon of the starter

### Day 2: Proof

* Morning: Mix the levain, water, and flour. Weight the salt (but don't mix in the dough). Also good time to feed the starter (put it back in the fridge as soon as I see bubbles).
* Wait 30min - 1h: Rest dough without salt (autolyse).
* Mix in the salt and bit extra water to help.
* Bulk fermentation (4-7h depending on temperature): Every 30min do a set of stretch-and-fold. It's OK if you forget sometimes. Dough is ready when it feels light and airy.
* Divide the dough and pre-shape into round balls.
* Wait 15-20 minutes for dough to relax.
* While we wait, prepare baskets: place a tea towel in a bowl or proofing basket, dust with flour. I usually err on the side of caution and dust generously.
* Shape the dough into the shape of your baskets. Try to get as much surface tension as possible. Google "dough shaping" and watch some videos.
* Place shaped loaves top side down into the baskets. Dust with flour, cover with the towel and place on fridge overnight.

### Day 3: Bake

* Morning: preheat the oven and your dutch oven to 240-250C for 25-30 min.
* After everything is hot: Dust the dutch oven with cornmeal to avoid sticking.
* Flip loaf into the hot dutch oven
* Score with a razor or **very** sharp knife
* Cover with lid and bake for 30 min
* Remove the lid, lower the temperature to 200C and bake for another 20-30 min (temperature and time may depend on your oven)
* Let loaf cool completely (at least 1h) before cutting. It gets sticky and soggy if you cut it hot.

## Starter maintenance

I keep my starter at 50g of flour and 100% hydration (50g water).
The morning when I bake, I'll feed the starter (discard most and add more flour + water).
Then I wait until bubbles start showing up, usually around 1-2h.
At this point, I put in the fridge until the next Friday when I'm going to bake again.

repository: leouieda/bread

branch_name: refs/heads/main

repo_name: leouieda/bread


text:
# Chaos

Bootstrap and configure services on individual server.
Can also configure your app to deploy to your freshly bootstrapped server using git.

## Installation

```bash
gem build chaos.gemspec
gem install chaos-X.X.X.gem
```

## Usage

```
Commands:
  chaos addons          # Manage app addons
  chaos app             # Manage app deployment configuration
  chaos config          # Manage app config vars
  chaos domains         # Manage app domains
  chaos help [COMMAND]  # Describe available commands or one specific command
  chaos server          # Manage server configuration
  chaos servicepacks    # Manage services offering addons on servers
```

## Links (Chaos components)

* [Hermes HTTP routes manager for Nginx](https://github.com/garnieretienne/chaos_hermes)
* [PostgreSQL Servicepack](https://github.com/garnieretienne/chaos-servicepack-postgresql)
* [Redis Servicepack](https://github.com/garnieretienne/chaos-servicepack-redis)

## Contributing

1. Fork it
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

repository: garnieretienne/chaos

repo_name: garnieretienne/chaos


text:
We cannot easily recreate the issue with the provided information. Please add a **minimal** reproduction in order for us to be able to help more efficiently.

### Why was this issue marked with the `please simplify reproduction` label?

There was a reproduction provided, but due to its complexity, we cannot easily reproduce the issue.

An ideal minimal reproduction (_unless relevant_):

- is not part of a monorepo
- does not require secrets to run
- does not reference private registry dependencies
- has as few dependencies as possible
- excludes unrelated pages/routes
- does not require a database/third-party service to run
- only includes the code necessary to reproduce the issue
- is tested against `next@canary` to make sure your issue has not already been fixed

**In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.**

If you cannot create a clean reproduction, another way you can help the maintainers' job is to pinpoint the `canary` version of `next` that introduced the issue. Check out our [releases](https://github.com/vercel/next.js/releases), and try to find the first `canary` release that introduced the issue. This will help us narrow down the scope of the issue, and possibly point to the PR/code change that introduced it. You can install a specific version of `next` by running `npm install next@<version>`.

### What happens if I don't provide a sufficient minimal reproduction?

Issues with the `please simplify reproduction` label that receive no meaningful activity (e.g. new comments with a simplified reproduction link) are automatically closed and locked after 30 days.

If your issue has _not_ been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

### I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps.

### I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Providing a minimal reproduction from the start without asking helps us look into issues much more quickly, as we can easily verify if the reported bug is related to Next.js. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

### Useful Resources

- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc)
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)
- [Reporting a Next.js bug](https://github.com/vercel/next.js/blob/canary/.github/ISSUE_TEMPLATE/1.bug_report.yml)
- [Next.js Triaging issues](https://github.com/vercel/next.js/blob/canary/contributing/repository/triaging.md)

branch_name: refs/heads/canary

gha_language: JavaScript


text:
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/

title: "More Than Just the Table: Analog Games as Computational Platforms"
authors: []
date: 2020-11-24T16:19:35-05:00
doi: "https://doi.org/10.1145/3402942.3402974"

# Schedule page publish date (NOT publication's date).
publishDate: 2020-09-15T16:19:35-05:00

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["0"]

# Publication name and optional abbreviated publication name.
publication: "FDG '20: International Conference on the Foundations of Digital Games"
publication_short: "FDG '20"

abstract: "Analog game platforms are more than just individual material objects as the platform studies methodology would argue. Platform studies affords a medium specific analysis connecting media to its cultural implications through close examinations of modular material components that influence the interactions and creation of media made on a specific hardware or software platform. This paper uses the examples of Dungeons & Dragons and Magic: the Gathering to conceptualize analog game platforms in a way that complicates the construction of platforms."

# Summary. An optional shortened abstract.
summary: ""

tags: []
categories: []
featured: false

# Custom links (optional).
#   Uncomment and edit lines below to show custom links.
# links:
# - name: Follow
#   url: https://twitter.com
#   icon_pack: fab
#   icon: twitter

url_pdf:
url_code:
url_dataset:
url_poster:
url_project:
url_slides:
url_source:
url_video:

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ""
  focal_point: ""
  preview_only: false

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
projects: []

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
slides: ""
---

repository: Jackademia/academic-kickstart

repo_name: Jackademia/academic-kickstart


text:
# sports-chain

You can deploy the contract in remix and hit "start game" for testing

Right now I have a CL node that is serving all the data, EXCEPT fantasy points. You'll see that `get_points_nba_players` right now only returns 1. It's already really expensive to run a game, let alone start to calculat the amount of points each one gets.

If you deploy the contract, you can run the "start game" and it will give you a game that starts in two days or greater from the Pandascores API.

It will then prompt a Chainlink Alarm to close the game, as well as send payouts to winners. Right now everyone/no one wins since collecting points is such a nightmare.
```
Node address(Ropsten):
0x810B278a74d5eE00357420Fd1abF4bdFF55918D1

Oracle contract address (ropsten):
0x241F77325C073a3815985691f76B58dff17F685B
```

repository: NATIVE-EARTHLING/sports-chain

repo_name: NATIVE-EARTHLING/sports-chain


text:
Sorting
=======
Sorting follows the the json api specification. You can do sorting on multiple columns separated by comma.

By default soring is ascending and if you prefix the column name with a - it becomes descending.

gha_language: PHP

gha_license_id: NOASSERTION


text:
# Discord.js-Bot

## ✨About
- This is a discord.js bot template to get started with a simple bot and a starter command
- This template was written [chopstickxs](https://github.com/chopstickxs) and will not be claimed by anybody else

## ⌨Installion
Make sure you have [git](https://git-scm.com/download) and [nodejs](https://nodejs.org/en/) installed
1 First Part
    - Open a terminal (cmd on windows) and type in ```git clone https://github.com/chopstickxs/Discord.js-Bot.git```
    - Then type in: ```cd Discord.js-Bot```
    - Then lastly type in: ```npm init -y```

2. Second Part
    - Type in npm install
    - Then Open the config.json file

3. Third Part
    - Go to discord.com/developers/applications and create a new Application
    - Go to the bot tab and press the create bot
    - Press Copy Token and paste it into the token value where it says TOKEN HERE
    - Change the prefix to anything you want it to be

4. Fourth Part
    - Go to the OAuth2 Tab and go to the scopes area, In that area press the bot tab
    - Then a permissions area will pop up, A little info: The admininstator permission is made for bot development, when you post your bot to the public make sure you don't have the admininstator permission and choose the permissions that only your bot needs
    - Once your done choosing some permissions a link will be generated, copy that link and paste it into another tab and a gui will come up
    - Choose the server you want your bot in and it will join

5. Five Part.
    - Welp you made it to the end, and your ready to run your own bot!,
    - The last thing to do is to run: ```node bot.js```

## 💬How to contribute
- We will be constantly updating this and changing this template adding new interagation to it like database support and may branch into a generator

[Please go to the contrubuting guide](./CONTRIBUTING.md)


text:
Laterpost
==============

Open source platform for scheduling twitter status updates.

## Installation

### Step 1: Clone the repo
```
git clone https://github.com/mrgodhani/laterpost
```

### Step 2: Prerequisites
This will install the dependencies of this website. It will pull in several packages like Lumen Framework, Vue, Vueify, vue-router, gulp and Laravel Elixir (this is just magic syntactical sugar for gulp, basically).
```
composer install
php artisan migrate
php artisan jwt:secret
npm install
```

### Step 3: Run Gulp
```
gulp --production
```

### Step 4: Configure environment variables
Configure environment variables and add keys for Twitter. Just copy .env.example file by executing command cp .env.example .env . In my case I used Amazon S3 for temporary storing uploaded images. But please free feel to use any driver you want.

```
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=
TWITTER_CLIENT_CALLBACK=

BITLY_KEY=
BITLY_SECRET=
BITLY_REDIRECT_URI=

AMAZON_KEY=
AMAZON_SECRET=
AMAZON_BUCKET=
AMAZON_REGION=

```

### Step 5: Serve
```
php artisan serve
```

For scheduling posts and queues setup cronjob  as following:

```
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
```

You also have to setup queue driver in your .env file and also configure supervisor to run worker to watch that specific tube.

```
QUEUE_DRIVER=beanstalkd

Configuring supervisor example:

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/forge/app.com/artisan queue:work beanstalkd --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
stdout_logfile=/home/forge/app.com/worker.log

```

## Features

- [x] Multi account for twitter
- [x] Email and password login
- [x] Scheduling twitter status updates to multiple account
- [x] Managing connected social media accounts and other account settings (i.e password change, timezone change and email update)
- [x] Sending twitter update with image (Currently supports 1 image upload only)
- [x] Character counting similar to twitter
- [x] Editing scheduled tweets
- [x] URL Shorterner feature (bit.ly integration)
- [ ] Multi image upload
- [ ] Slack integration to notify user when all pending scheduled queues are empty.
- [ ] Integrating Facebook

Linkedin apparently cannot be integrated because of limitation of API availability.

## Demo and Live application

![img](./laterpost.gif)
![img](./laterpost2.gif)

## Support / Contribution

Please feel free to give suggestion or report bug by [creating issue](https://github.com/mrgodhani/rss-reader/issues) or letting me know on twitter [@mrgodhani](https://twitter.com/mrgodhani).

repository: ramadhanbridge/laterpost

repo_name: ramadhanbridge/laterpost


text:
# Sample Programs in C#

Welcome to Sample Programs in C#!

## Sample Programs

- [Hello World in C#](https://therenegadecoder.com/code/hello-world-in-c-sharp/)
- [Reverse a String in C#](https://github.com/jrg94/sample-programs/issues/80)
- [Fizz Buzz in C#](https://github.com/TheRenegadeCoder/sample-programs/issues/351)

## Fun Facts

- Debut: 2000
- Developer: Microsoft
- Typing: Static

## References

- [C# Wiki](https://en.wikipedia.org/wiki/C_Sharp_(programming_language))
- [C# Guide](https://docs.microsoft.com/en-us/dotnet/csharp/)
- [Online C# Compiler](https://www.jdoodle.com/compile-c-sharp-online)


text:
# Scope of System

## Administrators

- Admins can manage users.

- Admins can manage books.

- Admins can create categories.

## Users

- Users are able to login and register.

- Users can publish books.

- Users can read books. (Paid ones require proof of purchase)

- Users can download books for offline use (desktop and mobile only, paid ones also require proof of purchase)

## Books

- Books contain metadata and contents.

- Books are categorized.

- Books have ratings and reader count.

- Books have download count.

- Books have unique barcode/qr code ids.

repository: libraria-io/docs

repo_name: libraria-io/docs


text:
# ngo-project

[![Build Status](https://travis-ci.org/anaskhan96/ngo-project.svg?branch=master)](https://travis-ci.org/anaskhan96/ngo-project)

![Image of the web-portal's homepage](https://i.imgur.com/QuYXnGU.jpg)

This project aims at being a complete, end-to-end solution for the functioning, and management of the school, which in our case is the Non-Profit Organization Sri Vidya Nikethan School, Bangalore.

Vidyanikethan is a not-for-profit organization founded in 1988 to improve the lives and livelihoods of people from the vulnerable, marginalized and under-developed sections of the society. There is a significant need of teachers, and volunteers at the school judging from the performance of the students, which is what called for this project, as an attempt to help the Non-Profit Organization.

The intent of this project is to provide an efficient tool from the persective of the 5 different types of users:
* Donors - To donate in the form of monetary, and non-monetary donations, keep track of the school's progress, etc.
* Volunteers - An intuituve portal to register, and manage their schedules with respect to the school.
* Teachers - Ability to manage the students they are teaching, add or remove videos to the E-Learning portal, etc.
* Students - Access to their assignments, projects, quizzes, as well an E-Learning portal comprising of the teachers' hand-picked videos.
* Management - A portal to handle all NPO, and school related activities. Managing volunteer registrations, volunteer schedules, managing teachers, donations, etc.

### Development Setup

+ Pre-requisites to be installed - `node`, `npm`, `mongodb`

+ Execute the following to setup the directory :-

```bash
git clone https://github.com/anaskhan96/ngo-project
cd ngo-project
npm install
```

+ Include the MongoDB and PayTM API details in a `.env` file in the root directory in the following form :-

```
DB_HOST=<hostname or ip addr>
DB_PORT=<port number>
DB_USER=<username>
DB_PASS=<password>
PAYTM_MID=<mid>
PAYTM_ACCTKEY=<acctkey>
```

+ Run `npm test` to run all the tests.

+ Run `npm start` to start the server at the specified port.

---

This project was built under the course *Software Engineering* in *PES University*.

repository: MrHarshvardhan/ngo-pro

repo_name: MrHarshvardhan/ngo-pro


text:
# Musical collaboration for disconnected performers: Rend-o-matic

## Description

Helping musicians jam together even when socially distanced, this tool from Choirless analyzes and merges musical waveforms to create a version of a track that can be continually updated.

## Technology stack

- HTML
- Node.js
- Cloud Foundry
- Cloudant
- Cloud Functions
- Python
- Cloud Object Storage

[Rend-o-Matic](https://github.com/Rend-o-matic) has several repositories (star them!)
Rend-o-Matic: check out the [site](https://rend-o-matic.github.io/) to get started.

## Open issues

Get started on issues [here](https://github.com/Rend-o-matic/Rend-o-matic/issues?q=is%3Aissue+is%3Aopen+label%3Ahacktoberfest) (issues are tagged #hacktoberfest):

## Slack Channel

Stay in touch in the #rend-o-matic channel. Click [here](../getting_started/README.md?id=join-our-slack-channel) to join our Slack workspace.

## Hear from the team

Check out this [passion projects page](https://www.ibm.com/thought-leadership/passion-projects/choirless) to learn more about the Choirless team, the creators of Rend-o-Matic.


text:
# redux-saga

[![npm version](https://img.shields.io/npm/v/redux-saga.svg?style=flat-square)](https://www.npmjs.com/package/redux-saga)

An alternative Side Effect model for Redux applications. Instead of dispatching thunks
which get handled by the redux-thunk middleware, you create *Sagas* to gather all your
Side Effects logic in a central place.

This means the logic of the application lives in 2 places:

- Reducers are responsible for handling state transitions between actions

- Sagas are responsible for orchestrating complex/asynchronous operations.

Sagas are created using Generator functions.

> As you'll see in the docs, Generators, while seemingly more low-level than ES7 async
functions, allow some features like declarative effects and cancellation which are harder—if not
impossible—to implement with simple async functions.

What this middleware proposes is:

- A composable abstraction **Effect**: waiting for an action, triggering state updates (by dispatching
  actions to the store), and calling a remote service are all different forms of Effects. A Saga composes those
  Effects using familiar control flow constructs (if, while, for, try/catch).

- The Saga is itself an Effect. It can be combined with other Effects using combinators.
It can also be called from inside other Sagas, providing the full power of Subroutines and
[Structured Programming](https://en.wikipedia.org/wiki/Structured_programming)

- Effects may be yielded declaratively. You yield a description of the Effect which will be
executed by the middleware. This makes your operational logic inside Generators fully testable.

- You can implement complex operations with logic that spans across multiple actions (e.g. User onboarding, wizard
dialogs, complex Game rules, etc.), which are non-trivial to express using other effects middlewares.

# Install

```
npm install redux-saga
```

# Documentation

- [Introduction](http://yelouafi.github.io/redux-saga/docs/introduction/index.html)
- [Basic Concepts](http://yelouafi.github.io/redux-saga/docs/basics/index.html)
- [Advanced Concepts](http://yelouafi.github.io/redux-saga/docs/advanced/index.html)
- [Recipes](http://yelouafi.github.io/redux-saga/docs/recipes/index.html)
- [External Resources](http://yelouafi.github.io/redux-saga/docs/ExternalResources.html)
- [Troubleshooting](http://yelouafi.github.io/redux-saga/docs/Troubleshooting.html)
- [Glossary](http://yelouafi.github.io/redux-saga/docs/Glossary.html)
- [API Reference](http://yelouafi.github.io/redux-saga/docs/api/index.html)

# Using umd build in the browser

There's also an **umd** build of `redux-saga` available in the `dist/` folder. When using the umd build
`redux-saga` is available as `ReduxSaga` in the window object.

The umd version is useful if you don't use Webpack or Browserify. You can access it directly from [npmcdn](npmcdn.com).

The following builds are available:

- [https://npmcdn.com/redux-saga/dist/redux-saga.js](https://npmcdn.com/redux-saga/dist/redux-saga.js)
- [https://npmcdn.com/redux-saga/dist/redux-saga.min.js](https://npmcdn.com/redux-saga/dist/redux-saga.min.js)

**Important!** If the browser you are targeting doesn't support _es2015 generators_ you must provide a valid polyfill,
for example the one provided by *babel*:
[browser-polyfill.min.js](https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.25/browser-polyfill.min.js).
The polyfill must be imported before **redux-saga**.

```javascript
import 'babel-polyfill'
// then
import sagaMiddleware from 'redux-saga'
```

# Building examples from sources

```
git clone https://github.com/yelouafi/redux-saga.git
cd redux-saga
npm install
npm test
```

Below are the examples ported (so far) from the Redux repos

### Counter example

```
npm run counter

// test sample for the generator
npm run test-counter
```

### Shopping Cart example

```
npm run shop

// test sample for the generator
npm run test-shop
```

### async example

```
npm run async

//sorry, no tests yet
```

### real-world example (with webpack hot reloading)

```
cd examples/real-world
npm install
npm start
```

repository: brandonlilly/light-cable

repo_name: brandonlilly/light-cable


text:
# eddy - Extracting Disk Dynamics

## What Is It?

`eddy` is a suite of Python tools to recover precise velocity profiles of protoplanetary disks from Doppler shifted line emission. `eddy` makes fitting of first moment maps and the inference of a rotation velocity from an annulus of spectra a breeze.

## Installation

The most simple method is with `pip`,

```
pip install astro-eddy
```

The only real dependencies for this are `numpy`, `scipy`, `matplotlib`, and [`emcee`](https://github.com/dfm/emcee), If you want to run the Gaussian Process method you will also need [`celerite`](https://github.com/dfm/celerite) which can be easily installed if you follow their [installation guide](https://celerite.readthedocs.io/en/stable/python/install/).

If things have installed correctly you should be able to run the [Jupyter Notebooks](https://github.com/richteague/eddy/tree/master/docs/tutorials) with no errors. If something goes wrong, please [open an issue](https://github.com/richteague/eddy/issues/new).

## Useage

For guides on how to use `eddy` you will find extensive examples in the [documents](https://github.com/richteague/eddy/tree/master/docs). We shamelessly recommend [bettermoments](https://github.com/richteague/bettermoments) to make the moment maps required for the fitting.

## Citations

If you use `eddy` as part of your research, please cite the [JOSS article](http://joss.theoj.org/papers/10.21105/joss.01220):

```latex
@article{eddy,
    doi = {10.21105/joss.01220},
    url = {https://doi.org/10.21105/joss.01220},
    year = {2019},
    month = {feb},
    publisher = {The Open Journal},
    volume = {4},
    number = {34},
    pages = {1220},
    author = {Richard Teague},
    title = {eddy},
    journal = {The Journal of Open Source Software}
}
```

A full list of citations including dependencies can be found on the [citations](./docs/citations.md) page.

## Works Using `eddy`

A list of the works using (or at least citing) `eddy` can be found on [ADS](https://ui.adsabs.harvard.edu/abs/2019JOSS....4.1220T/citations).

repository: richteague/eddy

gha_language: Python

repo_name: richteague/eddy


text:
# Pancakeswap SDK

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Actions Status](https://github.com/pancakeswap/pancakeswap-sdk/workflows/CI/badge.svg)](https://github.com/pancakeswap/pancakeswap-sdk)
[![npm version](https://img.shields.io/npm/v/@pancakeswap-lib/sdk/latest.svg)](https://www.npmjs.com/package/@pancakeswap-lib/sdk/v/latest)

## V2 SDK for the BSC testnet

This is a fork of `@pancakeswap-libs/sdk-v2` modified to work on the BSC testnet against PancakeSwap V2 routers coupled with [`pancake-swap-interface-v1`](https://github.com/pancakeswap/pancake-swap-interface-v1).

Detailed instructions and the modified `pancake-swap-interface-v1` code can be found at [https://github.com/ibhagwan/pancake-swap-interface-v1](https://github.com/ibhagwan/pancake-swap-interface-v1).

### Building this SDK

Clone either this repository or the official one:
```
❯ git clone https://github.com/ibhagwan/pancakeswap-sdk-v2
```

- Modify `FACTORY_ADDRESS` & `INIT_CODE_HASH` in `src/constants.ts`
- Modify the testnet `WBNB` at the end of `entities/token.ts`:
    ```
    [ChainId.BSCTESTNET]: new Token(
        ChainId.BSCTESTNET,
        '0xae13d989dac2f0debff460ac112a837c89baa7cd',
        18,
        'WBNB',
        'Wrapped BNB'
    )
    ```

Build:
```
❯ yarn
❯ npm run build
```

### PancaeSwap V2, option #1 (default)
Router: [`0xD99D1c33F9fC3444f8101754aBC46c52416550D1`](https://testnet.bscscan.com/address/0xD99D1c33F9fC3444f8101754aBC46c52416550D1)

Factory: [`0x6725f303b657a9451d8ba641348b6761a6cc7a17`](https://testnet.bscscan.com/address/0x6725f303b657a9451d8ba641348b6761a6cc7a17)

WETH: [`0xae13d989dac2f0debff460ac112a837c89baa7cd`](https://testnet.bscscan.com/address/0xae13d989dac2f0debff460ac112a837c89baa7cd)

INIT_CODE_PAIR_HASH: `0xd0d4c4cd0848c93cb4fd1f498d7013ee6bfb25783ea21593d5834f5d250ece66`

### PancaeSwap V2, option #2
Router: [`0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3`](https://testnet.bscscan.com/address/0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3)

Factory: [`0xb7926c0430afb07aa7defde6da862ae0bde767bc`](https://testnet.bscscan.com/address/0xb7926c0430afb07aa7defde6da862ae0bde767bc)

WETH: [`0xae13d989dac2f0debff460ac112a837c89baa7cd`](https://testnet.bscscan.com/address/0xae13d989dac2f0debff460ac112a837c89baa7cd)

INIT_CODE_PAIR_HASH: `0xecba335299a6693cb2ebc4782e74669b84290b6378ea3a3873c7231a8d7d1074`


text:
---
title: "Covariance, Eigen Vectors and Principal Components - PCA Part 1/3"
date: 2017-03-10T19:59:42+05:30
---

## Covariance matrix:

[Here is a really good reference](http://www.visiondummy.com/2014/04/geometric-interpretation-covariance-matrix/) to build an intuition for covariance matrix

Also known as the variance-covariance matrix, holds information about how two random variables (in this case two features) vary with respect to one another

Covariance is a measure of how much two random variables vary together. It’s similar to variance, but where variance tells you how a single variable varies, co variance tells you how two variables vary together.

A covariance matrix summarizes the co-variances of a set of variables in a matrix

Where,

The operator **E** is the mean (expected value) of it's argument

##### Shape of covariance matrix:

The following figure illustrates the shape of data and their corresponding covariance matrix

Understanding the shape:

*Top-Left*:

σ(x, x) = 5 -> Variance of x w.r.t itself, i.e., variance of x

σ(x, y) = 4 -> Variance of x w.r.t y

σ(y, x) = 4 -> Variance of y w.r.t x

σ(y, y) = 6 -> Variance of y w.r.t itself, i.e., variance of y

This implies that x, y have a positive covariance, i.e., x increases as y increases

*Top-Right*:

σ(x, x) = 5 -> Variance of x w.r.t itself, i.e., variance of x

σ(x, y) = -4 -> Variance of x w.r.t y

σ(y, x) = -4 -> Variance of y w.r.t x

σ(y, y) = 6 -> Variance of y w.r.t itself, i.e., variance of y

This implies that x, y have a negative covariance, i.e., x decreases as y increases and vice-versa

*Bottom-Left*:

σ(x, x) = 5 -> Variance of x w.r.t itself, i.e., variance of x

σ(x, y) = 0 -> Variance of x w.r.t y

σ(y, x) = 0 -> Variance of y w.r.t x

σ(y, y) = 1 -> Variance of y w.r.t itself, i.e., variance of y

This implies that x, y have a zero covariance, i.e., x and y have no relationship. Also the variance of x is much higher than y giving the shape that we see where the data is spread out maximally in the x direction

*Bottom-Right*:

σ(x, x) = 1 -> Variance of x w.r.t itself, i.e., variance of x

σ(x, y) = 0 -> Variance of x w.r.t y

σ(y, x) = 0 -> Variance of y w.r.t x

σ(y, y) = 5 -> Variance of y w.r.t itself, i.e., variance of y

This implies that x, y have a zero covariance, i.e., x and y have no relationship. Also the variance of y is much higher than x giving the shape that we see where the data is spread out maximally in the y direction

### Eigenvectors of Covariance matrix:

I highly recommend watching this [video](https://www.youtube.com/watch?v=PFDu9oVAE-g) to get an intuition about eigen vectors

Eigen vectors are special vectors for a given matrix, which when multiplied by the matrix do not change their [span](https://www.youtube.com/watch?v=k7RM-ot2NWY) but change their scale or magnitude

Eigenvalues is the scale by which an eigenvector changes when multiplied by a given matrix.

In other words, for an eigen vector of a matrix, multiplying the vector with the matrix is the same as multiplying the vector with a scalar. The scalar being the eigen value

This equation can be represented as:

> **Property**: For a covariance matrix, the Eigenvector with the largest Eigenvalue points in the direction of maximal variance

Eigenvectors and eigenvalues for the covariance matrices described above

> Given a set of eigen vectors for the covariance matrix, the principal components are the eigen vectors with the largets eigen values

repository: aparna-k/blog-content

repo_name: aparna-k/blog-content


text:
| NuGet Packages                                                                  | Downloads
| :------------------------------------------------------------------------------ | :---------------------------------
| [InplaceEditboxlib](https://www.nuget.org/packages/Dirkster.inplaceeditboxlib)  | [![NuGet](https://img.shields.io/nuget/dt/Dirkster.inplaceeditboxlib.svg)](http://nuget.org/packages/Dirkster.inplaceeditboxlib)

# InplaceEditBoxLib
WPF/MVVM control to implement a textbox on top of other elements like a
TreeViewItem or ListViewItem (use case: perform in place edit of a displayed item)

[![Build status](https://ci.appveyor.com/api/projects/status/7g6bx6uku9e1qow8?svg=true)](https://ci.appveyor.com/project/Dirkster99/inplaceeditboxlib)
[![Release](https://img.shields.io/github/release/Dirkster99/inplaceeditboxlib.svg)](https://github.com/Dirkster99/inplaceeditboxlib/releases/latest)
[![NuGet](https://img.shields.io/nuget/dt/Dirkster.inplaceeditboxlib.svg)](http://nuget.org/packages/Dirkster.inplaceeditboxlib)

![Net4](https://badgen.net/badge/Framework/.Net 4/blue) ![NetCore3](https://badgen.net/badge/Framework/NetCore 3/blue)

# Use Case: Edit-In-Place

The edit-in-place text control contained in this project can be used as a base for developing applications where users would like to edit text strings as overlay over the normally displayed string.

The best and well known example of an edit-in-place text control is the textbox overlay that is used for renaming renaming a file or folder in Windows Explorer. The user typically selects an item in a list (listbox, listview, grid) or structure of items (treeview) and renames the item using a textbox overlay (without an additional dialog).

Change of focus (activation of a different window), pressing escapee leads to canceling of the rename process and pressing enter leads to confirmation of the new string.

# Editing with Text Overlay
Here is a sequence of screenshots that shows the normal steps when renaming an item with an overlay TextBox control:
![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/EditOverlay/Step1.png)

Press F2 to start renaming
![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/EditOverlay/Step2.png)

Type a different sequence of characters
![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/EditOverlay/Step3.png)

Press enter to confirm the new name
![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/EditOverlay/Step4_Result.png)

## Features ##

This edit-in-place control in this project can be used in the collection of any **ItemsControl** (Treeview, ListBox, ListView etc).

Find more details in CodeProject:
https://www.codeproject.com/Articles/802385/A-WPF-MVVM-In-Place-Edit-TextBox-Control

# Demo in this Repository
The demo program shows how the control can be used in a treeview with:

* keybinding - Press F2 to rename - Press ESC to cancel renaming

* Context Menu - Click Rename in context Menu to rename an item
* Double Click - Double click the text portion to start renaming

**Watch this video on youtube**
https://www.youtube.com/watch?v=iOiveZ214M0&feature=youtu.be

and Handling Errors, such as:

* Renaming with an invalid character (Press ? in Edit Mode to see a pop-up message)
* Attempting to name 2 items with the same name (Name 2 items 'a' should invoke a pop-up message on the 2nd items rename)
* Minimum and Maximum length of a name should between 1 - 254 Characters (naming item with empty string '' should invoke a pop-up message)

### Editing text with Text and DisplayText properties ###

The edit-in-place control has 2 string properties, one is for display (**DisplayText**) and the other (**Text**) string represents the value that should be edited.

This setup enables application developers to show more than just a name in each item. Each item can, for example, display a name and a number by using the **DisplayText** property, while the **Text** property should contain the string that is to be edit.

The confirmation of editing does not change either of the above dependency properties. The edit-in-place control executes instead the command that is bound to the **RenameCommand** dependency property to let the viewmodel adjust all relevant strings.

The view invokes the bound **RenameCommand** and passes the **RenameCommandParameter** as parameter along.

```XML
<EditInPlace:EditBox Text="{Binding Path=DisplayName, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
  DisplayText="{Binding Path=DisplayName,StringFormat={}{0} (File), Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
 ToolTip="{Binding Description, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
  Focusable="True"

  VerticalAlignment="Stretch"
  HorizontalAlignment="Left"
  IsReadOnly="{Binding IsItemReadOnly}"
  RenameCommand="{Binding Path=Data.RenameCommand, Source={StaticResource DataContextProxy}}"
  RenameCommandParameter="{Binding}"
  ToolTipService.ShowOnDisabled="True"

  Margin="2,0" />
```
The actual renaming (changing the data structure and checking for quality issues, such as, minimal length of string, is then performed by the code invoked in the viewmodel. The viewmodel can then choose to show an error notification and refuse the renaming or perform the renaming and close the process (see Demo in [SolutionViewModel.cs](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/source/SolutionLib/ViewModels/Browser/SolutionViewModel.cs)).

```C++
// Do we already know this item?
if (string.IsNullOrEmpty(newName) == true ||
  newName.Length < 1 || newName.Length > 254)
{
    solutionItem.RequestEditMode(RequestEditEvent.StartEditMode);
    solutionItem.ShowNotification("Invalid legth of name",
        "A name must be between 1 and 254 characters long.");
    return;
}

var parent = solutionItem.Parent;

if (parent != null)
{
    // Do we already know this item?
    var existingItem = parent.FindChild(newName);
    if (existingItem != null)
    {
        solutionItem.RequestEditMode(RequestEditEvent.StartEditMode);
        solutionItem.ShowNotification("Item Already Exists",
            "An item with this name exists already. All names must be unique.");
        return;
    }

    parent.RenameChild(solutionItem, newName);

    // This parent selection + sort + child selection
    // scrolls the renamed item into view...
    parent.IsItemSelected = true;
    parent.IsItemExpanded = true;   // Ensure parent is expanded
    parent.SortChildren();
    solutionItem.IsItemSelected = true;
...
}
```

### Initiate Editing Text from the ViewModel ###

The edit-in-place control expects the viewmodel to implement the **InplaceEditBoxLib.Interfaces.IEditBox** interface which contains a **RequestEdit** event. This event can be fired by the viewmodel to start editing of a given item.

### Initiate Editing Text from the View ###

Editing text from the view can be done directly by 'double click' on the text or via command binding on the viewmodel which invokres the **RequestEdit** event mentioned above.

See demo project with:
* Rename context menu item or
* F2 Key binding

### Usage of Limited Space ###

The EditBox in-place overlay control should not exceed the view port area of the parent scrollviewer of the items control. That is, the EditBox should not exceed the visible area of a treeview if it was used within a treeview. This rule ensure that users do not end up typing in an invisible area (off-screen) when typing long string in small areas.

The following sequence of images shows the application behavior when the user enters the string 'The quick fox jumps over the river' in a limited space scenario:

![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/SpaceLimits/Step1.png) ![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/SpaceLimits/Step2.png)
![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/SpaceLimits/Step1.png) ![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/SpaceLimits/Step4.png)
 ![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/SpaceLimits/Step5_Result.png)

### Cancel and Confirm ###

* Editing text with the edit-in-place control can be canceled by pressing the 'Esc' key or changing the input focus to another windows or control. The application shows the text as it was before the editing started.

* Editing text can be confirmed pressing the enter key. The application shows the entered text instead of the text before the editing started.

* Clicking on the background of the ItemsControl (TreeView, ListView etc) cancels the edit mode (thanks to Alaa Ben Fatma for useful hints).

### IsReadOnly property ###

The edit-in-place control supports a Boolean **IsReadonly** dependency property to lock individual items from being renamed. Default is **false** meaning every item is editable unless binding defines somtheing else.

### IsEditableOnDoubleClick ###

Editing the string that is displayed with the edit-in-place control can be triggered with a time 'double click'.
This double click can be configured to occur in a certain time frame. There are 2 double dependency properties that can be setup to consume only those double clicks with a time frame that is larger than **MinimumClickTime** but smaller than **MaximumClickTime**.

Default values for **MinimumClickTime** and **MaximumClickTime** are 300 ms and 700 ms, respectively.

The **IsEditableOnDoubleClick** boolean dependency property can be setup to dermine whether double clicks are evaluated for editing or not. Default is true.

### IsEditing property ###

The edit-in-place control supports a **one way** Boolean **IsEditing** dependency property to enable viewmodels to determine whether an item is currently edited or not. This property cannot be used by the viewmodel to force the view into editable mode (since it is a get only property in the view). Use the **RequestEdit** event defined in **InplaceEditBoxLib.Interfaces.IEditBox** to request an edit mode that is initialized by the viewmodel.

### Key Filter and Error Handling ###

The EditBox control contains properties that can be used to define a blacklist of characters that should not be input by the user. See properties:

- **InvalidInputCharacters**
- **InvalidInputCharactersMessage**
- **InvalidInputCharactersTitle**

The control implements a pop-up message element to show hints to the user if he types invalid characters.

![](https://github.com/Dirkster99/InplaceEditBoxLib/blob/master/00_Docu/00_Docu/ErrorHandling/PopUpMessage.png?raw=true)

## Known Limitations ##

- Key definitions entered in the in-place textbox cannot be defined through a white-list. The textbox does not support input masks.

- Restyling TextBox with Hyperlink does not work since a Hyperlink is stored in the InlineCollection of a TextBox. But an InlineCollection cannot be set via dependency property and I cannot seem to work around this with a custom dependency property.

# Credits #

- Thanks to Joseph Leung for coaching me along the way

- This code uses part of ATC Avalon Team's work:
http://blogs.msdn.com/atc_avalon_team/archive/2006/03/14/550934.aspx

- CodeProject Article "Editable TextBlock in WPF for In-place Editing"
http://www.codeproject.com/Articles/31592/Editable-TextBlock-in-WPF-for-In-place-Editing?fid=1532208&df=90&mpp=25&noise=3&prof=False&sort=Position&view=Normal&spc=Relaxed&fr=26#xx0xx

## Theming

Check theming here:
- [FileExplorer in Edi](https://github.com/Dirkster99/Edi/wiki/File-Explorer-Tool-Window)
- [MLib](https://github.com/Dirkster99/MLib)

Load *Light* or *Dark* brush resources in you resource dictionary to take advantage of existing definitions.

```XAML
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/InplaceEditBoxLib;component/Themes/DarkBrushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
```

```XAML
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/InplaceEditBoxLib;component/Themes/LightBrushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
```

These definitions do not theme all controls used within this library. You should use a standard theming library, such as:
- [MahApps.Metro](https://github.com/MahApps/MahApps.Metro),
- [MLib](https://github.com/Dirkster99/MLib), or
- [MUI](https://github.com/firstfloorsoftware/mui)

to also theme standard elements, such as, button and textblock etc.

gha_language: C#


text:
# CardGame
This is based off of the faproulette found here:
https://www.faproulette.co/3406/bdsm-card-game/

LINKS for the ALBUMS
The basic cards https://imgur.com/a/uh9sL
The combo cards https://imgur.com/a/d3pvN

This is currently a very simple program that allows you to draw a random card into your hand, and discard it at anytime.

#TODO
Add support for combo cards
Maybe add a timer in the app somehwere
Make the game aware of the cards. Currently each card object is just a picture with no defining characteristics. (i.e. point value or task)

repository: HaruharaHaruko/CardGame

repo_name: HaruharaHaruko/CardGame