text:
# JqueryRailsSlick Demo Apps

Simple Rails apps demonstrating how to use [Slick carousel](https://kenwheeler.github.io/slick/).

* [Rails6Webpacker](https://github.com/bodrovis/jquery-slick-rails-demo/tree/master/Rails6Webpacker) — shows how to use Slick with Webpacker and Rails 6.
* [RailsNoWebpacker](https://github.com/bodrovis/jquery-slick-rails-demo/tree/master/RailsNoWebpacker) — shows how to integrate Slick with [jquery-slick-rails gem](https://github.com/bodrovis/jquery-slick-rails) and how it works with Turbolinks.

## License

Licensed under the [MIT License](https://github.com/bodrovis/jquery-slick-rails-demo/blob/master/LICENSE.txt).

Copyright (c) [Ilya Bodrov](http://bodrovis.tech)

repository: arambulomirta/jquery-slick-rails-demo

repo_name: arambulomirta/jquery-slick-rails-demo


text:
**Inapphelp** is a library to provide in-app support for your app's users. Your app’s users can easily raise requests or report issues from within your app.

With inapphelp, you can:

- Let users report issues within your app, along with device & app information
- Provide self-support by showing FAQ articles
- Customise your Inapphelp screen to blend with your app theme

Library based on  [helpstack.io](http://www.helpstack.io), with some improvments (like push notifications and user interaction logs)

### Getting started with Inapphelp.com

Use Cocoa Pods to install Inapphelp and its dependencies. Inapphelp dependencies include AFNetworking 2.0 and JCNotificationBannerPresenter 1.1.2

	pod 'Inapphelp'

Inapphelp requires Xcode 5.0 targeting iOS 7 and above.

### Configuring Inapphelp

Documentation

## License

MIT license. See the LICENSE file for more info.

license: MIT

repository: apps-m/inapphelp-ios

branch_name: refs/heads/master

extension: md

gha_language: Objective-C

license_type: permissive

repo_name: apps-m/inapphelp-ios


text:
# tesseract-explorer

A friendly interface to explore the contents of a tesseract-olap server.

[![npm package](https://img.shields.io/npm/v/@datawheel/tesseract-explorer.svg)](https://www.npmjs.com/package/@datawheel/tesseract-explorer)

## Installation

```bash
npm install @datawheel/tesseract-explorer
```

This project has some peer dependencies, which must be installed by the used manually:

```bash
npm install react@16 react-dom@16 react-redux@7 redux@4
npm install @blueprintjs/core@3 @blueprintjs/select@3 @blueprintjs/table@3
```

This is to prevent conflicts with hooks implemented in React 16.7, and to allow compatibility with the minor version of blueprintjs the user chooses.

## Usage

This package exports a `React.Component` and a reducer function to add to the redux store. To implement them:

```js
import {explorerReducer} from "@datawheel/tesseract-explorer";

function rootReducer(state = initialState, action) {
  return {
    yourKey: yourReducer(state, action),
    // you can either merge the Explorer state in your root app state
    ...explorerReducer(state, action),
    // or set it in with the "explorer" key
    explorer: explorerReducer(state, action)
  }
}
```

Then you can setup the `Explorer` component like this:

```jsx
import {Explorer as TesseractExplorer} from "@datawheel/tesseract-explorer";

// You must import blueprint's stylesheets too
import "normalize.css/normalize.css";
import<EMAIL_ADDRESS>import<EMAIL_ADDRESS>import<EMAIL_ADDRESS>import<EMAIL_ADDRESS>
// Tesseract Explorer's stylesheets must come after
import<EMAIL_ADDRESS>
function PageComponent(props) {
  return <TesseractExplorer src="https://tesseract.server.url/" />;
}
```

### Customize views

By default, the results obtained by a query can be presented in three views:
- `Data table`, a spreadsheet-like table that shows a fragment of the data
- `Pivot table`, a mini-app where you can export the data in a 2-dimensional matrix
- `Raw response`, a debugging view to get more info about the query and how to replicate it in code

These three views are also exported by this package:

```js
import {DebugView, TableView, PivotView} from "@datawheel/tesseract-explorer";
```

To remove a view or change their order, you can pass a `panels` property to the `Explorer` component:

```jsx
const PANELS = {
  "Results Table": TableView,
  "Pivot Data": PivotView
};

function PageComponent(props) {
  return <TesseractExplorer
    src="https://tesseract.server.url/"
    panels={PANELS}
  />;
}
```

The keys of the object will be used as the name of each tab, and the values are the raw react components. The components are then activated and passed the following properties:

```ts
interface ViewProps {
  cube: OlapClient.PlainCube;
  result: TessExpl.Struct.QueryResult;
  params: TessExpl.Struct.QueryParams;
}
```

This also means the `Explorer` component can be extended with external views that make use of the same interface. You can check how these are composed on [the typing definitions file](./index.d.ts).

### Data locale

If the data server is configured to output data in multiple locales, you can let the user pick the language by passing the `locale` property:

```jsx
function PageComponent(props) {
  return <TesseractExplorer
    src="https://tesseract.server.url/"
    locale={["en", "es"]}
    // The property also accepts a comma-separated string
    locale={"es,en"}
  />;
}
```

The first item in the list will be used by default when the app loads.
The options will be presented in the UI as a selector with the name of the language, and the parameter will be added to the queries.

### UI Localization

By default the user interface will be in English, but you can localize it using the these properties:

```jsx
function PageComponent(props) {
  return <TesseractExplorer
    src="https://tesseract.server.url/"
    translations={translations}
    uiLocale="es"
  />;
}
```

* `translations` must be an object where the keys are the locale codes you intend to make available in the app, and the values are dictionaries that complies with the labels [defined in this file](./src/utils/localization.js).
  This object is also exported by this package so you can check it yourself.
* `uiLocale`, which is not related to the `locale` property mentioned in the earlier section, must be a string matching one of the keys defined in the `translations` property.

When used, both properties are required.
The locale keys used not necesarily must be ISO 639 codes; any string can do, but must match on both properties.

Some translation labels do interpolation of values when used. These are optional, but encouraged, and some can have additional values available:

* `params.current_endpoint` replaces `{label}` with the current kind of endpoint (`"aggregate"` or `"logiclayer"`) if the server is Tesseract OLAP
* `params.label_cube` has the `{name}` and `{caption}` properties of the cube (though `caption` comes from `annotations.caption`)
* `params.label_locale` has `{code}`, `{name}`, and `{nativeName}`, which would match to `"es"`, `"Spanish"`, and `"Español"`, respectively (and these values come from the options passed to `locale`)
* `params.label_topic` and `label_subtopic` replace `{label}` with its respective values from the cube annotations
* `summary_growth`, `summary_rca`, and `summary_topk` allow you to compose a sentence summarizing what each mean:
  - `summary_growth`: `level`, `measure`
  - `summary_rca`: `level1`, `level2`, `measure`
  - `summary_topk`: `amount`, `level`, `measure`, `order`
* Wherever a number is used, the `{n}` tag contains the value, and you can define a label for the singular and plural forms: `key` for the singular, and `key_plural` for the plural.

### Additional formatters

The `formatters` property allows the user to set an index of formatter functions, which transform how the measures are shown in the UI.
To setup custom formatters, pass an object where the key is the name of the formatter, and its value is the function used to format, which must comply with the `Formatter` type: `(value: number) => string`

```jsx
// A good performance optimization is to memoize the object being passed
const formatterIndex = useMemo(() => ({
  Sheep: n => `🐑 ${n.toFixed()}`
}), []);

<TesseractExplorer
  {...}
  formatters={formatterIndex}
/>;
```

The app comes with a limited list of default ones: `Decimal` (1234.567), `Milliards` (1,234.567), `Dollars` ($1,234.57), and `Human` (1.23k).
The key used to select a formatter comes from the `format_template` annotation, and if not present, the `units_of_measurement` annotation in the measure data.
* If the measure contains the `format_template` annotation, it is used to create a custom formatter on runtime. [Check the documentation](https://github.com/d3plus/d3plus-format#readme) for details on how to build and customize a template.
* If the `units_of_measurement` set is an official ISO 4217 currency code (three letters in caps), it will be parsed into a currency formatter using the browser's [`Intl.NumberFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) constructor. Otherwise, the key is looked in the `formatters` property object and in the default formatters list.
* If any of these are present, numbers are presented in Decimal format.

## License

©2018-2021 [Datawheel, LLC](https://datawheel.us/)
This project is made available under the [MIT License](./LICENSE).


text:
# API Docs

## Basic API

```javascript
import { createCostate, co, getState, getCostate, watch, isCostate, hasCostate, remove } from 'costate'
import { useCostate, useCoreducer } from 'costate/react'
```

### createCostate(state) => costate

create co-state by state

### getState(costate) => state

read the latest state from co-state

### getCostate(state) => costate

retrive costate from state derived by costate

### co(arg) => costate | state

combined getState and getCostate

- if `arg` is state, return costate
- if `arg` is costate, return state

### isCostate(arg) => boolean

check if `arg` is a co-state or not

### hasCostate(state) => boolean

check if `state` has corresponding co-state or not

### watch(costate, watcher: state => void) => unwatch

watch a co-state, watcher function will receive state when co-state changed

### remove(costate) => void

remove co-state from its all parents

- if its parent is array, delete array item
- if its parent is object, delete object key

## React-Hooks API

### useCostate(state) => state

return a new state which has corresponding co-state as a implicity property

### useCoreducer((costate, action) => void, initialState) => [state, dispatch]

receive a coreducer(handle co-state and action) and initialState, return state and dispatch function, just like [useReducer](https://reactjs.org/docs/hooks-reference.html#usereducer) without `init` argument.

gha_language: TypeScript

gha_license_id: MIT


text:
meta-jetson
===============

Upstream Linux base Yocto layer for the NVidia Tegra Jetson TK1/TX1 board.
This BSP is not NVIDIA official.  It is a community BSP built with OSS.
This environment is experimental.

Available functions.
  Linux Kernel (with nouveau driver).
  wayland/weston with mesa OpenGL driver.

Supported distros.
  poky (core-image-weston).
  AGL Distro 5.0.

===============

This set of recipes is available under the MIT license.
http://opensource.org/licenses/mit-license.php


text:
# torproxy
### Simple tor proxy exposed as docker containers

1. Check out the repro and start a new proxy with
```docker-compose up```

2. Configure your browser to use proxy on port: 8118

---

3. Shut down the proxy after usage with
```docker-compose down```


text:
# toggle - Simple toggl command line

[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/tebeka/toggle) [![Test](https://github.com/tebeka/toggl/workflows/Test/badge.svg)](https://github.com/tebeka/toggl/actions) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

This is a simple command line to start/stop timers on
[toggl](https://toggl.com/). I scratched an itch, hope you'll find it useful.

## Usage

    $ toggl -h
    usage: toggl start <project>|stop|status|projects|report <since>
	    <project> - project name
	    <since> - YYYY-MM-DD (default to start of today)
      -version
	    show version and exit

You'll need a `~/.togglrc` with your API key and workspace id. See an example [here](togglrc-example) (`timeout` is optional).

## Licence
[BSD](LICENCE)

## Contact, Bugs ...

https://github.com/tebeka/toggl

repository: tebeka/toggl

gha_language: Go

repo_name: tebeka/toggl


text:
# Image Abstraction

This python package creates an abstraction (cartoon) of an image given as input using bilateral filter.

### Prerequisities

Packages required to run the code:

* OpenCV 2.4.11
* Python Numpy
* Python Scipy

## Steps to run the code
* Clone the repository to your machine.
```
cd folder
git clone https://github.com/AadityaVora/image-abstraction
cd image-abstraction
```

* Store the test images in the images folder
* Run the main script from terminal

```
python main.py ./images/image.jpg
python main.py ./images/image.jpg --kernel_size 5 --kernel_sigma [4,2] --q_level 10 --sigmaE 0.5 --phiE 1.0 --T 0.98
```

## Referances

1. Winnemöller, Holger, Sven C. Olsen, and Bruce Gooch. "Real-time video abstraction." ACM Transactions On Graphics (TOG).      Vol. 25. No. 3. ACM, 2006.

2. Tomasi, Carlo, and Roberto Manduchi. "Bilateral filtering for gray and color images." Computer Vision, 1998. Sixth            International Conference on. IEEE, 1998.

repository: lljbash/glamorous

repo_name: lljbash/glamorous


text:
# Value of care - National

## Dataset

| Name | Value |
| :--- | :---- |
| Catalog | [Link](https://catalog.data.gov/dataset/value-of-care-national) |
| Metadata | [Link](https://data.medicare.gov/api/views/gbq5-7hzr) |
| Data: JSON | [100 Rows](https://data.medicare.gov/api/views/gbq5-7hzr/rows.json?max_rows=100) |
| Data: CSV | [100 Rows](https://data.medicare.gov/api/views/gbq5-7hzr/rows.csv?max_rows=100) |
| Host | data.medicare.gov |
| Id | gbq5-7hzr |
| Name | Value of care - National |
| Category | Hospital Compare |
| Tags | hospital compare, medicare payment |
| Created | 2015-09-03T19:00:43Z |
| Publication Date | 2016-12-19T02:16:16Z |

## Description

Value of care displays ? national data. This data set includes national-level data for the value of care displays associated with a 30-day episode of care for heart attack, heart failure, and pneumonia patients.

## Columns

```ls
| Included | Schema Type    | Field Name                 | Name                       | Data Type     | Render Type   |
| ======== | ============== | ========================== | ========================== | ============= | ============= |
| Yes      | series tag     | value_of_care_measure_name | Value of care measure name | text          | text          |
| Yes      | series tag     | value_of_care_measure_id   | Value of care measure ID   | text          | text          |
| Yes      | numeric metric | number_of_hospitals        | Number of hospitals        | number        | number        |
| Yes      | time           | measure_start_date         | Measure start date         | calendar_date | calendar_date |
| No       |                | measure_end_date           | Measure end date           | calendar_date | calendar_date |
```

## Time Field

```ls
Value = measure_start_date
Format & Zone = yyyy-MM-dd'T'HH:mm:ss
```

## Series Fields

```ls
Excluded Fields = measure_end_date
```

## Data Commands

```ls
series e:gbq5-7hzr d:2012-07-01T00:00:00.000Z t:value_of_care_measure_name="Value of Care for heart attack patients - Worse mortality & lower payment" t:value_of_care_measure_id=TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_LOWER m:number_of_hospitals=4

series e:gbq5-7hzr d:2012-07-01T00:00:00.000Z t:value_of_care_measure_name="Value of Care for heart attack patients - Worse mortality & average payment" t:value_of_care_measure_id=TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_AVERAGE m:number_of_hospitals=17

series e:gbq5-7hzr d:2012-07-01T00:00:00.000Z t:value_of_care_measure_name="Value of Care for heart attack patients - Worse mortality & higher payment" t:value_of_care_measure_id=TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_HIGHER m:number_of_hospitals=3
```

## Meta Commands

```ls
metric m:number_of_hospitals p:integer l:"Number of hospitals" t:dataTypeName=number

entity e:gbq5-7hzr l:"Value of care -  National" t:url=https://data.medicare.gov/api/views/gbq5-7hzr

property e:gbq5-7hzr t:meta.view v:id=gbq5-7hzr v:category="Hospital Compare" v:averageRating=0 v:name="Value of care -  National"

property e:gbq5-7hzr t:meta.view.owner v:id=drs7-75yr v:profileImageUrlMedium=/api/users/drs7-75yr/profile_images/THUMB v:profileImageUrlLarge=/api/users/drs7-75yr/profile_images/LARGE v:screenName=cms v:profileImageUrlSmall=/api/users/drs7-75yr/profile_images/TINY v:displayName=cms

property e:gbq5-7hzr t:meta.view.tableauthor v:id=drs7-75yr v:profileImageUrlMedium=/api/users/drs7-75yr/profile_images/THUMB v:profileImageUrlLarge=/api/users/drs7-75yr/profile_images/LARGE v:screenName=cms v:profileImageUrlSmall=/api/users/drs7-75yr/profile_images/TINY v:roleName=administrator v:displayName=cms

property e:gbq5-7hzr t:meta.view.metadata.custom_fields.common_core v:Publisher="Centers for Medicare & Medicaid Services (CMS)"<EMAIL_ADDRESS>v:Contact_Name=CMS v:Bureau_Code=009:38 v:Program_Code=009:078
```

## Top Records

```ls
| value_of_care_measure_name                                                    | value_of_care_measure_id                    | number_of_hospitals | measure_start_date  | measure_end_date    |
| ============================================================================= | =========================================== | =================== | =================== | =================== |
| Value of Care for heart attack patients - Worse mortality & lower payment     | TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_LOWER     | 4                   | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Worse mortality & average payment   | TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_AVERAGE   | 17                  | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Worse mortality & higher payment    | TOT_MORT_30_AMI_WORSE_PAYM_30_AMI_HIGHER    | 3                   | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Average mortality & lower payment   | TOT_MORT_30_AMI_AVERAGE_PAYM_30_AMI_LOWER   | 166                 | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Average mortality & average payment | TOT_MORT_30_AMI_AVERAGE_PAYM_30_AMI_AVERAGE | 1921                | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Average mortality & higher payment  | TOT_MORT_30_AMI_AVERAGE_PAYM_30_AMI_HIGHER  | 240                 | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Better mortality & lower payment    | TOT_MORT_30_AMI_BETTER_PAYM_30_AMI_LOWER    | 12                  | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Better mortality & average payment  | TOT_MORT_30_AMI_BETTER_PAYM_30_AMI_AVERAGE  | 33                  | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for heart attack patients - Better mortality & higher payment   | TOT_MORT_30_AMI_BETTER_PAYM_30_AMI_HIGHER   | 12                  | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
| Value of Care for pneumonia patients - Worse mortality & lower payment        | TOT_MORT_30_PN_WORSE_PAYM_30_PN_LOWER       | 35                  | 2012-07-01T00:00:00 | 2015-06-30T00:00:00 |
```

repository: SpellarBot/open-data-catalog

repo_name: SpellarBot/open-data-catalog


text:
# l02-ex02

-  Status: Final
-  CodePen: <https://codepen.io/chindraba-ga/pen/mdPymwo>
-  Live page: <https://fewd.chindraba.work/lessons/l02-ex02/index.html>

## Contents

-  [Description](#description)
-  [Copyright and License](#copyright-and-license)
   -  [The MIT License](#the-mit-license)

---
## Description

### Lesson 2: Computers Out: CSS Exploration

This example contains a real piece of of a website. Apply all you've learned
with CSS and experiment. Remember, there's more than one right answer!

The starter code was:

#### HTML

    <!doctype html>

        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>AA Sample Page</title>

        <link rel="apple-touch-icon" href="apple-touch-icon.png">
        <link rel="stylesheet" href="main.css">

            News Item

Duis luctus et ipsum et porta Vivamus quis quam sed felis imperdiet pharetra

Author Last Name

June 2016

            News Item

Morbi orci lorem aliquam ultrices magna at

Author Last Name

June 2016

            News Item

Fusce ac mollis sapien

Author Last Name

June 2016

Content TBD. Proin vehicula varius aliquet. In ut aliquet nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque laoreet rutrum tincidunt. Maecenas non ullamcorper ipsum. Ut ut velit a justo porttitor posuere ut posuere lacus. Cras id vehicula tortor, a tincidunt ligula. Pellentesque sed semper sapien.

Content TBD. Proin vehicula varius aliquet. In ut aliquet nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque laoreet rutrum tincidunt. Maecenas non ullamcorper ipsum. Ut ut velit a justo porttitor posuere ut posuere lacus. Cras id vehicula tortor, a tincidunt ligula. Pellentesque sed semper sapien.

Content TBD. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dolor elit, facilisis in justo in, faucibus aliquet dolor. Suspendisse eget lacus felis. Nullam convallis massa vel sem porta efficitur ut sit amet lorem. Morbi auctor pellentesque lectus in elementum. Donec feugiat ex tellus, ac placerat leo hendrerit at. Morbi porttitor sapien vel purus faucibus, lacinia ultricies dui dapibus. Donec elementum, massa vitae volutpat hendrerit, sem neque ornare risus, a suscipit lacus tellus eu turpis.

#### CSS

    /* Just one way you could style things */

    .aa {
    background-color: #292929;
    padding: 30px;
    }

    .hp-news-category {
    display: block;
    font-size: 18px;
    text-transform: uppercase;
    font-family: Arial, sans-serif;
    font-weight: bolder;
    line-height: 1;
    color: #fff;
    }
    .hp-news-title {
    font-size: 48px;
    line-height: 1;
    margin: 5px 0;
    font-weight: lighter;
    color: #fff;
    }

    .hp-news-author, .hp-news-date  {
    color: #fff;
    text-transform: uppercase;
    font-family: sans-serif;
    line-height: .1;
    }

    img {
    width: 100%;
    }

[TOP](#contents)

---
## Copyright and License

Copyright © 2020  Chindraba (Ronald Lamoreaux)

<[upskill@chindraba.work](mailto:upskill@chindraba.work?subject='l02-ex02')>

— All Rights Reserved

### The MIT License

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE MENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.

[TOP](#contents)

branch_name: refs/heads/main


text:
# 1623 - Minimal Distance In The Array (E)

* Author: Jinghua Zhu<EMAIL_ADDRESS>* Tag: Binary Search
* Difficulty: Easy
* Link: https://www.lintcode.com/problem/minimal-distance-in-the-array/description

## Description
----
Given two integer arrays a and b,please find the number in a with the minimal distance between corresponding value in b (the distance between two numbers means the absolute value of two numbers), if there are several numbers in a have same distance between b[i],just output the smallest number.

Finally, you should output an array of length b.length to represent the answer.

## Example
----
Example 1:
```
Input: a = [5,1,2,3], b = [2,4,2]
Output: [2,3,2]
Explanation:
b[0]=2,2 is the number who has the minimal distance to 2
b[1]=4,3 and 5 have the same distance to 4,output 3 because 3 is smaller
b[2]=2,as well as b[0]
```

Example 2:
```
Input: a = [5,3,1,-1,6], b = [4,8,1,1]
Output: [3,6,1,1]
Explanation:
b[0]=4, 3 and 5 have the same distance to 4,output 3 because 3 is smaller
b[1]=8, 6 is the number who has the minimal distance to 8
b[2]=1, 1 is the number who has the minimal distance to 1
```

## Solution
----
### Java
```java
public class GetMinDistanceInArray {
	/**
     * @param a: array a
     * @param b: the query array
     * @return: Output an array of length `b.length` to represent the answer
     */
    public int[] minimalDistance(int[] a, int[] b) {
        if (a == null || b == null || a.length == 0)
        	return null;
        int[] result = new int[b.length];
        Arrays.sort(a);
        for (int i = 0; i < b.length; i++)
        	result[i] = getMinDistance(a, b[i]);

        return result;
    }

    private int getMinDistance(int[] a, int target) {
    	int low = 0, high = a.length - 1;
    	while (low + 1 < high) {
    		int mid = (high - low) / 2 + low;
    		if (a[mid] == target)
    			return a[mid];
    		if (a[mid] > target)
    			high = mid;
    		else
    			low = mid;
    	}
    	int d1 = target - a[low], d2 = high - a[target];
    	if (d1 < 0)
    		d1 = d1 * (-1);
    	if (d2 < 0)
    		d2 = d2 * (-1);

    	return d1 <= d2 ? a[low] : a[high]; // <= not <
    }
}
```

repository: jinghzhu/CrackAlgorithm

repo_name: jinghzhu/CrackAlgorithm


text:
---
layout: default
---

# 1995-12-26 - Re: Assault presses with cop killer computers.

## Header Data

From<EMAIL_ADDRESS>(tallpaul)

To: Kevin L Prigge<EMAIL_ADDRESS>Message Hash: 070ea5a765052d1206c386bf2b9b14e2134e551d6b8f3fc3427b58e79ed36d52

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-12-26 21:30:18 UTC

Raw Date: Wed, 27 Dec 1995 05:30:18 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(tallpaul)
Date: Wed, 27 Dec 1995 05:30:18 +0800
To: Kevin L Prigge<EMAIL_ADDRESS>Subject: Re: Assault presses with cop killer computers.
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Dec 25, 1995 23:36:00, 'Kevin L Prigge<EMAIL_ADDRESS>wrote:

>According to rumor, James A. Donald said:
>>
>> While channel surfing around 6PM today on Christmas day, I saw
>> President Clinton announce the grave international threat
>> posed by terrorists, drug dealers and money launderers wielding
>> computers (Only three horsemen -- he left out child pornographers.)
>
>Probably because child pornographers have been dealt with in
>the recent bill signed by Bill, which mandates 24-30 months
>for transmitting child porn, double if a computer is used.
>

see Reuters, "Clinton acts to tougher penalties" 23 Dec 95 08:40
clari.news.crime.sex
Message-ID<EMAIL_ADDRESS>
see AP, "Clinton signs porn bill," 23 Dec 95 09:40
clari.news.crime.sex
Message-ID<EMAIL_ADDRESS>
What is most interesting is how far the four horsemen have rampaged and the
destruction they have already done.

The internet is not the *least* regulated as those pushing for "tougher
penalties" claim. One can argue, using the new federal doubling of prison
terms when computers are used, that it is the *most* regulated.

One can also see how far the combination of sexual hysteria and fear of new
technology has fed into and been used by politicians from throughout the
political spectrum.

It also shows how much of the government threat to privacy is a social, not
a technological, issue.

While people argue about heat-death-of-the-universe encryption algos, a
different form of hot air is producing the heat death of civil liberties.

While cyber-libertarians talk about how strong crypto algos are needed to
protect property and how "the statists in Washington" are trying to take
away their crypto, right-wing pro-capitalist politicians have already taken
away civil liberties.

While crypto-radicals talk about how strong crypto algos are needed to lead
the revolution and how "the nazis in Washington" are trying to take away
their crypto, sexual hysterics calling themselves "radical feminists" have
already helped take away many civil liberties.

I support strong crypto. I support powerful and secure algos. I see it as a
wonderful development of technology to protect individual privacy.

But privacy is only one right of the citizen; it is only one of the many
civil liberties under attack.

I am also disturbed by the number of discussions on the list that may be on
topic but avoid *these* social issues, E.G.

     Army vs. Navy Captain?
     how cheap is AT&T?
     Bizdos: confused executive vs. conspiratorial swine?
     Are CFS programmers being treated nicely?
     Fred Cohen: nice guy victim or swine?
     Why Alice should use PGP.

Ever heard of bit fiddlin' while Rome burns?

--tallpaul

{% endraw %}
```

## Thread

+ Return to [December 1995](/archive/1995/12)

+ Return to<EMAIL_ADDRESS>(tallpaul)](/authors/tallpaul_at_pipeline_com_tallpaul_)"

+ 1995-12-26 (Wed, 27 Dec 1995 05:30:18 +0800) - Re: Assault presses with cop killer computers. -<EMAIL_ADDRESS>(tallpaul)_


text:
# Transformer Loading Process and Analysis

The goal of this application is to find transformers which are overloaded and
recommend the appropriate sized transformer.

## TODO

- Move the code to R Markup or Jupyter Notebook so we can show the charts.  T
- The process / code samples here generates data which can be visualized.

## Requirements

- kW ,Power Factor, abd/or kVA per hour (Intervals for one hour is the only supported data interval)
- MDM.dbo.Transformer.PhaseCount: Tranformer Phases to determine correct sized transformer.
- MDMTLA.dbo.TLAInventory: List of Transformer Sizes by Phase for the Utility (stocked in warehouse)
- Temperarture in F

## Calculating Overloaded Transformer

### Steps

Adhoc List for Analysis

- Create the Allowable Loading Matrix with default values
- Set the interval prior and post fitler to 12 hours
- Pull a list of Transformers from the MDM or MDMTLA.dbo.TLAHeader table
- Collect the min, max, average, sum for kVA
- Collect the min, max for ReadDate (This lets us log the fitler or date range)
- Collect the date of the kVAmax and the ambient temperature of that hour. Note, we will take the latest hour if the kVAmax occurs more than once.
- Convert the temperature from F to C
- Calculate the temperature multipliers for the Allowable Loading Matrix
- Calculate the Root Mean Square (RMS) for the prior and post load

Additional Notes

- For predicting the future load a transformer can carry at some future time in unknown ambient
- You use the average daily temperature for the month involved, average over several years
- You can also use the average of the maximum daily temperatures for the month involved averaged over serveral years
- Temperature in F for the max kW read, where do we get this?
- Code for temperature ... to adjust allowable load matrix
- If the load duration spans more than 1 hour this should be the average temperature right???????
- Instead of the temperature at the peak

Adjustments for Chart:
-1.5% for each degree above 30°C
+1.0% for each degree below 30°C

Valid for altitudes up to 3000 meters
Above 3000 meters
-.4% for every 100m above 3000m for ONAN
-0.5% for every 100m above 3000m for ONAF

Example Code Block - Not Production Ready

```sql
    SET @AmbientAvgTemperatureC = (@AmbientAvgTemperatureF - 32) * 5/9
    SET @TemperatureBelowThirtyMultiplier = (30 - @AmbientAvgTemperatureC)
    SET @TemperatureAboveThirtyMultiplier = (@AmbientAvgTemperatureC - 30)

    -- Set negative values to zero for the equation
    IF (@TemperatureBelowThirtyMultiplier < 0)
    BEGIN
        SET @TemperatureBelowThirtyMultiplier = 0
    END
    IF (@TemperatureAboveThirtyMultiplier < 0)
    BEGIN
        SET @TemperatureAboveThirtyMultiplier = 0
    END

    -- multiply by 100 to show the percentage value
    UPDATE @AllowableLoading
        SET
        Fifty = (Fifty*100 + ((-1.5* @TemperatureAboveThirtyMultiplier) + (1 * @TemperatureBelowThirtyMultiplier))),
        SeventyFive= (SeventyFive*100 + ((-1.5* @TemperatureAboveThirtyMultiplier) + (1 * @TemperatureBelowThirtyMultiplier))),
        Ninety= (Ninety*100 + ((-1.5* @TemperatureAboveThirtyMultiplier) + (1 * @TemperatureBelowThirtyMultiplier)))
```

Find the Load Duration for the kVAmax

- Mark all values as over or under the kVARating
- Check to see if these values are near the kVAmax
- Collect the Read Date min and max for values where kVA is greating than the kVARating
- These values may contain irregular results is the first hour of the day (Hour 0) is over the kVARating, but the Load Duration occurs during the middle of the day.
- We can clean these bad values up later in the process

Collect the kVA data for the min and max Load Duration, the hour which are the start and end of the load duration

- Start creating the data needed to calculate the Root Mean Square (RMS) for the Equivalent Load to compare to the Actual Load
- Add new column to square the kVA, we will use kVA in the RMS.
- Weed out duplicate values - Note this first pass only groups the data up instead of choosing the latest header id - Need to revisit the de-dupe process

Calculate the Load Duration

- Load Duration will be the start of the load and the end of the load with a peak in the middle
- Note, this has issues which need to be reviewed ... so we can see if Tranformer like OH65567491004 affect the results

Calculate the  ActualLoadingPercentage

- @kVAmax / @KVARating)*100

Calculate the RMS for the EquivalentContinuousPriorLoad and EquivalentContinuousPostLoad

- EquivalentContinuousPriorLoad will be the 12 hours before the load duration starts, or at least an attempt to collect what hours we have available before the load duration.
- EquivalentContinuousPostLoad will be the 12 hours after the load duration ends, or at least an attempt to collect what hours we have available after the load duration.
- We should develop a limit which allows us to drop out of the calculation when we are missing too much data

Additional Notes

- Root Mean Square to calculate the loading over 12 hours, what happens if we don't have 12 hours?
- IEEE pdf which references RMS
- https://en.wikipedia.org/wiki/Root_mean_square
- Equivalent Pre Loading Calculation
- Equivalent Post Loading Calculation

Example

 ```sql

    SELECT @EquivalentContinuousPriorLoad = SUM(kVaSqaured)/COUNT(*)
    FROM #finalresults
    WHERE ReadDate < @DateMinLoadDuration

    SELECT @EquivalentContinuousPriorLoadIntervalCount = COUNT(*)
    FROM #finalresults
    WHERE ReadDate < @DateMinLoadDuration

    -- Should this be a columns too???
    SELECT @EquivalentContinuousPriorLoad = SQRT(@EquivalentContinuousPriorLoad)

    SELECT @EquivalentContinuousPostLoad= SUM(kVaSqaured)/COUNT(*) FROM #finalresults
    WHERE ReadDate > @DateMaxLoadDuration

    SELECT @EquivalentContinuousPostLoadIntervalCount = COUNT(*) FROM #finalresults
    WHERE ReadDate > @DateMaxLoadDuration

    --Should this me a column too?
    SELECT @EquivalentContinuousPostLoad = SQRT(@EquivalentContinuousPostLoad)

```

- Pick the max value from EquivalentContinuousPriorLoad and EquivalentContinuousPostLoad
- The max value will be used to choose the column value from the Allowable Loading Matrix

```sql

   SELECT @EquivalentContinuousMaxLoad =  MAX(val)
   FROM
    (SELECT @EquivalentContinuousPriorLoad AS val
     UNION ALL SELECT @EquivalentContinuousPostLoad AS val
    ) tbl

   SELECT @EquivalentContinuousMaxLoad = (@EquivalentContinuousMaxLoad / MAX(KVARating)) * 100
   FROM #finalresults

 ```

### Example of the Allowable Loading Matrix

**Example Table @ 30 C values*

| DurationHrs | Fifty    |  SeventyFive | Ninety  | DiffToNextValue|
|-------------|----------|--------------|---------|---------------:|
| 1           | 212.0 | 196.0    | 182.0 | 1              |
| 2           | 179.0 | 168.0    | 157.0 | 2              |
| 4           | 150.0 | 144.0    | 136.0 | 2              |
| 6           | 134.0 | 131.0    | 126.0 | 2              |
| 8           | 128.0 | 125.0    | 121.0 | 4              |
| 12          | 122.0 | 119.0    | 117.0 | 4              |
| 16          | 117.0 | 115.0    | 113.0 | 4              |
| 20          | 113.0 | 111.0    | 110.0 | 4              |
| 24          | 108.0 | 107.0    | 107.0 | 4              |

Why are 75 and 90 % both 107 for hour 24?  Glitch in the matrix?

Set by the IEEE Document

- Duration In Hours
- 50% Loading
- 75% Loading
- 90% Loading

Difference to next value is used to help choose the correct bucket to choose when comparing the ActualLoadingPercentage to AllowableLoadingPercentage.

When EquivalentContinuousMaxLoad <= 50, then 50
When EquivalentContinuousMaxLoad > 50 AND EquivalentContinuousMaxLoad <= 75 , then 75
When EquivalentContinuousMaxLoad > 75 then 90

- Compare the ActualLoadingPercentage and the AllowableLoadingPercentage in the matrix
 -- Use the Load Duration in Hours to choose the y value
 -- Use the EquivalentContinuousMaxLoad to choose the x column
 -- The AllowableLoadingPercentage is the value defined.

When ActualLoadingPercentage is greater than AllowableLoadingPercentage, the transformer is overloaded.

## Resizing the Transformer

Steps

- Need to know the phases single, two, three phase for the transformer
- Need to know what the current tranformer kVARating is
- Need to know what transformers and phases the utiltity has in stock
- Once we detect the transformer is undersized just re-use the values to pick a transformer

Example List of Transformers and Predicted Loading

- Variables
 -- kVAmax = 164.366
 -- kVA Rating - current is 112
 -- AllowableLoadingPrecentage for the peak and temp is 131.39 %

Results Table Example
kVa Transformer, Predicted Loading

112, (kVAmax / 150 ) * 100  = 145.95% is higher than the AllowableLoadingPrecentage,
...
150, (kVAmax / 150 ) * 100  = 109.58%, is lower than the AllowableLoadingPercentage
225, (kVAmax / 150 ) * 100  = 73.05%, is lower than the AllowableLoadingPercentage
...

## TLALoadingAnalysis Results Table

**This table is alpha stage and columns might be added and removed*

- Stores one record for each transformer.
- Data is removed with each analysis run and updated.
- History is not kept, since data might be incorrect and need to be re-calculated on each import.

If for the data in the TLAReadHeader table has duplicate TransfomerIDentifier(s) for more than one TransfomerId
the last TransformerIDentifier we iterate over will be saved.

### Column Descriptions

#### TransformerID

Primary key from MDM.dbo.Transformer table, right?  MDMTLA has not data dictionary which describes this field.  Or is this from the MDMVMD database?

#### TransformerIDentifier

Identifier from MDM.dbo.Transformer.TransformerIdentifier typically similar to a LocationName or Key identifier in another database. Or is this from the MDMVMD database????

#### TransformerName

Name from MDM.dbo.Transformer table...??????????

#### LocationNumber

The location number which relates back to a map point, see MDM.dbo.Locations

#### SubstationName

The name of the substation which is upstread of the transformer, see MDM.dbo.Substation.

#### FeederName

The name of the Feeder which is upstream of the transformer.

#### kVAmin

The minimum kVAReadValue for the analysis range.

#### kVAmax

The maximum kVAReadValue for the analysis range.

### kVAsum

The total kVA summed up. This value can be used to help determine when we have kVAsum of zero that
all the values we have collected are also zeros, indicating an issue with the data.

#### kVAavg

The average or mean kVAReadValue for the analysis range.

Average can be mis-leading and SQL Server really needs a way to calculate the median value. What we try and observe is the mean and the median are close in value.  When mean and median differ we know the data is skewed, having lots of small values on some very few large values.

#### kVAmaxDate

The max date for the max kVAReadValue for the analysis range.
The Read Date the kVA max value occured on, sort by most recent at the top.  So this read date will bethe most recent date if the max value occurs more than once in the dataset

During testing we discovered kVA max values of zeros.

#### DateMin

Minimum date for the analyis range.

#### DateMax

Maximum date for the analyis range.

Storing the min and max date range allows the user to see the timeframe this
data has been in service.  The range could be days or years which affects the results.  The longer the time frame
the better the analysis will be since we have more opportunities over the years to see a true max peak, rather
than date existing just during the spring.

#### kVARating

KVA Rating for the Transformer, which is dependant on the number of phases a transformer supports.

#### PhaseCount

Represents the number of phases a tranformer supports.  Typically a transformer will support
single, two, and three phases represented with an interger (1,2,3).  When determining the correct transfomer
we need to determine the number of phases currently supported.

If no match can be made this value can be NULL.

#### EquivalentPeakLoad (NOT USED)

Equivalent peak load for the usual load cycle is the rms load obtained by Equation(5) for the limited period over which the major part of the actual irregular peak seems to exist. The estimated duration of the peak has considerableinfluence over the rms peak value. If the duration is over-estimated, the rms peak value may be considerably below the maximum peak demand. To guard against overheating due tohigh brief overloads during the peak overload,

The RMS value for the peak load period should not be less than 90% of the integrated 1/2 h maximum demand.

#### EquivalentContinuousPriorLoad

Root Mean Squaure of the intervals occuring no more than 12 hours before the start of the load duration.

The equivalent continuous prior load is the RMS load obtained by over a chosen period of the day. Experience indicates that quite satisfactory results are obtained by considering the 12 hour periods preceding and following the peak and by selecting the larger of the two rmsvalues so produced.

#### EquivalentContinuousPriorLoadIntervalCount

Actual number of intervals collected, which should be 12 hourly intervals before the start of the load duration (DateMinLoadDuration).

> COUNT(ReadDate))

#### EquivalentContinuousPostLoad

Root Mean Squaure of the intervals occuring 1 to 12 hours afer the end of the load duration. See the above notes on EquivalentContinuousPriorLoad.

> SQRT(SUM(kVaSqaured)/COUNT(ReadDate))

#### EquivalentContinuousPostLoadIntervalCount

Actual number of intervals collected, which should be 12 hourly intervals after the end of the load duration (DateMaxLoadDuration).

> COUNT(ReadDate))

#### EquivalentContinuousMaxLoad

The max value of EquivalentContinuousPriorLoad and EquivalentContinuousPostLoad AND divided by the kVA Rating multiplied by 100

> (@EquivalentContinuousMaxLoad / MAX(KVARating))*100

#### AmbientTemperatureF

Fahrenheit: The current temperature in F for the max kVA read value.

#### AmbientTemperatureC

Celsius: The temperature in AmbientTemperatureF converted to celsius.

#### TemperatureBelowThirtyMultiplier

> (30 - Tc), where Tc is the current temperature in celsius below 30C.

*Hey is there a flaw here, what happens when temp is negative?*

Adjustments for Chart:
-1.5% for each degree above 30°C
+1.0% for each degree below 30°C

Testing the calculation:

```sql
SELECT DISTINCT t.TemperatureF INTO #ConversionTest
from MDM.dbo.Temperature t

-- SET @AmbientTemperatureC = (@AmbientTemperatureF - 32) * 5/9
-- SET @TemperatureBelowThirtyMultiplier = (30 - @AmbientTemperatureC)
-- SET @TemperatureAboveThirtyMultiplier = (@AmbientTemperatureC - 30)

SELECT
     TemperatureF F
    ,((TemperatureF - 32) * 5/9) Celsius
    ,CASE WHEN (TemperatureF - 32) * 5/9 > 30 THEN (((TemperatureF - 32) * 5/9) - 30)
        ELSE (30 - ((TemperatureF - 32) * 5/9))
    END As Multiplier
FROM #ConversionTest
ORDER BY 2 ASC

DROP TABLE #ConversionTest

```

What we need to check is the negative values create the correct multiplier.

F, Celsius, Multiplier
-2.4, -19.111111, 49.111111
86.0, 30.000000, 0.000000
95.0, 35.000000, 5.000000

Since we are below 30C, that is 30 + 19.1111 = 49.111111.  All is good.

#### TemperatureAboveThirtyMultiplier

> (Tc - 30), where Tc is the current temperature in celsius above 30C.

Adjustments for Chart:
-1.5% for each degree above 30°C
+1.0% for each degree below 30°C

#### DateMinLoadDuration

The point to the left of the kVAMax where the load duration begins. Used to help determine the Load Duration.

#### DateMaxLoadDuration

The point to the right of the kVAMax where the load duration ends. Used to help determine the Load Duration.

#### LoadDurationHours

Total lenght in hours of the load duration where the peak occurs.  We will
attempt to define the load duration where the kVA read value increases above the kVA rating
and ends where the last kVA rating is above the kVA rating.  Note during testing we found we
can have multiple peaks during a day (24 hr timespan) which can affect the LoadDurationHours.
Need more test cases to see how LoadDurationHours will affect the overall results in the Allowable Loading Matix.

#### AllowableLoadingPercentageColumn

The column 50, 75, 90 value we map our values to when determining if the transformer is overloaded. The columns (50,75,90)are choosen based on the RMS calculations max values for the prior load and post load percentages.

#### AllowableLoadingPercentage

The allowable load which is the max load acceptable for a Transformer for a period of time, determined by choosing the appropirate value from the Allowable Loading Matrix adjusted for temperature and altitude.

#### ActualLoadingPercentage

Calculation:

> (@kVAmax / @KVARating) * 100, value stored is stored as a percentage.

#### TransformerRatingPredictedChoice

The size of our new transfomer in kVA choosen by the algorithm.
The transformer should be a large transformer size if the transformer AllowableLoadingPercentage is lower
than the ActualLoadingPercentage.  The transformer should be a smaller value if the ActualLoadingPercentage and lower than the AllowableLoadingPercentage.  This value should be in the MDMTLA.dbo.TLAInventory.

If no match can be made this value can be NULL.

#### TransformerRatingPredictedLoadingPercentage

The predicited percentage for the new transfomer sized in TransformerRatingPredictedChoice.

Calculation:

> (@kVAmax / NEW @KVARating) * 100.

If no match can be made this value can be NULL.

#### CreatedDate

The date the process was ran in local time of the database server.

-- Root Mean Square to calculate the loading over 12 hours, what happens if we don't have 12 hours?????
-- IEEE pdf which references RMS
-- https://en.wikipedia.org/wiki/Root_mean_square
-- need mark up to show the math equation, for reference Equation 5, in IEEE Guid for Loading
-- Mineral-Oil-Immersed Trabsformers and Step-Voltage Regualtors

## Interesting Queries

Below are a set of queries used to initital review the data to check for inconsistencies.

*Using 'SELECT *' for brevity and place emphasis on the filter*

### Actual Number of Transformers

```sql
SELECT COUNT (DISTINCT TransformerIdentifier)
FROM MDMTLA.dbo.TLAReadHeader

$ 435
```

```sql
SELECT COUNT (TransformerIdentifier)
FROM MDMTLA.dbo.TLALoadingAnalysis

$ 435
```

### Transformers Analysis based on over sized vs under sized

Note, this query has flaws but does a quick job summarizing results for a quick reivew.
The flaws are because we have NULLS withing the data currently.

```sql
SELECT
    COUNT(*)
    ,CASE WHEN ActualLoadingPercentage > AllowableLoadingPercentage THEN 1
     ELSE 0
END AS IsOverLoaded
FROM MDMTLA.dbo.TLALoadingAnalysis
    GROUP BY
        CASE WHEN ActualLoadingPercentage > AllowableLoadingPercentage THEN 1
            ELSE 0
        END

$ count, IsOverLoaded
$ 225, 0
$ 210, 1
```

Note, we have the same number of TransformerIdentfiier's.

### Transformers which are over sized

A transformer which is over sized can be switched out for a smaller transformer.

The results of these two queries suggest we need more work on analysis on the data and the calculations.

```sql
SELECT *
FROM MDMTLA.dbo.TLALoadingAnalysis
WHERE TransformerRatingPredictedChoice > kVARating
ORDER BY TransformerRatingPredictedLoadingPercentage DESC

SELECT *
FROM MDMTLA.dbo.TLALoadingAnalysis
WHERE ISNULL(AllowableLoadingPercentage,0) <= ActualLoadingPercentage
```

OR

```sql
SELECT *
FROM MDMTLA.dbo.TLALoadingAnalysis
WHERE ActualLoadingPercentage > AllowableLoadingPercentage
ORDER BY TransformerRatingPredictedLoadingPercentage DESC
```

### Additional Checks Needed

- Scan all columns for NULLS
- Scan all columns for max and mins when numbers exist to check for values which are too large or too small.
 -- Multipliers too large, indicating issues with calculation or temperatures
 -- Percentages in the high 100s or 1000s
- You know do it all by hand which other languges already do as a standard practice.
- On and On...

Flaw - None of the Transformers stayed the same size, either the transformer went down a size or increased by a size.  Hmm?

```sql

SELECT * FROM MDMTLA.dbo.TLALoadingAnalysis
WHERE kVARating = TransformerRatingPredictedChoice

```

## References

- IEEE Guide for Loading Mineral- Oil-Immersed Transformers and  Step-Voltage Regulators, add Url or location to pdf.
- Life and Loading of Transformers power point, add url or location to pptx.
- https://en.wikipedia.org/wiki/Root_mean_square

repository: craignicholson/TransformerLoading

repo_name: craignicholson/TransformerLoading


text:
---
layout: post
title: "iOS 8: Tips, Tricks, and Details | MacStories"
date: 2014-09-18 11:58:23 +0200
comments: true
categories:
- Digital Life
- Apple
external-url: http://www.macstories.net/roundups/ios-8-tips-tricks-and-details/
---

Apart from the excellent, full [review of iOS 8 by Federico Viticci](http://www.macstories.net/stories/ios-8-changed-how-i-work-on-my-iphone-and-ipad/), the team at MacStories have put together an awesome guide to help people out with the transition:

> iOS 8 is, by any measure, a big update. A lot of it is refinement to last year's drastic design overhaul, but there are also a lot of notable new features. Sitting amongst those refinements and big new features are little nuggets of delight in which Apple has designed or implemented something (whether it be a feature, design flourish or a shortcut) that you might not notice until one day you stumble upon it accidentally.

Great, great work, as usual.

Also, don't miss the extended coverage they're doing of some of the most interesting iOS 8-optimized apps we're seeing so far. Some of them include:

* [1Password 5](http://www.macstories.net/reviews/1password-5-for-ios-8-review/)

* [Instapaper 6.0](http://www.macstories.net/reviews/instapaper-6-0-review/)

* [Transmit for iOS 8](http://www.macstories.net/reviews/transmit-for-ios-8-review/)

And there's more. You could easily spend your whole day [at MacStories](http://www.macstories.net) today, and it would be worth it.

repository: analogsenses/source

extension: markdown

repo_name: analogsenses/source


text:
# Building

To build container:

```
docker build -t nildev/api-builder:latest .
docker build -t quay.io/nildev/base_builder:latest .
```

# How to use

Get `nildev` tool:
```
go get github.com/nildev/tools/cmd/nildev
```

Build container:
```
nildev build github.com/nildev/account
```

repository: Terabitas/api-builder

repo_name: Terabitas/api-builder


text:
---
layout: default
---

# 1996-11-20 - The NSA Responds

## Header Data

From: se7en<EMAIL_ADDRESS>To: DC-Stuff List<EMAIL_ADDRESS>Message Hash: 4cf38f3b5462b62e1add82c43f967982a62d8e4fee4345b0c9d267214b890753

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-11-20 02:08:54 UTC

Raw Date: Tue, 19 Nov 1996 18:08:54 -0800 (PST)

## Raw message

```
{% raw  %}From: se7en<EMAIL_ADDRESS>Date: Tue, 19 Nov 1996 18:08:54 -0800 (PST)
To: DC-Stuff List<EMAIL_ADDRESS>Subject: The NSA Responds
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

The NSA responded to a series of 14 questions posed to them by the
Houston Chronicle regarding their involvement and interest in cryptography.
While this article is not recent, it is still very interesting.

Because of the size, I have not posted it here. It can be found at:

http://www.dis.org/se7en/    and click the on "The NSA"

The question list is:

1. Has the NSA ever imposed or attempted to impose a weakness on any
cryptographic code to see if it can thus be broken?

2. Has the NSA ever imposed or attempted to impose a weakness on the DES
or DSS?

3. Is the NSA aware of any weaknesses in the DES or the DSS? The RSA?

4. Has the NSA ever taken advantage of any weaknesses in the DES or the
DSS?

5. Did the NSA play a role in designing the DSS? Why, in the NSA's
analysis, was it seen as desirable to create the DSS when the apparently
more robust RSA already stood as a de facto standard?

6. What national interests are served by limiting the power of
cyptographic schemes used by the public?

7. What national interests are served by limiting the export of
cryptographic technology?

8. What national interests are at risk, if any, if secure cryptography
is widely available?

9. What does the NSA see as its legitimate interests in the area of
cryptography?  Public cryptography?

10. How did NSA enter into negotiations with the Software Publishers
Association regarding the export of products utilizing cryptographic
techniques? How was this group chosen, and to what purpose? What statute
or elected representative authorized the NSA to engage in the
discussions?

11. What is the status of these negotiations?

12. What is the status of export controls on products uing cryptographic
techniques? How would you respond to those who point to the fact that
the expot of RSA from the U.S. is controlled, but that its import into
the U.S. is not?

13. What issues would you like to discuss that I have not addressed?

14. What question or questions would you like to pose of your critics?

se7en

{% endraw %}
```

## Thread

+ Return to [November 1996](/archive/1996/11)

+ Return to "[se7en <se7en@dis.org>](/authors/se7en_se7en_at_dis_org_)"

+ 1996-11-20 (Tue, 19 Nov 1996 18:08:54 -0800 (PST)) - The NSA Responds - _se7en<EMAIL_ADDRESS>


text:
CoffeeScriptCompiler
===========================

CoffeeScript compiler plugin for Codiad-IDE.

This plugin compiles the current CoffeeScript file on each save and gives you some
hints if the file could not be saved due to compilation issues.

See http://coffeescript.org/ for the CoffeeScript compiler.

Also integrates coffeelint to inform the user about bad pieces of code.
See http://www.coffeelint.org/ for details of coffeelint.

Compilation and Linting is completely done in the browser, so there are no further dependencies.

Update 2016/04/17:
==================
fixed an initialization issue

Update 2015/11/09:
==================
updated CoffeeScript compiler to 1.10.0

Update 2014/09/28:
==================
updated CoffeeScript compiler to 1.8.0

Update 2014/01/23:
==================

Integrated a settings dialog to edit settings.
Enabled SourceMaps by default.
Integrated CoffeeScript header to generated source files

Update 2014/01/12:
==================

I just translated the developed javascript code to CoffeeScript.
We are talking about a CoffeeScript compiler integration here,
so it's useful to provide the sourcecode of this plugin also written in CoffeeScript. ;-)

License
=======

The MIT License (MIT)

Copyright (c) 2013 dev-rke

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: dev-rke/Codiad-CoffeeScriptCompiler

repo_name: dev-rke/Codiad-CoffeeScriptCompiler


text:
# Image Search Abstraction Layer

This app was created for a [freecodecamp.com challenge](http://www.freecodecamp.com/challenges/image-search-abstraction-layer) from [Clementine.js](http://www.clementinejs.com/) boilerplate.

## License

MIT License. [Click here for more information.](LICENSE.md)

repository: roelver/imgsearch-micro

repo_name: roelver/imgsearch-micro


text:
# Fluent Assertions for JUnit 5

[![Build Status](https://secure.travis-ci.org/toberkoe/fluent-assertions.png)](http://travis-ci.org/toberkoe/fluent-assertions)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=de.toberkoe%3Afluent-assertions&metric=coverage)](https://sonarcloud.io/dashboard?id=de.toberkoe%3Afluent-assertions)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=de.toberkoe%3Afluent-assertions&metric=alert_status)](https://sonarcloud.io/dashboard?id=de.toberkoe%3Afluent-assertions)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.toberkoe/fluent-assertions/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.toberkoe/fluent-assertions)

Set of Fluent Assertions for Unit Tests.
Inspired by [FEST Fluent Assertions 2.x](https://github.com/alexruiz/fest-assert-2.x).

## Latest release

The most recent release is [fluent-assertions 0.5][current release], released 2018-04-12.

The Maven group ID is `de.toberkoe`, and the artifact ID is `fluent-assertions`. Use
version `0.5` for the current version.

To add a dependency on fluent-assertions using Maven, use the following:

```xml
<dependency>
  <groupId>de.toberkoe</groupId>
  <artifactId>fluent-assertions</artifactId>
  <version>0.5</version>
  <scope>test</scope>
</dependency>
```

To add a dependency using Gradle:

```
dependencies {
  testImplementation 'de.toberkoe:fluent-assertions:0.5'
}
```

## Examples
Use ```de.toberkoe.fluentassertions.api.Assertions#assertThat``` as entry point for type-specific fluent assertions.
To make tests more readable, it is recommended to access this class as a static import.

```java
import static de.toberkoe.fluentassertions.api.Assertions.assertThat;
...

List<Integer> numbers = List.of(1, 2, 3, 4, 5);
assertThat(numbers)
  .isNotEmpty()
  .hasSizeOf(5)
  .startsWith(1, 2, 3)
  .doesNotHaveDuplicates();
```

[current release]: https://github.com/toberkoe/fluent-assertions/releases/tag/0.5

repository: toberkoe/fluent-assertions

gha_language: Java

repo_name: toberkoe/fluent-assertions


text:
### [CVE-2021-31589](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-31589)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

A cross-site scripting (XSS) vulnerability has been reported and confirmed for BeyondTrust Secure Remote Access Base Software version 6.0.1 and older, which allows the injection of unauthenticated, specially-crafted web requests without proper sanitization.

### POC

#### Reference
- http://packetstormsecurity.com/files/165408/BeyondTrust-Remote-Support-6.0-Cross-Site-Scripting.html
- https://cxsecurity.com/issue/WLB-2022010013

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/ARPSyndicate/kenzer-templates
- https://github.com/adriyansyah-mf/One-Line-Bug-Bounty
- https://github.com/daffainfo/Oneliner-Bugbounty
- https://github.com/ghostxsec/one-liner
- https://github.com/karthi-the-hacker/CVE-2021-31589
- https://github.com/tucommenceapousser/Oneliner-Bugbounty2

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# iOS_Native_Samples
A collection of sample codes to quickstart with native iOS projects.

This repository has sample code for iOS native which will allow us experiment things quickly.

# Contents:

**Codable Sample**
Describe an example of using JSONDecode to decode json to Objects through Codable protocol.
Has a sample to encode and decode using JSONEncoder and JSONDecoder.
Has a sample for handling different key names using codingKeys.
Sample for Overriding init(from decoder: Decoder) throws {.
decoding optional values, mandatory value, and using singleValueContainer, using keyedBy

**Core Data**

**Simple Json Parsing**
This sample inclue downloading JSON using shared UrlSession dataTask and serialize the downloaded data using JSONSerialization.
This approach is not recommended now but this explain how JSON is converted to object before using codable protocol.


text:
# C++ coding conventions

 - prefer reference as an argument of functions
 - prefer reference instead of pointer whenever possible
 - use shared_ptr or unique_ptr.
   - avoid naked new / delete
 - make ownership explicit

 - use expect for pre-condition and ensure for post-condition
 - use ensure for class invariant
 - use exception for exceptional error
 - use result<bool, T> template for return value if it returns error
   - make result boolean to check failure

 - use config structs to pass options
 - use structs to hold related data
 - use types to wrap simple types and force semantics on it

 - use constness whenever possible
   - use const parameters
   - use const functions if it is const
   - remember lock is mutable in const functions
 - use constexpr for const values
 - use the same namespace as class for free helper functions

 - use fluent style when proper
 - use declarative style when possible
 - use operators to provide convenience
 - use std::_*_ if it exists
   - use stl for containers
   - use algorithms,  use std::to_string, and etc.
 - use lambda instead of bind / functor
 - use using instead of typedef
 - use auto when possible
 - use decltype when possible
 - use rvalue and move carefully
   - don't use it when performance is not critical

 - do document parameters, return value and exceptions
 - do unit test
   - do functional test as unit test if possible
 - do review code
 - do review design

## practice conventions

 - write unit test for all classes, especially for library classes.
   - aim for 100 % code coverage, especially for library classes.
 - write function test for game
   - aim 100% code coverage for important classes and for all classes as much as possible
 - make design simple
 - make code look simple and easy to read


text:
# Build Locale Objects for D3js
Npm module for generating D3 Locale settings files based on Unicode CLDR JSON data

Inspired by Rafael Xavier de Souza's
https://github.com/rxaviers/cldr-data-npm/tree/example-application

## Usage
Make sure you run in root of sucrose (should already exist if you ran `npm i` earlier):
    `npm i cldr cldr-data cldrjs`
To build locales, in root of sucrose run:
    `node ./scripts/lang/build_locales.js` or `make locales`
which will make a hashmap of D3 localities in:
    `build/locales.json`.
The build command will copy the locales file to the build folder.

To add or remove locales, edit the `src/data/cldr-locales.json` file using the pattern:
    `["xx_YY", "xx", "ZZZ", "xx-YY", "Klingon (Klinzhai)"]`
where `xx_YY` is the locales.json key, `xx` is the ISO language code, `ZZZ` is the ISO currency code,
`xx-YY` is the `node_modules/cldr/main/xx-YY` data folder, followed by an english translation of
the language and locale (country) like `"Klingon (Klinzhai)"`.

Then load the `build/locales.json` on your page into a `locales` variable and in Sucrose chart instantiation pass a locale object to set string/datetime/number formatting options:
```javascript
    var myLocale = locales['en_US'];
    var chart = sucrose.chart.pieChart.locality(myLocale);
```
The default formatters in the charts and models will now have localized content.
For instance, the pieChart tooltip uses a format utility function:
```javascript
    var val = utility.numberFormat(y, 2, yIsCurrency, chart.locality());
```
With locales['en_US'] the display string for `1234.567` as currency will be `$1,234.57`
while for locales['fr_FR'] the display string will be `1 234,57 €`.

## Resources
The following sites were extremely helpful in developing this script:

http://cldr.unicode.org/index
https://github.com/rxaviers/cldrjs
https://github.com/jquery/globalize
https://github.com/twitter/twitter-cldr-js
https://github.com/mbostock/d3/wiki/Time-Formatting
http://cldr.unicode.org/translation/number-patterns
https://rxaviers.github.io/javascript-globalization/
http://www.unicode.org/cldr/charts/28/by_type/numbers.number_formatting_patterns.html
https://lh.2xlibre.net/
http://www.localeplanet.com/icu/index.html
http://momentjs.com/
http://johnnyreilly.github.io/globalize-so-what-cha-want/#/?currency=true&date=true&message=false&number=true&plural=false&relativeTime=false&unit=false
http://www.globalbydesign.com/2011/12/08/how-to-localize-date-formats-using-globalize-js/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
http://npm.taobao.org/browse/keyword/locale
https://www.branah.com/unicode-converter
https://github.com/globalizejs/globalize/issues/758
https://github.com/d3/d3-format/issues/34

## License
Copyright 2018 SugarCRM, Licensed by SugarCRM under the Apache 2.0 license.

repository: sugarcrm/sucrose

gha_language: JavaScript

gha_license_id: NOASSERTION

repo_name: sugarcrm/sucrose


text:
# lagom-dojo

This project has been generated by cutting out parts of hello-lagom for the purpose of investigating the key
architectural decisions of the framework
(see https://www.lagomframework.com/documentation/1.4.x/scala/IntroGetStarted.html)

`sbt runAll`

repository: abirotti/lagom-dojo

repo_name: abirotti/lagom-dojo


text:
# xwing-ship-images
Images of ships from X-Wing: The Miniatures Game by Fantasy Flight Games.

All images are 256 x 256 PNGs with transparent backgrounds. The project is structured similarly to [xwing-data](https://github.com/guidokessels/xwing-data) by [Guido Kessels](https://github.com/guidokessels).

This repository is no longer being updated with new ships launched in Second Edition. If you want those, look at [xwing-2e-ship-images](https://github.com/acosoi/xwing-2e-ship-images).

The status of each ship is color-coded below:

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) OK
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Low Quality
* ![#ff0000](https://placehold.it/15/ff0000/000000?text=+) Not Done

---

### First Edition

#### Wave 1

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) X-Wing
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Fighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Y-Wing
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Advanced

#### Wave 2

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) A-Wing
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Interceptor
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) YT-1300
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Firespray-31

#### Rebel Transport Expansion Pack

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) GR-75 Medium Transport

#### Wave 3

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) HWK-290
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Lambda-class Shuttle
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) B-Wing
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Bomber

#### Wave 4

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Z-95 Headhunter
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) E-Wing
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Phantom
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Defender

#### Imperial Aces Expansion Pack

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Interceptor (Royal Guard paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Interceptor (Saber Squadron paint scheme)

#### Tantive IV Expansion Pack

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) CR90 Corvette

#### Wave 5

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) YT-2400
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) VT-49 Decimator

#### Wave 6

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Y-Wing (Scum paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Z-95 Headhunter (Black Sun paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) M3-A Interceptor
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Aggressor
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) StarViper

#### Rebel Aces Expansion Pack

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) A-Wing (Prototype paint scheme)
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) B-Wing (Dagger Squadron paint scheme)

#### Imperial Raider Expansion Pack

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Advanced (alternate paint scheme)
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Raider-class Corvette

#### Wave 7

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Kihraxz Fighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) YV-666
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) K-wing
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Punisher

#### Imperial Assault Carrier Expansion Pack

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Gozanti-class Cruiser
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Fighter (Blue paint scheme)

#### Wave 8

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Attack Shuttle
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Adv. Prototype
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) VCX-100
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) G-1A Starfighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) JumpMaster 5000
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) T-70 X-Wing
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE/fo Fighter

#### Imperial Veterans Expansion Pack

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Defender (Glaive Squadron paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Bomber (Gamma Squadron paint scheme)

#### Wave 9

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE/sf Fighter
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Protectorate Starfighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Lancer-class Pursuit Craft
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) ARC-170

#### Heroes of the Resistance Expansion Pack

* ![#ff0000](https://placehold.it/15/ffff00/000000?text=+) T-70 X-wing (Poe Dameron paint scheme)
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) YT-1300 (alternate paint scheme)

#### C-ROC Cruiser Expansion Pack

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) C-ROC Cruiser
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) M3-A Interceptor (red stripe paint scheme)

#### Wave 10

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Fighter (Sabine paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) TIE Striker
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Upsilon-class Shuttle
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Quadjumper
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) U-wing

#### Wave 11

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Auzituck Gunship
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Scurrg H-6 Bomber
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Aggressor

#### Wave 12

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) M12-L Kimogila Fighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Sheathipede-class Shuttle
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Alpha-class Star Wing

#### Wave 13

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Silencer
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) B/SF-17 Bomber

#### Guns for Hire Expansion Pack

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) Kihraxz Fighter (Black Sun paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) StarViper Mk. II

#### Wave 14

* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) U-Wing (Saw's Rebels paint scheme)
* ![#ffff00](https://placehold.it/15/ffff00/000000?text=+) T-65 X-Wing (Saw's Rebels paint scheme)
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) TIE Reaper

### Second Edition

#### Wave 1

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Customized YT-1300 Light Freighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Escape Craft

#### Wave 2

* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Fang Fighter
* ![#00ff00](https://placehold.it/15/00ff00/000000?text=+) Modified TIE/ln Fighter

---

Star Wars, X-Wing: The Miniatures Game and all related properties, images and text are owned by Fantasy Flight Games, Lucasfilm Ltd., and/or Disney.

repository: acosoi/xwing-ship-images

repo_name: acosoi/xwing-ship-images


text:
# Hot or Cold

## @description A Hot-or-Cold treasure hunt game

## ~avatar avatar

Find the hidden @boardname@ before the other players!

## ~

https://youtu.be/nbRfNug-RkY

## Tutorials

* [Start tutorials](/multi#tutorial:/projects/hot-or-cold/beacon:|:tutorial:/projects/hot-or-cold/seekers)

You can also do them individually:

* [Beacon](/projects/hot-or-cold/beacon)
* [Seekers](/projects/hot-or-cold/seekers)

## Extra

Make the hot-or-cold game multi beacon. [Start activity](/proejcts/hot-or-cold/multi-beacons)


text:
## Update for Rails 5.1+

I've started to use the [premailer](https://github.com/premailer/premailer) gem for Rails > 5.0. I'd welcome patches to keep this gem going.

## Inline Styles Mailer [![Build Status](https://secure.travis-ci.org/billhorsman/inline_styles_mailer.png)](http://travis-ci.org/billhorsman/inline_styles_mailer)

Using Jack Danger's excellent [Inline Styles](https://github.com/jackdanger/inline_styles) gem is even easier if you're using Rails 3.1+ and this gem.

The Inline Styles gem helps you embed CSS styles into your markup so that you can send pretty HTML emails that won't get butchered by email clients that strip out CSS. Or, more precisely, will help reduce the amount of butchering (even with inline CSS some styles, like background images, are often cut out).

This gem stands on the shoulders of the [inline_styles](https://github.com/jackdanger/inline_styles) and [sass-rails](https://github.com/rails/sass-rails) gem, merely adding some code to make it more convenient to use.

## What do you mean, "inline style"?

Let's say you have a mail template like this:

```html
<html>
  <body>
    <p>Hello World</p>
  </body>
</html>
```

And a CSS file like this:

```css
p {
  color: red;
}
```

Then this gem will mash that all up into:

```html
<html>
  <body>
    <p style="color: red;">Hello World</p>
  </body>
</html>
```

So you can keep your templates clean and take advantage of CSS preprocessing goodness if you want without compromising the portability of your HTML in various email clients.

MailChimp have a nice article: [How To Code HTML Emails](http://kb.mailchimp.com/article/how-to-code-html-emails/).

## Installation

If you're using Bundler:

```ruby
source 'http://rubygems.org'
gem 'inline_styles_mailer'
```

## Usage

If you keep things simple, then it's just one line:

```ruby
class FooMailer < ActionMailer::Base
  include InlineStylesMailer

  def foo(email)
    mail(:to => email, :subject => "Foo foo!")
  end

end
```

If you have a CSS file app/assets/stylesheets/_foo_mailer* (where * can be .css, .css.scss or .css.sass) then it will get automatically applied to the mail using the inline_styles gem. That name (_foo_mailer) is based on your mailer class name, e.g. FooMailer. If you have more than one file matching that pattern then it will use them all.

It will use one of three preprocessing methods based on the filename:

* [.scss](http://sass-lang.com/)
* [.sass](http://sass-lang.com/)
* anything else (e.g. .css) no preprocessing at all

Want to use a different css file? Declare use_stylesheet:

```ruby
class FooMailer < ActionMailer::Base
  include InlineStylesMailer
  use_stylesheet '_bar.css.sass'
  ...
end
```

You can use an array of stylesheets if you like. Don't keep your stylesheets in app/assets/stylesheets? Declare stylesheet_path:

```ruby
class FooMailer < ActionMailer::Base
  include InlineStylesMailer
  stylesheet_path 'public/stylesheets'
  ...
end
```

## Upgrading to Version 1.0

We decided to bump up the major version because of a fix (5d0b6f4) we made to the way the template was found. We were incorrectly assuming that all mail templates were only nested one deep in `app/views` but that's not always the case. It now works correctly but you might have worked around this bug (issue #8) by moving your templates. You don't need to do that any more.

## What versions of Rails does this work with?

We run tests using Rails `4.2.6`, `5.0.0.beta3`, `5.1.6` and `5.2`

| Version | Working? |
| --- | --- |
| 3.0 | No * |
| 3.1 | Yes |
| 3.2 | Yes |
| 4.0 | Yes |
| 4.1 | Yes |
| 4.2 | Yes |
| 5.0 | Yes |
| 5.1 | Yes |
| 5.2 | Yes |

\* It relies on the asset pipeline so I'd be surprised if it works. Not tested.

\** I'm recommending using the [premailer](https://github.com/premailer/premailer) gem for Rails > 5.0.

## What about Ruby?

Anything later than Ruby `1.9.2` should be fine. We test using Ruby 2.0.0`, `2.1.8`, `2.2.4` and `2.3.0`.

### 1.9 Support

We don't test with Ruby `1.9` because there is a dependency on the `mime-types-data` gem for which the latest version requires Ruby `2.0` or later. That doesn't mean you can't use Ruby `1.9.3` but you'll need to make sure you're using a version of `mime-types-data` less than `3`.

## Development

Questions or problems? Please post them on the [issue tracker](https://github.com/billhorsman/inline_styles_mailer/issues). You can contribute changes by forking the project and submitting a pull request. You can ensure the tests passing by running `bundle` and `rake`.

The tests also run on [Travis CI](http://travis-ci.org/#!/billhorsman/inline_styles_mailer).

This gem was created by Bill Horsman and is under the MIT License.

gha_language: Ruby


text:
---
title: PowerMax
linktitle: PowerMax
weight: 6
description: Enabling Replication feature for CSI PowerMax
---
## Enabling Replication In CSI PowerMax

Container Storage Modules (CSM) Replication sidecar is a helper container that is installed alongside a CSI driver to facilitate replication functionality. Such CSI drivers must implement `dell-csi-extensions` calls.

CSI driver for Dell EMC PowerMax supports necessary extension calls from `dell-csi-extensions`. To be able to provision replicated volumes you would need to do the steps described in the following sections.

### Before Installation

#### On Storage Array
Configure SRDF connection between multiple PowerMax instances. Follow instructions by PowerMax storage for creating the SRDF Groups between a set of arrays.

You can ensure that you configured remote arrays by navigating to the `Data Protection` tab and choosing `SRDF Groups` on the managing Unisphere of your array. You should see a list of remote systems with the SRDF Group number that is configured and the Online field set to a green tick.

While using any SRDF groups, ensure that they are for exclusive use by the CSI PowerMax driver -
* Any SRDF group which will be used by the driver is not in use by any other application
* If an SRDF group is already in use by a CSI driver, don't use it for provisioning replicated volumes outside CSI provisioning workflows.

There are some important limitations that apply to how CSI PowerMax driver uses SRDF groups -
* One replicated storage group __always__ contains volumes provisioned from a single namespace
* While using SRDF mode Async/Metro, a single SRDF group can be used to provision volumes within a single namespace. You can still create multiple storage classes using the same SRDF group for different Service Levels.
  But all these storage classes will be restricted to provisioning volumes within a single namespace.
* When using SRDF mode Sync, a single SRDF group can be used to provision volumes from multiple namespaces.

#### In Kubernetes
Ensure you installed CRDs and replication controller in your clusters.

To verify you have everything in order you can execute the following commands:

* Check controller pods
    ```shell
    kubectl get pods -n dell-replication-controller
    ```
  Pods should be `READY` and `RUNNING`
* Check that controller config map is properly populated
    ```shell
    kubectl get cm -n dell-replication-controller dell-replication-controller-config -o yaml
    ```
  `data` field should be properly populated with cluster-id of your choosing and, if using multi-cluster
  installation, your `targets:` parameter should be populated by a list of target clusters IDs.

If you don't have something installed or something out-of-place please refer to installation instructions
in [installation-repctl](../install-repctl) or [installation](../installation).

### Installing Driver With Replication Module

To install the driver with replication enabled you need to ensure you have set
helm parameter `replication.enabled` in your copy of example `values.yaml` file
(usually called `my-powermax-settings.yaml`, `myvalues.yaml` etc.).

Here is an example of how that would look like
```yaml
...
# Set this to true to enable replication
replication:
  enabled: true
  image: dellemc/dell-csi-replicator:v1.0.0
  replicationContextPrefix: "powermax"
  replicationPrefix: "replication.storage.dell.com"
...
```
You can leave other parameters like `image`, `replicationContextPrefix`, and `replicationPrefix` as they are.

After enabling the replication module you can continue to install the CSI driver for PowerMax following
usual installation procedure, just ensure you've added necessary array connection information to secret.

> **_NOTE:_** you need to install your driver at least on the source cluster, but it is recommended to install
> drivers on all clusters you will use for replication.

### Creating Storage Classes

To be able to provision replicated volumes you need to create properly configured storage
classes on both source and target clusters.

Pair of storage classes on the source and target clusters would be essentially `mirrored` copies of one another.
You can create them manually or with help from `repctl`.

#### Manual Storage Class Creation

You can find sample replication enabled storage class in the driver repository
at `./samples/storageclass/powermax_srdf.yaml`.

It will look like this:
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powermax-srdf
provisioner: csi-powermax.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
  SRP: <SRP Name>
  SYMID: <SYMID>
  ServiceLevel: <Service Level>
  replication.storage.dell.com/RemoteSYMID: <RemoteSYMID>
  replication.storage.dell.com/RemoteSRP: <RemoteSRP>
  replication.storage.dell.com/isReplicationEnabled: "true"
  replication.storage.dell.com/RemoteServiceLevel: <Remote Service Level>
  replication.storage.dell.com/RdfMode: <RdfMode>
  replication.storage.dell.com/Bias: "false"
  replication.storage.dell.com/RdfGroup: <RdfGroup>
  replication.storage.dell.com/RemoteRDFGroup: <RemoteRDFGroup>
  replication.storage.dell.com/remoteStorageClassName: <RemoteStorageClassName>
  replication.storage.dell.com/remoteClusterID: <RemoteClusterID>
```

Let's go through each parameter and what it means:
* `replication.storage.dell.com/isReplicationEnabled` if set to `true`, will mark this storage class as replication enabled,
  just leave it as `true`.
* `replication.storage.dell.com/RemoteStorageClassName` points to the name of the remote storage class, if you are using replication with the multi-cluster configuration you can make it the same as the current storage class name.
* `replication.storage.dell.com/RemoteClusterID` represents the ID of a remote cluster, it is the same id you put in the replication controller config map.
* `replication.storage.dell.com/RemoteSYMID` is the Symmetrix id of the remote array.
* `replication.storage.dell.com/RemoteSRP` is the storage pool of the remote array.
* `replication.storage.dell.com/RemoteServiceLevel` is the service level that will be assigned to remote volumes.
* `replication.storage.dell.com/RdfMode` points to the RDF mode you want to use. It should be one out of "ASYNC", "METRO" and "SYNC". If mode is set to
  METRO, driver does not need `RemoteStorageClassName` and `RemoteClusterID` as it supports METRO with single cluster configuration.
* `replication.storage.dell.com/Bias` when the RdfMode is set to METRO, this parameter is required to indicate driver to use Bias or Witness.
  If set to true, the driver will configure METRO with Bias, if set to false, the driver will configure METRO with Witness.
* `replication.storage.dell.com/RdfGroup` is the local SRDF group number, as configured.
* `replication.storage.dell.com/RemoteRDFGroup` is the remote SRDF group number, as configured.

Let's follow up that with an example, let's assume we have two Kubernetes clusters and two PowerMax
storage arrays:
* Clusters have IDs of `cluster-1` and `cluster-2`
* There are two arrays local Symmetrix array: `000000000001` and remote Symmetrix array: `000000000002`
* Storage arrays are connected to each other via RdfGroup `1` and RemoteRDFGroup `2`
* Cluster `cluster-1` connected to array `000000000001`
* Cluster `cluster-2` connected to array `000000000002`
* RDF Mode is ASYNC

And this how would our pair of storage classes would look like:

StorageClass to be created in `cluster-1`:
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powermax-srdf
provisioner: csi-powermax.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
  SRP: "SRP"
  SYMID: "000000000001"
  ServiceLevel: "Optimized"
  replication.storage.dell.com/RemoteSYMID: "000000000002"
  replication.storage.dell.com/isReplicationEnabled: "true"
  replication.storage.dell.com/RemoteSRP: "SRP"
  replication.storage.dell.com/RemoteServiceLevel: "Optimized"
  replication.storage.dell.com/RdfMode: "ASYNC"
  replication.storage.dell.com/Bias: "false"
  replication.storage.dell.com/RdfGroup: "1"
  replication.storage.dell.com/RemoteRDFGroup: "2"
  replication.storage.dell.com/remoteStorageClassName: "powermax-srdf"
  replication.storage.dell.com/remoteClusterID: "cluster-2"
```

StorageClass to be created in `cluster-2`:
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powermax-srdf
provisioner: csi-powermax.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
  SRP: "SRP"
  SYMID: "000000000002"
  ServiceLevel: "Optimized"
  replication.storage.dell.com/RemoteSYMID: "000000000001"
  replication.storage.dell.com/isReplicationEnabled: "true"
  replication.storage.dell.com/RemoteServiceLevel: "Optimized"
  replication.storage.dell.com/RemoteSRP: "SRP"
  replication.storage.dell.com/Bias: "false"
  replication.storage.dell.com/RdfMode: "ASYNC"
  replication.storage.dell.com/RdfGroup: "2"
  replication.storage.dell.com/RemoteRDFGroup: "1"
  replication.storage.dell.com/remoteStorageClassName: "powermax-srdf"
  replication.storage.dell.com/remoteClusterID: "cluster-1"
```

After figuring out how storage classes would look like you just need to go and apply them to
your Kubernetes clusters with `kubectl`.

#### Storage Class Creation With repctl

`repctl` can simplify storage class creation by creating a pair of mirrored storage classes in both clusters
(using a single storage class configuration) in one command.

To create storage classes with `repctl` you need to fill up the config with necessary information.
You can find an example in `repctl/examples/powermax_example_values.yaml`, copy it, and modify it to your needs.

If you open this example you can see a lot of similar fields and parameters you can modify in the storage class.

Let's use the same example from manual installation and see how config would look like
```yaml
sourceClusterID: "cluster-1"
targetClusterID: "cluster-2"
name: "powermax-replication"
driver: "powermax"
reclaimPolicy: "Retain"
replicationPrefix: "replication.storage.dell.com"
parameters:
  rdfMode: "ASYNC"
  srp:
    source: "SRP_1"
    target: "SRP_1"
  symId:
    source: "000000000001"
    target: "000000000002"
  serviceLevel:
    source: "Optimized"
    target: "Optimized"
  rdfGroup:
    source: "1"
    target: "2"
```

After preparing the config you can apply it to both clusters with repctl, just make sure you've
added your clusters to repctl via the `add` command before.

To create storage classes just run `./repctl create sc --from-config <config-file>` and storage classes
would be applied to both clusters.

After creating storage classes you can make sure they are in place by using `./repctl list storageclasses` command.

### Provisioning Replicated Volumes

After installing the driver and creating storage classes you are good to create volumes using newly
created storage classes.

On your source cluster, create a PersistentVolumeClaim using one of the replication enabled Storage Classes.
The CSI PowerMax driver will create a volume on the array, add it to a StorageProtectionGroup and configure replication
using the parameters provided in the replication-enabled Storage Class.

#### Provisioning Metro Volumes

Here is an example of a storage class configured for Metro mode,

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powermax-metro
provisioner: csi-powermax.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
  SRP: "SRP"
  SYMID: "000000000001"
  ServiceLevel: "Optimized"
  replication.storage.dell.com/RemoteSYMID: "000000000002"
  replication.storage.dell.com/isReplicationEnabled: "true"
  replication.storage.dell.com/RemoteSRP: "SRP"
  replication.storage.dell.com/RemoteServiceLevel: "Optimized"
  replication.storage.dell.com/RdfMode: "Metro"
  replication.storage.dell.com/Bias: "true"
  replication.storage.dell.com/RdfGroup: "3"
  replication.storage.dell.com/RemoteRDFGroup: "3"
```

After installing the driver and creating a storage class with Metro config (as shown above) we can create volumes.
On your cluster, create a PersistentVolumeClaim using this storage class. The CSI PowerMax driver will create a volume on the array, add it to a StorageProtectionGroup and configure replication using the parameters provided in the replication-enabled Storage Class.

### Supported Replication Actions
The CSI PowerMax driver supports the following list of replication actions:

#### Basic Site Specific Actions -
- FAILOVER_LOCAL
- FAILOVER_REMOTE
- UNPLANNED_FAILOVER_LOCAL
- UNPLANNED_FAILOVER_REMOTE
- REPROTECT_LOCAL
- REPROTECT_REMOTE

#### Advanced Site Specific Actions -
In this section we are going to refer to "Site A" as the original source site & "Site B" as the original target site.
Any action with the LOCAL suffix means, do this action for the local site. Any action with the REMOTE suffix means do this action for the remote site.
- FAILOVER_WITHOUT_SWAP_LOCAL
  - You can use this action to do a failover when you are at Site B, and don't want to swap the replication direction.
  - On Site B, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `FAILOVER_WITHOUT_SWAP_LOCAL`.
  - After receiving this request the CSI driver will attempxt to Fail over to Site B which is the local site.
- FAILOVER_WITHOUT_SWAP_REMOTE
  - You can use this action to do a failover when you are at Site A, and don't want to swap the replication direction.
  - On Site A, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `FAILOVER_WITHOUT_SWAP_REMOTE`.
  - After receiving this request the CSI driver will attempt to Fail over to Site B which is the remote site.
- FAILBACK_LOCAL
  - You can use this action to do a failback, and when you are at Site A.
  - On Site A, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `FAILBACK_LOCAL`.
  - After receiving this request the CSI driver will attempt to Fail back from Site B to Site A which is the local site.
- FAILBACK_REMOTE
  - You can use this action to do a failback, and when you are at Site B.
  - On Site B, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `FAILBACK_REMOTE`.
  - After receiving this request the CSI driver will attempt to Fail back to Site A from Site B which is the local site.
- SWAP_LOCAL
  - You can use this action to swap the replication direction, and you are at Site A.
  - On Site A, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `SWAP_LOCAL`.
  - After receiving this request the CSI driver will attempt to do SWAP at Site A which is the local site.
- SWAP_REMOTE
  - You can use this action to swap the replication direction, and you are at Site B.
  - On Site B, run `kubectl edit rg <rg-name>` and edit the 'action' in `spec` with `SWAP_REMOTE`.
  - After receiving this request the CSI driver will attempt to do SWAP at Site B which is the remote site.

#### Maintenance Actions -
- SUSPEND
- RESUME
- ESTABLISH
- SYNC

### Deletion of DellCSIReplicationGroup
The deletion of `DellCSIReplicationGroup` custom resource triggers the `DeleteStorageProtectionGroup` call on the driver.
The storage protection group on the array can be deleted only if it has no volumes associated with it. If the deletion is triggered on the storage protection group with volumes, the deletion will fail and the dell-csi-driver will return a final error to the dell-csm-replication sidecar.

repository: JacobGros/csm-docs

repo_name: JacobGros/csm-docs