text:
![Cartoview Logo](../img/cartoview-logo.png)
# Cartoview Installation | Docker

## Introduction
This document describes the installation of Cartoview using Docker on either [Ubuntu 18.04](#for-ubuntu-1804) or [Windows 10](#for-windows-10).

## Installation Requirements

#### For Ubuntu 18.04:

- **Install Docker**

***

In order to be able to run Cartoview with docker engine, Docker Compose should be installed, but because it relies on Docker Engine, we will install ``docker`` first from [Docker official website][1].

1. Install **Docker Engine**, navigate to [this guide][2]. We recommend to install it using [docker repository][3].

2. Install **Docker Compose**, navigate to [this guide][4].

[1]: https://docs.docker.com/get-docker/
[2]: https://docs.docker.com/engine/install/ubuntu/
[3]: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
[4]: https://docs.docker.com/compose/install/

!!! note
    The Docker daemon needs to use root privileges, so we must prefix each docker command with ``sudo``, but if you want to run them without ``sudo``, check [How to manage Docker as a non-root user][5].

[5]: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

**Validate Docker Installation**

To make sure Docker is installed successfully, run the following command.
```shell
docker --version
# Docker version 19.03.8, build afacb8b
docker-compose --version
# docker-compose version 1.25.4, build 8d51620a
```

- **Install Python2.7 and Django**

***

In order to run Cartoview, we need to install python and django.

```shell
sudo apt-get update
sudo apt-get install python-django
```

#### For Windows 10:

- **Install Docker**

***

Docker has two applications, you can use one of them:

    1. **[Docker Desktop](#using-docker-desktop)** but it has [specific system requirements][6] that must be met.

[6]: https://docs.docker.com/docker-for-windows/install/#system-requirements

    2. **[Docker Toolbox](#using-docker-toolbox)** which is used for systems that do not meet the requirements of Docker Desktop.

###### Using Docker Desktop:

Walk through this guide to download and install [Docker Desktop][7].

[7]: https://docs.docker.com/docker-for-windows/install/

!!! warning
    Before installing Docker Desktop, please read carefully the [What to know before you install][8] section.

[8]: https://docs.docker.com/docker-for-windows/install/#what-to-know-before-you-install

Proceed with installation and leave everything as default.

After installing docker desktop, we need to start it. In the search-bar, search for **Docker**, and select **Docker Desktop** in the search results.

When the whale icon in the taskbar stays steady, **Docker Desktop** is up-and-running, and is accessible from any terminal window.

!!! note
    If you right-click on the whale icon, you can check multiple features like docker version, docker hub, dashboard, etc.

    ![Docker Whale](../img/installation/Docker/whale_icon.png)

**Docker Dashboard** provides a useful interface to handle and control all the available containers easily. Please visit [Docker Desktop Dashboard][9] for more details.

[9]: https://docs.docker.com/docker-for-windows/dashboard/

***
**Optional | Configure Docker Resources**

You may want to change the default resources given to Docker to speed up operations that will be done on the containers.

Right-click on the whale icon, select **Settings**, navigate to **Resources** tab and change the resources as you wish.

![Docker Resources](../img/installation/Docker/docker_resources.png)
***

###### Using Docker Toolbox:

Walk through this guide to download and install [Docker Toolbox][10] untill you got the terminal in which we will execute the following commands.

[10]: https://docs.docker.com/toolbox/toolbox_install_windows/

!!! note
    **Docker Toolbox** by default, is configured to use IP address ``<IP_ADDRESS>`` so instead of using ``localhost`` we will use this IP address.

After installing one of the docker applications above, Validate Docker Installation by opening ``Windows PowerShell`` and execute the following command:

**Validate Docker Installation**

After installing one of the docker applications above, validate docker installation by checking its version.

At any directory, ``right-click with left-Shift`` on the free space and select ``Open Windows PowerShell here``.

This will open a terminal in which we will execute all the upcoming commands. Just copy-paste the commands and hit the Enter button.

```shell
docker --version
# Docker version 19.03.8, build afacb8b
docker-compose --version
# docker-compose version 1.25.4, build 8d51620a
```

The version should be something like what is after the ``#`` symbol.

- **Install Python2.7 and Django**

***

As explained in [Cartoview Installation | Windows](/installation/windows/#installation-requirements) section, download and install [Python2.7][11].

[11]: https://www.python.org/ftp/python/2.7.17/python-2.7.17.amd64.msi

Open ``Windows PowerShell`` and install django.

```shell
pip install django==1.11.11
```

## Cartoview Libraries Installation

- **Download and Install Cartoview**

***

Download the latest version of cartoview by cloning the repository.

```shell
git clone https://github.com/cartologic/cartoview.git
```

This will create a directory called ``cartoview``.

Navigate inside it to install Cartoview using docker.

!!! warning
    Before executing the command below, make sure that ``port 80`` is not used by any process as Cartoview will be running on it.

```shell
cd cartoview
docker-compose up -d
```

!!! warning
    **For Ubuntu**, if you didn't configure docker to run without ``sudo``, make sure to prefix each docker command with it.

Get a cup of coffee and wait untill all the images are downloaded and installed successfully.

!!! warning
    **For Docker Desktop**, while installation, you may be prompted to accept whether to give permission for Docker to mount its containers on one of your hard-drives or to not. Accept this so that the containers can run probably.

    If you didn't accept, you will get errors. Execute ``docker-compose up -d`` again and accept.

After all images are downloaded, you can monitor the logs of initiating Cartoview with this command.

```shell
docker-compose logs -f --tail=100
```

**For Windows Docker Desktop**

If you open **Docker Dashboard**, you should find the installed containers up and running.

![Cartoview on Docker](../img/installation/Docker/cartoview_docker.PNG)

Also, you can see the logs by just ``double-click`` on ``cartoview``.

![Cartoview Logs](../img/installation/Docker/cartoview_logs.png)

- **Migrate & Load default data**

***

We need to execute some commands to the service after it's up and running. So we will open the terminal inside ``Cartoview`` container.

**For Ubuntu:**

```shell
docker exec -it cartoview_cartoview_1 /bin/bash
```

**For Windows:**

Open **Docker Dashboard** and for ``cartoview_cartoview_1`` container, click on the Cli button to open the terminal in which we will execute the below commands.

![Cartoview CLI](../img/installation/Docker/cartoview_cli.PNG)

This will open a shell inside the container in which we will execute the following commands.

Detect changes in the ``app_manager``.
```shell
python manage.py makemigrations app_manager
```

Migrate the data.
```shell
python manage.py makemigrations
python manage.py migrate
```

Create accounts table.
```shell
python manage.py migrate account
```

Load default User.
```shell
python manage.py loaddata sample_admin.json
```

Load default oauth apps so that you will be able to authenticate with defined external server.
```shell
python manage.py loaddata default_oauth_apps.json
```

Load default Initial Data for Cartoivew.
```shell
python manage.py loaddata initial_data.json
```

Load default Cartoview Appstore data.
```shell
python manage.py loaddata app_stores.json
```

!!! note
    After executing the above commands, you can ``exit`` the container terminal by just typing exit then hit the ``Enter`` button.

Restart the services running on docker so that the changes takes effect.

```shell
docker-compose restart
```

- **Test the development server**

***

In the browser navigate to ``localhost:80``.

**For Windows:**

Open Docker Dashboard and for ``cartoview_nginx_1``container, click on ``Open in browser`` button to open Cartoview in the browser.

![Cartoview open browser](../img/installation/Docker/cartoview_browser.PNG)

You should get:

![Cartoview on Browser](../img/installation/Ubuntu/cartoview.png)

**Sign-in with:**
```shell
user: admin
password: admin
```

**For GeoServer:**
Open ``localhost:80/geoserver``

![GeoServer](../img/installation/Ubuntu/geoserver.png "GeoServer")
**Sign-in with:**
```shell
user: admin
password: geoserver
```

## GeoServer Configuration

- **Optional | Change default GeoServer admin Password**

***

1. Login with GeoServer credentials that were mentioned above.

2. At the left-side menu, navigate to **Security** section and click on **Users, Groups, Rules**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_pass1.png "GeoServer Configuration")

3. Click on **Users/Groups** then select **admin**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_pass2.png "GeoServer Configuration")

4. Set the password you wish then scroll to the end of the page and click **Save**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_pass3.png "GeoServer Configuration")

Now, you can logout and login again with the new password you have just entered.

- **Configure GeoServer with Cartoview**

***

In order for Cartoview to work properly, we need to authenticate GeoServer with it.

1. Inside ``cartoview`` directory, navigate to ``env`` folder and open the file called **celery.env**.

    Edit the contents of the file as below:

    ``GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ instead of http://<IP_ADDRESS>/geoserver/.``
    ``SITEURL=http://localhost/ instead of http://<IP_ADDRESS>/.``

2. Repeat step 1, but for another file which is **django.env**.

!!! note
    For **Docker Toolbox**, use docker IP address ``<IP_ADDRESS>`` instead of using ``localhost``.

3. For GeoServer, at the left-side menu, navigate to **Security** section and click on **Authentication**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_conf1.png "GeoServer Configuration")

    At the Authentication Filters, select **geonode-oauth2**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_conf2.png "GeoServer Configuration")

    Change the URLs inside the red square to the values in the image then click **Save**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_conf3.png "GeoServer Configuration")

4. At the left-side menu, navigate to **Security** section and click on **Users, Groups, Rules**.

    Click on **geonode REST role service**.

    Select **ROLE_ADMIN** for **Administrator role** and **Group administrator role**.

    Edit the **Base Server URL**

    ![GeoServer Configuration](../img/installation/Docker/geoserver_conf4.png "GeoServer Configuration")

5. At the left-side menu, navigate to **Settings** section and click on **Global**.

    Edit the **Proxy Base URL**.

    ![GeoServer Configuration](../img/installation/Docker/geoserver_conf5.png "GeoServer Configuration")

6. Add **GeoServer OAuth2 Redirect URIs** accordingly.

    Open ``Cartoview Admin Dashboard`` in the browser at ``localhost/admin``.

    Navigate to this directory, ``Home › Django OAuth Toolkit › Applications › GeoServer``.

    Make sure GeoServer URLs are like the image below then click **Save**.

    ![Cartoview Configuration](../img/installation/Docker/cartoview_admin.png "OAuth Configuration")

**Verify the process of authentication between GeoServer and Cartoview**

Sign out from GeoServer and navigate to Cartoview at ``localhost``.

Login in Cartoview with the credentials:
```shell
user: admin
password: admin
```

Open GeoServer from the **admin dropdown**.

![GeoServer Configuration](../img/installation/Docker/geoserver_admin.png "GeoServer Configuration")

You should find that GeoServer user is logged in automatically, and the authentication process runs properly.

## Deployment Notes

Once Cartoview is installed it is expected to install all the Apps from the app store automatically, but Cartoview will not be able to restart Docker when new apps are installed. So, after installing any new app or app update, you will need to restart docker manually until this issue is addressed in the future.

**Follow these steps to get the apps working on Nginx:**

!!! note
    We need to open the terminal inside Cartoview container as we did at **Migrate & load default data** section.

- Collect static files using the command, ``python manage.py collectstatic --noinput``.

- Restart docker to see the change's effect, ``docker-compose restart``.

repository: anshori/cartoview

repo_name: anshori/cartoview


text:
---
title: "Python's __hash__ function is not a cryptographic hash"
authors:
    - "Janis Lesinskis"
date: "2018-07-14"
tags:
    - Python
    - hashing
    - cryptography
contentType: "blog"
---

You may have noticed that Python has an internal hash method, here’s why it is not suitable as a cryptographic hash and some suggestions for alternatives if you do need a cryptographic hash.

<!-- end excerpt -->

Let’s say we want to check if 2 sequences of bytes are the same by comparing their hash values. To do this we would need a hashing function that satisfies the requirements for a good cryptographic hash function.

## Python’s builtin hash

Python makes extensive use of hash-table based associative mappings with it's dictionary and set types amongst others. To support this there is a builtin function called [`hash`](https://docs.python.org/3/library/functions.html#hash) which will call the [`__hash__`](https://docs.python.org/3/reference/datamodel.html#object.__hash__) dunder method. This is an internal implementation detail that calculates the hash value required by the various hash-table backed associative mappings in the language. To be able to store an item as a dictionary key that item must support the hashing protocol via supplying the `__hash__` method. A collision in a dictionary is not a deal-breaker because any item being used as a dictionary key must specify an equality operation too. The collision resolution is therefore able to be handled in these cases by having more than one value stored at each colliding hash value and then comparing based on equality. For example:

```python
>>> hash("foo")
-2127098756728086877
>>> hash(-2127098756728086877)
-2127098756728086877
>>> test = { "foo": 1, -2127098756728086877: 2}
>>> test["foo"]
1
>>> test[-2127098756728086877]
2
```

Because the equality of `"foo"` and `-2127098756728086877` is not the same both can be stored as dictionary keys and the lookup will still succeed. This of course is the required behavior, to the user the hash collision is usually *mostly* transparent, the only cost you pay for collisions is a degradation of performance because every item with the same hash value now needs to be checked for equality (Note this is why hash randomization was introduced for strings, read more below).

This built in hash method does have a few nice properties with regards to the data structures it supports. One of the big things is that it is fast because it performs well with the data you encounter in Python programs. Because the hash is fast the time saved on the hash more than offsets the extra time spent on collision handling in general cases.

The current default algorithm used by recent CPython versions for hashing is [SipHash24](https://en.wikipedia.org/wiki/SipHash). If you would like more information about which hash is being internally or how to change the defaults have a look at [this blog post](https://www.lesinskis.com/TIL_python_hashing.html).

## Why this hash function is not suitable as a cryptographic hash

Unfortunately the builtin `hash` doesn’t necessarily meet the requirements for a cryptographic hash for the following reasons:

### The hash does not always yield the same result given the same input

```python
janis@scry:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> hash("abcdef")
3361618094207257066
>>> exit()
janis@scry:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> hash("abcdef")
5563937455588773354
>>> exit()
```

The change in values across runs of the Python interpreter is as a result of hash randomization that was introduced into the language to prevent against various denial of service hashing attacks (See: https://bugs.python.org/issue13703 for more details). The default hashing algorithm makes use of a per-run hash seed, see [PYTHONHASHSEED](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED) for information on how to set this seed from the command line.

The reason this is important is because in a lot of web frameworks that use Python there are various lookups into dictionaries and sets to handle URLs and these values are from strings in the URLs that are publicly facing. A carefully crafted attack that generates the same hash values can degrade performance by taking advantage of the fact that in the worst case inserting items into a dictionary is `O(n^2)` complexity in the case of a hash collision. Adding hash randomization makes construction of hash collisions harder to do. But unfortunately this means we can’t use this to create sharable hash values for strings/bytes across runs of the program without seeding both with the same hash seed.

### The hash does not change substantially for small changes for some inputs

```python
janis@scry:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> hash(1)
1
>>> hash(2)
2
>>> hash(3)
3
```

This behavior does not hold for strings/bytes objects however:

```python
>>> hash("a")
6813857533266275591
>>> hash("b")
-7206112842794147113
>>> hash("c")
4007592366952877056
```

Because strings/bytes are hashed with a different algorithm to the integers.

### Collisions are easy to create

Notice how the hash of an integer is the integer itself. Given that there’s a unification of long types in Python 3 this means we can represent arbitrarily large integers directly and this means we can recreate any hash value. See for example:

```python
>>> hash("foo")
-2127098756728086877
>>> hash(-2127098756728086877)
-2127098756728086877
```

This is an issue if your code relies on `hash` creating different results for different inputs.

## What you should use instead

If you want to hash the contents of an object for the purposes of checking the contents for equality this could perhaps be implemented via a method that uses a proper cryptographic hash function. Because Python has a batteries included approach to the standard library there’s some cryptographic hash functions in the standard library in the [hashlib](https://docs.python.org/3/library/hashlib.html) module.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Bot Builder SDK Azure Extensions

The Microsoft Bot Builder SDK Azure Extensions allow for interactions with specific Azure components.

## High level features:

* Azure Table Storage: Allows bot developers to store bot state in their own Azure Storage accounts. For more information on Azure Table Storage, visit the **[Azure Table Storage Documentation](https://azure.microsoft.com/en-us/services/storage/tables/)**
* Azure DocumentDB: Allows bot developers to store bot state in DocumentDB. For more information on Azure DocumentDB, visit the **[Azure DocumentDB Documentation](https://azure.microsoft.com/en-us/services/documentdb/)**

## Sample Overview

This is a simple 'echo' bot which echo's the user's message. The difference is that this sample demonstrates
how to leverage the [botbuilder-azure](https://www.npmjs.com/package/botbuilder-azure) npm module to save your bot's conversation state to an Azure database.

## To run this sample

After you've cloned this repo, cd into the folder and install the dependencies with npm:

  npm install

## Configure the Bot to your Azure DB

```
  var documentDbOptions = {
      host: 'Your-Azure-DocumentDB-URI',
      masterKey: 'Your-Azure-Key',
      database: 'botdocdb',
      collection: 'botdata'
  };
```

## Using the Bot Framework Emulator with this sample

To use the emulator, you'll need to add an environment property.
In .env file, add "NODE_TLS_REJECT_UNAUTHORIZED = 0;" or, alternatively in your bot
you can directly paste the following:

  process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;

Make sure to delete/comment out the above property if you switch to a production channel.

## Run the bot
Run the following command to start the bot

  node app.js

repository: MarcelRaschke/BotFramework-Samples

gha_language: C#

gha_license_id: MIT

repo_name: MarcelRaschke/BotFramework-Samples


text:
# Quiz Model using Django REST framework

## Prerequistes

Assuming you do not have any merge conflicts and have the latest pull request
  1. There has been a lot of model changes so delete your **db.sqlite3** file.
  1. Under `teams/migrations` delete everything except the `__init__.py` file.
  1. Run `pipenv install`
  1. Run `pipenv shell`
  1. Run `./manage.py makemigrations` to create the models and fields for the database
  1. Run `./manage.py migrate` to create the tables in the database
  1. Run `./manage.py createsuperuser` to create a user. You must be a registered user in the database to create a quiz.
  1. To run the server type `./manage.py runserver`
  1.  Remember you must be a logged in user.
    *  At the bottom of the page click on `Raw Data` to input **all** of the quiz information.
    * Here is a sample quiz to input in the field:
    ```
    {
      "name": "Test 1",
      "randomize_team": false,
      "teams": [
        {"name": "team 1"},
        {"name": "team 2"},
        {"name": "team 3"}
      ],
      "questions": [
        {
          "question":"how many days are there in a week?",
          "answers": [
            {"answer": 7, "is_correct": true},
            {"answer": 8},
            {"answer": 9},
            {"answer": 10}
          ]

        },
        {
          "question":"how many days are in a year?",
          "answers": [
            {"answer": 366},
            {"answer": 377},
            {"answer": 365, "is_correct": true},
            {"answer": 356}
          ]

        }
      ]
    }
    ```
    * Press post and you should have your first quiz published!
    * To better understand the fields please go to `teams/models.py`

## `PUT` and `DELETE`
  * Go to `http://<IP_ADDRESS>:8000/api/:id` if it is your first quiz the `id` will be 1. So simply go to `http://<IP_ADDRESS>:8000/api/1/`
  * Once again scroll to the bottom to the `Raw Data` section and alter any fields of your choosing and press `PUT`. The page should reload with the updated information.


text:
# KUDO Cassandra Architecture

Apache Cassandra is a stateful workload. KUDO Cassandra uses kubernetes
statefulset as the basic piece of the KUDO Cassandra Architecture

As a StatefulSet maintains sticky identities for each of its Pods, this helps
KUDO Cassandra to automate all necessary operations with Apache Cassandra nodes.

To help with updates and upgrades, KUDO Cassandra comes with a custom config
maps thats helps for rolling updates for KUDO Cassandra. Apache Cassandra
maintenance jobs like `repair` and `backup/restore` are configured as kubernetes
jobs and are only deployed on-demand when configuring their respective
parameters.

![](images/architecture.png)

## Multi-Datacenter Architecture

KUDO Cassandra can span a ring across multiple kubernetes clusters, to
facilitate the deployment across various regions and zones. Read more about
multidataceneter configuration options in the
[multi-dataceneter](./multidataceneter.md) docs.

![](images/multi-dc-arch.png)

repository: zaoshangyaochifan/operators

repo_name: zaoshangyaochifan/operators


text:
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1" />](https://supportukrainenow.org)

# Repeater Component in Table layout for Filament Package

[![Latest Version on Packagist](https://img.shields.io/packagist/v/icetalker/filament-table-repeater.svg?style=flat-square)](https://packagist.org/packages/icetalker/filament-table-repeater)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/icetalker/filament-table-repeater/run-tests?label=tests)](https://github.com/icetalker/filament-table-repeater/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/icetalker/filament-table-repeater/Check%20&%20fix%20styling?label=code%20style)](https://github.com/icetalker/filament-table-repeater/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/icetalker/filament-table-repeater.svg?style=flat-square)](https://packagist.org/packages/icetalker/filament-table-repeater)

This is a package for Filament form component. Extends from Repeater, but display in Table Layout.

![image](/screenshots/screen-shot.png)

## Installation

You can install the package via composer:

```bash
composer require icetalker/filament-table-repeater
```

You can publish the views using

```bash
php artisan vendor:publish --tag="filament-table-repeater"
```

## Usage

```php
use Icetalker\FilamentTableRepeater\Forms\Components\TableRepeater;

protected function getFormSchema(): array
{
    return [
        ...
        Forms\Components\Grid::make(1)->schema([

            TableRepeater::make('items')
                ->relationship('items')
                ->schema([
                    Forms\Components\TextInput::make('product'),
                    ...
                ])
                ->collapsible()
                ->defaultItems(3),

        ]),

    ];
}
```

> Since this component extends from `Filament\Forms\Components\Repeater`, you can use most of its methods, except for a few methods like `inset()`, `grid()`, `columns()`.

## Other method

### colStyles

To customize styles for each cell, you can pass an array of component name as key and css style as value to `colStyles()`.  See example below:

```php
use Icetalker\FilamentTableRepeater\Forms\Components\TableRepeater;

protected function getFormSchema(): array
{
    return [
        ...
        Forms\Components\Grid::make(1)->schema([

            TableRepeater::make('items')
                ->relationship('items')
                ->schema([
                    Forms\Components\TextInput::make('product'),
                    Forms\Components\TextInput::make('quantity'),
                    ...
                ])
                ->colStyles([
                    'product' => 'color: #0000ff; width: 250px;',
                ]),

        ]),

    ];
}
```

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [Martin Hwang](https://github.com/icetalker)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: icetalker/filament-table-repeater

branch_name: refs/heads/main

gha_language: PHP

repo_name: icetalker/filament-table-repeater


text:
# RGB-Thermal-Tracking-Paper-List

This is a paper list of RGB-Thermal tracking algorithms.
![image](https://github.com/wangxiao5791509/RGB-Thermal-Tracking-Paper-List/blob/master/pipeline2.png)

1. GTOT-50 dataset: "[Learning collaborative sparse representation for grayscale-thermal tracking](https://ieeexplore.ieee.org/document/7577747/)" IEEE Transactions on Image Processing 25, no. 12 (2016): 5743-5756.
Li, Chenglong, Hui Cheng, Shiyi Hu, Xiaobai Liu, Jin Tang, and Liang Lin.

2. RGBT-234 dataset: "[RGB-T object tracking: benchmark and baseline](https://arxiv.org/pdf/1805.08982)." arXiv preprint arXiv:1805.08982 (2018).
Li, Chenglong, Xinyan Liang, Yijuan Lu, Nan Zhao, and Jin Tang.

3. "[Fusing two-stream convolutional neural networks for RGB-T object tracking](https://www.sciencedirect.com/science/article/pii/S0925231217318271)." Neurocomputing 281 (2018): 78-85.
Li, Chenglong, Xiaohao Wu, Nan Zhao, Xiaochun Cao, and Jin Tang.

4. "[Weighted sparse representation regularized graph learning for RGB-T object tracking](https://dl.acm.org/citation.cfm?id=3123289)." In Proceedings of the 25th ACM international conference on Multimedia, pp. 1856-1864. ACM, 2017.
Li, Chenglong, Nan Zhao, Yijuan Lu, Chengli Zhu, and Jin Tang.

5. "[FANet: Quality-Aware Feature Aggregation Network for RGB-T Tracking](https://arxiv.org/pdf/1811.09855)." arXiv preprint arXiv:1811.09855 (2018).
Zhu, Yabin, Chenglong Li, Yijuan Lu, Liang Lin, Bin Luo, and Jin Tang.

6. "[Learning Local-Global Multi-Graph Descriptors for RGB-T Object Tracking](https://ieeexplore.ieee.org/abstract/document/8485393/)." IEEE Transactions on Circuits and Systems for Video Technology (2018).
Li, Chenglong, Chengli Zhu, Jian Zhang, Bin Luo, Xiaohao Wu, and Jin Tang.

7. "[Two-stage modality-graphs regularized manifold ranking for RGB-T tracking](https://www.sciencedirect.com/science/article/pii/S0923596518304892)." Signal Processing: Image Communication 68 (2018): 207-217.
Li, Chenglong, Chengli Zhu, Shaofei Zheng, Bin Luo, and Jing Tang.

8. "[Cross-Modal Ranking with Soft Consistency and Noisy Labels for Robust RGB-T Tracking](http://openaccess.thecvf.com/content_ECCV_2018/papers/Chenglong_Li_Cross-Modal_Ranking_with_ECCV_2018_paper.pdf)." In Proceedings of the European Conference on Computer Vision (ECCV), pp. 808-823. 2018.
Li, Chenglong, Chengli Zhu, Yan Huang, Jin Tang, and Liang Wang.

9. "[Fast RGB-T Tracking via Cross-Modal Correlation Filters](https://www.sciencedirect.com/science/article/pii/S0925231219300347)." Neurocomputing 334 (2019): 172-181.
Zhai, Sulan, Pengpeng Shao, Xinyan Liang, and Xin Wang.

10. "[Grayscale-thermal object tracking via multitask laplacian sparse representation](https://ieeexplore.ieee.org/abstract/document/7822984/)." IEEE Transactions on Systems, Man, and Cybernetics: Systems 47, no. 4 (2017): 673-681.
Li, Chenglong, Xiang Sun, Xiao Wang, Lei Zhang, and Jin Tang.

11. "[Robust collaborative discriminative learning for RGB-infrared tracking](https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/viewPDFInterstitial/16878/16289)." In Thirty-Second AAAI Conference on Artificial Intelligence. 2018.
Lan, Xiangyuan, Mang Ye, Shengping Zhang, and Pong C. Yuen.

12. [Learning Target-oriented Dual Attention for Robust RGB-T Tracking](https://cmsworkshops.com/ICIP2019/Papers/AcceptedPapers.asp), accepted by ICIP-2019, Rui Yang, Yabin Zhu, Xiao Wang, Chenglong Li, Jin Tang. [[Paper]](https://arxiv.org/abs/1908.04441)

13. Dense Feature Aggregation and Pruning for RGBT Tracking, Yabin Zhu, Chenglong Li, Bin Luo, Jin Tang, Xiao Wang, accepted by [ACM MM 2019](https://www.acmmm.org/2019/) [[Paper]](https://arxiv.org/abs/1907.10451)

14. Multi-Adapter RGBT Tracking, Chenglong Li, Andong Lu, Aihua Zheng, Zhengzheng Tu, Jin Tang, arXiv Preprint 	arXiv:1907.07485, ICCV-2019 workshop [Paper](https://arxiv.org/abs/1907.07485) [Code](https://github.com/Alexadlu/MANet)

15. Zhang, X., Ye, P., Leung, H., Gong, K., & Xiao, G. (2020). Object Fusion Tracking Based on Visible and Infrared Images: A Comprehensive Review. Information Fusion. [[Paper](https://www.sciencedirect.com/science/article/pii/S1566253520302657)]

16. Cross-Modal Pattern-Propagation for RGB-T Tracking	Chaoqun Wang, Chunyan Xu, Zhen Cui, Ling Zhou, Tong Zhang, Xiaoya Zhang, Jian Yang [[cvpr-2020](http://openaccess.thecvf.com/content_CVPR_2020/html/Wang_Cross-Modal_Pattern-Propagation_for_RGB-T_Tracking_CVPR_2020_paper.html)]

17. Jointly Modeling Motion and Appearance Cues for Robust RGB-T Tracking. Pengyu Zhang, Jie Zhao, Dong Wang, Huchuan Lu, Xiaoyun Yang [[arXiv pre-print](https://arxiv.org/abs/2007.02041)]

18. LSOTB-TIR: A Large-Scale High-Diversity Thermal Infrared Object Tracking Benchmark [[ACM MM 2020](https://github.com/QiaoLiuHit/LSOTB-TIR)]

19.


text:
# C# Algorithms Implementation :)

This project contains a C# implementation of the algorithms and data structures.

Algorithms:
- Binary Search Tree
 - Search
 - Pre-, In-, Post- Traversal
 - Is Binary Search Tree
- Graph
 - Union Find (disjoint-sets data type)
 - Breadth First Search
 - Depth First Search

Sorts:
 - Counting Sort
 - Insertion Sort
 - Merge Sort
 - Quick Sort

 Not Implemented:
  - Bubble Sort
  - Heap Sort
  - Radix Sort
  - Bucket Sort
  - Selection Sort
  - Shell Sort

Data Structures
 - Linked List
 - Doubly Linked List
 - Queue (Array implementation)
 - Queue (Linked List implementation)
 - Stack (Array implementation)
 - Stack (Linked List implementation)
 - Binary Tree
 - HashTable (Array with Doubly Linked List implementation)
 - Trie
 - Graph (Adjacency List)
 - Graph (Objects)

 Not Implemented:
  - AVLTree
  - BTree
  - RedBlackTree

Each data structure is covered with nUnit tests.

## Installation & Unsage

For running you will need to build the project.

### Tests

To run the tests you need to open Test Explorer in Visual Studio ( Test - Windows - Test Explorer)


text:
---
layout: post
title: Rust and the Monad trait - Not just higher kinded types
permalink: rust-and-monad-trait
---

Higher kinded types is something which has been discussed a lot related to Rust in the past year,
both as a feature people want, but also as a feature people do not really know what to do with.
I am going to focus on the ``Monad`` trait in this post, since that is one of the things which
makes higher kinded types so appealing.

Rust is strict in trait definitions, both types and lifetimes need to match the definition exactly
and there is very little leeway except for using more generics. This is both good and bad, it
guarantees a lot of invariants for the trait but for higher kinded types like ``Monad`` and
``Functor`` it is maybe a bit too restrictive in its current form.

Of course this is not a full proposal — and most of this does not actually make sense as a
proper feature or syntax in a programming language — but it is more of an exploration of
what would be needed to properly implement a generic ``Monad`` trait. Hopefully this article can
serve as some kind of start for a discussion about a real RFC.

# Simple ``Monad`` definition

This is a definiton of ``Monad`` which is similar to the definition Scala uses, with the
difference that the ``Applicative`` trait is not involved:

~~~rust
trait Monad[M<_>] {
    fn bind<F, T, U>(M<T>, F) -> M
      where F: FnOnce(T) -> M;

    fn unit<T>(T) -> M<T>;
}
~~~

This looks pretty neat and works nicely for ``Option<T>``:

~~~rust
impl Monad[Option<_>] for Option {
    fn bind<F, T, U>(m: Option<T>, f: F) -> Option
      where F: FnOnce(T) -> Option {
        match m {
            Some(t) => f(t),
            None    => None,
        }
    }

    fn unit<T>(t: T) -> Option<T> {
        Some(t)
    }
}
~~~

Though once we try to apply this on ``Result<T, E>`` we run into a problem: what do we do with
``E``?  ``impl<T, E> Monad<Result<T>> for Result<T, E>``? That will not work since ``Monad``
expects a type with only one type-parameter and ``Result`` has two. That leaves us with two
options, either denote the higher kinded parameter with a separate syntax, or allow for partial
application of type-constructors:

~~~rust
impl<E> Monad[R<_>] for R
  where R<O> = Result<O, E> {
    fn bind<F, T, U>(m: R<T>, f: F) -> R
      where F: FnOnce(T) -> R {
        match m {
          Ok(t)  => f(t),
          Err(e) => Err(e),
        }
    }

    fn unit<T>(t: T) -> R<T> {
        Ok(t)
    }
}
~~~

The purpose of the syntax above would be to create a type alias ``R<O>`` as ``Result<O, E>`` for
any fixed ``E``, this would allow us to define ``Monad`` on ``R<O>`` since it only requires a
single type-parameter.

## ``Fn``, ``FnMut`` vs ``FnOnce``

Another problematic issue with ``Monad`` is the type of the function ``F`` passed to ``bind``;
it will require either ``Fn``, ``FnMut`` or ``FnOnce`` depending on how it is used. Some monads,
like ``Option<T>``, ``Result<T, E>`` and my own ``Parser`` monad are happily accepting ``FnOnce``
which is the most permissive generic for the user of ``bind`` since they are allowed to do
almost anything inside of ``F``.

On the other hand, implementing ``Monad`` for ``Iterator<Item=T>`` requires an ``FnMut`` bound
on ``F``, since ``F`` will be executed once for each item in the iterator and that disqualifies
``FnOnce``. And for some kind of ``Future<T>`` ``F`` will probably need to be something like
``FnOnce + Send + 'static``, and some parallel monad would want ``Fn + Send + 'static``.

``FnOnce`` is desirable since it allows the user of the monad to do simple sequencing without
putting any requirements on the code used, like this:

~~~rust
// Note: Not copy, and not clone
#[derive(Debug)]
struct Foo;

fn makeFoo()   -> Result<Foo, Error> { Ok(Foo) }
fn theAnswer() -> Result<i32, Error> { Ok(42) }

let r = makeFoo()
          .bind(|foo| theAnswer()
                        .bind(move |data| (foo, data)));

match r {
    Ok((foo, data)) => println!("Foo: {:?}, the answer is: {}", foo, data),
    Err(e)          => println!("Something went wrong: {:?}", e),
}
~~~

This typechecks nicely with a ``bind(M<T>, FnOnce(T) -> M)``, but would fail if ``bind``
required ``F`` to be a ``FnMut`` or ``Fn`` since ``Foo`` in the code above is not ``Clone`` or
``Copy``. This kind of sequencing is necessary for any real-world usage of ``std::io`` or
``std::fs`` since most structures in those modules do not implement ``Clone`` (this includes
``File``, ``Metadata``, ``DirEntry`` and the list goes on).

Another reason for allowing ``FnOnce`` for ``bind`` is to avoid unnecessary allocations and copies
which both degrade performance and increases the risk of users being confused and frustrated by
accidentally operating on copies of the data or having to jump through hoops to satisfy the
type-checker.

This means that the ``Monad`` trait needs to also somehow be generic over the function-type
used by the concrete implementation while still enforcing the general signature of
``Fn*(T) -> M``. This will require [impl specialization]
since ``FnOnce`` implements ``FnMut`` and ``FnMut`` implements ``Fn`` which means that any attempt
to unify all three ``Fn``* types under one generic will fail due to conflicting impl-blocks.

Another possibility is to have separate implementations of ``Monad``, ``MonadMut`` and
``MonadOnce`` where they all have a different ``Fn*`` type. In addition to this we provide default
implementations for the other compatible variants so that a ``MonadOnce`` can be used as a ``Monad``:

~~~rust
trait Unit[M<_>] {
    fn unit<T>(T) -> M<T>;
}

trait Monad[M<_>]: Unit[M<_>] {
    fn bind<F, T, U>(M<T>, F) -> M
      where F: Fn(T) -> M;
}

trait MonadMut[M<_>]: Unit[M<_>] {
    fn bind<F, T, U>(M<T>, F) -> M
      where F: FnMut(T) -> M;
}

trait MonadOnce[M<_>]: Unit[M<_>] {
    fn bind<F, T, U>(M<T>, F) -> M
      where F: FnOnce(T) -> M;
}

mod impls {
    use super::{Monad, MonadMut, MonadOnce};

    impl<M: MonadOnce> MonadMut[M<_>] for M {
        fn bind<F, T, U>(m: M<T>, f: F) -> M
          where F: FnMut(T) -> M {
            MonadOnce::bind(self, f)
        }
    }

    impl<M: MonadMut> Monad[M<_>] for M {
        fn bind<F, T, U>(m: M<T>, f: F) -> M
          where F: Fn(T) -> M {
            MonadMut::bind(self, f)
        }
    }
}
~~~

Example without higher kinded types: [playground](https://play.rust-lang.org/?gist=4480a38393cd27097bb2&version=stable).

The drawback of this is that the trait needs to be specified for each use, and the traits
themselves are incompatible in the reverse direction of the inheritance chain. This is not so
ergonomic for the user, what monad-trait should he/she use?

# The ``Iterator`` monad

Attempting to define the ``Monad`` implementation for an arbitrary ``I: Iterator`` is problematic
due to the type-parameters for the return types of ``bind`` and ``F`` since neither I<U> nor
``Iterator<Item=U>`` can be used because the source iterator (ie. the type after the ``for``
keyword)  is not of the same concrete type as the iterator returned by either ``F`` or ``bind``,
and plain traits are not allowed as a return-type.

My own ``Parser`` monad also has this issue, and it is also shared by the ``State``–,
``Future``–, and possibly some async-IO–monad. The base-type is generic but ``F``,
``bind`` and ``unit`` do not return the same concrete type (since they generally are all closures,
which means that their actual type is a compiler implementation-detail and cannot be described and
is always unique).

This would require us to be able to implement a trait for another trait, and not just a generic,
since the generic type would be the same ``Self`` in the return from ``F``, ``bind`` and ``unit``.
If this constraint remains in place it would be impossible to make a generic and extensible
monad implementing the ``Monad`` trait without having to box everything on every ``bind`` and
``unit`` operation which will cause horrible performance issues.

Here I assume that we can use ``impl Trait`` to denote that it is some concrete type implementing
``Trait`` (but not necessarily the same concrete type), which would allow us to use
``impl I<T> where I<X> = Iterator<Item=X>`` (we need to somehow alias the associated type into a
normal generic, or otherwise be able to use an associated type in HKT):

~~~rust
impl Monad[impl I<_>] for impl I
  where I<X> = Iterator<Item=X> {
    fn bind<F, T, U>(m: impl I<T>, f: F) -> impl I
      where F: FnMut(T) -> impl I {
        // Create new iterator wrapping self and F yielding items from
        // the iterator f(self.next()). Essentially flat_map but
        // without the need for allocations.
    }

    fn unit(T) -> impl I<T> {
        // Iterator yielding the item once
    }
}
~~~

This monad would allow us to build lazy list-comprehensions and similar constructions:

~~~rust
let r: Vec<(u32, u32)> = 0..10.iter()
                              .bind(|i| i..10.iter()
                                             .bind(|j| Monad::unit((i, j))))
                              .collect();
// r = [(0, 0), (0, 1), ..., (1, 1), (1, 2), ..., (8, 8), (8, 9), (9, 9)]
~~~

Another possibility to solve this would be to use a newtype allowing ``impl Trait`` inside it. But
it might be problematic and confusing for the the user since suddenly you have a type which acts as
a ``Sized`` type in most aspects (can be stack allocated, can be passed by value, can be put inside
of structs without ``Box``es) but does not have the same size as any other instance of the same
type (eg. this will prevent you from putting multiple instances inside of a ``Vec`` without
``Box``ing the items first).

The existing closures behave just like that, so there is precedent for allowing types which behave
like this. But the downside of this approach is that the user would be required to do an explicit
cast the value by wrapping it in its newtype before being able to treat it as a ``Monad``.

## Lifetimes

So, let's say we got all the above working, now we have our ``Monad`` trait and we are done with this,
right? No, we still have another class of types which exists in Rust: lifetimes.

Lifetimes which are a part of the monad can be moved out by using partial application of
type-constructors and treating the lifetime as just another type parameter:

~~~rust
impl<'a, M> Monad[M<_>] for M
  where M<X> = MyType<'a, X> {
    fn bind<F, T, U>(m: M<T>, f: F) -> M
      where F: FnOnce(T) -> M { ... }

    fn unit<T>(t: T) -> M<T> { ... }
}
~~~

On the other hand, a monad which is lazy (eg. the ``Iterator`` monad) will require ``m`` and
``F`` to have the same lifetime as the returned M<U> (It will also require the same
``impl Trait`` or similar feature to allow different concrete types):

~~~rust
impl Monad[impl I<_>] for impl I
  where I<X> = Iterator<Item=X> {
    fn bind<'a, S, F, T, U>(m: S, f: F) -> impl I + 'a
      where S: I<T> + 'a,
            F: FnMut(T) -> impl I + 'a {
        BindIter { source: m, fun: f, current: UnitIter(None) }
    }

    fn unit<T>(t: T) -> impl I<T> {
        UnitIter(Some(t))
    }
}
~~~

Note the ``'a`` constraint on ``S``, ``F`` and the return of ``bind``. This is necessary
because lifetime elision will restrict the lifetimes specified on ``bind`` to be (using
``+ 'lifetime`` to detail the restriction)
fn bind(m + 'a, f: F + 'b) -> I<U> + 'a where F: FnMut(T + 'c) -> I<U> + 'c and ``'c``
shorter than ``'b`` which is shorter than ``'a``. So either ``F`` (elide all lifetimes) or
``S`` (when ``'a`` is added to ``F`` and the return of ``bind``) will not live long enough
without these extra annotations.

The ``Option``, ``Result`` — and other types which do not need ``F`` and/or ``S`` to live as
long as the return from ``bind`` — will not use this constraint at all.

This means that ``Monad[M<_>]`` not only needs to be generic over the type it is implemented on
and the ``Fn*`` type it uses, it also needs to be generic over the lifetimes in the signature
of ``bind``. Another way to accomplish this would be to let traits be used as associated types,
then the desired function-trait can be used as an associated type by using the ``unboxed_closure``
feature.

So now we have a ``Monad[M<_>]`` trait which looks more like this:

~~~rust
// Need to be separate due to inference issues
trait Unit[M<_>] {
    fn unit<T>(T) -> M<T>;
}

// Separate trait just for bind since F is intended to be used as a free
// generic specified by the trait-implementation, and T needs to be available
// for the Fn* generic
trait Monad[M<_>]<T, F>: Unit[M<_>] {
    fn bind(M<T>, F) -> M
      // Let's assume we can use the trait Func and its associated types
      // Input and Output to enforce a function-signature
      where F: Func,
            F::Input  = (T,),
            F::Output = M;
}
~~~

This enables us to add lifetimes to ``F``, and with the help of ``impl Trait`` in type-position
we can also add the same lifetime to ``m`` and the return of ``bind``. It is a bit cumbersome,
but looks promising:

~~~rust
// Option monad
impl Unit[Option<_>] for Option {
    fn unit<T>(t: T) -> Option<T> { Some(t) }
}

impl<T, F> Monad[Option<_>]<T, F> for Option
  // We leave out the return type definition to bind using the feature
  // unboxed_closure to be able to use the <> notation. If we are not
  // allowed to use this feature we also need to move U to the Monad trait
  where F: FnMut<(T,)> {
    fn bind(m: Option<T>, f: F) -> Option
      where F: Func,
            F::Input  = (T,),
            F::Output = Option {
        match m {
            Some(t) => f(t),
            None    => None,
        }
    }
}

// Iterator monad
impl Unit[I<_>] for impl I
  where I<X> = Iterator<Item=X> {
    fn unit<T>(T) -> impl I<T> { ... }
}

impl<'a, T, F> Monad[impl I<_>]<T, F> for impl I
  // Use the lifetime 'a here to restrict all uses of I<_>
  where I<X> = Iterator<Item=X> + 'a,
        // Here we can add that F needs to live at least as long as
        // the return from bind (and Self):
        F: FnMut<(T,)> + 'a {
    fn bind(m: impl I<T>, f: F) -> impl I
      where F: Func,
            F::Input  = (T,),
            F::Output = impl I {
        // Now we can put both self and f inside of something and
        // return it safely
        ...
    }
}
~~~

And now we actually have a ``Monad`` trait which allows for different ``Fn*`` types, different
lifetime requirements on the function passed to ``bind`` and it can also be implemented for
N-ary types as well as traits themselves.

## Receiver types

An additional, and slightly smaller, problem is receiver types. All parameters to ``bind`` have
so far been taken by value, which means that unless the type implementing the monad trait is
``Copy`` the original value would be invalidated once it is passed to ``bind``. This is a bit
problematic when you want to reuse the same piece of data multiple times without having to build
the monad computation anew every time it has to be used.

Haskell's GHC does some limited memoization to avoid this issue, eg. when performing repeated
calls to the same function with the same value it will only calculate the value one, which solves
this issue. Rust cannot do that since there is no runtime, and the value itself would have to be
``Clone``.

I am not sure I see too much use of ``&self``, and ``&mut self`` seems to be somewhat redundant
since you cannot use ``&mut self`` for anything else until the specific monad instance has been
computed.

The solution to these two would probably be to implement specific monad-traits for the
receiver-types. Hopefully this will not have to be combined with different traits for ``Fn*`` types
since that would result in a lot of different, somewhat-incompatible, monad-traits.

# Attempting to use the ``Monad`` trait in a generic way

The code above is all ok as long as we do not try to actually be generic over the ``Monad``
trait and let the compiler infer all the types. Then the ``Monad::bind`` and ``Monad::unit``
functions work pretty well. But what if we try to define functions generic over ANY ``Monad``?

~~~rust
fn liftM2<M, MT, MU, F, H, T, U>(f: F, m1: MT, m2: MU)
    -> M<F::Output, H>
  where M:   Monad,
        MT = M<T>,
        MU = M,
        F:   Fn<(T, U)>,
        H:   Fn<(U,)> {
    Monad::bind(m1, move |x1| Monad::bind(m2, move |x2| Unit::unit(f(x1, x2))))
}
~~~

The above will actually not work. Firstly, the generic ``H`` will not be possible to infer.
Secondly, all the different ``Fn*`` parameters are creating lots of unnecessary noise as well as
restricts the user to the most basic use of ``bind``.  By using "associated traits" we can
simplify it a tiny bit:

~~~rust
fn liftM2<M, MT, MU, F, T, U>(f: F, m1: MT, m2: MU) -> M<F::Output>
  where M:   Monad,
        MT = M<T>,
        MU = M,
        F:   Fn<(T, U)> {
    Monad::bind(m1, move |x1| Monad::bind(m2, move |x2| Unit::unit(f(x1, x2))))
}
~~~

It is still very far from being ergonomic to use. I suspect that we will need to be able to
implement traits for types without having to specify their type-parameters, as well as using
traits and types which are partially applied as types and type-parameters. This would enable us
to use both the "associated traits" and the types implenting traits as a type-constructors if
their type-parameters are not fully specified:

~~~rust
fn liftM2<M, F, T, U>(f: F, m1: M<T>, m2: M) -> M<F::Output>
  where M: Monad,
        F: M::BindFn<(T, U)> {
    Monad::bind(m1, move |x1| Monad::bind(m2, move |x2| Unit::unit(f(x1, x2))))
}
~~~

The above code requires the use of traits in place of concrete types, having the compiler
monomorphize them to concrete types without having to be explicitly generic over them. This is
starting to look a lot more like how ``Monad`` is declared  and used in Haskell, more so than how
it is in Scala, and it cuts down on a lot of noise which the extra generics otherwise would have
added.

# What is needed to be able to implement a generic ``Monad`` trait?

* Proper higher kinded types. Currently this can be emulated using associated types and
  trait-inheritance, but this has the downside that it cannot enforce the signature of the types
  used by ``F`` or returned from ``bind``.
* Partial application of type-constructors, to allow for implementing ``Monad`` for N-arity
  type-constructors as well as associated types.
* [impl specialization] or otherwise some unification for ``Fn*`` traits to enforce the function
  signature of ``F`` passed to ``bind``, since the ``Monad`` trait needs to be generic over the
  ``Fn*`` type itself.
* Type-equality constraints in ``where``-clauses: [#20041](https://github.com/rust-lang/rust/issues/20041)
  This will allow the ``F`` passed to ``bind`` to be a generic specified by the implementor and
  be enforced to have the correct function signature.
* Implementing a trait for another trait needs to have some kind of mechanism which allows the
  concrete type used to be different within the same ``impl``-block without failing to typecheck.
  Eg. all ``impl Trait`` inside of the same ``impl``-block could be considered to be equivalent to
  the generic ``T: Trait`` for typechecking of traits. Otherwise the M<U> return
  of ``F`` and ``bind`` will not typecheck for monads more complex than ``Option`` or ``Result``.
  Another solution would be to allow traits to be used in type-position and then let the compiler
  monomorphize.

The above also holds true for the ``Functor`` trait, since ``Option`` and ``Result`` can take
``F = FnOnce`` while ``Iterator`` can at most take ``F = FnMut``, ``Iterator``'s ``map`` also
returns a different concrete type compared to the original type.

There are a few additional features which can be added to this list if ease of use is considered,
and it is not just limited to these:

* Allowing types and function signatures to be generic over type-constructors.
* Allowing traits to be used in type-position, letting the compiler monomorphize the type.
* Allowing restrictions defined in traits on associated types.

This would allow us to hopefully write ``Monad`` as something more like this:

~~~rust
trait Monad
  // The type monad is implemented on must be a 1-arity type-constructor
  where Type: <_> -> {
    // Trait-parameter of 1-arity, inheriting from the Func trait
    type BindFn: Func;

    // Here we assume we can use the syntax Type<...> to parameterize
    // the self type, same for BindFn:
    fn bind<'a, F, T, U>(self, F) -> Type
      where Self      = Type<T> + 'a,
            F:          Type::BindFn<(T,)> + 'a,
            F::Output = Type;

    fn unit<T>(T) -> Type<T>;
}

impl Monad for Option {
    trait BindFn = FnOnce;

    fn bind<'a, F, U>(self, f: F) -> Option
      where Self      = Option<T> + 'a,
            F:          Type::BindFn<(T,)> + 'a,
            F::Output = Option {
        match self {
            Some(t) => f(t),
            None    => None,
        }
    }

    fn unit<T>(t: T) -> Option<T> { Some(t) }
}
~~~

[impl specialization]: https://github.com/rust-lang/rfcs/pull/1210

**EDIT:** Posted on reddit: [/r/rust](https://www.reddit.com/r/rust/comments/3li3by/rust_and_the_monad_trait_not_just_higher_kinded/)

**EDIT 2015-09-21:** [diff](https://github.com/m4rw3r/m4rw3r.github.io/commit/68bceb3f427b9f24ba0ec60f1b749a569a4a8981)

Changed ``Monad`` definition to not include the ``T`` generic in the impl but only in ``bind``
where possible. The HKT syntax was also changed to ``Trait[Type<_>]`` to indicate a type of
kind ``* -> *`` required for the impl of ``Trait``.


text:
# Counting the Number of Characters

 * [x] [Ruby](ruby/)
 * [x] [Go](go/)

## Problem Statement

Prompt for an input string and display output that shows the input string and
the number of characters the string contains.

## Example Output

```
What is the input string? Homer
Homer has 5 characters.
```

## Constraints

 * Be sure the output contains the original string.
 * Use a single output statement to construct the output.
 * User a built-in function of the programming language to determine the length
   of the string.

## Analysis

### Inputs:

 * string

### Processes:

 * prompt for a string
 * print the string and character count

### Outputs:

 * string with character count

## Test Plan

Input:

 * string: Homer

Expected result:

 * output: Homer has 5 characters.

## Pseudocode

```
CountChars
  Prompt for string with "What is the input string?"

  Display string + " has " + count + " characters."
End
```

repository: TrevorBramble/exercises-for-programmers

repo_name: TrevorBramble/exercises-for-programmers


text:
# :construction: MongoDB VSCode [Work in Progress] :construction:

[![Build Status](https://dev.azure.com/team-compass/team-compass/_apis/build/status/mongodb-js.vscode?branchName=master)](https://dev.azure.com/team-compass/team-compass/_build/latest?definitionId=4&branchName=master)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmongodb-js%2Fvscode.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmongodb-js%2Fvscode?ref=badge_shield)

Official MongoDB Visual Studio Code Extension. **Not Yet Released**.

> brought to you by the [Compass](https://github.com/mongodb-js/compass) team

## Features

### :construction:

## Extension Settings

`mdb.show`: Show/Hide the MongoDB extension.

*See `package.json` `contributes.configuration` for a full list of settings.*

## Contributing

For issues, please create a ticket in our [JIRA
Project](https://jira.mongodb.org/browse/VSCODE).

## Development

We recommend familiarizing yourself with the VSCode extension documentation:
[code.visualstudio.com/api](https://code.visualstudio.com/api).

Running the MongoDB VSCode plugin requires [Node.js](https://nodejs.org) and npm.

1. Clone this project, navigate to the folder, then run:
```shell
npm install
npm run watch
```

2. Inside of [VS Code Insiders](https://code.visualstudio.com/insiders/) open this directory and press `F5` to begin debugging the extension. This should launch a new VSCode window which is running the extension.

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmongodb-js%2Fvscode.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmongodb-js%2Fvscode?ref=badge_large)


text:
[![travis](https://img.shields.io/travis/skonves/ts-registry-express.svg)](https://travis-ci.org/skonves/ts-registry-express)
[![coveralls](https://img.shields.io/coveralls/skonves/ts-registry-express.svg)](https://coveralls.io/github/skonves/ts-registry-express)
[![NPM Version](https://img.shields.io/npm/v/ts-registry-express.svg)](https://npmjs.com/package/ts-registry-express)

# ts-registry-express

Custom [`ts-registry`](https://github.com/ChristianAlexander/ts-registry) scope provider for [Express](https://expressjs.com/) requests.

## Quick Start

```Typescript
import * as express from 'express';
import { Registry } from 'ts-registry';
import { middleware, request } from 'ts-registry-express';

// define a request-scoped service
const registry = new Registry();
registry
  .for('my-service')
  .withScope(request)
  .use(() => new MyService())

// use the middleware
const app = express();
app.use(middleware);

// get an instance of the service
app.get('/', (req, res) => {
  // service instance is unique to this request
  const service = registry.getService('my-service');
})
```

## Access to the current Request

The target scope for this `ScopeProvider` is the current `Request` object and can be accessed via the second parameter of the service initializer.

Example:

```Typescript
registry
  .for('my-service')
  .withScope(request)
  .use((_get, req) => new MyService(req.session))
```

Because service instantiation is deferred, request-scoped service initializers can be defined outside of standard Express middleware, routers, or other handlers. However, when the `registry.get()` is called during a request (even if the call is made from another another function or module) the service initializer is passed the instance of the current request as the second argument.

Note that if you hold onto a reference of `req` within either the service intializer or other code, it will not be garbage collected and will lead to a memory leak.

repository: skonves/ts-registry-express

gha_language: TypeScript

repo_name: skonves/ts-registry-express


text:
# utfbom-remove

[![Build Status](https://travis-ci.org/alastairruhm/utfbom-remove.svg?branch=master)](https://travis-ci.org/alastairruhm/utfbom-remove)
[![Build status](https://ci.appveyor.com/api/projects/status/6lor56a2339hd8we?svg=true&passingText=windows%20build%20pass)](https://ci.appveyor.com/project/alastairruhm/utfbom-remove)
[![codecov](https://codecov.io/gh/alastairruhm/utfbom-remove/branch/master/graph/badge.svg)](https://codecov.io/gh/alastairruhm/utfbom-remove)
[![Go Walker](https://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/alastairruhm/utfbom-remove)
[![Go Report Card](https://goreportcard.com/badge/github.com/alastairruhm/utfbom-remove)](https://goreportcard.com/report/github.com/alastairruhm/utfbom-remove)
[![codebeat badge](https://codebeat.co/badges/dcefcf89-de89-4d8a-adfb-b542b025c067)](https://codebeat.co/projects/github-com-alastairruhm-utfbom-remove-master)

detect and remove BOM in utf-8 encoding files

## feature

* remove BOM in utf8 encoding files
* dry-run mode

## download and run

https://github.com/alastairruhm/utfbom-remove/releases

Download binary according to your system and on macOS, you can install as

```
brew tap alastairruhm/tap && brew install utfbom-remove
```

usage:

```bash

$ ./utfbom-remove -h

NAME:
   utfbom-remove - detect and remove BOM in utf-8 encoding files

USAGE:
   main [global options] command [command options] [arguments...]

VERSION:
   v1.0.2

AUTHOR:
   alastairruhm<EMAIL_ADDRESS>
COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --check-only   dry-run mode
   --path value   the path to scan (default: ".")
   --help, -h     show help
   --version, -v  print the version

COPYRIGHT:
   (c) 2017 alastairruhm
```

### macOS and linux

```bash
# dry-run mode
$ ./utfbom-remove --path=/path/to/directory --check-only

# repalce with bom free header
$ ./utfbom-remove --path=/path/to/directory
```

### windows

```bash
# dry-run mode
$ ./utfbom-remove.exe --path=/path/to/directory --check-only

# repalce with bom free header
$ ./utfbom-remove.exe --path=/path/to/directory
```

## Supported platforms

utfbom-remove is tested against multiple versions of Go on Linux, and against the latest released version of Go on OS X and Windows. For full details, see [.travis.yml](./.travis.yml) and [appveyor.yml](./appveyor.yml).

repository: alastairruhm/utfbom-remove

gha_language: Go

repo_name: alastairruhm/utfbom-remove


text:
# Feast CLI

The feast command-line tool, `feast`, is used to register resources to
feast, as well as manage and run ingestion jobs.

## Installation

The quickest way to get the CLI is to download the compiled binary:

```sh
# For Mac OS users
wget https://github.com/gojek/feast/releases/download/v0.1.1/feast-cli-v0.1.1-darwin-amd64
chmod +x feast-cli-v0.1.1-darwin-amd64
sudo mv feast-cli-v0.1.1-darwin-amd64 /usr/local/bin/feast

# For Linux users
wget https://github.com/gojek/feast/releases/download/v0.1.1/feast-cli-v0.1.1-linux-amd64
chmod +x feast-cli-v0.1.1-linux-amd64
sudo mv feast-cli-v0.1.1-linux-amd64 /usr/local/bin/feast
```

### Building from source

If you want to develop the CLI or build it from source, you need to have at least Golang version 1.11 installed because Feast use go modules.

```sh
git clone https://github.com/gojek/feast
cd feast
go build -o feast ./cli/feast

# Test running feast CLI
./feast
```

repository: peterjrichens/feast

repo_name: peterjrichens/feast


text:
# onlineMotionCorrection
onlineMotionCorrection. To transfer an image from Matlab, please see amitani/mex_tools
It requires OpenCV to compile.
This was tested with Qt Creator 4.4.1 on Windows 10 with OpenCV 3.2.

If used for research, please properly cite a paper this is used first.
Brain-Computer Interface with Inhibitory Neurons Reveals Subtype-Specific Strategies
Mitani, Akinori et al. Current Biology , Volume 28 , Issue 1 , 77 - 83.e4
http://www.cell.com/current-biology/fulltext/S0960-9822(17)31517-8

repository: amitani/onlineMotionCorrection

repo_name: amitani/onlineMotionCorrection


text:
# Bhosada Trap

Introducing *Bhosada Trap* which is my New bot and I am glad to inform you that You guys can use my Bot via WhatsApp. To use this Bot first verify your Number by sending *Join theft lived* message on http://wa.me/14157386170 or You can verify your Number by just clicking on this link: http://wa.me/14157386170?text=Join%20theft%20lived and then use these HelpFul Commands:

1. *Start*

2. *Help*

3. *Commands*

4. *Image*

5.  This Bot is Under Development*

*Credits: Name Credit Goes to R37r0.Gh057*

*Source Code:* https://github.com/MrSp4rX/WhatsAppBot

*Report Bugs:* http://wa.me/919519874704

*Open Issue:* https://github.com/MrSp4rX/WhatsAppBot/issues/new

*For Protecting Your number from iSpammer tool for Lifetime contact http://wa.me/919519874704*

*For Queries, Banning, UnBanning and Abusing Persons contact http://wa.me/919519874704*


text:
# HannoverJS Website

> The official HannoverJS Website

Using:
- [React](https://github.com/facebook/react)
- [Axios](https://github.com/mzabriskie/axios)
- [Babel](https://github.com/babel/babel)
- [PostCSS](https://github.com/postcss/postcss)
- [Webpack](https://github.com/webpack/webpack)
- [ESLint](https://github.com/eslint/eslint)

## Development

Clone/fork this repository, `cd` into it and install the npm dependencies first:
```
$ npm install
````

#### Commands
- **Start development server on `localhost:3000`**
    ```
    $ npm start
    ```

- **Lint `.js` files**
    ```
    $ npm run lint
    ```

- **Lint `.js` files and fix errors/warnings automatically**
    ```
    $ npm run lint:fix
    ```

- **Run tests**
    ```
    $ npm test
    ```

- **Generate production build in a `/dist` folder**
    ```
    $ npm run build
    ```

- **Delete `/dist` folder**
    ```
    $ npm run clean
    ```

- **Generate production build and deploy on `gh-pages` branch**
    ```
    $ npm run deploy
    ```

## License

MIT


text:
+++
title= "Monitoring Clipper Metrics"
date= 2018-03-13T10:23:10-07:00
description = ""
draft= false
weight = 10
+++

Starting in Clipper v0.3.x, Clipper reports metrics to a [Prometheus](https://prometheus.io/) server.

## Prometheus Server
We use Prometheus as the metric tracking system. When you start a Clipper cluster, a Prometheus instance is automatically started for you.
If you are using `DockerContainerManager`, you can view Prometheus UI at: [`http://localhost:9090`](http://localhost:9090).
If you are using `KubernetesContainerManager`, the Prometheus address is dynamically generated by Kubernetes. You can fetch the address for your cluster by calling `clipper_conn.get_metric_addr()`.

Please note that the Prometheus UI is intended for debug purpose only. You can view certain metrics and plot the timeseries, but for better visualization we recommend [Grafana](https://grafana.com/).
Grafana has default support for Prometheus Client. Check out the [example](https://github.com/ucbrise/clipper/tree/develop/examples/monitoring) on GitHub to see how to use Grafana to display Clipper metrics.

## Available Metrics
Clipper provides latency and throughput metrics by default. In particular, we provide latency and throughput metrics across several processing stages.

Check out the example for more details.

## User Defined Metrics
You can also add user defined metrics in your application. The API is simple. When you write your predict function, just add the following:

- `import clipper_admin.metric as metric` to import the Metrics module
- `metric.add(metric_name, metric_type, metric_description, optional_histogram_bucket)` to add a metric.  The metric type is defined in [Prometheus Data Types](https://prometheus.io/docs/concepts/metric_types/)
- `metric.report(metric_name, metric_data)` to report a metric.

Please checkout a detailed [example/user_defined_metric](https://github.com/ucbrise/clipper/tree/develop/examples/user_defined_metric) with user defined metric. In the example, we will add metrics for a sklearn spam prediction model.

## [WIP] System Metrics
Clipper does not collect physical system metrics like the CPU or memory usage yet. Please follow the progress [on GitHub](https://github.com/ucbrise/clipper/issues/421) and feel free to [contribute](/contributing)!

repository: pfeyz/clipper-website

repo_name: pfeyz/clipper-website


text:
# Roles

## Introduction

Superset has a permission system built-in based on the underlying Flask AppBuilder security API.  The FAB Security model aims to be pretty
fine-grained, which can be both a blessing and a curse.

Superset recommends that you do not alter the default roles and they suggest that you instead give most users a base "Gamma" role and extend
it by union'ing in other roles.  There is not at this time much guidance in terms of how to programatically manage roles. Another pain point
is that you end up with a huge jumble of permissions per role and it is not easy to tell which permissions relate specifically relate to any given view
within the site.

## Setting up roles programmatically

A CLI command is provided to load the roles in a way that mimics the
manual process descrived bellow.

To do this, you can run `chpro setup_permissions` from an environment where the
application is installed.

When running the application via docker, you can use the shortcut `fab apprun:'chpro setup_permissions'`

## Setting Up Primary Roles

The following is intended as a starting point for initial exploration and testing of the site.  Some attempt has been made to remove edit / delete
actions from the Viewer role while preserving the ability to view Dashboards and Charts.  More work may be needed to remove other permissions not
suitable for this role.  In some cases an 'edit' button may display but the user does not have permission and will be redirected elsewhere. However the UI
would need some attention here.

### Create Viewer Role

First create a copy of the default `Gamma` role.

1. Select the `Gamma` role in http://localhost:9090/roles/list/ and use the **Copy** command in the **Actions** menu at the bottom of page
name the new Role as _Viewer_
1. In the roles list, find "Gamma copy" and click its edit button
1. In the `Name` field change it to "Viewer", then Save
1. Run the following SQL statements against the `superset` database to purge the Viewer role of edit/remove permissions:

```
-- remove can delete
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_delete")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can add
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_add")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can add slices
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_add_slices")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can copy dash
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_copy_dash")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can delete
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_delete")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can edit
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_edit")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can import dashboards
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "can_import_dashboards")) and role_id = (select id from ab_role where name = "Viewer");

-- remove can override role permissions
-- role will not any by default

-- remove muldelete
delete from ab_permission_view_role where permission_view_id in (select id from ab_permission_view where permission_id = (select id from ab_permission where name = "muldelete")) and role_id = (select id from ab_role where name = "Viewer");

-- add data access
insert into ab_permission_view_role (permission_view_id, role_id)
  select apv.id, ar.id from ab_permission_view as apv
  inner join ab_role as ar on ar.name = "Viewer"
    where permission_id = (select id from ab_permission where name = 'all_datasource_access')
      and
    view_menu_id = (select id from ab_view_menu where name = 'all_datasource_access');

```

### Create Editor Role

Create a copy of the default `Alpha` role.

1. Select the `Alpha` role in http://localhost:9090/roles/list/ and use the **Copy** command in the **Actions** menu at the bottom of page
1. In the roles list, find "Alpha copy" and click its edit button
1. In the `Name` field change it to "Editor", then Save

```
-- adds SQL Lab permissions
insert into ab_permission_view_role (permission_view_id, role_id)
  select apv.id, ar.id from ab_permission_view as apv
  inner join ab_role as ar on ar.name = "Editor"
  where apv.id in (select permission_view_id from ab_permission_view_role where role_id = (select id from ab_role where name = "sql_lab"));

-- adds Manage Viewers permissions
insert into ab_permission_view_role (permission_view_id, role_id)
  select apv.id, ar.id from ab_permission_view as apv
  inner join ab_role as ar on ar.name = "Editor"
    where permission_id in (select id from ab_permission where name in ('can_add', 'can_download', 'can_edit', 'can_list', 'can_show', 'can_delete', 'muldelete', 'mulexport'))
      and
    view_menu_id = (select id from ab_view_menu where name = "Manage Viewers")
```

repository: rapidpro/chpro

repo_name: rapidpro/chpro


text:
![Java CI with Maven](https://github.com/SidMorad/factest/workflows/Java%20CI%20with%20Maven/badge.svg)

### Installation

`mvn compile`

`chmod +x organic.sh`

`./organic.sh`

Then see the failure.
Update `organic.sh` to point to correct FactSuite classpath(FSUIT variable).

`./organic.sh`
Then see the success.

### Run when changed

`npm i`

`npm run watch`

repository: SidMorad/factest

gha_language: Java

repo_name: SidMorad/factest


text:
# HIG theme data proof-of-concept

HIG theme data is a representation of the HIG visual design language in the form of data.

## Getting started
```bash
yarn add @hig/theme-data-poc
```

#### Access theme data as json
```js
import lightGrayTheme from<EMAIL_ADDRESS>
console.log(lightGrayTheme);
// {
//  "basics.borderRadii.none": "0",
//  "basics.borderRadii.small":  "0"
//  "basics.borderRadii.medium":  "2px"
// ...
// }
```

#### Access theme data as javascript
```js
import { lightGrayTheme } from '@hig/theme-data-poc';

console.log(lightGrayTheme.data);
// {
//  "basics.borderRadii.none": "0",
//  "basics.borderRadii.small":  "0"
//  "basics.borderRadii.medium":  "2px"
// ...
// }
```

#### Extend a theme to make a new variation
```js
import { extendTheme, resolveTheme, lightGrayTheme } from '@hig/theme-data-poc';

const redAccentedThemeConfig = extendTheme(lightGrayTheme.config, {
    "colorScheme.accentColor500": "#F00",
});
const redAccentedTheme = resolveTheme(redAccentedThemeConfig);

console.log(redAccentedTheme);
// {
// ...
//  "colorScheme.accentColor500": "#F00",
//  "input.focus.borderBottomColor": "#F00"
// ...
// }
```

## Vision
- Autodesk products evolve toward a greater level of visual coherence
- Product teams can alter visual design of products with minimal developer effort

## Goals
- Enable teams across Autodesk to share UI components
- Shared components are highly visually flexible
- HIG developers are not a bottleneck to collaboration

## Strategy
- Deliver HIG design as data for consumption by any product regardless of tech stack
- Enable product teams to customize theme values in order to meet their needs as they see fit
- Enable product teams to extend the schema to incorporate new or product-specific components

## Important domain concepts for everyone

### [Basics](./src/basics)
Named values (colors, spacings, typographic specifications, etc.) from which most (all?) other values in a theme are derived

### Role
A property of a component provided by a theme. E.g. Divider is a component. '1px' is a border width. `DIVIDER.BORDER_WIDTH` is a role mapping a width to the border width property of the divider component.

### Theme schema
A set of roles and types which define the properties of the design language

### Theme
Data defining a primitive value (e.g. “#0696D7” or “16px”) for each role in the theme schema.

## Additional concepts for technical folks

### Theme configuration
Data defining a primitive value or reference for each role in the theme schema.

### Reference
References in a theme configuration may point to a basic value or another role. References may point to roles defined with another reference. For example, `textArea.focus.color` may refer to `input.focus.color`, which refers to `accentColor`, which refers to `basics.colors.autodeskBlue600`.

### `Theme generator`
The theme generator is javascript code that overrides values in a theme, adds new roles and values to a theme, and replaces references with primitive values.

## Thoughts on modeling a theme
We have chosen to model theme data more simply than the domain.

In terms of domain, at the highest level, values in a theme fall into three categories—basics, system-level, and component-specific. Examples of system-level values are accent colors, default text properties, and colors of background surfaces. Component-level values fit into a hierarchy beginning with category (e.g. form fields), below that falls component (e.g. select element), then sub-component (e.g. option element). Category, component, and subcomponent are arbitrarily deep, and not all components fall within a category. Within a component values vary according to state. Component states are better represented by a node-map than a tree. Finally, for a given state, a value maps to a property (e.g. background color).

```
Theme
- Basics
- System-level values
- Component values
    - Category - optional
        - Component
            - Subcomponent - arbitrarily deep
                - State* - more of a node map than a tree
                    - Property: value
```

In data we model the theme as a flat map of key-value pairs. We represent the hierarchy in the key, but only as much as is needed to disambiguate one key from another. e.g. a role in the theme may have a key such as `textAreaDisabled.textColor`. The key uses component name, state name, and property name but does not describe a category.

## Ideas discussed but not advanced at this time
- Stylesheet factories: Functions that map a theme and state to a stylesheet for a component
- Stylesheets: Data providing a set of styles for each state a component can enter
- Using theme schema to raise errors in development when attempting to access an undefined or mis-typed role
- Validating themes against a json schema
- Considering how a component will declare role dependencies

repository: noahjb/hig

repo_name: noahjb/hig


text:
---
layout: default
---

# 1995-09-17 - Re: CYPHERPUNK considered harmful

## Header Data

From: Black Unicorn<EMAIL_ADDRESS>To: "David C. Lambert"<EMAIL_ADDRESS>Message Hash: 048a6350b5094d457cb6fe88d272a9d987babb7b2599ea20e89af2127330b816

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1995-09-17 23:23:21 UTC

Raw Date: Sun, 17 Sep 95 16:23:21 PDT

## Raw message

```
{% raw  %}From: Black Unicorn<EMAIL_ADDRESS>Date: Sun, 17 Sep 95 16:23:21 PDT
To: "David C. Lambert"<EMAIL_ADDRESS>Subject: Re: CYPHERPUNK considered harmful
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Sun, 17 Sep 1995, David C. Lambert wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
>
> Black Unicorn<EMAIL_ADDRESS>wrote:
> > On Fri, 15 Sep 1995, David C. Lambert wrote:
> >
> > > BTW, I'm not for changing the name of the list, but I do see the logic
> > > in a more establishment-friendly name to use when lobbying the public.
> >
> > Distrubute [sic] watered down cypherpunk "teachings" in more benign forms
 which
> > hide their true (Ohhh! Scary!) potential in an effort to make them commonly
> > acceptable to joe sixpack.
>
> I believe you misstate the point that people are trying to make.
>
> I haven't seen anyone advocating the "watering down" of any so-called
> "teachings" to "hide" any "true potential".  The only thing that people
> have mentioned is that some of the less clueful out there have a knee
> jerk response to the name "cypherpunk".  That's all.

I don't believe you can have one without the other.  Tell me someone who
is sensitive enough to be offended by the term "cypherpunk" won't be
alarmed at concepts like crypto-anarchy.

>
> > Can't we all see what road this leads down?
>
> No.  Please enlighten us.
>

When you begin compromising to meet the public sentiment you end up
aiming for the middle.  "He who builds on the people builds on mud."  I
believe this especially true in the United States.  The general
population has no tolerance/time/interest in the deeper issues involved
here, and are much more apt to bow to the "law and order" arguments made
by the various political entities here.  These are emotional arguments to
which Joe Sixpack is particularly open.  Enter the four horsemen.

I believe working to recruit "the people" and lobby "the leaders" to
embrace the ramification of free and strong crypto is a losing game.  My
money in information futures is going into "yes" certificates on the
question of "Unescrowed Strong Crypto Banned in U.S. by 2000."

> > At the risk of politicizing the issue, I wouldn't be the first to call this
> > "left-speak" or "term-sanitizing."
>
> And this matters because...?
>

The fact that you need this question answered does more to rebuke your
position than I ever could.

> > Really the core issue is that the citizens of their respective nations
> > need to either:
> >
> > 1>  See cryptography for the important individual rights issue that it
> > is and latch on to the basic desire for free and unmonitored commerce and
> > exchange without censorship or observation.
> >
> > or
> >
> > 2>  Decide that they are not interested in the issues because these
> > issues are too radical, or simply because their own political ideas
> > fall left (or statist) of this spectrum.
>
> What exactly is it that you feel "the citizens of their respective
> nations" are doing right now, if not this?

Be real.  What percentage of [insert nation here]'s citizens would be
able to discuss strong encryption with anything more than a comic book
understanding?

i.e., the answer to your question is "mostly nothing."

> > in the end I
> > don't care if every joe sixpack on the planet uses real crypto, just so
> > long as those I am to conduct commerce (of data or goods) with do.
>
> If this is the case, then I'm at a loss to understand how you fail to see
> the merit in a "term-sanitizing", as you put it, in order to make the use
> of strong crypto desired and required by Joe Sixpack.

You're error is in assuming Joe Sixpack desires or thinks he requires strong
crypto.

  How do you expect
> the legality of string crypto to survive unless Joe and his friends exert
> political pressure to keep it alive?

I don't expect its legality to survive in the United States, nor do I
expect it to survive despite "political pressure" (that nature of which
which you conveniently do not idenfify) and finally, I don't expect Joe
Sixpack, and his friends to exert any (undefined) political pressure- or care.

If people want to try and organize a crypto awareness program, fine.
If people want to try and organize a crypto propoganda program, count me out.

If you don't understand the difference, you need to study history and
political science.

If Joe Sixpack can't deal with the core, unsanitized ramifications of
strong crypto, Joe Sixpack isn't ready to have strong crypto.  This is,
in my view, realism, and intellectual evolution in action.  If strong
crypto is the advantage I suspect it will be, then those nations which
use it will endow its citizens with those significant advantages,
hopefully to the disadvantage of the banning nations.  With any luck,
this will result in the eventual lack of world/market infulence of
crypto-ignorant Joe Sixpacks.  This in my view is "a good thing."
I would like the United States to be pro-crypto, but I'm not sure I give
the country and its current political system as a whole that much credit.

> Isn't it obvious that unless this
> happens, that strong (unescrowed) crypto is on the path to being outlawed
> (at least in the US, and several other countries)?
>
> > The final judgement will be in the advantage of velocity and security of
> > transactions and the wealth that this "allocates" to those wise enough to
> > adopt crypto exchange systems.  Evolution in action.  If this makes me
> > elitist, so be it.
>
> Elitist or not, this is beside the point.

No, it is exactly the point.

> People are bringing up political
> and rhetorical concerns because they feel that political and persuasive
> methods are required *right now* in order to preserve the *legality* of
> strong crypto.

And I believe them a waste of time because I feel that political and
persuasive methods are useless *right now* or in the *foreseeable future*.

The only thing that will stop this legislation will be a sudden awakening
of the American People to freedom of speech in the face of an offered and
vague promise of "security."  (Read: Good Luck)

The FBI is screaming that strong crypto is nasty stuff to the Executive.
Certainly the intelligence agencies are doing the same.
The Executive is going to support if not outright push through a key
forfeiture bill, and about all I can see standing in the way will be
cost- which in this bill is going to be small.

> I only care about whether Joe Sixpack wants strong crypto
> because if I can't persuade him that he does, he won't help me keep it
> legal in my country of residence.

So if you are so intouch with Joe Sixpack, what does he think?  Do you
have some evidence to suggest that there is any widespread awareness of
the issues among Joe and Jane?  Surveys?  Studies?  Anything?

Go out on the street and ask 10 random people.  Hell, ask 10
intellectuals not in the computer science field.  I think your level of
disillusion will approach mine, and if not, then I do not give your
powers of observation much credit.

>  Once it's legality seems safe(r) from
> attack, he can go on using rot13 for all I care.

I think you have a long wait.

Part of the entire issue here is securing your own privacy rather than
letting the government do it for you.    Instead you should, while
perhaps allocate some effort to political concerns, be working to
propogate crypto systems which are untraceable, do not bear the
recipiants key identifier in each message, and otherwise able to endure a
crypto "Dark Age" which I see right around the corner here.

In other words:

Secure it yourself.  Privacy comes to you only if you secure it
yourself.  If you believe that political action is the way to do this, be
my guest- I happen to think you are wasting your time.  Time will judge
the winner of this debate in any event.  I hope I am wrong, I expect I am
not.

>
> David C. Lambert
><EMAIL_ADDRESS>> (finger for PGP public key)
>
> -----BEGIN PGP SIGNATURE-----
> Version: 2.6.2
[...]
> -----END PGP SIGNATURE-----
>
>

---
"In fact, had Bancroft not existed,       potestas scientiae in usu est
Franklin might have had to invent him."    in nihilum nil posse reverti
00B9289C28DC0E55  E16D5378B81E1C96 - Finger for Current Key Information

{% endraw %}
```

## Thread

+ Return to [September 1995](/archive/1995/09)

+ Return to "[Black Unicorn <unicorn@polaris.mindport.net>](/authors/black_unicorn_unicorn_at_polaris_mindport_net_)"
+ Return to "["David C. Lambert" <dcl@panix.com>](/authors/david_c_lambert_dcl_at_panix_com_)"
+ Return to "[Jeff Simmons <jsimmons@goblin.punk.net>](/authors/jeff_simmons_jsimmons_at_goblin_punk_net_)"

+ 1995-09-17 (Sun, 17 Sep 95 10:16:06 PDT) - [Re: CYPHERPUNK considered harmful](/archive/1995/09/0eabbd8845cb75b9ddffd42982b6484764223eefbf550615ac2c18f89f371cd8) - _"David C. Lambert"<EMAIL_ADDRESS>  + 1995-09-17 (Sun, 17 Sep 95 16:23:21 PDT) - Re: CYPHERPUNK considered harmful - _Black Unicorn<EMAIL_ADDRESS>    + 1995-09-18 (Sun, 17 Sep 95 17:18:40 PDT) - [Re: CYPHERPUNK considered harmful](/archive/1995/09/9f08a3d2a4c4dffe377f165d29825705680539d7564dcfbb973f041b74cded6e) - _Jeff Simmons<EMAIL_ADDRESS>


text:
---
id: g4
title: "Drift Bio: The Future of Microbial Genomics with Apache Airflow"
url: /sessions/2021/drift-bio--futuremicrobial-genomics-with-apache-airflow
speakers:
 - Eli Scheele
time_start: 2021-07-16T05:30:00.000Z
time_end: 2021-07-16T05:55:00.000Z
block: g
slot: 4
format: presentation
aliases:
 - /sessions/Drift-Bio
crowdcast_id: 45
---

In recent years, the bioinformatics world has seen an explosion in genomic analysis as gene sequencing technologies have become exponentially cheaper. Tests that previously would have cost tens of thousands of dollars will soon run at pennies per sequence. This glut of data has exposed a notable bottleneck in the current suite of technologies available to bioinformaticians. At Drift Biotechnologies, we use Apache Airflow to transition traditionally on-premise large scale data and deep learning workflows for bioinformatics to the cloud, with an emphasis on workflows and data from next generation sequencing technologies.

repository: softwareguru/airflowsummit-website

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: softwareguru/airflowsummit-website


text:
# Innovative-Visualization-Design-D3
unique visualization that goes beyond the "common chart types" to showcase the Burritos in SanDiego Dataset

Live firebase deployement of the project: https://innovative-vis-burritos-in-sd.web.app/

* Burritos in San Diego ([source](https://www.kaggle.com/srcole/burritos-in-san-diego)): This dataset contains a single table that lists several ratings of ~200 burritos from ~50 restaurants in San Diego.

I have choosen the Burritos in San Diego Dataset, the dataset was large.
Attributes Choosen:

Quantitaive: Temperature, Wrap, Synergy, Hunger, Uniformity
Categorical: Burrito Type

I have choosen the Burrito type as my Categorical type annd choose 6 types of Burritos that are majorly available accross most of the stores in the Dataset, I have visualised the dataset as a modificaltion of Radial Dataset, with centre in circle depicting the google rating and color depicting the burrito type, the hue determines the overall score.
The quantitaitve are plotted as radial bar graph which are scores  between 0-5.

Navigate to the project folder and run the following commands:

pip install simple-http-server

python -m SimpleHTTPServer 8080


text:
# About
This example exercises DataGridView in a way that is similar to Windows Explorer's list view and other popular file listing apps like voidtools Everything.

![main](https://github.com/MikeClark512/WinFormsDataGridViewFileExplorer/blob/master/screenshot.png)

## Goals
- Brevity: The non-designer code is intentionally brief, at around 200 lines.
- Plain objects: The code should be easily portable to work with any plain old objects (e.g. deserialized JSON). There is no direct depenency on FileSystemInfo.
- Fluent gestures and responsive behavior

## Column and Window Resizing
- The columns should respond to the form window being resized. (This behavior is questionable. Windows Explorer doesn't do this, and the behavior has pros and cons.)
- Fill all space made available to the control when the parent window resizes. (Also questionable. See above.)
- The starting column widths should be auto-sized in a way that respects the lengths of all initial strings in the column. (There is some trouble with this -- what if you add more data that's longer, or scroll down to an item that's longer? Also, there are performance concerns with very long lists.)
- The user should be able to resize the columns.
- If the window is resized after the columns are resized, the columns should resize proportionally to each other. (This behavior is questionable. Windows Explorer doesn't do this, and the behavior has pros and cons.)

## Plain Old Data
- We should be able to populate the DataGridView programatically from a plain data-type object, like a deserialized JSON object.
- Population of the DataGridView's metadata (like columns) and data (like cell contents) should not need any funky database/ADO wiring.
- We should be able to update the DataGridView while the application is running and not get bad behaviors like the DGV scrolling to the top or bottom (so the user loses their place), or redraw issues.
- The plain old object backing the DGV should be retrievable from the DGV

## Sorting
- User-controlled column sorting
- Click a column header to switch between sorting by that column: ascending/descending

## Well-known keyboard gestures should work as expected
- Press enter to open the currently selected row (directory/file)
- Press enter to confirm input ("OK") in single-line text boxes and dialogs, etc.
- Up and down arrows should move focus between nearby controls in away similar to Tab
- Explorer-isms: Alt-Up to "cd .."

## Well-known mouse gestures should work as expected
- Double-click to open files and directories
- Click to select things
- Scroll-wheel to scroll
- Scrollbar positions do not reset unexpectedly

## Data Selection and Scrolling
- Data selection in this project is assumed to be full-row
- Only one row is selectable at a time. This met my current needs.
- The backing data (plus metadata) should be easily retrievable given the current state of user selection

## Future
- Fluent support for touch-screen gestures
- Icon support (maybe)
- Multi-select (maybe)
- Context menu (maybe)
- Inline renaming

license: Unlicense

gha_license_id: Unlicense


text:
# hotel-management-system
Hotel Management Service

## How to build
Setup java 8 and Maven

### build project
  mvn clean install

### Servers setup
  You need to setup 2 local Tomcat servers with 8080 and 8002, you can do it with InteliJ IDEA tools (Edit Confgurations -> Add New Configuration -> Tomcat -> Local).The first one is used to deploy htm-client:war exploded wich is a client war file.The second is used to deploy htm-rest-app:war exploded which is a server war file.

## How to use
  New Tab should be open in your default browser(Chrome)(if you perform all setup steps correct).If this sentence is correct simply add users/ to the URL and u will see all users that system store.

repository: ddyadyuk/hotel-management-system

gha_language: JavaScript

repo_name: ddyadyuk/hotel-management-system


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

panzoom2 BETA
=============

WORK IN PROGRESS

```
npm i panzoom2
```
_[panzoom 2 on npm](https://www.npmjs.com/package/panzoom2)_

## Supported browsers

The project aim to support every [browser that has more than 1% market share, plus IE11](http://browserl.ist/?q=IE+11%2C+%3E+1%25).

## Internet Explorer 11

Required polyfills:

- Promise
- CustomEvent
- Object.assign
- Map

You can use the polyfill service from [Financial Times](https://polyfill.io/v2/docs/)
`<script src="https://cdn.polyfill.io/v2/polyfill.minify.js?features=Promise,Object.assign,CustomEvent,Map&flags=gated&rum=0"></script>`

## Examples

[Overview](https://dotnetcarpenter.github.io/panzoom2/)

- [swipe](https://dotnetcarpenter.github.io/panzoom2/swipe) `Showcase swipe detection and all the ways you can listen and unlisten to an event with panzoom.`
- [gestures](https://dotnetcarpenter.github.io/panzoom2/gestures) `Showcase gesture recognition.`

## Inspiration drawn from

- Andrei Kashcha's [panzoom](https://github.com/anvaka/panzoom/)
- Ulrich-Matthias Schäfer's [svg.panzoom.js](https://github.com/svgdotjs/svg.panzoom.js/)
- Eight Media's [HAMMER.JS](http://hammerjs.github.io/)
- [User-defined gestures for surface computing](https://faculty.washington.edu/wobbrock/pubs/chi-09.02.pdf)
- [Algorithms for 2D Multi-Touch Rotate, Scale & Translate (RST) Gestures](http://www.erikpaluka.com/blog/rst/)

license: ISC


text:
# SUIT utilities: state

[![Build Status](https://secure.travis-ci.org/suitcss/utils-state.png?branch=master)](http://travis-ci.org/suitcss/utils-state)

SUIT CSS state utilities.

Read more about [SUIT's design principles](https://github.com/suitcss/suit/).

## Installation

* [Component(1)](http://component.io/): `component install suitcss/utils-state`
* [npm](http://npmjs.org/): `npm install suitcss-utils-state`
* [Bower](http://bower.io/): `bower install suit-utils-state`
* Download: [zip](https://github.com/suitcss/utils-state/zipball/master)

## Available classes

* `u-isActionable` - Style with a `pointer` cursor to indicate an element will trigger an action.
* `u-isDisabled` - Style with a `default` cursor to indicate no associated action.
* `u-isDraggable` - Style with a `move` cursor to indicate an element can be dragged.
* `u-isHidden` - Completely remove an element from the flow and screen readers.
* `u-isHiddenVisually` - Completely remove an element from the flow but leave available to screen readers.
* `u-isVisible` - Make an element visible.
* `u-isInvisible` - Hide an element without affecting flow

## Usage

Please refer to the README for [SUIT utils](https://github.com/suitcss/utils/)

## Testing

Install [Node](http://nodejs.org) (comes with npm).

```
npm install
```

To generate a build:

```
npm run build
```

To generate the testing build.

```
npm run build-test
```

Basic visual tests are in `test.html`.

## Browser support

* Google Chrome (latest)
* Opera (latest)
* Firefox 4+
* Safari 5+
* Internet Explorer 8+

repository: bbc/made-by-you

repo_name: bbc/made-by-you