text:
# Actuator's Design Document
# 1. Product Design
## 1.1. Requirements

- Health check

Users can check the health status of both Layotto internal components and the applications behind Layotto through the Actuator API,

- Query runtime metadata

Through the Actuator API, Layotto's own metadata information (such as version, git information) and metadata information of business applications can be obtained (such as the list of subscribed topics, such as application version information)

- Support integration into open source infrastructure, including:
    - Can be integrated into k8s health check
    - Can be integrated into a monitoring system, such as Prometheus+Grafana
    - If necessary, the service registry can remove nodes based on the health check results
    - We can build dashboard projects or GUI tools based on this API in the future to troubleshoot problems.

- Similar to the functions of Spring Boot Actuator, there will be more room for imagination in the future: Monitoring, Metrics, Auditing, and more.

## 1.2. Explanation

**Q: What is the value? People use the health check API for what?**

1. For troubleshooting.Developers can access the Actuator API directly to query runtime metadata or reasons for unavailability, or using a dashboard page/GUI tool based on the API.

2. For monitoring by the monitoring system;

3. For automated operation provided by the infrastructure.For example,the deployment system can use the health check results to determine the deployment progress, whether should it continue or not; the service registry can remove abnormal nodes based on health checks;the k8s can kill and recreate containers based on health checks.

**Q: It seems that there is no need to return detailed information,since a status code is enough? Who will use the detailed runtime information?**

1. We can build a dashboard page or GUI tool based on the detailed information in the future to troubleshoot problems;

Similar to the spring boot community wrote a 'spring boot admin' web page based on the spring boot actuator

2. With these information,we can integrate Layotto into monitoring system like Prometheus+Grafana

Similar to Spring Boot Actuator being integrated with Prometheus+Grafana

**Q: Should we add some admin API to control the ability, such as "turn off the ability of specific components inside Layotto"**

A: Don't do it. Switching some components off will leave the app in a partial failure state, which can lead to uncertainty.
However, we can consider adding debug capabilities in the future, such as mock, packet capture and package modification, etc.

**Q: Does the health check API do permission control?**

A: Don't do it for now, add a hook if we receive feedbacks in the future.

# 2. High-level design

## 2.1. Overview

Develop the http API first, because the health check function of the open source infrastructure basically supports http (such as k8s, prometheus), while grpc is not supported.

In order to reuse filter capabilities such as the authentication filter of MOSN, Actuator runs on MOSN using a layer-7 filter as a glue layer.

Specifically, add a new listener and a new stream_filter to MOSN. This filter is responsible for http request processing and calling Actuator.

Endpoint is an abstract inside Actuator. After a new request arrives at the server, Actuator will entrust the corresponding Endpoint to process it. Endpoint supports on-demand expansion and injection into Actuator:

![img.png](../../../img/actuator/abstract.png)

## 2.2. Http API design

### 2.2.1. Explanation for API path

The path adopts restful style. After different Endpoints are registered in Actuator, the path is:

```
/actuator/{endpoint_name}/{params}
```

For example:
```
/actuator/health/liveness
```

The 'health' element in the path above identifies the Endpoint name is health, and 'liveness' is the parameter passed to the health Endpoint.

Multiple parameters can be passed, such as /actuator/xxxendpoint/a/b/c/d, and the semantics of the parameters are determined by each Endpoint.

The paths registered by default are:

```
/actuator/health/liveness

/actuator/health/readiness

/actuator/info
```

### 2.2.2. Health Endpoint
#### /actuator/health/liveness
GET
```json
// http://localhost:8080/actuator/health/liveness
// HTTP/1.1 200 OK

{
  "status": "UP",
  "components": {
    "livenessProbe": {
      "status": "UP",
      "details":{

      }
    }
  }
}
```
Return field description:

HTTP status code 200 means success, other (status code above 400) means failure.

There are three types of status fields:
```go
var (
	// INIT means it is starting
	INIT = Status("INIT")
	// UP means it is healthy
	UP   = Status("UP")
	// DOWN means it is unhealthy
	DOWN = Status("DOWN")
)
```

#### /actuator/health/readiness
GET
```json
// http://localhost:8080/actuator/health/readiness
// HTTP/1.1 503 SERVICE UNAVAILABLE

{
  "status": "DOWN",
  "components": {
    "readinessProbe": {
      "status": "DOWN"
    }
  }
}
```
### 2.2.3. Info Endpoint

#### /actuator/info

GET
```json
// http://localhost:8080/actuator/health/liveness
// HTTP/1.1 200 OK

{
    "app" : {
        "version" : "1.0.0",
        "name" : "Layotto"
    }
}
```

**Q: What are the runtime metadata requirements?**

Phase 1:

- version number

We can add more information in the future:

- Callback app
- Runtime configuration parameters

**Q: Is it mandatory for components to implement the health check API?**

Temporarily not mandatory

## 2.3. Schema of config data

![img.png](../../../img/actuator/actuator_config.png)

A new listener is added for handling actuator requests. A new stream_filter called actuator_filter is added for http request processing(see below)

## 2.4. Internal structure and request processing flow

![img.png](../../../img/actuator/actuator_process.png)

explanation:

### 2.4.1. When requests arrive

The request arrives at the mosn, enters Layotto through the stream filter, and calls the Actuator.

The http protocol implementation class (struct) of the stream filter layer is DispatchFilter, which is responsible for dispatching requests and calling Actuator according to the http path:
```go

type DispatchFilter struct {
	handler api.StreamReceiverFilterHandler
}

func (dis *DispatchFilter) SetReceiveFilterHandler(handler api.StreamReceiverFilterHandler) {
	dis.handler = handler
}

func (dis *DispatchFilter) OnDestroy() {}

func (dis *DispatchFilter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffer.IoBuffer, trailers api.HeaderMap) api.StreamFilterStatus {
}
```
The protocol layer is decoupled from Actuator. If the API of other protocols is needed in the future, the stream filter of this protocol can be implemented.

### 2.4.2. Requests will be assigned to Endpoints inside Actuator

Drawing lessons from the design of spring boot: Actuator abstracts the concept of Endpoint, which supports on-demand expansion and injection of Endpoint.

Built-in Endpoints are health Endpoint and info Endpoint.
```go
type Actuator struct {
	endpointRegistry map[string]Endpoint
}

func (act *Actuator) GetEndpoint(name string) (endpoint Endpoint, ok bool) {
	e, ok := act.endpointRegistry[name]
	return e, ok
}

func (act *Actuator) AddEndpoint(name string, ep Endpoint) {
	act.endpointRegistry[name] = ep
}

```
When a new request arrives at Actuator,it will be assigned to the corresponding Endpoint according to the path.

For example, /actuator/health/readiness will be assigned to health.Endpoint

### 2.4.3. health.Endpoint collect information from all the implementation of health.Indicator

The components that need to report health check information should implement the Indicator interface and inject it into health.Endpoint:
```go
type Indicator interface {
	Report() Health
}
```
When a new request arrives,health.Endpoint will collect information from all the implementation of health.Indicator

### 2.4.4. info.Endpoint collect information from all the implementation of info.Contributor

Components that need to report runtime information should implement the Contributor interface and inject it into info.Endpoint:
```go
type Contributor interface {
	GetInfo() (info interface{}, err error)
}
```

When the path '/actuator/info' is visited,Actuator dispatch the request to info.Endpoint.

info.Endpoint will collect information from all the implementation of info.Contributor

# 3. Detailed design

## 3.1. When will health state change
### 3.1.1. runtime_startup Indicator

- SetStarted

![img.png](../../../img/actuator/set_started.png)

- SetUnhealthy

When the startup fails:

![img.png](../../../img/actuator/img.png)

When server stops:

![img_1.png](../../../img/actuator/img_1.png)

### 3.1.2. apollo's Indicator

When failing in initializing the component:

![img_2.png](../../../img/actuator/img_2.png)

repository: emeory/layotto

repo_name: emeory/layotto


text:
### Create an unmanaged cluster

Create a few on-premises Kubernetes clusters. This is simulated using k3s by Rancher running on a single Azure VM.

1. Open [**Cloud Shell**](https://shell.azure.com/)
2. Execute this code to create a resource group and copy the credential output

```bash
LOCATION=uksouth

RG_ID=$(az group create -n "rg-arc4k8s-${LOCATION}" -l "${LOCATION}" -o tsv --query 'id')
AZURE_CREDENTIALS=$(az ad sp create-for-rbac --sdk-auth --role contributor --scopes $RG_ID)

echo "Copy this output into a GitHub secret with the name: 'AZURE_CREDENTIALS_${LOCATION^^}'"
echo "You will use this to allow GitHub to deploy the appropriate resources"

echo $AZURE_CREDENTIALS
```

3. [Create a child repository](//github.com/jasoncabot-ms/arc-for-kubernetes/generate) from this template, you can call it something like `arc-for-kubernetes` but the name doesn't matter
4. Add a secret with value of the `AZURE_CREDENTIALS` output. The name does not matter, but something like `AZURE_CREDENTIALS_<region>` would work
> This secret allows GitHub access to Azure resources within the resource group created in Step 2

As an example, your GitHub repository should appear like this
![Secret values](secret_example.png)

5. Run the **Deploy Cluster** workflow from [GitHub Actions](../../actions)

license: MIT

repository: mormond/arc-for-kubernetes

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: mormond/arc-for-kubernetes


text:
# JS Weekend

> An intensive weekend React workshop with Kiwi.com developers

## About

See our website: https://www.kiwi.com/jsweekend/

The goal of this workshop is to show you some great tools and best practices for
building React application. During two weekend days you'll learn how to fetch
data with Relay Modern from GraphQL backend, enrich Javascript with static
types due to Flow, write test, create re-usable React components and setup
continuous deployment.

The workshop is divided into four blocks plus one short introduction. Each block
corresponds to a directory containing the desired source code we'll try to create.

## Installation

There are no complicated dependencies. All you need is [Node.js](https://nodejs.org/en/)
and [Yarn](https://yarnpkg.com/en/) installed, everything else will be installed
from NPM.

## Table of Contents

* [Requirements](#requirements)
* [How to install](#how-to-install)
* [Where to start](#where-to-start)
* [Technologies used](#technologies)

## Requirements

This project requires the following to be installed.

* [Node.js 8+](https://nodejs.org/en/)
* [Yarn](https://yarnpkg.com/en/docs/install)

## How to Install

If you have everything from [Requirements](#requirements) then you can simply run: `yarn`.

This project uses [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) so all the project dependencies for all the folders will be installed automatically.

In each block/directory, you'll find a working application. Check out the readme
file if you want to run it.

## Where to start

The application you should start with is in a directory
[start](https://github.com/kiwicom/jsweekend/tree/master/start). Feel free to make all your changes here.

All other folders contain ready made parts of our final application. If you get stuck or can't keep up you can use the code from these folders to help yourself catch up with the rest or see how we've handled a problem you may have come across.

## Technologies

Here you can find a list of technologies we use everyday that we would like to show you. The JSWeekend workshop is focused on teaching you some of the know how and best practices we have come to with these technologies.

Main technologies:

* [NextJS](https://github.com/zeit/next.js/)
  * Serverside rendering for React
  * Easy to use Framework for creating a React focused application with routing sorted out
  * Made by Zeit.co
* [React](https://reactjs.org/)
  * JavaScript library for building user interfaces
  * Made by Facebook
* [Relay](https://facebook.github.io/relay/)
  * Javascript library for communicating with GraphQL
  * React components for handling network calls
  * Made by Facebook
* [Styled-JSX](https://github.com/zeit/styled-jsx)
  * Library for CSS-in-JS
  * Made by Zeit.co
* [Storybook](https://github.com/storybooks/storybook)
  * Library for showcasing components
* [Jest](https://facebook.github.io/jest/)
  * Library for testing
* [Flow](https://flow.org/)
  * Library for static type checking
* [ESLint](https://eslint.org/)
  * Library for enforcing code style
* [Prettier](https://prettier.io)
  * Opinionated and automating code styling
  * Let a extension handle formatting for the entire team automatically
* [Cypress](https://www.cypress.io)
  * End to end testing in JS

repository: marizikmund/jsweekend

branch_name: refs/heads/master

repo_name: marizikmund/jsweekend


text:
# Getting Started

## Installation

If your application setup uses a bundler (like [Vite](https://vitejs.dev/)), just add the [npm package](https://www.npmjs.com/package/hybrids) to your application:

```bash
npm i hybrids
```

Otherwise, you can use it directly from a number of CDNs, which provides packages from the registry:

* [https://esm.sh/hybrids@^8](https://esm.sh/hybrids@^8) (2 requests, minified)
* [https://cdn.skypack.dev/hybrids@^8?min](https://cdn.skypack.dev/hybrids@^8?min) (2 request, minified)
* [https://unpkg.com/hybrids@^8](https://unpkg.com/hybrids@^8) (multiple requests, not minified)

```html
<script type="module">
  import { define, html } from 'https://esm.sh/hybrids@^8';

  define({
    tag: "hello-world",
    name: '',
    content: ({ name }) => html`<p>Hello ${name}!</p>`,
  });
</script>
```

### Hot Module Replacement

HMR is supported out of the box, but your bundler setup may require indication that an entry point can be replaced on the fly. For example, for bundlers using ES module syntax, you can use the following code:

```javascript
// Enable HMR only in development mode
if (import.meta.hot) import.meta.hot.accept();
```

If the entry point imports files that do not support HMR, you can place the above snippet in a module where you define your web components. (where `define` method from the library is used).

## Browser Support

The library source code uses ES modules and currently supported JavaScript syntax by all of the major browsers. You can use hybrids in all modern browsers without code transpilation and bundling.

repository: hybridsjs/hybrids

gha_language: JavaScript

gha_license_id: MIT

repo_name: hybridsjs/hybrids


text:
## Sub-split of Flysystem for in-memory file storage.

```bash
composer require league/flysystem-memory
```

View the [documentation](https://flysystem.thephpleague.com/v2/docs/adapter/in-memory/).

repository: sergiy-petrov/flysystem

repo_name: sergiy-petrov/flysystem


text:
# Turla

```
  __               .__
_/  |_ __ _________|  | _____
\   __\  |  \_  __ \  | \__  \
 |  | |  |  /|  | \/  |__/ __ \_
 |__| |____/ |__|  |____(____  /
                             \/

```

## Description

### MITRE Description

> [Turla](https://attack.mitre.org/groups/G0010) is a Russian-based threat group that has infected victims in over 45 countries, spanning a range of industries including government, embassies, military, education, research and pharmaceutical companies since 2004. Heightened activity was seen in mid-2015. [Turla](https://attack.mitre.org/groups/G0010) is known for conducting watering hole and spearphishing campaigns and leveraging in-house tools and malware. [Turla](https://attack.mitre.org/groups/G0010)’s espionage platform is mainly used against Windows machines, but has also been seen used against macOS and Linux machines. (Citation: Kaspersky Turla) (Citation: ESET Gazer Aug 2017) (Citation: CrowdStrike VENOMOUS BEAR) (Citation: ESET Turla Mosquito Jan 2018)

### External Description

>

## Aliases

```
Turla
Waterbug
WhiteBear
VENOMOUS BEAR
Snake
Krypton
```

## Known Tools

```
systeminfo
net
tasklist
gpresult
wce
pwdump
Uroburos
Turla
Agent.BTZ
Tavdig
Wipbot
Agent.dne
AdobeARM
ATI-Agent
MiniDionis
WhiteBear
Gazer
Neuron
Nautilus
Kopiluwak
```

## Operations

```
Satellite Turla
Epic Turla
The 'Penquin' Turla
Witchcoven
RUAG hack
Mosquito
Moonlight Maze
```

## Targets

```
Targeting several governments and sensitive businesses such as the defense industry
embassies and diplomatic/foreign affair organizations, defense-related organizations
```

## Attribution Links

```
https://securelist.com/analysis/publications/65545/the-epic-turla-operation/
https://securelist.com/blog/research/72081/satellite-turla-apt-command-and-control-in-the-sky/
https://securelist.com/blog/research/67962/the-penquin-turla-2/
https://www2.fireeye.com/rs/848-DID-242/images/rpt-witchcoven.pdf
https://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/waterbug-attack-group.pdf
https://www.welivesecurity.com/2017/03/30/carbon-paper-peering-turlas-second-stage-backdoor/
https://www.welivesecurity.com/2017/06/06/turlas-watering-hole-campaign-updated-firefox-extension-abusing-instagram/
https://securelist.com/kopiluwak-a-new-javascript-payload-from-turla/77429/
https://www.proofpoint.com/us/threat-insight/post/turla-apt-actor-refreshes-kopiluwak-javascript-backdoor-use-g20-themed-attack
https://www.welivesecurity.com/2017/08/30/eset-research-cyberespionage-gazer/
https://www.govcert.admin.ch/blog/22/technical-report-about-the-ruag-espionage-case
http://www.sueddeutsche.de/digital/it-sicherheit-einbrechen-ausbreiten-abgreifen-1.3887843
https://www.welivesecurity.com/2018/05/22/turla-mosquito-shift-towards-generic-tools/
https://www.ncsc.gov.uk/alerts/turla-group-malware
https://motherboard.vice.com/en_us/article/vvk83b/moonlight-maze-turla-link
https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2018/03/07180251/Penquins_Moonlit_Maze_PDF_eng.pdf
https://www.wired.com/2017/04/russian-hackers-used-backdoor-two-decades/
https://www.crowdstrike.com/blog/meet-crowdstrikes-adversary-of-the-month-for-march-venomous-bear/
https://www.symantec.com/blogs/threat-intelligence/waterbug-espionage-governments
https://securelist.com/turla-renews-its-arsenal-with-topinambour/91687/
https://securelist.com/shedding-skin-turlas-fresh-faces/88069/
https://twitter.com/lehtior2/status/893085897226412036
https://www.ncsc.gov.uk/news/turla-group-exploits-iran-apt-to-expand-coverage-of-victims
https://medium.com/chronicle-blog/who-is-gossipgirl-3b4170f846c0
https://securelist.com/introducing-whitebear/81638/
```

## Country

```
russia
```

## Comments

```
Turla also uses OilRig's (APT34) implants
Associated with Turla
```

# Techniques

* [Brute Force](../techniques/Brute-Force.md)

* [Spearphishing Link](../techniques/Spearphishing-Link.md)

* [Query Registry](../techniques/Query-Registry.md)

* [PowerShell](../techniques/PowerShell.md)

* [System Service Discovery](../techniques/System-Service-Discovery.md)

* [File and Directory Discovery](../techniques/File-and-Directory-Discovery.md)

* [Registry Run Keys / Startup Folder](../techniques/Registry-Run-Keys---Startup-Folder.md)

* [Bidirectional Communication](../techniques/Bidirectional-Communication.md)

* [Process Injection](../techniques/Process-Injection.md)

* [Malicious Link](../techniques/Malicious-Link.md)

* [Ingress Tool Transfer](../techniques/Ingress-Tool-Transfer.md)

* [Remote System Discovery](../techniques/Remote-System-Discovery.md)

* [System Network Configuration Discovery](../techniques/System-Network-Configuration-Discovery.md)

* [System Information Discovery](../techniques/System-Information-Discovery.md)

* [Winlogon Helper DLL](../techniques/Winlogon-Helper-DLL.md)

* [Web Protocols](../techniques/Web-Protocols.md)

* [Indicator Removal from Tools](../techniques/Indicator-Removal-from-Tools.md)

* [Process Discovery](../techniques/Process-Discovery.md)

* [System Network Connections Discovery](../techniques/System-Network-Connections-Discovery.md)

* [Spearphishing Attachment](../techniques/Spearphishing-Attachment.md)

* [SMB/Windows Admin Shares](../techniques/SMB-Windows-Admin-Shares.md)

* [System Time Discovery](../techniques/System-Time-Discovery.md)

* [PowerShell Profile](../techniques/PowerShell-Profile.md)

* [Modify Registry](../techniques/Modify-Registry.md)

* [Obfuscated Files or Information](../techniques/Obfuscated-Files-or-Information.md)

* [Windows Management Instrumentation Event Subscription](../techniques/Windows-Management-Instrumentation-Event-Subscription.md)

* [Native API](../techniques/Native-API.md)

* [Disable or Modify Tools](../techniques/Disable-or-Modify-Tools.md)

* [Deobfuscate/Decode Files or Information](../techniques/Deobfuscate-Decode-Files-or-Information.md)

* [Proxy](../techniques/Proxy.md)

* [Data from Removable Media](../techniques/Data-from-Removable-Media.md)

* [Create Process with Token](../techniques/Create-Process-with-Token.md)

* [Data from Local System](../techniques/Data-from-Local-System.md)

* [Windows Command Shell](../techniques/Windows-Command-Shell.md)

* [Credentials from Password Stores](../techniques/Credentials-from-Password-Stores.md)

* [Visual Basic](../techniques/Visual-Basic.md)

* [Exfiltration to Cloud Storage](../techniques/Exfiltration-to-Cloud-Storage.md)

* [Archive via Utility](../techniques/Archive-via-Utility.md)

* [Dynamic-link Library Injection](../techniques/Dynamic-link-Library-Injection.md)

* [Lateral Tool Transfer](../techniques/Lateral-Tool-Transfer.md)

* [Domain Groups](../techniques/Domain-Groups.md)

* [Local Groups](../techniques/Local-Groups.md)

* [Domain Account](../techniques/Domain-Account.md)

* [Local Account](../techniques/Local-Account.md)

* [Password Policy Discovery](../techniques/Password-Policy-Discovery.md)

* [Peripheral Device Discovery](../techniques/Peripheral-Device-Discovery.md)

* [Data from Information Repositories](../techniques/Data-from-Information-Repositories.md)

* [Drive-by Compromise](../techniques/Drive-by-Compromise.md)

* [Security Software Discovery](../techniques/Security-Software-Discovery.md)

# Malwares

* [Gazer](../malwares/Gazer.md)

* [Mosquito](../malwares/Mosquito.md)

* [Epic](../malwares/Epic.md)

* [Uroburos](../malwares/Uroburos.md)

* [Kazuar](../malwares/Kazuar.md)

* [ComRAT](../malwares/ComRAT.md)

* [Carbon](../malwares/Carbon.md)

* [PowerStallion](../malwares/PowerStallion.md)

* [LightNeuron](../malwares/LightNeuron.md)

# Tools

* [Tasklist](../tools/Tasklist.md)

* [Reg](../tools/Reg.md)

* [nbtstat](../tools/nbtstat.md)

* [netstat](../tools/netstat.md)

* [Mimikatz](../tools/Mimikatz.md)

* [Arp](../tools/Arp.md)

* [Net](../tools/Net.md)

* [Systeminfo](../tools/Systeminfo.md)

* [Empire](../tools/Empire.md)

* [PsExec](../tools/PsExec.md)

* [certutil](../tools/certutil.md)


text:
**When You Really Love Someone双手简谱** 和五线谱完全对应。

_When You Really Love Someone_ 是Alicia Keys的歌曲，收录在专辑The Diary of Alicia
Keys中。精雕细琢了两年多，终于在2003年快要结束的时候，Alicia Keys发表了这张《The Diary of Alicia
Keys》专辑。在经历了2002年初葛莱美颁奖典礼那个美妙的夜晚之后，全世界无数热心的歌迷对于Alicia
Keys的第二张个人专辑都在翘首以待，期待着这位灵魂乐才女能够给歌迷更多新的惊喜。现在，这张专辑终于来了，在发行后的第一周，这张专辑横扫唱片店货架，售出了61万8千张，这样的成绩比她第一张专辑《Songs
in A Minor》最高24万张的单周销量高出一倍还要多的多，同时这也令这张专辑毫无阻力的登上了Billboard排行榜冠军的宝座。

歌词下方是 _When You Really Love Someone钢琴谱_ ，希望大家喜欢。

### When You Really Love Someone歌词：

I'm a woman, lord knows it's hard
I need a real man to give me what I need
Sweet attention, love and tenderness
When it's real it's unconditional, I'm telling y'all

[Chorus:]

Cause a man, just ain't a man,
If he aint' man enough
To love you when you're right,
Love you when you're wrong
Love you when you're weak,
Love you when you're strong
Take you higher
When the world got you feelin low.

url: https://raw.githubusercontent.com/Emptyspirit/everyonepiano-music-database/fb8ba03dd9474f049b18d9822c40a395229b7aca/流行/When You Really Love Someone-Alicia Keys/README.md


text:
# ESLint

Enable eslint and integrate with other tools like TypeScript

## What it does

- If no `eslint` config found in project's root directiry, create one
- If detect that project is using TypeScript, install `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` and add them into `eslint` config

repository: SpellarBot/generator-effective

repo_name: SpellarBot/generator-effective


text:
Introduction
============

There is no better documentation of an algorithm than a working example. Now
imagine hundreds of OpenCV examples in a single app where each algorithm is less
than a page of code and is in a familiar language – C++, C\#, Python, or VB.Net.
And each algorithm is *just the algorithm* without the baggage from a user
interface. That is what "OpenCVB" Version 1.0 provides.

In the sample output below, any of the hundreds of algorithms can be selected
from the first combo box at the top of the form. The second combo box is used to
group the different algorithms by OpenCV API or OpenCVB algorithm. The default
grouping is to select “\<All\>” algorithms while other special groupings allow
selecting Python or C++ or Multi-threaded algorithms. The text at the right side
of the toolbar is a brief description of the algorithm. Icons on the left side
are to (l. to r.): pause/resume the algorithm, change global settings for
OpenCVB, run regression tests, and take a picture of the current output.

![](media/aeec548511d99538594068b76ca4b49b.png)

The output images above are the RGB output (upper left), the colorized depth
image (upper right), the output of the current algorithm (lower left) and an
optional second image output from the algorithm (lower right). In this example
the algorithm renders the camera point cloud as if seen from directly above in
the lower left image while the lower right has the view from the side. Both
perspectives show the camera field of view (FOV) and the distance to each of the
objects.

The “Sample Results” section below provides numerous additional examples.

Pre-Install Requirements
========================

Here are the requirements:

-   Windows 10

-   Visual Studio 2019 Community Edition (Free version of Visual Studio)

-   Any of the following RGBZ cameras:

    -   Microsoft Kinect for Azure

    -   Intel RealSense camera –D435i

    -   Intel T265 camera (no point cloud or depth data)

    -   StereoLabs ZED2

    -   Mynt Eye D 1000

    -   Intel RealSense L515 – a Lidar-based camera without an IMU

    -   Intel RealSense D455 – the latest in the series of Intel RealSense
        cameras

Most of the above cameras have an IMU (Inertial Measurement Unit.) The Microsoft
Kinect for Azure has the best depth accuracy but requires more power and is not
as portable as the Intel D435i camera. All the cameras use USB 3 to provide data
to the host platform.

The Objective
=============

The objective is to solve many small computer vision problems and do so in a way
that enables any of the solutions to be reused. The resulting toolkit can solve
bigger and more important problems.

OpenCVB is targeting only cameras that produce depth and color. These newer
cameras have prompted a review of existing vision algorithms to see how they can
be improved if depth is known. To enable revisiting many existing algorithms,
this software provides a single application that can run hundreds of OpenCV
algorithms on any of the cameras listed above.

There are many computer vision examples on the web but too often something is
missing. OpenCVB is designed to collect these algorithms into a single
application and guarantee that each will build and run. In addition, the process
of adding variants and experimenting with algorithms is simplified.

The languages used are those often found in OpenCV projects - C++, C\#, Python
and even VB.Net. Secondly, it is important to get access to multiple libraries -
OpenCV, OpenCVSharp, OpenGL, Emgu, NumPy, NAudio, and OpenMP. And lastly, it is
important to use all the possible image representations - 3D, bitmaps, plots,
bar charts, spreadsheets, or text.

Making these languages and libraries available while using the same
infrastructure shaped a standardized class for OpenCV examples. Implementing
hundreds of examples with the same reusable class structure has confirmed the
approach is useful. The result is a starting point to add depth and explore
OpenCV.

There are other objectives. Convolutions combined with neural nets (CNN’s) are a
successful approach to computer vision. CNN’s detect differences within a set of
images and identify content surprisingly well. OpenCVB is a pathway to search
for more and better features than convolutions, features that are measured,
objective, and essential. Depth, infrared, gravity, and camera motion are the
kind of objective features that can enhance almost any imaging algorithm.

And what if all cameras had depth and an IMU? Making this assumption explains
why only a few cameras from Intel, Microsoft, and others are currently
supported. The data from each camera – color, depth, point cloud, and IMU data -
is presented to all the algorithms in the same standardized format. More cameras
with depth are expected to arrive and integration with OpenCVB is likely to
follow. OpenCVB is an opportunity to experiment with the features of these
cameras and apply the same algorithm to all cameras.

The algorithms are notably short, almost always less than a page of code,
labelled reasonably well, easily searched, and easily combined, while often
providing links to online documentation and versions for other platforms. Many
downloadable algorithms are encumbered by environmental considerations that can
obscure the meaning or context of an algorithm. All the algorithms here contain
just the algorithm separate from any camera dependencies and will work with each
of the supported cameras. Isolating just the algorithm functionality enables
easy adaptation to other environments or platforms.

Pre-Install Notes
=================

You will need to download and install the following before starting:

-   Microsoft Visual Studio 2019 Community Edition (Free)

    -   <https://visualstudio.microsoft.com/downloads/>

-   CMAKE 3.0 or later

    -   <https://cmake.org/download/>

-   TortoiseGit and Git

    -   <https://tortoisegit.org/>

    -   <https://git-scm.com/downloads>

Installation – Quick Reference
==============================

-   <https://github.com/bobdavies2000/OpenCVB> - download OpenCVB from GitHub

-   <https://www.python.org/downloads/release/python-380/> - Install the latest
    Python (version 3.8)

    -   One of the algorithms – PythonPackages.py – checks that all the required
        Python packages are present.

-   In the OpenCVB directory, run the “PrepareTree.bat” script. It will download
    and run CMake for OpenCV, OpenCV_Contrib, librealsense, and Kinect4Azure.
    After building it will occupy about 18Gb of disk space – plan accordingly.

    -   This will take a fair amount of time depending on the network speed.

    -   After “PrepareTree.bat” completes, Visual Studio projects will open. Run
        “Batch Build” in each Visual Studio project.

-   Set Environmental variable OpenCV_Version to 450. – This depends on the
    version of OpenCV, currently 4.50.

-   <https://docs.microsoft.com/en-us/azure/Kinect-dk/sensor-sdk-download> –
    Select “Windows Installer” to get proprietary Kinect4Azure support.

-   Build and run OpenCVB.sln

    -   Edit “Cameras/CameraDefines.hpp” to turn on support for Mynt Eye D1000
        or StereoLabs Zed 2

Full Installation Description with Discussion
=============================================

The first step is to download OpenCVB from GitHub:

-   <https://github.com/bobdavies2000/OpenCVB>

The second step is to download the desired version of Python for use with
OpenCVB. Only Python 3.x is supported. The latest Python is available here:

-   <https://www.python.org/downloads/release/python-380/> - Install the x86-64
    bit version.

The third step is where all the work is.

-   Run the “PrepareTree.bat” script in the OpenCVB directory.

The “PrepareTree.bat” script will download OpenCV, librealsense, and
Kinect4Azure from their respective GitHub locations and install them in the
OpenCVB tree. In addition, the script will run the CMake commands that setup
OpenCV, librealsense, and Kinect4Azure for OpenCVB’s use. The script will then
open Visual Studio for each solution file. Build the Debug and Release versions
of each with the “Build/Batch Build” Visual Studio menu entry. The steps to
download and run CMake take about 20 minutes depending on the speed of the
network connection. The Visual Studio builds should take about an hour depending
on the speed of the machine.

After all the packages have been built, then there is one environmental variable
that needs to be set and it will depend on which version of OpenCV was just
downloaded and built.

-   Environmental variable “OpenCV_Version” should be set to 450

The currently available OpenCV download is 4.50 so setting OpenCV_Version to 450
reflects that but note that OpenCV is updated several times a year and the
environmental variable may need to be updated.

The last step before building OpenCVB is to download the proprietary binaries
from Microsoft for their Kinect4Azure camera. The “PrepareTree.bat” script built
the open source portion of the camera support but this step will complete the
installation of the Kinect4Azure camera:

-   <https://docs.microsoft.com/en-us/azure/Kinect-dk/sensor-sdk-download>

    -   Click “Microsoft Installer” to download and install the proprietary
        Kinect code from Microsoft

The last step is to open the OpenCVB.sln file and build OpenCVB.

Support for some optional cameras can be easily added:

-   For the StereoLabs ZED 2 camera (released Q1 2020), install the StereoLabs
    SDK from

    -   <https://www.stereolabs.com/>

-   For the Mynt Eye D 1000 camera, download the SDK from:

    -   <https://mynt-eye-d-sdk.readthedocs.io/en/latest/sdk/install_win_exe.html>

-   Edit “Cameras/CameraDefines.hpp” file to add OpenCVB’s support for
    StereoLabs Zed 2 or Mynt Eye D 1000 support.

Trouble-Shooting New Install
============================

Some typical problems with new installations:

-   Link problems: check the “OpenCV_Version” environmental variable for OpenCV
    version. It may need to reflect a newer version of OpenCV. For OpenCV 4.4,
    the environmental variable is OpenCV_Version = 440. Make sure that OpenCV
    Debug and Release versions were built successfully.

-   Camera Failure: check the camera installation by testing with examples
    provided by the vendor. Did the Kinect4Azure support get upgraded recently?
    Post if some configuration problems prevent the camera from working in
    OpenCVB.

-   Python Scripts Fail: this is likely a missing package. Run the algorithm
    “PythonPackages.py” in OpenCVB to verify that all the necessary packages are
    installed. If still failing, check the Python setting in the Options (click
    the Settings icon.) Make sure it points to the Python version that was
    installed. Test Python scripts independently using \<OpenCVB Home
    Directory\>/VB_Classes/Python/PythonDebug.sln.

Build New Experiments
=====================

OpenCVB is a WinForms application and most of the algorithms are written using
Microsoft's managed code but C++ examples are provided as well (with appropriate
VB.Net wrappers.) Python examples don’t require a VB.Net wrapper unless you want
to pass RGB, depth, or point cloud images to your Python script. There are
several VB.Net examples that demonstrate how to move images to Python (see
AddWeighted_Trackbar_PS.py as an example that is only a few lines of code.)

For C++, C\#, and VB.Net writing a new experiment requires a new class be added
anywhere in the “VB_Classes” project. OpenCVB will automatically detect the new
class and present it in the user interface. The code is self-aware in this
regard – the UI_Generator project is invoked in a pre-compile step for the
VB_Classes project.

Code “snippets” are provided to accelerate development of new VB.Net, OpenGL,
and C++ algorithms. To use any snippets, you must first install them in Visual
Studio: use the menu “Tools/Code Snippets Manager” and add the “\<OpenCVB Home
Directory\>/OpenCVB.snippets” directory. After installing, access the code
snippets with a right-click in the VB.Net code, select “Snippet/Insert Snippet”
and select “OpenCVB.snippets”. NOTE: even C++ algorithms can use snippets, but
each C++ algorithm has a VB.Net entry that includes both the C++ and the VB.Net
code in the snippet. The C++ portion is to be cut and pasted anywhere in the
“CPP_Classes” Visual Studio project included with OpenCVB.

Experimental Subsets
====================

The complete list of algorithms may be grouped into smaller subsets to study
some shared OpenCV API reference or to switch quickly between algorithms.
Algorithm subsets may be created and accessed through the Subset Combo Box in
the toolbar (indicated below.) The list of subsets is built from all the OpenCVB
algorithm names and all the OpenCV API’s referenced. For instance, selecting
“Threshold” in the Subset Combo Box, will update the Algorithm Combo Box with
all the algorithms that use the OpenCV “Threshold” API.

![](media/38bd5de162aff996693b6f96d7b1d58e.png)

*In the image above, all the algorithms using the “Edges_Sobel” class are listed
in the Algorithms Combo Box. The Select Subset combo box contains a subset
“\<All\>” that will allow access to the complete list of algorithms.*

The ability to create subsets from the hundreds of algorithms makes it easier to
study examples of an OpenCV API or OpenCVB algorithm usage. All the OpenCV API’s
that are used and all the OpenCVB algorithms are available in the list of
subsets. In addition, several higher-level groupings are available. For
instance, selecting “\<OpenGL\>” will select only the algorithms that use
OpenGL. The “\<All\>” entry in the Subset Combo Box will restore the complete
list of algorithms.

Regression Testing All Experiments
==================================

Testing is integrated into OpenCVB. Clicking the icon below runs through a
checklist of all the algorithms at all the resolutions with all the supported
cameras available on the system. The duration of each test can be selected in
the Options dialog.

![](media/4551393d07ab7de64ae7f0422f672cb7.png)

When using a subset of the algorithms, the “Test All” button will test only the
algorithms in the subset. This can be useful when changing an algorithm that is
reused frequently by other algorithms. For instance, if the Edges_Sobel
algorithm is changed, first select the subset of all algorithms using
Edges_Sobel then select “Test All” to visually review each algorithm using the
updated Edges_Sobel.

One side benefit of the “Test All” feature is that is provides a way to visually
review all the algorithms. When used in combination with the subset feature, it
can make it easier to search for a desired effect.

Why VB.Net?
===========

VB.Net is not a language associated with computer vision algorithms. But the
proliferation of examples in OpenCVB suggests this may be an oversight. Even the
seasoned developer should recognize what is obvious to the beginner: VB.Net can
keep the code simple to read and write. VB.Net is a full-featured language just
like C\# with lambda functions and multi-threading and VB.Net includes user
interface tools that are flexible and complete (check boxes, radio buttons,
sliders, TrueType fonts, and much more) - options missing from OpenCV's popular
HighGUI library. (All existing HighGUI interfaces are still supported though.)

The main caution in using VB.Net is to treat it as a scripting language like
Python. Most of the algorithms avoid pixel-by-pixel details – VB.Net can be
detailed but it will be slower than optimized C++. Usually, OpenCVB is doing
most of the real work in optimized C++ through the OpenCVSharp interface. Most
algorithms run reasonably fast even in Debug mode because the release version of
OpenCVSharp is active even when the solution is in Debug mode.

Critics will point out that a Windows 10 app using VB.Net is not easily portable
to other platforms but the entire OpenCVB application does not need to be ported
to other platforms. Only individual algorithms will need to be ported after they
are debugged and polished and most algorithms consist almost entirely of OpenCV
APIs which are available everywhere. OpenCVB’s value lies in the ability to
experiment and finish an OpenCV algorithm before even starting a port to a
different platform. Confining development to OpenCVB’s C++ interface should
provide the most portable version of any algorithm but even VB.Net code is also
easily ported to a variety of non-Windows platforms.

Camera Interface
================

All the camera code is isolated in the “camera” class – see cameraD400Series.vb,
cameraKinect.vb, cameraMynt.vb, cameraZed2.vb or cameraT265.vb. There are no
references to camera interfaces anywhere else in the code. Isolating the camera
support from the algorithms strips the code to just the essential OpenCV API’s
needed.

For example, the Kinect for Azure camera support is isolated to the
cameraKinect.vb class and a supporting Kinect4Azure DLL that provides all the
interface code to the Kinect for Azure libraries. Since there is likely to be
little interest in debugging the Kinect4Azure DLL, the Release version is used
even in the Debug configuration. If it is necessary to debug the camera
interface, set any Build Configuration components to the Debug version.
Optimizations enable a higher framerate than when running the Debug
configuration of the Kinect camera DLL. As a result, the VB.Net code in Debug
mode often runs as fast as the Release configuration.

OpenGL Interface
================

There have been several attempts to provide OpenGL interfaces into managed code,
but none is used here. OpenGL is simply run in a separate process. To
accommodate running separately, a named-pipe moves the image data to the
separate process and a memory-mapped file provides a control interface. The
result is both robust and economical leaving the OpenGL C++ code independent of
hardware specifics. The VB.Net code for the OpenGL interface is less than a page
and does not require much memory or CPU usage. The OpenGL C++ code provided with
OpenCVB is customized for specific applications in a format that should be
familiar to OpenGL developers. There are several examples – displaying RGB and
Depth, 3D histograms, 3D drawing, and IMU usage. A code snippet (See ‘Build New
Experiments’ above) provides everything needed to add a new OpenGL algorithm
that will consume RGB and a point cloud.

NOTE: it is easy to forget to include any new OpenGL project in the Project
Dependencies. This can be confusing because the new project will not build
automatically when restarting. The OpenCVB Project Dependencies need to be
updated whenever a new OpenGL application is added to the OpenCVB solution. To
update dependencies, select “Project/Dependencies” from the Visual Studio menu
and make sure that the “OpenCVB” project depends on any new OpenGL projects.
This ensures that the new project will always be rebuilt when OpenCVB is
restarted.

OpenCV’s OpenGL Interface
=========================

The “PrepareTree.bat” script will have configured OpenCV with OpenGL support.
OpenCVB can use this OpenGL interface – see the OpenCVGL algorithm. The
interface is sluggish and looks different from most OpenGL applications so the
alternative interface to OpenGL (discussed above) is preferred. Both interfaces
use the same sliders and options to control the OpenGL interface.

NOTE: why use sliders instead of OpenGL mouse or keyboard callbacks? The answer
in a single word is precision. It is often desirable to set appropriate defaults
with each of the numerous ways to change the display. Also, sliders were
valuable in learning which OpenGL API was controlling which feature of the 3D
effect. Preconfiguring the sliders allows the user to program a specific setup
for viewing 3D data.

For those that prefer using the mouse to adjust the OpenGL display, the OpenGL
code snippet provides sample code. To test a working example of OpenGL using
just the mouse interface, see the OpenGL_Callbacks algorithm.

Python Interface
================

OpenCV has numerous examples of Python scripts and Python is often used for
computer vision experiments. To add a new Python script for use with OpenCVB,
add a script in the Python directory of the VB_Classes project. It is convenient
for edits to add any script to the VB_Classes project but, more importantly, any
changes to a Python script will automatically show the new or renamed Python
files in the user interface. Python scripts don’t require a VB.Net wrapper –
just add them to the VB_Classes Project in the Python directory – and the script
will be present in the user interface.

Python scripts that would like a stream of images from the camera need to use
the “PyStream.py” import. There are numerous examples of how to do this: see
AddWeighted_Trackbar_PS.py or Camshift_PS.py. The “_PS” suffix is an OpenCVB
convention that indicates it is a Python Streaming script that expects a stream
of RGB and Depth images. NOTE: The Python script name MUST END WITH \_PS for
PyStream.py to work. To see the list of all the Python Streaming scripts, select
the pre-defined subset group called “\<PyStream\>”.

Python scripts show up in the list of algorithms in the OpenCVB user interface
and each Python script will be run when performing the regression tests. To
change which version of Python is used, open the “Options” dialog and in the
“Python” section, there is a browse button to select any Python.exe available on
the system.

Python Packages
===============

The Python libraries “opencv-python” or “NumPy” are required for many of the
OpenCVB Python scripts but are not installed by default. To update missing
packages in Visual Studio, use the “Tools/Python/Python Environments” in the
Visual Studio menu:

-   “Tools/Python/Python Environments” – select “Packages” in the combo box then
    enter “opencv-python” or “numpy” or any Python import and then select the
    package from the list.

To check that all the necessary packages are installed, run the
‘PythonPackages.py’ algorithm from OpenCVB’s user interface.

NumPy is included in the list of NuGet packages that come with OpenCVB but the
code has not been stable. Using Python as it is normally consumed – with Python
scripts running in their own process – means that the script will be reusable
elsewhere. There is a check box in the Global Options dialog box to allow new
versions of NumPy to be tested with the existing NumPy algorithms. Because it
has been unreliable, the enabled setting is not saved when OpenCVB is closed.

Python Debugging
================

Python scripts are run in a separate address space when invoked by OpenCVB so
Visual Studio’s Python debug environment is not available. When a Python script
fails in OpenCVB, it may be debugged in the PythonDebug project. Here are the
steps to debug Python:

-   Open VB_Classes\\Python\\PythonDebug.pyproj in Visual Studio.

-   Copy the failing Python script into the PythonDebug.py file, and run it.

The Python script will be running in the same environment as if it were invoked
from OpenCVB except the Python debugger will be active. For Python scripts
requiring a stream of images or point clouds, OpenCVB is opened in a separate
address space with the requested Python script. Images and point clouds will
then be streamed to the failing Python script running in the debugger.

Visual Studio Debugging
=======================

The Visual Studio projects can be configured to simultaneously debug both
managed and unmanaged code seamlessly. The property “Enable Native Code
Debugging” for the managed projects controls whether C\# or VB.Net code will
step into C++ code while debugging. However, leaving that property enabled all
the time means that the OpenCVB will take longer to start – approximately 5
seconds vs. 3 seconds on a higher-end system. The default is to leave the
“Enable Native Code Debugging” property off so OpenCVB will load faster. Of
course, if there is a problem in the C++ code that is best handled with a debug
session, turn on the “Enable Native Code Debugging” property in the OpenCVB
VB.Net project and invoke the algorithm requiring C++ debugging.

Record and Playback
===================

The ability to record and playback is provided with OpenCVB – see Replay_Record
and Replay_Play algorithms. RGB, Depth, point cloud, and IMU data are written to
the recording file. Any algorithm that normally runs with the live camera input
and IMU data can be run with recorded data. Use the “Subset Combo Box” to select
the option: “\<All using recorded data\>”. Running the regression tests with
that setting will run all the algorithms with recorded data instead of a live
camera feed.

StereoLabs Zed 2 Support
========================

The StereoLabs Zed 2 camera is supported but the support is turned off by
default. To enable this support:

-   Download the Windows 10 SDK from
    <https://www.stereolabs.com/developers/release/>

-   Edit the CameraDefines.hpp file to turn on the interface to the Zed 2
    camera.

The Zed 2 camera support is always installed in C:\\Program Files (x86)\\ZED SDK
(regardless of the version) so no additional changes are required to the
supporting C++ project.

Mynt Eye D 1000 Support
=======================

The Mynt Eye D 1000 camera is supported but the support is turned off by
default. To enable this support:

-   Download the Windows 10 SDK from
    <https://mynt-eye-d-sdk.readthedocs.io/en/latest/sdk/install_win_exe.html>

-   Edit the CameraDefines.hpp file to turn on the interface to the Zed 2
    camera.

The Mynt D SDK creates a system environmental variable MYNTEYED_SDK_ROOT that
allows the OpenCVB build to locate the Mynt D camera support no matter where it
was installed.

VTK Support
===========

VTK (the Visualization ToolKit) is supported through OpenCV but it takes a
non-trivial amount of time and effort to install and build it. The support is
present in this version but is turned off. All the algorithms using VTK will
work with or without VTK installed but if it is not present, the VTK algorithms
will simply display a message explaining how to enable VTK with the following
steps:

-   Run “Support\\PrepareVTK.bat” in \<OpenCVB_Home\>

-   Build VTK for both Debug and Release

-   Build OpenCV for both Debug and Release

-   Edit mainVTK.cpp (project VTKDataExample) and modify the first line

Sample Results
==============

The following images are a preview of some algorithms’ output.

In the OpenCVB user interface, the top left image is the RGB and top right is
depth. Algorithm results are in the bottom left and right or additional OpenGL,
Python, or HighGUI windows.

![](media/d484f0049c87c9cd2ea7f99a61d12215.png)

*The bottom left is a top-down view of the point cloud data for an Intel D455
camera while the bottom right is a side view of the same point cloud. The red
lines indicate where walls were detected. A slider controls the expected minimum
length of a detected wall. The images are actually histograms of projections
after correcting the point cloud data to align with the gravity vector from the
integrated IMU on the D455 camera.*

![](media/e377133fbea5d03a0c3d83299aa994bd.png)

*OpenGL has an infinite number of ways to view a point cloud but visualizing top
down and side views may add the most value. The “Projection_Backproject”
algorithm provides both a top down view and a side view and back projects the
objects clicked into the color image in the lower left corner. A mask is also
provided for the object. The aspect ratio of both top and side views is 1:1 to
provide realistic dimensions and sharp, straight edges. The camera can be
located with the red dot. These projections are available with cameras that
include an IMU.*

![](media/d7ca291698e8ffd637a2d6df554e00ca.png)

*Benford’s Law is an interesting empirical hypothesis. The plot above is
actually 2 plots – a count of the leading digits pulled from a compressed image
combined with a plot of the expected distribution of those leading digits
derived from Benford’s Law. The values are so close that you cannot see the
difference. The code contains some links explaining Benford’s Law and examples
of when it works and when it does not.*

![](media/ac533603224f4ec5b4ac97c16dc22330.png)

*The top down view – after thresholding - is a slice through the vertical
objects in the field of view. Each object can be isolated with a floodfill to
find size and distance.*

![](media/916a4f7e3b53633c63bf7243a8a8a1ae.png)

*A genetic drawing experiment that translates any image or camera screen grab
into painting. The algorithm randomly alters DNA sequences describing brush
strokes.*

![](media/cd7e699a6192e4daf1d540a15e35005a.png)

*Histogram Valleys are used to create clusters in depth data. The bottom left is
the histogram showing the different clusters. The bottom right is the
back-projection of the different clusters into the depth image using the same
colors as the histogram.*

![](media/f3e144361b0ffeb85ff30f51af3eac3e.png)

*Using the histogram to create clusters (see previous example ‘Histogram
Valleys’) allows an algorithm to segment an entire image (see lower right
image), creating blobs that can be measured and tracked. The black segment has
no depth. The number of blobs can be controlled with a lower limit on the size
of the blob.*

![](media/1df99676bf4ca2ef5c9351c3259c35ac.png)

*The IMU timestamp provides clues to the relationship between the IMU capture
and the image capture (the devices are on different clocks.) The image capture
triggers an interrupt but how long ago did the IMU capture the pose data or
Gyro/Acceleration? The plot in the lower right shows the actual frame durations
for the IMU and host interrupts following an image capture. The IMU and host
interrupt frame times are used to estimate the delay from the IMU capture to the
image capture. The blue dots are the actual IMU capture frame times, the green
is the host image capture frame time, and the red is the estimated delay from
the IMU capture to the image capture. The white row shows the IMU frame time
with the highest occurrence and is used as a boundary between lost IMU captures
(below the white line) and correctly sequenced IMU captures (at or above the
white line).*

![](media/3df8502dfd9e7ac7e50e5645cf8fe4ad.png)

*Here the MeanShift algorithm is used to track the 4 largest blobs in the image.
The lower left image shows the objects tracked by the algorithm while the lower
right shows the different histograms used to identify the object to track. The
histogram is for the hue portion of the HSV format of the image.*

![](media/69c6578e73d94f9941e3e19ad50ae4f4.jpg)

*KAZE feature detection algorithm matching points on the left and right infrared
images from the Intel RealSense 3D camera.*

![](media/59211cf16c0fcf1573366606022a3a84.jpg)

*The features detected by the FAST (Features from Accelerated Segment Test)
algorithm are shown with 2 different FAST options.*

![](media/a5fdb31abf7b00f7795a0cc3d9a70866.png)

*This is a combination of 4 variations of binarization and their corresponding
histograms. It demonstrates the use of the Mat_4to1 class to get 4 images in
each of the result images.*

![](media/3367c93aeb671c6cd3ed978040e9b3aa.png)

*A Kalman filter is used here to follow the mouse. The actual mouse movement is
in red while the output of the Kalman filter is in white.*

![](media/278991d0c7a1b70a4d912707974e49ca.jpg)

*Compare the original color and depth images with the image right below it to
see the impact of an edge-preserving filter applied to both.*

![](media/e1cf24b8d952e0a0ddf6af7075e82e04.png)

*The bottom images are the output of a multi-threaded Hough lines algorithm that
identifies featureless RGB surfaces (shown as white in the lower right image).
The blue color in the lower right image is meant to highlight depth shadow where
no depth data is available.*

![](media/d1b5776e1e2062cd4dd50ca206b2528e.png)

*The MeanShift algorithm output (lower left) is used here to find what is likely
to be the face – the highest point of the nearest depth fields (shown in a box
in the lower right.)*

![](media/1c93b65678b1664d6f8c6b95eb1dfde6.png)

*Algorithms may optionally work on only a selected region. Here the oil paint
effect is applied only to the region selected by drawing a rectangle on the
output image (lower left.) The lower right image is an intermediate stage with
only edges. All algorithms may draw a rectangle with a right-mouse to open a
spreadsheet with the data selected in the rectangle.*

![](media/ec6993a1021d7e22891e6c1575edd88c.png)

*The OpenGL window is controlled from the VB.Net user interface but is run in a
separate address space. The OpenGL axes are represented in this image as well.
In the lower left background are some of the sliders used to control the OpenGL
interface – Point Size, FOV, yaw, pitch, roll.*

![](media/2429d8d0dc72575c4321f17af66029b9.png)

*This dnn Caffe example in VB.Net is a reinterpretation of the C++ sample
program distributed with the Intel librealsense library. The application is
meant to detect and highlight different objects shown in the yellow box (lower
right). The algorithm requires square input (shown centered in the lower left
image.)*

![](media/8497c5db9233508b0cecc82bf0cc13c6.png)

*This example of a compound class shows an image that has been motion-blurred
(lower left) and then de-blurred in the lower right. The options for the motion
blur and de-blur are also shown.*

![](media/a3f9a39a4f120ef7829003267332a9b3.jpg)

*It is an option to use VTK (Visualization Tool Kit) but it is turned off by
default in the distribution. The test pattern in the lower right image behind
the VTK output is sent to VTK where the 3D histogram is computed and displayed.*

![](media/2f8061c17229863e8216ee67ee5cfb4f.png)

*The Expectation Maximization algorithm learns the different clusters and then
predicts the boundaries of those clusters. The lower left image defines the
different clusters (each with a different color) and the lower right fills in
the maximized regions for each cluster. The RGB and Depth images are not used in
this example.*

![](media/676099b58f6e449a8fae146232512495.png)

*In this example of multi-threaded simulated annealing, the lower right image
shows 4 annealing solutions - the 2 best solutions with 2 worst solutions. The
log in the bottom left shows each thread getting different energy levels,
confirming that each is independently searching the solution space. The example
was taken directly from the OpenCV examples but was multi-threaded on an Intel
Core i9 18-core (36 thread) processor here*.

![](media/fc40ee0a0f63d30e70b12177a3b3a0c4.png)

*First, two estimated triangles are created to surround two sets of random
points. Then an affine transform is computed that converts one triangle to the
other. The matrix of the computed affine transform is shown of the lower right
image. The RGB and depth images are not used for this algorithm.*

![](media/11f9fa473841d322771407e024e5cc99.png)

*First, a randomly oriented rectangle is created. Then a transformation matrix
is computed to change the shape and orientation of the color image to the new
perspective. The matrix of the computed affine transformation is shown in the
lower right image.*

![](media/c1e4ce70ae8054b2fc0b5bbcf0d50f0a.png)

*The histograms displayed in OpenCVB have an option to use Kalman filtering to
smooth the presentation of the bar graph (lower right.) A check box (below the
bar graph) allows alternating between a Kalman-smoothed and real-time bar graph.
The bar colors show a progression of dark to light to link the color of the
underlying grayscale pixel into the bar graph. There is also an option to use
different transition matrices in the Kalman filter.*

![](media/ce8590b89b130234594bd9ecae5f0c64.png)

*This example shows the Plot_Basics class which will plot XY values. The bottom
left image shows the mean values for red, green, and blue in the color image
smoothed using Kalman prediction while the bottom right shows the real-time
values.*

![](media/2a29ff58c53f1225d7b2b99fcf1d79c4.png)

*In the OpenCV distribution there is a bio-inspired model of the human retina.
The objective is to enhance the range of colors present in an image. In this
example the “useLogSampling” is enabled and emphasizes colors (bottom left) and
motion (bottom right).*

![](media/6602327efd37ee81572ae5072fc75f78.jpg)

*Applying the bio-inspired enhancements, the high-dynamic range image is shown
in the bottom left while the motion-enhanced image is shown in the bottom right.
The monitor on the desk that appears black in the image in the top left has much
more detail in the bottom left image which shows the reflection that would
likely be visible to the human retina.*

![](media/b81abe738e142a7aa80f53ea6ca5b97b.png)

*In this Python example taken from the OpenCV distribution, the various
positions of an etalon (not shown) are visualized in a 3D matplotlib control.
See the “Camera_calibration_show_extrinsics.py” algorithm.*

![](media/7410ae7a79c21c3f20aef18ee58750aa.png)

*In this multi-threaded version of the Gabor filter, the bottom left image is
the Gabor result while the bottom right figure shows the 32 Gabor kernels used
to produce the result on the bottom left.*

![](media/cbabb4e31400daa77e482733a5b535f9.png)

*Emgu applications are supported as well. Here the planar subdivision of the
image is shown for a random set of points with Voronoi facets and Delauney
triangles. Emgu interfaces, while based on OpenCV, are significantly different
from OpenCVSharp. For instance, the Emgu Mat is not the same as the OpenCVSharp
Mat. Nonetheless, there is considerable ongoing investment in the Emgu APIs’ and
they are fully supported.*

![](media/b675880a11fc9b9a94d6873b1bf40fa8.png)

*The Aruco markers are found in an image allowing the image to be transformed
using OpenCV’s WarpPerspective transform. This example is from the OpenCVSharp
Sample programs.*

![](media/fe5d5b60aee4b1159d61f964a2bfff40.png)

*OpenCV can be used to display audio data using the NAudio package from NuGet.
The interface can play any available audio data or generate synthetic sound in a
variety of patterns – pink/white noise, square waves, sawtooth waves, etc. The
black vertical bar shows tracks the currently playing sound.*

![](media/08085bb3df8c48de755fc8e9e10074e7.png)

*This synthetic problem demonstrates how to use the Python SciKit package to
perform a gradient descent problem.*

![](media/2bb85cf64b4b39f190ba31e5059be427.png)

*A voxel-style view of the depth data in OpenGL is available – see top window.
The bottom left shows the thread grid used to compute the median depth in each
voxel while the bottom right shows the voxels colored with their median depth
(using the typical colors for depth – yellow for close, blue for distant.) The
options used in each of the contributing algorithms are present below the main
OpenCVB window (not shown.)*

![](media/83446a818084895c88dd13d1b30b9e2a.png)

*Support for Intel’s T265 is rudimentary – it is not meant to capture depth and
the camera is grayscale. The upper left image is the undistorted and remapped
Left View. The upper right color section shows depth (computed on the host)
while the rest of the image is the Left View. The bottom views are the left and
right raw camera views (cropped to accommodate the frame size.) While none of
the algorithms fail when running the T265, not all of them produce anything
useful as depth is not provided by the camera.*

![](media/64c52c2be85cafd12a707e52aa3a8cbc.png)

*OpenCV’s InitUndistortRectifyMat and Remap API’s can be used to manipulate the
image arbitrarily. Here one of the sliders in the interface has introduced
barrel distortion in the lower left image. This is a useful exercise to get an
more intuitive understanding of the parameters needed to rectify and undistort
an image.*

![](media/282608bc4f343ce30c844cadc10763b5.png)

*The 100 year-old photos of Prokudin-Gorskii were made with red, green, and blue
filters. Combining the 3 images is a useful application of the OpenCV
findTransformECC API that can align the images. One of the transformation
matrices is displayed as well. The option to use gradients for alignment
(instead of RGB values) is available. There are 4 possible OpenCV parameters to
define the extent of the search for alignment in the user interface.*

Future Work
===========

The plan is to continue adding more algorithms. There are numerous published
algorithms on the web but there is also the task to combine the different
algorithms in OpenCVB. The current edition of the code contains examples of
compound algorithms and more will arrive in future releases. The class-oriented
structure of the code almost enforces reuse because any algorithm with sliders
or check boxes suggests reusing an existing class rather than provide another
with similar set of sliders and check boxes. The options forms for combined
algorithms are automatically cascaded for easy selection.

Acknowledgements
================

The list of people who have made OpenCVB possible is long but starts with the
OpenCV contributors – particularly, Gary Bradski, Victor Erukhimov, and Vadim
Pisarevsky - and Intel’s decision to contribute the code to the open source
community. Also, this code would not exist without OpenCVSharp’s managed code
interface to OpenCV provided by user “shimat”. There is a further Intel
contribution to this software in the form of RealSense cameras – low-cost 3D
cameras for the maker community as well as robotics developers and others.
RealSense developers Sterling Orsten and Leo Keselman were helpful in educating
this author. While others may disagree, there is no better platform than the one
provided by Microsoft Visual Studio and VB.Net. And Microsoft’s Kinect for Azure
camera is a valuable addition to the 3D camera effort. And lastly, it should be
obvious that Google’s contribution to this effort was invaluable. Thanks to all
the computer vision developers who posted algorithms where Google could find
them. All these varied organizations deserve most of the credit for this
software.

MIT License
===========

<https://opensource.org/licenses/mit-license.php> - explicit license statement

Fremont, California

Summer 2020

Addendum 1: Comparing Cameras
=============================

There are 5 supported cameras that generate a point cloud – Intel RealSense
D435i, Intel RealSense L515, Microsoft Kinect4Azure, StereoLabs Zed 2, and Mynt
Eye D1000. The cameras are setup to measure the distance to the same wall in the
same environment. Here is a look at how the cameras were setup:

![](media/e15606605299f00d6ae1f4fb8da73c09.jpg)

The cast of characters – (left to right) Intel D435i, Intel L515, StereoLabs Zed
2, Mynt Eye D1000, and Microsoft Kinect 4 Azure. Using the
“PointCloud_GVector_TopView”, all the above cameras were used to measure the
distance to the wall approximately 2.5 meters from the cameras. The results are
below. Not shown above is the latest Intel RealSense camera – the D455. The
output is shown below and looks good.

![](media/a2bdd27cd813f1c37d92db977fc74a00.png)

Microsoft Kinect 4 Azure results – these were the best results.

![](media/528653ce39895622cffe3622778a5e21.png)

Intel Realsense L515 Lidar camera

![](media/4d64891bc8325de3fb0926b4db21c6a1.png)

Intel RealSense D435i camera. (Distance to the wall looks incorrect.)

![](media/ed464a9db22610b7e3dfd5ed1057d238.png)

StereoLabs Zed 2 camera. FOV looks a little skewed to the right. The problem
could be specific to this camera but there was no available second camera to
test (the camera is a little expensive.)

![](media/1e2803ceab3c74d9cbd59249369035b1.png)

Mynt Eye D 1000 camera.

![](media/e4879903e5aff609e28fff60fcb01f0f.png)

Intel RealSense D455 camera.

Addendum 2: Some Thoughts
=========================

1.  The user interface is the documentation. The user interface should make it
    clear how the algorithm works and what parameters will tweak it.

2.  There are few comments in the code. Documenting code is a second, parallel
    explanation of the algorithm. There is no need for a second explanation when
    the code is short and can be easily debugged. There are comments but they
    explain settings or assumptions from external algorithms. In common practice
    elsewhere, code comments are padded with spaces and too often out-of-date.
    Automated comments are a waste of screen space. Room for improvement: allow
    images in the code. The algorithm output can go a long way toward explaining
    the algorithm.

3.  Sliders and checkboxes are located by the text for the slider or checkbox,
    not by the name of some variable. The user interface is the documentation –
    see Thought \#1. If the text in the user interface changes and the slider or
    checkbox is not found, an error will appear in the regression tests
    describing the missing label and the name of the failing algorithm.

4.  All algorithms are run through a regression test with a single click.
    Algorithms can still fail when sliders or settings are changed but every
    effort is made to test with abrupt and reckless changes. Room for
    improvement: test combinations of settings automatically.

5.  Each algorithm is short. The application caption contains the average number
    of lines – currently around 33. Short algorithms are easier to write and
    test. Short algorithms may be easily rewritten in another language.

6.  Algorithms should run standalone. This enables testing and isolates
    problems. The “standalone” variable is available to all algorithms to
    control behavior when running by itself or as a companion to another
    algorithm.

7.  Every algorithm is designed for reuse by other algorithms. Each algorithm
    has at least one source (labeled src) and 2 default destinations (labeled
    dst1 and dst2). Any additional inputs or outputs are made available with
    public variables in the algorithm’s object.

8.  Camera interfaces are run in their own task and are always running and
    presented in the user interface whether the data is consumed or not.

9.  Cameras are always run at 1280x720. Requesting a lower resolution simply
    resizes the camera input before sharing with the algorithm task. The goal is
    to keep the camera interface simple. Room for improvement: support a full
    camera interface with different resolutions and settings.

10. The user interface is the main task. The camera task is independent of the
    user interface.

11. Algorithms are run in their own task as well. All threads are labeled for
    the “Threads” debugging use. The algorithm will wait on camera data if
    camera frame rate does not keep up.

12. Algorithm groupings are subsets organized by specific OpenCV and OpenCVB
    API’s or objects. Changes made to an OpenCVB algorithm can be easily
    validated by selecting the group of algorithms that use the OpenCVB
    algorithm and running the regression test.

13. OpenCV API’s can always be found with an editor but selecting an OpenCV API
    group will show how each algorithm uses the OpenCV API.

14. Every time that OpenCVB is compiled, the groupings are reorganized.

15. Every time OpenCVB is compiled, the list of all algorithms is created and
    provided to the user interface. The user interface is aware of the code used
    to create the user interface.

16. The last algorithm to execute is automatically run when starting OpenCVB.
    There is only a “Pause” button, no “Stop” button. When developing, a
    crashing algorithm has only to be renamed to allow OpenCVB to come back up.
    When the last algorithm is not found, the first algorithm in the algorithm
    list is run.

17. Regression tests run every algorithm with all resolutions and with each
    available camera. Setting the algorithm group to “\<All\>” will run 10’s of
    thousands of tests without incident.

18. Algorithms can run for extremely long durations. Not a problem normally, it
    was a problem for the regression tests when algorithm B is started before
    algorithm A is finished. This was fixed with Synclock around the algorithm
    thread – only one algorithm can run at a time. Algorithm B waits until
    algorithm A completes and relinquishes the lock.

19. Options for each algorithm are presented by the algorithm itself and are
    automatically part of the algorithm task. The appearance is that of an MDI –
    Multiple Document Interface – application and seems the share the
    inconveniences. However, click the main form and all the options will
    conveniently reappear.

20. With multiple tasks for camera, user interface, and algorithm, there is no
    guarantee that all 4 images are for the same instant. However, the left and
    right destination images are for the same iteration. Room for improvement:
    sync the presentation of the RGB and RGB Depth images like the dst1 and dst2
    images.

repository: omar-Fouad/OpenCVB

repo_name: omar-Fouad/OpenCVB


text:
# TicTacToe
Simple Tic-Tac-Toe game using libgdx

## Unit tests
 * Inspired by https://github.com/TomGrill/gdx-testing

repository: kevinbaptist/TicTacToe

gha_language: Java

repo_name: kevinbaptist/TicTacToe


text:
[com.coinzgame.theoxo.coinz](../index.md) / [InboxFragment](index.md) / [<init>](.)

# <init>

`InboxFragment()`

A fragment which shows the user their current inbox and allows them to craft new messages.
Crafting new messages starts a [MessageCreationActivity](../-message-creation-activity/index.md).

repository: theoxo/CoinzAndroidGame

repo_name: theoxo/CoinzAndroidGame


text:
# Android Overlay Packaging Tool

This is our modified version of Android's Android Asset Packaging Tool (AAPT), specifically for compiling OMS overlays.

To build it, either clone this repo in your ROM's "external" folder or add it as a line to your manifest, placing it in "external/aopt". After that, run your normal command:

```bash
. build/envsetup.sh
lunch
make -j# aopt
```


text:
# This project is now unmaintained. You might be interested into this active fork: https://depot.vwa.re/ludofloria/myhordes-enhancer/

---

## Die2Nite Enhancer

[![Build Status](https://travis-ci.org/aymericbeaumet/die2nite_enhancer.png?branch=master)](https://travis-ci.org/aymericbeaumet/die2nite_enhancer) [![Coverage Status](https://coveralls.io/repos/aymericbeaumet/die2nite_enhancer/badge.png?branch=master)](https://coveralls.io/r/aymericbeaumet/die2nite_enhancer?branch=master) [![Dependency Status](https://david-dm.org/aymericbeaumet/die2nite_enhancer.png?theme=shields.io)](https://david-dm.org/aymericbeaumet/die2nite_enhancer) [![devDependency Status](https://david-dm.org/aymericbeaumet/die2nite_enhancer/dev-status.png?theme=shields.io)](https://david-dm.org/aymericbeaumet/die2nite_enhancer#info=devDependencies)

Die2Nite Enhancer is an extension allowing you to improve your game experience on the browser game [Die2Nite](http://www.die2nite.com/).

The French ([Hordes](http://www.hordes.fr/)), Spanish ([Zombinoia](http://www.zombinoia.com/)) and Dutch ([Die Verdammten](http://www.dieverdammten.de/)) versions are supported.

### Install as an extension (recommended)

You can directly install this plugin as an extension for the following browsers:
- [Google Chrome](https://chrome.google.com/webstore/detail/die2nite-enhancer/imkkdabijgkodinlhgncdfmghdcdacmg)
- [Mozilla Firefox](https://addons.mozilla.org/en-US/firefox/addon/die2nite_enhancer/)
- [Opera](https://addons.opera.com/en/extensions/details/die2nite-enhancer/)
- [Safari](http://safariaddons.com/en-US/safari/addon/227)

### Install as a script

It is also possible to install this plugin as a script. Natively supported in Google Chrome, or with the GreaseMonkey extension under Mozilla Firefox. If you want to do it like so, I consider you know what you are doing: the script can be found [here](http://userscripts-mirror.org/scripts/show/242398).

### Feedback

If you find any problem or have a suggestion, please give me a feedback [here](https://github.com/aymericbeaumet/die2nite_enhancer/issues).

In case of a problem, please be sure all your softwares (browser and extensions) are up to date. Then post a new issue using the header below:

```
- **Operating System:** OS + version
- **Browser:** Browser + version (indicate GreaseMonkey version if relevant)

Explain here how to reproduce the problem...
```

### License

zlib/libpng © [Aymeric Beaumet](http://beaumet.me)

license: Zlib


text:
# Raven Pattern Library

RPL is a living style guide and component-driven front-end development resource. As you make changes to the styles and components used by your web site or application, the pattern library will automatically update to reflect those changes.

## Requirements

* [Node.js/NPM](https://nodejs.org/en/)

## Getting Started

Use your preferred method to download the files.

* Git: `git clone https://github.com/thomashigginbotham/raven-pattern-library.git`
* [Download a ZIP file](https://github.com/thomashigginbotham/raven-pattern-library/archive/master.zip)

### Installation

1. From the command line, change to the directory where the files were downloaded.
1. Run `npm install`.

### Usage

Run `npm run serve` to start a development server that watches for changes. (Note: using `npm run serve -- -o` will automatically open your browser to the correct URL.)

When you’re ready to publish, use `npm run build` to create a **dist** folder, ready for deployment on another server.

## Copyright/License

Raven Pattern Library is freely available under the [MIT license](https://tldrlegal.com/license/mit-license).

gha_language: TypeScript


text:
An ESP for COD4 that uses a hook in R_EndFrame and uses an external method of calculating 3D to 2D coordinates to display tags over all drawn entities.

The hack was written in mASM and needs to be linked as a dll. To do this:
```
\masm32\bin\ml /c /coff Esp.asm
\masm32\bin\Link /SUBSYSTEM:WINDOWS /DLL Esp.obj
```

![Hack Screenshot](screenshot.jpg?raw=true "Screenshot Hack")

Originally written on 2011/01/01 by attilathedud.


text:
#### References

- https://gitter.im/hashicorp-nomad/Lobby
  - a multi-host overlay or underlay network such as FanNetwork, Weave, Calico etc.

- FanNetwork

> Fan trades access to one **user-selected /8 (potentially external) address range**
  for an expanded pool of “organisation-internal” addresses to be used by containers
  or virtual machines. Fan does this by mapping the addresses in a way that can be
  computed, **rather than one that requires maintenance of distributed state**
  (e.g., routing tables).

- [the bits have hit fan](http://blog.dustinkirkland.com/2015/06/the-bits-have-hit-fan.html)

> ...is an extension of network tunnel driver in Linux kernel. Each container host has a fan
  bridge that allows mapping of network traffic to any other container on the fan network.
  Overhead is nothing more than **IP-IP tunneling**. Quite simply, **a /16 network gets mapped
  on onto an unused /8 network**, and **container traffic is routed by the host via an IP
  tunnel**.

- IP tunnel

> IP in IP is an IP tunneling protocol that encapsulates one IP packet in another IP packet.
  To encapsulate an IP packet in another IP packet, an outer header is added with SourceIP,
  the entry point of the tunnel and the Destination point, the exit point of the tunnel.
  While doing this, the inner packet is unmodified (except the TTL field, which is decremented).
  The Don't Fragment and the Type Of Service fields should be copied to the outer packet.
  If the packet size is greater than the Path MTU, the packet is fragmented in the encapsulator,
  as the outer header should be included. The decapsulator will reassemble the packet.

- TODO - https://www.flockport.com/simplify-container-networking-with-ubuntu-fan-project/

repository: AmitKumarDas/curated-tech

repo_name: AmitKumarDas/curated-tech


text:
# job-service

# Setup

Install .Net Core 2.1+

`dotnet run`

## Routes

### Exchanges
- ```
    POST /exchanges with {
      "name": "tasks"
    } returning
      201 => id
  ```

- ```
    GET /exchanges/{id | name} returning
      200 => json
        { "id": "27878eba-81a6-4b6f-91e0-660973a25d48",
          "name": "tasks",
          "jobCount": 0
        }
  ```

### Jobs

Note: The `body` needs to be base-64 encoded bytes.

  - ```
      POST /jobs with {
        "exchange": "27878eba-81a6-4b6f-91e0-660973a25d48",
        "subject": "requested",
        "contentType": "application/json",
        "body": ""
      } returning
        201 => id
    ```

  - ```
      GET /jobs?exchange={exchange.{id | name}}&subject={regex-like} returning
        200 => [job]
          [{"id":"2c555a3c-dbf2-419d-8bd9-33a49fa42822","createdOn":"2018-03-25T03:01:00.025991","dueBy":"0001-01-01T00:00:00","priority":0,"acceptedOn":null,"updatedOn":null,"completedOn":null,"exchange":"27878eba-81a6-4b6f-91e0-660973a25d48","subject":"requested","contentType":"application/json","body":""}]
    ```

### Reports

  - ```
      POST /jobs/{job id}/reports with {
        "title": "started",
        "body": ""
      } returning
        201 => report id
    ```

  - ```
      GET /jobs/{job id}/reports returning
        200 => [report]
          [{"page":1,"createdOn":"2018-03-25T03:14:13.357777","title":"started","body":""}]
    ```


text:
---
layout: post
title: Week of 29 Aug - 4 Sep
---

## What Did I Do This Week?

Well for starters, I went to class, did the reading, started on the first project! In class we went over what we needed to do to get started on the collatz project, and the difference between ++i and i++. It might seem simple, but I actually learned some interesting things in class that day!

## What Is In My Way?

I think what is my way is pretty much the same things that were in my way the week before. I still need to get used to using C++; I still need to get used to using all of the programs for our projects like Docker and Travis CI.

## What Will I Do Next Week?

Finish the project hopefully since it is due next week! Also do the reading and go to class of course.

## Class Experience So Far

I was pretty worried about this class the first week, but I think I have gotten more into the swing of things now. I think after taking a class like CS439, I was expecting the programming projects to be just as intensive, but now I'm starting to realize that is not the case. Downing is a good lecturer, and the cold calling helps you stay focused on what he is talking about. The way he explains things makes sense and the class is overall engaging. I'm enjoying it!

## Tip of the Week

If you need some coding questions to work on for technical interviews, I would look at the book _The Coding Interview_. Not only does it have a lot of coding questions (they are practically half the book), but it also has what you can expect from a interview with Google, Facebook, Amazon, Apple, etc.


text:
---
title:  buildschema() (aggregation function)
description: Learn how to use the buildschema() function to build a table schema from a dynamic expression.
ms.reviewer: alexans
ms.topic: reference
ms.date: 11/23/2022
---
# buildschema() (aggregation function)

Builds the minimal schema that admits all values of *DynamicExpr*.

[!INCLUDE [data-explorer-agg-function-summarize-note](../../includes/data-explorer-agg-function-summarize-note.md)]

## Syntax

`buildschema` `(`*DynamicExpr*`)`

## Parameters

| Name | Type | Required | Description |
|--|--|--|--|
|*DynamicExpr*| dynamic | ✓ | Expression used for the aggregation calculation.

## Returns

Returns the minimal schema that admits all values of *DynamicExpr*.

> [!TIP]
> If `buildschema(json_column)` gives a syntax error:
>
> > *Is your `json_column` a string rather than a dynamic object?*
>
> then use `buildschema(parsejson(json_column))`.

## Example

The following example builds a schema based on:

* `{"x":1, "y":3.5}`
* `{"x":"somevalue", "z":[1, 2, 3]}`
* `{"y":{"w":"zzz"}, "t":["aa", "bb"], "z":["foo"]}`

> [!div class="nextstepaction"]
> Run the query

```kusto
datatable(value: dynamic) [
    dynamic({"x":1, "y":3.5}),
    dynamic({"x":"somevalue", "z":[1, 2, 3]}),
    dynamic({"y":{"w":"zzz"}, "t":["aa", "bb"], "z":["foo"]})
]
| summarize buildschema(value)
```

**Results**

|schema_value|
|--|
|{"x":["long","string"],"y":["double",{"w":"string"}],"z":{"`indexer`":["long","string"]},"t":{"`indexer`":"string"}}|

The resulting schema tells us that:

* The root object is a container with four properties named x, y, z, and t.
* The property called `x` is of type *long* or of type *string*.
* The property called `y` ii of type *double*, or another container with a property called `w` of type *string*.
* The `indexer` keyword indicates that `z` and `t` are arrays.
* Each item in the array `z` is of type *long* or of type *string*.
* `t` is an array of strings.
* Every property is implicitly optional, and any array may be empty.

### Schema model

The syntax of the returned schema is:

Container ::= '{' Named-type* '}';
Named-type: := (name | '"`indexer`"') ':' Type;
Type ::= Primitive-type | Union-type | Container;
Union-type ::= '[' Type* ']';
Primitive-type ::= "long" | "string" | ...;

The values are equivalent to a subset of TypeScript type annotations, encoded as a Kusto dynamic value.
In TypeScript, the example schema would be:

```typescript
var someobject:
{
    x?: (number | string),
    y?: (number | { w?: string}),
    z?: { [n:number] : (long | string)},
    t?: { [n:number]: string }
}
```

repository: microsoft/Kusto-Query-Language

gha_language: C#

repo_name: microsoft/Kusto-Query-Language


text:
# Let's build StarWarsArchives 🛸
## Phases of building an app 🏗
Applications are not built only by coding and drinking coffee. Applications are also built by thinking, researching, planning and testing. All these things are called a development cycle of an application.  Today we are going to build an application. These are the phases that we are going to pass:
* Analyzing and researching
* Planning and discussion
* Coding the planned features
* Testing the code that we have written

### Analyzing and research phase 🔹
We need to make a single page application. This application will have one view with two tables:
* People Info - A table that shows info about people from Star Wars universe
	* Name
  * Height ( cm )
  * Mass ( kg )
  * Gender
  * Birth Year
  * Appearances ( Count of movies they appeared in )
* Ships Info - A table that shows info about ships from Star Wars universe
	* Name
  * Model
  * Manufacturer
  * Cost ( credits )
  * People Capacity ( crew + passengers )
  * Class
#### About the API 🛰
We will be using the [swapi](https://swapi.co/) API. This API is free. You can try some links out on the API page it self. Here are some useful links:
* **API:** https://swapi.co/api/

* **People Link:** https://swapi.co/api/people/?page=1 ( page=1 is the first page )

* **Ships Link:** https://swapi.co/api/starships/?page=1 ( page=1 is the first page )

* **Limit:** 10,000 requests per day

### Planning phase 🔹
In this step we already analysed the stuff that we need and the requirements for the application. Now we have to plan it. Planning is one of the most important part of the development process. We take the whole problem of building the app and create smaller chunks or tasks that we can complete.
1.  Create HTML page and connect a script, css document and libraries
2. Create the intro page with the link images to the tables
3. Connect the images with the script
4. Create a function for making an API request
5. Connect the function with the images so that when any of the images is clicked, the corresponding request is made
6. Create a function for printing a table of 10 people
7. Create buttons for next and previous
8. Create functions for next and previous
9. Create a logic so that next/previous buttons make a call to the next page as request

### Coding phase 🔹
In this phase we start coding all the tasks that we have planned and written in the planning phase. So we are building and creating the application here. We can always go back and add a task in the planning list if we encounter some feature that we missed in the planning.

### Testing phase 🔹
This is a phase where we spend time testing our code and checking if the built product correlates with the requirements. When we encounter a problem, missing requirement or something out of place we go back to the coding phase to fix the problems and then go back to testing. This cycle is done when we are satisfied with the complete product.


text:
# **Annie Ton-Nu**

### **TELEPHONE:** xxx-xxx-xxxx   ♣   **EMAIL:**<EMAIL_ADDRESS>
#### **SUMMARY**
***
I am a successful finance manager experienced in building and managing end-to-end complex finance function for companies with high growth.  I have a track record of leadership and delivery result in fast-paced, unstructured environment and successfully partnered with senior leadership to influence key business decisions.  I have a keen eye for details, outstanding analytical and financial modeling skills, and a strong desire to solve problems through manipulation of large complex data sets and systems utilization to deliver meaningful analyses.  I have excellent interpersonal and communications skills and I am experienced in managing multiple projects with competing deadlines.

#### **PROFESSIONAL EXPERIENCE**
***
#### Sr. Financial Planning & Analysis Manager     *Xome Inc.    2016-2016*
+ Own and provide financial forecast and budget for all of Xome G&A and Engineer organizations (350+ employees between Seattle, California, Dallas and India).
+ Provide business partners with monthly variance analysis on Actual vs. approved Forecast and Budget.
+ Re-engineer monthly reporting and quarterly forecasting processes for efficiency.
+ Build pro forma model to support CFO and investment firms with different investment opportunities.
+ Provide clear and concise analysis to Senior Engineering Leader to assist them with making sound financial decisions on capital investment and skill force planning.
+ Work closely with Finance department leaders and business partners to ensure strategic operational targets are in alignment with overall company financial goals.
+ Made key hiring decisions for continued growth of Finance team.  Provide mentorship and coaching to junior analysts.

#### Financial Planning & Analysis Manager     *INRIX Inc.    2014-2015*
+ Established and maintained the Budget and Forecast model for Operating Expense (11 departments and 300+ employees worldwide) and Cost of Goods Sold.
+ Provided monthly, quarterly and annual forecast for Income Statement, Balance Sheet and Cash Flow.
+ Collaborated with Controller to provide monthly accounting close reports to senior management, investment banks and auditors.
+ Developed and maintained overall company bonus structure and sales compensation plan.  Effectively streamlined the entire People Cost calculation by migrating it from Excel into HOST Analytics.
+ Owned, maintained and provided insights on KPIs that track monthly data quality, sales performance, customers count, financial performance, and headcount resource.
+ Built and improve the company 5-year financial model as well as on-going support of the Revenue model in Salesforce
+ Supported CFO with due diligence for equity funding and acquisition (range from $50-$150 millions) for multiple deals.
+ Built financial models for scenarios planning and Merger & Acquisition.
+ Updated and maintained Board of Director quarterly and annual financial reports.

**Sr. Financial Analyst**     *ThyssenKrupp Aerospace - North America    2013-2014*
**Financial Analyst**     *Continental Milles    2011-2012*
**Project Manager**     *The Boeing Company    2007-2011*
**Financial Analyst**     *The Boeing Company    2005-2007*

#### **EDUCATION**
***
+ Master in Business Administration (MBA) – Finance and Marketing  •  *2009
Seattle University, Seattle, WA*
+ Project Management Certificate  •  *2007
University of Washington, Seattle, WA*
+ Bachelor Of Business Administration – Finance  • *2004
Seattle University, Seattle, WA*

#### **PROGRAMMING LANGUAGE PROFICIENCIES**
***
+ HTML - intermediate
+ CSS - intermediate
+ Markdown - intermediate
+ Javascript - beginner

repository: annieqton/ada

repo_name: annieqton/ada


text:
CREATIVE MEDIA SPACE

CreativeMedia.space is a learning space of helpful resources and curated lists of creative media related sites that are continually being updated. Designed for life-long students of creative media, you'll find recommended blogs to follow, podcasts to listen to, books to read, and newsletters. You'll also find a growing range of educational resources, including topic-specific lessons, assignments, and exercises. More courses coming soon.

See All Posts

repository: kccnma/creativemediaspace-jekyll

gha_language: HTML

repo_name: kccnma/creativemediaspace-jekyll