text:
## Kronos

Kronos is a distributed service / library which can be used to provide
synchronized time in a cluster.

It provides an API to query "kronos time", which would be nearly same on all
kronos nodes in the cluster. It does not update system time.

- [What is Kronos?](#what-is-kronos)
- [Comparison with NTPD](#comparison-with-ntpd)
- [Design](#design)
- [Server Operation](#server-operation)
- [Usage](#usage)

## What is kronos
Kronos is a fault tolerant service / library which can be used to have
synchronized time in a cluster. The time provided by this service may be
different from system time, but it will be nearly the same on all nodes of the
cluster.

In a cluster each node has a local system clock which it uses for time.
There can be clock skews between nodes. Individual nodes can also have clock
jumps. Some services require a "global" timestamp for ordering of events,
and having a global view of time is difficult in a cluster.

Kronos solves above problems and has the following properties:
- It always serves monotonic time.
- It is immune to large jumps in system time (Go v1.9 onwards).
- It has the same rate of flow as real time.
- It returns nearly the same time on all the nodes (within a few ms).
- It is fault tolerant and works in the presence of node failures
- It requires only a quorum of nodes to be up.
- It supports addition / removal of nodes from the cluster.

This library also provides an "uptime" which is a distributed monotonic timer
starting from 0. This timer will not have backward jumps and not have forward
jumps in most cases. In rare cases it can have small forward jumps (in the order
of a few seconds). This "uptime" can be useful in measuring time durations when
the kronos service is live.

## Comparison with NTPD
The ntpd program is an operating system daemon which sets and maintains the
system time of day in synchronism with Internet standard time server
(http://doc.ntp.org/4.1.0/ntpd.htm)

Kronos and NTPD solve different problems. The objective of kronos is to
provide access to monotonic time which is guaranteed to be nearly the same
on all nodes in the cluster at all times (irrespective of changes to system
time). The key differences are

* Kronos provides an API to access time. It does not modify system time like
  NTPD.
* Kronos time is monotonic. NTPD is not resilient to backward system time jumps.
* Kronos time will not have large forward jumps (Go v1.9 onwards) since it
  uses CLOCK_REALTIME only for a reference point, and continues to use
  CLOCK_MONOTONIC to measure progress of time.
  NTPD does not prevent large system time jumps (forward / backward), but
  corrects those jumps after they happen. This correction can take a while.
* If a kronos node finds itself partitioned away from the cluster, it will stop
  serving time requests. Hence if kronos time is served by a node, it can be
  assumed to be accurate.
  The same cannot be said for system time. It is (almost) always accessible and
  there is no guarantee that it would be nearly the same as other nodes of the
  cluster.
* The time provided by kronos may not be same as system time / UTC time of
  any time server. It provides a guarantee of monotonicity and that it would
  always be nearly the same on all nodes of the cluster. Hence it should be
  used when the order of events is important, and not when the events
  actually happened.
  Hence this should be used in conjunction with NTPD which keeps system time
  in sync with an Internet standard time server (but can be prone to time
  jumps).
* Kronos does not attempt to measure RTT variance. It is not optimized for
  cross data-center deployments yet.
  NTPD can synchronize time cross data-center.

Kronos is not a replacement for NTPD. It's recommended to use NTPD in
conjunction with Kronos so that applications can choose which timestamp they
want to use (system time vs kronos time).

## Design
- **Time is always monotonic**
This is easy to ensure for a running service by storing the last served
timestamp in memory and flat-lining if a backward jump is detected.
To ensure monotonic time across restart, an upper bound to time is periodically
persisted (like current time +10s). This time cap is used to ensure monotonicity
across restarts.

- **It is immune to large jumps in system time**
  **It has the same rate of flow as real time**
Kronos uses CLOCK_MONOTONIC along with CLOCK_REALTIME.
CLOCK_REALTIME represents the machine's best-guess as to the current wall-clock,
time-of-day time.
CLOCK_MONOTONIC represents the absolute elapsed wall-clock time since some
arbitrary, fixed point in the past. It isn't affected by changes in the system
time-of-day clock.
CLOCK_MONOTONIC is used to compute progress of time from a fixed reference
picked from CLOCK_REALTIME.
Time used in kronos is given by
`local_time = (start_time + time.Since(start_time))`
`start_time` is a fixed point of reference taken from CLOCK_REALTIME.
`time.Since(start_time)` is the monotonic time since `start_time`.
Time used this way is immune to large system jumps and has the same rate of
flow as real time.
This is supported Go 1.9 onwards
https://github.com/golang/proposal/blob/master/design/12914-monotonic.md

- **Returns nearly the same time on all the nodes (within a few ms)**
**It is fault tolerant and works in the presence of node failures**
**It supports addition / removal of nodes from the cluster**
Kronos elects a single "oracle" from within the cluster. This oracle is a node
with which all nodes in the cluster periodically sync time. Periodic time
synchronization suffices since each node is immune to large system time jumps.
RPCs are used to synchronize time with the oracle.
Kronos time on each node is given as `local_time + delta`, where delta is the
time difference between kronos time this node and kronos time of the oracle. The
delta is updated during every synchronization with the oracle.
The oracle is elected using raft (distributed consensus protocol). Raft provides
a mechanism to manage a distributed state machine. Kronos stores the identity of
the current oracle and an upper bound to time (for safety reasons) in this state
machine.
Raft is failure tolerant and can continue to work as long as a quorum of nodes
are healthy. It also supports addition and removal of nodes to the cluster.

## Server operation
When a kronos server starts up, it first tries to initialize itself to find out
the current kronos time.
It does the following till it is initialized
1. If there is no current oracle
   1. Propose self as oracle
2. If self is the current oracle
   1. Wait to see if another initialized node becomes the oracle. Initialized
      nodes have the correct kronos time and should get preference to become
      the oracle
      1. If no nodes becomes the oracle
         1. If a backward jump is detected (since this node has no delta
             information)
            1. Continue time from time cap
         2. Propose self as oracle
3. If self is not the oracle, sync with the current oracle
   1. If the the current oracle is down
      1. Propose self as oracle

When proposing self as oracle, the server proposes itself as the new oracle and
a new time cap to the state machine managed by raft. Raft guarantees
serializability so CAS (compare and set) operations are used to manage this
state machine.
Once the server is initialized, it operates as follows
1. If self is the current oracle
   1. Continue proposing self as oracle
2. If self is not the oracle, sync with the current oracle
   1. If the the current oracle is down
      1. Propose self as oracle

**Syncing time with the oracle**
Time synchronization with the oracle happens over RPCs. Kronos has a limit on
the RTT allowed for this RPC for it to be considered valid. The goal is to keep
the kronos time of the follower in sync with kronos time of the oracle.
![Time sync with oracle](docs/media/kronos_sync.png?raw=true "Time sync with oracle")

Let's say a follower requests the oracle for its kronos time at ts
and receives a response at te (where ts is the kronos time
of the follower), and the oracle responds with to.
Time needs to be adjusted taking RTT into account. The true oracle time will lie
between to and to + RTT

If tf does not lie within this interval, delta is adjusted so that it
falls into this interval (kronos time on follower is given as local_time + delta
with oracle).

**Cluster operations**
Addition and removal of nodes entail addition and removal of nodes from the raft
cluster. A kronos node maintains metadata about itself and its view of the
cluster locally in a file.
Each kronos server is passed a list of kronos seed hosts which it can use to
initialize itself.
When a new kronos node is started, it assigns itself a NodeID and requests the
seed hosts to add this new node to the raft cluster. Once this request succeeds,
it joins the raft cluster and continues its usual operations.
Seed hosts are not necessary for subsequent restarts of a node since each node
has a local view of the cluster, but can be used in order to ramp up a node
which has been down for a long time.

## Usage
Kronos can be used as a standalone service or embedded in another service
as a library.

Kronos requires Go version 1.9+ for immunity against large clock jumps.

**Install**
- Install Go version >= 1.15
- Clone the repository `git clone https://github.com/rubrikinc/kronos.git && cd kronos`

**Build/Test**
- Build kronos: `make build` creates a kronos binary.
- Run unit tests: `make test`
- Run acceptance tests: `make acceptance`

`kronos help` can be used to get information on subcommands.

**Starting a kronos server**
The below are example commands to create a kronos cluster
- Log and data directory have to be created
- The IPs used are <IP_ADDRESS>. For multi node clusters, the IP of different nodes
  can be used.
```
Server 1
./kronos \
  --log-dir ./log0\
  start\
  --advertise-host <IP_ADDRESS>\
  --raft-port 5766\
  --grpc-port 5767\
  --pprof-addr :5768\
  --data-dir ./data0\
  --seed-hosts <IP_ADDRESS>:5766,<IP_ADDRESS>:6766

Server 2
./kronos \
  --log-dir ./log1\
  start\
  --advertise-host <IP_ADDRESS>\
  --raft-port 6766\
  --grpc-port 6767\
  --pprof-addr :6768\
  --data-dir ./data1\
  --seed-hosts <IP_ADDRESS>:5766,<IP_ADDRESS>:6766

Server 3
./kronos \
  --log-dir ./log2\
  start\
  --advertise-host <IP_ADDRESS>\
  --raft-port 7766\
  --grpc-port 7767\
  --pprof-addr :7768\
  --data-dir ./data2\
  --seed-hosts <IP_ADDRESS>:5766,<IP_ADDRESS>:6766
```
Kronos servers discover each other based on seed hosts (which is the raft
address of some nodes of the cluster)

Time (In Unix Nanos) can be queried using `kronos time` and status can be
queried using `kronos status`. If the default ports (5766, 5767) are not being
used, they need to be passed as arguments to time / status commands. For example
```
./kronos time --grpc-addr=<IP_ADDRESS>:5767
1536315057173673605

./kronos status --raft-addr <IP_ADDRESS>:5766 --all                                                                                kronos ✚ ✱ ◼
Raft ID           Raft Address    GRPC Address    Server Status  Oracle Address  Oracle Id  Time Cap             Delta  Time
a7041e2396dec1e3  <IP_ADDRESS>:5766  <IP_ADDRESS>:5767  INITIALIZED    <IP_ADDRESS>:5767<PHONE_NUMBER>306176477839  0s<PHONE_NUMBER>559974475
b2300f5e4ece5750  <IP_ADDRESS>:7766  <IP_ADDRESS>:7767  INITIALIZED    <IP_ADDRESS>:5767<PHONE_NUMBER>306176477839  0s<PHONE_NUMBER>560100423
c56aec267a57d604  <IP_ADDRESS>:6766  <IP_ADDRESS>:6767  INITIALIZED    <IP_ADDRESS>:5767<PHONE_NUMBER>306176477839  0s<PHONE_NUMBER>560047515
```

**Removing a node from the cluster**
A node can be removed using
`./kronos cluster remove <Raft ID>` where Raft ID is the id in `kronos status`

**Embedding kronos**
A kronos server can be started in a go application by using
```go
import(
	"github.com/rubrikinc/kronos"
	"github.com/rubrikinc/kronos/oracle"
	"github.com/rubrikinc/kronos/pb"
	kronosserver "github.com/rubrikinc/kronos/server"
)

  if err := kronos.Initialize(ctx, kronosserver.Config{
    Clock:                    tm.NewMonotonicClock(),
    OracleTimeCapDelta:       kronosserver.DefaultOracleTimeCapDelta,
    ManageOracleTickInterval: 3 * time.Second,
    RaftConfig: &oracle.RaftConfig{
      CertsDir: certsDir,
      DataDir:  kronosDir,
      GRPCHostPort: &kronospb.NodeAddr{
        Host: advertiseHost,
        Port: serverCfg.KronosGRPCPort,
      },
      RaftHostPort: &kronospb.NodeAddr{
        Host: advertiseHost,
        Port: serverCfg.KronosRaftPort,
      },
      SeedHosts: seedHosts,
    },
  }); err != nil {
    return err
  }

  // call kronos.Stop() in shutdown
  // call kronos.Now() for kronos time
```

**Client example**
An example of a `go` client usage
```go
import (
	"context"
	"fmt"

	"github.com/rubrikinc/kronos/kronosutil/log"
	"github.com/rubrikinc/kronos/pb"
	"github.com/rubrikinc/kronos/server"
)

func main() {
	ctx := context.Background()

	c := server.NewGRPCClient("" /* certs dir */)
	// Similar to below, KronosUptime endpoint can be used to get uptime.
	timeResponse, err := c.KronosTime(ctx, &kronospb.NodeAddr{
		Host: "<IP_ADDRESS>", /* IP of kronos server */
		Port: "5767", /* GRPC port of kronos server */
	})

	if err != nil {
		log.Fatal(ctx, err)
	}

	fmt.Println(timeResponse.Time)
}
```

Clients can also be created for other languages by generating GRPC clients
for TimeService in `pb/kronos.proto`

**TLS Support**
Kronos supports TLS. The certificates directory can be passed using --certs-dir
or set using the environment variable `KRONOS_CERTS_DIR`.
The CA and node certs can be created using something similar to
https://www.cockroachlabs.com/docs/stable/create-security-certificates.html

repository: rubrikinc/kronos

gha_language: Go

repo_name: rubrikinc/kronos


text:
# react-environment-settings

> Load environment settings for react asynchronously at runtime

[![NPM](https://img.shields.io/npm/v/react-environment-settings.svg)](https://www.npmjs.com/package/react-environment-settings) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-environment-settings
```

## Usage

```tsx
import React from "react";

import AppSettingsLoader from "react-environment-settings";
import settingsAssetUrl from "./settings.json.txt";

interface Settings {
  data: string;
}

const App = () => {
  return (
    <div className="root">
      <AppSettingsLoader<Settings>
        settingsUrl={settingsAssetUrl}
        loading={() => <div>Loading settings...</div>}
        ready={s => <pre>{JSON.stringify(s, null, 2)}</pre>}
      />
    </div>
  );
};

export default App;
```

## License

MIT © [daniellittledev](https://github.com/daniellittledev)

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: TypeScript

license_type: permissive


text:
# Exercise 9.21

Assuming `c1` and `c2` are containers, what constraints does the following usage place on the element types in `c1` and `c2`?

`if (c1 < c2)`

What, if any, constraints are there on `c1` and `c2`?

**Answer**:

1. The containers must be the same kind of container and must hold elements of the same type.
2. The relational operators `<` should be defined with the element types of these containers.


text:
# ScriptsLoader
Pure JavaScript scripts loader with dependencies and uniqueness check

## Install
```html
<script src="/js/scripts_loader.js"></script>
```

## Use
    // Define the dependency
    var dependencyForest = [{
      '//code.jquery.com/jquery-1.11.0.min.js': {
        '//code.jquery.com/ui/1.11.2/jquery-ui.min.js': '/js/demo_scripts/script_based_on_jquery_ui.js',

        // will not load again '//code.jquery.com/jquery-1.11.0.min.js', but its child
        '//code.jquery.com/jquery-1.11.0.min.js': '/js/demo_scripts/script_based_on_jquery.js'
      },
      '//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js': [
        '//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.8/angular-cookies.min.js',
        '//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.8/angular-animate.js'
      ]
    }];

    // Load the scripts
    ScriptsLoader(dependencyForest, function(scriptsLoaded) {
      console.log('Done. The following scripts were loaded:');
      console.log(Object.keys(scriptsLoaded).join('\n'));
    });

## Features
1. Loads the scripts according the dependencies so the chidren will be loaded only after the parent was loaded.
2. Doesn't load scripts with the same path. In this case it skips a script was loaded and proceeds to its children.
3. A callback can be provided to be called when all the scripts are loaded.
4. The callback recieves a hash with the src's as its keys (and true as a value).

## Demo/Playground:

http://jsbin.com/sebaxipuma/2

repository: MargalitBennun/ScriptsLoader

repo_name: MargalitBennun/ScriptsLoader


text:
# nwu-acm-mis-backend

## Requirements install
```
conda activate your_env_name
```
```
pip install -r requirements.txt
```

## Modify e-mail address

**./NWU_ACM_MIS/config.py**

EMAIL_HOST_USER = f'your NWU e-mail address'

EMAIL_HOST_PASSWORD = 'your password'

## Datebase migrate
```
python manage.py makemigrations
python manage.py migrate
```
## Run
```
python manage.py runserver
```

## Crate superuser
```
python manage.py createsuperuser
```

repository: MIXISAMA/NWU-ACM-MIS-backend

branch_name: refs/heads/main

gha_language: Python

gha_license_id: MIT

repo_name: MIXISAMA/NWU-ACM-MIS-backend


text:
# Binary Search Tree and Traversals

Class Bst implements Binary Search tree and tree traversal algorithms

Class BstIterator implements an iterator to visit the tree nodes in in-order fashion

Structure of each node is defined in class Node.

Methods/ Operations Implemented:

	public void insert(int value) - Inserts a new Node with specified value in the BST

	public void inOrder() - Prints In Order traversal of tree.

	public void preOrder() - Prints Pre Order traversal of tree.

	public void postOrder() - Prints Post Order traversal of tree.

	public void levelOrder() - Prints Level Order Traversal of tree.

	public Node search(int value) - Searches a Node with specified value in the tree

	public void delete(int value) - Delete Node with specified value from the BST

	protected Node findSucc(Node n) - Returns In Order successor of specified node

	public boolean isValidBst() - Returns true if tree is a valid Binary Search Tree.
								  Returns false otherwise

	public int getHeight(Node n, boolean[] isBalanced) - Returns node's height (assuming height of leaf is 1) and checks 													  if tree is balanced
	 													 Parameters: node, whose height is to be found
				   										isBalanced (one element boolean array) - initially this flag must be supplied as true.
	 													If the tree is balanced, isBalanced will remain true after execution of this method. Otherwise, isBalanced would be false

    public boolean isBalanced() -  Calls getHeight and returns flag indicating whether tree is balanced
								   Returns true if tree is balanced, false otherwise
								   Prints height of tree

Iterator Methods:

	public Node next() - Returns next tree node

	public boolean hasNext() - Returns true if there is at least one more element that has not been visited
							   Returns false otherwise

repository: rohitkhilnani/Java-holic

gha_language: Java

repo_name: rohitkhilnani/Java-holic


text:
---
title: "algorithm-analysis-course homework week fifteen"
layout: post
date: 2018-12-15 17:22
image: /assets/images/markdown.jpg
headerImage: false
tag:
- markdown
- elements
star: true
category: blog
author: junior huang
description: homework for algorithm analysis
---

## most popular problems on leetcode

![](./image/leetcode-week-15-2.png)

## intro of the question
the problem is that
```
Given a linked list, remove the n-th node from the end of list and return its head.
Example:
Given linked list: 1->2->3->4->5, and n = 2.

After removing the second node from the end, the linked list becomes 1->2->3->5.
Note:
Given n will always be valid.
Follow up:
Could you do this in one pass?
```

## prove of work

so this the problem of this week,this problem is all about the lisNode.which is an import data structure of our daily coding because it have some advantake in storage and its very fast to delete or add node in the middle of array.

![](./image/leetcode-week-15-1.png)

and here is the code
```
# Definition for singly-linked list.
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self.next = None

class Solution:
    def removeNthFromEnd(self, head, n):
        """
        :type head: ListNode
        :type n: int
        :rtype: ListNode
        """
        before_delete = head
        n_after_before_delete = head
        for x in range(n):
            n_after_before_delete = n_after_before_delete.next
        if n_after_before_delete ==None:
            return head.next
        while True:
            if n_after_before_delete.next== None:
                before_delete.next = before_delete.next.next
                return head
            before_delete=before_delete.next
            n_after_before_delete=n_after_before_delete.next

```

i have to say this result is probably the fastest code i ever done in leetcode. beat almost a hundred percent people who have done this problem.

and the key is that since this problem is kind of simple,so you have to make decision about the best time complexity.

and since its a linked list,and you will have check the all list to find the least n-th node.

so no matter what,the solution(if exists)should one traverse of the whole linked list.

so there is a direction to make the best algorithm now.

and here i present the somehow useful tool called cursor.which is used very offen in linkedlist problem.

the term cursor means that not like always you using one pointer point to the current node and one by one you can check if this node is what you want,then you can add node of remove the next node.

for the cursor it means it keeps two different pointer which keeps the constant distance between each other.

as for how can you make sure it always keeps the same distance is that in the initialize phrase,you set the two pointer at constant distance then you move the two pointer at the same time so you can keep the same distance at always.

for this problem,you will know that the bigest problem is that how can you fine the n-th least node during one traverse,and here we can use cursor to do that,once the later cursor comes to the end which is none,then it means the before cursor point to the right node then you can delete the afterwards node then.

repository: huangjundashuaige/huangjundashuaige

repo_name: huangjundashuaige/huangjundashuaige


text:
# PyWPS 4.0 Advanced Features Presentation

Presentation to be used for various talks, conferences and other events.

The source of the presentation is written using
[LaTeX](http://docutils.sourceforge.net/rst.html), it must be compiled on your
development environment.

* To obtain the PDF document of the presentation, install a programme like
* `pdflatex` and run:
```
pdflatex pywps-presentation-advanced
```

* do not forget to change the author, date and event in the cover slide.

repository: PyWPS/pywps-presentation-advanced

repo_name: PyWPS/pywps-presentation-advanced


text:
---
comments: true
date: 2011-09-29 14:37:44
layout: post
slug: harmonizing-every-scale-with-python
title: Harmonizing every scale with Python
categories:
- python
---

I was advising some students the other day about harmonizing
non-traditional scales and someone mentioned how it would be useful to
have a list of harmonizations for every possible scale. I bragged that
I could write a program in half-hour to accomplish it. Of course it
took longer than that, but I quickly wrote a small python program to
generate harmonizations for every possible scale and used [LilyPond]
to typeset them.

<!-- more -->

The harmonization for the major scale is pretty simple; you stack
notes vertically following every other note in the scale:

![](/images/2011/09/scale.png)

In modern music it's fairly common to use non-traditional scales to
generate new and interesting harmonies. For instance, in the example
bellow I have a 7-note scale that is very different from the good ol'
major scale. Right after the scale we have harmonizations for every 3,
4, and 5 notes of the scale. Also notice that we break the thing about
having the interval in which we pick notes be the same of the
horizontal notes (that is, having chords in thirds, fourths, and so
on). This leads to very interesting harmonies.

![](/images/2011/09/Escalas.png)

By the way, this is one of the reasons I got into programming in the
first place; to generate material to use in my [compositions] (using
Pascal back in the 90's, if you must know).

So, in order to harmonize every scale we need to know how many scales
exist and the answer will vary depending to whom you ask. In a way a
scale is an ordered set of notes, so I used the 129 [pitch class sets]
with cardinality greater than 5. [Here] is a complete list of all
pitch class sets. Some people will find that using [prime forms] is
too condensed and doesn't take in account a bunch of scales, but it'll
do for the purpose of this post.

The code to generate the harmonizations is actually very simple (with
the help of my in-progress [python library]). We harmonize the first
note of a scale with `harmonize_first_note` and use it in a list
comprehension to harmonize every note of the scale. The helper
function rotate_set will generate every rotation of a list.

    def harmonize_first_note(scale, interval, size):
        i = (interval - 1)
        indexes = [x % len(scale) for x in range(0, size * i, i)]
        return [scale[index] for index in indexes]

    def harmonize_scale(scale, interval, size=3):
        scales = musiclib.rotate_set(sorted(scale))
        return [harmonize_first_note(scale, interval, size) for scale in scales]

Here's how we use it: A scale is defined as a list of integers (we are
using [integer notation]). Let's put the major scale in a variable:

    scale = [0, 2, 4, 5, 7, 9, 11]

The result of `harmonize_first_note` will be, as expected, just the
first chord (C major) as a list of integers:

    harmonize_first_note(scale, 3, 3)
    >>> [0, 4, 7]

And the result of `harmonize_scale` will be a list with the
harmonization of every chord in the scale. In the next example I'm
using 4 as the chord size to generate tetrads:

    harmonize_scale(scale, 3, 4)
    >>> [[0, 4, 7, 11], [2, 5, 9, 0], [4, 7, 11, 2], [5, 9, 0, 4],
         [7, 11, 2, 5], [9, 0, 4, 7], [11, 2, 5, 9]]

Finally, lets generate tetrads separated by fourths instead of thirds:

    harmonize_scale(scale, 4, 4)
    >>> [[0, 5, 11, 4], [2, 7, 0, 5], [4, 9, 2, 7], [5, 11, 4, 9],
         [7, 0, 5, 11], [9, 2, 7, 0], [11, 4, 9, 2]]

The code to generate the LilyPond file is boring, so I won't talk
about it here. You can see it in the [repository].

Generating harmonizations for every scale is interesting and all, but
it start to get interesting when we can filter things. For instance, I
may want to generate harmonizations for the scales that have more than
4 notes and have consecutive intervals greater than 1 semitone. This
can be accomplished with filter_sets. This is how I'd express the
previous example:

    filter_sets(lambda intervals, size: size > 4 and 1 not in intervals)

The function filter_sets accepts an anonymous function with a list of
the consecutive intervals in a set and the size of a set as
parameters. If the condition in the body of the anonymous function is
met the set is returned:

    def filter_sets(condition):
        sets = {}
        for forte, pc_set in musiclib.PC_SETS.items():
            intervals = musiclib.intervals(pc_set)
            size = len(pc_set)
            if condition(intervals, size):
                sets[forte] = pc_set
        return sets

This is an example of how high-order functions can be used to abstract
code. Also, the built-in function all is very handy to chain
conditions. Let's say I want to get scales that have more than 4 notes
and have only 1 consecutive halftone and 1 consecutive whole tone:

    filter_sets(lambda i, s: all([s > 4, i.count(1) == 1,
                                  i.count(2) == 1]))

Since I want to filter scales by interval content, it makes sense to
write a small function to help me. `cond_interval_count` abstracts the
previous code:

    def cond_interval_count(count_list):
        return lambda i, s: all([i.count(interval) == count for
                                 count, interval in count_list])

So if I want the scales that have no consecutive halftones and only 1
consecutive whole tone I can write it as:

    cond = cond_interval_count(((0, 1), (1, 2)))
    filter_sets(cond)

There are a few things that can be improved:

  * Use some pitch spelling algorithm, like ([Meredith, 2003]) so we
    won't have chords like C, D#, G

  * Have better functions for filtering. The function I'm using looks
    for consecutive intervals but it would be better to search for
    every interval in the Pitch Class Set.

  * Handle octaves better in the LilyPond generation. Some notes would
be better on a different octave:

![](/images/2011/09/Oitava-errada.png)

This post only scratches the surface of all things we can do. For
anything more complicated than that I'd use [music21], a nice and
professional Python library for computer-aided musicology. But it's
interesting too see how far we can go with a few dozen lines of pure
Python code and the use of nice abstractions.

If you have an interest in this kind of thing, there are lots of
[Python packages] for music programming and
[Notes from the Metalevel: An Introduction to Computer Composition] is
a nice book about the topic (but it uses Scheme, not Python for the
code).

<!-- Links -->

[LilyPond]: lilypond.org/
[compositions]: http://pedrokroger.com/compositions/
[pitch class sets]: http://en.wikipedia.org/wiki/Set_theory_(music)
[Here]: https://github.com/kroger/musiclib/blob/master/musiclib/pc_sets.py
[prime forms]: http://www.jaytomlin.com/music/settheory/help.html#primeform
[python library]: https://github.com/kroger/musiclib
[integer notation]: http://en.wikipedia.org/wiki/Pitch_class#Integer_notation
[repository]: https://github.com/kroger/scales/blob/master/scales.py#L32
[Meredith, 2003]: http://citeseer.ist.psu.edu/viewdoc/summary?doi=<IP_ADDRESS>.8569
[music21]: http://mit.edu/music21/
[Python packages]: http://wiki.python.org/moin/PythonInMusic
[Notes from the Metalevel: An Introduction to Computer Composition]: http://www.amazon.com/Notes-Metalevel-Introduction-Computer-Composition/dp/9026519753

extension: markdown


text:
# Music

![Swift Version](https://img.shields.io/badge/Swift-5.x-orange.svg)
![Platforms](https://img.shields.io/badge/platform-linux%20%7C%20macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg)
[![Build Status](https://travis-ci.org/dn-m/Music.svg?branch=latest)](https://travis-ci.org/dn-m/Music)

Structures for the creation, analysis, and performance of music in Swift. Check out the [documentation](https://dn-m.github.io/Packages/Music).

## Overview

`Music` is a package for anyone who wants to create, analyze, and perform music in pure Swift.

## Usage

### 🎶 Pitch

The [`Pitch`](https://github.com/dn-m/Music/tree/latest/Sources/Pitch) module provides types for structuring and transforming the frequency domain.

#### Basic Types

```swift
let a440: Frequency = 440    // Hz
let middleC: Pitch = 60      // MIDI note number
let e = middleC + 4          // e above middle c
let microtone = e - 0.25     // eighth-tone below the e above middle c
let anyE = Pitch.Class(e)    // pitch class 4
let anyGSharp = anyE.inverse // pitch class 8
```

#### Set Operations

```swift
let set: Pitch.Class.Collection = [8,0,4,6]
set.normalForm // => [4,6,8,0]
set.primeForm  // => [0,2,4,8]
```

#### Row Transformations
```swift
let pcs: Pitch.Class.Collection = [0,11,3,4,8,7,9,5,6,1,2,10]
pcs.retrograde // => [10,2,1,6,5,9,7,8,4,3,11,0]
pcs.inversion  // => [0,1,9,8,4,5,3,7,6,11,10,2]
```

#### Diatonic Intervals

```swift
let majorThird: DiatonicInterval = .M3
let minorSixth = majorThird.inverse
let AAA3 = DiatonicInterval(.triple, .augmented, .third)
let noSuchThing = DiatonicInterval(.major, .fifth) ❌ will not compile!
```

---

### ♬ Duration

The [`Duration`](https://github.com/dn-m/Music/tree/latest/Sources/Duration) module provides types for structuring and transforming the time domain.

#### Basic Types

```swift
let crotchet = Duration(1,4)
let waltz = Meter(3,4)
let stayinAlive = Tempo(100, subdivision: 4)
```

---

### 🎚 Dynamics

The `Dynamic` module provides ways to describe musical loudness in a highly subjective way.

```Swift
let loud: Dynamic = .ff
let quiet: Dynamic = .p
let interp = Dynamic.Interpolation(from: .p, to: .ff)
```

---

### 🥁 Articulations

The `Articulation` type provides an interface to describe the way in which a given musical entity is performed.

```Swift
let short: Articulation = .staccato
let sweet: Articulation = .tenuto
let hard: Articulation = .marcato
let hereIAm: Articulation = .accent
```

---

### 💾 MusicModel

The `Model` brings all of elements together from the modules contained in this package.

```Swift
let builder = Model.Builder()
let performer = Performer(name: "Pat")
let instrument = Instrument(name: "Euphonium")
let voiceID = builder.createVoice(performer: performer, instrument: instrument)
let pitch: Pitch = 60
let articulation: Articulation = .tenuto
let dynamic: Dynamic = .fff
let note = Rhythm<Event>(1/>1, [event([pitch, dynamic, articulation])])
let rhythmID = builder.createRhythm(note, voiceID: voiceID, offset: .zero)
let model = builder.build()
```

---

## Requirements

In order to use the `Music` package, you'll need a few things:

- Swift 5.x Toolchain (Xcode 10.2–11, or [here](https://swift.org/download/))
- [Swift Package Manager](https://swift.org/package-manager/)

## Installation

In order to use the `Music` modules in your own projects, add it to the `dependencies` section of your `Package.swift` file:

```Swift
let package = Package(
    name: ...,
    products: [ ... ],
    dependencies: [
        ...,
        .package(url: "https://github.com/dn-m/Music", from: "0.17.1")
    ],
    targets: [ ... ]
)
```

## Development

To contribute to the `Music` package, clone the `git` repository:

```
git clone https://github.com/dn-m/Music && cd Music
```

If you use the Xcode IDE on macOS, you can use SwiftPM to generate an `.xcodeproj` file:

```
swift package generate-xcodeproj
```

## Inspiration

Here are some libraries in other languages that have been influential to the design of the `Music` package:

- [Abjad](http://abjad.mbrsi.org) (Python)
- [Music21](http://web.mit.edu/music21/) (Python)
- [Haskore](https://wiki.haskell.org/Haskore) (Haskell)
- [Mezzo](http://hackage.haskell.org/package/mezzo) (Haskell)
- [GUIDO](http://science.jkilian.de/salieri/GUIDO/index.html) (C++)

repository: dn-m/Music

branch_name: refs/heads/latest

gha_language: Swift

repo_name: dn-m/Music


text:
# LJ code 201 day 9

Today was almost defeating. I made a stand alone function that needed to be above a function to let the below function render, but it also needed to be below that function because it needed stuff from the above function.
function 1 // runs to make an array needed by function 2
function 2 // uses arrays to make a table
function 1 // needs function 2 to run to make objects with data that function 1 needs to use

I changed the stand alone function to a prototype of the object but still had problems.

This is the problem I see with dynamic functions. Especially when code is happening/defined at one point in your file that you need to see how it plays with what you're working on.

I also got a free tshirt. This did not compensate for the troubles I had.

## Code review
In multi-line strings, "wrap" it by concatenating strings on separate lines OR use the escape key (\) at the end of each line break.

When a language can pass in functions as an argument, they are called higher-order functions or first-class functions.

event.target.someTarget.value and
document.getElementById('some_id').value + an extra id in html
get the same thing.

### Wireframe practice
http://codepen.io/anon/pen/qqqxoQ?editors=1010#0

## Why use 'use strict'?
'Use strict' helps keep track of the scope of variables. For example, without 'use strict', if a variable wasn't declared in a function, JS would make an assumption and declare it on the global scope, obviously tricky. It also keeps 'this.' in line/within its scope. Otherwise 'this.' would set/give access to the window.

## CSS positioning
Relative position stays in the flow of the document, and is relative (left, right, up, down) to where it would normally be.
Everything but static is said to be positioned. TRBL doesn't apply to static.
Static and relative take up 'space', share attributes?
Fixed and absolute don't take up 'space' on the page.
Absolute is kinda like fixed, different from if it's ancestor is defaulted to the window or it's ancestor element who is positioned.
Use absolute to sit on top of something else, especially for pop-ups.

float gets block elements to sit next to each other
floats, positioning, box element, display, how to get a good grip on layout

### Examples
http://codepen.io/anon/pen/VmmyLW
http://codepen.io/anon/pen/VmmyMy?editors=1100

repository: cmd-kvn/daily-learning-journals

repo_name: cmd-kvn/daily-learning-journals


text:
# Flex
[Flex](http://www.templatemo.com/live/templatemo_406_flex) is HTML5 fast and fluid responsive layout created by [Templatemo](http://www.templatemo.com/).

This is a port for [OctoberCMS](https://octobercms.com/).

## Installation
`$ php artisan theme:install martin.flex <theme>`

Replace `<theme>` with the name of your theme.

## Using the theme
`$ php artisan theme:use <name>`

Where `<name>` is whatever you specified in `theme:install`.

repository: yangzhipeng/halo

repo_name: yangzhipeng/halo


text:
## Overview

Join two KGTK edge files or two KGTK node files.

### Summary

* The output file contains the union of the columns in the two
input files, adjusted for predefined name aliasing.
* Specify `--left-join` to get a left outer join.
* Specify `--right-join` to get a right outer join.
* Specify both to get a full outer join (equivalent to [`kgtk cat`](../cat)).
* Specify neither to get an inner join.
* By default, node files are joined on the id column, while edge files are joined on the node1 column. The label and node2 columns may be added to the edge file join  criteria.  Alternatively, the left and right file join columns may be
  listed explicitly.
* Join keys are extracted from one or both input files and stored in memory, then the data files are processed in a second pass.  Performance will be poor, and execution may fail, if the files are very large.
* stdin will not work as an input file if join keys are needed from it.

### Uses for Join

 * to assemble edges from different files, building an
   enriched set of relationships for selected subjects (`node1` values).

 * to assemble additional columns from different files,
   building an enriched set of additional columns for selected edges or nodes.

 * to select a smaller set of edges (or nodes) from a larger set, to
   improve the performance of future processing steps by eliminating
   unwanted edges (or nodes).

 * to perform a logical (set) operation on two sets of edges or nodes.

     * intersection (inner join, defined below)
     * union (outer join, defined below; also, [`kgtk cat`](../cat))

### Left and Right Input Files

`kgtk join` takes two KGTK edge or node files (called `left` and `right`, in a nod to relational
database terminology) and produces a new KGTK edge or node file that contains
a selection of the edges or nodes from the two input files.

The following combinations are accepted:

 * both input files are KGTK edge files, or
 * both input files are KGTK node files, or,
 * at least one input file is a quasi-KGTK file (indicated by the expert options `--mode=NONE`,
   `--left-mode=NONE`, and `--right-mode=NONE`).

### Join Types

Following the terminology used for relational databases:

| Join Type | Indicated by | Description |
| ----      | --- | ----- |
| inner join | | The output file contains only left and right edges or nodes that satisfy the matching criteria discussed below.  This is equivalend to a logical intersection. |
| left join | `--left-join` | The output file contains all of the left edges or nodes, and only the right edges or nodes that satisfy the matching criteria. |
| right join | `--right-join` | The output file contains all of the right edges or nodes, and only the left edges or nodes that satisfy the matching criteria. |
| outer join | `--left-join --right-join` | The output file contains all edges or nodes from both input files.  This is equivalend to a logical union, or [`kgtk cat`](../cat) |

### Duplicate Edges or Nodes

If either input file contains duplicate edges or nodes, or the two input files contain
copies of the edge or node, and these edges or nodes are selected for inclusion in the output file,
then the output file will contain duplicate edges or nodes.

The command [`kgtk compact`](../compact) can be used to remove duplicate
edges or nodes from the output file.

### Joining Normalized Edges

A normalized KGTK edge file contains only the following columns:

 * `node1` (or its alias)
 * `label` (or its alias)
 * `node2` (or its alias)
 *  optionally `id` (or its alias)

The `label` column typically expresses a relationship between the values
(symbols, strings, numbers, etc.) in the `node1` and `node2` columns.

If the two input files to `kgtk join` contain only normalized edges then the output file will contain only normalized edges.

### The Optional `id` Column

The `id` columns is optional in KGTK edge files.  It is required in KGTK node files.

 * If either input file contains an `id` column, then the output file will
contain an `id` column.

 * If an `id` column is missing from an input file, the corresponding edges
in the output file will have empty `id` values.

 * Existing `id` column values will not be checked for duplication.

!!! note
    See [`kgtk add-id`](../add_id) if you wish to generate new `id` column values or
    manipulate existing `id` column values.
    [`kgtk calc`](../calc) may also be useful for modifying `id` column values.

### Joining Edge Files on `node1` Alone

By default, `kgtk join` matches the `node1` column (or its alias) in the `left` input edge
file to the `node1` column (or its alias) in the `right` input edge file.  The goal is to
gather relationships, expressed by the `label` and `node2` columns, pertaining to
specific `node1` objects.

Left input files:

| node1 | label | node2 |
| ----- | ----- | ----- |
| block1 | isa | block|
| block1 | color | red |

Right input file:

| node1 | label | node2 |
| ----- | ----- | ----- |
| block1 | isa | block|
| block1 | size | large |

Output file after joining on `node1`:

| node1 | label | node2 |
| -- | -- | -- |
| block1 | isa | block|
| block1 | color | red |
| block1 | isa | block|
| block1 | size | large |

The left and right edges will remain distinct in the output file,
leading to duplicate edges (`block1 isa block`).

[`kgtk compact`](../compact) may be used to remove duplicate
edges after the join.  The output would be:

| node1 | label | node2 |
| -- | -- | -- |
| block1 | color | red |
| block1 | isa | block|
| block1 | size | large |

After `kgtk join`, [`kgtk lift`](https../lift) may be used to
build additional columns with the assembled information, such
as `node1;color` and `node1;size`.  The result might an edge
file with denormalzed edges (see below).

After `kgtk lift`:

| node1 | label | node2 | node1;color | node1;size |
| ----- | ----- | ----- | ----- | ---- |
| block1 | isa | block | red | large

### Joining with Additional Columns (Denormalized Edges)

A denormalized KGTK edge file contains additional columns beyond (`node1`, `label`, `node2`, and `id`).

When one or both of the input edge file are denormalized, the output file will also be denormalized.
The output file will contain the union of the additional columns from the input files, with empty values
in the additional columns when an input file does not contain a corresponding nonempty value.

Left input file:

| node1 | label | node2 | color |
| ----- | ----- | ----- | ----- |
| block1 | isa | block|
| block1 | type | cube | red |

Right input file:

| node1 | label | node2 | size |
| ----- | ----- | ----- | ----- |
| block1 | isa | block|
| block1 | type | cube | large |

Output file after joining on `node1`:

| node1 | label | node2 | color | size |
| ----- | ----- | ----- | ----- | --- |
| block1 | isa | block| | |
| block1 | type | cube | red |       |
| block1 | isa | block| | |
| block1 | type | cube |     | large |

[`kgtk compact`](../compact) may be used to remove duplicate edges
edges and compact the additional columns after the join:

| node1 | label | node2 | color | size |
| ----- | ----- | ----- | ----- | --- |
| block1 | isa | block| | |
| block1 | type | cube | red | large |

### Prefixing Additional Columns

`--left-prefix LEFT_PREFIX` and `--right-prefix RIGHT_PREFIX` provide optional
prefixes for the additional columns in the output field.
Without prefixing, additional columns with the same name in the left and right input
files become a single column in the output file:

Left input file:

| node1 | label | node2 | color |
| ----- | ----- | ----- | ----- |
| block1 | isa | block | |
| block1 | type | cube | red |

Right input file:

| node1 | label | node2 | color |
| ----- | ----- | ----- | ----- |
| block1 | isa | block | |
| block1 | type | cube | green |

Output file after joining without prefixing:

| node1 | label | node2 | color |
| ----- | ----- | ----- | ----- |
| block1 | isa | block | |
| block1 | type | cube | red |
| block1 | isa | block | |
| block1 | type | cube | green |

Output file after joining on `node1` with `--left-prefix=l- --right-prefix=r-`:

| node1 | label | node2 | l-color | r-color |
| ----- | ----- | ----- | ----- | --- |
| block1 | isa | block | | |
| block1 | type | cube | red |       |
| block1 | isa | block | | |
| block1 | type | cube |     | green |

### Joining Edges on `node1`, `label`, `node2`, and optionally `id`

Another use for `kgtk join` is to assemble a set of additional columns for
edges with entries in two different files.  Joining on edge identity can be
requested by specifying `--join-on-label --join-on-node2`.  If the `id`
column is significant for edge identity, `--join-on-id` can also be specified.

Left input file:

| node1 | label | node2 | color |
| ----- | ----- | ----- | ----- |
| block1 | material | wood | |
| block1 | type | cube | red |
| block2 | material | steel | |
| block2 | type | cube | blue |

Right input file:

| node1 | label | node2 | size |
| ----- | ----- | ----- | ----- |
| block1 | type | cube | large |
| block3 | type | cube | small |

Output file after an inner join on (`node1`, `label`, `node2`):

| node1 | label | node2 | color | size |
| ----- | ----- | ----- | ----- | --- |
| block1 | type | cube | red |       |
| block1 | type | cube |     | large |

[`kgtk compact`](../compact) can then be used to
compact the additional columns after the join:

| node1 | label | node2 | color | size |
| ----- | ----- | ----- | ----- | --- |
| block1 | type | cube | red | large |

### Joining Node Files: Set Intersection

Node files may be joined to perform a set intersection using the default
join type (omit `--left-join` and `--right-join`).

Left input file:

| id |
| --- |
| block1 |
| block2 |

Right input file:

| id |
| --- |
| block1 |
| block3 |

Output file after the inner join:

| id |
| --- |
| block1 |

### Joining Node Files: Set Union

Node files may be joined to perform a set union.  Use `--left-join --right-join` to
perform an outer join.

Left input file:

| id |
| --- |
| block1 |
| block2 |

Right input file:

| id |
| --- |
| block1 |
| block3 |

Output file after the outer join:

| id |
| --- |
| block1 |
| block2 |
| block1 |
| block3 |

After using [`kgtk compact`](../compact) to remove duplicates:

| id |
| --- |
| block1 |
| block2 |
| block3 |

### Joining Node Files: Merging Additional Columns

Node files may be joined to merge the additional columns found in the two input files.

Left input file:

| id | shape |
| --- | --- |
| block1 | cube |

Right input file:

| id | color |
| --- | --- |
| block1 | red |

Output file:

| id | shape | color |
| --- | --- | --- |
| block1 | cube | |
| block1 | | red |

After using [`kgtk compact`](../compact) to compact the entries:

| id | shape | color |
| --- | --- | --- |
| block1 | cube | red |

### Joining on Arbitrary Columns

`--left-file-join-columns LEFT_JOIN_COLUMNS ...` and `--right-file-join-columns RIGHT_JOIN_COLUMNS ...`
may be used to join on arbitrary sets of left and right file columns.  It is necessary to use these
options when processing quasi-KGTK files (`--mode=NONE`, `--left-mode=NONE`, `--right-mode=NONE`).

### Memory Usage and stdin Limitation

`kgtk join` builds in-memory key sets from one or both input files.  This may cause performance
problems if the join requires more memory than is available.

| Join Type | Input File Key Sets |
| --- | --- |
| Inner join | Key sets are built in memory  for both the left and right input files. |
| Left join | A key set is built in memory for the left input file. |
| Right join | A key set is built in memory for the right input file. |
| Outer join | No key sets are built in memory. |

!!! note
    `kgtk join` builds in-memory key sets from one or both input files. Standard input (stdin)
    from a pipe may not be used for an input file for which a key set is built in memory.

!!! note
    [`kgtk ifexists`](../ifexists) provides an experimental join mode that works with
    presorted input files and uses much less memory.  In the future, `kgtk join` may offer support for
    presorted input files.

### Bending the Rules

To join an edge file to a node file, or to join quasi-KGTK files, use the
following options (enable expert mode for usage information):

| Option | Description |
| --- | --- |
| `--left-mode=NONE` | Treat the left input file as a quasi-KGTK file.  `--left-file-join-columns` must be supplied. |
| `--mode=NONE` | Treat both input files as quasi-KGTK files.  Both `--left-file-join-columns` and `--right-file-join-columns` must be supplied. |
| `--right-mode=NONE` | Treat the right input file as a quasi-KGTK file.  `--right-file-join-columns` must be supplied. |

### `kgtk join / compact`

The pipeline `kgtk join / compact` is a frequent idiom to remove duplicates and
compact additional columns in the output from a join operation.

!!! info
    In the future, `kgtk join --compact` will run `kgtk compact` automatically
    on the output of `kgtk join`.  This will reduce the
    number of command options that may need to be specified.  It may increase
    performance as well. [Issue #116](https://github.com/usc-isi-i2/kgtk/issues/116).

## Usage

```
usage: kgtk join [-h] [--left-file LEFT_FILE] [--right-file RIGHT_FILE]
                 [-o OUTPUT_FILE] [--join-on-id [JOIN_ON_ID]]
                 [--join-on-label [JOIN_ON_LABEL]]
                 [--join-on-node2 [JOIN_ON_NODE2]] [--left-prefix LEFT_PREFIX]
                 [--left-file-join-columns LEFT_JOIN_COLUMNS [LEFT_JOIN_COLUMNS ...]]
                 [--left-join [LEFT_JOIN]] [--right-prefix RIGHT_PREFIX]
                 [--right-file-join-columns RIGHT_JOIN_COLUMNS [RIGHT_JOIN_COLUMNS ...]]
                 [--right-join [RIGHT_JOIN]] [-v [optional True|False]]

Join two KGTK edge files or two KGTK node files.

Join keys are extracted from one or both input files and stored in memory,
then the data files are processed in a second pass.  stdin will not work as an
input file if join keys are needed from it.

The output file contains the union of the columns in the two
input files, adjusted for predefined name aliasing.

Specify --left-join to get a left outer join.
        The output file will contain all records from the
        left input file, along with records from the right
        input file with matching join column values.

Specify --right-join to get a right outer join.
        The output file will contain all records from the
        right input file, along with records from the left
        input file with matching join column values.

Specify both --left-join and --right-join to get a full outer
join (equivalent to cat or set union).
        The output file will contain all records from both
        the left input file and the right input file.

Specify neither --left-join nor --right-join to get an inner
join.  If there are no columns beyond the join columns, then
this is equivalent to set intersection.
        The output file will contain records from the left
        input file and from the right input file for which
        the join column value match.

By default, node files are joined on the id column, while edge files are joined
on the node1 column. The label and node2 columns may be added to the edge file
join criteria.  Alternatively, the left and right file join columns may be
listed explicitly.

To join an edge file to a node file, or to join quasi-KGTK files, use the
following option (enable expert mode for more information):

--mode=NONE

Expert mode provides additional command arguments.

optional arguments:
  -h, --help            show this help message and exit
  --left-file LEFT_FILE
                        The left-side KGTK file to join (required). (May be
                        omitted or '-' for stdin.)
  --right-file RIGHT_FILE
                        The right-side KGTK file to join (required). (May be
                        omitted or '-' for stdin.)
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        The KGTK output file. (May be omitted or '-' for
                        stdout.)
  --join-on-id [JOIN_ON_ID]
                        If both input files are edge files, include the id
                        column in the join (default=False).
  --join-on-label [JOIN_ON_LABEL]
                        If both input files are edge files, include the label
                        column in the join (default=False).
  --join-on-node2 [JOIN_ON_NODE2]
                        If both input files are edge files, include the node2
                        column in the join (default=False).
  --left-prefix LEFT_PREFIX
                        An optional prefix applied to left file column names
                        in the output file (default=None).
  --left-file-join-columns LEFT_JOIN_COLUMNS [LEFT_JOIN_COLUMNS ...]
                        Left file join columns (default=None).
  --left-join [LEFT_JOIN]
                        Perform a left outer join (default=False).
  --right-prefix RIGHT_PREFIX, --prefix RIGHT_PREFIX
                        An optional prefix applied to right file column names
                        in the output file (default=None).
  --right-file-join-columns RIGHT_JOIN_COLUMNS [RIGHT_JOIN_COLUMNS ...]
                        Right file join columns (default=None).
  --right-join [RIGHT_JOIN]
                        Perform a right outer join (default=False).

  -v [optional True|False], --verbose [optional True|False]
                        Print additional progress messages (default=False).
```
## Examples

### Normalized Sample Data

Suppose that `file1.tsv` contains the following table in KGTK format:

```bash
kgtk cat -i examples/docs/join-file1.tsv
```

| node1 | label | node2 |
| -- | -- | -- |
| john | zipcode | 12345 |
| peter | zipcode | 12040 |
| steve | zipcode | 45601 |

and `file2.tsv` contains the following table in KGTK format:

```bash
kgtk cat -i examples/docs/join-file2.tsv
```

| node1 | label | node2 |
| -- | -- | -- |
| john | position | programmer |
| peter | position | engineer |
| edward | position | supervisor |

### Do an inner join on two KGTK normalized edge files on `node1`.

The output will contain edges from the left and right files
got only those `node1` values that appear in both files.

```bash
kgtk join --left-file examples/docs/join-file1.tsv \
          --right-file examples/docs/join-file2.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 |
| -- | -- | -- |
| john | zipcode | 12345 |
| peter | zipcode | 12040 |
| john | position | programmer |
| peter | position | engineer |

### Do a left outer join on two KGTK normalized edge files on `node1`.

The output will contain all edges from the left file,
and any edges from the right file with a `node1` value that
matches at least one edge in the left file.

```bash
kgtk join --left-join \
          --left-file examples/docs/join-file1.tsv \
          --right-file examples/docs/join-file2.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 |
| -- | -- | -- |
| john | zipcode | 12345 |
| peter | zipcode | 12040 |
| steve | zipcode | 45601 |
| john | position | programmer |
| peter | position | engineer |

### Do a right outer join on two KGTK normalized edge files on `node1`.

The output will contain all edges from the right file,
and any edges from the left file with a `node1` value that
matches at least one edge in the right file.

```bash
kgtk join --right-join \
          --left-file examples/docs/join-file1.tsv \
          --right-file examples/docs/join-file2.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 |
| -- | -- | -- |
| john | zipcode | 12345 |
| peter | zipcode | 12040 |
| john | position | programmer |
| peter | position | engineer |
| edward | position | supervisor |

### Do a full outer join on two KGTK normalized edge files on `node1`.

This produces the same output as the `kgtk cat` command,
and is included here for completeness.

```bash
kgtk join --left-join --right-join \
          --left-file examples/docs/join-file1.tsv \
          --right-file examples/docs/join-file2.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 |
| -- | -- | -- |
| john | zipcode | 12345 |
| peter | zipcode | 12040 |
| steve | zipcode | 45601 |
| john | position | programmer |
| peter | position | engineer |
| edward | position | supervisor |

### Denormalized Sample Data

Suppose that `file3.tsv` contains the following table in KGTK format:

```bash
kgtk cat -i examples/docs/join-file3.tsv
```

| node1 | label | node2 | location |
| -- | -- | -- | -- |
| john | zipcode | 12345 | home |
| john | zipcode | 12346 | work |
| peter | zipcode | 12040 | home |
| peter | zipcode | 12040 | work |
| steve | zipcode | 45601 | home |
| steve | zipcode | 45601 | work |

and `file4.tsv` contains the following table in KGTK format:

```bash
kgtk cat -i examples/docs/join-file4.tsv
```

| node1 | label | node2 | years |
| -- | -- | -- | -- |
| john | position | programmer | 3 |
| peter | position | engineer | 2 |
| edward | position | supervisor | 10 |
| john | laptop | dell | 4 |
| peter | laptop | apple | 7 |

### Do an inner join on two KGTK denormalized edge files on `node1`.

The output will contain edges from the left and right files
got only those `node1` values that appear in both files.

```bash
kgtk join --left-file examples/docs/join-file3.tsv \
          --right-file examples/docs/join-file4.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 | location | years |
| -- | -- | -- | -- | -- |
| john | zipcode | 12345 | home |  |
| john | zipcode | 12346 | work |  |
| peter | zipcode | 12040 | home |  |
| peter | zipcode | 12040 | work |  |
| john | position | programmer |  | 3 |
| peter | position | engineer |  | 2 |
| john | laptop | dell |  | 4 |
| peter | laptop | apple |  | 7 |

### Do a left outer join on two KGTK denormalized edge files on `node1`.

The output will contain all edges from the left file,
and any edges from the right file with a `node1` value that
matches at least one edge in the left file.

```bash
kgtk join --left-join \
          --left-file examples/docs/join-file3.tsv \
          --right-file examples/docs/join-file4.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 | location | years |
| -- | -- | -- | -- | -- |
| john | zipcode | 12345 | home |  |
| john | zipcode | 12346 | work |  |
| peter | zipcode | 12040 | home |  |
| peter | zipcode | 12040 | work |  |
| steve | zipcode | 45601 | home |  |
| steve | zipcode | 45601 | work |  |
| john | position | programmer |  | 3 |
| peter | position | engineer |  | 2 |
| john | laptop | dell |  | 4 |
| peter | laptop | apple |  | 7 |

### Do a right outer join on two KGTK denormalized edge files on `node1`.

The output will contain all edges from the right file,
and any edges from the left file with a `node1` value that
matches at least one edge in the right file.

```bash
kgtk join --right-join \
          --left-file examples/docs/join-file3.tsv \
          --right-file examples/docs/join-file4.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 | location | years |
| -- | -- | -- | -- | -- |
| john | zipcode | 12345 | home |  |
| john | zipcode | 12346 | work |  |
| peter | zipcode | 12040 | home |  |
| peter | zipcode | 12040 | work |  |
| john | position | programmer |  | 3 |
| peter | position | engineer |  | 2 |
| edward | position | supervisor |  | 10 |
| john | laptop | dell |  | 4 |
| peter | laptop | apple |  | 7 |

### Do a full outer join on two KGTK denormalized edge files on `node1`.

This produces the same output as the `kgtk cat` command,
and is included here for completeness.

```bash
kgtk join --left-join --right-join \
          --left-file examples/docs/join-file3.tsv \
          --right-file examples/docs/join-file4.tsv
```

The result will be the following table in KGTK format:

| node1 | label | node2 | location | years |
| -- | -- | -- | -- | -- |
| john | zipcode | 12345 | home |  |
| john | zipcode | 12346 | work |  |
| peter | zipcode | 12040 | home |  |
| peter | zipcode | 12040 | work |  |
| steve | zipcode | 45601 | home |  |
| steve | zipcode | 45601 | work |  |
| john | position | programmer |  | 3 |
| peter | position | engineer |  | 2 |
| edward | position | supervisor |  | 10 |
| john | laptop | dell |  | 4 |
| peter | laptop | apple |  | 7 |

gha_language: Jupyter Notebook


text:
# Developer Guide
devops is a perl based Object Orirentated project.

## Coding Conventions
- Every class is in a .pm file of the same name
  - except where the class is considered internal to another class and is not used directly by any other class
- Class names shall all be PsscalCase
- variable names shall all be lower case with _ to represent word seperation

## Repository Structure
devops -
       |- Externals                     Perl module dependencies external to this project
       |- Installation                  Scripts to set up devops on the host system
       |- DevOps                        The perl core app modules source code
            |- test                     The unit tests for core modules
            |- Configuration            Configuration file parsing modules
            |- Cli                      The Command Line Interface to the core modules
            |- TestUtils                Module specific reusable testing utilities
            |- VersionControl           Plugin modules for the various revision control systems projects use

## Unit Tests
- Every class shall have a unit test in the test subdirectory with the name
   test_ClassName.pm. This will implement a test class.
- each test should be a method of the test class. The list of test methods should be returned by the tests() method of
  this class.
- tests are executed by running the test.pl script found in each test sub directory.

repository: chrisjwilliams/devops

repo_name: chrisjwilliams/devops


text:
# WIP Scala 3 Language Specification

**This is still a work in progress, and should *not* be regarded as a source of truth.**

First of all, the language specification is meant to be correct, precise and clear.

Second, editing, previewing and generating output for the markdown should be simple and easy.

Third, we'd like to support different output formats. An html page per chapter with MathJax seems like a good start, as it satisfies the second requirement, and enables the first one.

## Editing

We are using Jekyll and [Redcarpet](https://github.com/vmg/redcarpet) to generate the html.

Check `Gemfile` for the current versions.

We aim to track the configuration GitHub Pages uses but differences may arise as GitHub Pages evolves.

## Building

<!-- TODO: Check nothing else is needed -->
To preview locally, run the following commands in the docs/_spec subfolder:

```
env UID="$(id -u)" GID="$(id -g)" docker-compose up
```

and open http://<IP_ADDRESS>:4000/files/archive/spec/2.13/ to view the spec. Jekyll will rebuild as you edit the markdown, but make sure to restart it when you change `_config.yml`.
<!--
To preview locally, run the following commands in the root of your checkout scala/scala:
`bundle install` to install Jekyll and `bundle exec jekyll serve -d build/spec/ -s spec/ -w --baseurl=""` to start it,
and open http://<IP_ADDRESS>:4000/ to view the spec. Jekyll will rebuild as you edit the markdown, but make sure to restart it when you change `_config.yml`.
-->

## General Advice for editors

- All files must be saved as UTF-8: ensure your editors are configured appropriately.
- Use of the appropriate unicode characters instead of the latex modifiers for accents, etc. is necessary. For example, é instead of `\'e`.
- MathJAX errors  will appear within the  rendered DOM as span  elements with class `mtext` and style attribute `color: red` applied. It is  possible to search for this combination in the development  tools of the browser of your choice. In chrome, CTRL+F / CMD+F within the inspect element panel allows you to do this.

- This document follows the "one sentence <=> one line" convention, with the following exceptions below.
  - A multiline code block is part of the sentence
  - An enumeration of links is long enough

- Whenever doing an enumeration of the kind "a, ..., z", follow the following conventions:
  - It should always be "separator whitespace period period period separator whitespace", for example `, ..., ` or `,\n...,\n` for multiline.
  - If in a code block, only the elements (a and z above) should be in math mode (between forward ticks)
  - If in a math expression, the whole thing should be in a single math mode
  - Look at the [Tuple Types section](docs/_spec/03-types.html#tuple-types) for an example of the different cases above.

- Try to use "Note" blocks to point out logical conclusions that are not obvious, for examples, look at the [Tuple Types section](docs/_spec/03-types.html#tuple-types).

### Macro replacements:

- While  MathJAX just  support LaTeX style  command definition,  it is recommended  to not use  this as  it will likely cause issues with preparing the document for PDF or ebook distribution.
- `\SS` (which I could not find defined within the latex source) seems to be closest to `\mathscr{S}`
- `\TYPE` is equivalent to `\boldsymbol{type}'
- As MathJAX has  no support for slanted font (latex  command \sl), so in all instances  this should be replaced with \mathit{}
- The macro \U{ABCD} used for unicode character references can be replaced with \\uABCD.
- The macro \URange{ABCD}{DCBA} used for unicode character ranges can be replaced with \\uABCD-\\uDBCA.
- The macro \commadots can be replaced with ` , … , ` (But should not, see above).
- There is no adequate replacement for `\textsc{...}`  (small caps) in pandoc markdown. While unicode contains a number of  small capital  letters, it  is notably  missing Q and  X as  these glyphs  are intended  for phonetic spelling, therefore these  cannot be reliably used. For now,  the best option is to use  underscore emphasis and capitalise the text manually, `_LIKE THIS_`.

### Unicode Character replacements

- The unicode  left and right single  quotation marks (‘ and ’ (U+2018 and U+2019, respectively)) have been used in  place of ` and ', where the quotation marks  are intended to  be paired. These can  be typed on  a mac using  Option+] for a left  quote and Option+Shift+] for the right quote.
- Similarly for left and right double quotation marks (“ and ” (U+201C and U+201D, respectively)) in place of ". These can be typed on a mac using Option+[ and Option+Shift+].

repository: lampepfl/dotty

gha_language: Scala

repo_name: lampepfl/dotty


text:
# $humanizeMS

This function converts MS time into a readable duration

#### Fields

This function has 1 required field

1. MS \(Required\)
2. Limit \(Optional\)
3. Separator \(Optional\)

Raw Usage: `$humanizeMS[ms;limit (optional);separator (optional)]`

#### Options

* MS - The duration in ms we're converting
* Limit - Limit of display for the duration
* Separator - The separator for each duration

#### Usage

Without the optional fields

```javascript
bot.command({
name: "convert",
code: `
$humanizeMS[1207398129310]
`
//Returns: 38 years and 9 months
})
```

With `Limit` optional field

```javascript
bot.command({
name: "convert",
code: `
$humanizeMS[1207398129310;4]
`
//Returns: 38 years 9 months 24 days and 12 hours
})
```

With `Separator` optional field

```javascript
bot.command({
name: "convert",
code: `
$humanizeMS[1207398129310;4;,]
`
//Returns: 38 years, 9 months, 24 days, and 12 hours
})
```

repository: XzFirzal/documentation

repo_name: XzFirzal/documentation


text:
---
layout: default
---

# 1995-01-06 - Re: C'punks Economist Fan Club

## Header Data

From<EMAIL_ADDRESS>(Duncan Frissell)

To<EMAIL_ADDRESS>Message Hash: 538a8ce0308df2613fd74d5ff98229dfc72345e675f81e39e2980445a2c0f715

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-01-06 11:23:19 UTC

Raw Date: Fri, 6 Jan 95 03:23:19 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Duncan Frissell)
Date: Fri, 6 Jan 95 03:23:19 PST
To<EMAIL_ADDRESS>Subject: Re: C'punks Economist Fan Club
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>It's witty, politically
>aware, relatively technically savvy. The articles exhibit a healthy (IMHO)
>cynicism about what happens and why, yet maintain some idealism about what
>should happen. It's not perfect, but it's difficult to imagine surpassing it.

The Economist is fully informed and funny.  What domestic news magazine
would include the following in one of *their* leads (editorials):

Circa 1987

"It is unlikely that Gorbachev has included an invasion of Western Europe in
his next Five Year Plan but his generals *have* made their preparations.
Lucky Britain is in the *Polish* Army's Zone of Occupation."

DCF

--
Have you registered a domain today.  My template worked first time and I
have since registered nine domain names.  Send for a free copy.

{% endraw %}
```

## Thread

+ Return to [January 1995](/archive/1995/01)

+ Return to "[Carol Anne Braddock  <carolann@mm.com>](/authors/carol_anne_braddock_carolann_at_mm_com_)"
+ Return to<EMAIL_ADDRESS>(Duncan Frissell)](/authors/frissell_at_panix_com_duncan_frissell_)"

+ 1995-01-06 (Fri, 6 Jan 95 03:23:19 PST) - Re: C'punks Economist Fan Club -<EMAIL_ADDRESS>(Duncan Frissell)_
  + 1995-01-06 (Fri, 6 Jan 95 06:40:49 PST) - [Re: C'punks Economist Fan Club](/archive/1995/01/557ef5b04d9134461e587da66df150496b9f394245e1dd15b8b8023c1825da38) - _Carol Anne Braddock<EMAIL_ADDRESS>


text:
---
layout: post
title: "IntelliJ Rust Changelog #141"
date: 2021-02-15 12:00:00 +0300
---

## New Features

* [#6741] Support 2021.1 EAPs

* [#6622] Add a quick-fix to remove redundant function call arguments (by [@Kobzol])

  {% include gif-img.html path="/assets/posts/changelog-141/6622" w="700px" %}

* [#6777], [#6776] Detect [E0116](https://doc.rust-lang.org/error-index.html#E0116) and [E0117](https://doc.rust-lang.org/error-index.html#E0117) compiler errors

* [#6267] Support debugging in [GoLand](https://www.jetbrains.com/go/) 2021.1.
  Note, it requires [Native Debugging Support](https://plugins.jetbrains.com/plugin/12775-native-debugging-support) plugin and supports only LLDB.

* [#6716] Support async function by `Create function` intention (by [@Stzx])

  {% include gif-img.html path="/assets/posts/changelog-141/6716" w="700px" %}

* [#6591] Add `Crate not found` inspection to check non-existent crates in `Cargo.toml`.
  Note, the corresponding feature is disabled by default for now.
  To use it, enable `org.rust.crates.local.index` experimental feature (by [@Kobzol])

## Performance Improvements

* [#6719] Fix performance regression in name resolution for large modules

## Fixes

* [#6768] Improve `File | Open` action to set up project structure of Cargo project if a project is opened via directory with `Cargo.toml`

* [New name resolution engine](https://github.com/intellij-rust/intellij-rust/issues/6217) improvements:

    * [#6731] Enable new name resolution engine on the nightly plugin channel by default

    * [#6733] Support resolve multi-segment macro paths

    * [#6692] Fix completion of unqualified macro calls in some cases

    * [#6723] Fix freeze during rendering of failed test backtrace

* [#6782] Fix processing of `break`/`continue` inside block expressions during control-flow analysis

* [#6804] Fix enum rendering during debugging on Linux with GDB in CLion 2021.1

* Improvements of `Change signature` refactoring (`Refactor | Change Signature` or Ctrl+F6):

    * [#6795] Apply the refactoring to the called function when invoked on function and method calls (by [@Kobzol])

    * [#6724] Fix auto-import in dialog when using new resolve

* [#6725] Fix resolve of methods from super trait in some cases

* [#6688] Fix some false-positive [E0277](https://doc.rust-lang.org/error-index.html#E0277) errors

* [#6767] Fix exception during loading structure of Cargo workspace with several IDE modules

* [#6805] Fix launching Cargo run configurations with arguments for running binary (i.e. arguments after `--`)

* [#6738] Show test hierarchy tree on the client when using [Code With Me](https://plugins.jetbrains.com/plugin/14896-code-with-me) plugin

* [#6810] Show missing Rust block in `Preferences | Build, Execution, Deployment | Debugger` settings on Windows in IntelliJ IDEA

* [#6739] Fix false-positive [E0404](https://doc.rust-lang.org/error-index.html#E0404) "Expected trait, found trait alias"

## Internal Improvements

* [#6764] Create new milestone automatically during new branch creation

Full set of changes can be found [here](https://github.com/intellij-rust/intellij-rust/milestone/49?closed=1)

[@Kobzol]: https://github.com/Kobzol
[@Stzx]: https://github.com/Stzx

[#6267]: https://github.com/intellij-rust/intellij-rust/pull/6267
[#6591]: https://github.com/intellij-rust/intellij-rust/pull/6591
[#6622]: https://github.com/intellij-rust/intellij-rust/pull/6622
[#6688]: https://github.com/intellij-rust/intellij-rust/pull/6688
[#6692]: https://github.com/intellij-rust/intellij-rust/pull/6692
[#6716]: https://github.com/intellij-rust/intellij-rust/pull/6716
[#6719]: https://github.com/intellij-rust/intellij-rust/pull/6719
[#6723]: https://github.com/intellij-rust/intellij-rust/pull/6723
[#6724]: https://github.com/intellij-rust/intellij-rust/pull/6724
[#6725]: https://github.com/intellij-rust/intellij-rust/pull/6725
[#6731]: https://github.com/intellij-rust/intellij-rust/pull/6731
[#6733]: https://github.com/intellij-rust/intellij-rust/pull/6733
[#6738]: https://github.com/intellij-rust/intellij-rust/pull/6738
[#6739]: https://github.com/intellij-rust/intellij-rust/pull/6739
[#6741]: https://github.com/intellij-rust/intellij-rust/pull/6741
[#6764]: https://github.com/intellij-rust/intellij-rust/pull/6764
[#6767]: https://github.com/intellij-rust/intellij-rust/pull/6767
[#6768]: https://github.com/intellij-rust/intellij-rust/pull/6768
[#6776]: https://github.com/intellij-rust/intellij-rust/pull/6776
[#6777]: https://github.com/intellij-rust/intellij-rust/pull/6777
[#6782]: https://github.com/intellij-rust/intellij-rust/pull/6782
[#6795]: https://github.com/intellij-rust/intellij-rust/pull/6795
[#6804]: https://github.com/intellij-rust/intellij-rust/pull/6804
[#6805]: https://github.com/intellij-rust/intellij-rust/pull/6805
[#6810]: https://github.com/intellij-rust/intellij-rust/pull/6810

gha_language: SCSS


text:
# Serverless Python Workflow with AWS Lambda
A tutorial to setup and deploy a simple Serverless Python workflow with REST API endpoints in AWS Lambda.

#### Requirements
- Working Knowledge of Python or [Learn Here](https://cfe.sh/projects/30-days-python-38)
- [AWS Account](https://aws.amazon.com) with the appropriate permissions for AWS Lambda, API Gateway, AWS S3, and IAM. If it's your account, you already have this.

### Getting started

#### 1. Download Project
```
mkdir serverless-workflow
cd serverless-worlfow
git clone https://github.com/codingforentrepreneurs/Serverless-Python-Workflow-with-AWS-Lambda .
```

#### 2. Copy `base` files to project root
```
cp base/* .
```

#### 3. Remove Unnecessary files
```
rm -rf .git
rm -rf base
```

#### 4. Virtual Environment Setup

##### Pipenv
```
pipenv install -r requirements.txt --python 3.8
```

##### Virtualenv
```
virtualenv -p python3.8 .
source bin/activate
pip install -r requirements.txt
```
> If using `windows` with `virtualenv` just run `.\Scripts\activate`

#### 5. Ready
You now have a baseline Lambda function working locally. Check out the code in the [course directory](./course) or learn how to implement this code on [cfe](https://www.codingforentrepreneurs.com/projects/serverless-python-aws-lambda-api-gateway).


text:
---
title: HouseArrestApi constructor
---

Initializes a new instance of the [`HouseArrestApi`](../HouseArrestApi.md) class

```csharp
public HouseArrestApi(ILibiMobileDevice parent)
```

| parameter | description |
| --- | --- |
| parent | The !:ILibiMobileDeviceApi which owns this HouseArrest. |

## See Also

* interface [ILibiMobileDevice](../../iMobileDevice/ILibiMobileDevice.md)
* class [HouseArrestApi](../HouseArrestApi.md)
* namespace [iMobileDevice.HouseArrest](../../iMobileDevice-net.md)

<!-- DO NOT EDIT: generated by xmldocmd for iMobileDevice-net.dll -->

repository: qmfrederik/docsy-perf

gha_language: HTML

repo_name: qmfrederik/docsy-perf


text:
# Library Standards
These standards attempt to enforce consistency across the codebase to assist developers that wish to read or understand the source code.

## Naming Conventions
All identifiers must follow these conventions to better identify types derived from the package.

1. CamelCase for all Classes and Functions
    1. N prefix for extensions of modules that manipulate the default network code.
    2. R prefix for extensions of the Relay Node.
    3. B prefix for extensions of the Balancer Node.
    4. I prefix for extensions of the Indexer Node.
    5. EY prefix for extensions of the Entry Node.
    6. ET prefix for extensions of the Exit Node.
2. Snake_Case for all Variables
    1. _p object reference
    2. _e enumerators
    3. _s classes acting as structs
    4. _t for unique types defined
    5. _g for generic variables
3. Capitalization for Constants

## Commenting Conventions
Comments should follow a standard format, making it easy to understand the arguments, expected outcomes, and possible errors associated with a codebase.

1. File Comments
```
[File Name]
:this is a description of the python module

@author(s) **a list of individuals who worked on the file**
@created **the date the file was created**
@last-edit **the date the file was last edited**
@common **what all the functions / structs / types have in common within the file**
@use-case **the use case for the module, when it should be used, etc.**
```

2. Import Comments
Group common imports from the sys, src, cli, gui, or util libraries when there is lots of imports.

3. Class Comments
```
[Class Name]
:this is a description of the function

@purpose **why the class is important / how it helps the user**
@use-case **where the class should, and should not be used**
```

4. Function Comments
```
(parameters) -> (output)
:this is a description of the function

@parameters **textually identify specific parameter requirements**
@returns **textually identify what should be returned**
@except **textually identify what is expected when the function fails**
```

## Global Conventions
Python files or sub-directories that MAY be used by one or many codebase must be put in the root src directory.

1. Constants should be placed in src/constants.py
2. Functions useful between all sub-directories should be placed in src/utils/*.py

repository: GabeCordo/py-acyclic-network

repo_name: GabeCordo/py-acyclic-network


text:
# Fable.Axios

Fable bindings for [axios](https://github.com/axios/axios), a promise based HTTP client for the browser and node.js
.
### Nuget Packages

Stable | Prerelease
--- | ---
[![NuGet Badge](https://buildstats.info/nuget/Fable.Axios)](https://www.nuget.org/packages/Fable.Axios/) | [![NuGet Badge](https://buildstats.info/nuget/Fable.Axios?includePreReleases=true)](https://www.nuget.org/packages/Fable.Axios/)

## Example

```
module Example

open Fable.Axios
open Fable.Axios.Globals

type ResultType = Result<string option, exn>

let private parseResponse matchId videoUrl (response : AxiosXHR<string>) : ResultType =

let private catchAxiosError (error : AxiosError<_, _>) : ResultType =
        match error with
        | ErrorResponse r ->
            match r.response.status with
            | 403
            | 404 ->
                Ok None
            | _ ->
                handleError error
        | _ ->
            handleError error

let fetchWithAxios url =
    axios.get (url)
    |> Promise.map parseResponse
    |> Promise.catchAxios catchAxiosError
```

## Development

### Building

Make sure the following **requirements** are installed in your system:

* [dotnet SDK](https://www.microsoft.com/net/download/core) 2.0 or higher
* [node.js](https://nodejs.org) 6.11 or higher
* [yarn](https://yarnpkg.com)
* [Mono](http://www.mono-project.com/) if you're on Linux or macOS.

Then you just need to type `./build.cmd` or `./build.sh`

### Release

In order to push the package to [nuget.org](https://nuget.org) you need to add your API keys to `NUGET_KEY` environmental variable.
You can create a key [here](https://www.nuget.org/account/ApiKeys).

- Update RELEASE_NOTES with a new version, data and release notes [ReleaseNotesHelper](http://fake.build/apidocs/fake-releasenoteshelper.html).
Ex:

```
#### 0.2.0 - 30.04.2017
* FEATURE: Does cool stuff!
* BUGFIX: Fixes that silly oversight
```

- You can then use the Release target. This will:
  - make a commit bumping the version: Bump version to 0.2.0
  - publish the package to nuget
  - push a git tag

`./build.sh Release`

repository: gamurs-group/fable-axios

repo_name: gamurs-group/fable-axios


text:
# Bkper para Google Sheets

Aplicativo para integração entre Bkper e GoogleSheets.

![Bkper App Menu](https://storage.googleapis.com/bkper-public/images/bkper-app-menu.png)

See the [documentation](https://bkper.com/docs) to learn more.


text:
# Console - `FREEZE DATABASE`

Flushes all cached content to disk and restricts permitted operations to read commands.  With the exception of reads, none of the commands made on a frozen database execute.  It remains in this state until you run the [`RELEASE`](Console-Command-Release-Db.md) command.

Executing this command requires server administration rights.  You can only execute it on remote databases.  If you would like to freeze or release a local database, use the `ODatabase.freeze()` and `ODatabase.release()` methods directly through the OrientDB API.

>You may find this command useful in the event that you would like to perform backups on a live database.  To do so, freeze the database, perform a file system snapshot, then release the database.  You can now copy the snapshot anywhere you want.

>This works best when the backup doesn't take very long to run.

**Syntax**

```sql
FREEZE DATABASE
```

**Example**

- Freezes the current database:

  orientdb> FREEZE DATABASE

>To unfreeze a database, use the [`RELEASE DATABASE`](Console-Command-Release-Db.md) command.

>For more information on other commands, please refer to [Console Commands](Console-Commands.md) and [SQL Commands](../sql/SQL-Commands.md).

repository: orientechnologies/orientdb-docs

gha_language: CSS

repo_name: orientechnologies/orientdb-docs


text:
# PVN3D
This is the source code for ***PVN3D: A Deep Point-wise 3D Keypoints Voting Network for 6DoF Pose Estimation***, **CVPR 2020**. ([PDF](http://openaccess.thecvf.com/content_CVPR_2020/papers/He_PVN3D_A_Deep_Point-Wise_3D_Keypoints_Voting_Network_for_6DoF_CVPR_2020_paper.pdf), [Video_bilibili](https://www.bilibili.com/video/av89408773/), [Video_youtube](https://www.youtube.com/watch?v=ZKo788cyD-Q&t=1s)).

## Installation
- Install CUDA9.0
- Set up python environment from requirement.txt:
  ```shell
  pip3 install -r requirement.txt
  ```
- Install tkinter through ``sudo apt install python3-tk``
- Install [python-pcl](https://github.com/strawlab/python-pcl).
- Install PointNet++ (refer from [Pointnet2_PyTorch](https://github.com/erikwijmans/Pointnet2_PyTorch)):
  ```shell
  python3 setup.py build_ext
  ```

## Datasets
- **LineMOD:** Download the preprocessed LineMOD dataset from [here](https://drive.google.com/drive/folders/19ivHpaKm9dOrr12fzC8IDFczWRPFxho7) (refer from [DenseFusion](https://github.com/j96w/DenseFusion)). Unzip it and link the unzipped ``Linemod_preprocessed/`` to ``pvn3d/datasets/linemod/Linemod_preprocessed``:
  ```shell
  ln -s path_to_unzipped_Linemod_preprocessed pvn3d/dataset/linemod/
  ```
- **YCB-Video:** Download the YCB-Video Dataset from [PoseCNN](https://rse-lab.cs.washington.edu/projects/posecnn/). Unzip it and link the unzipped```YCB_Video_Dataset``` to ```pvn3d/datasets/ycb/YCB_Video_Dataset```:

  ```shell
  ln -s path_to_unzipped_YCB_Video_Dataset pvn3d/datasets/ycb/
  ```

## Training and evaluating

### Training on the LineMOD Dataset
- First, generate synthesis data for each object using scripts from [raster triangle](https://github.com/ethnhe/raster_triangle).
- Train the model for the target object. Take object ape for example:
  ```shell
  cd pvn3d
  python3 -m train.train_linemod_pvn3d --cls ape
  ```
  The trained checkpoints are stored in ``train_log/linemod/checkpoints/{cls}/``, ``train_log/linemod/checkpoints/ape/`` in this example.

### Evaluating on the LineMOD Dataset
- Start evaluation by:
  ```shell
  # commands in eval_linemod.sh
  cls='ape'
  tst_mdl=train_log/linemod/checkpoints/${cls}/${cls}_pvn3d_best.pth.tar
  python3 -m train.train_linemod_pvn3d -checkpoint $tst_mdl -eval_net --test --cls $cls
  ```
  You can evaluate different checkpoint by revising ``tst_mdl`` to the path of your target model.
- We provide our pre-trained models for each object at [onedrive link](https://hkustconnect-my.sharepoint.com/:f:/g/personal/yhebk_connect_ust_hk/Ehay5pPtl-BGnvAEclXBRu8BEpZeHuG9x-aN_djAtt5rPA?e=3BvfrV), [baiduyun link](https://pan.baidu.com/s/1MhqPvjROCkR17W1tiXE9SA) (access code(提取码): 8kmp). Download them and move them to their according folders. For example, move the ``ape_pvn3d_best.pth.tar`` to ``train_log/linemod/checkpoints/ape/``. Then revise ``tst_mdl=train_log/linemod/checkpoints/ape/ape_pvn3d_best.path.tar`` for testing.

### Demo/visualizaion on the LineMOD Dataset
- After training your models or downloading the pre-trained models, you can start the demo by:
  ```shell
  # commands in demo_linemod.sh
  cls='ape'
  tst_mdl=train_log/linemod/checkpoints/${cls}/${cls}_pvn3d_best.pth.tar
  python3 -m demo -dataset linemod -checkpoint $tst_mdl -cls $cls
  ```
  The visualization results will be stored in ``train_log/linemod/eval_results/{cls}/pose_vis``

### Training on the YCB-Video Dataset
- Preprocess the validation set to speed up training:
  ```shell
  cd pvn3d
  python3 -m datasets.ycb.preprocess_testset
  ```
- Start training on the YCB-Video Dataset by:
  ```shell
  python3 -m train.train_ycb_pvn3d
  ```
  The trained model checkpoints are stored in ``train_log/ycb/checkpoints/``

### Evaluating on the YCB-Video Dataset
- Start evaluating by:
  ```shell
  # commands in eval_ycb.sh
  tst_mdl=train_log/ycb/checkpoints/pvn3d_best.pth.tar
  python3 -m train.train_ycb_pvn3d -checkpoint $tst_mdl -eval_net --test
  ```
  You can evaluate different checkpoint by revising the ``tst_mdl`` to the path of your target model.
- We provide our pre-trained models at [onedrive link](https://hkustconnect-my.sharepoint.com/:f:/g/personal/yhebk_connect_ust_hk/EmQQXKJdC1FDplKS4FQ6n78B4T7eyvhSEsZ8dZySJUmv4w?e=7BwsS5), [baiduyun link](https://pan.baidu.com/s/1hCzqfB3JhOzF3LATsWFFBg) (access code(提取码): h2i5). Download the ycb pre-trained model, move it to ``train_log/ycb/checkpoints/`` and modify ``tst_mdl`` for testing.

### Demo/visualizaion on the LineMOD Dataset
- After training your model or downloading the pre-trained model, you can start the demo by:
  ```shell
  # commands in demo_ycb.sh
  tst_mdl=train_log/ycb/checkpoints/pvn3d_best.pth.tar
  python3 -m demo -checkpoint $tst_mdl -dataset ycb
  ```
  The visualization results will be stored in ``train_log/ycb/eval_results/pose_vis``

## Results
- Evaluation result on the LineMOD dataset:
  ![res_lm](pictures/res_linemod.png)
- Evaluation result on the YCB-Video dataset:
  ![res_ycb](pictures/res_ycb.png)
- Visualization of some predicted poses on YCB-Video dataset:
  ![vis_ycb](pictures/ycb_qualitive.png)
- Joint training for distinguishing objects with similar appearance but different in size:
  ![seg](pictures/seg_res.png)

## Citations
Please cite [PVN3D](https://arxiv.org/abs/1911.04231) if you use this repository in your publications:
```
@InProceedings{He_2020_CVPR,
author = {He, Yisheng and Sun, Wei and Huang, Haibin and Liu, Jianran and Fan, Haoqiang and Sun, Jian},
title = {PVN3D: A Deep Point-Wise 3D Keypoints Voting Network for 6DoF Pose Estimation},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}
```


text:
# Kubernetes Fetch Logs

<img src="https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png" width="100">

![env](https://img.shields.io/static/v1?label=env&message=Kubernetes&style=flat&logo=Kubernetes&color=326CE5)

[![Import to StackPulse](../../images/open_in_stackpulse.svg)](https://app.stackpulse.io/playbook/create?tab=playbook#https://github.com/stackpulse/playbooks/blob/master/kubernetes/logs/playbook.yaml)

This playbook allows you to fetch logs from a Kubernetes entity, with all the options that Kubernetes expose to you.

## How to get started

[![Import to StackPulse](../../images/open_in_stackpulse.svg)](https://app.stackpulse.io/playbook/create?tab=playbook#https://github.com/stackpulse/playbooks/blob/master/kubernetes/logs/playbook.yaml)

Not a Stackpulse user? Follow these steps:

1. Make sure your have a [StackPulse](https://stackpulse.com/get-started) account
2. Import [this playbook](https://app.stackpulse.io/playbooks) into your account
3. Connect it to monitoring alerts or execute manually

repository: vince-lynch/playbooks

repo_name: vince-lynch/playbooks


text:
Meta packages
========

This repo contains NuGet meta packages that help quickly reference sets of common packages.

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.

https://opensource.microsoft.com/?page_number=2&tag=c%23&sort=Alphabet&repo=

repository: DouglasAllen/MetaPackages

branch_name: refs/heads/dev

repo_name: DouglasAllen/MetaPackages


text:
# Mattermost Jitsi Plugin (Beta)

[![Build Status](https://img.shields.io/circleci/project/github/mattermost/mattermost-plugin-jitsi/master)](https://circleci.com/gh/mattermost/mattermost-plugin-jitsi)
[![Code Coverage](https://img.shields.io/codecov/c/github/mattermost/mattermost-plugin-jitsi/master)](https://codecov.io/gh/mattermost/mattermost-plugin-jitsi)
[![Release](https://img.shields.io/github/v/release/mattermost/mattermost-plugin-jitsi)](https://github.com/mattermost/mattermost-plugin-jitsi/releases/latest)
[![HW](https://img.shields.io/github/issues/mattermost/mattermost-plugin-jitsi/Up%20For%20Grabs?color=dark%20green&label=Help%20Wanted)](https://github.com/mattermost/mattermost-plugin-jitsi/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Up+For+Grabs%22+label%3A%22Help+Wanted%22)

**Maintainer:** [Daniel Espino García](https://github.com/larkox)
**Originally developed by:** [Sean Sackowitz](https://github.com/seansackowitz).

Start and join voice calls, video calls and use screen sharing with your team members with a Jitsi plugin for Mattermost.

Clicking a video icon in a Mattermost channel posts a message that invites team members to join a Jitsi meetings call.

![image](https://user-images.githubusercontent.com/13119842/86600303-e145a600-bf6d-11ea-8562-775869064af0.png)

## Features

- Use a `/jitsi` command to start a new meeting. Optionally append a desired meeting topic after the command.
- Embed Jitsi meetings as a floating window inside Mattermost for a seamless experience.
- Click a video icon in channel header to start a new Jitsi meeting in the channel. Not yet supported on mobile.
- Use a `/jitsi settings` command to configure user preferences, including
    - whether Jitsi meetings appear as a floating window inside Mattermost or in a separate window
    - how meeting names are generated

The plugin has been tested on Chrome, Firefox and the Mattermost Desktop Apps.

## Installation

1. Go to https://github.com/mattermost/mattermost-plugin-jitsi/releases to download the latest release file in tar.gz format.
2. Upload the file through **System Console > Plugins > Management**, or manually upload it to the Mattermost server under plugin directory. See [documentation](https://docs.mattermost.com/administration/plugins.html#set-up-guide) for more details.

## Configuration

Go to **System Console > Plugins > Jitsi** and set the following values:

1. **Enable Plugin**: ``true``
2. **Jitsi Server URL**: The URL for your Jitsi server. If you set the Jitsi Server URL to https://meet.jit.si it uses the public server provided by Jitsi.
3. **Embed Jitsi video inside Mattermost**: When true, Jitsi video is embedded as a floating window inside Mattermost. This feature is experimental.
4. (Optional) If your Jitsi server uses JSON Web Tokens (JWT) for authentication, set:

  - **Use JWT Authentication for Jitsi**: ``true``
  - **App ID** and **App Secret** used for JWT authentication
  - **Meeting Link Expiry Time** in minutes. Defaults to 30 minutes.

5. **Jitsi Meeting Names**: Select how Jitsi meeting names are generated by default. The user can optionally override this setting for themselves via `/jitsi settings`.

  - Defaults to using random English words in title case, but you can also use a UUID as the meeting link, or the team and channel name where the Jitsi meeting is created. You can also allow the user to choose the meeting name each time by default.

You're all set! To test it, go to any Mattermost channel and click the video icon in the channel header to start a new Jitsi meeting.

### Manual Builds

You can use Docker to compile the binaries yourself. Run `./docker-make` shell script which builds a Docker image with necessary build dependencies and runs `make all` afterwards.

You can also use make targets like `dist` (`./docker-make dist`) from the [Makefile](./Makefile).

## Developing

This plugin contains both a server and web app portion.

Use `make` to check the quality of your code, as well as build distributions of the plugin that you can upload to a Mattermost server for testing.

### Server

Inside the `/server` directory, you will find the Go files that make up the server-side of the plugin. Within there, build the plugin like you would any other Go application.

### Web App

Inside the `/webapp` directory, you will find the JS and React files that make up the client-side of the plugin. Within there, modify files and components as necessary. Test your syntax by running `npm run build`.

repository: animustech/mattermost-plugin-jitsi

repo_name: animustech/mattermost-plugin-jitsi


text:
# witness\_node Introduce

`witness_node` is the GXChain-node program that contains blockchain core features such as packing blocks, verification blocks, and state storage.Starting the `witness_node` program with the `help` parameter will output all the commands supported by the tool. The following is an example of how to start the common functions.

### 1. replay blockchain
Rebuild object graph by replaying all blocks

```bash
./programs/witness_node/witness_node --replay-blockchain --fast-replay
```
`fast-replay`:no sleep while replaying block blocks

### 2. resync blockchain
Delete all blocks and re-sync with network from scratch

```bash
./programs/witness_node/witness_node --resync-blockchain
```

### 3. genesis-json
On the GXChain main-net, this file is built in, no need to specify it manually.

```bash
#File to read Genesis State from genesis-json
./programs/witness_node/witness_node --genesis-json genesis.json
```

### 4. API Server
Endpoint for websocket RPC to listen on

```bash
./programs/witness_node/witness_node --rpc-endpoint="<IP_ADDRESS>:28090"
```

### 5. P2P Server
Endpoint for P2P node to listen on

```bash
./programs/witness_node/witness_node --p2p-endpoint="<IP_ADDRESS>:9999"
```

### 6. Seed Nodes
P2P nodes to connect to on startup (may specify multiple times)

```bash
./programs/witness_node/witness_node --seed-nodes='["testnet.gxchain.org:6789"]'
```

### 7. Data-dir
Directory containing databases,configuration file, etc.

```bash
./programs/witness_node/witness_node --data-dir=testnet_node
```

### 8. Close `witness_node`

- If the `witness_node` is not running in the background, execute `Ctrl + C` once and then wait for the program to save the memory data and then exit automatically.

- If the `witness_node` is running in the background, execute `kill -s SIGINT $(pgrep witness_node)`, and wait for the program to save the memory data and then exit automatically. You can't use `kill -9`, otherwise the next time you start the index, the index will be rebuilt.

repository: gxchain/docs

gha_language: JavaScript

repo_name: gxchain/docs