text:
# oir
Internal package to standardize preliminary data analysis and integrate analytical feedback

Encodes common statistical decision trees, for a list of response variables for a project.
Cite via Zenodo DOI -- [![DOI](https://zenodo.org/badge/420233162.svg)](https://zenodo.org/badge/latestdoi/420233162)

Requires input data tbl to be "nested" into 2 columns --
  1. "variable", a vector of response variable names, and
  2. "varData", a list of

This can be done with the 2 code lines, acting on typically cleaned "wide" data (i.e. response variables as columns), with dataset's independent variable keys also as columns (e.g. "plot", treatment", etc.) --

#e.g.
cleanData <- dplyr::tibble(
  "plot" = c(1, 2, 3), "treat" = c(1, 2, 3),
  "var1" = c(1, 2, 3), "var2" = c(1, 2, 3) #, [...]
 )

varTbl <- cleanData %>%
  tidyr::pivot_longer(names_to = "variable", values_to = "value") %>%
  purr::nest(cols = !c(-variable)).

then processed using --

statFormula <- value ~ [independent variable of interest]
resultsTbl <- varTbl %>% oir::getStatsTbl(formula = statFormula)

Notes --

- best used with simple model formula, i.e. 1 independent variable in "statFormula" (at a time)
- the main oir::getStatsTbl() function has versions "1", "2", and "12" to run --
  1. linear regressions at plot-/group-level median centers ("1")
  2. non-linear version of regression (not nlme::) modifying independent variable with stats::poly(x, degree = 2, at finest row level ("2")
  3. the same non-linear version of regression, but using plot-/group-level centers ("12")
- more complex formulas (e.g. lmer) can be processed, but with limited insight into final appropriate p-values
- non-parametric option included as back-up test for usable p-value, but may offer slightly different inference/interpretation


text:
# Flags for C++ 11 enum classes

C++ 11 gives a new type of enums — *enum classes*.
These are strongly typed enumerations, they do not cast implicitly to or from
the underlying integer type. They also do not leak enumeration values to
enclosing scope (thus the names of this values do not clash and you no longer
need to prefix/suffix them with something to disambiguate).

The only drawback to type safety is you cannot treat variables of *enum class*
types as sets of flags. That is because *enum classes* do not cast to integers
and there are no bitwise operators overloads defined for them.

This library brings a `flags` class template which provides bit flags for
scoped enums.

----------

Simple usage:

``` c++
enum class MyEnum { Value1 = 1 << 0, Value2 = 1 << 1 };
ALLOW_FLAGS_FOR_ENUM(MyEnum)

int main() {
  auto mask1 = MyEnum::Value1 | MyEnum::Value2; // set flags Value1 and Value 2
  if (mask1 & MyEnum::Value2) { // if Value2 flag is set
    /* ... */
  }
}
```

More info can be found in the [docs][DOC].

[DOC]: http://grisumbras.github.io/enum-flags/

repository: inviwo/inviwo

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: inviwo/inviwo


text:
 Game Programming Capstone Project 📑

This repository is consists of the assignment(s) done for Game Programming 15CS323E during Spring 2020 at SRM IST.

 Topic:

An implementation of the popular Flappy Bird Game using Python

Snapshot:

Directions of Usage:

- Clone this repository ⏬
- Move inside 👉 the repo
    - Open the Terminal 👩💻
    - and type ```cd smileplease```
- Now make sure you have all the dependencies🧱
  - Type in the terminal:```pip install -r requirements.txt```
- Now start the game:
     - Type in the terminal ```python flappy_bird.py```

Supervisor

[Ms.R.Sangeetha](https://www.srmist.edu.in/engineering/dept-cse/faculty/r-anita)

License📜

[MIT License](https://github.com/smaranjitghose/game_programming_project/blob/master/LICENSE)

Crafted with ❤ by Smaranjit Ghose

license: MIT


text:
# GameEngines-OpenCL

In this repository, a working installation of Bullet with Opencl is provided for macOS.

[Bullet Physics](https://github.com/bulletphysics/bullet3)

Tested on a Macbook Pro with the following features.

OpenGL:

  Version:	16.4.2

  Obtained from:	Apple

  Last Modified:	29/11/2017 13:14

  Kind:	Intel

  64-Bit (Intel):	Yes

  Signed by:	Software Signing, Apple Code Signing Certification Authority, Apple Root CA

  Get Info String:	OpenGL <IP_ADDRESS>.0

  Location:	/System/Library/Frameworks/OpenGL.framework

  Private:	No

Click [here](https://support.apple.com/en-us/HT202823) for info regarding macOS & OpenCL/OpenGL.

license: Zlib

repository: nikos-kekatos/GameEngines-OpenCL

repo_name: nikos-kekatos/GameEngines-OpenCL


text:
# alien4cloud-plugin-sample-plugin
Sample plugin with rest service and ui components.

This project is a small illustration of what can be done into alien4cloud in terms of customization.

## Description

### The backend part

In A4C, a plugin, when loaded and activated, will start a Spring context, child of the main application context.
It can contain it's own beans that can access to main context's beans.

#### The @Configuration

The class [alien4cloud.sampleplugin.ContextConfiguration](src/main/java/alien4cloud/sampleplugin/ContextConfiguration.java) is the entry point of the plugin backend. It defines the context and how to configure it. In this example, we simply scan the package `alien4cloud.sampleplugin` in order to detect and instantiate beans.

#### The @Service

The class [alien4cloud.sampleplugin.services.MyPluginService](src/main/java/alien4cloud/sampleplugin/services/MyPluginService.java) is a Spring @Service that contains the 'logic'.

#### The @RestController

The class [alien4cloud.sampleplugin.rest.MyPluginController](src/main/java/alien4cloud/sampleplugin/rest/MyPluginController.java) is a Spring controller that exposes a simple REST endpoint (`/rest/sample/hello`) and another endpoint (`/rest/sample/hello/authenticated`) which requires an authentication.
Notice the method for authenticated endpoint needs to be public to allow Spring security @PreAuthorize annotations lookup.

They both simply calls the service to build a simple response.

### The UI part

Optionally, a plugin can embed UI parts.

The UI part of this simple plugin add a menu in the main Alien4Cloud navigation bar that display a page. The page displays the result of the service call through the REST endpoint.

- the file [src/main/webapp/views/hello.html]() is the angular view.
- the file [src/main/webapp/scripts/hello-service.js]() creates an angular service used by the angular controller. It's in charge of calling the REST resource.
- the file [src/main/webapp/scripts/plugin.js]() is the UI entry point of the plugin : it creates a angular controller, bind it to the service, and define the view template. It also configure menu entry for the plugin.

### The manifest

Last but not least, the file [META-INF/plugin.yml]() is the manifest of the plugin.
It's needed by A4C to properly activate the plugin.

## Build and test

Simply build using `mvn clean install`. The assembly will generate a zip file in `target` folder (ie. `alien4cloud-plugin-sample-2.2.0-SNAPSHOT.zip`).

Just drag and drop this file in the Administration / Plugin page of a running A4C.

![Alt text](doc/upload.png?raw=true "Upload A4C plugin")

A 'Hello plugin' menu will appear in the main navigation bar. If you click on it, the plugin view will be displayed.

![Alt text](doc/display.png?raw=true "Display A4C plugin")

That's all folks !

gha_language: JavaScript


text:
### [CVE-2019-9878](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9878)
![](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

There is an invalid memory access in the function GfxIndexedColorSpace::mapColorToBase() located in GfxState.cc in Xpdf 4.0.0, as used in pdfalto 0.2. It can be triggered by (for example) sending a crafted pdf file to the pdftops binary. It allows an attacker to cause Denial of Service (Segmentation fault) or possibly have unspecified other impact.

### POC

#### Reference
- https://github.com/kermitt2/pdfalto/issues/46
- https://research.loginsoft.com/bugs/invalid-memory-access-in-gfxindexedcolorspacemapcolortobase-pdfalto-0-2/

#### Github
- https://github.com/0xCyberY/CVE-T4PDF
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
Read-Time : 2 minutes

# HTTP
**HTTP**  stands for HyperText Transfer Protocol. It is a stateless application protocol, used to exchange or transfer hypertext. It is called a stateless protocol because each command is executed independently, without any knowledge of the commands that came before it.

# REQUEST
A **REQUEST** contains a **Method** and a **URL**
You can check a request on chrome by opening the console > network (let filter be All and add the tag 'Method').
Once you click a GET request it will display 3 tabs: `General`, `Response Headers` and `Request Headers`.
Open the `Request Header`:

There are a few things we can check there:
- On Accept it displays what the request wants the server to return.
- On User-Agent it displays info about what the user is using.

Now toggle the button `view source`. Using Google as an example, the first lines look like this:
```
GET / HTTP/1.1
Host: google.com
```
This is our **REQUEST HEADER**.

## REQUEST HEADER
syntax
```
HTTP_METHOD /resource HTTP.VERSION
header_name: value
(empty_line)
```

## VERBS / METHODS
These describe the action that should be performed on the host. They are fomalized and universally applicable:

- **GET:** fetch an existing resource. The URL contains all the necessary information the server needs to locate and return the resource.
- **POST:** create a new resource. POST requests usually carry a payload that specifies the data for the new resource.
- **PUT:** update an existing resource. The payload may contain the updated data for the resource. (Also, PATCH)
- **DELETE:** delete an existing resource.

## URL
![URL Layout](https://github.com/LucasKuhn/notes/blob/master/phase2/images/http1-url-structure.png)

Uniform Resource Locator

 - The default port is 80

### URI gem
Try it on pry/irb ^^
```ruby
require 'uri'
url = URI('http://devbootcamp.com/')
url.scheme
url.hostname
url.port
url.path
url.query
```

# RESPONSE

## STATUS CODES
- **1xx:** Informational Messages
- **2xx:** Successful
- **3xx:** Redirection
- **4xx:** Client Error
- **5xx:** Server Error
[HTTP Statuses](https://httpstatuses.com/)

# RESOURCES
[Text Source](https://code.tutsplus.com/tutorials/http-the-protocol-every-web-developer-must-know-part-1--net-31177)
[Video Source](https://talks.devbootcamp.com/intro-to-http)

repository: klorealf/dbc-notes

repo_name: klorealf/dbc-notes


text:
## PAYSTACK API

To charge a card{

    First Point
    --------------------------
    The first point handles the card number, cvv, expiry month and year.
    Then send this data to paystack, Paystack will verify it and send me a message.
    the message holds status and the message itself,
    i verified the message, if its an error >>> it should show an error message, else >>> it should continue the process

    Second Point
    ---------------------------
    The second point handles the card and bank informations, e.g. amount, card number, expiry month and year,
    bank code, bank account number, etc.
    i wrote a validation that checks if any error is found in the first point and also save the
    informations and messages sent from paystack to the database.
    if no error is found>>>> it continues the process

    Last Point
    ----------------------------
    The third point returns a reference and request for a pin.
    This also have a validation for errors
    the page will be redirected and ask for pin and otp from user
}
## NOTE: All endpoints are saved to the Database

To add PIN and OTP{

    First EndPoint
    --------------------------------
    The first endpoint handles the pin number and the reference key.
    then send the pin and the reference that is sent from the Last Point which will be required

    Second EndPoint
    -------------------------------
    This endpoint will get the message from the first endpoint and ask for the otp number.
    i added the otp number and the reference number that is been sent from the first endpoint
    Then a Successful message will be sent that Charge attempted and is been approved
    I didn't save this endpoint to the database but you can view the message on the view to see if transaction has been made successfully
    Thanks!
}
The Laravel framework is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

repository: Oyelamin/PAYSTACK-API

repo_name: Oyelamin/PAYSTACK-API


text:
# _Think With Google Rebuild_

#### _Second CSS project for Epicodus, 11.28.2016_

#### By _**Larry Dean Tunseth and Garrett Price**_

## Description

_This is a full responsive rebuild of the Baker Street Inquirer page._

## Setup/Installation Requirements

* _Clone this repository_
* _Open an HTTP server in the cloned directory_
* _Repo Link: https://github.com/larrytun/CSS_Baker-Stree-Inquirer_

## Known Bugs

_No Known bugs_

## Support and contact details

_If you run into problems contact Larry Tunseth at<EMAIL_ADDRESS>
## Technologies Used

_HTML
CSS
GitHub
Git_

### License

*This software is licensed under the MIT license.*

Copyright (c) 2016 **_Larry Tunseth & Garrett Price_**


text:
# [Visual Data](@id config_visual)

The visual data of the configuration will be passed to the underlying plotting functions and can be used to set their specific attributes.

As a consequence, the possible options are determined by the following functions:
- Designmatrix, ERP Image : `heatmap` ([documentation](https://makie.juliaplots.org/v0.17.13/examples/plotting_functions/heatmap/index.html))
- Line Plot, Butterfly Plot, PCP : `lines` ([documentation](https://makie.juliaplots.org/v0.17.13/examples/plotting_functions/lines/index.html))
- Topo Plot, EEG Topo Plot : `topoplot`,`eeg_topoplot` ([documentation](https://docs.juliahub.com/TopoPlots/giJys/0.1.1))

gha_language: Julia


text:
# ardor-ts

An [Ardor](https://ardorplatform.org) client library written in [TypeScript](https://www.typescriptlang.org).

## Installation

````
npm install @blobaa/ardor-ts
````

## Development

You need to have [Node.js](https://nodejs.org/en/) installed.

To **initialize** the project just clone this repository and run
```
npm install
```

For **linting** run
```
npm run lint
```

You can try to **autofix lint errors** with
```
npm run fix-lint
```

For **unit testing** run the following associated commands

browser:
```
npm run test-browser
```

node:
```
npm run test-node
```

both:
```
npm test
```

Because broadcasting a transaction costs fees, the transaction post request tests are disabled by default. You can enable them in the `test/config.ts` file.

## APIs

The library consist of the following modules:

### Request

This module creates requests to communicate with an ardor node. It handles get requests and transaction post requests. Every request which involves a transaction creation is signed locally so that your passphrase is never transmitted to an ardor node.

Each function has the following singature:
````
functionName(url: string, params: FunctionNameParams): Promise<FunctionNameResponse>
````
The *functionName* corresponds to the ardor API request type, the *functionName*Params interface to the request parameters and the *functionName*Response interface to the JSON response properties (see [API console](https://testardor.jelurida.com/test)).

An example request to get the current account balance might look like this:

````typescript
import { request, GetBalanceParams, ChainId, ErrorResponse } from '@blobaa/ardor-ts'

const exampleRequest = async () => {

    /* set request parameters */
    const params: GetBalanceParams = {
        chain: ChainId.IGNIS,
        account: "ARDOR-XCTG-FVBM-9KNX-3DA6B"
    }

    try {

        /* create and emit a request */
        const response = await request.getBalance("https://testardor.jelurida.com", params);

        /* the response implements the GetBalanceResponse interface */
        console.log(response.balanceNQT);
        console.log(response.unconfirmedBalanceNQT);
        console.log(response.requestProcessingTime);

    } catch(e) {

        /* check the error type */
        const error = e as ErrorResponse;
        if(error.errorCode) {

            /* error is an api error */
            console.log(error.errorDescription);
            console.log(error.errorCode);

        } else {

            /* error is an axios error */
            console.log(e);

        }
    }
}

exampleRequest();
````

The following requests are implemented:

#### get requests

````typescript
- decodeToken(url: string, params: DecodeTokenParams): Promise<DecodeTokenResponse>
- getAccountProperties(url: string, params: GetAccountPropertiesParams): Promise<GetAccountPropertiesResponse>
- getBalance(url: string, params: GetBalanceParams): Promise<GetBalanceResponse>
- getBlockchainTransactions(url: string, params: GetBlockchainTransactionsParams): Promise<GetBlockchainTransactionsResponse>
- getBundlerRates(url: string, params: GetBundlerRatesParams): Promise<GetBundlerRatesResponse>
- getTransaction(url: string, params: GetTransactionParams): Promise<GetTransactionResponse>
- downloadTaggedData(url: string, params: DownloadTaggedDataParams): Promise<DownloadTaggedDataResponse>
````

#### transaction post requests

````typescript
- broadcastTransaction(url: string, params: BroadcastTransactionParams): Promise<BroadcastTransactionResponse>
- deleteAccountProperty(url: string, params: DeleteAccountPropertyParams): Promise<DeleteAccountPropertyResponse>
- sendMessage(url: string, params: SendMessageParams): Promise<SendMessageResponse>
- sendMoney(url: string, params: SendMoneyParams): Promise<SendMoneyResponse>
- setAccountProperty(url: string, params: SetAccountPropertyParams): Promise<SetAccountPropertyResponse>
- uploadTaggedData(url: string, params: UploadTaggedDataParams): Promise<UploadTaggedDataResponse> // only data upload (no file upload) supported
````

### Account

The Account module is a wrapper of a forked [version](https://github.com/Atzen2/ardorjs) of the [ardorjs](https://github.com/mrv777/ardorjs) package. It handles transaction signing, account conversions and token generation.

It provides the following APIs:

````typescript
- convertPassphraseToPublicKey(passphrase: string, toByteArray?: boolean): string | Array<number> // toByteArray defaults to false
- convertPublicKeyToAccountId(publicKey: string): string
- convertPublicKeyToAccountRs(publicKey: string): string
- convertPassphraseToAccountId(passphrase: string): string
- convertPassphraseToAccountRs(passphrase: string): string
- checkAccountRs(accountRs: string): boolean // ok => true, error => false
- generateToken(message: string, passphrase: string, forTestnet?: boolean): string // forTestnet defaults to false
- signTransactionBytes(unsignedTransactionBytesHex: string, passphrase: string): string
- verifyTransactionBytes(unsignedTransactionBytesHex: string, transactionType: string, transactionJSON: object, publicKey: string): boolean
````

### Passphrase

This module provides passphrase generation. It uses the [bip39](https://github.com/bitcoinjs/bip39) package with the default english wordlist.

API:

````typescript
 - generate(): string
````

### Time

The Time module handles conversions between Ardor epoch timestamps and unix timestamps.

It provides the following APIs:

````typescript
- convertUnixToArdorTimestamp(timestampInMsec: number, isTestnetTimestamp?: boolean): number // isTestnetTimestamp defaults to false
- convertArdorToUnixTimestamp(timestamp: number, isTestnetTimestamp?: boolean): number // isTestnetTimestamp defaults to false
````

### ChainCurrency

The ChainCurrency module handles conversions between a chain currency representation and its base value. <br>
For example: ARDR has 8 decimals so that 1 ARDR can be converted to 100000000 ARDR NQTs which is called the base unit here.

It provides the following APIs:

````typescript
- convertToBaseUnit(amount: number, currencyType: ChainCurrencyType): number;
- convertFromBaseUnit(amount: number, currencyType: ChainCurrencyType): number;
````

## Module Instantiation

Each module is pre instantiated and importable via the lower case module name. If you need the class definition of a module, import it via the upper case name. For example:

````typescript
import { passphrase, Passphrase } from '@blobaa/ardor-ts'

/* use the default instance */
const passphrase1 = passphrase.generate();
console.log(passphrase1);

/* use your own instance */
const myPassphrase = new Passphrase();
const passphrase2 = myPassphrase.generate();
console.log(passphrase2);
````

Enjoy :)

repository: blobaa/ardor-ts

gha_language: TypeScript

repo_name: blobaa/ardor-ts


text:
# Contribution Guidelines

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

The following is a set of guidelines for contributing to Lucide. Feel free to propose changes to this document in a pull request.

## Pull Requests

Feel free to open a pull-request to contribute to this project.

**Working on your first Pull Request?** You can learn how from this *free* series
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

Guidelines for pull requests:
- __Make your commit messages as descriptive as possible.__ Include as much information as you can. Explain anything that the file diffs themselves won’t make apparent.
- __Document your pull request__. Explain your fix, link to the relevant issue, add screenshots when adding new icons.
- __Make sure the target of your pull request is the relevant branch__. Most of bugfix or new feature should go to the `master` branch.
- __Include only related work__. If your pull request has unrelated commit, it won't be accepted.

## Icon Requests

Before creating an icon request, please search to see if someone has requested the icon already. If there is an open request, please add a :+1:.

If the icon has not already been requested, [create an issue](https://github.com/lucide-icons/lucide/issues/new?title=Icon%20Request:) with a title of `Icon request: <icon name>` and add as much information as possible.

## Icon Requests from Feather
If you are a designer who wants to contribute to Lucide but you don't know what icons to work on, then have a look at the Requests from Feather. All open, unfinished and valid requests can be found in [Feather Icon Requests](https://github.com/lucide-icons/lucide/issues/119).

license: ISC

repository: aelfric/featherity

gha_license_id: ISC

repo_name: aelfric/featherity


text:
# sian-admin

## Build Setup

```bash
# clone the project
git clone http://gitlab.sian.vip/sian/h5/sian-admin.git

# enter the project directory
cd sian-admin

# install dependency
npm install

# develop
npm run dev
```

This will automatically open [http://localhost:9530](http://localhost:9530)

## Build

```bash
# build for devlopment environment
npm run build:dev

# build for test environment
npm run build:test

# build for production environment
npm run build
```

## Advanced

```bash
# preview the release environment effect
npm run preview

# preview the release environment effect + static resource analysis
npm run preview -- --report

# code format check
npm run lint

# code format check and auto fix
npm run lint -- --fix
```


text:
# The Lake Isle Of Innisfree

  #### By William Butler [Yeats](https://en.wikipedia.org/wiki/W._B._Yeats)
  #

I will **arise** and go now, and go to *Innisfree,*

And a [small cabin](http://housedesignideas.us/free-small-cabin-floor-plans/) build there, of clay and wattles made:

Nine bean-rows will I have there, a [hive for the honeybee,](https://jardindesigndotorg1.files.wordpress.com/2012/10/dsc02062.jpg) :honeybee:

And live alone in the bee-loud glade.

*And I shall have some peace there,* for peace comes dropping slow,

Dropping from the veils of the morning to where the [cricket sings](https://youtube.com/watch?v=Re72di5phM0)

There midnight's all a :sparkles: glimmer :sparkles:, and noon a purple glow,

And evening full of the [linnet's wings.](https://www.youtube.com/watch?v=XTsJ_1I-jL4)

**I will _arise_ and go now,** for always night and day

I hear lake water lapping with low sounds by the shore;

While I stand on the roadway, or on the pavements grey,

I hear it in the deep heart's :heart: core.

#
 #

[link](http://public-domain-poetry.com/william-butler-yeats/lake-isle-of-innisfree-187) to source poem

repository: olsonem/legendary-fortnight

repo_name: olsonem/legendary-fortnight


text:
# Kregervanrija Kurtzman GENUS

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
FEMS Yeast Res. 6(2): 289 (2006)

#### Original name
Kregervanrija Kurtzman

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# jekyll-ttskch-theme

A simple and customizable theme for Jekyll.

> This theme was renamed from _jekyll-**qck**-theme_ to _jekyll-**tch**-theme_ at 2016.06.02.
> And renamed again from _jekyll-**tch**-theme_ to _jekyll-**ttskch**-theme_ at 2016.09.23.

## Screen shot

![image](https://cloud.githubusercontent.com/assets/4360663/18776176/62611b38-81a2-11e6-875b-86a66aa8f15c.png)

## Features

- A lot of Markdown features (also GitHub Flavored Markdown)
- `:emoji:` ready :+1:
- Easy color-scheme customization
- Tags list page
- Monthly Archives page
- Search feature without any Jekyll plugins
- `<!--more-->` tag feature
- Anchor links for each headings
- Sticky side nav
- Responsive
- OGP ready
- Share buttons ready


text:
![Shortcode Enablr](.github/README/logo.png)

[![Contributors](https://img.shields.io/github/contributors/herdl/shortcode-enablr)](https://github.com/herdl/shortcode-enablr)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/herdl/shortcode-enablr/graphs/commit-activity)
[![GitHub releases](https://img.shields.io/github/release/herdl/shortcode-enablr.svg)](https://github.com/herdl/shortcode-enablr/releases/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![We Love Open Source!](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/herdl)

# Shortcode Enablr
Wordpress 3rd party shortcode enabler.

## Prerequisites
The following is a list of prerequisites for Shortcode Enablr.
```
PHP Version >= 7.0.0
```

### Installation

You can download the latest release as a `.zip` then head over to your site to install this manually.

Alternatively you can install it via the [Wordpress marketplace](https://wordpress.org/plugins/shortcode-enablr/).

## Description

The Herdl 3rd party shortcode enabler plugin, shortcode-enablr, allows for shortcode to be used in third party add-ons such as ACF and Yoast SEO.

## Usage

To add shortcode to the desired add-on, navigate the shortcode-enablr settings and select the service you want to enable shortcode for. Hit save and all is done!

## FAQ

Q - I want to use shortcode in an add-on that isn't currently listed, can I request it?
A - Sure!

## We're Using
* [PHP](https://www.php.net/) - The primary programming language

## Contributing
It is worth noting that all contributions must comply with the [PSR-2 standards](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)

## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/herdl/shortcode-enablr/tags).

## Authors
* **Alex Blackham** - *Developer and Maintainer* - [B3none](https://github.com/b3none)
* **Mat Moses** - *Logo creation* - [mooonthemove](https://instagram.com/mooonthemove)

See also the list of [contributors](https://github.com/herdl/shortcode-enablr/contributors) who participated in this project.

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

repository: herdl/shortcode-enablr

gha_language: PHP

repo_name: herdl/shortcode-enablr


text:
Fix ESI (EtherCAT Slave Infomation)
====

If you got an error info as follows, you may need to fix ESI on the robot.
```
ERROR: slave_no(1) : channel(352) is larger than Input bits (256)
```

### How to fix ESI

Open the elfin_ethercat_driver/config/write_esi.yaml file and configure the parameters.

Then fix ESI with following commands.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```

Finally, restart the robot. Now ESI should be fixed.

Besides, some backup files of the original ESI of the slaves that are fixed are generated in elfin_ethercat_driver/script/ folder.


text:
Custom generated lodash with string functions using

```shell script
lodash category=string exports=node -d
```

More info: https://lodash.com/custom-builds


text:
---
published: false
title: i13
layout: post
author: Yu
categories: v43
hidden: true
---

| 项目 | 具体内容 | 链接 |
|---:|---|---|
| 作者 | Willem M. van der Wal, Ronald B. Geskus| |
| 题目 |ipw: An R Package for Inverse Probability Weighting | [下载地址](http://www.jstatsoft.org/v43/i13/paper) |
| 参考资料 |Vol. 43, Issue 13, Sep 2011 | |
| | 提交日期 2010-04-07, 接收日期 2011-06-13| |
| 类别 | 论文| |
| 摘要 | We describe the R package <b>ipw</b> for estimating inverse probability weights. We show how to use the package to fit marginal structural models through inverse probability weighting, to estimate causal effects. Our package can be used with data from a point treatment situation as well as with a time-varying exposure and time-varying confounders. It can be used with binomial, categorical, ordinal and continuous exposure variables.| |
| 论文 | ipw: An R Package for Inverse Probability Weighting  (application/pdf, 825.2 KB)| [下载地址](http://www.jstatsoft.org/v43/i13/paper) |
| 补充材料 | | |
| |ipw_1.0-10.tar.gz: R软件包源代码  (application/x-gzip, 124.5 KB)|  [下载地址](http://www.jstatsoft.org/v43/i13/supp/1) |
| |v43i13.R: 论文的示例程序  (application/octet-stream, 6.6 KB)|  [下载地址](http://www.jstatsoft.org/v43/i13/supp/2) |
| 资源 | [BibTeX](http://www.jstatsoft.org/v43/i13/bibtex) [OAI](http://www.jstatsoft.org/oai?verb=GetRecord&identifier=oai.jstatsoft/v43/i13&prefix=oai_dc)| |
| |  | [返回卷目录]({{site.baseurl}}/volume/v43.html) |

repository: yulijia/jstatsoft

repo_name: yulijia/jstatsoft


text:
endpoints
=========

*endpoints* is a Scala library for defining communication protocols over HTTP between
applications.

Noteworthy features:

- endpoints descriptions are **first-class Scala values**, which can be reused,
  combined and abstracted over ;
- a *same* endpoint description can be interpreted in *multiple* ways:
    - a **client** implementation (JVM and/or Scala.js),
    - a **server** implementation,
    - an **OpenAPI** definition file,
    - thus, your client and documentation are always consistent with the actual
      implementation of your server,
- **type safety**: you get a compile-time error if you invoke an endpoint but supply incorrect data
  (requests are guaranteed to be well constructed),
- **extensibility**: you can introduce both
  - new *descriptions* that are specific to your application (e.g. the usage
    of a particular HTTP header),
  - new *interpreters* for endpoint descriptions (e.g. generation of a RAML documentation),
- **vanilla Scala**: being written in pure Scala (no macros), the implementation is easy to
  reason about and IDE friendly.

## Getting started

- Have a look at the [overview](overview.md) to understand in a few minutes what
  the library does and how its usage look like ;
- Check out the [use cases](use-cases.md) to know where *endpoints* shines ;
- [Install](installation.md) the library and follow the
  [tutorial](tutorial.md) to progressively learn all the features ;
- Explore the [API documentation](api:endpoints.algebra.package) ;
- Get in touch in the [gitter room](https://gitter.im/julienrf/endpoints).

## Contributing

See the [Github repository](https://github.com/julienrf/endpoints).


text:
databank-leveldb
================

This is the LevelDB driver for Databank.

License
-------

Copyright 2012, StatusNet Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

> http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Usage
-----

To create a LevelDB databank, use the `Databank.get()` method:

    var Databank = require('databank').Databank;

    var db = Databank.get('leveldb', {});

The driver takes the following parameters:

* `file`: the LevelDB directory. Defaults to `/tmp/databank-leveldb`.
* `schema`: the database schema, as described in the Databank README.
* `mktmp`: If set, ignore the `file` argument and make a new,
  temporary DB that will be deleted on disconnection. Good for caches or
  unit tests. Defaults to `false`.

See the main databank package for info on its interface.

Under the covers
----------------

Objects, arrays and numbers are stored as JSON-encoded strings in the
LevelDB database.

Keys in the database have the form "type:id". So a "person" with id
"evanp" is at "person:evanp".


text:
# Petris

Play online

Disclaimer: This game was created by people at Washington University in St. Louis. Since I played it at a professional retreat, and the instruction paper did not contain any author, I cannot attribute it to anyone specifically. I am copying this in electronic form in good faith, assuming there is no copyright on the material.

**Description (of the board game version):**

- The game board consists of a blank, numbered honeycomb pattern representing a petri dish.

- Each player represents a different bacterium (everyone picks a color).

**Objective:**

- The bacterium with the most points when time is up or there are fewer spots than players wins.
  - If time is up, finish the round before declaring a winner.

- 1 contact = 1 point
  - Ex: Green colonizes hexagons 4 and 13 this round. Green scores 5 points because 5 contacts between its colonies are made.

**Game play:**
- Rounds are played as follows:

  a. 1 round = everone takes a turn, game play progresses counterclockwise.

  b. Rounds 1-10: Everyone writes down the numbers of 3 hexagons before the round begins:
    - 2 for where they want their bacterium to grow a colony.
    - 1 for where they are secretly placing their antibiotic.

  c. Rounds 11+: Antibiotics are no longer allowed. Only 2 colony spots are chosen.

  d. Each player's turn = reading their 2 proposed colony numbers and coloring them in *if they are not blocked by someone else.* (Don't say your antibiotic location during your turn.)

    - Ways you can be blocked:

      a. If you have also chosen the same spot someone else is trying to colonize, say "COMPETITION" immediately.
        - The scorekeeper colors the spot black, and it is permanently out of play.

      b. If you have chosen someone's proposed colony spot as your antibiotic location, say "NOPE" immediately.

        - The spot cannot be claimed this round.

        - **Antibiotics trump "competitions."**

          - If multiple players choose the same spot to colonize during a round **and** an antibiotic is there, the spot remains in play for future rounds.

    - If you don't say anything until after their turn, you have missed your chance to block.

- The scorekeeper marks connections with black lines, writes down scores every turn, and keeps track of running totals.

- The scorekeeper starts the first round. In each successive round, the player who starts the round shifts one player counterclockwise.

repository: discolemur/Petris

repo_name: discolemur/Petris


text:
[![image_alt_preview25](https://developer.blackberry.com/files/bbm-enterprise/documents/guide/resources/images/bnr-bbm-enterprise-sdk-title.png)](https://developer.blackberry.com/files/bbm-enterprise/documents/guide/resources/images/bnr-bbm-enterprise-sdk-title.png)
# **Raspberry Pi IoT Sample**

The Raspberry Pi IoT Sample provides an example of how to interface with a hardware peripheral device that is running the Node.js BlackBerry Spark SDK. This sample reads the colour selected on a mobile application and displays it on an RGB LED connected to a Raspberry Pi.

If you would like to learn more about the BlackBerry Spark Commmunication Services, be sure to head over to our [website](https://us.blackberry.com/enterprise/bbm-enterprise-sdk).

### BlackBerry Spark SDK Guide
For more details see the
[iOS Getting Started page in the BlackBerry Spark SDK Guide](https://developer.blackberry.com/files/bbm-enterprise/documents/guide/html/gettingStarted-ios.html).

### Screenshots
[![image_alt_preview25](screenShots/screen-shots.png)](screenShots/screen-shots.png)

### Features
- **Send and receive secure data** - using the BlackBerry Spark SDK to communicate between the mobile app and hardware peripheral device.
- **Build on** - using this sample, which can be used as a skeleton for more complex secure data transfer in your enterprise use case.

## Getting Started

These instructions will help you get this project up and running on your Rasberry Pi and iOS device. **Note that this project was built using the BlackBerry Spark SDK version <IP_ADDRESS> for iOS**

### Prerequisites
**Important Note:** This project requires you have [this Node.js sample](https://github.com/blackberry/bb-spark-javascript-samples/tree/master/RaspberryPi_IoTSample) running on a Raspberry Pi 3. Refer to the Node.js sample [README.md](https://github.com/blackberry/bb-spark-javascript-samples/tree/master/RaspberryPi_IoTSample) for instructions on setting up the Raspberry Pi.

This project also requires that you have the following:
- Raspberry Pi 3 running Raspbian OS
- GPIO breakout board or equivilant jumper wires
- RGB LED

### Installation
Make sure that your development machines have cocoapods installed on it. To install the required pods for this project, `cd` to your project directory and run the following command:

```
pod install
```
This will install the required Google and Firebase pods for your app to authenticate. This will also install the required MSColorPicker pod to allow your app to select a new colour.

In order for you to run this project, you will need to include BlackBerry Spark SDK and the classes in the support group from one of the examples in BlackBerry Spark SDK bundle. Follow the instructions provided [here](https://developers.blackberry.com/us/en/products/blackberry-bbm-enterprise-sdk.html) to download the bundle.

### Configure
Your project must be configured with a BlackBerry BBME Domain, database and an IDP. For this sample, we will use Google Sign In.

If you have not already done so for the [Node.js sample]() for your Raspberry Pi, set up a new project with Google. Then open `ConfigSettings.h` and paste in the `GOOGLE_SIGNIN_CLIENTID` parameter found on [Google's Developer API Console](https://console.developers.google.com/apis/). Then head on over to your [Firebase Console](https://console.firebase.google.com/), add an new iOS project, and paste the `google.plist` file into the project to replace the missing reference.

Your Firebase database rules will need to be edited to allow the application the requireed access while keeping your data secure. Head to Database in your Firebase Console, then to Rules. Paste in the contents of rules.json (included in this repository).

You can find your `SDK_SERVICE_DOMAIN` by logging into [BlackBerry Application Portal](http://account.good.com) and navigating to the application you are using for this project.

The final step to to retrieve the Reg ID of the user logged in on the peripheral device. To do so, monitor the console output from the Raspberry Pi the first time you run it. A line will appear that reads similar to:
```sh
Your peripheral device Reg ID is:<PHONE_NUMBER>82941152
```
Your console will contain the Reg ID unique to your account. Copy that value and paste it in the `PERIPHERAL_REG_ID` parameter in your iOS app's `ConfigSettings.h`.

### Deploy
The app can be started by building and running it on your physical iOS device.
Note that this application was built for use between one iOS device and one Raspberry Pi. If multiple iOS devices are used and the application stops working, head over to  your [Firebase Console](https://console.firebase.google.com/) and delete all users from Authentication and all data from the Database.

## Authors

- **Connor Holowachuk** - Initial Work - [connor-holowachuk](https://github.com/connor-holowachuk)

## License

These samples are released as Open Source and licensed under [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html).

## Reporting Issues and Feature Requests

If you find a issue in one of the Samples or have a Feature Request, simply file an [issue](https://github.com/blackberry/bbme-sdk-ios-samples/issues).

repository: ataqizadeh/bb-spark-ios-samples

repo_name: ataqizadeh/bb-spark-ios-samples


text:
# AVM (X-Chain) API

The X-Chain, Avalanche's native platform for creating and trading assets, is an instance of the Avalanche Virtual Machine (AVM).
This API allows clients to create and trade assets on the X-Chain and other instances of the AVM.

## Format

This API uses the `json 2.0` API format.

## Endpoints

`/ext/bc/X` to interact with the X-Chain.

`/ext/bc/blockchainID` to interact with other AVM instances,
where `blockchainID` is the ID of a blockchain running the AVM.

## Methods

### avm.buildGenesis

Given a JSON representation of this Virtual Machine's genesis state, create the byte
representation of that state.

#### Endpoint

This call is made to the AVM's static API endpoint:

`/ext/vm/avm`

#### Signature

```go
avm.buildGenesis(genesisData:JSON) -> {bytes:string}
```

where `genesisData` has this form:

```json
{
"genesisData" :
    {
        "assetAlias1": {               // Each object defines an asset
            "name": "human readable name",
            "symbol":"AVAL",           // Symbol is between 0 and 4 characters
            "initialState": {
                "fixedCap" : [         // Choose the asset type.
                    {                  // Can be "fixedCap", "variableCap", "limitedTransfer", "nonFungible"
                        "amount":1000, // At genesis, address A has
                        "address":"A"  // 1000 units of asset
                    },
                    {
                        "amount":5000, // At genesis, address B has
                        "address":"B"  // 1000 units of asset
                    },
                    ...                // Can have many initial holders
                ]
            }
        },
        "assetAliasCanBeAnythingUnique": { // Asset alias can be used in place of assetID in calls
            "name": "human readable name", // names need not be unique
            "symbol": "AVAL",              // symbols need not be unique
            "initialState": {
                "variableCap" : [          // No units of the asset exist at genesis
                    {
                        "minters": [       // The signature of A or B can mint more of
                            "A",           // the asset.
                            "B"
                        ],
                        "threshold":1
                    },
                    {
                        "minters": [       // The signatures of 2 of A, B and C can mint
                            "A",           // more of the asset
                            "B",
                            "C"
                        ],
                        "threshold":2
                    },
                    ...                    // Can have many minter sets
                ]
            }
        },
        ...                                // Can list more assets
    }
}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc": "2.0",
    "id"     : 1,
    "method" : "avm.buildGenesis",
    "params" : {
        "genesisData": {
            "asset1": {
                "name": "myFixedCapAsset",
                "symbol":"MFCA",
                "initialState": {
                    "fixedCap" : [
                        {
                            "amount":100000,
                            "address": "8UeduLccQuSmYiY3fGQEyotM9uXxoHoQQ"
                        },
                        {
                            "amount":100000,
                            "address": "AgVkHvvDShLumJrzXzkwuHa7rYpewj9Kg"
                        },
                        {
                            "amount":50000,
                            "address": "AwBDGsUwNdXgVc8XG2E8A8dL3bkoVbkL9"
                        },
                        {
                            "amount":50000,
                            "address": "AATN8YjgmFjC2jQRq45sEeGcBFXNYPcM8"
                        }
                    ]
                }
            },
            "asset2": {
                "name": "myVarCapAsset",
                "symbol":"MVCA",
                "initialState": {
                    "variableCap" : [
                        {
                            "minters": [
                                "AATN8YjgmFjC2jQRq45sEeGcBFXNYPcM8",
                                "FNqMDYafoDVYQ2o4a7Zd9maJAxcUEieQb"
                            ],
                            "threshold":1
                        },
                        {
                            "minters": [
                                "JJSiKQfha9Z2TiMxBZ8XdW9F6KFw8aKS4",
                                "7jJHY1vZL6AAbCFb97KMLY8nqMQVyd5JG",
                                "58pM5cEf1wMSncPdCwtQ8tbHs2xdMA4eo"
                            ],
                            "threshold":2
                        }
                    ]
                }
            }
        }
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/vm/avm
```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "bytes":"111TNWzUtHKoSvxohjyfEwE2X228ZDGBngZ4mdMUVMnVnjtnawW1b1zbAhzyAM1v6d7ECNj6DXsT7qDmhSEf3DWgXRj7ECwBX36ZXFc9tWVB2qHURoUfdDvFsBeSRqatCmj76eZQMGZDgBFRNijRhPNKUap7bCeKpHDtuCZc4YpPkd4mR84dLL2AL1b4K46eirWKMaFVjA5btYS4DnyUx5cLpAq3d35kEdNdU5zH3rTU18S4TxYV8voMPcLCTZ3h4zRsM5jW1cUzjWVvKg7uYS2oR9qXRFcgy1gwNTFZGstySuvSF7MZeZF4zSdNgC4rbY9H94RVhqe8rW7MXqMSZB6vBTB2BpgF6tNFehmYxEXwjaKRrimX91utvZe9YjgGbDr8XHsXCnXXg4ZDCjapCy4HmmRUtUoAduGNBdGVMiwE9WvVbpMFFcNfgDXGz9NiatgSnkxQALTHvGXXm8bn4CoLFzKnAtq3KwiWqHmV3GjFYeUm3m8Zee9VDfZAvDsha51acxfto1htstxYu66DWpT36YT18WSbxibZcKXa7gZrrsCwyzid8CCWw79DbaLCUiq9u47VqofG1kgxwuuyHb8NVnTgRTkQASSbj232fyG7YeX4mAvZY7a7K7yfSyzJaXdUdR7aLeCdLP6mbFDqUMrN6YEkU2X8d4Ck3T"
    },
    "id": 1
}
```

### avm.createAddress

Create a new address controlled by the given user.

#### Signature

```go
avm.createAddress({
    username: string,
    password:string
}) -> {address: string}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "avm.createAddress",
    "params": {
        "username":"myUsername",
        "password":"myPassword"
    },
    "id": 1
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "address": "X-EKpEPX56YA1dsaHBsW8X5nGqNSwJ7JrWH"
    },
    "id": 1
}
```

### avm.createFixedCapAsset

Create a new fixed-cap, fungible asset.
A quantity of it is created at initialization and then no more is ever created.
The asset can be sent with `avm.sendFungibleAsset`.

#### Signature

```go
avm.createFixedCapAsset({
    name: string,
    symbol: string,
    denomination: int,
    initialHolders: []{
        address: string,
        amount: int
    },
    username: string,
    password: string
}) -> {assetID: string}
```

* `name` is a human-readable name for the asset. Not necessarily unique.
* `symbol` is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. May be omitted.
* `denomination` determines how balances of this asset are displayed by user interfaces. If `denomination` is 0, 100 units of this asset are displayed as 100. If `denomination` is 1, 100 units of this asset are displayed as 10.0. If `denomination` is 2, 100 units of this asset are displays as .100, etc.
* In the future, performing a transaction on an AVM instance will require a transaction fee (paid in AVAX tokens). `username` and `password` denote the user paying the fee.
  That user will need to hold enough AVAX to cover the fee.
  Since there are no transaction fees right now, you can leave `username` and `password` blank.
* Each element in `initialHolders` specifies that `address` holds `amount` units of the asset at genesis.
* `assetID` is the ID of the new asset.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.createFixedCapAsset",
    "params" :{
        "name": "myFixedCapAsset",
        "symbol":"MFCA",
        "initialHolders": [
            {
                "address": "X-AW87kLa9vP6TqEVsfvmLcTrroi73CQkng",
                "amount": 10000
            },
            {
                "address":"X-Gwafp5KZKPxtZbrW7RtQ7w1cQEAbVntGn",
                "amount":50000
            }
        ],
        "username":"myUsername",
        "password":"myPassword"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "assetID":"ZiKfqRXCZgHLgZ4rxGU9Qbycdzuq5DRY4tdSNS9ku8kcNxNLD"
    }
}
```

### avm.createMintTx

Create an unsigned transaction to mint more of a variable-cap asset (an asset created with `avm.createVariableCapAsset`.)

#### Signature

```go
avm.createMintTx({
    amount: int,
    assetID: string,
    to: string,
    minters: []string
}) -> {tx: string}
```

* `amount` units of `assetID` will be created and controlled by address `to`.
* `minters` are the minters that will sign this transaction before it's issued.
  `minters` must be `threshold` addresses from one of this asset's minter sets.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.createMintTx",
    "params" :{
        "amount":10000000,
        "assetID":"2QbZFE7J4MAny9iXHUwq8Pz8SpFhWk3maCw4SkinVPv6wPmAbK",
        "to":"X-AHFNFP9rqditmGx4ZkSewmkyRPbBpnf22",
        "minters":[
            "X-AHFNFP9rqditmGx4ZkSewmkyRPbBpnf22",
            "X-PkGQYz92QaCSCUbY48pZ9fhXgDX2Z4hAb"
        ]
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "tx":"NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj"
    }
}
```

### avm.createVariableCapAsset

Create a new variable-cap, fungible asset. No units of the asset exist at initialization.
Minters can mint units of this asset using `createMintTx`, `signMintTx` and `issueTx`.
The asset can be sent with `avm.send`.

See [this tutorial](../tutorials/variable-cap-asset.md) for an example of usage.

#### Signature

```go
avm.createVariableCapAsset({
    name: string,
    symbol: string,
    denomination: int,
    minterSets []{
        minters: []string,
        threshold: int
    },
    username: string,
    password: string
}) -> {assetID: string}
```

* `name` is a human-readable name for the asset. Not necessarily unique.
* `symbol` is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. May be omitted.
* `denomination` determines how balances of this asset are displayed by user interfaces. If denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as .100, etc.
* `minterSets` is a list where each element specifies that `threshold` of the addresses
  in `minters` may together mint more of the asset by signing a minting transaction.
* In the future, performing a transaction on an AVM instance will require a transaction fee (paid in AVAX tokens). `username` and `password` denote the user paying the fee.
  That user will need to hold enough AVAX to cover the fee.
  Since there are no transaction fees right now, you can leave `username` and `password` blank.
* `assetID` is the ID of the new asset.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.createVariableCapAsset",
    "params" :{
        "name":"myVariableCapAsset",
        "symbol":"MFCA",
        "minterSets":[
            {
                "minters":[
                    "X-5LC8hETB2XeTPrLGk8jjjZZVU6VzW1kXw"
                ],
                "threshold": 1
            },
            {
                "minters": [
                    "X-81XNrdH8xwRk8A9u6vAtLssiZYv7YFb6h",
                    "X-8sL4nTb2L2AZo9Bkp1TFPxxFf6GpRMsdf",
                    "X-NyiSJaddAG6GGTKHDroWs3PytbuvqfKXo"
                ],
                "threshold": 2
            }
        ],
        "username":"myUsername",
        "password":"myPassword"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "assetID":"2QbZFE7J4MAny9iXHUwq8Pz8SpFhWk3maCw4SkinVPv6wPmAbK"
    }
}
```

### avm.exportAVA

(Note: This method will change to `exportAVAX` in the next release.)

Send AVAX from the X-Chain to an account on the P-Chain.
After calling this method, you must call the P-Chain's [`importAVA`](./platform.md#platformimportava) method to complete the transfer.

#### Signature

```go
avm.exportAVA({
    to: string,
    amount: int,
    username: string,
    password:string,
}) -> {txID: string}
```

* `to` is the ID of the P-Chain account the AVAX is sent to.
* `amount` is the amount of nAVAX to send.
* The AVAX is sent from addresses controlled by `username`

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.exportAVA",
    "params" :{
        "to":"Bg6e45gxCUTLXcfUuoy3go2U6V3bRZ5jH",
        "amount": 500,
        "username":"myUsername",
        "password":"myPassword"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "txID": "25VzbNzt3gi2vkE3Kr6H9KJeSR2tXkr8FsBCm3vARnB5foLVmx"
    },
    "id": 1
}
```

### avm.exportKey

Get the private key that controls a given address.
The returned private key can be added to a user with `avm.importKey`.

#### Signature

```go
avm.exportKey({
    username: string,
    password:string,
    address:string
}) -> {privateKey: string}
```

* `username` must control `address`.
* `privateKey` is the string representation of the private key that controls `address`.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.exportKey",
    "params" :{
        "username" :"myUsername",
        "password":"myPassword",
        "address": "X-7u5FQArVaMSgGZzeTE9ckheWtDhU5T3KS"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "privateKey":"2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq"
    }
}
```

### avm.getAllBalances

Get the balances of all assets controlled by a given address.

#### Signature

```go
avm.getAllBalances({address:string}) -> {
    balances: []{
        asset: string,
        balance: int
    }
}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.getAllBalances",
    "params" :{
        "address":"X-Go7PyA65ZUVichsQVmAt9d65h2S7Exiw"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "balances": [
            {
                "asset": "AVA",
                "balance": "102"
            },
            {
                "asset": "2sdnziCz37Jov3QSNMXcFRGFJ1tgauaj6L7qfk7yUcRPfQMC79",
                "balance": "10000"
            }
        ]
    },
    "id": 1
}
```

### avm.getAssetDescription

Get information about an asset.

#### Signature

```go
avm.getAssetDescription({assetID: string}) -> {name: string, symbol: string, denomination:int}
```

* `name` is the asset's human-readable, not necessarily unique name.
* `symbol` is the asset's symbol.
* `denomination` determines how balances of this asset are displayed by user interfaces. If denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as .100, etc.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getAssetDescription",
    "params" :{
        "assetID" :"ZiKfqRXCZgHLgZ4rxGU9Qbycdzuq5DRY4tdSNS9ku8kcNxNLD"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "name":"My asset name",
        "symbol":"MyAN"
    }
}
```

### avm.getBalance

Get the balance of an asset controlled by a given address.

#### Signature

```go
avm.getBalance({
    address:string,
    assetID: string
}) -> {balance: int}
```

#### Example Call

```json
curl -X POST --data '{
  "jsonrpc":"2.0",
  "id"     : 1,
  "method" :"avm.getBalance",
  "params" :{
      "address":"X-EKpEPX56YA1dsaHBsW8X5nGqNSwJ7JrWH",
      "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC"
  }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "balance":"299999999999900",
        "utxoIDs":[
            {
                "txID":"WPQdyLNqHfiEKp4zcCpayRHYDVYuh1hqs9c1RqgZXS4VPgdvo",
                "outputIndex":1
            }
        ]
    }
}
```

### avm.getTx

Returns the specified transaction

#### Signature

```go
avm.getTx({txID: string}) -> {tx: string}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getTx",
    "params" :{
        "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "tx":"1111111vQFqEEHkkAGwJnpdAJgga28zHk9pFARHp1VWe3QM5wC7ztGA5cZAPanFWXHkhbWEbFs9qsEpNZ7QHrzucUUZqLEPrAwJZLrZBik4dEhbsTCF3nS6s2fXVzc5ar2esLFD92WVMZmJNuTUQuKjVkjag2Gy3HHYSqm6bojrG62KrazywKPhrYx8QF9AqNfYYwD3XcSUV1g46r7sQ1WqzM8nyG4qL517JS1YVuTC3aWPeN5cxP6FdvbYexwHcgaBtiQsYbCEeZ9cuJqhE2Pxx8BJFpicLN8FBexb6fzQyBLiFR7yx6v6YBjq7dtu9MBczFdNCnDE4MsG2SyPZsdUv1XxQYVVwDqgqi8Zto5esJKph72YZbrXX3SHVSZBFZXkKbTzyEQFWHCF1jC"
    }
}
```

### avm.getTxStatus

Get the status of a transaction sent to the network.

#### Signature

```go
avm.getTxStatus({txID: string}) -> {status: string}
```

`status` is one of:

* `Accepted`: The transaction is (or will be) accepted by every node
* `Processing`: The transaction is being voted on by this node
* `Rejected`: The transaction will never be accepted by any node in the network
* `Unknown`: The transaction hasn't been seen by this node

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getTxStatus",
    "params" :{
        "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "status":"Accepted"
    }
}
```

### avm.getUTXOs

Get the UTXOs that reference a given address.

#### Signature

```go
avm.getUTXOs({addresses: string}) -> {utxos: []string}
```

* `UTXOs` is a list of UTXOs such that each UTXO references at least one address in `addresses`

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getUTXOs",
    "params" :{
        "addresses":["X-xMrKg8uUECt5CS9RE9j5hizv2t2SWTbk"]
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```go
{
    "jsonrpc": "2.0",
    "result": {
        "utxos": [
            "3ng2kBneUGy8SY98FgNvEMPo2pgL7m9UqcTDbL4svzdNKiuTpQCewGeJyTqppjMjaimnAvQfVfBTWcy2Da2CAKMy9P3Pu6E4nqp7NbrNN1aptYTEGoeg6oMjV76QGiWn37RhFcWuboDLst778nemsE7RrNhccgnHAXCQ"
        ]
    },
    "id": 1
}
```

### avm.importAVA

(Note: This method will change to `importAVAX` in the next release.)

Finalize a transfer of AVAX from the P-Chain to the X-Chain.

Before this method is called, you must call the P-Chain's [`exportAVA`](./platform.md#platformexportava) method to initiate the transfer.

#### Signature

```go
avm.importAVA({
    to: string,
    username: string,
    password:string,
}) -> {txID: string}
```

* `to` is the address the AVAX is sent to.
  This must be the same as the `to` argument in the corresponding call to the P-Chain's `exportAVA`,
  except that the prepended `X-` should be included in this argument.
* `username` is the user that controls `to`.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.importAVA",
    "params" :{
    	"username":"myUsername",
    	"password":"myPassword",
        "to":"X-G5ZGXEfoWYNFZH5JF9C4QPKAbPTKwRbyB"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "txID": "MqEaeWc4rfkw9fhRMuMTN7KUTNpFmh9Fd7KSre1ZqTsTQG73h"
    },
    "id": 1
}
```

### avm.importKey

Give a user control over an address by providing the private key that controls the address.

#### Signature

```go
avm.importKey({
    username: string,
    password:string,
    privateKey:string
}) -> {address: string}
```

* Add `privateKey` to `username`'s set of private keys. `address` is the address `username` now controls with the private key.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.importKey",
    "params" :{
        "username" :"myUsername",
        "password":"myPassword",
        "privateKey":"2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "address":"X-7u5FQArVaMSgGZzeTE9ckheWtDhU5T3KS"
    }
}
```

### avm.issueTx

Send a signed transaction to the network.

#### Signature

```go
avm.issueTx({tx: string}) -> {txID: string}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.issueTx",
    "params" :{
        "tx":"6sTENqXfk3gahxkJbEPsmX9eJTEFZRSRw83cRJqoHWBiaeAhVbz9QV4i6SLd6Dek4eLsojeR8FbT3arFtsGz9ycpHFaWHLX69edJPEmj2tPApsEqsFd7wDVp7fFxkG6HmySR"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "txID":"NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj"
    }
}
```

### avm.listAddresses

List addresses controlled by the given user.

#### Signature

```go
avm.listAddresses({
    username: string,
    password: string
}) -> {addresses: []string}
```

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "avm.listAddresses",
    "params": {
        "username":"myUsername",
        "password":"myPassword"
    },
    "id": 1
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X

```

#### Example Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "addresses": ["X-EKpEPX56YA1dsaHBsW8X5nGqNSwJ7JrWH"]
    },
    "id": 1
}
```

### avm.send

Send a quantity of an asset to an address.

#### Signature

```go
avm.Send({
    amount: int,
    assetID: string,
    to: string,
    username: string,
    password: string
}) -> {txID: string}
```

* Sends `amount` units of asset with ID `assetID` to address `to`.
  `amount` is denominated in the smallest increment of the asset.
  For AVAX this is 1 nAVAX (one billionth of 1 AVAX.)
* The asset is sent from addresses controlled by user `username`.
  (Of course, that user will need to hold at least the balance of the asset being sent.)

(Note: The asset ID of AVAX is AVA on nodes running Denali or earlier. The ID will change to AVAX in the next release.)

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.send",
    "params" :{
        "assetID" :"AVA",
        "amount"  :10000,
        "to"      :"X-xMrKg8uUECt5CS9RE9j5hizv2t2SWTbk",
        "username":"userThatControlsAtLeast10000OfThisAsset",
        "password":"myPassword"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "txID":"2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1"
    }
}
```

### avm.signMintTx

Sign an unsigned or partially signed transaction.

#### Signature

```go
avm.signMintTx({
    tx: string,
    minter: string,
    username: string,
    password: string
}) ->
{tx: string}
```

* `tx` is an unsigned or partially signed mint transaction.
* `minter` is the address signing this transaction.
* `username` is the user that controls address `minter`.

#### Example Call

```json
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.signMintTx",
    "params" :{
        "tx":"1112yKaDdTb7XZXqX38X8U6ro7EC4GQdxDU48eHTcoQxPtJncHSQEMCi9n3hYaPp33K95i8sntkox5ZMHNq26DeNui4yuSQANXgFEeondXZvq65Pk1jnXbUpkJPkjX4KG1W9XQMAmCNpXs5xHzpX4THcYg3WY569Rj7cdf9Km4FQ3r3VDUAn1dpZLsCyQHeGb8Lr3ub7PGh4pn42KPAWsS6N4xCAGg1GGww2XNBxoDfu81toejPJFuqTJQg6tzgL82uT3amebb4FYQVU5B2gxH5Amevm1zsiTTfNDWui4BfB6e7jt8fc36UWYgb4MiaaApmySUe4ndt7SjFTT6taDkVNFdbUWuNEfiebrYFLpqL86mQ1XD",
        "minter":"X-xMrKg8uUECt5CS9RE9j5hizv2t2SWTbk",
        "username":"userThatControlsTheSignerAddress",
        "password":"passwordOfThatUser"
    }
}' -H 'content-type:application/json;' <IP_ADDRESS>:9650/ext/bc/X
```

#### Example Response

```json
{
    "jsonrpc":"2.0",
    "id"     :1,
    "result" :{
        "tx":"1112yKaDdTb7XZXqX38X8U6ro7EC4GQdxDU48eHTcoQxPtJncHSQEMCi9n3hYaPp33K95i8sntkox5ZMHNq26DeNui4yuSQANXgFEeondXZvq65Pk1jnXbUpkJPkjX4KG1W9XQMAmCNpXs5xHzpX4THcYg3WY569Rj7cdf9Km4FQ3r3VDUAn1dpZLsCyQHeGb8Lr3ub7PGh4pn42KPAWsS6N4xCAGg1GGww2XNBxoDfu81toejPJFuqTJQg6tzgL82uT3amebb4FYQVU5B2gxH5Amevm1zsiTTfNDWui4BfB6e7jt8fc36UWYgb4MiaaApmySUe4ndt7SjFTT6taDkVNFdbUWuNEfiebrYFLpqL86mQ1XD"
    }
}
```

repository: tyler-smith/docs

repo_name: tyler-smith/docs


text:
---
title: Automating Spinnaker
aliases:
  - /user-guides/writing-scripts/
  - /user-guides/writing_scripts/
  - /user_guides/writing-scripts/
  - /user_guides/writing_scripts/
  - /spinnaker_user_guides/writing_scripts/
  - /spinnaker_user_guides/writing-scripts/
  - /spinnaker-user-guides/writing_scripts/
description: >
  Access Spinnaker's REST APIs.
---

## API docs
People often ask how they can write scripts and use Spinnaker™ programmatically. Spinnaker is a collection of subservices that all expose a RESTful API. You can see a list (with descriptions) of all of the endpoints by navigating to:

```
http(s)://<your-gate-url>/swagger-ui.html
```

Note: you may need to append your url with the gate port, `:8084`.

You should see a screen that looks like:

![](/images/Image-2017-04-03-at-4.06.51-PM.png)

You can click on the controller you are interested in to see endpoints related to it. You can even test out hitting these different endpoints right in the UI.

## Auth

Being able to access the API when auth is enabled requires a certain configuration by your Spinnaker Administrator. They will need to enable programmatic access via mutual tls (x509 certs). Then you will need to use a cert when communicating with the API.

repository: dev-chulbuji/docs

repo_name: dev-chulbuji/docs


text:
# Contributing to Project
**All** are welcome to contribute to our efforts to combat gerrymandering. If making a PR for a certain issue, please reference issue number.

## General Guidelines
- All PR's should ideally be unit tested.
- All code should be run through linter (StandardJS)
- For code that makes significantly large changes to application, PR should be reviewed by two or more individuals.
- Otherwise, most PR's can be adequately reviewed by one individual. (Anyone is free to comment on a PR they feel deserves multiple reviewers)
- PR's should ideally be reviewed and/or merged within 1-3 days of request, and no later than a week.
- Don't hesitate to reach out to other members of the project for any issues/questions concerning your PR

### Don't be afraid to contribute! The more help, the better :D

repository: Anti-Gerrymandering/visualization

repo_name: Anti-Gerrymandering/visualization


text:
---
title: Using a binary coding trick illustrated by a Car Talk puzzler
author: Steve Simon
date: 2011-05-21
categories:
- Blog post
tags:
- Data management
output: html_document
---

I often need to see how often certain variables and combinations of those variables appear in a data set. If the variable is binary, there is a trick for doing this that is illustrated by a Car Talk puzzler.

<!---More--->

Car Talk is a program on National Public Radio where listeners call in to ask questions about car repair from two experts, Tom and Ray Magliozzi. As part of the show, they include a Puzzler. The Puzzler is a question, sometimes related to automobiles, but sometimes not. Some of the most interesting Puzzlers (to me anyway) are about Mathematics.

One Mathematical Puzzler actually relates to the coding problem described above.

+ [Car talk puzzler][car1]

The basic setup is that you have seven stacks of coins. Each stack has 100 coins in it, and all of the coins in the stack are either genuine or counterfeit. A genuine coin weights 10 grams and a counterfeit coin weights 11 grams. You could tell whether a stack of coins was counterfeit by weighing the stack. A value of 1,000 grams indicates a genuine stack of coins and a value of 1,100 grams indicates a counterfeit stack. Do this six more times and you would establish which stacks were genuine and which stacks were counterfeit. But there is a way to identify whether none, some, or all of the stacks are counterfeit and which ones they are using a single weighing.

The way you do this is to select 127 coins: 1 from the first stack, 2 from the second stack, 4 (not 3) from the third stack, 8 from the fourth stack, etc. Following this sequence of powers of two, you would get 64 (=2^7) coins from the seventh stack. Notice that 1 + 2 + 4 + 8 + 16 + 32 + 64 = 127.

If all the coins are genuine, this stack will weigh 1,270 grams. If only the first stack is counterfeit, you would be over by one gram because of the 11 gram counterfeit coin from this stack replaces the 10 gram genuine coin. Similarly if the second stack is counterfeit those two bogus coins would add two extra grams to your weight.

Notice what happens with 3 grams overweight. This occurs when only the first and second stacks are counterfeit. That's because we very carefully picked four instead of three coins from the third stack. If we had foolishly used three coins from the third stack, then three grams overweight could represent either the first and second stacks only being counterfeit or the third stack only being counterfeit. Likewise, we chose 8 coins for the fourth stack because the maximum amount of excess weight among the 1 + 2 + 4 coins in the first, second, and third stacks is 7.

The amount of excess weight tells you which stacks are counterfeit by a binary representation of that number. For example 66 is represented by 1000010 in binary and this tells you that the seventh stack (64 coins) and the second stack (2 coins) are the only counterfeit coins.

How does this help in Statistics? I had a project with five exclusion factors: cancer, trauma, iv drug abuse, certain neurological conditions, and acute lower back pain.

So I created a new variable:

```{}
COMPUTE cod=(can=1)*16+(trm=1)*8+(ivd=1)*4+(neu=1)*2+(lbp)*1.
```

The variables can, trm, etc. were coded as 1 if the exclusionary criteria were met and 0 if they were not.

If none of the exclusionary criteria were met for a particular patient, you would see a value of 0. This is similar to having seven stacks of genuine coins. A value of 16 means an exclusion only because of cancer, 8 means an exclusion only because of trauma, etc. Here are the frequencies for the newly created variable.

```{}
 0 45020
 1  2095
 2   293
 3    90
 4    70
 5     6
 6     2
 8  8426
 9   754
10    94
11    30
12    30
14     1
16  5037
17   361
18    63
19    11
20     7
21     1
24  1077
25   126
26    17
27     3
28     1
```

Notice that 45,020 patients have no exclusions. There are 15,921 cases with one and only one exclusionary criteria: 2,095 for acute lower back pain (1), 293 for neurological problems (2), 70 for iv drug abuse (4), 8,426 for trauma (8), and 5,037 for cancer (16).

Certain codes correspond to exactly two exclusions (3=1+2, 5=1+4, 6=2+4, 9=1+8, 10=2+8, 12=4+8, 17=1+16, 18=2+16, 20=4+16, 24=8+16). There are 90 + 6 + 2 + 754 + 94 + 30 + 361 + 63 + 7 + 1,077 = 2,484 of these cases, with the most common combination of exclusion criteria being cancer and trauma (1,077 cases corresponding to the value of 24).

Only a handful of cases have three exclusionary criteria (11=1+2+8, 14=2+4+8, 19=1+2+16, 21=1+4+16, 25=1+8+16, 26=2+8+16, and 28=4+8+16) corresponding to 30 + 1 + 11 + 1 + 126 + 1 = 187 cases. The most common of these combinations is cancer, trauma, and acute lower back pain.

The only combination of exclusionary factors occuring four times is cancer, trauma, neurological problems, and acute lower back pain (27=1+2+8+16). No patients had all five exclusionary criteria, which would have coded as 31.

This is rather difficult for the average person to follow, so here is a relabeling of the exclusion reasons

```{}
 none  (0) 45020
    b  (1)  2095
   n   (2)   293
   nb  (3)    90
  i    (4)    70
  i b  (5)     6
  in   (6)     2
 t     (8)  8426
 t  b  (9)   754
 t n  (10)    94
 t nb (11)    30
 ti   (12)    30
 tib  (14)     1
c     (16)  5037
c   b (17)   361
c  n  (18)    63
c  nb (19)    11
c i   (20)     7
c i b (21)     1
ct    (24)  1077
ct  n (25)   126
ct b  (26)    17
ct bn (27)     3
cti   (28)     1
```

Note that b=acute lower back pain, n=neurologic problems, i=iv drug abuse, t=trauma, and c=cancer.

You can find an [earlier version][sim1] of this page on my [original website][sim2].

[car1]: https://www.cartalk.com/radio/puzzler/search-bogus-coins

[sim1]: http://www.pmean.com/11/BinaryCoding.html
[sim2]: http://www.pmean.com/original_site.html

repository: pmean/build-website

repo_name: pmean/build-website


text:
# SG-Separation

Star/galaxy separation with `sklearn` machine learning models.

Main notebook: [`Machine Learning for Star/Galaxy Separation`](Machine%20Learning%20for%20Star%20Galaxy%20Separation.ipynb)

*This work is the final project of ASTRO 9, summer, 2019. Special thanks to Professor Ben Horowitz.*

## Requirements

*   `requests`, `PIL`: for data acquiring

*   `sklearn`, `pandas`: for machine learning

repository: nyLiao/SG-Separation

repo_name: nyLiao/SG-Separation


text:
# Individual Challenges

## Interactive navigation bar

Create a navigation bar out of an unordered list element, and add the following interactivity.

1. When the user hovers over one of the links, the color of the text should change.
1. When the user hovers over one of the links, the background color of the element that contains the link should change.
1. When the user clicks on one of the links, the element that contains the link should grow in size by 5px on the left and right.

## Sticky navigation bar

You will learn more about how to do this in CSS102, but if you want a challenge now, create a web page that has a navigation bar and plenty of articles so that the content goes well below the fold (fancy term for the amount of real estate that exists when the user first loads the page).

When the user scrolls now to read the rest of the content, the navigation bar should remain at the top of the page, always visible, no matter how far down the user scrolls.

## Math Magician 1

What is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder?

## Math Magician 2

What is the difference between the sum of the squares of the first ten natural numbers, and the square of the sum of the first ten natural numbers?

## Fibonacci

Write a [Fibonacci number](https://en.wikipedia.org/wiki/Fibonacci_number) generator that outputs the numbers in the series that are less than 500.

## Animated Box

1. Add a red, 100px x 100px div and a button to a basic HTML page
1. When the button is clicked, make the div double in size, and change the color from red to blue.
1. After 3 seconds, make the div revert to its original size and color.

## CSS in Space!!

Your challenge is to replicate the shapes, and the animations that you see in the animated GIF below. You must **only use CSS**. No JavaScript and no images.

<img src="fKDwWc0Stk.gif">

# Team Challenges

## Alpha and Omega

1. Create an HTML page that contains a text area and a button labeled *Create*.
1. When the user enters in text into the text area and then clicks the create button, create a new card element in the DOM - similar to the quiz and group project. You decide the height/width of the card.
1. Above the text on each card, there must be two input controls of type `color`.
1. Above the text on each card, there must be a button element labeled *Delete*.
1. When the user selects a color from the first input, then the background color of that card, and no other cards, should change to the color chosen.
1. When the user selects a color from the second input, then the font color of that card, and no other cards, should change to the color chosen.
1. When the user clicks the *Delete* button, the containing card, and no other cards, should then be removed from the DOM. Not just made invisible, actually removed from the DOM.

## Chameleon Colors Containers

1. In HTML, create 3 divs
1. Give each div a background color
1. When one of the three divs is clicked do the following:
1. Give the selected/clicked div a border to indicate it has been selected
1. Reveal a form with an input box and a button
1. The user should now be able to enter a color value in the input field.
1. When the corresponding button is clicked, the currently selected div should change its background color to the color value the user entered in the input box.

## Tic Tac Toe

1. Create a grid of nine boxes
1. When any box is clicked a red `X` appears
1. When the next box is clicked a Blue `O` appears
1. #1 and #2 are repeated until a row of 3 of the same character is created
1. When a win happens:
    1. Alert the players who won
    1. Disallow any further clicks on the game board
    1. Display a `Play Again` button that resets the game
1. For a tie:
    1. Alert players that game has ended in a tie
    1. Display a `Play Again` button that resets the game


text:
# Controller Name

## Specific name of the endpoint e.g. Create Account

```shell

```

```csharp

```

```java

```

```ruby

```

```python

```

```javascript

```

> The above command returns JSON structured like this:

```json

```

Description of what the endpoint does.

### HTTP Request

GET
https://uat.mppglobal.com/

### Parameters
 |  |  |
--------- | ------- | ------- |

`op`
The type of change that should be executed. add, replace and remove are available operations.| string | Required |

repository: JoshuaJFogg/slate

repo_name: JoshuaJFogg/slate


text:
---
title: "Going From Ember to Vue"
date: "2019-08-03T17:02:38.041Z"
template: "post"
draft: false
slug: "/posts/going-from-ember-to-vue/"
category: "Engineering"
banner: "https://miro.medium.com/max/3840/1*nfvapd86apvGH-hNBYkYuw.png"
filename: "Going-from-ember-to-vue.md"
tags:
  - "Engineering"
  - "Ember"
  - "Vue"
  - "JavaScript"
  - "Web Development"
description: "Thinking of looking into another framework other than Ember? React might seem like the obvious choice due to popularity, but consider taking a look at Vue first!"
---

![Vue.js logo](https://miro.medium.com/max/3840/1*nfvapd86apvGH-hNBYkYuw.png)

If you know me, you know that I love Ember and have worked with it (and the community) for several years.
But recently, I took another job where I won't be writing it anymore [(I wrote a whole post about this if you're interested)](/posts/a-few-thoughts-on-ember/).
My first instinct when looking for a new job was to learn React, due to popularity, but I found it was hard to jump straight from Ember into React.
It wasn't impossible, but I felt I had to unlearn some habits that I had formed.
For the past few months though, I have been working on a Vue project and I have found the leap from Ember to Vue was much more straight forward.

So, I was going to take some time and write about the similarities and differences I have experienced.
Even if you still love Ember and plan on working with it for a while, I would encourage you to look at Vue just to see what else is out there.

## What's the point of this post?

I mostly want to focus on what similarities exist to encourage those writing Ember to try taking a look at Vue.
Obviously, there are too many differences to list, so I just want to talk about some major points.

# Some big differences

Much like React, Vue is a component library -- which means you'll be using components for everything.
That means no controllers or route objects.
When you create a route, you are pointing to a component.
There is literally nothing special about this component -- it can be any component that you want (in fact, you can use it both as a route _and_ component on the page... although, you really shouldn't).

## Batteries aren't included

![Batteries](https://i.imgur.com/65SKMnM.jpg?1)
Photo by Hilary Halliwell on Pexels

This isn't meant to be a knock on Vue, but it doesn't come with as much stuff out of the box as Ember.
[Vue CLI](https://cli.vuejs.org/) allows you to generate a project quickly, but much like [Create React App](https://github.com/facebook/create-react-app), you are getting a pretty simple UI application with webpack pre-configured for you.
And yes, webpack over brocolli is another big difference... but it's probably a good one (noted disclaimer that [ember-embroider](https://github.com/embroider-build/embroider) is helping the community move towards webpack).

However, anything you want to do in ember, probably already has an equivalent library in Vue.
And most of these libraries are maintained by core team members, so they feel very official (unlike the React ecosystem).
With just a couple more `vue add` commands, you can get routing and state management in your app, so "batteries not included" isn't a _huge_ knock against Vue.
In fact, both [Vuex](https://vuex.vuejs.org/) and [Vue Router](https://router.vuejs.org/) are subdomains of the official Vue website -- showing developers that these are real considerations by the core team.
You probably won't find a large Vue application without these things installed already.

## Components are one file

I found this weird at first, but boy, do I like components with both markup and JavaScript in the same file.
I hated having to bounce between files so often in Ember (especially when the community wanted to move away from pod structure).
Disclaimer: there is [currently an rfc that could help move toward single-file components](https://github.com/emberjs/rfcs/pull/454).

Ugh, markup and JS in the same file?? I believe in separation of concerns.

      — People who want you to know they're smart.

I've actually heard this complaint a few times about "I don't like JS/HTML/CSS in the same file because I like separation of concerns."
I get the sentiment, but to be clear, just because "concerns" are in the same file, doesn't mean they aren't separated.
The JavaScript of a component is too tightly tied to the markup (as it should be), so why force yourself to bounce between the two files?

## State management

The popular state management solution seems to be [Vuex](https://vuex.vuejs.org/) (another "official" Vue library written by core team members).
This is much closer to [Redux](https://redux.js.org/) or [NGRX](https://ngrx.io/) -- if you're familiar with those libraries, you'll be able to jump right into Vuex.
As I [learned from the reviews on this post](https://github.com/sbatson5/imposter-syndrome-blog/pull/14), there are way too many differences to list here as [Ember data](https://github.com/emberjs/data) and Vuex are two very different approaches.
I will say that if you learn Vuex, you'll be able to jump into Redux without issue, which I consider a huge plus.
You might find the learning curve steep here if you have only used Ember data, but it's definitely worth checking out other solutions.

# Similarities

![Spider-Man pointing to Spider-Man](https://i.kym-cdn.com/entries/icons/mobile/000/023/397/C-658VsXoAo3ovC.jpg)

Ok, let's talk about the similarities (which is really the point of this post).

## Components

Components in Vue are more similar to Ember than the ones in React.
Obviously, there is a lot that goes on under the hood, but I just want to focus on how this affects you, the developer.
First of all, you aren't writing JSX -- you are writing plain ol' HTML.

Here is a typical setup for a component in Vue:

```HTML
<template>
  <div>
    <SomeCustomComponent :title="title" @click="someMethod" />
  </div>
</template>

<script>
import SomeCustomComponent from './somewhere/SomeCustomComponent';

export default {
  name: 'YourComponent',

  components: {
    SomeCustomComponent
  },

  props: {
    jobs: {
      type: Array,
      required: false,
    }
  },

  data() {
    return {
      firstName: 'Scott',
      lastName: 'Batson',
      title: 'Boss'
    }
  },

  computed: {
    fullName() {
      return `${this.firstName} ${this.lastName}`;
    }
  },

  methods: {
    someMethod() {
      this.$store.dispatch('foo', this.title);
      this.emit('something-that-bubbles');
    }
  }
}
</script>
```

Ok, it might seem like there is a lot there, but not every component will need all of these things.
I just wanted some examples of the major key pieces.

First off, all of the markup is wrapped in a `template`.
After that, you are writing normal HTML.
The syntax is just like `<AngleBracket />` components in Ember, but the differences (for now) is that you have to import them.
This saves you from potential name collision, as an npm package might have a component with the same name as yours.
You could do:
```
import SomeCustomComponent as Monkey from '@something/components';
```
and rename a component easily.
Again, this is something in an RFC for Ember already but it cements a point I made in an earlier post that [the resolver is a bit too clever sometimes](/posts/a-few-thoughts-on-ember/#3-make-the-resolver-less-clever).

## Methods/Actions

When using a component, we have similar patterns as Ember.
You need to append a `:` to properties you pass down to a component.
So, if my parent component has a property called `author` and I want to pass `author.name` down to a child component as `fullname`, here is how it would by comparison:
```HTML
<!-- Vue -->
<AuthorInfo :fullname="author.name" />
<!-- Ember -->
<AuthorInfo @fullname={{author.name}} />
```
As you can see the syntax isn't hard to learn.

`methods` are the equivalent of `actions` in Ember -- if there is a function that is going to be called from the template, it is in the `methods` hash.
Functions can live outside of that hash (obviously) but this tells you what you expect to interact with your markup.
In Ember, you can call functions on your component by _not_ using the `action` helper, but Vue forces this convention on you, separating your template functions.

If you look at the `someMethod` function, you will see the last line calls `this.emit('something-that-bubbles');`.
This is how we accomplish something similar to "Data Down, Actions Up" (DDAU).
It's a bit different and shouldn't be used for every case, but basically, when we `emit` something, any parent component can listen to that event (in this case `something-that-bubbles`) and respond to it.
This means that the child component does not need to receive an action as a parameter.
All it does is emit something, pass any properties along with it and then it stops caring.
It's up to the parent component to listen to it and respond.

If you are doing something that updates application state, then `emit` and passing functions around isn't the right solution and you should instead rely on Vuex.

One of the things I disliked with the actions helper in Ember was that I might not always pass an action down for every instance of my component.
Say you had a component like this in Ember:
```HTML
<!-- Ember component -->
<AuthorInfo @updateProfile={{action "updateProfile"}} />
```
We pass down an action called `updateProfile` which allows the logged in user to update their profile.
However, I want to use that same layout elsewhere when viewing a post, but it isn't editable.
So, I simply don't pass down that action: `<AuthorInfo />`.
If the user triggers that action, however, I will get an error like `this.updateProfile is not a function` (or something similar).
That might be the behavior you want (throwing an error when something isn't properly passed down), but I felt there was a lot of confusion when we moved from `sendAction` to calling the action directly as a function.

With emitting, the child component won't hit that type of error, as all it does is emit something out and it's up to the parent to intercept it.
Calling `this.emit('update-profile')` won't cause an error if parent component doesn't have a method for updating that profile.

## Computed Properties

Properties that needs to be available on the template, need to be declared in the hash returned by the `data` function.
This would be for local state on the component (computed properties and props passed down don't need to be added here).
This ends up being really handy in documenting what shows up in your template.
Computed properties are declared in the `computed` hash and behave very similarly to Ember.

I love computed properties in Ember and was a bit miffed when there wasn't something similar in React.

So, we go from something like this Ember:

```javascript
fullName: computed('firstName', 'lastName', function() {
  return `${this.firstName} ${this.lastName}`;
})
```

To this in Vue:

```javascript
fullName() {
  return `${this.firstName} ${this.lastName}`;
}
```

Computed properties have the same issues in Vue as Ember, in that it won't observe nested arrays for performance reasons -- instead, you'd usually create an intermediary computed property.

## The Router

![A Router](https://i.imgur.com/xlUWWN7.jpg?1)
Photo by Rawpixel on Pexels

The router in Vue feels like a good mix between react-router and the Ember Router.
Let's just look at a full example of a router in Vue:

```javascript
import Vue from 'vue';
import Router from 'vue-router';
import { auth } from 'utils';

import { NotFound, Dashboard, Login } from 'routes';

Vue.use(Router);

const router = new Router({
  mode: 'history',
  routes: [
    {
      path: '*',
      component: NotFound
    },
    {
      path: '/dashboard',
      name: 'Dashboard',
      meta: {
        layout: 'sidebar',
        requiresAuth: true
      },
      component: Dashboard
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      // If they were redirected here, don't bother doing our auth check
      beforeEnter: async (to, from, next) => {
        if (to.params.redirected) {
          next();
        } else {
          if (auth.currentUser) {
            next({ name: 'Dashboard' });
          } else {
            next();
          }
        }
      }
    }
  ]
});

router.beforeEach(async (to, from, next) => {
  const { currentUser } = auth;

  // If the page requires authentication
  // make sure they are logged in
  // if they aren't, kick them to the login page
  if (to.meta.requiresAuth) {
    if (currentUser) {
      next();
    } else {
      next({
        name: 'Login',
        params: { redirected: true } // indicate they are redirected
      });
    }
  } else {
    next(); // business as usual
  }
});

export default router;
```

Much like react-router, we specify the route name and point it to a component that we have imported (here, we store them in a `routes/index.js` file, but they could live anywhere).
The provided hooks (which are called [navigation guards](https://router.vuejs.org/guide/advanced/navigation-guards.html)) can be asynchronous and hold transitions until a promise has resolved.
And we get [route splitting out of the box](https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components).

We can specify a path, just like in Ember but we can also attach additional information in any format we want.
This becomes really handy for when you want to mark some pages as public and some that need authentication or just store meta information for specific pages.
Ember has something similar with `routeDidChange` but if you want to handle everything in a particular route's lifecycle (i.e. `willTransition`, `didTransition`, `beforeModel`, etc.), you'd handle that in an optional `route.js` file.
So, we can do all the same things, with similar approaches, they just happen in different spots.

# Conclusion

I feel like those are the major pieces I found that allowed me to shift into Vue without a steep learning curve.
Obviously, there is so much more to Vue than what is discussed here, but being able to map my mental model of Ember to things within Vue was a big help.
So, if you're really only familiar with Ember but have found it intimidating to jump into something like React, I would recommend you check out Vue.
You might even get a blog post out of it!


text:
# Service Portal Scaffold
Quickly scaffold service portal with pre-defined widget and style templates using VS Code ServiceNow extension.

## Setup
> __[Setup and Installation Guide](https://asc2683.github.io/sn-scaffold-doc/docs/setup)__

***
![](sp-scaffold.gif)

## Contribution
Contribution for templates, enhancements, and bug fixes are welcomed.

## License
Service Portal Scaffold is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

***
Note: Service Portal Scaffold is released as an open source and is neither endorsed nor supported by any organizations or institutions.


text:
---
path: '/tips/post-220'
date: '2020-09-14'
title: 'Validating data on inputs with the pattern attribute'
languages: ['HTML']
img: 'https://res.cloudinary.com/duejrcpct/image/upload/q_auto/f_auto/w_1000/v1600093478/tips/220-1_edxybh.png'
description: 'Using the "pattern" attribute to validate inputs'
number: 220
status: true
---

![alt text](https://res.cloudinary.com/duejrcpct/image/upload/q_auto/v1600093713/tips/220-2_ibfgoz.gif 'HTML input pattern')

Using the 'pattern' attribute to validate inputs

What's up guys? Today we'll check a HTML tip on validating inputs by using the 'pattern' attribute.

The 'pattern' attribute lets us specify a regular expression that must be respected by the input value. So if a user types a value that doesn't fit this regular expression, it won't be submitted. This can be super handy for an initial layer of validation on a form as you'll make the user respect the mandatory types for each input.

```html
<form>
  <input
    type="text"
    placeholder="Has to contain 4 letters and no numbers"
    pattern="[A-Za-z]{4}"
  />
  <button>Send</button>
</form>

<form>
  <input
    type="password"
    placeholder="Has to contain 6 characters or more"
    pattern=".{6,}"
  />
  <button>Send</button>
</form>

<form>
  <input type="text" placeholder="Can only contain numbers" pattern="[0-9]+" />
  <button>Send</button>
</form>

<form>
  <input
    type="url"
    placeholder="Must start with https:// or http://"
    pattern="https?://.+"
  />
  <button>Send</button>
</form>
```

In here we have four examples, each one with a form and an input with different patterns: containing exactly 4 letters and no numbers, containing at least 6 characters, containing only numbers and starting with 'http://' or 'https://'. They are all pretty straightforward so just take a look to check how they are being implemented.

Let me know your thoughts on it! See you guys 😁✌


text:
## angulartics-cordova-firebase

[Cordova Firebase](https://github.com/arnesson/cordova-plugin-firebase) plugin for [Angulartics](https://github.com/angulartics/angulartics).

## Install

First make sure you've read installation and setup instructions for [Angulartics](https://github.com/angulartics/angulartics#install).

Then you can install this package either with `npm` or with `bower`.

### npm

```shell
npm install angulartics-cordova-firebase
```

Then add `angulartics.cordova.firebase` as a dependency for your app:

```javascript
angular.module('myApp', [
  require('angulartics'),
  require('angulartics-cordova-firebase')
]);
```

### bower

```shell
bower install angulartics-cordova-firebase
```

Add the `<script>` to your `index.html`:

```html
<script src="/bower_components/angulartics-cordova-firebase/dist/angulartics-cordova-firebase.min.js"></script>
```

Then add `angulartics.cordova.firebase` as a dependency for your app:

```javascript
angular.module('myApp', [
  'angulartics',
  'angulartics.cordova.firebase'
]);
```

## Documentation

Documentation is available on the [Angulartics site](http://angulartics.github.io/).

## Development

```shell
npm run build
```

## License

[MIT](LICENSE)

repository: chaowlert/angulartics-cordova-firebase

repo_name: chaowlert/angulartics-cordova-firebase


text:
---
layout: post
title: Hello, World.
comments: true
tags: meta
---

This is my blog. It's built with Jekyll/Lanyon, and it's hosted with Github Pages.

### Why

This is a good question. Here are some answers:

* I wanted to start a blog.
* Jekyll makes creating websites painless.
* [Lanyon](https://github.com/poole/lanyon) is a cool looking theme.

### Thanks
[Long Qian](https://longqian.me), [Joshua Lande](http://joshualande.com) and [Nikhita Raghunath](https://www.nikhita.dev) made super helpful blog posts/guides about Jekyll. Check them out.