text:
Static Staging Compiler
=======================

[![build status](https://circleci.com/gh/Microsoft/staticstaging.svg?style=shield&circle-token=c39f027c650d4a4e2c6f9b59868309c210228de3)](https://circleci.com/gh/Microsoft/staticstaging)

This is an experimental programming language for heterogeneous systems based on multi-stage programming. See [the documentation][docs] for an introduction to the language.

The compiler is written in [TypeScript][] and runs on [Node][].
You can build the compiler and run a few small programs by typing `make test` (if you have [npm][]).
Check out the [code documentation][hacking] for an introduction to the compiler's internals.

[npm]: https://www.npmjs.com/
[Node]: https://nodejs.org/
[TypeScript]: http://www.typescriptlang.org/
[docs]: http://microsoft.github.io/staticstaging/docs/
[hacking]: http://microsoft.github.io/staticstaging/docs/hacking.html

## Details

The license is [MIT][].
This project uses the [Microsoft Open Source Code of Conduct][coc]; check out the [FAQ about the CoC][cocfaq].

[MIT]: https://opensource.org/licenses/MIT
[coc]: https://opensource.microsoft.com/codeofconduct/
[cocfaq]: https://opensource.microsoft.com/codeofconduct/faq/


text:
---
name: CAPCOG 1997 2m BW Orthoimagery
short_description:
Black and White 2m Aerial Imagery produced by the Capital Area Planning Council of Government (CAPCOG).

type: Raster
available_formats: SID
source: CAPCOG
coverage_extent: Bastrop, Blanco, Burnet, Caldwell, Fayette, Hays, Lee, Llano, Travis, Williamson
data_download_lvl:
statewide_coverage:
footprint: 1/4 USGS Quadrangle
download_size:
recommended_use: Basemap
date_created: 1997
tags: Bastrop, Blanco, Burnet, Caldwell, Fayette, Hays, Lee, Llano, Travis, Williamson, County, Orthoimagery, Imagery, Aerial Photography, BW, Black, White, 911, Austin, San Marcos, Georgetown, Historical
known_issues: None
alternative_data: None
derivative_data: None
spatial_reference:
EPSG 2277

relationship_tag:
category: Orthoimagery - Regional
download:
download_link:
order: T
wms_category:
wms_link:
pop_link:
status_map_cartodb_id: f42d2afe-ded1-11e4-a345-0e4fddd5de28
agency: Capital Area Council of Governments
agency_web: http://www.capcog.org/
agency_gis_page:
date_added: 2014-02-01
license: CC0
tile_index: T
supplemental_report:
lidar_breaklines:
urlized_name: capcog-1997-2m-bw
filename: data-catalog/entry/capcog-1997-2m-bw.md
layout: redirect.njk
title: CAPCOG 1997 2m BW
urlized_category: orthoimagery-regional
overview_image_url: images/data-catalog/entry/capcog_1997_2m_bw_overview.jpg
thumb_url: images/data-catalog/entry/capcog_1997_2m_bw_th.jpg
natural_image_url: images/data-catalog/entry/capcog_1997_2m_bw_natural.jpg
urban_image_url: images/data-catalog/entry/capcog_1997_2m_bw_urban.jpg
tile_index_url: https://tnris-datadownload.s3.amazonaws.com/datacatalog/tile_index/capcog_1997_2m_bw_tileindex.zip
license_text: Public Domain (Creative Commons CC0)
license_url: https://creativecommons.org/publicdomain/zero/1.0/
---

Black and White 2m Aerial Photography captured for the 10,496 square mile region database as developed and maintained by the Capital Area Planning Council of Government (CAPCOG).

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Use Vite Today

> out-of-the-box for vue-cli projects without any codebase modifications.

## Table of Contents

- [Usage](#usage)
- [Motivation](#motivation)
- [Options](#options)
- [Underlying principle](#underlying-principle)
  - [Compatibility](#compatibility)
  - [Differences between vue-cli and vite](#differences-between-vue-cli-and-vite)
- [Milestones](#milestones)
- [Examples](#examples)
- [Troubleshooting](#troubleshooting)
- [Benefits](#benefits)
  - [Best development-experience right now](#best-development-experience-right-now)
  - [Migration to vite smoothly](#migration-to-vite-smoothly)
  - [Lint the codebase](#lint-the-codebase)
  - [Use vue-cli ecosystem](#use-vue-cli-ecosystem)
- [Relevant Vite Plugins](#relevant-vite-plugins)

## Usage
```sh
# 1. first step
vue add vite

# 2. second step
# NOTE you cannot directly use `vite` or `npx vite` since it is origin vite not this plugin.
yarn vite // or npm run vite

# 3. add optimizeDeps#include (optional and will speedup devServer start time a lot)
# added in vue.config.js#pluginOptions.vite.optimizeDeps.include
# e.g.: ['vue', 'vue-router', 'vuex']
# all scanned deps(logged in terminal) can be added for speedup.
```

## Motivation
- We have lots of exists vue-cli(3.x / 4.x) projects.
- In Production: vue-cli based on webpack is still the best practice for bundling webapp(with code spliting, legecy-build for old browsers).
- In Development: instant server start and lightning fast HMR by vite is interesting.
- Why not use them together ?

## [Options](https://github.com/IndexXuan/vue-cli-plugin-vite/blob/main/config/options.ts)
```js
// vue.config.js
{
  // ...
  pluginOptions: {
    vite: {
      /**
       * Plugin[]
       * @default []
       */
      plugins: [], // other vite plugins list, will be merge into this plugin\'s underlying vite.config.ts
      /**
       * you can enable jsx support by setting { jsx: true }
       * @see {@link https://github.com/underfin/vite-plugin-vue2#options}
       * @default {}
       */
      vitePluginVue2Options: {},
      /**
       * @vitejs/plugin-vue-jsx Options
       * @see {@link https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx#options}
       * @default {}
       */
      vitePluginVue3Options: {
        jsx?: {}
      },
      /**
       * Vite UserConfig.optimizeDeps options
       * recommended set `include` for speedup page-loaded time
       * @default {}
       */
      optimizeDeps: {}
    }
  },
}
```

## Underlying principle

### Compatibility
- **NO EXTRA** files, code and dependencies injected
    - injected one devDependency `vue-cli-plugin-vite`
    - injected one line code in `package.json#scripts#vite` and one file at `bin/vite`
- auto-resolved as much options as we can from `vue.config.js` (publicPath, alias, outputDir...)
- auto reuse public/index.html as vite html entry template
- compatible the differences between vue-cli and vite(environment variables, special syntax...)

### Differences between vue-cli and vite

| Dimension                        |         vue-cli     |     vite           |
|----------------------------------|---------------------|--------------------|
|     Plugin                       | 1. based on webpack.
2. have service and generator lifecycles.
3. hooks based on each webpack plugin hooks | 1. based on rollup.
2. no generator lifecycle.
3. universal hooks based on rollup plugin hooks and vite self designed |
|     Environment Variables        | 1. loaded on process.env.
2. prefixed by `VUE_APP_`.
3. client-side use `process.env.VUE_APP_XXX` by webpack definePlugin | 1. not loaded on process.env.
2. prefixed by `VITE_`.
3. client-side use `import.meta.env.VITE_XXX` by vite inner define plugin |
|     Entry Files                  | 1. main.{js,ts}.    | 1. *.html          |
|     Config File                  | 1. vue.config.js    | 1. vite.config.ts.
2. support use --config to locate |
|     MPA Support                  | 1. native support by `options.pages`.
2. with history rewrite support | 1. native support by `rollupOptions.input` |
|     Special Syntax               | 1. require(by webpack)
 2. require.context(by webpack)
2. use `~some-module/dist/index.css`(by `css-loader`)
3. module.hot for HMR | 1. import.meta.glob/globEager
2. native support by vite, use `module/dist/index.css` directly
3. import.meta.hot for HMR  |
|     Local devServer              | 1. [webpack dev-server](https://webpack.js.org/configuration/dev-server/)
2. express-style middleware and many extension api.  | 1. [connect](https://github.com/senchalabs/connect)
2. connect middleware |
|     Type Checker                 | 1. [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) | 1. No built-in, we can use [vite-plugin-checker(based on vetur and vue-tsc)](https://github.com/fi3ework/vite-plugin-checker) |
|     Lint                         | 1. [@vue/cli-plugin-eslint](https://www.npmjs.com/package/@vue/cli-plugin-eslint) | 1. No built-in we can use [vite-plugin-eslint](https://github.com/gxmari007/vite-plugin-eslint),  |
|     Jest                         | 1. [@vue/cli-plugin-jest](https://www.npmjs.com/package/@vue/cli-plugin-jest)  | 1. will have first-class jest support |

## Milestones
- Done ✅ vs WIP ⬜ vs ❌ Won't support
- ✅ Plugin
    - ✅ we can do nothing but rewrite corresponding vite-plugin, most code and tools can be reused
- ✅ Environment Variables Compatibility
    - ✅ load to process.env.XXX (all env with or without prefix will be loaded)
    - ✅ recognize `VUE_APP_` prefix (you can use other instead by config, e.g. `REACT_APP_`)
    - ✅ define as `process.env.${PREFIX}_XXX` for client-side
- ✅ Entry Files (we can do nothing)
- ✅ Config File (vue.config.js Options auto-resolved)
    - ✅ vite#base - resolved from `process.env.PUBLIC_URL || vue.config.js#publicPath || baseUrl`
    - ✅ vite#css - resolved from vue.config.js#`css`
        - ✅ preprocessorOptions: `css.loaderOptions`
    - ✅ vite#server- resolved from vue.config.js#`devServer`
        - ✅ host - resolved from `process.env.DEV_HOST || devServer.public`
        - ✅ port - resolved from `Number(process.env.PORT) || devServer.port`
        - ✅ https - resolved from `devServer.https`
        - ✅ open - resolved from `process.platform === 'darwin' || devServer.open`
        - ✅ proxy - resolved from `devServer.proxy`
        - ✅ before
            - use middlewares to improve viteDevServer(connect instance) to express instance
    - ✅ vite#build
        - ✅ outDir - resolved from vue.config.js#`outputDir`
        - ✅ cssCodeSplit - resolved from `css.extract`
        - ✅ sourcemap - resolved from `process.env.GENERATE_SOURCEMAP === 'true' || productionSourceMap || css.sourceMap`
    - ✅ Alias - resolved from configureWebpack or chainWebpack
        - ✅ also resolved from `vue.config.js#runtimeCompiler`
- ✅ MPA Support
    - ✅ same development experience and build result
- ✅ Build Support (as of 1.0.0-rc.0, no real html entry file generated, just reuse public/index.html of vue-cli)
    - ✅ Support SPA Build
    - ✅ Support MPA Build
- ✅ Special Synatax
    - ❌ require('xxx') or require('xxx').default, most of the case, it can be replaced by dynamicImport ( import('xxx') or import('xxx').then(module => module.default) )
    - ✅ import '~some-module/theme/index.css' syntax for Import CSS [supported by vite#2185](https://github.com/vitejs/vite/issues/2185#issuecomment-784637827))
    - ✅ require.context compatibility
    - ✅ module.hot compatibilite
- ✅ Type Checker
    - ✅ [vite-plugin-checker & vite-plugin-checker-vls](https://github.com/fi3ework/vite-plugin-checker)
- ✅ Lint
    - ✅ [vite-plugin-eslint](https://github.com/gxmari007/vite-plugin-eslint)
- ⬜ Eject and Codemod
    - ⬜ eject vite.config.ts
    - ⬜ eject vite deps
    - ⬜ remove vue-cli and webpack deps
    - ⬜ codemod webpack special syntax to vite-specific( import.meta.{hot, env} )

## Examples
- [simple vue-cli SPA project](https://github.com/IndexXuan/vue-cli-plugin-vite/tree/main/examples/my-mpa-ts-app)
- [simple vue-cli MPA TypeScript project](https://github.com/IndexXuan/vue-cli-plugin-vite/tree/main/examples/my-mpa-ts-app)
- [complex chrisvfritz/vue-enterprise-boilerplate project](https://github.com/IndexXuan/vue-enterprise-boilerplate/compare/master...IndexXuan:feature/vite)

you can clone/fork this repo, under examples/*

## Troubleshooting
- [see #9](https://github.com/IndexXuan/vue-cli-plugin-vite/issues/9)

## Benefits

### Best development-experience right now
- Instant server start and lightning fast HMR

### Migration to vite smoothly
- In the future, migration to vite is only the replacement of special syntax between webpack and vite

### Lint the codebase
- lint dependencies, which is incorrectly use [main/module/exports](https://twitter.com/patak_js/status/1363514285180268550?s=21) field in package.json
- lint codebase, which is more esmodule compatible
    - use [import('xxx')](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports) not `require('xxx')`
    - use [import.meta.xxx](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta) not `module.xxx`

### Use vue-cli ecosystem
- first-class eslint/stylelint integration
- first-class unit-test integration (by [@vue/cli-plugin-unit-jest](https://cli.vuejs.org/core-plugins/unit-jest.html))
- first-class e2e integration (by [@vue/cli-plugin-cypress](https://cli.vuejs.org/core-plugins/e2e-cypress.html))
- first-class xyz support by the [official](https://cli.vuejs.org/core-plugins/) and [community](https://www.npmjs.com/search?q=vue-cli-plugin-) plugins

## Relevant Vite Plugins
- [vite-plugin-vue2@underfin](https://github.com/underfin/vite-plugin-vue2) - Vue 2 support for vite.
- [vite-plugin-checker@fi3ework](https://github.com/fi3ework/vite-plugin-checker) - Type checker for vite.
- [vite-plugin-eslint@gxmari007](https://github.com/gxmari007/vite-plugin-eslint) - Eslint for vite.
- [@vitejs/plugin-vue](https://github.com/vitejs/vite/tree/main/packages/plugin-vue) - Official Vue 3 plugin.
- [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx) - Official Vue 3 jsx plugin.
- [vite-plugin-env-compatible](https://github.com/IndexXuan/vite-plugin-env-compatible) - Env compatibility for vite with vue-cli.
- [vite-plugin-html-template](https://github.com/IndexXuan/vite-plugin-html-template) - Like html-webpack-plugin for webpack.
- [vite-plugin-vue-cli](https://github.com/IndexXuan/vite-plugin-vue-cli) - Infer vite config from vue.config.js.
- [vite-plugin-mpa](https://github.com/IndexXuan/vite-plugin-mpa) - MPA support for vite.

branch_name: refs/heads/main

gha_license_id: MIT


text:
# ProgScheduler

Creates a preliminary show schedule by processing our djs' submitted entries to programming department's quarterly show application.

Usage: `python3 schedule.py Show_Apps_Wave_2.csv`

### File Format

Expects an input `.csv` with the following field names: (which could be generated by a google form)

```
"Timestamp", "Name", "Email", "#1 Preference", "#2 Preference", "#3 Preference", "#4 Preference", "#5 Preference", "#6 Preference", "#7 Preference", "#8 Preference", "#9 Preference", "#10 Preference"
```

And produces an output `Schedule.csv` listing dj requests, with the following field names: (which could be used to create a google docs sheet)

```
"Start Time", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
```

repository: uclaradio/ProgScheduler

repo_name: uclaradio/ProgScheduler


text:
# Installing XDS client tools

[xds-agent](https://github.com/iotbzh/xds-agent) is a client tool that must run
on your machine (user / developer host) to be able to use XDS.
You should establish the following chain:

Client (eg. `xds-cli` or XDS Dashboard) and `xds-agent` is running on your machine
and `xds-server` is running on a remote server and/or in a container.
Exchanges between these 3 tools are done though HTTP and Websocket protocols
and default url/port mentioned in schema below can be change using config files.

![XDS blocks chain](./pictures/xds-block-chain.png)

Installation of other XDS client tools, such as `xds-cli` or `xds-gdb` is
optional and depends of what you want to do :

- [xds-cli](https://github.com/iotbzh/xds-cli) : command line tool to used to interact with XDS (also used by IDE integration).
- [xds-gdb](https://github.com/iotbzh/xds-gdb) : requested for debugging application.

> [xds-exec](https://github.com/iotbzh/xds-exec) is another tool used to interact
> with XDS before that `xds-cli` exists. `xds-exec` is deprecated and you should
> now use `xds-cli exec` command instead.

## Install packages for debian distro type

```bash
# 'DISTRO' can be set to { xUbuntu_16.04, xUbuntu_16.10, xUbuntu_17.04, Debian_8.0, Debian_9.0 }
export DISTRO="xUbuntu_16.04"

wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/Release.key | sudo apt-key add -
sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF
deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/ ./
EOF"

sudo apt-get update
sudo apt-get install agl-xds-agent
sudo apt-get install agl-xds-cli
sudo apt-get install agl-xds-gdb
```

## Install packages for openSUSE distro type

```bash
# DISTRO can be set to {openSUSE_Leap_42.2, openSUSE_Leap_42.3, openSUSE_Tumbleweed}
export DISTRO="openSUSE_Leap_42.2"

sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/isv:LinuxAutomotive:app-Development.repo

sudo zypper ref
sudo zypper install agl-xds-agent
sudo zypper install agl-xds-cli
sudo zypper install agl-xds-gdb
```

## Install for other platforms (Windows / MacOS)

- Install `xds-agent`:

  1. Download the latest released tarball from github [releases page](https://github.com/iotbzh/xds-agent/releases).

  1. Then unzip the tarball any where into your local disk (for example: `/opt/AGL/xds` or `C:\AGL\xds`).

  1. Add binary to PATH:

      - MacOs: create the .bash_profile `nano .bash_profile` and add `export PATH="/opt/AGL/xds/xds-agent:$PATH`
      - Windows: change the system path via control panel or system settings or
    `setx path "C:\AGK\xds\xds-agent;%path%"`

- repeat the previous steps to install other tools depending of your needs:
  - `xds-cli` : requested for command line and IDE integration. ([released tarball link](https://github.com/iotbzh/xds-cli/releases)).
  - `xds-gdb` : requested for debugging application. ([released tarball link](https://github.com/iotbzh/xds-gdb/releases)).

## Start xds-agent

XDS-agent is a client tool that must run on your local / user development
machine when you use XDS.

For Linux distro, a user systemd service is provided, so you just need to enable
if you want to start it automatically at boot and you can also start it
immediately using following commands:

```bash
# Enable xds-agent service at boot
systemctl --user enable xds-agent.service

# Manually start xds-agent service
systemctl --user start xds-agent.service

# Get status and log of xds-agent service
systemctl --user status xds-agent.service
```


text:
[![Awesome Android #14](https://img.shields.io/badge/Awesome%20Android-%2314-green.svg?style=true)](https://android.libhunt.com/newsletter/14)

# Android Animated Icons

![Preview](https://github.com/andremion/Android-Animated-Icons/raw/master/assets/preview.gif)

## How to improve the user experience using animated icons with vector drawables on Android

## English version
https://medium.com/@andremion/animated-icons-on-android-ee635307bd6

## Versão em português
https://medium.com/@andremion/criando-%C3%ADcones-animados-no-android-14b2d5feb877

repository: jiubadao/Android-Animated-Icons

repo_name: jiubadao/Android-Animated-Icons


text:
# Terraform::AWS::Instance

Provides an EC2 instance resource. This allows instances to be created, updated,
and deleted. Instances also support [provisioning](/docs/provisioners/index.html).

## Properties

`Ami` - (Required) The AMI to use for the instance.

`AvailabilityZone` - (Optional) The AZ to start the instance in.

`PlacementGroup` - (Optional) The Placement Group to start the instance in.

`Tenancy` - (Optional) The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the import-instance command.

`HostId` - (optional) The Id of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host.

`CpuCoreCount` - (Optional) Sets the number of CPU cores for an instance. This option is
only supported on creation of instance type that support CPU Options
[CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API.

`CpuThreadsPerCore` - (Optional - has no effect unless `CpuCoreCount` is also set)  If set to to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information.

`EbsOptimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized.
Note that if this is not set on an instance type that is optimized by default then
this will show as disabled but if the instance type is optimized by default then
there is no need to set this and there is no effect to disabling it.
See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information.

`DisableApiTermination` - (Optional) If true, enables [EC2 Instance
Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination).

`InstanceInitiatedShutdownBehavior` - (Optional) Shutdown behavior for the
instance. Amazon defaults this to `stop` for EBS-backed instances and
`terminate` for instance-store instances. Cannot be set on instance-store
instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information.

`InstanceType` - (Required) The type of instance to start. Updates to this field will trigger a stop/start of the EC2 instance.

`KeyName` - (Optional) The key name of the Key Pair to use for the instance; which can be managed using [the `Terraform::AWS::KeyPair` resource](key_pair.html).

`GetPasswordData` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.

`Monitoring` - (Optional) If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0).

`SecurityGroups` - (Optional, EC2-Classic and default VPC only) A list of security group names (EC2-Classic) or IDs (default VPC) to associate with.

`VpcSecurityGroupIds` - (Optional, VPC only) A list of security group IDs to associate with.

`SubnetId` - (Optional) The VPC Subnet ID to launch in.

`AssociatePublicIpAddress` - (Optional) Associate a public ip address with an instance in a VPC.  Boolean value.

`PrivateIp` - (Optional) Private IP address to associate with the
instance in a VPC.

`SourceDestCheck` - (Optional) Controls if traffic is routed to the instance when
the destination address does not match the instance. Used for NAT or VPNs. Defaults true.

`UserData` - (Optional) The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `UserDataBase64` instead.

`UserDataBase64` - (Optional) Can be used instead of `UserData` to pass base64-encoded binary data directly. Use this instead of `UserData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.

`IamInstanceProfile` - (Optional) The IAM Instance Profile to
launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`.

`Ipv6AddressCount` - (Optional) A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.

`Ipv6Addresses` - (Optional) Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface.

`Tags` - (Optional) A mapping of tags to assign to the resource.

`VolumeTags` - (Optional) A mapping of tags to assign to the devices created by the instance at launch time.

`RootBlockDevice` - (Optional) Customize details about the root block
device of the instance. See [Block Devices](#block-devices) below for details.

`EbsBlockDevice` - (Optional) Additional EBS block devices to attach to the
instance.  See [Block Devices](#block-devices) below for details.

`EphemeralBlockDevice` - (Optional) Customize Ephemeral (also known as
"Instance Store") volumes on the instance. See [Block Devices](#block-devices) below for details.

`NetworkInterface` - (Optional) Customize network interfaces to be attached at instance boot time. See [Network Interfaces](#network-interfaces) below for more details.

`CreditSpecification` - (Optional) Customize the credit specification of the instance. See [Credit Specification](#credit-specification) below for more details.

## Return Values

### Fn::GetAtt

`Id` - The instance ID.

`Arn` - The ARN of the instance.

`AvailabilityZone` - The availability zone of the instance.

`PlacementGroup` - The placement group of the instance.

`KeyName` - The key name of the instance.

`PasswordData` - Base-64 encoded encrypted password data for the instance.

`PublicDns` - The public DNS name assigned to the instance. For EC2-VPC, this.

`PublicIp` - The public IP address assigned to the instance, if applicable. **NOTE**: If you are using an [`Terraform::AWS::Eip`](/docs/providers/aws/r/eip.html) with your instance, you should refer to the EIP's address directly and not use `publicIp`, as this field will change after the EIP is attached.

`Ipv6Addresses` - A list of assigned IPv6 addresses, if any.

`NetworkInterfaceId` - The ID of the network interface that was created with the instance.

`PrimaryNetworkInterfaceId` - The ID of the instance's primary network interface.

`PrivateDns` - The private DNS name assigned to the instance. Can only be.

`PrivateIp` - The private IP address assigned to the instance.

`SecurityGroups` - The associated security groups.

`VpcSecurityGroupIds` - The associated security groups in non-default VPC.

`SubnetId` - The VPC subnet ID.

`CreditSpecification` - Credit specification of instance.

## See Also

* [aws_instance](https://www.terraform.io/docs/providers/aws/r/instance.html) in the _Terraform Provider Documentation_


text:
klStringUtilities
=================

A small set of Swift 3 utilities I've come up with over the last few months, sometimes via Googling, sometimes on my own. Feel free to use them if you have a need for one or more of these shortcuts.

## Current Version: 1.0.3
I opened it up to the various OSes. I wonder if it will work...

## Installation
### [CocoaPods](http://cocoapods.org/)

1. Add the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html):

    ```
    use_frameworks! #if this isn't already in your podfile
    pod "klStringUtilities"
    ```
2. Run `pod install`.
3. Enjoy.

## Documentation
Until I have ample time, note that you can find at least simple examples of usage in both the Demo app and the `klStringUtilities_iOSTests` class.
### Extensions to String
#### `.len: Int`
Shortcut for self.characters.count.
**Returns:** integer count of characters
#### `.humanLen: Int`
Counts the number of human-visible characters in a String. That is, multiple glyph characters are counted as one.
**Returns:** integer count of human-visible characters
#### `.autoTrim: String`
A quick shortcut to remove any whitespace chars from the start and end of a string.
**Returns:** the String, stripped of leading and trailing whitespace
#### `.loc: String`
Shortcut for localization. The String is run through NSLocalizedString.
**Returns:** the result of the String being run through NSLocalizedString
#### `.floc(_ params: Any...) -> String`
Shortcut for localization. The string is run through NSLocalizedString with any '%' params replaced.
**Parameter** *params*: one or more parameters to replace the '%' placeholders
**Returns:** the result of the String being run through NSLocalizedString
#### `func rangeFromNSRange(nsRange: NSRange) -> Range<String.Index>?`
Convert an NSRange into a Swift range.
**Parameter** *nsRange*: the NSRange to convert. If the range is out of bounds of the string, the function will return nil
**Returns:** returns the Swift range, or nil if the NSRange was outside the bounds of the String
#### `func containsRegEx(regExString:String, ci:Bool = true) -> Bool`
Shortcut to find if a String contains a particular RegEx value.
**Parameters**
*regExString*: the regular expression to look for
*ci*: case insensitivity. Default is true
**Returns:** a Bool indicating whether or not the RegEx was found
#### `func withMatchingPatterns(regExString:String) -> [String]?`
Returns an array of Strings with RegEx capture groups found in the receiver.
**Parameters** *regExString*: the regular expression to look for
**Returns:** An array of Strings, starting with the complete match, followed by the found capture groups, or an empty array if no match was found, or nil if the regular expression failed to parse
### Extensions to ExpressibleByIntegerLiteral
#### `.intString:String`
Returns a string rounded to the nearest Int, with localized grouping separators (i.e., ',') if appropriate.
### Extensions to BinaryFloatingPoint
#### `.currencyString:String`
Returns a string formatted for the local currency, rounded off if passed a whole number.
### Extensions to NSRange
#### `init(string:String, range:Range<String.Index>)`
Creates an NSRange from a Swift String range.
**Parameters**
*string*: the source String
*range*: the source Range

repository: kenlaws/klStringUtilities

repo_name: kenlaws/klStringUtilities


text:
# strong-error-handler

Error handler for use in development (debug) and production environments.

 - When run in production mode, error responses are purposely undetailed
   in order to prevent leaking sensitive information.

 - When in debug mode, detailed information such as stack traces
   are returned in the HTTP responses.

JSON is the only supported response format at this time.

*There are plans to support other formats such as Text, HTML, and XML.*

## Install

```bash
$ npm install strong-error-handler
```

## Usage

In an express-based application:

```js
var express = require('express');
var errorHandler = require('strong-error-handler');

var app = express();
// setup your routes
app.use(errorHandler({ /* options, see below */ }));

app.listen(3000);
```

In LoopBack applications, add the following entry to your
`server/middleware.json` file.

```json
{
  "final:after": {
    "strong-error-handler": {
      "params": {
       }
    }
  }
}
```

## Options

#### debug

`boolean`, defaults to `false`.

When enabled, HTTP responses include all error properties, including
sensitive data such as file paths, URLs and stack traces.

#### log

`boolean`, defaults to `true`.

When enabled, all errors are printed via `console.error`.

Customization of the log format is intentionally not allowed. If you would like
to use a different format/logger, disable this option and add your own custom
error-handling middleware.

```js
app.use(myErrorLogger());
app.use(errorHandler({ log: false }));
```

repository: blockchain-lab/emission-trade-market

gha_language: JavaScript

repo_name: blockchain-lab/emission-trade-market


text:
---
title: "Naming I – Flat Naming"
tags: [Distributed Systems]
categories:
  - Distributed Systems
date: 2020-02-23
---

  - [Function of a naming system**](#function-of-a-naming-system)
  - [Flat naming systems](#flat-naming-systems)
    - [1. Broadcasting](#1-broadcasting)
    - [2. Forwarding pointers](#2-forwarding-pointers)
    - [3. Home-based approach](#3-home-based-approach)
    - [4. Distributed Hash Tables](#4-distributed-hash-tables)
    - [5. Hierarchical approaches](#5-hierarchical-approaches)
  - [Summary](#summary)

**Basic definitions**

  - **Names –** are used to share resources, to uniquely identify
    entities, to refer to locations, etc.
  - Entities – in any computer system must be given names if we are able
    to have access to them
      - **Entities** could be software, hardware, disk, file, page, etc
      - Name is a string of bits or characters -usually human readable
  - These names must bound to attributes – how does attributes define
    the actual name
      - Normally the attributes will give us access to that entity
  - Name is resolved when we translate it into those attributes – you
    are finding Mr. brown in the audience
  - In DS the implementation of naming system is often described across
    multiple machines.
      - How this distribution is done plays a key role in efficiency and
        scalability of naming sys
  - → The end of the day, aim is to access the identity through its name

**Name resolution example**

  - How can I resolve name in the content of that urL?
  - URL – <http://www.acme.com:8080/products/catalog.html>
      - ![Screenshot 2020-02-25 at 8 55 53 pm](https://user-images.githubusercontent.com/33334078/75286882-37ad1600-5811-11ea-842f-3f33df8542eb.png)
      - First thing is to try to look the server where the object or
        entity is - To access the server I need to know the IP address –
        there exists DNS look-up who tells you the IP address.
      - Second thing is the port, it may suggest that it's running on
        localhost-8080
      - Next is /products/catalog.html – there's a folder and there's
        this HTML file
      - → We try to resolve the name step by step
      - On a web server there's a file, and what do I need? I will need        to actually access the server, which is prolly sitting on a
        cluster – that IP address is gonna be translated into
        network address to access THE
        host machine itself\!\! we take the network address + port no to
        access actual host machine.
      - Ip address to network address translation is through
        ARP
          - Address resolution protocol – I took IP and translated into
            data link address to have access to host machine which helps
            you resolve the name

**Access points and addresses**

  - To operate on any entity – I need special kind of entity called
    access point  - The name of the access point itself is called address.
  - The entity itself can have more than one access point
      - E.g. telephone – access point, telephone number – address. you
        can have 5 phone number\!\!
      - In ds, access point – a host running a specific server, address
        – IP+ port no.
  - Entity may change its access points
      - E.g. computer move from one to another- diff IP address. I
        should be reachable – and bc mobile IP address keeps changing –
        so it may change over time
  - In general, don’t want to use an address as a regular name – coz it
    changes\! So we want location-independent name\!

## Function of a naming system**
  - Naming system manages set of bindings btwn names and attributes of
    entities in the system.
      - In simplest form is a table of (name, address) pairs
  - Primary function of naming service is naming resolution
  - Secondary functions:
      - To create new binding
      - Delete existing binding – name may say they want to remove that
        attribute
      - Listing of bound names
      - Can organize the namespace as I want

## Flat naming systems

  - Entities are referred to by an identifier - and principles have no
    meaning at all – it doesn’t tell you how to locate the access point
    of its associated entity. could not be human readable
  - No structure and it needs special mechanisms to trace the location
    of entities

### 1. Broadcasting
  - It broadcasts the ID- a message containing the identifier of the
    entity is broadcast to each machine and each machine checks if
    they’ve got it, and send back a reply message with the address of
    the access point.
  - You require all the process and entities are READY to listen to the
    incoming call.
  - However, it doesn’t scale beyond the LAN – but in WAN with thousands
    of machines it will never work coz it doesn’t scale
  - Network bandwidth is wasted by request messages, and too many hosts
    are interrupted
  - E.g. **ARP –** Address Resolution Protocol
      - To find MAC address of the machine, you will basically have one
        of the hosts and say I need to deliver this data to this
        machine, who has this IP address

### 2. Forwarding pointers

  - When an entity moves from A to B, it leaves behind in A a pointer to
    its new location at B.
      - Dereferencing can be made transparently to clients by having a
        chain of pointers – you keep track of where the entity is
      - Client keeps updating the reference of the entity – good news is
        entity is always gonna be found
  - Drawbacks
      - If no special measure is taken, a chain for an entity can be so
        long and hence expensive locating. → latency may be an issue
      - Intermediate locations have to maintain their part of the chain
        all the time
      - Broken links – one pointer can fail and the whole chain will be
        broken\!\!\!

  - **Example: SSP chains**

      - ![Screenshot 2020-02-25 at 8 58 25 pm](https://user-images.githubusercontent.com/33334078/75287035-91addb80-5811-11ea-8517-05c1a89732c3.png)
      - Each forwarding pointer – a (client stub, server stub) pair to
        access object
      - P1- P3- P4 → it leaves behind the client stub – if you want to
        find me here’s my stub.
      - Prev client will use the stub as a pointer to the next P’s
        server stub.
      - P2 is looking for the stub – could broadcast does anyone have
        the client stub? Then p1 has – p1 and p2 will have the same stub
        – and it will both point to P3’s server stub which leads you to
        P4’s server stub aka the object you wanna refer to.
      - BUT – there exists a way to make the forwarding pointer more
        efficient
          - ![Screenshot 2020-02-25 at 8 59 08 pm](https://user-images.githubusercontent.com/33334078/75287091-ab4f2300-5811-11ea-9214-3b19e7a4a0d7.png) (a) and (b)
          - One may break coz it's too long – why can't we redirect the
            pointer by storing a shortcut in a client stub? - hence
            server stub is no longer referenced.
              - If it is found, it doesn’t need to go through all the
                pointer – it simply gives a copy of the stub
              - Communication is faster coz fewer process.
          - Once ur entity is found, the server can send some info to
            initial requester, and give a copy of the stub.
          - Let the object’s **home location** keep a reference to its
            current location.

### 3. Home-based approach
  - It approaches through a home – the **home location** keeps track of    where the entities are.
      - Communication to that IP address is first directed to the **home
        agent.**
      - Home agent is located in LAN corresponding to the network
        address contained in the mobile host’s IP address
      - Whenever mobile host moves to another network, it requests a
        foreign address (care of address) to use for communication

  - How it works
      - When home agent receives a packet for mobile host, it looks up
        host’s current loc. If its in local network, packet is
        forwarded. If not, it is tunnelled to the current location,
        wrapped as data in an IP packet and sent to the care-of address.
  - Whole mechanism is hidden and transparent\!\! – location
    transparency is high

  - **Example: mobile IP**
      - ![Screenshot 2020-02-25 at 9 00 04 pm](https://user-images.githubusercontent.com/33334078/75287164-ccb00f00-5811-11ea-8fb4-6eabb40af52f.png)
      - Assume there's an entity where the home origin is the states,
        and the entity is now in south Africa lol – and there are client
        in Singapore that needs to access to the entity that is
        currently in south africa

    1.  First, Singapore client sends packet to the host at home.
    2.  Host home will return address of current location aka Singapore
        AND at the same time, host home will tunnel the packet to the
        current location – forwarded or tunnelled
    3.  Then client will send successive packets to the current location - host name has played the role of intermediary agent
      - Aspect of tunnelling is v important

  - Problems
      - In large scale network, the home may be in complete diff
        location → increase in communication latency\!\!
          - What if this client is next door to south Africa – it's
            wasting resources\!\!why would you connect the US
      - Used of fixed home location – it always has to exists, if not,
        contacting the entity is impossible. The host itself could fail
      - Possible that entity migrates to the location and stay there
        forever – better if the home could move along to minimize the
        waste
      - Home address is fixed – it can't move to somewhere close

### 4. Distributed Hash Tables

  - The way we organise them is a logical ring – you have entities and they hold some information
      - We expect every node to be with a random m-bit identifier
      - Entity is assigned a unique key
      - Entity with key k – falls under jurisdiction of node with
        smallest id k – successor of k
  - We can make each node keep track of its neighbour – you start linear search along the ring
      - E.g. you search from 1 ,3, 4, etc until you get to 13 –
        never scalable and inefficient.
  - We will speak of node p as the node having the identifier p – we are resolving name through a key

  - Principles
    - Finger table – each node p maintains a finger table with
      less than m entries
        - Calculate and fill in by FTp\[i\] = *succ*(p+ 2i−1)
    - Forwarding: q = FTp\[j\] ≤ k \< FTp\[j+ 1\]
    - Or q = FTp\[1\] when p \< k \<FTp\[1\]

    - Example – resolving k= 26 from node 1 and k= 12 from 28
      - ![Screenshot 2020-02-25 at 9 04 28 pm](https://user-images.githubusercontent.com/33334078/75287521-6a0b4300-5812-11ea-8b9e-3c884e7cad38.png)
      - Node 1 will look up k = 26 in its finger table, to discover
        that this value is larger than the last element of the
        finger table. So its forwarded to 18 which is the last
        entry. Then 18 will select node 20, as FT\[2\]\<k\<FT\[3\].
        Then, the request is forwarded from node 20 to 21, and from
        there to 28, which is responsible for k =26. (21 \< 26 \<
        FTp\[1\] 18) so q= 28.

### 5. Hierarchical approaches

  - Idea is to build a large-scale search tree for which the underlying
    network is divided into hierarchical
    **domains**. - Looking to resolve an entity
      - Each domain is represented by a separate
        directory node.
      - Top-level domain t – **root directory node** → knows about all
        entities
      - Lowest level domain – **leaf domain** – and the information we
        are looking for is usually here
      - ![Screenshot 2020-02-25 at 9 05 30 pm](https://user-images.githubusercontent.com/33334078/75287597-8f984c80-5812-11ea-8f42-c2615caed1d4.png)

**Tree organisation**

  - Address of entity E is stored in a leaf or intermediate node
  - BUT how do you lookup for the address of the entity? How to insert
    and delete?
      - Going back to the basics, tree structure, use concept of
        pointer.
  - Intermediate nodes contain a pointer to a child iff the subtree
    rooted at the child stores an address of the entity
  - Assumption is there's a root node, and is a point of entry, and it
    knows all about the entities
  - Eg – multiple addresses in different leaf domains
      - ![Screenshot 2020-02-25 at 9 05 55 pm](https://user-images.githubusercontent.com/33334078/75287633-9de66880-5812-11ea-8327-ab9172cdb3b5.png)
      - If entity E has an address in - 2 address in 2 leaf domain - E
        is replicated in D1 and D2.
      - Then the directory node of the smallest domain (M) containing
        both D1 and D2 will have 2 pointers, one for each subdomain (N)
        containing an address
          - The way it works is you can decide with entry node M there's
            two pointers aka children. And that N itself will help you
            store or locate the record of the entity you are looking for
  - Imp at this stage is to understand how to lookup operation works

  - **Lookup Operation**
      - ![Screenshot 2020-02-25 at 9 06 35 pm](https://user-images.githubusercontent.com/33334078/75287685-b6568300-5812-11ea-9fbc-636a95cb03ee.png)
      - Start lookup at local leaf node and work ur way up by forwarding
        the request
      - It may come as a request to this domain and this domain may or
        not hold the info I want – the node knows nothing→ then it sends
        the request to its parent. Then the parents say it needs to ask
        the root directory. In this case M, and m knows about it. Hence
        the request is forwarded to the child.
          - Right child, and helps you locate the entity you are looking
            for
      - Start always with a leaf and up to the tree to look for
        information

  - **Insert operation**
      - You have an insert request going to one of the leaf nodes. If it
        has no information, request is forwarded to the parent, parent
        contacts root node M and in this case M has a task to create an
        entry (coz its insert) so it creates a record and stores the
        address of the entity
      - A chain of forwarding pointers to the leaf node is created
      - Understand that the right child has info but not the left – one
        way to replicate that information

## Summary
  - 5 different mechanism for flat name space
  - Name space naming service is v imp and the definition of
    attributes\!\!
  - Naming services allow us to bind a name to the attributes of some
    entity in a DS, and resolve a name into those attributes. Entity
    addresses should not be used as names.
  - Names can be organised into name systems
  - Explored various flat name systems


text:
# Usage
This project utilizes a Bluepill board (STM32F103C8) to allow the connection of a digital RC reciever as a USB computer joystick (USB HID device).

# Supported RC Protocols

* CRSF and CRSFv3 (baudrate negotiation not supported at the moment)
* SBUS
* GHST
* ELRS

# preparing
### precompiled binaries
Precompiled binaries can be downloaded from [releases](https://github.com/cruwaller/rc_receiver_to_usb_hid/releases) page.

Basic configuration is
* 4 analog channels (0...2047)
* 8 buttons

SBUS 6xFULL (analogs) and 8xFULL are available if needed.

### compiling
Platformio is used. Check https://docs.platformio.org/en/latest/core/quickstart.html for more info.

# install
Flash using ST-Link or using FTDI (this tool can be used https://www.st.com/en/development-tools/flasher-stm32.html).

# receiver connection
wiring:
| receiver | Bluepill |
| -------- | -------- |
| TX       | PA3 (USART2 RX) |
| 5V       | 5V       |
| GND      | GND      |
| RX       | not connected |


text:
# .NET Core Service Architecture

## Environment
.NET Core has a built-in notion of the environment it is running in.  By default, it assumes it is running in the 'Production' envioronment,
which means that it should be in its most locked-down state, unless specified otherwise.

[MS Documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments)

### Setting the Environment
- Set as the environment variable ASPNETCORE_ENVIRONMENT
- Set in Properties\launchSettings.json
  - Seems to only effect Visual Studio, and not dotnet run
- Set in .vscode\launch.json when debugging with VS Code

### Checking the Environment
- Request IHostingEnvironment from DI, such as in Startup.Configure()
  - ex: public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {}
- Use env.IsEnvironment("environmentname") instead of env.EnvironmentName == "name", since IsEnvironment ignores casing
- There are helper methods for common environments (.NET Core uses full names, instead of abbreviations, such as DEV, TST, STG or PRD)
  - ex: if (env.IsDevelopment()) {}

## Configuration

[Essential .NET Core Configuration](https://msdn.microsoft.com/en-us/magazine/mt632279.aspx?f=255&MSPPError=-2147217396)

### Environment Configs
Configuration settings are stored in appsettings.json, for common settings, and appsettings.[ENV].json for settings specific to an individual environment.
.NET Core has native support for loading settings from JSON files, as well as XML/INI files, environment variables or even command line arguments.

repository: jrharmon/EcsMicroServices

repo_name: jrharmon/EcsMicroServices


text:
# OMReader
![logo](screenshots/logo.png)

[![GitHub contributors](https://img.shields.io/github/contributors/MuhammeedAlaa/OMReader)](https://github.com/MuhammeedAlaa/OMReader/graphs/contributors)
![GitHub last commit](https://img.shields.io/github/last-commit/MuhammeedAlaa/OMReader)
[![GitHub forks](https://img.shields.io/github/forks/MuhammeedAlaa/OMReader)](https://github.com/MuhammeedAlaa/OMReader/network/members)
[![GitHub stars](https://img.shields.io/github/stars/MuhammeedAlaa/OMReader)](https://github.com/MuhammeedAlaa/OMReader/stargazers)
[![GitHub license](https://img.shields.io/github/license/MuhammeedAlaa/OMReader)](https://github.com/MuhammeedAlaa/OMReader/blob/master/License)

## Table of Contents
- [Introduction](#About)
- [Assumptions](#Assumptions)
- [Supported Symbols](#Supported-Symbols)
- [Pipeline](#Pipeline)
  * [Preprocessing](#Preprocessing)
  * [Classification](#Classification)
- [Tools Used](#Tools-Used)
- [How to Run](#How-to-Run)
- [Useful Resources](#Useful-Resources)
- [Contributers](#Contributers)
- [License](#License)

## About

This project aims to convert music sheets into a machine-readable version. We take a simplified version as we support only main [symbols](#Supported-Symbols) where we convert an image of a music sheet to a textual representation that can be further processed to produce midi files or audio files like wav or mp3.

## Assumptions

- input image should be a scanned music sheet.
- maximum ledgers supported are `two` above the stafflines and `two` below the stafflines.
- each stave should start with a G clef.
- stem height is greater than or equal `3 * staffSpacing` (vertical area between two lines).
- note head height equals `staffSpacing`.
- output file is in [GUIDO music notation](https://en.wikipedia.org/wiki/GUIDO_music_notation).

## Supported Symbols

Music sheets have a very vast variety of symbols making it hard to handle so for simplicity we handle only the symbols listed below.

### Notes
![notes](screenshots/notes.PNG)
we support `whole notes`, `half notes`, `quarter notes`, `eigth notes`, `sixteenth notes`, `thiry-second notes` stemsUp or stemsDown.

### Beams
![beams](screenshots/beams.PNG)
we support different kinds of beams combining notes up to `thirty-second` stemsUp or stemsDown.

### Chords
![chords](screenshots/chords.PNG)
we support all kinds of chords.

### Special Symbols
![special](screenshots/special.PNG)
- **Time signatures**: we support only `4/2` and `4/4`
- **Accidentals**: we support all kinds like `double sharp`, `sharp`, `flat`, `double flat`, `natural`.
- **Augmentation dots**
- **clefs**: we support only G clef.

## Pipeline

### Preprocessing
- The input image goes through a series of steps we first apply filters to remove noise like `Hyprid Median Filter` and `Gaussian Filter`
![filtered](screenshots/filtered.PNG)
- We apply `Rotation` then `Adaptive Thresholding` is used to segment the image into symbols and background.
![binary](screenshots/binary.PNG)

- We remove Stafflines to find the symbols in the image easier.
![staffRemoved](screenshots/staffRemoved.PNG)

- We clip the image to remove the brace connecting the staves if exists.
![clipped](screenshots/clipped.PNG)

- We partition the image into the composing staves and apply find contours on each stave and feed each symbol to the classifiers.
![staves1](screenshots/staves1.PNG)
![staves2](screenshots/staves2.PNG)
![staves3](screenshots/staves3.PNG)

### Classification
- symbols are first fed into template matching using SIFT features to identify the following: `Double Sharp`, `Sharp`, `Flat`, `Double Flat`, `Natural`, `Whole Note`, `Time Signatures`.

- if non of the previous symbols was identified we begin classification with our algorithmic approach after removing the stems using the following decision tree.
![decision-tree](screenshots/decision-tree.png)

## Tools Used

- `Ubuntu-18.04` or `Ubuntu-18.04` installed on [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
- [vscode](https://code.visualstudio.com/)
- `python 3.8.5`
- `NumPy`
- `OpenCV`
- `scikit-image`

## How to Run
- Install [conda](https://www.anaconda.com/products/individual)
```
conda env create -f requirements.yml

conda activate OMReader

python3 main.py <input directory path> <output directory path>
```

**Note:** you can run it on windows but you should ignore creating environment with the command previously mentioned and you need to have `anaconda` and `opencv` installed.

## Useful Resources:
- [Staff Line Removal](https://github.com/AmbitionXiang/2018_Competition_of_Computer_Design)
- [Classificaiton](https://www.researchgate.net/publication/263800032)
- [Guido Editor](https://guidoeditor.grame.fr/)

## Contributers:
- [Hossam Alaa](https://github.com/hossamalaa69)
- [Muhammed Ahmad Hesham](https://github.com/Etshawy1)
- [Muhammed Alaa](https://github.com/MuhammeedAlaa)
- [Mahmoud Gody](https://github.com/Moodrammer)

## License:
- Licensed under the [MIT License](./License).


text:
## REST API using Spring Boot, Hibernate and JPA

These are the code example for the Chapter 10 : REST API using Spring Boot, Hibernate and JPA.

There is 3 project that include the example code for different sections in the chapter

- [spring-boot-example](spring-boot-example) : Basic Spring Boot application example
- [hibernate-example](hibernate-example) : Simple Hibernate example using H2
- [spring-data-example](spring-data-example) : Full functional RESTFul API using Spring Data JPA

## Technical requirements

- Oracle OpenJDK 8 available at http://jdk.java.net/8/
- IntelliJ IDEA Community Edition available at https://www.jetbrains.com/idea/
- Gradle available at https://gradle.org/
- HTTPie available at https://httpie.org/
- Any Zip Software such https://www.7-zip.org/

All Software could be installed with the default settings, you may need to download the right version for your operating system, no additional configuration is required.


text:
<!-- markdownlint-disable MD034 -->
# vSphere CSI Driver - v2.2.1 release

## New Feature

- There is no new feature released in v2.2.1.  v2.2.1 is the patch release to fix critical issue observed in [v2.2.0](v2.2.0.md) release.

## Notable Changes

- Fixed detach volume error handling [#665](https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/840)

## Deployment files

- https://github.com/kubernetes-sigs/vsphere-csi-driver/tree/v2.2.1/manifests/v2.2.1

## Kubernetes Release

- Minimum: 1.18
- Maximum: 1.20

## Supported sidecar containers versions

- csi-provisioner - v2.1.0
- csi-attacher - v3.1.0
- csi-resizer - v1.1.0
- livenessprob - v2.2.0
- csi-node-driver-registrar - v2.1.0

## Known Issues

### vSphere CSI Driver issues

1. Migrated in-tree vSphere volume deleted by in-tree vSphere plugin remains on the CNS UI.
    - Impact: Migrated in-tree vSphere volumes deleted by in-tree vSphere plugin remains on the CNS UI.
    - Workaround: Admin needs to manually reconcile discrepancies in the Managed Virtual Disk Catalog. Admin needs to follow this KB article - https://kb.vmware.com/s/article/2147750
2. Volume expansion might fail when it is called with pod creation simultaneously. This issue is fixed in vSphere 7.0u2, but present on vSphere 7.0u1 and 7.0.
    - Impact: Users can resize the PVC and create a pod using that PVC simultaneously. In this case, pod creation might be completed first using the PVC with original size. Volume expansion will fail because online resize is not supported in vSphere 7.0 Update1.
    - Workaround: Wait for the PVC to reach FileVolumeResizePending condition before attaching a pod to it.
3. Deleting PV before deleting PVC, leaves orphan volume on the datastore.
    - Impact: Orphan volumes remain on the datastore, and admin needs to delete those volumes manually using `govc` command.
    - Upstream issue is tracked at: https://github.com/kubernetes-csi/external-provisioner/issues/546
    - Workaround:
        - No workaround. User should not attempt to delete PV which is bound to PVC. User should only delete a PV if they know that the underlying volume in the storage system is gone.
        - If user has accidentally left orphan volumes on the datastore by not following the guideline, and if user has captured the volume handles or First Class Disk IDs of deleted PVs, storage admin can help delete those volumes using `govc disk.rm <volume-handle/FCD ID>` command.
4. vSAN file share volumes (ReadWriteMany/ ReadOnlyMany vSphere CSI Volumes) become inaccessible after vSphere CSI driver Node DaemonSet Pod restarts.
   - Impact: Pod can not write/read data on vSAN file share volumes
   - Workaround: Remount vSAN file services volumes used by the application pods at the same location from the Node VM Guest OS directly. Detailed steps are available [here](https://vsphere-csi-driver.sigs.k8s.io/driver-deployment/upgrade.html#if-you-have-rwm-volumes-backed-by-vsan-file-service-deployed-using-vsphere-csi-driver-please-refer-to-the-following-steps-before-upgrading-vsphere-csi-driver).
5. `user` and `ca-file` change in the [vsphere-config-secret](https://vsphere-csi-driver.sigs.k8s.io/driver-deployment/installation.html#create-a-configuration-file-with-vsphere-credentials-) is not honored until vSphere CSI Controller Pod restarts.
   - Impact: Volume lifecycle operations fail until the controller pod restarts.
   - Workaround: Restart `vsphere-csi-controller` deployment Pod.
6. vCenter restart may leave Kubernetes persistent volume claims in the Pending state.
   - Impact:
      - Persistent volume claims which are being created at the time vCenter is restarting may remain in the `pending` state for 1 hour.
      - After vSphere CSI Driver clears up pending cached tasks, new tasks to create volumes will be issued to the vCenter and then Persistent volume claims can go into `Bound` State.
      - Restarting vCenter while volumes are getting created may leave orphan volumes on the datastores.
   - Workaround:
      - If 1 hour wait is longer for SLA, restart the vSphere CSI driver Pod to clean up pending vCenter cached tasks objects for which session is already destroyed. Note: This action will leave orphan volume on the datastore.

### Kubernetes issues

1. Filesystem resize is skipped if the original PVC is deleted when FilesystemResizePending condition is still on the PVC, but PV and its associated volume on the storage system are not deleted due to the Retain policy.
    - Issue: https://github.com/kubernetes/kubernetes/issues/88683
    - Impact: User may create a new PVC to statically bind to the undeleted PV. In this case, the volume on the storage system is resized but the filesystem is not resized accordingly. User may try to write to the volume whose filesystem is out of capacity.
    - Workaround: User can log into the container to manually resize the filesystem.
2. Volume associated with a Statefulset cannot be resized.
    - Issue: https://github.com/kubernetes/enhancements/pull/660
    - Impact: User cannot resize volume in a StatefulSet.
    - Workaround: If the statefulset is not managed by an operator, there is a slightly risky workaround which the user can use on their own discretion depending upon their use case. Please refer to https://serverfault.com/questions/955293/how-to-increase-disk-size-in-a-stateful-set for more details.
3. Recover from volume expansion failure.
    - Impact: If a user tries to expand a PVC to a size which may not be supported by the underlying storage system, volume expansion will keep failing and there is no way to recover.
    - Issue: https://github.com/kubernetes/enhancements/pull/1516
    - Workaround: None.

## vSphere issues

1. CNS file volume has a limitation of 8K for metadata.
    - Impact: It is quite possible that we will not be able to push all the metadata to CNS file share as we need support a max of 64 clients per file volume.
    - Workaround: None, this is vSphere limitation.

repository: derek-pryor/vmware-vsphere-csi-driver

repo_name: derek-pryor/vmware-vsphere-csi-driver


text:
---
title:  "Publications"
layout: single
permalink: /publications/
author_profile: true
comments: false
---

#### Journals

[J-6] R. Sedar, C. Kalalas, F. Vazquez-Gallego, L. Alonso, J. Alonso-Zarate, “*A Comprehensive
Survey of V2X Cybersecurity Mechanisms and Future Research Paths,*" in IEEE Open Journal
of the Communications Society, vol. 4, pp. 325-391, January 2023.

[J-5] D. Carrillo, C. Kalalas, P. Raussi, D. Michalopoulos, D. Rodríguez, H. Kokkoniemi-
Tarkkanen, K. Ahola, P. Nardelli, G. Fraidenraich, and P. Popovski, “*Boosting 5G on Smart
Grid Communication: A Smart RAN Slicing Approach,*" in IEEE Wireless Communications,
Early Access, pp. 1–8, August 2022.

[J-4] M. d. Castro Tomé, D. Gutierrez-Rojas, P. Nardelli, C. Kalalas, L. C. Pereira da Silva, A.
Pouttu, “*Event-driven Data Acquisition for Electricity Metering: A Tutorial,*" in IEEE Sensors
Journal, vol. 22, no. 6, pp. 5495–5503, March 2022.

[J-3] F. Vazquez-Gallego, C. Kalalas, L. Alonso and J. Alonso-Zarate, “*Contention Tree-based
Access for Wireless Machine-to-Machine Networks with Energy Harvesting,*" in IEEE Transactions
on Green Communications and Networking, vol. 1, no. 2, pp. 1–12, April 2017.

[J-2] A. Laya, C. Kalalas, F. Vazquez-Gallego, L. Alonso and J. Alonso-Zarate, “*Goodbye,
ALOHA!,*" in IEEE Access, vol. 4, no. 1, pp. 2029–2044, April 2016.

[J-1] C. Kalalas, L. Thrybom and J. Alonso-Zarate, “*Cellular Communications for Smart Grid
Neighborhood Area Networks: A Survey,*" in IEEE Access, vol. 4, no. 1, pp. 1469–1493, March
2016.

#### Conferences

[C-24] R. Sedar, C. Kalalas, P. Dini, J. Alonso-Zarate, F. Vazquez-Gallego, “*Misbehavior Detection
in Vehicular Networks: An Ensemble Learning Approach*", in Proc. of IEEE Global Communications
Conference 2022 (IEEE Globecom ’22), Rio de Janeiro, Brazil, December 2022.

[C-23] A. Beattie, P. Mulinka, S. Sahoo, I. Christou, C. Kalalas, D. Gutierrez-Rojas, P. Nardelli,
“*A Robust and Explainable Data-Driven Anomaly Detection Approach For Power Electronics*",
in Proc. of IEEE International Conference on Smart Grid Communications 2022 (IEEE Smart-
GridComm ’22), Singapore, October 2022.

[C-22] P. Mulinka, S. Sahoo, C. Kalalas, P. Nardelli, “*Optimizing a Digital Twin for Fault Diagnosis
in Grid Connected Inverters - A Bayesian Approach*", in Proc. of IEEE Energy Conversion
Congress and Exposition 2022 (IEEE ECCE ’22), Detroit, Michigan, USA, October 2022.

[C-21] R. Sedar, C. Kalalas, J. Alonso-Zarate, F. Vazquez-Gallego, “*Multi-domain Denial-of-Service Attacks in Internet-of-Vehicles: Vulnerability Insights and Detection Performance,*" in
Proc. of IEEE International Conference on Network Softwarization 2022 (IEEE NetSoft ’22),
Milan, Italy, July 2022.

[C-20] R. Sedar, C. Kalalas, F. Vazquez-Gallego, J. Alonso-Zarate, “*Reinforcement Learning Based Misbehaviour Detection in Vehicular Networks,*" in Proc. of IEEE International Conference
on Communications 2022 (IEEE ICC ’22), Seoul, South Korea, May 2022.

[C-19] P. Mulinka, C. Kalalas, M. Dzaferagic, I. Macaluso, D. Gutierrez-Rojas, P. Nardelli, and
N. Marchetti, “*Information Processing and Data Visualization in Networked Industrial Systems,*"
in Proc. of IEEE International Symposium on Personal, Indoor and Mobile Radio Communications
2021 (IEEE PIMRC ’21), virtual conference, September 2021.

[C-18] R. Sedar, C. Kalalas, F. Vazquez-Gallego, J. Alonso-Zarate, "*Reinforcement Learning based
Misbehaviour Detection in V2X Scenarios*", in Proc. of IEEE International Mediterranean
Conference on Communications and Networking 2021 (IEEE MeditCom 2021), Athens, Greece,
September 2021.

[C-17] R. Vilalta, P. Alemany, R. Sedar, C. Kalalas, R. Casellas, R. Martinez, F. Vazquez-
Gallego, J. Ortiz, A. Skarmeta, J. Alonso-Zarate and R. Munoz, “*Applying Security Service
Level Agreements in V2X Network Slices,*" in Proc. of IEEE Conference on Network Function
Virtualization and Software Defined Networks 2020 (IEEE NFV-SDN ’20), virtual conference,
November 2020.

[C-16] T. Alexopoulos, C. Kalalas and G. Korres, “*On the Imputation of Power System Measurement
Streams with Imperfect Wireless Communication,*" in Proc. of IEEE Global Power, Energy
and Communication Conference 2020 (IEEE GPECOM ’20), virtual conference, October 2020.

[C-15] C. Kalalas and J. Alonso-Zarate, “*Lightweight and Space-efficient Vehicle Authentication
based on Cuckoo Filter,*" in Proc. of IEEE 5G World Forum 2020 (IEEE 5G-WF ’20), virtual
conference, September 2020.

[C-14] C. Kalalas and J. Alonso-Zarate, “*Sensor Data Reconstruction in Industrial Environments
with Cellular Connectivity,*" in Proc. of IEEE International Symposium on Personal, Indoor and
Mobile Radio Communications 2020 (IEEE PIMRC ’20), virtual conference, August 2020.

[C-13] D. Gutierrez-Rojas, M. Ullah, I. Christou, G. Almeida, P. Nardelli, D. Carrillo, J. M.
Sant’Ana, H. Alves, M. Dzaferagic, A. Chiumento and C. Kalalas, “*Three-layer Approach to
Detect Anomalies in Industrial Environments based on Machine Learning*", in Proc. of IEEE
International Conference on Industrial Cyber-Physical Systems (IEEE ICPS ’20), virtual conference,
June 2020.

[C-12] D. Carrillo-Melgarejo, C. Kalalas, A. S. Sena, P. Nardelli and G. Fraidenraich, “*Reconfigurable
Intelligent Surface-Aided Grant-Free Access for Uplink URLLC*", in Proc. of 6G
Wireless Summit 2020 (6G Summit), virtual conference, March 2020.

[C-11] C. Kalalas and J. Alonso-Zarate, “*Massive Connectivity in 5G and Beyond: Technical
Enablers for the Energy and Automotive Verticals*", in Proc. of 6G Wireless Summit 2020 (6G
Summit), virtual conference, March 2020.

[C-10] P. Nardelli, C. Papadias, C. Kalalas, H. Alves, I. Christou, I. Macaluso, N. Marchetti,
R. Palacios and J. Alonso-Zarate, “*Framework for the Identification of Rare Events via Machine
Learning and IoT Networks*", in Proc. of International Symposium on Wireless Communication
Systems 2019 (IEEE ISWCS ’19), Oulu, Finland, August 2019.

[C-9] J. Haapola, S. Ali, C. Kalalas, J. Markkula, N. Rajatheva, A. Pouttu, J. M. Martín Rapún, I.
Lalaguna, F. Vazquez-Gallego, J. Alonso-Zarate, G. Deconinck, H. Almasalma, J.Wu, C. Zhang,
E. Porras Muñoz and F. David Gallego, “*Peer-to-Peer Energy Trading and Grid Control Communications
Solutions’ Feasibility Assessment based on Key Performance Indicators*", in Proc. of
IEEE Vehicular Technology Conference 2018, Workshop on Enabling Internet via Machine type
Wireless Communications (IEEE VTC-Spring ’18), Porto, Portugal, June 2018.

[C-8] A. Tsitsimelis, C. Kalalas, J. Alonso-Zarate and C. Antón-Haro, “*On the Impact of LTE
RACH Reliability on State Estimation in Wide-Area Monitoring Systems*", in Proc. of IEEE
Wireless Communications and Networking Conference 2018 (IEEE WCNC ’18), Barcelona, Spain,
April 2018.

[C-7] C. Kalalas and J. Alonso-Zarate, “*Efficient Cell Planning for Reliable Support of Event-
Driven Machine-Type Traffic in LTE*", in Proc. of IEEE Global Communications Conference
2017 (IEEE Globecom ’17), Singapore, December 2017.

[C-6] C. Kalalas, J. Alonso-Zarate and G. Bag, “*On the Transmission Mode Selection for Substation
Automation Traffic in Cellular Networks*", in Proc. of IEEE International Conference
on Smart Grid Communications 2017 (IEEE SmartGridComm ’17), Dresden, Germany, October
2017.

[C-5] A. Pouttu, J. Haapola, P. Ahokangas, Y. Xu, M. Kopsakangas-Savolainen, E. Porras, J.
Matamoros, C. Kalalas, J. Alonso-Zarate, F. D. Gallego, J. M. Martín, G. Deconinck, H. Almasalma,
S. Clayes, J. Wu, M. Cheng, F. Li, Z. Zhang, D. Rivas and S. Casado, “*P2P Model for Distributed Energy Trading, Grid Control and ICT for Local Smart Grids*", in Proc. of European
Conference on Networks and Communications 2017 (EuCNC ’17), Oulu, Finland, June 2017.

[C-4] C. Kalalas and J. Alonso-Zarate, “*Reliability Analysis of the Random Access Channel
of LTE with Access Class Barring for Smart Grid Monitoring Traffic*", in Proc. of IEEE International
Conference on Communications, Workshop on Integrating Communications, Control,
and Computing Technologies for Smart Grid 2017 (IEEE ICC ’17, ICT4SG), Paris, France, May
2017.

[C-3] C. Kalalas, F. Vazquez-Gallego and J. Alonso-Zarate, “*Performance Evaluation of the
Contention-Based Random Access of LTE under Smart Grid Traffic*", in Proc. of EAI International
Conference on Smart Grid Inspired Future Technologies 2017 (EAI SmartGIFT ’17),
London, UK, March 2017.

[C-2] C. Kalalas, F. Vazquez-Gallego and J. Alonso-Zarate, “*Handling Mission-Critical Communication
in Smart Grid Distribution Automation Services through LTE*", in Proc. of IEEE
International Conference on Smart Grid Communications 2016 (IEEE SmartGridComm ’16),
Sydney, Australia, November 2016.

[C-1] C. Kalalas, L. Gkatzikis, C. Fischione, P. Ljungberg and J. Alonso-Zarate, “*Enabling IEC
61850 Communication Services over Public LTE Infrastructure*", in Proc. of IEEE International
Conference on Communications 2016 (IEEE ICC ’16), Kuala Lumpur, Malaysia, May 2016.

#### Book chapters

[BC-3] M. Fallgren, M. Dillinger, T. Mahmoodi, T. Svensson, C. Kalalas, E. Ström, and A.
E. Fernandez Barciela, “*An Introduction to C-V2X,*" Chapter in “Cellular V2X for Connected
Automated Driving", published by John Wiley & Sons. ISBN: 978-1-119-69264-5. January
2021.

[BC-2] R. Sedar, C. Kalalas, F. Vazquez-Gallego and J. Alonso-Zarate, “*Intelligent Transport
System as an Example of a Wireless IoT System,*" Chapter in “Wireless Networks and Industrial
IoT - Applications, Challenges and Enablers", published by Springer. ISBN: 978-3-030-51472-3. October 2020.

[BC-1] M. Angjelichinoski, M. Cosovic, C. Kalalas, R. Lliuyacc, M. Zeinali, J. Alonso-Zarate,
J. Manuel Mauricio, P. Popovski, C. Stefanovic, J. S. Thompson and D. Vukobratovic, “*Overview
of research in the ADVANTAGE project,*" Chapter in “Smarter Energy: from Smart Metering to
the Smart Grid", published by IET Digital Library. ISBN: 978-1-78561-104-9. December 2016.

#### White papers

[WP-4] Contributor to the White Paper “*Intelligent Security Architecture for 5G and Beyond
Networks*", INSPIRE-5Gplus, October 2022.

[WP-3] Contributor to the White Paper “*From 5G to 6G Vision: A Connected and Automated
Mobility Perspective*", 6G-IA 5G for CAM Working Group, June 2022.

[WP-2] Contributor to the Strategic Research and Innovation Agenda 2021-27 “*Smart Networks
in the context of Next Generation Internet*", 5G-Infrastructure Association, September 2020.

[WP-1] Contributor to the White Paper “*5G and Energy*", 5G-Infrastructure Association, Editors:
Linus Thrybom (ABB) and Adam Kapovits (Eurescom), September 2015.

#### Research reports

[R-2] C. Kalalas, L. Ning, R. Zhang, Y. Wu, A. Laya, J. Markendahl, A. Höglund, “*Technoeconomic
study on capillary networks and cellular technologies for Machine-to-Machine communications*",
Wireless@KTH, January 2014.

[R-1] C. Zhang, C. Kalalas, C. Lamé, L. Xiuming, P. Krishnan, T. Fehrenbach, “*Visual-Based
In-Flight File Transfer*", KTH, May 2013.


text:
# QRontol
Control stuff via QR codes.

The main goal of this project is to provide a tangible interface to trigger user-defined actions. While not meant to completly replace other interfaces, this is meant to provide an alternative interaction metaphor for certain actions. The inspiration came from the "old analog way" of browsing for music, e.g., flipping through some LP or CD albums covers in a box. This directly leads to one use cases, printing out and laminating QR coded cards with album art. In this case, one can literally browse through a deck of cards and hand pick an album. The selected card can be scanned, which triggers an action that starts the playlist on a streaming music service or starts the album in a local mp3 player etc. The system can be potentially also used by small kids, without having to navigate any menues or getting distracted by other apps on a phone or tablet.

# System overview
* QR code card generator: svg-template and python script
  * the script will autogenerate QR codes and register them with the command server (see below),
  * populate the svg file, e.g., based on some csv input file, or using some scraper
  * the svg file, can be converted to a PDF and then be printed and laminated by the user
* QR code reader:
  * generic reader: any QR reader app on a smartphone; reads an URL from the QR code, that triggers via a webhook the command server
  * custom reader: runs on a dedicated device, e.g., [octocam](https://shop.pimoroni.com/products/octocam-pi-zero-w-project-kit); reads a numeric sequence from the QR code and pass it on to the command server
* command server: implemented in python
  * has a database of QR codes associated with actions
  * receives a decoded QR code and triggers a command/action of a third party API

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

What things you need to install the software and how to install them

```
Give examples
```

### Installing

pip integraton is planed for later and will be documented here.

A step by step series of examples that tell you have to get a development env running

Say what the step will be

```
Give the example
```

And repeat

```
until finished
```

End with an example of getting some data out of the system or using it for a little demo

## Running the tests

Explain how to run the automated tests for this system

### Break down into end to end tests

Explain what these tests test and why

```
Give an example
```

### And coding style tests

Explain what these tests test and why

```
Give an example
```

## Deployment

Add additional notes about how to deploy this on a live system

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/souljedi/QRontol/tags).

## Authors

* **Sebastian Ullrich** - *Initial work* - [souljedi](https://github.com/souljedi)

See also the list of [contributors](https://github.com/souljedi/QRontol/graphs/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

* **Billie Thompson** - For the Readme and contributing templates - [PurpleBooth](https://github.com/PurpleBooth)
* Inspiration
* etc

repository: souljedi/QRontol

repo_name: souljedi/QRontol


text:
# NieR: Automata Save Importer - Version 0.1 by Fog
Allows saves from other users to be modified to work with your copy of the game

## Introduction
This tool was originally made for the NieR: Automata speedrunning community, in order to modify my practice saves to work for their games. Inspiration was taken from NieR:AutoModSave by jimmyazrael, but modifies the saves in a different way. Instead of requiring GameData.dat, only a single SlotData_X.dat file is required from the user running the program. This allows not only the header to be modified for the saves to load on a different computer, but it also transfers settings and bindings from the donor save.

As for the actual save data information, it appears that data is stored in Big Endian format. This doesn't matter to us in this case, but it's still good to know. Save data is tied to the Steam User ID, but the save data itself is not encrypted. This is why using a save without modification does not work.

Relevant save data locations:
1. 0x4 (4 bytes) 	- Steam32 ID
2. 0x3974c (264 bytes)	- Game settings (not graphics related, that's stored in SystemData.dat)
3. 0x39854 (172 bytes) 	- Custom controller bindings for gamepad and keyboard (4 bytes per button)

Everything else is not modified, so I have not documented it. (TODO: research and document rest of save format)

I've made the extra step to transfer over settings and bindings from a donor save due to the large amount of practice saves made. Instead of the user re-binding everything manually, this tool handles it for them to make it as plug and play as possible.

## Requirements
### On Linux (Ubuntu 19.10 x86_64)
* Python 2
  * `sudo apt-get update -y && sudo apt-get install -y python2`

## Instructions

### On Windows
1. If no save file exists, create one within NieR: Automata. Once created, copy the file (SlotData_X.dat, with numbers from 0 to 2 in place of X) into the same directory as this program.
2. Rename the original save to SlotDataOriginal.dat.
3. Copy the save(s) you wish to import into the same directory as SlotData_X.dat and this program. Every save within the directory (including sub-folders) will be converted to work with your game.
4. Run the program. This will complete all of the steps required to make the imported saves work with your copy of the game.

### On Linux
* 1 to 3: Follow the above instructions
4. Open a Terminal with a CLI (Command Line Interface). Change into the directory of the program. Run the Python program:
  `python2 NierAutomataSaveImporter.py`
5. Expected output is as such :
```
python2 NierAutomataSaveImporter.py
All done! The requested saves have been modified and can now be placed in your save directory.
```

## TODO
1. Allow input/output paths to be specified.
2. Options for header only or settings only.
3. Probably some other stuff which I'm forgetting.


text:
# Algolia Jekyll Plugin

[![Gem Version][1]](http://badge.fury.io/rb/algoliasearch-jekyll)
[![Build Status][2]](https://travis-ci.org/algolia/algoliasearch-jekyll)
[![Coverage Status][3]](https://coveralls.io/github/algolia/algoliasearch-jekyll?branch=master)
[![Code Climate][4]](https://codeclimate.com/github/algolia/algoliasearch-jekyll)

Jekyll plugin to automatically index your Jekyll posts and pages into an
Algolia index by simply running `jekyll algolia push`.

## Usage

```shell
$ jekyll algolia push
```

This will push the content of your jekyll website to your Algolia index.

You can specify any option you would normally pass to `jekyll build`, like
`--config`, `--source`, `--destination`, etc.

## Installation

First, add the `algoliasearch-jekyll` gem to your `Gemfile`, in the
`:jekyll_plugins` section. If you do not yet have a `Gemfile`, here is the
minimum content to get your started.

```ruby
source 'https://rubygems.org'

gem 'jekyll', '~> 2.5.3'

group :jekyll_plugins do
  gem 'algoliasearch-jekyll', '~> 0.4.3'
end
```

Once this is done, download all dependencies with `bundle install`.

Then, add `algoliasearch-jekyll` to your `_config.yml` file, under the `gems`
section, like this:

```yaml
gems:
  - algoliasearch-jekyll
```

If everything went well, you should be able to execute `jekyll help` and see the
`algolia` subcommand listed.

## Configuration

Add information about your Algolia configuration into the `_config.yml` file,
under the `algolia` section, like this:

```yaml
algolia:
  application_id: 'your_application_id'
  index_name:     'your_index_name'
```

You write api key will be read from the `ALGOLIA_API_KEY` environment variable.
You can define it on the same line as your command, allowing you to type
`ALGOLIA_API_KEY='your_write_api_key' jekyll algolia push`.

### ⚠ Other, unsecure, method ⚠

You can also store your write api key in a file named `_algolia_api_key`, in
your source directory. If you do this we __very, very, very strongly__ encourage
you to make sure the file is not tracked in your versioning system.

### Options

The plugin uses sensible defaults, but you may want to override some of its
configuration. Here are the various options you can add to your `_config.yml`
file, under the `algolia` section:

#### `excluded_files`

Defines which files should not be indexed for search.

```yml
algolia:
  excluded_files:
    - index.html
    - 2015-01-01-post.md
```

#### `record_css_selector`

Defines the css selector inside a page/post used to choose which parts to index.
It is set to all paragraphs (`<p>`) by default.

If you would like to also index lists, you could set it like this:

```yml
algolia:
  record_css_selector: 'p,ul'
```

#### `settings`

Here you can pass any specific [index settings][5] to your Algolia index. All
the settings supported by the API can be passed here.

##### Examples

If you want to activate `distinct` and some snippets for example, you would do:

```yml
algolia:
  settings:
    attributeForDistinct: 'hierarchy'
    distinct: true
    attributesToSnippet: ['text:20']
```

If you want to search in other fields than the default ones, you'll have to edit
the `attributesToIndex` (default is `%w(title h1 h2 h3 h4 h5 h6 unordered(text)
unordered(tags))`

```yml
algolia:
  settings:
    attributesToIndex:
      - title
      - h1
      - h2
      - h3
      - h4
      - h5
      - h6
      - unordered(text)
      - unordered(tags)
      - your_custom_attribute_1
      - your_custom_attribute_2
      - ...
```

### Hooks

The `AlgoliaSearchRecordExtractor` contains two methods (`custom_hook_each` and
`custom_hook_all`) that are here so you can overwrite them to add your custom
logic. They currently simply return the argument they take as input.

```ruby
class AlgoliaSearchRecordExtractor
  # Hook to modify a record after extracting
  # `node` refers to the Nokogiri HTML node of the element
  def custom_hook_each(item, node)
    item
  end

  # Hook to modify all records after extracting
  def custom_hook_all(items)
    items
  end
end
```

The `AlgoliaSearchJekyllPush` class also lets user define the
`custom_hook_excluded_file?` method. This method is called on every file that
the plugin thinks it should parse and index. If it returns `true`, the file is
not indexed. You can add here your custom logic to exclude some files.

```ruby
class AlgoliaSearchJekyllPush < Jekyll::Command
  class << self
    # Hook to exclude some files from indexing
    def custom_hook_excluded_file?(file)
      return true if filepath =~ %r{^/excluded_dir/}
      false
    end
  end
end
```

## Command line

Here is the list of command line options you can pass to the `jekyll algolia
push` command:

| Flag                     | Description                                                           |
| ----                     | -----                                                                 |
| `--config ./_config.yml` | You can here specify the config file to use. Default is `_config.yml` |
| `--future`               | With this flag, the command will also index posts with a future date  |
| `--limit_posts 10`       | Limits the number of posts to parse and index                         |
| `--drafts`               | Index drafts in the `_drafts` folder as well                          |
| `--dry-run` or `-n`      | Do a dry run, do not actually push anything to your index             |
| `--verbose`              | Display more information about what is going to be indexed            |

## Dependencies

The `algoliasearch-jekyll` plugin works for versions of Jekyll starting from
2.5, with a version of Ruby of at least 2.0. You also need
[Bundler][6] to easily add the gem as a dependency to Jekyll.

## Searching

This plugin will only index your data in your Algolia index. Adding search
capabilities is quite easy. You can follow [our tutorials][7] or use our forked
version of the popular [Hyde theme][8].

## GitHub Pages

GitHub does not allow custom plugins to be run on GitHub Pages. This means that
you'll either have to run `jekyll algolia push` manually, or configure TravisCI
to do it for you.

[Travis CI][9] is an hosted continuous integration
service, and it's free for open-source projects. Properly configured, it can
automatically reindex your data whenever you push to `gh-pages`.

For it to work, you'll have 3 steps to perform.

### 1. Create a `.travis.yml` file

Create a file named `.travis.yml` at the root of your project, with the
following content:

```yml
language: ruby
cache: bundler
branches:
  only:
    - gh-pages
script:
  - bundle exec jekyll algolia push
rvm:
 - 2.2
```

This file will be read by Travis and instruct it to fetch all dependencies
defined in the `Gemfile`, then run `jekyll algolia push`. This will only be
triggered when data is pushed to the `gh-pages` branch.

### 2. Update your `_config.yml` file to exclude `vendor`

Travis will download all you `Gemfile` dependencies into a directory named
`vendor`. You have to tell Jekyll to ignore this directory, otherwise Jekyll
will try to parse it (and fail).

Doing so is easy, just add the following line to your `_config.yml` file:

```yml
exclude: [vendor]
```

### 3. Configure Travis

In order for Travis to be able to push data to your index on your behalf, you
have to give it your write API Key. This is achieved by defining an
`ALGOLIA_API_KEY` [environment variable][10] in Travis settings.

You should also uncheck the "Build pull requests" option, otherwise any pull
request targeting `gh-pages` will trigger the reindexing.

![Travis Configuration][11]

### Done

Commit all the changes to the files, and then push to `gh-pages`. Travis will
catch the event and trigger your indexing for you. You can follow the Travis job
execution directly on [their website][12].

[1]: https://badge.fury.io/rb/algoliasearch-jekyll.svg
[2]: https://travis-ci.org/algolia/algoliasearch-jekyll.svg?branch=master
[3]: https://coveralls.io/repos/algolia/algoliasearch-jekyll/badge.svg?branch=master&service=github
[4]: https://codeclimate.com/github/algolia/algoliasearch-jekyll/badges/gpa.svg
[5]: https://www.algolia.com/doc/ruby#indexing-parameters
[6]: http://bundler.io/
[7]: https://www.algolia.com/doc/javascript
[8]: https://github.com/algolia/hyde
[9]: https://travis-ci.org/
[10]: http://docs.travis-ci.com/user/environment-variables/
[11]: /docs/travis-settings.png
[12]: https://travis-ci.org

repository: unity/algoliasearch-jekyll

repo_name: unity/algoliasearch-jekyll


text:
Perhaps then you are wondering, why are we discussing them in the context of software engineering? First introduced by [Jeffrey Palermo](https://jeffreypalermo.com/) in a series of blog posts, Onion Architecture guides software engineers to model their business logic in a **core** collection with no coupling to the outer concerns, such as database choice or how the user interface operates.

 What does Onion Architecture look like? It may come as a surprise.

![https://img.barrymcauley.co.uk/onion_architecture.svg](https://img.barrymcauley.co.uk/onion_architecture.svg)

It looks very similar to an onion with layers wrapping around a central core. Each of these layers represent a specific duty within the overall function of a service. Similar to an onion, you can only access the core by going through the outer most layers and it is that narrative which informs us of the architectures purpose - to direct the flow of coupling towards the centre from the outside in.

So, like a typical onion, let's work our way into the core and hopefully avoid any tears along the way. The three outer layers are those which are not directly related to our business logic but depend upon on it fulfil their own purpose. They can change often and thus are separate from our core application logic.

These layers are: **Infrastructure**, where our database, file system, or any external web service we depend on live. **Tests:** unit, integration, end-to-end. How we validate our business cases. Finally, **User Interface**, how our users interact with the code we have built. These layers are the ones which interact with the first layer of our **"application core"** and that is the **Application Services** layer (sometimes known as the **Transport Layer**). Within this layer, we define what our service can do through a series of contracts.

Inward moving, we encounter the **Domain Services** layer. In this layer is where the majority of our business logic lives, it carries out the operations to turn A into B, input into output, egg into chicken. It achieves this through interacting with the final layer, the **Domain Model** layer which is the representation of the high level data objects we use.

Let's walk-through an example on how we can solve a real-world task such as processing a financial transaction to see how we apply the **Onion Architecture.** from the outside, in.

### An Example - Buying A Coffee

One outer layer which may surprise many is **Infrastructure**. Is the database we use or an external dependency not part of our domain model layer? A very valid question so let's explore it further.

Take for instance we have the following definition of a user account in some NoSQL database:

```json
{
	"id": "some_user_id",
	"balance": 500.00,
	"currency": "GBP",
}
```

So when we do a query and wish to interact with this, it would be common sense that we would create a model object to marshal this json into such as:

```go
type Account struct {
	ID       string    `json:"id"`
	Currency string    `json:"currency"`
	Balance  float64   `json:"balance"`
}
```

Makes sense, right? Lets say however that the team decides that NoSQL isn't up to scratch and some relational goodness is the trend of the month. Well, thanks to the power of the onion architecture, as long as the new relational structure provides the fields required as defined in your domain model **contract**, the business logic of your application does not need to change and you can continue to provide the functionality your users need. This applies to any external dependency or data-storage the application interacts with the key takeaway being:

```
Externalise your dependencies and decouple them through contracts.
```

Now we have a domain model representation of an account, let's need to define a use-case for a financial transaction and the steps involved when our user, Andre, decides to buy a coffee:

![https://img.barrymcauley.co.uk/transaction.svg](https://img.barrymcauley.co.uk/transaction.svg)

As we can see from the diagram, we need to set a contract to allow "Generic Coffee Shop" to charge Andres balance for the cost of the coffee he is purchasing. Let's assume that "Generic Coffee Shop" will communicate with us via a **HTTP POST** request, we can see that we need the following:

- The user ID of Andre.
- The requested amount to buy the coffee.

A **json** representation of this request would be:

```json
{
	"userID": "some_user_id",
	"amount": 100.00,
}
```

The naming of this use-case would be charging a users balance and, as mentioned, the **Applications Services** layer is where we define these. To represent this in code, we will need to embody it within our http handler code:

```go
package application

import (
	"net/http"
	"encoding/json"
)

// ChargeRequest is our representation of an incoming request.
type ChargeRequest struct {
	UserID string  `json:"userID"`
	Amount float64 `json:"amount"`
}

// ChargeUserHandler takes an incoming HTTP POST request and decodes
// the body into a ChargeRequest so that we can carry out charging
// the users balance for the cost of the transaction.
func ChargeUserHandler(w http.ResponseWriter, r *http.Request) {
	var cr ChargeRequest

	err := json.NewDecoder(r.Body).Decode(&cr)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	if cr.UserID == "" {
		http.Error(w, "user id empty", http.StatusBadRequest)
		return
	}

	// Call our domain services layer

	return
}
```

Great! We have now set our expectations for anyone wishing to charge a user for a transaction within our **Application Services** layer. However, we are not doing anything useful at the moment with the transaction so from this and following the layers of **Onion Architecture** we need to define our **Domain Services** layer.

As engineers, let's take some time to lay out our flow:

1. Check Andres account balance and if it has enough funds in it to cover the cost of the transaction.
    - If not or there is no account for Andre, return an error stating so.
2. Now we have the account, deduct the cost of the transaction from Andres balance and update it within our database.
    - If the update fails, we need to return an error stating so. We don't want anyone getting a free coffee.
3. Now the balance has been updated, return confirmation to "Generic Coffee Company" thus completing the transaction and allowing Andre to drink his delicious coffee.

Thankfully we have already defined our Account domain model that we can use so encapsulating all of this in code would look something like:

```go
package service

import (
	"database/sql"
	"fmt"
)

// DB interface sets out the operations allowed on our database.
type DB interface {
	StartTransaction() (*sql.Tx, error)
	GetUserAccount(tx *sql.Tx, userID string) (Account, error)
	UpdateUserAccount(tx *sql.Tx, userID string, account Account) error
}

// ChargeService carries out the business logic to charge users balances
type ChargeService struct {
	db DB
}

// ChargeUser takes a user ID and an amount then deducts that amount from the
// balance of that user, if they have enough.
func (cs *ChargeService) ChargeUser(userID string, chargeAmount float64) error {
	transaction, err := cs.db.StartTransaction()
	if err != nil {
		return fmt.Errorf("error starting transaction")
	}
	defer func() {
    	_ = transaction.Rollback()
	}()

	account, err := cs.db.GetUserAccount(transaction, userID)
	if err != nil {
		return err
	}
	if account.Balance < chargeAmount {
		return fmt.Errorf("insufficient funds")
	}

	account.Balance = account.Balance - chargeAmount
	err = cs.db.UpdateUserAccount(transaction, userID, account)
	if err != nil {
		return err
	}

	err = transaction.Commit()
	if err != nil {
		return fmt.Errorf("error committing transaction")
	}

	return nil
}
```

Referring back to the cases above we mapped out above, we can see that we have captured the business logic required within our **Domain Service** layer code and now we can add the function call into our handler:

```go
// ChargeUserHandler takes an incoming HTTP POST request and decodes
// the body into a ChargeRequest so that we can carry out charging
// the users balance for the cost of the transaction.
func ChargeUserHandler(w http.ResponseWriter, r *http.Request) {
	var cr ChargeRequest

	err := json.NewDecoder(r.Body).Decode(&cr)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	if cr.UserID == "" {
		http.Error(w, "user id empty", http.StatusBadRequest)
		return
	}

	// New code here
	db := DatabaseAdapter{}
	chargeService := service.ChargeService{db: db}
	err := chargeService.ChargeUser(cr.UserID, cr.Amount)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
	}

	return
}
```

Now, if we deploy this service, when Andre decides to buy a coffee we can be certain that we will meet the requirements set-out in our investigation and be confident our logic is neatly sorted into layers (assuming we have the appropriate level of testing in place). This is a simple use-case but the real question being asked is why.

### Why use Onion Architecture?

But, what are the benefits of using **Onion Architecture**?

It is the contracts between each layer we have defined, also known as the **Dependency Inversion Principle**, which the **Onion Architecture** heavily depends on. As long as our layers adhere to the contracts / interfaces set out in our code, we can utilise them as mentioned in our NoSQL or SQL debate. A picture says a thousand words, let's visualise this:

![https://img.barrymcauley.co.uk/contract.svg](https://img.barrymcauley.co.uk/contract.svg)

Using contracts allows each layer to set its expectations onto the next and couples it to ***only*** what it requires to be. In addition, the implementation specifics of each layer can be refactored at any point as long as they meet their contractual obligations with their neighbours making it easier to respond to changes and increasing the testability of our code.

However, this architecture pattern is not a silver bullet to every problem. As with all software problems, we need to evaluate whether or not we need this additional abstraction as it is more suited for larger applications with many engineers working on them. As engineers we need to apply critical thinking to determine whether or not it will overall benefit the task at hand. Furthermore, the added complexity of defining contracts / interfaces and religiously enforcing them requires a strong understanding of the pattern. If executed well, the benefits will supercharge productivity and greatly increase the flexibility of the applications being developed.

Let me know what you think about Onion Architecture on Twitter and I hope you enjoyed this post. If you like what you see, check me out on my [blog.](https://barrymcauley.co.uk)

Until next time...

BM