text:
# Also see

- [PackageFileStructure.md](PackageFileStructure.md)
- [PackagingTutorial.md](PackagingTutorial.md)
- [Questions.md](Questions.md)
- [PublishOnPyPI.md](PublishOnPyPI.md)

# PyPI Publishing Summary

## Distribution Tools

For `python setup.py sdist`:

```bash
$ pip install --upgrade setuptools
```

For `python setup.py bdist_wheel`:

```bash
$ pip install --upgrade wheel
```

For `twine check` and `twine upload`:

```bash
$ pip install --upgrade twine
```

For `check-manifest` and `check-manifest --create`:

```bash
$ pip install check-manifest
```

## Distribution Build Commands

Enter the project folder.

Clean out the old build:

```bash
$ rm -fr build/ dist/ *.egg-info/
```

Check repo and sdist will match:

```bash
$ check-manifest.exe
```

*This check creates the `egg-info/` folder.*

Check the `*./egg-info/PKG-INFO` file. This information shows up
on the PyPI (or TestPyPI) page, and is displayed when users do
`pip show PACKAGENAME`. For example:

- check the `Home-page` is correct
- search for `UNKNOWN` to find arguments missing from the call to
  `setuptools.setup()` in `setup.py`.

Rebuild the distributions:

```bash
$ python.exe setup.py sdist bdist_wheel
```

Check the README is valid for PyPI:

```bash
$ twine check dist/*
```

## Distribution Publishing Commands

Upload to TestPyPI:

```bash
$ twine upload --repository testpypi dist/*
```

## Distribution Testing Commands

Do a test installation in a virtual environment.

Create a virtual environment:

```powershell
> python -m venv test-install
> .\test-install\Scripts\activate
(test-install) >
```

Install the package. Since the package is not on PyPI, use `-i`
or `--index-url` to specify the package URL is TestPyPI:

```powershell
(test-install) > pip install -i https://test.pypi.org/simple/ PROJECTNAME
```

If the package has dependencies on packages that are not on
TestPyPI, use `--extra-index-url` to get the dependencies from
PyPI:

```powershell
(test-install) > pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple PROJECTNAME
```

Example, test installing `microspec`:

```powershell
(test-install) > pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ microspec
```

The `--extra-index-url` is required for `pip` to find requirement
`pyserial`.

*Follow the rule that PROJECTNAME == PACKAGENAME.*

Check the package is installed:

```powershell
(test-install) > pip list
```

Test importing the packaging:

```powershell
(test-install) > python -c "import PACKAGENAME"
```

*There is no deleting packages once they are uploaded to PyPI.*

Re-upload by incrementing the version number.

By logging in and clicking "Manage", it is *possible* to delete a
specific version, but that same version cannot be re-uploaded. So
there is no reason to delete a version and the interface is set
up to discourage this.

Make sure the upload is good by uploading to TestPyPI first. The
same deletion rules apply (deleting is discouraged), but the
accounts and packages there are periodically deleted. So a
publish test on TestPyPI may require incrementing the version
number a few times to get it right.

**Remember to reset to the original version number before
uploading to PyPI.**

Import to PyPI by leaving off the `--repository` argument:

```bash
$ twine upload dist/*
```

# PyPI Publishing Details

I highlight two issues here that I found to be poorly documented
at the time that I wrote this up:

- naming conventions
- packaging data files

For more details about project setup and publishing:

- [PackageFileStructure.md](PackageFileStructure.md)
- [PublishOnPyPI.md](PublishOnPyPI.md)

## Use UTF-8 in the "Project description"

The following line in `setup.py` uses README.md as the *Project
description* on PyPI:

```python
 # Show README.md as PyPI "Project description".
with open("README.md", "r", encoding="utf-8") as fh:
    long_description = fh.read()
```

Note `encoding="utf-8"`. UTF-8 is not the default encoding.
Specify UTF-8 if the README.md includes any unicode, e.g., the
branch symbols (└─, ├─) used in the output of the utility `tree`.

## Maintain three separate documents

I put the real documentation on *Read the Docs*. This includes
tutorials, how-to guides, explanatory discussion, and reference
docs auto-generated with Sphinx extension `sphinx.ext.autodoc`.

In addition to the *real* documentation there are two more short
but important documents: `PyPI.md` and `README.md`.

When users land on the PyPI page, they need just enough
information to install the project and test the install works.
More information is just noise and doesn't belong here.

If there are common problems with install or basic use, the PyPI
page also needs that troubleshooting information.

Installation and use are short, hopefully a line or two dedicated
to each.

The only section that deserves length is troubleshooting because
the user cannot do much if they cannot install and do some basic
operation to see that the installation worked.

Absolutely no explanations or details about the project belong
in PyPI.md.

I like to hide `PyPI.md` in a `doc/` folder. To use `PyPI.md` in
`setup.py`:

```python
with open("doc/PyPI.md", "r", encoding="utf-8") as fh:
    long_description = fh.read()
```

*The build process cannot find "doc/PyPI.md" if it is not in the
`MANIFEST.in`. Make sure the file is under version control, then
`check-manifest` takes care of `MANIFEST.in`.*

The `README.md` is the landing page for the project homepage. Use
`README.md` for project development notes. The project homepage
should link to the PyPI landing page (or the repository's copy of
PyPI.md) for the basic install/use/troubleshoot instructions.

## Follow these project and package naming rules

### 1. No dashes or underscores in the name

Avoid dashes and underscores.

Underscores are converted to dashes when listing packages with
`pip list`.

But dashes are not allowed in the package name when doing
`import`.

So using either underscores or dashes violates the next rule.

### 2. Project and Package use the same name

Make the project name the same as the package name so that:

```bash
$ pip install NAME
```

And

```python
>>> import NAME
```

Use the same NAME.

I broke this rule: `microspec` named its package `microspeclib`
planning for future packages that depend on `microspeclib`.

In hindsight, the better solution is to put those future packages
in their own distributions (then I could have named the package
`microspec` and dropped the `lib`).

This is better because it is simpler to test and document a
smaller project *and* it gives the end user more control over
what gets installed.

Future distributions, like `microspecgui` use the
`install_requires` parameter in `setuptools.setup()` to
automatically install `microspec`.

## Include data files

Projects depend on files that are not part of Python packages.
For example, project `mirospecgui` installs a GUI application,
`microspec-gui`. The application needs a font file and an image
file for the Window icon.

Here is the package structure:

```
.
├── doc
│   └── PyPI.md
├── LICENSE.md
├── MANIFEST.in
├── microspecgui
│   ├── __init__.py
│   ├── __main__.py
│   └── _gui
│       ├── consola.ttf
│       └── icon.png
├── README.md
└── setup.py
```

Using the generic `setuptools.setup()` call, the `_gui/` folder
is *not* included in the distribution because it is not a Python
package.

Here is that generic `setuptools.setup()`, ignoring the
irrelevant parameters that describe the project:

```python
setuptools.setup(
    ...
    packages=setuptools.find_packages(),
    entry_points={
        "console_scripts": [
            "microspec-gui=microspecgui.__main__:main",
            ],
        },
    install_requires=[
        "pygstuff",
        "microspec"
        ],
    ...
)
```

The `setuptools.find_packages()` includes the Python packages in
the distribution. The only package is `microspecgui`. `_gui/` is
a sub-folder of `microspecgui` but since it does not contain an
`__init__.py`, it is not a package, so it is not included.

A solution often-cited, but incorrect, is to put an empty
`__init__.py` file in the `_gui/` folder. This *does* make it a
package, which *does* include the folder in the distribution. But
the data files inside `_gui/` **are not included**.

Try it out for yourself. There are three steps to make this a
repeatable experiment:

```bash
$ rm -fr build/ dist/ microspecgui.egg-info/
$ check-manifest
$ python.exe setup.py sdist bdist_wheel
```

I will break these down step-by-step:

1. Clean out the old build:

```bash
$ rm -fr build/ dist/ microspecgui.egg-info/
```

2. Run `check-manifest` to be sure `MANIFEST.in` matches the Git
   index of files under version control:

```bash
$ check-manifest
```

If `MANIFEST.in` does not exist yet, create it from the Git index
of files under version control:

```bash
$ check-manifest --create
```

Here is the `MANIFEST.in` that is created:

```
include *.md
recursive-include doc *.md
recursive-include microspecgui *.png
recursive-include microspecgui *.ttf
```

*There is no reason to manually edit this file.*

As long as everything that *should be* under version control is
under version control (i.e., *is part* of the Git index),
`check-manifest --create` does the right thing.

Files are not part of the Git index if they are ignored in a
.gitignore, excluded in a .git/info/exclude, or simply new files
that have not been added to the index yet.

And if any files are under version control that *should not be*
under version control, `check-manifest` issues a warning and
specifies which files it recommends removing from the Git index.

`check-manifest` is fantastic.

3. Build:

```bash
$ python.exe setup.py sdist bdist_wheel
```

Now inspect the `sdist` (source distribution) and `bdist_wheel`
(build distribution) to see if they include the data files.

Look at the contents of the `sdist`:

```bash
$ tar --list -f dist/microspecgui-0.0.1a6.tar.gz
microspecgui-0.0.1a6/
...
microspecgui-0.0.1a6/microspecgui/__init__.py
microspecgui-0.0.1a6/microspecgui/__main__.py
microspecgui-0.0.1a6/microspecgui/_gui/
microspecgui-0.0.1a6/microspecgui/_gui/consola.ttf <-- yay!
microspecgui-0.0.1a6/microspecgui/_gui/icon.png    <-- yay!
...
```

So the `sdist` includes the data files if `MANIFEST.in` says to
include them. There is nothing extra to do. The generic
`setuptools.setup()` is sufficient *for the sdist*.

Look at the contents of the `bdist`:

```bash
$ python check-whl.py
microspecgui/__init__.py
microspecgui/__main__.py
microspecgui-0.0.1a6.dist-info/LICENSE.md
microspecgui-0.0.1a6.dist-info/METADATA
microspecgui-0.0.1a6.dist-info/WHEEL
microspecgui-0.0.1a6.dist-info/entry_points.txt
microspecgui-0.0.1a6.dist-info/top_level.txt
microspecgui-0.0.1a6.dist-info/RECORD
```

Where `check-whl.py` is this three line script:

```python
from zipfile import ZipFile
path = "dist/microspecgui-0.0.1a6-py3-none-any.whl"
print('\n'.join(ZipFile(path).namelist()))
```

The *bdist* is missing the data files.

The `_gui/` folder is completely missing.

What if I create `_gui/__init__.py`? *The data files are still
not there!* The `_gui/` folder *is included* but it does not
contain the icon and font files!

Nevermind the legacy-bollocks on StackOverflow. The fix is *one
line of code* in setup.py:

```python
setuptools.setup(
    ...
    packages=setuptools.find_packages(),
    entry_points={
        "console_scripts": [
            "microspec-gui=microspecgui.__main__:main",
            ],
        },
    install_requires=[
        "pygstuff",
        "microspec"
        ],
    include_package_data=True, # <-- adds data files to bdist
    ...
)
```

With the fix in place, redo the experiment:

```bash
$ rm -fr build/ dist/ microspecgui.egg-info/
$ check-manifest
$ python.exe setup.py sdist bdist_wheel
```

Make sure the `sdist` still has the data files:

```bash
$ tar --list -f dist/microspecgui-0.0.1a6.tar.gz
microspecgui-0.0.1a6/
...
microspecgui-0.0.1a6/microspecgui/__init__.py
microspecgui-0.0.1a6/microspecgui/__main__.py
microspecgui-0.0.1a6/microspecgui/_gui/
microspecgui-0.0.1a6/microspecgui/_gui/consola.ttf <-- yay!
microspecgui-0.0.1a6/microspecgui/_gui/icon.png    <-- yay!
...
```

Look at the contents of the `bdist`:

```bash
$ python check-whl.py
microspecgui/__init__.py
microspecgui/__main__.py
microspecgui/_gui/consola.ttf        <--- yay!
microspecgui/_gui/icon.png           <--- yay!
microspecgui-0.0.1a6.dist-info/LICENSE.md
microspecgui-0.0.1a6.dist-info/METADATA
microspecgui-0.0.1a6.dist-info/WHEEL
microspecgui-0.0.1a6.dist-info/entry_points.txt
microspecgui-0.0.1a6.dist-info/top_level.txt
microspecgui-0.0.1a6.dist-info/RECORD
```

Note that `pip install -e .` *is not* a way to test if data files
are included in the bdist. The symbolic link causes the
installation to behave as if the data files are included (because
they already exist locally on the developer's computer).

After `pip install microspecgui`, the data files are in the
virtual environment's `lib/site-packages/microspecgui/` folder,
using the exact same file structure shown above in the list of
the `whl` contents.

# Final Notes

Experimentation is key. Use TestPyPI because `pip install -e .`
can hide missing data files. And do all install tests inside
virtual environments.

Python packages used for packaging Python projects (e.g.,
`setuptools` and `wheel`) have changed significantly over the
past decade. Any information on the internet needs to be
cross-checked against the official documentation for that
package. Be especially careful of answers on StackOverflow.

For example, the "solutions" on StackOverflow about how to
include package data are contradictory and outdated.

I'm using `setuptools` because it's currently what is officially
recommended. But `poetry` seems like it will win out eventually
because it is based on Rust's *Cargo* package manager (which
people like) and people say it is simpler than using
`setuptools`.

Anyway, this XKCD comic sums it up best:

![https://xkcd.com/1987/](https://imgs.xkcd.com/comics/python_environment.png)


text:
# Copy constructor

Copying refers to copy memory or data.
A lot of time we want to copy objects but many time we want to make it optimize and stop unncessary copying.
We can also remove copying.

```c++
#include <iostream>

struct Vector2 {

    float x, y;
};

int main()
{
    int a = 2;
    int b = a;
    //here we are copying the value of a to b
    //with classes also this works the same way;
    Vector2 va = { 2,3 };
    Vector2 vb = va; //here we are just copying

    Vector2* vg = new Vector2();
    Vector2* vj = vg; //this is going to be different as vg is a pointer
    //now both willbe pointing the same value as its copying same position
    //we are copying the memory address
    std::cout << "Hello World!\n";
}
```

So with this in mind lets write the string class and make it copyable

```c++
#include <iostream>
#include<string>

class String
{
private:
	char* buffer;
	unsigned int m_size;
public:
	String(const char* string)
	{
		m_size = strlen(string);
		buffer = new char[m_size+1];
		memcpy(buffer, string, m_size);
		buffer[m_size] = 0;
	}
	friend std::ostream& operator<<(std::ostream& stream, const String& string);
};

std::ostream& operator<<(std::ostream& stream, const String& string)
{
	stream << string.buffer; //since this is private so we made this as a freind function
	return stream;
}

int main()
{

	String string = "shaksham";
	std::cout << string;
	return 0;

}
```

Above we are not deleting the pointer so we can use delete keyword in the destructor of the class

Now lets try to copy the String

```c++
#include <iostream>
#include<string>

class String
{
private:
	char* buffer;
	unsigned int m_size;
public:
	String(const char* string)
	{
		m_size = strlen(string);
		buffer = new char[m_size+1];
		memcpy(buffer, string, m_size);
		buffer[m_size] = 0;
	}
	~String()
	{
		delete[] buffer;
	}
	friend std::ostream& operator<<(std::ostream& stream, const String& string);
};

std::ostream& operator<<(std::ostream& stream, const String& string)
{
	stream << string.buffer; //since this is private so we made this as a freind function
	return stream;
}

int main()
{

	String string = "shaksham";
	String second = string;
	std::cout << string;
	std::cout << second;
	return 0;

}
```

Here c++ just takes whatever member we have and takes its value and copy that, What we have now we have it has done the shallow copy i.e it has copied the memory address , i.e the memory address of the buffer is same.

here we copying the string, so shaksham will be printed twice but once the program exits what will happen is both the object will try to delete the buffer , when second one try to delete, then the first one already has deleted that so this gives the error.

Trying to delete the same memory twice.

```c++
#include <iostream>
#include<string>

class String
{
private:
	char* buffer;
	unsigned int m_size;
public:
	String(const char* string)
	{
		m_size = strlen(string);
		buffer = new char[m_size+1];
		memcpy(buffer, string, m_size);
		buffer[m_size] = 0;
	}
	~String()
	{
		delete[] buffer;
	}
	char& operator[](unsigned int index)
	{
		return buffer[index];
	}

	friend std::ostream& operator<<(std::ostream& stream, const String& string);
};

std::ostream& operator<<(std::ostream& stream, const String& string)
{
	stream << string.buffer; //since this is private so we made this as a freind function
	return stream;
}

int main()
{

	String string = "shaksham";
	String second = string;
	string[2] = 'o';
	std::cout << string;
	std::cout << second;
	return 0;

}
```

Uisng the above code we can see that both the string changes but we are making the changes in only one.

To avoid this we can make deep copy and not the shallow copy.
Shallow copy is not gonna go to the content oof the pointer and copy that as well.

Deep copy does both , so we have to write a copy constructor.

c++ provide default copy constructor

```c++
#include <iostream>
#include<string>

class String
{
private:
	char* buffer;
	unsigned int m_size;

public:
	String(const char* string)
	{
		m_size = strlen(string);
		buffer = new char[m_size+1];
		memcpy(buffer, string, m_size);
		buffer[m_size] = 0;
	}
	//copy constrcutor
	//by default it just does member copy
	String(const String& other) :m_size(other.m_size)
	{
		buffer = new char[m_size + 1];
		memcpy(buffer, other.buffer, m_size);
		buffer[m_size] = 0;
	}

	~String()
	{
		delete[] buffer;
	}
	char& operator[](unsigned int index)
	{
		return buffer[index];
	}

	friend std::ostream& operator<<(std::ostream& stream, const String& string);
};

std::ostream& operator<<(std::ostream& stream, const String& string)
{
	stream << string.buffer; //since this is private so we made this as a freind function
	return stream;
}

int main()
{

	String string = "shaksham";
	String second = string;
	string[2] = 'o';
	std::cout << string<<std::endl;
	std::cout << second<<std::endl;
	return 0;

}
```

Now this works prefectly fine.

license: MIT

repository: Arslan-Z/cplusplusCHERNO

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Arslan-Z/cplusplusCHERNO


text:
### [CVE-2023-1836](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-1836)
![](https://img.shields.io/static/v1?label=Product&message=GitLab&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Improper%20neutralization%20of%20input%20during%20web%20page%20generation%20('cross-site%20scripting')%20in%20GitLab&color=brighgreen)

### Description

A cross-site scripting issue has been discovered in GitLab affecting all versions starting from 5.1 before 15.9.6, all versions starting from 15.10 before 15.10.5, all versions starting from 15.11 before 15.11.1. When viewing an XML file in a repository in "raw" mode, it can be made to render as HTML if viewed under specific circumstances

### POC

#### Reference
- https://gitlab.com/gitlab-org/gitlab/-/issues/404613

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
# Hyperledger Besu sample project

## Running the sample project locally

1. Compile contracts, build project, and install Hyperledger Besu:
   `gradle clean build installBesu`

2. Start Hyperledger Besu:
   `build/besu-1.5.0/bin/besu --config-file=config.toml`

3. Wait until you see `Ethereum main loop is up`

4. From another terminal at your sample project directory, compile and start your application:
   `gradle run`

## Running the sample project in a container

`appsody run`

repository: freight-trust/HyperledgerBesuGenerators

gha_language: Java

repo_name: freight-trust/HyperledgerBesuGenerators


text:
## lineEncoding

### Description
> Given a string, return its encoding defined as follows:

* First, the string is divided into the least possible number of disjoint substrings consisting of identical characters
  * for example, "aabbbc" is divided into ["aa", "bbb", "c"]
* Next, each substring with length greater than one is replaced with a concatenation of its length and the repeating character
  * for example, substring "bbb" is replaced by "3b"
* Finally, all the new strings are concatenated together in the same order and a new string is returned.

### Example

### Input/Output

* #### [execution time limit] 4 seconds (py)

* #### [input]

 	<i>Guaranteed constraints:</i>

* #### [output]


text:
## 1.0.2
* fix users post call
## 1.0.2
* added underscore to string class if not rails env

## 1.0.1
* Fixed file require for irb

## 1.0.0
* Added rhoconnect API methods
* Changed namespace from Rhoconnect to Rhoconnectrb
* `rhoconnect_query` now takes an attributes hash
* Added default settings for easier setup w/ RhoConnect apps
* Travis build support for JRuby

repository: rhomobi/rhoconnect-rb

repo_name: rhomobi/rhoconnect-rb


text:
![partychurch](https://github.com/forivall/partychurch/blob/master/icon/partychurch.png)

# partychurch
A web-based pseudo-livestreaming site accompanied by ephemeral chat that lets viewers send simple,
short messages along with a short video of themselves.

## Proof of Concept Features

### Broadcaster ("BC")
- Can record looping video up to 30 seconds long, and change the record duration, playback duration,
  and recording fps
- Can login with username/password

### Viewers
- Send a message to anyone connected to the same partychurch server / room (must include gif)
- Provides jpeg (filmstrip-style) videos alongside chats
- No signup required for viewers

## Future Features

### Admin
- Analytics tracking (google analytics)

### Broadcaster
- Can login with slack or discord (or hoodie?) organization login
- Can send messages inline with chat, with or without gif
- Can set room theme, title, chat message settings, etc.
- Can preview a gif before it is sent
- Can pause recording
- Frame by frame recording

### Viewers
- Show count of viewers
- Playback is synchronised globally, so that you can have many computers showing the same broadcast
  and it will all be in unison (will need to allow some config for display lag with TVs etc)
- Forbid users from sending messages without a webcam (configurable by BC)
- Allows for muting users based on their ID, removing all their current messages and blocking any
  future ones

### Moderators
- Mute and ban users

## Running a server

partychurch requires [node](http://nodejs.org) >=8.0.0. Recommended deployment
is with zeit.

## Socket Protocol
The protocol of partychurch is built around socket.io 2.0, making use of binary frames where
appropriate. socket.io acks are used for all messages from the client to the server.

### Connecting
Upon connecting, clients must send a fingerprint to the server. This fingerprint should uniquely
identify a particular client, and be relatively stable. Examples of good choices for this would be
a hardware identifier (e.g. Android ID), or a fingerprint constructed from many data points that
don't change often (e.g. fingerprintjs). Bad choices are things like IP addresses, since these could
potentially change a lot, as well as collide for multiple users.

To send the fingerprint, clients simply emit a `fingerprint` message with the fingerprint data as
the body, i.e.
```javascript
io.emit('fingerprint', 'myCoolFingerprint')
```

The server will reply with a `userid` message containing the ID it has calculated for this client,
which should be saved so that a client can recognize which messages are its own. This ID will be
constant for the lifetime of the websocket connection. An example of handling the message would be:
```javascript
io.on('userid', function(userId) {
  myId = userId
})
```

Clients should then specify what they want to watch / broadcast

```javascript
io.emit('join', {
  room: 'sanctuary',
  role: 'broadcaster', // or 'viewer'
  credentials: {
    password: 'imthebroadcaster'
  }
})
```

A user can only be in one room at a time.

### Messages

#### Receiving
Messages are transmitted to clients using the `chat` message. The format of the data passed in this
message is:
```javascript
{
  "video": {
    "data": ArrayBuffer(),
    "type": "jpg",
    "mime": "image/jpeg",
    "frames": 25,
    "duration": 5000
  },
  "text": "The text the user sent",
  "sent":<PHONE_NUMBER>231,
  "userId": "TheUserIDOftheSender"
}
```

Currently, `type` and `mime` will always be 'jpg' and 'image/jpg'. `sent` is a
unix timestamp corresponding to when the message was originally sent.

#### Sending
Clients can send messages by sending a `chat` message themselves, with the first parameter in the
following format:
```json
{
  "text": "The text the user wants to send",
  "ack": "AUniqueIdTheServerShouldAckWith",
  "video": {
    "format": "image/jpeg",
    "frames": 10,
    "duration": 2000
  }
}
```

Clients should send an array of `n` frames (as binary) as the second parameter, e.g.
```javascript
io.emit('chat', message, frames)
```

`format` specifies what format these frames are in. At present, only `image/jpeg` is accepted.
`frames` specifies how many frames are being sent. `duration` indicates how long the video will play

### Broadcasts

Broadcasts are transmitted to clients using the `broadcast` message. The format of the data passed
in this message is as follows:

```javascript
{
  "video": {
    "data": ArrayBuffer(),
    "type": "jpg",
    "mime": "image/jpeg",
    "frames": 25,
    "duration": 5000
  },
  "image": {
    "data": ArrayBuffer(),
    "mime": "image/jpeg",
  },
  "text": "The text the broadcaster sent",
  "sent":<PHONE_NUMBER>231,
  "userId": "TheUserIDOftheSender"
}
```

#### Sending
Broadcasters can send messages by sending a `broadcast` message, with the first parameter in the
following format:
```js
{
  "text": "The text the broadcaster wants to show",
  "video": {
    "format": "image/jpeg",
    "frames": 10,
    "duration": 2000,
    "frameData": [ArrayBuffer()...]
  },
  "image": {
    "format": "image/jpeg", // or "image/png", "image/gif"
    "data": ArrayBuffer()
  }
}
```

### Status updates
The server will send clients a number of different status updates to allow things like user counts
to be known. These are all handled through seperate messages, which are:

#### active
Specifies how many users are currently connected.
```javascript
io.on('active', function(numActive) {
  alert('There are ' + numActive + ' viewers in your room!')
})
```

#### settings
Updates the room settings, set by the broadcaster. Title, theme, chat message
settings, etc.

## License
MIT

repository: forivall/partychurch

gha_language: TypeScript

repo_name: forivall/partychurch


text:
## Redux
```
Redux is a predictable state container for JavaScript applications. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test.

Simply put, Redux is a state management tool. With Redux, the state of your application is kept in a store and each component can access any state that it needs from this store.
```

## Actions
Actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using `store.dispatch()`.

Actions are plain JavaScript objects. Actions must have a type property that indicates the type of action being performed.
```
# action example

{
  type: ADD_TODO,
  text: 'Build my first Redux app'
}

# action creator example

function addTodo(text) {
  return {
    type: ADD_TODO,
    text
  }
}
```

## Reducers
Reducers specify how the application's state changes in response to actions sent to the store. Remember that actions only describe what happened, but don't describe how the application's state changes. Remember that actions only describe what happened, but don't describe how the application's state changes.
```
function todoApp(state = initialState, action) {
  switch (action.type) {
    case SET_VISIBILITY_FILTER:
      return Object.assign({}, state, {
        visibilityFilter: action.filter
      })
    default:
      return state
  }
}
```

- Redux doesn't mutate the state

## Store
The Store is the object that brings actions and reducers together. The store has the following responsibilities:
- Holds application state;
- Allows access to state via getState()
- Allows state to be updated via dispatch(action)
- Registers listeners via subscribe(listener)
- Handles unregistering of listeners via the function returned by subscribe(listener)

```
import { createStore } from 'redux'
import todoApp from './reducers'
const store = createStore(todoApp)
```

There is only a signle store in a Redux application.

## React-redux
Official React bindings for Redux

- https://react-redux.js.org/

## Reference

- Redux official website: https://redux.js.org/

- Why use Redux? Reasons with clear examples: https://blog.logrocket.com/why-use-redux-reasons-with-clear-examples-d21bffd5835/


text:
![Logo](https://i.imgur.com/t0W5aJe.png)

- - - -

* [SAPP SCRIPTS](https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/tree/master/SAPP%20SCRIPTS)
* [PHASOR SCRIPTS](https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/tree/master/PHASOR%20SCRIPTS)

> ## [REQUEST AN ADDON](https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/blob/master/REQUEST%20AN%20ADD-ON.md)

### SAPP LINKS
> * SAPP Lua API: [weblink](https://docs.google.com/document/d/1RAnl68RN8z0RAvJcPqnv94ngzWZ6xavaX1EHsAqHeJU/edit)
> * Sapp Forums: NO LONGER AVAILALBE

### PHASOR LINKS
> * Phasor Lua API for v057: [weblink](https://phasor.protonnebula.com/_phasor/docs/200/index.html)
###### V2 API weblink no longer available.
> * Phasor Forums: [weblink](http://phasor.proboards.com/)

#### Contributors: [weblink](https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/blob/master/CONTRIBUTING.md)
> Contributors are those whom have contributed code to my projects in some way.
> Sometimes I will use functions written by other people.
> In which case, their names will be credited in the relevant scripts (at the top) and their names will be listed in the CONTRIBUTING.md

Contact Me:
<EMAIL_ADDRESS>

![Logo](https://i.imgur.com/YI8iuLr.png)

repository: AelitePrime/HALO-SCRIPT-PROJECTS

repo_name: AelitePrime/HALO-SCRIPT-PROJECTS


text:
---
layout: default
---

# 1993-02-19 - Spreading Encryption to Political Groups (fwd)

## Header Data

From<EMAIL_ADDRESS>(Kelly Goen)

To<EMAIL_ADDRESS>Message Hash: b1160acee41eadaf70d77d9909db3dbf762b8f2e89bf4da000885ed67eeb19b3

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-02-19 20:43:43 UTC

Raw Date: Fri, 19 Feb 93 12:43:43 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Kelly Goen)
Date: Fri, 19 Feb 93 12:43:43 PST
To<EMAIL_ADDRESS>Subject: Spreading Encryption to Political Groups (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Forwarded message:
> From<EMAIL_ADDRESS>Fri Feb 19 12:28:13 1993
> Date: Fri, 19 Feb 93 12:07:00 -0800
> Message-Id<EMAIL_ADDRESS>> To<EMAIL_ADDRESS>> From<EMAIL_ADDRESS>(Timothy C. May)
> Subject: Spreading Encryption to Political Groups
>
>
> Kelly Goen expresses his outrage about the powerfreaks controlling the
> police/spy/military agencies and encourages us to help spread encryption
> and privacy technology to the groups figthing the government:
>
> Even though I'm a libertarian (small "l") anarchocapitalist who happened to
> vote for Perot (who has his defects!), I support some (but not all) of the
> liberal agenda. Especially as regards getting the government out of our
> lives. (And where I part company with many on the left is in the areas of
> interference in free markets, anti-discrimination laws, and other statist
> invasions of freedom and privacy.)
>
> -Tim May
>
> --
> Timothy C. May               | Crypto Anarchy: encryption, digital money,
><EMAIL_ADDRESS>      | anonymous networks, digital pseudonyms, zero
><PHONE_NUMBER>               | knowledge, reputations, information markets,
> W.A.S.T.E.: Aptos, CA       | black markets, collapse of governments.
> Higher Power: 2^756839 | Public Key: MailSafe and PGP available.

As a further note I have been in communication with John Dinardo
who has been spreading a LOT of information of this type
around the net and who was responsible for my personal
awareness of the PROMIS/INSLAW/BCCI/Cabazon affair , A reporter
named Danny Casarlo lost hist life in the middle of this,
The investigative journalist and whistleblower community
has many among it who would come forward if onyl
a anonymity guranteed by technology(not by a sysadms promise not to look)
type of network such as David Chaums thoughts express...
The information that could then come forth could make the effects
of crypto spread to the common man MUCH more pronounced and help
us put ALL of the cold warriors in therapy where
they so obviously need to be... JUST for the record I am a randist...
not a socialist AND it makes nodifference to me what a socialist
says he/she/it no matter what political stripe or pursuasion or
sexual orientation has an equal right of access to privacy and anonymity
if our constitution is to survive the onslaught of the federal intelligence
communitys move from the cold war to the drug war.

         cheers
         kelly

>

--

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Kelly Goen)](/authors/kelly_at_netcom_com_kelly_goen_)"

+ 1993-02-19 (Fri, 19 Feb 93 12:43:43 PST) - Spreading Encryption to Political Groups (fwd) -<EMAIL_ADDRESS>(Kelly Goen)_


text:
## Montreal Marathon 2016 Prediction Challenge

Prediction for participation as well as race times for Comp 551 class project in McGill University, Montreal, Canada

### Data :

Data is preprocessed and cleaned for Classification and Regression

### Source :

Data is gathered largely from [Sportstats.ca](https://sportstats.ca)

### License

MIT

repository: koustuvsinha/data-adventures

repo_name: koustuvsinha/data-adventures


text:
## Tracking Changes Reflection

- How does tracking and adding changes make developers' lives easier?
 Enables teams to work more effiecnetly by contoling versions.

- What is a commit?

- What are the best practices for commit messages?
It is best to commit often to not loose work. You should also use the present tense when creating commit messges .

- What does the HEAD^ argument mean?
HEAD is used to unstage an added file.

- What are the 3 stages of a git change and how do you move a file from one stage to the other?
git add - stages the file to be committed
git commit - commits the file to the local machine
git push - pushes file to github in the cloud.
One moves from one stage to the next in the command line.

- Write a handy cheatsheet of the commands you need to commit your changes?
 - master
 - git pull
 - git checkout
 - git checkout -b branch_name
 - work work work
 - git add
 - git commit -m "commit message"
 - git push origin branch_name
 - git checkout master
 - git fetch origin master
 - git merge origin/master

- What is a pull request and how do you create and merge one?
A pull request is a way of submitting contributions to a project through github.

- Why are pull requests preferred when working with teams?
They enable multiple people to work on the same directories at the same time and effeciently merge all the work together.


text:
# Scala.js typings for postcss-lab-function

Typings are for version 5.2.3

## Library description:
Use lab() and lch() color functions in CSS

|                    |                 |
| ------------------ | :-------------: |
| Full name          | postcss-lab-function |
| Keywords           | color, colors, comma, css, design, functional, lab, lch, notation, postcss, postcss-plugin, rgb, rgba, space, syntax |
| # releases         | 11 |
| # dependents       | 0.0 |
| # downloads        | 2.7276727333333332E7 |
| # stars            | 248.0 |

## Links
- [Homepage](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function#readme)
- [Bugs](https://github.com/csstools/postcss-plugins/issues)
- [Repository](https://github.com/csstools/postcss-plugins)
- [Npm](https://www.npmjs.com/package/postcss-lab-function)

## Note
This library has been generated from typescript code from first party type definitions.

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
# Twin Reflector Proxy - Core implementation

Core implementation handling ingress message streams and applying to Azure Digital Twins (i.e. topology operations) as well as the to embedded Azure IoT Hub (i.e. telemetry ingress).

Main features are:

- Message ingress handling from a Kafka topic (or Azure Event Hub).
- Local Azure Digital Twin entity caching to reduce ADT calls.
- Application of topology operations by leveraging the [ADT Java Management Client](/twin-management-client).
- Forward of telemetry ingress through [Azure IoT Device SDK](https://github.com/Azure/azure-iot-sdk-java/blob/master/doc/java-devbox-setup.md#installiotmaven).
- Optionally report ingress to [Azure Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/insights-overview).

See below for details.

## Message ingress handling

The ingress as well as optional feedback egress is message based and can either be connected to Kafka topics or Azure Event Hubs through its [Kafka API](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview).

All topics/Event Hubs can be [configured](/twin-reflector-proxy/twin-reflector-proxy-app) but as default they are set as:

- Topic: _proxyingress_ / Group: _proxyingresscg_
  - Inbound channel for ingress messages (topology and/or telemetry) according to [specification](/twin-reflector-proxy).
- Topic: _proxyfeedback_
  - Outbound channel for optional feedback. Both successful application as well as error case.
- Topic: _topologyoperations_
  - Inbound channel for receiving [ADT TopologyOperation](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-events-routing) events for cache invalidation. Note: ADT endpoint is automatically registered at startup time if it does not exist yet.

## Local ADT entity caching

The goal of the local cache is improve performance as well as reduce ADT calls in order to save cost and stay within the [public preview service limits](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-service-limits).

The cache is managed by listening to [ADT TopologyOperation](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-events-routing) event for entry invalidation.

Implementation leverages Spring Cache as abstraction layer. The default implementation is Caffeine as local cache but a central (e.g. Redis based) cache could be used as well.

## Application of topology operations

Topology operations are applied according to the [specification](/twin-reflector-proxy).

Supported [relationships](/twin-reflector-proxy/twin-reflector-proxy-api/src/main/java/com/microsoft/twins/reflector/model/Relationship.java) and [attributes](/twin-reflector-proxy/twin-reflector-proxy-api/src/main/java/com/microsoft/twins/reflector/model/IngressMessage.java) are documented in the API module.

## Forward of telemetry ingress

Telemetry ingress is by default based on a central _gateway_ device that has [Azure IoT Hub functionality](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-device-ingress) enabled and is directly attached to the tenant space topology element. This gateway will be created for the tenant if it does not exist yet.

As alternative the proxy can be provided with a _gateway_ relationship to another device that is marked in ADT as IoT Hub device.

## Report to Azure Application Insights

Inbound ingress is reported to Azure Application Insights as custom event with the metadata _correlationId_, _deviceId_ and and _messageType_.

repository: microsoft/azure-digital-twins-java

repo_name: microsoft/azure-digital-twins-java


text:
# AI Artist

Project intended for university course.
But also an interesting one.

To view the version 1 of video style transfer, click this [link](https://www.bilibili.com/video/av77410445)
To view the final version of video style transfer, click this [link](https://www.bilibili.com/video/av78332976)

------

**References:**
1. [Neural Style Transfer (TensorFlow)](https://www.tensorflow.org/tutorials/generative/style_transfer)

repository: teamclouday/AIArtist

repo_name: teamclouday/AIArtist


text:
# Intro

This repository contains all of our CI images which are used to build [Strongbox][strongbox].

# Build locally

You can use the `build.sh` script to build all of the images locally.
Check out `./build.sh -h` for the available commands.

Example
```
./build.sh ./images/alpine/Dockerfile.alpine
./build.sh ./images/alpine/jdk8
./build.sh ./images/alpine/jdk8/*mvn3.6*
./build.sh --snapshot ./images/alpine/jdk8/*mvn3.6*
```

# Structure

To keep things in order we have divided our images into two types - `base` and `jdk`.

## Base images

The `base` images contain packages/tools which are commonly used or necessary in multiple other images (i.e. jdk images or jdk images).

Each base image should be placed under a folder in `./images/` (i.e. `./images/alpine/`) and should be named using
the distribution they represent (i.e. `./images/alpine/Dockerfile.alpine`)

## JDK images (and build tools)

JDK images provide a specific JDK version (i.e. 8, 11, etc).
They are based on the `base` images and will inherit whatever tools are available there.

The files for jdk images are located in `./images/jdk$VERSION` and should be named using the distribution name, jdk version
and the build tool they contain (i.e. `./images/jdk8/Dockerfile.alpine.jdk8`, `./images/jdk8/Dockerfile.alpine.jdk8-mvn3.6`)

JDK images are tagged and published as `strongboxci/distribution_name:jdk${VERSION}-${BUILD_TOOL_WITH_VERSION}`

# Publishing

Our images are published in [docker hub](https://cloud.docker.com/u/strongboxci).

[<--# Generic links -->]: #
[strongbox]: https://github.com/strongbox/strongbox

repository: strongbox/ci-build-images

gha_language: Roff

repo_name: strongbox/ci-build-images


text:
---
displayed_sidebar: entitiesSidebar
---

# Enumeration: DiscountRuleType

## Enumeration Members

### FIXED

• **FIXED** = ``"fixed"``

#### Defined in

[models/discount-rule.ts:9](https://github.com/medusajs/medusa/blob/da7ea8c5d/packages/medusa/src/models/discount-rule.ts#L9)

___

### FREE\_SHIPPING

• **FREE\_SHIPPING** = ``"free_shipping"``

#### Defined in

[models/discount-rule.ts:11](https://github.com/medusajs/medusa/blob/da7ea8c5d/packages/medusa/src/models/discount-rule.ts#L11)

___

### PERCENTAGE

• **PERCENTAGE** = ``"percentage"``

#### Defined in

[models/discount-rule.ts:10](https://github.com/medusajs/medusa/blob/da7ea8c5d/packages/medusa/src/models/discount-rule.ts#L10)

repository: medusajs/medusa

branch_name: refs/heads/develop

repo_name: medusajs/medusa


text:
# Scala.js typings for mysql-import

Typings are for version 2.0

## Library description:
Import .sql into a MySQL database with Node.

|                    |                 |
| ------------------ | :-------------: |
| Full name          | mysql-import |
| Keywords           | nodejs, mysql, textfiles, import, sql |
| # releases         | 5 |
| # dependents       | 0.0 |
| # downloads        | 25270.666666666668 |
| # stars            | 35.0 |

## Links
- [Homepage](https://github.com/pamblam/mysql-import#readme)
- [Bugs](https://github.com/pamblam/mysql-import/issues)
- [Repository](https://github.com/pamblam/mysql-import)
- [Npm](https://www.npmjs.com/package/mysql-import)

## Note
This library has been generated from typescript code from [DefinitelyTyped](https://definitelytyped.org).

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.


text:
# cloud-provider-gcp

## Publishing gcp-controller-manager image

This command will build and publish
`gcr.io/k8s-image-staging/gcp-controller-manager:latest`:

```
bazel run //cmd/gcp-controller-manager:publish
```

Environment variables `IMAGE_REPO` and `IMAGE_TAG` can be used to override
destination GCR repository and tag.

This command will build and publish
`gcr.io/my-repo/gcp-controller-manager:v1`:

```
IMAGE_REPO=my-repo IMAGE_TAG=v1 bazel run //cmd/gcp-controller-manager:publish
```

repository: xichengliudui/cloud-provider-gcp

repo_name: xichengliudui/cloud-provider-gcp


text:
# WinDrawLib Authors

The following people (in alphabetical order) have contributed to the project.
(Please, make a pull request or let us know if you are missing in the list.)

**Antonio Scuri** (WWW: https://github.com/antonioscuri)
  * Contributed stoke style support.
  * Many minor improvements and fixes.

**Martin Mitáš** (WWW: https://github.com/mity, e-mail<EMAIL_ADDRESS>  * Main developer and maintainer.

repository: mity/windrawlib

gha_language: C

repo_name: mity/windrawlib


text:
# server-components-mdx-demo

[![screenshot](screenshot.png)](https://wooorm.com/server-components-mdx-demo/)

[Go to demo »](https://wooorm.com/server-components-mdx-demo/)

## Build

Clone this repo, `cd` into it, make sure you’re using Node 12+, and then:

```sh
npm i --legacy-peer-deps
npm run build
```

## Run

Then start an HTTP server in `build/`.

```sh
npx serve build/
```

## License

MIT

repository: ydrias/server-components-mdx-demo

repo_name: ydrias/server-components-mdx-demo


text:
# Circumstance

Circumstance allows you to register and evaluate setup blocks globally in your test suite. This is useful when you want to share big blocks of factory setups between tests.

## Example

Circumstance ships with helpers which you can include in your suite to have access to helpers like `load_circumstance`. In RSpec you can do the following:

```ruby
require 'circumstance'

RSpec.configure do |config|
  config.extend Circumstance::Helpers
end

Circumstance.define(:nuts_and_bolts) do
  let(:nuts_and_bolts) { create(:company, name: 'Nuts and Bolts') }
end

describe Company do
  load_circumstance :nuts_and_bolts

  it "has a name" do
    expect(nuts_and_bolts.name).to_not be_blank
  end
end
```

But you can also use it with other test suites.

```ruby
require 'circumstance'

class ActiveSupport::TestCase
  extend Circumstance::Helpers
end

Circumstance.define(:large_database) do
  before do
    @number_count = 10_000
    @number_count.times do
      ActiveRecord::Base.connection.execute("INSERT INTO numbers SET i = 1")
    end
  end
end

class NumberTest < ActiveSupport::TestCase
  load_circumstance :large_database

  test "counts all numbers" do
    assert_equal @number_count, Number.count
  end
end
```

You can nest circumstances within other circumstances to reuse base circumstances in others.

```ruby
    Circumstance.define(:company) do
      let(:company) { create(:company) }
    end

    Circumstance.define(:company_with_client) do
      load_circumstance :company
      let(:company_with_client) do
        company_with_client = company
        company_with_client.clients << create(:client)
        company_with_client
      end
    end
```

The `load_circumstance` method tries to figure out if a circumstance was previously loaded so you won't load them multiple times for the same context. If you do need to evaluate a circumstance multiple times or directly on a test class for some reason, that's possible too.

```ruby
Circumstance.evaluate(ActiveRecord::Base, :setup_mock_responses)

describe PunyHuman do
  Circumstance.evaluate(self, :setup_mock_responses)
  Circumstance.evaluate(self, :setup_mock_responses)
end
```

## What's happening to my tests?

You can follow along with what Circumstance is doing with your circumstances by setting a different log level or changing the logger instance.

When logging to $stderr is good enough for you, just lower the log level.

    Circumstance.logger.level = Logger::DEBUG

Alternatively you can swap out the entire logger.

    Circumstance.logger = Rails.logger

## Contributing

Circumstance is really tiny so any changes have big consequences. Please create an issue before hacking away at the code to discuss your changes. Thanks!

1. Create a ticket on GitHub describing **what** you want to change and **why** you want to change it
2. Discuss the changes
3. Write the code
4. Request a pull
5. Bask in glory

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

repository: procore/circumstance

gha_language: Ruby

repo_name: procore/circumstance


text:
# coala Configuration

| Metadata |                                                         |
| -------- | ------------------------------------------------------- |
| cEP      | 5                                                       |
| Version  | 2.2                                                     |
| Title    | coala Configuration                                     |
| Authors  | Lasse Schuirmann<EMAIL_ADDRESS>  |
|          | Adhika Setya Pramudita<EMAIL_ADDRESS>|
| Status   | Implementation Due                                      |
| Type     | Feature                                                 |

## Problem

One main pain point for our users is that coala is hard to configure. It tries
to provide full options to a full set of tools. At the same time we try to
provide an abstraction over the tools by e.g. giving the same setting names to
similar bears across languages so the user can reuse the same configuration for
other languages too.

By integrating lots of different existing tools with coala we have gained a huge
set of possible analysis but it makes it very hard to understand and configure
without knowledge about a particular tool. Also the conflict of bears versus
linter bears that effectively offer multiple "checks" or sets of analysis rises:
it is confusing to have to use multiple bears for one language for a set of
analysis that is provided by only one bear for another language.

Other problems of the configuration file are, that some duplication is involved,
especially when dealing with settings that are used for file collection.

## Proposal

One important aspect of coala and its usability is that the configuration of a
new language is as easy as possible. There should be no learning involved.
Naturally, one very good aspect of a good configuration would be that it can be
used for a new language without changing anything. Also, namespaces are a
honking great idea and explicit is better than implicit.

The following changes are proposed and illustrated in the mockup following this
paragraph:

- Implicit `default` section inheritance will be removed. (It will be kept with
  warning for some time to allow people to do the switch.)
- Explicit inheritance is possible by giving sections namespaces (`all.python`
  would inherit from the `all` section.)
- Values can be added to inherited values. E.g. `ignore += ./vendor` would take
  the inherited value and add `, ./vendor` to it. Note that additions within a
  section will not be possible! The configuration should describe a state and
  not a program and must remain flow insensitive.
- To specify, what analysis should be run the user will not have to care about
  bears. Instead, an `aspects` setting will be provided allowing the user to
  specify what `aspects` of their code should be analyzed. `aspects` could be
  `Spelling` or `Smell` and are namespaced such that `Redundancy.Clone` will be
  possible as well. `aspects` can be defined inclusive (analyze those aspects,
  with the `aspects` settings) or exclusive (analyze all but those aspects, with
  the `ignore_aspects` setting).
- Specifying `bears` manually will still be possible as it eases use especially
  for bear developers.

### Mockup

The following is a mockup of how a configuration could look like.

```ini
[all]
# Values can be added to inherited ones only, not within the section because
# a configuration should describe a state and not involve operations.
# A system wide coafile can define venv, .git, ... and we would recommend to
# always use += for ignore even in the default section to inherit those values.
# += always concatenates with a comma.
ignore += ./vendor

max_line_length = 80

# This inherits all settings from the `all` section. There is no implicit
# inheritance.
[all.python]
language = Python
files = **.py
aspects = Smell, Redundancy.Clone  # Inclusive

[all.c]
language = C
files = **.(c|h)
ignore_aspects = Redundancy  # Exclusive
```

An aspect could be writen by its fully qualified name (`Root.Redundancy.Clone`)
or partially qualified name (`Redundancy.Clone` or even `Clone`) and is case
insensitive. Note that writing by partial name could result in ambiguity. This
could be resolved by writing the expanded partially qualified name in such way
to remove the ambiguity or just write its fully qualified name.

In case of multiple aspects have the same taste name, ambiguity must be resolved
by prefixing the taste name with its aspect name. For example, `max_length` is a
taste of `Shortlog` and `LineLength`. Thus the `Shortlog` would be defined like
`Shortlog.max_length = 50`.

### Bear API

Bears will receive the aspects that should be checked as a parameter and results
will get metadata to indicate what aspect has been checked.

```python
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.bearlib.aspects import Root

# To define the aspects and languages for a bear using the bear metaclass
class RedundancyBear(LocalBear, aspects={
        'detect': [Root.Redundancy.Clone],
        'fix': [Root.Redundancy.UnusedImport]
}, languages=['C', 'Python']):

    # aspect instances are passed as parameter
    def run(self, filename, file, aspects):
        # No documentation required anymore for the bears.

        if unused_imports(file):
            # A bear may yield results for any aspect even if it's not selected.
            # coala will filter out only selected aspects.
            yield Result.from_values(aspect=Root.Redundancy.UnusedImport, ...)

        # Bears can save performance by only performing needed checks
        aspect = aspects.get(Root.Redundancy.Clone, False)
        if aspect:
            # Bears can access settings right from the aspect instance
            min_clone_tokens = aspect.min_clone_tokens

            # The aspect is tied to the result. coala now knows everything from
            # the aspect documentation!
            yield Result.from_values(aspect=aspect, ...)
```

### Naming of aspects and tastes

#### aspects

An aspect should just talk about a property of something, without qualifying it.
It should be named something like `Length` rather than `TooLong`. Then it should
be given the tastes.

For e.g. an aspect can be named as `Metadata.CommitMessage.Shortlog.Length` to
represent the length property of the shortlog (first line) of a commit message.

#### tastes

tastes are the values that are used to initialize the aspect settings. It should
not be something like `allow` or `check` which enables or disables an aspect,
rather it should be something more like a value which describes an aspect in a
specific, measurable way. It can be given as much context as needed but not
more.

For e.g. for the aspect `Metadata.CommitMessage.Shortlog.`
`FirstCharacterCasing`, set the taste `shortlog_starts_upper_case` as true if
the shortlog must begin with a upper case letter consistently, and false if the
opposite is true.

**Note:** aspects and tastes are orthogonal concepts and should never overlap.
Therefore extreme caution must be taken while naming aspects and tastes to avoid
any discrepancy and inconsistency in the future.

### aspectclass

The concept of aspects allows us to implement a consistency check and reduce
documentation redundancy. Instead of documenting settings and results in every
bear, we can create a new aspects class. A working implementation of the aspects
concept is available
[here](https://github.com/coala/coala/blob/cdaa239cc8e96e022f3b4e144e16a8a9303dcadd/coalib/bearlib/aspects/__init__.py).

An aspect can be defined as follows:

```python
from coalib.bearlib.aspects import Root

@Root.subaspect  # Every aspect is inherited from Root
class Metadata:  # The description can be given as a documentation comment
    """
    This describes any aspect that is related to metadata that is not your
    source code.
    """

@Metadata.subaspect  #  Now we can build a tree of aspects
class CommitMessage:
    """
    Your commit message is important documentation associated with your
    source code. It can help you to identify bugs (e.g. through
    `git bisect`) or find missing information about unknown source code
    (through `git blame`).

    Commit messages are also sometimes used to generate - or write
    manually - release notes.
     It is the
    most crucial part and summarizes the change in the shortest possible manner.
    """

# This is a leaf of the tree! It has to be well documented and bears will only
# implement leaves. However, users may use just Metadata.Shortlog to check for
# groups of aspects. This simplifies browsing aspect documentation:
#
# Whether the user wants to see/configure aspects precisely or roughly, he can
# just go deeper into the tree as needed.
@Shortlog.subaspect
class ColonExistence:
    """
    Some projects force you to use colons in the commit message shortlog (first
    line).
    """
    class docs:
        example = """
        FIX: Describe change further
        context: Describe change further
        """
        example_language = "English"
        importance_reason = """
        The colon can be a useful separator for a context (e.g. a filename) so
        the commit message makes more sense to the reader or a classification
        (e.g. FIX, ...) or others. Some projects prefer not using colons
        specifically: consistency is key.
        """
        fix_suggestions = """
        Add or remove the colon according to the commit message guidelines.
        """

    def style_paragraph(self):
        if self.shortlog_colon:
            return """
            Your commit message must have a colon. You can use the colon to
            give your commit message some context, for example::

                coafile: Add colon shortlog check
            """
        else:
            return """
            Your commit message must not contain a colon.
        else:
            return "Colon found in commit message shortlog."

    shortlog_colon = Setting[bool](
        "Whether or not the shortlog has to contain a colon.",
        (True, False), default=True)
```

This allows to show more information in results. Bears can give a custom result
message; however, by default the message can be generated from the settings of
the aspects with the `result_message` function.

`aspects` can also define a `style_paragraph` function that returns a small
paragraph describing how the user should write their source code according to
the given settings. This will be used to generate a full style definition from a
coala configuration.

Bears are expected to use all of the settings they get via the aspects.

## Implementation

The implementation will have to be two phased as we should ideally deprecate the
old way of using bears, keep it around for few releases and then phase it out
and remove unneeded source code.

### Gathering Metadata

To get all bears for a set of aspects, all bears will have to be collected. It
can then be filtered against its metadata to get only bears that analyze the
given aspects. This information should be cached to improve the performance.

### Bear Picking Strategy

If multiple bears provide the same aspects, then coala will pick one of them
with the following prioritization:

1. Could **fix** the problem, not only detect it.
2. Minimizing number of bears. For performance reason, it's faster to run 1 bear
   that can handle 10 aspect rather than 10 bears for 10 aspect.
3. Run under the most common runtime. Rather than have 2 external bear run with
   NodeJS and 2 with Ruby, try to get 4 that run under NodeJS.
4. Alphabetical order.

coala will emit a log message that state the name and reason for each picked
bear.

repository: coala/cEPs

repo_name: coala/cEPs


text:
Really simple Python Sentry with minimal dependencies.

Usage:

```
import ravensimple
try:
    foobar
except Exception:
    ravensimple.report_exception(dsn='http[s]://[key]:[secret]@[host]/[projectid]')
```

license: Unlicense

repository: zielmicha/raven-simple

repo_name: zielmicha/raven-simple


text:
# opusic-sys

[![Build Status](https://travis-ci.org/DoumanAsh/opusic-sys.svg?branch=master)](https://travis-ci.org/DoumanAsh/opusic-sys)
[![Build status](https://ci.appveyor.com/api/projects/status/crphcqtvtjctacm8/branch/master?svg=true)](https://ci.appveyor.com/project/DoumanAsh/opusic-sys/branch/master)
[![Crates.io](https://img.shields.io/crates/v/opusic-sys.svg)](https://crates.io/crates/opusic-sys)
[![Documentation](https://docs.rs/opusic-sys/badge.svg)](https://docs.rs/crate/opusic-sys/)

Bindings to [libopus](https://github.com/xiph/opus)

## Re-generate bindings

The feature `build-bindgen` is used to generate bindings.

To use it set env variable `LIBCLANG_PATH` to directory that contains clang binaries

## Requirements

### Unix and windows-gnu

Being able to build `libopus` which means you need make and gcc/clang

### MSVC toolchain

It uses statically pre-built binaries instead of building it on fly
As otherwise it is too bothersome.

repository: alyssais/opusic-sys

gha_license_id: NOASSERTION

repo_name: alyssais/opusic-sys


text:
# Puppy static routing module

[![Latest Stable Version](https://poser.pugx.org/raphhh/puppy-static-route/v/stable.svg)](https://packagist.org/packages/raphhh/puppy-static-route)
[![Build Status](https://travis-ci.org/Raphhh/puppy-static-route.png)](https://travis-ci.org/Raphhh/puppy-static-route)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Raphhh/puppy-static-route/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Raphhh/puppy-static-route/)
[![Code Coverage](https://scrutinizer-ci.com/g/Raphhh/puppy-static-route/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Raphhh/puppy-static-route/)
[![Total Downloads](https://poser.pugx.org/raphhh/puppy-static-route/downloads.svg)](https://packagist.org/packages/raphhh/puppy-static-route)
[![License](https://poser.pugx.org/raphhh/puppy-static-route/license.svg)](https://packagist.org/packages/raphhh/puppy-static-route)

Static routing module for Puppy framework.

See [Puppy framework](https://github.com/Raphhh/puppy) for more information.

## Installation

```
$ composer require raphhh/puppy-static-route
```

## Documentation

This module routes an uri to a template file. The router takes the request uri and tries to find an associated template.

Note that the template files must be in the dir "<template.directory.main>/public/".

If the request uri points to a dir and not a file, a default file will be searched. By default: "<dir>/index.html.twig".

If no file is found in the templates, it returns an HTTP 404 error.

## Config options

 - 'template.directory.main' => path to the directory of the template files.
 - 'template.file.default' => name of the file to search if the address points to a dir. Default: "index".
 - 'template.file.server.extension' => extension of the file to search if the address points to a dir. Default: ".html".
 - 'template.file.template.extension' => name of the template engine added to the file. Default: ".twig".

repository: Raphhh/puppy-static-route

repo_name: Raphhh/puppy-static-route


text:
## [0.0.7] (2018-03-07)

#### Bug Fixes

 * Fix missing **'ip address'** when row display VM with hypervisor 'pro'  (  *'vagrant arubacloud servers'* )

#### Documentation

 * changes in README.md

## [0.0.6] (2018-03-06)

#### Documentation

 * correct License info

## [0.0.5] (2018-03-06)

#### Features

 * added command **'snapshot'**  *create*, *delete*, *restore*, *list*  methods
 * changed command  **vagrant arubacloud servers**  :now output *'DC*, *'Id'* , *'status description'* .
 * parameter  **admin_password** ( in :arubacloud section) is removed and replaced by the directive **'nodename'.ssh.password** in vagrant config section.
 * added command **reload**   as  *power off* ( it's a 'shutdown ' and not 'power-off' forced)  and *power on*
 * after vagrant command *'up'* or *'reload'*, is executed a **synced_folder**
 * changed option **package_id** (in :arubacloud section) : valid values now are : *'small'*, *'medium'*, *'large'*, *'extra large'* ;
 * added new parameter  **endpoint**  (in :arubacloud section)  to define DataCenter Aruba can be used for the defined VM in Vagrantfile (
this parameter replaces *'nodename'.url* )
 * changed the use of **url** parameter  (in :arubacloud section) : should only be used when a new 'dc?' not yet included in this plugin ( override the *'nodename'.endpoint* value ).
 * added **[dc.]** (name of DataCenter) in output for command : *'up'*, *'reload'* , *'halt'*, *'arubacloud servers/templates'*, *'destroy'*, *'snapshot'*.

repository: Arubacloud/vagrant-arubacloud

repo_name: Arubacloud/vagrant-arubacloud


text:
---
description: This template creates a new Azure Machine Learning Workspace, along with an encrypted Storage Account, KeyVault and Applications Insights Logging
page_type: sample
products:
- azure
- azure-resource-manager
urlFragment: modules-machine-learning-workspace-0.9
languages:
- json
---
# Azure Machine Learning Workspace

![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/PublicLastTestDate.svg)
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/PublicDeployment.svg)

![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/FairfaxLastTestDate.svg)
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/FairfaxDeployment.svg)

![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/BestPracticeResult.svg)
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/modules/machine-learning-workspace/0.9/CredScanResult.svg)

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fmodules%2Fmachine-learning-workspace%2F0.9%2Fazuredeploy.json)
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fmodules%2Fmachine-learning-workspace%2F0.9%2Fazuredeploy.json)
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fmodules%2Fmachine-learning-workspace%2F0.9%2Fazuredeploy.json)

This module creates a new Azure Machine Learning Workspace, along with an encrypted Storage Account, KeyVault and Applications Insights Logging.

It is a simple module for creating a generic ML instance.

## Parameters

| Name | Type | Required | Description |
| :------------- | :----------: | :----------: | :------------- |
| workspaceName | string | No | Specifies the name of the Azure Machine Learning workspace.|
| storageAccountName | string | No | The name for the storage account to created and associated with the workspace.|
| keyVaultName | string | No | The name for the key vault to created and associated with the workspace.|
| applicationInsightsName | string | No | The name for the application insights to created and associated with the workspace.|
| location | string | No | Specifies the location for all resources.|

## Outputs

| Name | Type | Description |
| :------------- | :----------: | :------------- |
| workspaceName | string | Specifies the name of the Azure Machine Learning workspace.|
| storageAccountName | string | The name for the storage account to created and associated with the workspace.|
| keyVaultName | string | The name for the key vault to created and associated with the workspace.|
| applicationInsightsName | string | The name for the application insights to created and associated with the workspace.|
| location | string | Specifies the location for all resources.|

```apiVersion: n/a```

`Tags: Microsoft.Storage/storageAccounts, Microsoft.KeyVault/vaults, Microsoft.Insights/components, Microsoft.MachineLearningServices/workspaces, systemAssigned`

repository: Azure/azure-quickstart-templates

gha_language: Bicep

repo_name: Azure/azure-quickstart-templates


text:
om-tables
========

A sortable table created to learn Clojure/ClojureScript/Om.

## Dependencies

   * [Clojure](http://clojure.org/)
   * [Leiningen](http://leiningen.org/)

## Running

Run the following in your terminal from the project directory:
`lein run -m clojure.main script/figwheel.clj`

Open [http://localhost:3449/](http://localhost:3449/) in your browser.

repository: jasich/playground

repo_name: jasich/playground


text:
# Example-middleware

### Requirements
* [NodeJs](https://nodejs.org/) > 8.10.0
* NPM > 5.6.0 (included in node)
* Modern browser (not IE)

### Getting started
On the command line, run:
* `npm install`
* `npm start`

### Middleware for RaaP

This project exists for three objectives
* Allow automatic authenticated access to the RaaP platform
* Allow attaching of additional metadata to atoms
* Make the RaaP API easier to consume

#### Overview of the example domain
Throughout this tutorial, we will be be using a simplified subset of the Spam Act 2003 to demonstrate the middleware.
If you go to the Raap [Spam act 2003 simplified](https://raap.d61.io/#!/group/examples/domain/spam-act-2003-simplified) domain, you will see it modelled there.

We will be modelling the conditions for sending electronic communications. Put simply, in order to not be in breach of the law, you need to:
 * Get the recipient's permission
 * Be clear about who you are in the message
 * Provide the user an easy way to unsubscribe from future communications.

More information about this can be found on the [ACMA site](https://www.acma.gov.au/Industry/Marketers/Anti-Spam/Ensuring-you-dont-spam/acma---what-is-a-commercial-electronic-message---fs162-1). However, an in-depth knowledge of this domain is not neccessary.

#### Encoding the rules
If you look under the rules tab under this domain, we have only two rules:
1. Default sendCommercialElectronicMessage is FORBIDDEN
  * Overriden by: 2. Conditions required to send a commercial electronic message
2. If isConsentAcquired and isIdentityClear and hasUnsubscribeFunction then sendCommercialElectronicMessage is PERMITTED

Roughly speaking, we can understand it as sending commercial messages is forbidden UNLESS isConsentAcquired is true AND isIdentityClear is true AND hasUnsubscribeFunction is true.
Since we are interested in to see when sendCommercialElectronicMessage is PERMITTED, we have tagged that atom in the metadata.csv file with the goal "canSend" and the modality of "PERMITTED".

This means that when we POST to the endpoint /api/canSend/questions was are asking what questions we need to ask to fulfill that goal.

### GET /api/schema
This endpoint returns back all the atoms in the domain merged with the fields specified in csv/metadata.csv. The role of this csv file is to identify which atoms are the goal atoms and to provide a mechanism to attach additional pieces of metadata to individual atoms in the domain.

In this example, atomType and description is returned back from RaaP whereas question, goal and modality come from the metadata.csv.

Sample response:
````
{
    "hasUnsubscribeFunction": {
        "atomType": "BOOL",
        "description": "A commercial electronic message must contain a functional and legitimate 'unsubscribe' facility",
        "question": "Can a user easily unsubscribe?"
    },
    "isConsentAcquired": {
        "atomType": "BOOL",
        "description": "Consent means either express consent where it is given directly or inferred consent where it can be reasonably inferred from the conduct and the nature of business",
        "question": "Has the user provided consent either express or inferred?"
    },
    "isIdentityClear": {
        "atomType": "BOOL",
        "description": "A commercial electronic message must contain clear and accurate information about the individual or organisation who authorised the sending of the message",
        "question": "Is it clear who is sending the email?"
    },
    "sendCommercialElectronicMessage": {
        "atomType": "BOOL",
        "description": "A commercial electronic message is a message sent by email, sms, mms or instant messenger",
        "goal": "canSend",
        "modality": "PERMITTED"
    }
}
````

### POST /api/:goal/questions
This endpoint takes in an object of atom values and returns back the contributing atoms to reach the specified goals identified in metadata.
Under the hood, it calls the /input-atoms RaaP endpoint.

Sample request:
```
{
	"hasUnsubscribeFunction":true,
	"isConsentAcquired":true
}
```

Sample response:
```
{
    "isIdentityClear": {
        "atomType": "BOOL",
        "description": "A commercial electronic message must contain clear and accurate information about the individual or organisation who authorised the sending of the message",
        "question": "Is it clear who is sending the email?"
    }
}
```

### POST /api/:goal/answers
This endpoint takes in an object of atom values and returns back the reasoning result for each specified goal identified in metadata.
Under the hood, it calls the /reason RaaP endpoint.

Sample request:
```
{
	"hasUnsubscribeFunction":true,
	"isConsentAcquired":true,
	"isIdentityClear": true
}
```

Sample response:
```
{
    "sendCommercialElectronicMessage": {
        "result": {
            "PERMITTED": {
                "reasoningResult": "CONCLUSIVE"
            },
            "not": {
                "reasoningResult": "INCOMPLETE"
            },
            "FORBIDDEN": {
                "reasoningResult": "INCOMPLETE"
            },
            "reasoningResult": "INCOMPLETE"
        },
        "type": "BOOL",
        "atomType": "BOOL",
        "description": "A commercial electronic message is a message sent by email, sms, mms or instant messenger",
        "goal": "canSend",
        "modality": "PERMITTED"
    }
}
```
---
The Software is copyright (c) 2017 Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230. All rights reserved.

CSIRO grants you a licence to access the RaaP Sample Application on the terms of the MIT License published by the [Open Source Initiative](https://opensource.org/licenses/MIT) and included in this repository. Nothing in the MIT Licence derogates from any applicable Australian Consumer Laws that cannot be excluded.

DISCLAIMER AND UNDERTAKING
------------------------------------------------
By registering for access to the Regulation as a Platform API (RaaP API) the User acknowledges the following limitations on use.
          The digital rules and reasoner output:
1.    Have no status or standing in law.
2.    Do not represent any form of legal advice, or opinion of the relevant regulator.
3.    Cannot be relied upon for the purpose of decision making or compliance.
4.    Are provided to users for test purposes only to support the development of test applications - no guarantee is provided as to the accuracy of the rules or reasoner output.

By registering for access to the Regulation as a Platform API the User provides and agree to be bound by the following undertaking.
The User undertakes:
1.    To ensure that any third party accessing their software is made expressly aware of the above limitations on RaaP API use.
2.    Not to induce any reliance by a third party, directly or indirectly, or through any act or omission, on the rules or reasoner output via their software.
3.    Neither the name of CSIRO nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of CSIRO.


text:
# TestServices

Service Objects that provide useful benefits to your integration test suite.

## Installation

Add this line to your application's Gemfile:

    gem 'test_services', group: [:test]

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install test_services

## Usage

### Cucumber

Just require the cucumber file and all the cucumber service objects will become available.

```ruby
# features/support/my_configuration_file
require 'test_services/cucumber'
```

#### TableComparer

TableComparer lets you write a step definition representing an HTML Table and validate the text contents match

```gherkin
Then I should see the following search results:
| username | email address |
| Bobby    |<EMAIL_ADDRESS> |
```

And using it is as simple as:
```ruby
Then(/^I should see the following search results:$/) do |table|
  expect(TableComparer.new(table, "#search_results").matches?).to be_true
end
```

However you should also push this into a PageObject
```ruby
# features/support/pages/search_result_page.rb
class SearchResultsPage < SitePrism::Page
  def has_results_matching?(table)
    TableComparer.new(table, "#search_results").matches?
  end
end

# features/step_definitions/search_results_steps.rb
Then(/^I should see the following search results:$/) do |table|
  expect(SearchResultsPage.new).to have_results_matching(table)
end
```

## Contributing

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


text:
# Docs

This project's documentation is using vue-press to create a documentation site that can be launched in development or built so that it can be depoloyed on a server.

The config file in the vuepress folder contains the configurtion of the home page, the navigation and the sidebar. All pages are saved as md files and then generated as static html files. The search funtionality automatically based on the headings of the pages.

```js
# launch docs in development
$ yarn docs:dev

# launch docs in development
$ yarn docs:prod
```

repository: eliashourany/spotify-artists-search

repo_name: eliashourany/spotify-artists-search


text:
# Modifying an HTML / XML Document

## Changing text contents

Assuming we have the following HTML document:

~~~ ruby assets/modify-setup.rb

Let's change the header's text contents:

~~~ ruby assets/modify-change-content.rb

You'll notice that, when you use `#content=`, entities are properly
escaped. Pow!

## Moving nodes

The simplest method of moving a node is assign its parent:

~~~ ruby assets/modify-reparent.rb

But you could also arrange it next to other nodes:

~~~ ruby assets/modify-sibling.rb

## Modifying Nodes and Attributes

~~~ ruby assets/modify-nodes-and-attrs.rb

## Creating new nodes

Often the easiest thing to do is pass markup to one of the `Node` methods to create siblings:

~~~ ruby assets/modify-creating-new-nodes-with-tags.rb

or you can manually create a node object, if you're a detail-oriented person:

~~~ ruby assets/modify-creating-new-nodes.rb

## Wrapping a NodeSet

If you wanted to wrap new HTML around each node in a Nodeset, here's an example of how to do it:

~~~ ruby assets/modify-wrap.rb

## Adding a Processing Instruction

### (like <?xml-stylesheet?>)

If you want to add a processing instruction (a.k.a. "PI node"), like
an xml-stylesheet declaration, you should first create the node using
`Nokogiri::XML::ProcessingInstruction.new` and then add it to the
document as a previous-sibling of the root node:

~~~ ruby assets/modify-processing-instructions.rb


text:
# Slony Exporter

Prometheus exporter for a [Slony](https://www.slony.info) node

## Usage

~~~
export SLONY_CLUSTER=clustername
export POSTGRES_URL=postgresql://postgres@localhost:5432/test1
export PORT=9090
slony-exporter
~~~

The slony-exporter will listen for HTTP requests on port 9090 and respond with prometheus metrics as follows

|Metric name|labels|Description|
|-----------|------|-----------|
|slony_last_event|slony_origin|The last event generated on this node|
|slony_last_event_timestamp|slony_origin|The timestamp of the last event generated on the node|
|slony_confirmed_event|slony_origin,slony_receiver|The last event from slony origin(this node) that has been confirmed on the receiver and the confirmation has propogated back to this node(the origin)|
|slony_confirmed_event_timestamp|slony_origin,slony_receiver|The timestamp of when the last confirmed event was confirmed on the receiver|
|slony_received_event|slony_origin,slony_receiver|The last event from the remote origin(slony_origin) received by this node|
|slony_received_event_timestamp|The time the last event from slony_origin that has been received by this node hawas generated at. This is the time an event(which has propogated to this node, slony_receiver) was generated on a remote node(slony_origin)|
|slony_origin_sets|The replication sets that have slony_origin as the set origin. Each has a label of slony_set of the set id with a value of 1 if slony_origin is the origin of that set|

## Limitations

* HTTPS is not supported
* HTTP authentication is not supported
* Specifying SSL options for the SSL connection to postgresql including a key, client cert or CA is not
supported.

repository: ssinger/slony-exporter

repo_name: ssinger/slony-exporter


text:
# Office Navigation App

This is an office navigation app developed for the Sapient Razorfish (Publicis.Sapient) New York office during the summer of 2018 by tech interns Mark Abramov, Ted Chen, Jack Dishman, and Megan Massey.

This app was developed as a method of improving office culture. We had discovered through user interviews that both long-term legacy employees as well as newer hires were not aware of where other members of their teams sat or where the conference rooms were located. The facilities staff had also reported they had needed an app like this developed for the new office for several years to help visitors find conference rooms and people's seats more easily.

A live version of this app can be found at http://bit.ly/office-nav, and for security reasons can only be accessed while on the Sapient Razorfish NY office wi-fi network.

### Features
  - Locate conference rooms and see their capacities
  - Find employees in the office and those who sit near them
  - Switch between the eighth and ninth floors
  - Locate office facilities such as kitchen and restrooms
  - Auto-complete search, pre-populating the form with a list of locations
  - Provide answers to Frequently Asked Questions through the office handbook
  - Real-time updates of seating charts through the Contentful content infrastructure

### Demo
##### Autocomplete Search
![autocomplete](https://github.com/markab4/office-nav/blob/master/src/images/demo%20Autocomplete.png?raw=true)
##### When Destination is On a Different Floor
![switch floors](https://github.com/markab4/office-nav/blob/master/src/images/demo%20Head%20to%20the%20Stairs.png?raw=true)
##### Navigate the Facilities
![navigate facilities](https://github.com/markab4/office-nav/blob/master/src/images/demo%20Navigate%20facilities.png?raw=true)
##### Click on a Section and See Who Sits There
![people modal](https://github.com/markab4/office-nav/blob/master/src/images/demo%20People%20Modal.png?raw=true)
##### Navigate from a Person to a Room (or vice versa)
![people modal](https://github.com/markab4/office-nav/blob/master/src/images/demo%20Person%20to%20Room.png?raw=true)
##### Click on a Room to See More Information About It
![room modal](https://github.com/markab4/office-nav/blob/master/src/images/demo%20Room%20Modal.png?raw=true)

### Privacy
Due to employee privacy concerns, all employees names and API tokens have been excluded from this repository.

### Tech

Our office navigation app takes advantage of a number of technologies:

* [Contentful](https://www.contentful.com/) - Cloud-based content infrastructure platform to securely host employee information and allow real-time updates of seating
* [React/Redux](https://github.com/reduxjs/react-redux)
* HTML5/CSS
* [jQuery](http://jquery.com/)
* [Node Package Manager](https://www.npmjs.com/)

### Installation

```sh
$ git clone https://github.com/markab4/office-nav.git
$ cd office-nav
$ npm install
$ npm start
```


text:
## Dependencies:

### Golang backend dependencies

**BDS3-Clause**:

- github.com/google/uuid
- github.com/kabukky/httpscerts
- github.com/gorilla/mux
- github.com/fsnotify/fsnotify (TODO)

**Apache2.0**:

- github.com/spf13/cobra

**MIT**:

- github.com/mitchellh/go-homedir
- github.com/spf13/viper

## JS frontend dependencies

**MIT**

- https://github.com/facebook/react
- https://github.com/rexxars/react-markdown
- https://github.com/webpack/webpack
- https://github.com/webpack/webpack-cli
- https://github.com/webpack/webpack-dev-server
- https://github.com/ant-design/ant-design.git
- https://www.npmjs.com/package/codemirror
- https://www.npmjs.com/package/dagre
- https://www.npmjs.com/package/gg-editor
- https://www.npmjs.com/package/react-codemirror2
- https://www.npmjs.com/package/react-image-gallery
- https://www.npmjs.com/package/react-moment
- https://www.npmjs.com/package/recordrtc
- https://www.npmjs.com/package/react-player
- https://www.npmjs.com/package/ts-ebml
- https://www.npmjs.com/package/@babel/core
- https://www.npmjs.com/package/css-loader
- https://www.npmjs.com/package/style-loader
- https://www.npmjs.com/package/svg-inline-loader

## Icons

https://fontawesome.com (antd)
https://heropatterns.com (login background-svg)

https://github.com/jgraph/drawio (Icons)
Thanks: https://github.com/jgraph/drawio/tree/master/src/main/webapp/img/lib/active_directory

repository: c-f/lel

gha_language: JavaScript

repo_name: c-f/lel


text:
# UAV - the concourse pipeline generator

UAV can be used to generate and merge pipelines.  The original version is in the c++ directory and is the basis for the second golang version.

The golang version adds templating and a new `merge` directive to a concourse pipeline.

It's currently being dogfooded by us, and so far, it's useful.  Hopefully it can be useful for you too.

All the best.
The Finbourne Team.

repository: jhwbarlow/uav

repo_name: jhwbarlow/uav


text:
MASFoundation is the core iOS framework of the Mobile SDK, which is part of [CA Mobile App Services][mas.ca.com]. MASFoundation handles the communication and authentication layer of the Mobile SDK, making it easy for developers to establish a secure connection (TLS, Mutual SSL) to any CA Mobile API Gateway (MAG).

## Features

The MASFoundation framework has the following features:

- Authentication
    + OAuth
    + OIDC - OpenID Connect
    + BLE
    + Dynamic Client ID & Client Secret
    + QR Code
    + Social Login
    + Single Sign On
    + OTP - One Time Password
    + PKCE - Proof Key for Code Exchange
    + SSL Pinning with certificate, public key, or public key hash
- Dynamic SDK Configuration
- Enterprise Browser
- Geo Location

## Get Started

- [Download MASFoundation][download]
- Read the ["Getting Started" guide][get-started] or watch some [video tutorials][videos]
- Check out our [documentation][docs] for more details and sample codes

## Communication

- *Have general questions or need help?*, use [Stack Overflow][StackOverflow]. (Tag 'massdk')
- *Find a bug?*, open an issue with the steps to reproduce it.
- *Request a feature or have an idea?*, open an issue.

## How You Can Contribute

Contributions are welcome and much appreciated. To learn more, see the [Contribution Guidelines][contributing].

## Installation

MASFoundation supports multiple methods for installing the library in a project.

### Cocoapods (Podfile) Install

To integrate MASFoundation into your Xcode project using CocoaPods, specify it in your **Podfile:**

```
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

pod 'MASFoundation'
```
Then, run the following command using the command prompt from the folder of your project:

```
$ pod install
```

### Manual Install

For manual install, you add the Mobile SDK to your Xcode project. Note that you must add the MASFoundation library. For complete MAS functionality, install all of the MAS libraries as shown.

1. Open your project in Xcode.
2. Drag the SDK library files, and drop them into your project in the left navigator panel in Xcode. Select the option, `Copy items if needed`.
3. Select `File->Add files to 'project name'` and add the msso_config.json file from your project folder.
4. In Xcode "Build Setting” of your Project Target, add `-ObjC` for `Other Linker Flags`.
5. Import the following Mobile SDK library header file to the classes or to the .pch file if your project has one.

```
#import <MASFoundation/MASFoundation.h>
```

## Set Up Project and Start the SDK

The following ***video*** describes how to set up the project and start the Mobile SDK.

[![IMAGE ALT TEXT](http://img.youtube.com/vi/h95MF55Uuuw/0.jpg)](http://www.youtube.com/watch?v=h95MF55Uuuw "Starting the SDK")

After your project is properly configured, you must start the SDK to establish a secure connection with the backend services. The startup process includes: initialize necessary services for library (such as geo-location, BLE, and network services), and load configuration.

Ideally, SDK startup should be processed before app startup (during the splash/loading screen of your app). We recommended that you process any communication with the backend services upon successful completion of the startup method. Otherwise, the secure communication is not guaranteed and may fail.

MASFoundation includes the following methods to start the SDK.

##### Start with standard method
```objectivec
    //Initializing the SDK.
    [MAS start:^(BOOL completion, NSError *error) {
        //Your code here!
    }];
```
This method starts the SDK with the currently-active configuration. A currently-active configuration is: 1) the last successfully used configuration, 2) the default JSON configuration file (i.e. msso_config.json in your app bundle) or 3) the custom JSON configuration file defined in `[MAS setConfigurationFileName:]`.

**Recommended for**: Most environments, including production.

##### Start with default configuration
```objectivec
    //Initializing the SDK.
    [MAS startWithDefaultConfiguration:YES completion:^(BOOL completed, NSError *error)
        //Your code here!
    }];
```
This method starts the SDK with the currently-active configuration, or the default configuration (depending on the parameter). If you specify the `YES` parameter, this overwrites the currently-active configuration with the default configuration (if two configurations are different.). If you pass the `NO` parameter, this behaves the same as `[MAS start:];`. If the SDK is already started, this method: stops the SDK, then restarts it with the custom JSON object.

**Recommended for**: Development environments where configurations change often.

##### Start using custom JSON
```objectivec
  //Your custom JSON object.
  NSDictionary *jsonObject = @{....};

  //Initializing the SDK with custom JSON object.
  [MAS startWithJSON: jsonObject completion:^(BOOL completed, NSError *error) {
    //Your code here!
  }];
```
This method starts the SDK using the custom JSON object in, NSDictionary. This method overwrites the currently-active configuration with the custom JSON object, and stores it as the active configuration. If the SDK is already started, this method: stops SDK, then it restarts it with the custom JSON object.

**Recommended for**: Using multiple MAG servers so you can dynamically change the configuration during runtime. Note: The backend servers must have a version of the product that supports dynamic configuration.

##### Start using file URL
```objectivec
    NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"your_file_name"
                                                         ofType:@"json"];
    NSURL *thisURL = [NSURL fileURLWithPath:jsonPath];

    //Initializing the SDK with file URL of JSON configuration.
    [MAS startWithURL:thisURL completion:^(BOOL completed, NSError *error) {
        //Your code here!
    }];
```
This method starts the SDK using the custom JSON configuration file. The custom file can be defined in NSURL format, which indicates the path of the custom file. This method overwrites the currently-active configuration with the custom JSON file, and stores it as the active configuration. If the SDK is already started, this method: stops the SDK, then restarts it with the custom JSON file.

The SDK accepts the NSURL only with __local file path__. If the Web URL is provided, the startup method fails.

**Recommended for**: Using multiple MAG servers so you can dynamically change the configuration during runtime. Note: The backend servers must have a version of the product that supports dynamic configuration.

## Documentation

For more documentation and API references, go to our [main website][docs]

## License

Copyright (c) 2016 CA. All rights reserved.

This software may be modified and distributed under the terms
of the MIT license. See the [LICENSE][license-link] file for details.

 [mag]: https://docops.ca.com/mag
 [mas.ca.com]: http://mas.ca.com/
 [get-started]: http://mas.ca.com/get-started/
 [docs]: http://mas.ca.com/docs/
 [blog]: http://mas.ca.com/blog/
 [videos]: https://www.ca.com/us/developers/mas/videos.html
 [StackOverflow]: http://stackoverflow.com/questions/tagged/massdk
 [download]: https://github.com/CAAPIM/iOS-MAS-Foundation/archive/master.zip
 [contributing]: https://github.com/CAAPIM/iOS-MAS-Foundation/blob/develop/CONTRIBUTING.md
 [license-link]: /LICENSE


text:
# GitHub/RailsRenderLiteral

tldr; `render` MUST be passed a string literal template path.

* When used in conjunction with `GitHub/RailsViewRenderPathsExist`, linters can ensure the target file exists on disk and would not crash rendering a missing template.
* Makes it easier for humans to trace callers of a template. Simply search for the full path of the target template to find **all** call sites.
* This same call site tracing enables automated unused template checking. If no callers are found, the template can be safely removed.
* Enables render precompilation and inlining optimizations. Target templates can be compiled and inlined on boot time rather than deferring to first render to lazily compile templates.

repository: github/rubocop-github

repo_name: github/rubocop-github


text:
---
layout: post
title:  "Safe and Stable Control Synthesis for Uncertain System Models via Distributionally Robust Optimization"
date:   2023-06-01 22:21:59 +00:00
image: /images/DRCCP_compare1.PNG
categories: research
authors: "Kehan Long*, Yinzhuang Yi*, Jorge Cort\u00E9s, Nikolay Atanasov"
venue: "2023 American Control Conference"
arxiv: https://arxiv.org/abs/2210.01341
---

This paper considers enforcing safety and stability of dynamical systems in the presence of model uncertainty. We assume that only a finite set of model parametric uncertainty samples is available and formulate a distributionally robust chance-constrained program (DRCCP) for control synthesis with CBF safety and CLF stability guarantees. To facilitate efficient computation of control inputs during online execution, we present a reformulation of the DRCCP as a second-order cone program (SOCP).

extension: markdown


text:
# typescript-mongoose-typegoose-mongoose-graphql

Template starter project to develop `TypeScript` backend with `GraphQL` strongly typed models
`NodeJS`, `MongoDB`, `GraphQL`, `Apollo` and `Express`.

# In order to run project put in .env file something like:
DATABASE_URL=mongodb://localhost:27017/typegoose
PORT=2020
PASSWORD_SALT=xx

# Running
* clone the repo
* npm i
* npm run dev
* go to localhost:2020/graphql

# GraphQL Queries:

    # getUser
    query{ getUser(id: "5ce1b0dc0b3d81401b0971a1") {
      username
      id
      role
    }}

# GraphQL Mutations:

    # createUser
    mutation {
      createUser( name:"adyx", password:"123456") {
        id
        username
      }
    }

    # login
    mutation{ login(req: { username: "adyx", password: "123456"} ) {
      jwt
    }}

# Credits
Inital fork of this project came from
https://github.com/Veetaha/typegraphql-typegoose-express-react-template