text:
# Aries VCR Getting Started Tutorial

This Getting Started Guide is to get someone new to the Aries VCR Issuer Controller get an agent up and running in about an hour.  We assume that if you are here, you have some background in the goals and purpose of Verifiable Credentials, Aries VCR, OrgBook and Aries VCR Issuer Agents.  If any of this is new to you, please learn more at [https://vonx.io](https://vonx.io). On that site, we recommend the overview in the "About" section, and especially, the webinar linked at the top.

## Table of Contents <!-- omit in toc -->

- [Aries VCR Getting Started Tutorial](#aries-vcr-getting-started-tutorial)
  - [Running in your Browser or on Local Machine](#running-in-your-browser-or-on-local-machine)
  - [Prerequisites](#prerequisites)
    - [In Browser](#in-browser)
    - [Local Machine](#local-machine)
  - [VON Network Setup](#von-network-setup)
    - [In Browser](#in-browser-1)
    - [Local Machine](#local-machine-1)
      - [VON Network](#von-network)
      - [Aries VCR](#aries-vcr)
  - [Step 1: Investigating VON](#step-1-investigating-von)
  - [Step 2: Getting Your VON Issuer/Verifier Agent Running](#step-2-getting-your-von-issuerverifier-agent-running)
    - [In Browser](#in-browser-2)
    - [Local Machine](#local-machine-2)
    - [Clone, Initialize and Start Your Agent](#clone-initialize-and-start-your-agent)
    - [Submit Credentials via API](#submit-credentials-via-api)
      - [Submit Credentials via Bulk Load Script](#submit-credentials-via-bulk-load-script)

## Running in your Browser or on Local Machine

This guide can be run from within a browser, or if you are more technically inclined, you can run it on your local machine using Docker. In the following sections, there are sub-sections for `In Browser` and `Local Machine`, depending on how you want to run the guide. If you are planning on setting up a new VON Issuer/Verifier Agent instance for your organization, we suggest you use the `Local Machine` path.

## Prerequisites

### In Browser

The only prerequisite (other than a browser) is an account with [Docker Hub](https://hub.docker.com). Docker Hub is the "Play Store" for the [Docker](https://docker.com) ecosystem.

### Local Machine

To run this guide on your local machine, you must have the following installed:

* Docker (Community Edition is fine)
  * If you do not already have Docker installed, go to [the Docker installation page](https://docs.docker.com/install/#supported-platforms) and click the link for your platform.
* Docker Compose
  * Instructions for installing docker-compose on a variety of platforms can be found [here](https://docs.docker.com/compose/install/).
* git
  * [This link](https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/) provides installation instructions for Mac, Linux (including if you are running Linux using VirtualBox) and native Windows (without VirtualBox).
* a bash shell
  * bash is the default shell for Mac and Linux.
  * On Windows, the git-bash version of the bash shell is installed with git and it works well. You **must** use bash to run the guide (PowerShell or Cmd will not work).
* curl
  * An optional step in the guide uses the utility `curl`.
  * curl is included on Mac and Linux.
  * Instructions for installing curl on Windows can be found [here](https://stackoverflow.com/questions/9507353/how-do-i-install-and-use-curl-on-windows).

## VON Network Setup

### In Browser

Go to [Play with Docker](https://labs.play-with-docker.com/) and (if necessary) click the login button. *Play With Docker* is operated by Docker to support developers learning to use Docker.

> If you want to learn more about the `Play with Docker` environment, look at the [About](https://training.play-with-docker.com/about/) and the Docker related tutorials at the Docker Labs [Training Site](https://training.play-with-docker.com). It's all great stuff created by the Docker Community. Kudos!

Click the `Start` button to start a Docker sandbox you can use to run the demo, and then click `+Add an Instance` to start a terminal in your browser. You have an instance of a Linux container running and have a bash command line.  We won't need to use the command line until Step 2 of this tutorial.

From time to time in the steps in this guide, we'll ask you to edit files. There are two ways to do that in this environment:

- If you are comfortable with the `vi` editor, you can just use that. If you don't know `vi`, don't try it. It's a little scary.
- Alternatively, there is an `Editor` button near the top of the screen. Click that and you get a list of files in your home directory, and clicking a file will open it in an editor.  You will probably need to expand the editor window to see the file. Make the changes in the editor and click the `Save` button.
  - Don't forget to click the `Save` button.

The following URLs are used in the steps below for the different components:

- The `von-network` URL - [http://greenlight.bcovrin.vonx.io](http://greenlight.bcovrin.vonx.io). You'll see a ledger browser UI showing four nodes up and running (blue circles).
- The `Aries VCR` URL  - [https://demo.orgbook.gov.bc.ca](https://demo.orgbook.gov.bc.ca) - You'll see the OrgBook interface with companies/credentials already loaded.

You can open those sites now or later. They'll be referenced by name (e.g. "The von-network URL...") in the guide steps.

### Local Machine

On a local machine upon which the prerequisites are setup, we will be installing and starting instances of [von-network](https://github.com/bcgov/von-network), and [Aries VCR](https://github.com/bcgov/aries-vcr).

#### VON Network

In a shell, run the following commands to start von-network:

```bash
git clone https://github.com/bcgov/von-network
cd von-network
./manage build
./manage start
```

After about 20 seconds or so, go to [http://localhost:9000](http://localhost:9000) in your browser and you should see a web page with the status of your network showing four nodes up and running (blue circles). If you don't get the server up immediately, wait longer and refresh your browser.  If you have a atypical docker and hosts setup, you may have to determine how to navigate to the correct page.

If you want to see the logs for von-network (especially if things aren't working), run from the same folder the command `./manage logs`. When you are done with the logs and you want to get back to the command line, type `Ctrl-c`.

When you are finished with the demo and want to stop the running von-network, run from the same folder the command `./manage stop`.

#### Aries VCR

After von-network has started, go to a second shell and run the following commands to start Aries VCR:

```bash
git clone https://github.com/bcgov/aries-vcr
cd aries-vcr/docker
./manage build
./manage start
```

The build step will take a long time to run, so sit back and relax...

Once you have run the `start` step and the logs look good, navigate to [http://localhost:8080](http://localhost:8080) in your browser to get to the Aries VCR home page. Sadly, you won't be able to do much because no credentials have been loaded, but at least everything is running!

When you are finished playing with the instance of Aries VCR, go back to your shell, hit Ctrl-c to get back to the command line prompt and run `./manage stop`. That will stop all of the running containers and clean up the volumes created as part of the Aries VCR instance.

## Step 1: Investigating VON

If you are new to VON, see the instructions in the respective repos for how to use the running instances of [von-network](https://github.com/bcgov/von-network) and [Aries VCR](https://github.com/bcgov/aries-vcr).

Our goal in this guide is to configure a new permit and/or licence VON issuer/verifier agent so that the credential will be discoverable in the Aries VCR instance.

## Step 2: Getting Your VON Issuer/Verifier Agent Running

In this step, we'll get an instance of your new VON issuer/verifier agent running and issuing credentials.

### In Browser

Start in the root folder of your Docker instance—where you began.

### Local Machine

Use a different shell from the one used to start the other components. After opening the new shell, start in the folder where you normally put the clones of your GitHub repos.

### Clone, Initialize and Start Your Agent

Clone the repo, and run the initialization script.

```bash
# Start in the folder with repos (Local Machine) or home directory (In Browser)
git clone https://github.com/bcgov/aries-vcr-issuer-controller
cd aries-vcr-issuer-controller
. init.sh  # And follow the prompts

```

The `init.sh` script does a number of things:

- Prompts for some names to use for your basic agent.
- Prompts for whether you are running with Play With Docker or locally and sets some variables accordingly.
- Registers a DID for you on the ledger that you are using.
- Shows you the lines that were changed in the agent configuration files (in [issuer_controller/config](issuer_controller/config)).

The initial agent you  created issues one credential, using the name you gave it, with a handful of claims: permit ID, permit type, etc. That credential depends on the applying organization already having the BC Registries "Registration" credential. Without already having that credential, an applying organization won't be able to get your agent's credential.

To start your agent, run through these steps:

```
cd docker   # Assumes you were already in the root of the cloned repo
./manage build
./manage start
```

After the last command, you will see a stream of logging commands as the agent starts up. The logging should stabilize with a "Completed sync: indy" entry.

When you need to get back to the command line, you can press `CTRL-c` to stop the stream of log commands. Pressing `CTRL-c` does not stop the containers running, it just stops the log from displaying. If you want to get back to seeing the log, you can run the command `./manage logs` from the `aries-vcr-issuer-controller/docker` folder.

To verify your agent is running:

1. Go to the `agent URL`, where you should see a "404" (not found) error message. That signals the agent is running, but does not respond to that route.
   1. For `In Browser`, click the "5001" link at the top of the screen. That's the path to your agent.
   2. For `Local Machine`, go to [http://localhost:5001](http://localhost:5001)

All good?  Whoohoo!

### Submit Credentials via API

To submit credentials, use Postman (or similar, based on your local configuration) to submit the following to http://localhost:5000/issue-credential

```
[
    {
        "schema": "ian-registration.ian-ville",
        "version": "1.0.0",
        "attributes": {
            "corp_num": "ABC12345",
            "registration_date": "2018-01-01",
            "entity_name": "Ima Permit",
            "entity_name_effective": "2018-01-01",
            "entity_status": "ACT",
            "entity_status_effective": "2019-01-01",
            "entity_type": "ABC",
            "registered_jurisdiction": "BC",
            "addressee": "A Person",
            "address_line_1": "123 Some Street",
            "city": "Victoria",
            "country": "Canada",
            "postal_code": "V1V1V1",
            "province": "BC",
            "effective_date": "2019-01-01",
            "expiry_date": ""
        }
    },
    {
        "schema": "ian-permit.ian-ville",
        "version": "1.0.0",
        "attributes": {
            "permit_id": "MYPERMIT12345",
            "entity_name": "Ima Permit",
            "corp_num": "ABC12345",
            "permit_issued_date": "2018-01-01",
            "permit_type": "ABC",
            "permit_status": "OK",
            "effective_date": "2019-01-01"
        }
    }
]
```

For example:

```bash
curl -H 'Content-Type: application/json' -X 'POST' http://localhost:5000/issue-credential -d @- << EOF
<paste contents of the above file here>
EOF
```

This should return the ID numbers for the updated credentials, for example:

```
[
    {"result":"70273ab2-ca75-42cd-aef9-c16a968be49c", "success":true},
    {"result":"2f8986a7-9ba3-48ab-b34d-9cdf7759f5bc", "success":true},
    {"result":"822408b0-216a-4a51-b768-66436cd8130c", "success":true}
]
```

#### Submit Credentials via Bulk Load Script

Open a browser at http://localhost:5050 and:

- click on "initialization and load tasks" | "von data db init"
- click on "Run"
- then back to home page (left hand nav bar, click on "Overview")
- click on "von data event processor" then click on "Run"
- this will post about 360 random credentials
- then back to home page (left hand nav bar, click on "Overview")
- click on "von data pipeline status" then click on "Run"
- this will display the summary counts

If you navigate to the Credential Registry (http://localhost:8080) you can search for and view the loaded credentials.


text:
---
layout: post
title:  Sorting Out A Linked List
date:   2016-07-17
---

Linked lists can sometimes be a better fit than an array for an application's data structure. However, sorting a linked list in Ruby is not as straight-forward as sorting an array, as there are no built-in methods.

A useful exercise is to write a method that sorts a list of integers. As preparation for the problem, I first constructed a linked list of unsorted integers.

{% highlight ruby %}
Node = Struct.new(:data, :next)

list = Node.new(6, nil)
current_node = list
[5, 10, 3, 5, 7, 8, 5, 10, 1].each do |num|
  current_node.next = Node.new(num, nil)
  current_node = current_node.next
end

# 6 -> 5 -> 10 -> 3 -> 5 -> 7 -> 8 -> 5 -> 10 -> 1

{% endhighlight %}

Now how to approach the problem?

One method might be to traverse the list, collecting all the items in an array. Then we can sort the array and rebuild the list in order.

How long would this approach take? Let's go through the steps. First, we must do an initial traversal of our list. Since we have *n* nodes in our linked list, that means we have a cost of *n* steps so far. Now that we have an array, we can use any number of sorting methods to put them in order. The simplest way is to just use Ruby's array sort method:

{% highlight ruby %}
array = [6, 5, 10, 3, 5, 7, 8, 5, 10, 1]
array.sort

# => [1, 3, 5, 5, 5, 6, 7, 8, 10, 10]
{% endhighlight %}

However, if we were to write our own, we might use an efficient method like a Merge Sort. (With such a small array, another method might be more appropriate, but let's assume we're writing a method that could be used on a list of any size.) A Merge Sort works in O(n log n) time, giving us O(n + (n log n)) time after both creating the array and sorting it.

The final process is to traverse our sorted array and build a new linked list. This, of course, will take *n* steps. That leaves us with O(2n + (n log n)). If we divide out the *n*, we get O(n(2 + log n)), which is basically O(n log n), the Big O of the sort. This is the best we can hope for, since the sort can't get any faster.

The question is, do we need a sort? There's a trick we can use to reach O(n), though only under certain conditions, which is a list of limited range and a finite set of values (e.g. integers or letters). This might occur in real life when sorting, for example, a list of users' ages.

Instead of trying to sort the data, I traversed the list once and kept track in a hash of the number of times each integer was used. I also kept track of the maximum and minimum of the set so that I could use it in the next step.

{% highlight ruby %}
def sort_list(list)
  items = Hash.new(0)         # the default value is 0
  current_node = list
  until current_node.nil?
    min ||= max ||= current_node.data
    items[current_node.data] += 1
    max = current_node.data if current_node.data > max
    min = current_node.data if current_node.data < min
    current_node = current_node.next
  end
end
{% endhighlight %}

That gives us O(n) so far, since we've traversed the list once. Now, instead of sorting the list, we just have to reconstruct it in order. To do this, I started at the minimum and counted up to the maximum, using my hash count to insert the correct number of nodes for each integer that was present in the original array.

{% highlight ruby %}
def sort_list(list)
  .
  .
  .

  new_list = nil
  (min..max).each do |count|
    items[count].times do
      if new_list.nil?
        current_node = new_list = Node.new(items[count], nil)
      else
        current_node = current_node.next = Node.new(count, nil)
      end
    end
  end
  new_list
end
{% endhighlight %}

This process runs longer than *n* times since I am iterating through numbers that I don't use. Of course, as I mentioned, this only works on lists of a finite set (it wouldn't work on floats, for instance), and also of limited range. With an unknown range, the Big O would be infinity (or at least the maximum value of integers) since the list could have a huge range, e.g. a list like 0 -> 1 -> 100_000_000_000_000. However, in certain circumstances in which we knew our numbers would have a much narrower range (less than, say, n log n), this method would be faster, because the rebuilding of list would take give us an O(n + max - min), which, ignoring the constants, means the method is O(n), linear time.

So, we're now left with a method that could potentially be much faster than using a sorting method. Perhaps the next step in improving the method would be to determine by the range which method is more appropriate.

Anyway, here's the final, full method for creating a sample list, sorting it, and displaying the results:

{% highlight ruby %}
Node = Struct.new(:data, :next)

list = Node.new(6, nil)
current_node = list
[5, 10, 3, 5, 7, 8, 5, 10, 1].each do |num|
  current_node.next = Node.new(num, nil)
  current_node = current_node.next
end

def print_list(list)
  print "#{list.data}"
  current_node = list.next
  until current_node.nil?
    print " -> #{current_node.data}"
    current_node = current_node.next
  end
  puts
end

def sort_list(list)
  items = Hash.new(0)
  current_node = list
  until current_node.nil?
    min ||= max ||= current_node.data
    items[current_node.data] += 1
    max = current_node.data if current_node.data > max
    min = current_node.data if current_node.data < min
    current_node = current_node.next
  end

  new_list = nil
  (min..max).each do |count|
    items[count].times do
      if new_list.nil?
        current_node = new_list = Node.new(items[count], nil)
      else
        current_node = current_node.next = Node.new(count, nil)
      end
    end
  end
  new_list
end

print_list(list)
print_list(sort_list(list))
{% endhighlight %}

license: MIT

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# Static web container

This container runs a default install nginx to serve static content. Start it with `docker run -v /full/path/to/web/pages/root/:/var/www/html:ro -d pocketinternet/http-static:0.1`

## Sample page

There's an included folder in the repo with an `index.html` and a picture that you can use (remember you need to put the full path in the docker run command).

extension: md


text:
# pyNasNas
### A simple game framework to get started quickly with python and sfml.

### Features :
 - [x] Automatic resource loader and  manager system
 - [x] Scene and Layers system
 - [x] Entities, sprites and animations
 - [x] Cameras
 - [x] Text and bitmap fonts
 - [x] Tiled map loader (.tmx)
 - [x] Debug text display in-game
 - [x] Transitions

### In progress :
 - [x] Menus and UI

### To do :
 - [ ] Splash screens
 - [ ] Levels and game events management
 - [ ] In-game command line for debugging
 - [ ] Particles system

### Install

#### From pip
```
python3 -m pip install NasNas
```
Then you can import NasNas anywhere in your projects
```python
import NasNas as ns
```

#### From source
Download and extract the repository. Then run
```
python3 setup.py install
```

#### Local install
Let's say your project has the following structure
```
YourProject
    |_ assets
    |_ src
    main.py
```

Download the repository and copy the NasNas folder into your project src folder.
```
YourProject
    |_ assets
    |_ src
        |_ NasNas
    main.py
```
Then you can, import NasNas with:
 ```python
import src.NasNas as ns
```

### Get started

Visit the [wiki](https://github.com/Madour/pySFMLGameEngine/wiki) to get started.

You can also take a look at the example project to see how to use it.

Be sure to run run_example.py from example folder like this : `python3 ../run_example.py`

### Other

A C++ version of NasNas is under development, you can check it out [here](https://github.com/Madour/NasNas)

### Author

 - Modar Nasser

license: Zlib

repository: ABD-Z/pyNasNas

gha_license_id: NOASSERTION

repo_name: ABD-Z/pyNasNas


text:
# voxel plugin

**voxel plugin** allows to create fully volumetric, entirely destructible, infinite worlds in **Unreal Engine**.
It is compatible with 4.20 and 4.21.

For more info, check the website: https://voxelplugin.com

Join the discord for all the latest news! https://discord.gg/58ZqEbg

You can get a binary build here: https://gumroad.com/voxelplugin

To report an issue: https://gitlab.com/Phyronnaz/VoxelPluginIssues/issues

## Installation
* In your game’s root directory, create a folder named Plugins
* Copy the Voxel folder into it. You should have something like
```
    MyProject
    ├── Content
    └── Plugins
        └── Voxel
            └── Voxel.uplugin
```
* If you want to use it in your C++ project: add **"Voxel"** as public dependency in **MyProject.Build.cs**. You should have
```
    PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Voxel" });
```
## Quick start
Follow [this video](https://www.youtube.com/watch?v=EpXu9kqFoSM)

Basically:
* Add a **Voxel Invoker Component** to your character
* Add a **VoxelWorld** to your scene
* Set your player controller to the **BP_VoxelPlayerController** (need to toggle *Show Plugin Content*)
* Hit play

## Pricing & Licensing

There are two editions of the plugin available:

* a free version (this one), with limited features
* a pro version with more features, which you can check out [on the website](https://voxelplugin.com)

Both versions can be used commercially.

## Features

### Free version
* Fully volumetric and entirely destructible terrain
* Infinite worlds with seamless LODs
* Ultra smooth edits: up to 50 times per second on a single chunk
* VR Ready: everything is done in background threads, allowing for a constant 90fps
* Up to 256 materials, with smooth transitions and texture support
* Complete Blueprint interface
* C++ World Generators to create your own worlds

### Pro version
* Easy to use custom graph system to create your own worlds
* Multiplayer
* Importers: import from meshes, heightmaps, landscapes, MagicaVox, 3D Coat and splines
* Voxel Physics: enable physics on floating voxel blocks
* Grass and Voxel Actors
* Pro Support

## Docs & Support
The docs of the plugin are hosted at https://voxel-plugin.readthedocs.io/en/latest/

To get support, you can either:
* join the discord: https://discord.gg/58ZqEbg
* leave a message on the UE forums: https://forums.unrealengine.com/community/released-projects/125045-voxel-plugin

For issues, please use https://gitlab.com/Phyronnaz/VoxelPluginIssues/issues

## Screenshots
![Materials](https://i.imgur.com/du0V5i6.png)
![50Hz Edits](https://i.imgur.com/4ouIrX9.png)
![Grass & Voxel Actors (Pro only)](https://i.imgur.com/0Ic3o6h.png)
![Infinite World](https://i.imgur.com/hvfXNob.png)
![Multiplayer (Pro only)](https://i.imgur.com/wEMPfYm.png)
![Entirely Destructible](https://i.imgur.com/v3zjXQj.png)
![Import Meshes, Heightmaps, Landscape, Splines, MagicaVox assets, 3D Coat assets (Pro only)](https://i.imgur.com/YiX8afI.png)
![Fully Volumetric](https://i.imgur.com/9tH7yVv.png)
![Voxel Physics (Pro only)](https://i.imgur.com/c6Zc4oD.png)

repository: daozhangXDZ/VoxelPlugin

repo_name: daozhangXDZ/VoxelPlugin


text:
The `useResizeObserver` hook is useful when you want to watch a specific element
resize when it can't be handled just by an entire page resize listener. The
`ResizeObserver` is useful when you want to watch a specific element resizing
when it can't be handled just by an entire page resize listener. This hook
returns an ordered list containing a `ref` object containing the current element
if you need access to that element and a `refHandler` that should be passed to
the target element.

The example below will animating between different max heights and max widths
once the "Start" button is pressed and show the current `height` and `width`
values within the table.

repository: mlaursen/react-md

branch_name: refs/heads/main

gha_language: TypeScript

gha_license_id: MIT

repo_name: mlaursen/react-md


text:
# Change Log

## 1.2.0

 - Deprecated Jade plugin in favor of plugin

## 1.1.0

 - Updated to Electron v. 1.0.2

## 1.0.0

Features:
 - Migrated from `jshint` and `jscs` to `eslint`
 - Introduced a simple plugin system
 - More promises, less callbacks

Bug fixes:
 - Add missing `npm` requirement

Removed:
 - Dependency on `babel` by default

Notes:
  - From this version on, Node.js >= 4.0 is required

## 0.4.1

repository: rmp/aprs-electron

gha_language: CSS

repo_name: rmp/aprs-electron