text:
[**[Return To All Test Plans]**]

- [Test Plan for CAPIF Api Publish Service](#test-plan-for-capif-api-publish-service)
- [Tests](#tests)
  - [Test Case 1: Publish API by Authorised API Publisher](#test-case-1-publish-api-by-authorised-api-publisher)
  - [Test Case 2: Publish API by NON Authorised API Publisher](#test-case-2-publish-api-by-non-authorised-api-publisher)
  - [Test Case 3: Retrieve all APIs Published by Authorised apfId](#test-case-3-retrieve-all-apis-published-by-authorised-apfid)
  - [Test Case 4: Retrieve all APIs Published by NON Authorised apfId](#test-case-4-retrieve-all-apis-published-by-non-authorised-apfid)
  - [Test Case 5: Retrieve single APIs Published by Authorised apfId](#test-case-5-retrieve-single-apis-published-by-authorised-apfid)
  - [Test Case 6: Retrieve single APIs non Published by Authorised apfId](#test-case-6-retrieve-single-apis-non-published-by-authorised-apfid)
  - [Test Case 7: Retrieve single APIs Published by NON Authorised apfId](#test-case-7-retrieve-single-apis-published-by-non-authorised-apfid)
  - [Test Case 8: Update API Published by Authorised apfId with valid serviceApiId](#test-case-8-update-api-published-by-authorised-apfid-with-valid-serviceapiid)
  - [Test Case 9: Update APIs Published by Authorised apfId with invalid serviceApiId](#test-case-9-update-apis-published-by-authorised-apfid-with-invalid-serviceapiid)
  - [Test Case 10: Update APIs Published by NON Authorised apfId](#test-case-10-update-apis-published-by-non-authorised-apfid)
  - [Test Case 11: Delete API Published by Authorised apfId with valid serviceApiId](#test-case-11-delete-api-published-by-authorised-apfid-with-valid-serviceapiid)
  - [Test Case 12: Delete APIs Published by Authorised apfId with invalid serviceApiId](#test-case-12-delete-apis-published-by-authorised-apfid-with-invalid-serviceapiid)
  - [Test Case 13: Delete APIs Published by NON Authorised apfId](#test-case-13-delete-apis-published-by-non-authorised-apfid)

# Test Plan for CAPIF Api Publish Service
At this documentation you will have all information and related files and examples of test plan for this API.

# Tests

## Test Case 1: Publish API by Authorised API Publisher
* **Test ID**: ***capif_api_publish_service-1***
* **Description**:

  This test case will check that an API Publisher can Publish an API
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API
  3. Retrieve {apiId} from body and Location header with new resource created from response

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*

  2. Published Service API is stored in CAPIF Database

## Test Case 2: Publish API by NON Authorised API Publisher
* **Test ID**: ***capif_api_publish_service-2***
* **Description**:

  This test case will check that an API Publisher cannot Publish an API withot valid apfId
* **Pre-Conditions**:

  * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API with invalid APF ID at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{APF_ID_NOT_VALID}/service-apis*
     * body [service api description] with apiName service_1
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API with invalid APF ID

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **401 Unauthorized**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **401**
        * title with message "Unauthorized"
        * detail with message "Publisher not existing".
        * cause with message "Publisher id not found".

  2. Service API is NOT stored in CAPIF Database

## Test Case 3: Retrieve all APIs Published by Authorised apfId
* **Test ID**: ***capif_api_publish_service-3***
* **Description**:

  This test case will check that an API Publisher can Retrieve all API published
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
  * At least 2 service APIs are published.

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Publish Other Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_2
     * Get apiId
     * Use APF Certificate

  4. Retrieve all published APIs:
     * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API service_1
  3. Retrieve {apiId1} from body and Location header with new resource created from response
  4. Publish Service API service_2
  5. Retrieve {apiId2} from body and Location header with new resource created from response
  6. Retrieve All published APIs and check if both are present.

* **Expected Result**:
  1. Response to service 1 Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId1}*

  2. Response to service 2 Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId2}*

  3. Published Service APIs are stored in CAPIF Database

  4. Response to Retrieve all published APIs:
     1. **200 OK**
     2. Response body must return an array of **ServiceAPIDescription** data.
     3. Array must contain all previously published APIs.

## Test Case 4: Retrieve all APIs Published by NON Authorised apfId
* **Test ID**: ***capif_api_publish_service-4***
* **Description**:

  This test case will check that an API Publisher cannot Retrieve API published when apfId is not authorised
* **Pre-Conditions**:

  * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Retrieve all published APIs:
     * Send Get to *https://{CAPIF_HOSTNAME}/published-apis/v1/{APF_ID_NOT_VALID}/service-apis*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Retrieve All published APIs

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **401 Non Authorized**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **401**
        * title with message "Unauthorized"
        * detail with message "Provider not existing".
        * cause with message "Provider id not found".

  2. Service API is NOT stored in CAPIF Database

## Test Case 5: Retrieve single APIs Published by Authorised apfId
* **Test ID**: ***capif_api_publish_service-5***
* **Description**:

  This test case will check that an API Publisher can Retrieve API published one by one
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
  * At least 2 service APIs are published.

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Publish Other Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_2
     * Get apiId
     * Use APF Certificate

  4. Retrieve service_1 published APIs detail:
     * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{apiId1}*
     * Use APF Certificate

  5. Retrieve service_2 published APIs detail:
     * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{apiId2}*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API service_1.
  3. Retrieve {apiId1} from body and Location header with new resource created from response.
  4. Publish Service API service_2.
  5. Retrieve {apiId2} from body and Location header with new resource created from response.
  6. Retrieve service_1 API Detail.
  7. Retrieve service_2 API Detail.

* **Expected Result**:
  1. Response to service 1 Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId1}*

  2. Response to service 2 Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId2}*

  3. Published Service APIs are stored in CAPIF Database

  4. Response to Retrieve service_1 published API using apiId1:
     1. **200 OK**
     2. Response body must return a **ServiceAPIDescription** data.
     3. Array must contain same information than service_1 published registration response.

  5. Response to Retrieve service_2 published API using apiId2:
     1. **200 OK**
     2. Response body must return a **ServiceAPIDescription** data.
     3. Array must contain same information than service_2 published registration response.

## Test Case 6: Retrieve single APIs non Published by Authorised apfId
* **Test ID**: ***capif_api_publish_service-6***
* **Description**:

  This test case will check that an API Publisher try to get detail of not published api.
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
  * No published api

* **Information of Test**:
  1. Perform [Provider Registration]
  2. Retrieve not published APIs detail:
     * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Retrieve not published API Detail.

* **Expected Result**:
  1. Response to Retrieve for NOT published API must accomplish:
     1. **404 Not Found**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **404**
        * title with message "Not Found"
        * detail with message "Service API not found".
        * cause with message "No Service with specific credentials exists".

## Test Case 7: Retrieve single APIs Published by NON Authorised apfId
* **Test ID**: ***capif_api_publish_service-7***
* **Description**:

  This test case will check that an API Publisher cannot Retrieve detailed API published when apfId is not authorised
* **Pre-Conditions**:

  * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration] and [Invoker Onboarding]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Retrieve detailed published APIs:
     * Send Get to *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/${apiId}*
     * Use Invoker certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API at CCF
  3. Retrieve {apiId} from body and Location header with new resource created from response.
  4. Register and onboard Invoker at CCF
  5. Store signed Invoker Certificate
  6. Retrieve detailed published API acting as Invoker

* **Expected Result**:
  1. Response to Retrieve Detailed published API acting as Invoker must accomplish:
     1. **401 Unauthorized**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **401**
        * title with message "Unauthorized"
        * detail with message "User not authorized".
        * cause with message "Certificate not authorized".

  2. Service API is NOT stored in CAPIF Database

## Test Case 8: Update API Published by Authorised apfId with valid serviceApiId
* **Test ID**: ***capif_api_publish_service-8***
* **Description**:

  This test case will check that an API Publisher can Update published API with a valid serviceApiId
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)
  * A service APIs is published.

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * get resource url from location Header.
     * Use APF Certificate

  3. Update published API at CCF:
     * Send PUT to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}*
     * body [service api description] with overrided apiName to service_1_modified
     * Use APF Certificate

  4. Retrieve detail of service API:
     * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}*
     * check apiName is service_1_modified
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API
  3. Retrieve {apiId} from body and Location header with new resource url created from response
  4. Update published Service API.
  5. Retrieve detail of Service API

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*

  2. Response to Update Published Service API:
     1. **200 OK**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiName service_1_modified

  3. Response to Retrieve detail of Service API:
     1. **200 OK**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiName service_1_modified.

## Test Case 9: Update APIs Published by Authorised apfId with invalid serviceApiId
* **Test ID**: ***capif_api_publish_service-9***
* **Description**:

  This test case will check that an API Publisher cannot Update published API with a invalid serviceApiId
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Update published API at CCF:
     * Send PUT to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}*
     * body [service api description] with overrided apiName to ***service_1_modified***
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Update published Service API.

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*

  2. Response to Update Published Service API:
     1. **404 Not Found**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **404**
        * title with message "Not Found"
        * detail with message "Service API not found".
        * cause with message "Service API id not found".

  ## Test Case 10: Update APIs Published by NON Authorised apfId
* **Test ID**: ***capif_api_publish_service-10***
* **Description**:

  This test case will check that an API Publisher cannot Update API published when apfId is not authorised
* **Pre-Conditions**:

  * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority)

* **Information of Test**:
  1. Perform [Provider Registration] and [Invoker Onboarding]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Update published API at CCF:
     * Send PUT to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*
     * body [service api description] with overrided apiName to ***service_1_modified***
     * Use invoker certificate

  4.  Retrieve detail of service API:
     * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}*
     * check apiName is service_1
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API at CCF
  3. Retrieve {apiId} from body and Location header with new resource created from response.
  4. Register and onboard Invoker at CCF
  5. Store signed Invoker Certificate
  6. Update published API at CCF as Invoker
  7. Retrieve detail of Service API as publisher

* **Expected Result**:
  1. Response to Update published API acting as Invoker must accomplish:
     1. **401 Unauthorized**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **401**
        * title with message "Unauthorized"
        * detail with message "User not authorized".
        * cause with message "Certificate not authorized".

  2. Response to Retrieve Detail of Service API:
     1. **200 OK**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiName service_1.

## Test Case 11: Delete API Published by Authorised apfId with valid serviceApiId
* **Test ID**: ***capif_api_publish_service-11***
* **Description**:

  This test case will check that an API Publisher can Delete published API with a valid serviceApiId
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority).
  * A service APIs is published.

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Remove published Service API at CCF:
     * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*
     * Use APF Certificate
  4. Retrieve detail of service API:
     * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Publish Service API
  3. Retrieve {apiId} from body and Location header with new resource created from response
  4. Remove published API at CCF
  5. Try to retreive deleted service API from CCF

* **Expected Result**:
  1. Response to Publish request must accomplish:
     1. **201 Created**
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiId
     3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}*

  2. Published Service API is stored in CAPIF Database

  3. Response to Remove published Service API at CCF:
     1. **204 No Content**

  4. Response to Retrieve for DELETED published API must accomplish:
     1. **404 Not Found**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status 404
        * title with message "Not Found"
        * detail with message "Service API not found".
        * cause with message "No Service with specific credentials exists".

## Test Case 12: Delete APIs Published by Authorised apfId with invalid serviceApiId
* **Test ID**: ***capif_api_publish_service-12***
* **Description**:

  This test case will check that an API Publisher cannot Delete with invalid serviceApiId
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority).

* **Information of Test**:
  1. Perform [Provider Registration]

  2. Remove published Service API at CCF with invalid serviceId:
     * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}*
     * Use APF Certificate

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Remove published API at CCF with invalid serviceId

* **Expected Result**:
  1. Response to Remove published Service API at CCF:
     1. **404 Not Found**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status 404
        * title with message "Not Found"
        * detail with message "Service API not found".
        * cause with message "Service API id not found".

## Test Case 13: Delete APIs Published by NON Authorised apfId
* **Test ID**: ***capif_api_publish_service-12***
* **Description**:

  This test case will check that an API Publisher cannot Delete API published when apfId is not authorised
* **Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority).

* **Information of Test**:
  1. Perform [Provider Registration] and [Invoker Onboarding]

  2. Publish Service API at CCF:
     * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis*
     * body [service api description] with apiName service_1
     * Get apiId
     * Use APF Certificate

  3. Remove published Service API at CCF with invalid serviceId as Invoker:
     * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}*
     * Use invoker certificate.

* **Execution Steps**:
  1. Register Provider at CCF and store certificates.
  2. Register Invoker and onboard Invoker at CCF
  3. Remove published API at CCF with invalid serviceId as Invoker

* **Expected Result**:
  1. Response to Remove published Service API at CCF:
     1. **401 Unauthorized**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **401**
        * title with message "Unauthorized"
        * detail with message "User not authorized".
        * cause with message "Certificate not authorized".

   [service api description]: ./service_api_description_post_example.json  "Service API Description Request"
   [publisher register body]: ./publisher_register_body.json  "Publish register Body"
   [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json  "API Invoker Request"
   [invoker register body]: ../api_invoker_management/invoker_register_body.json  "Invoker Register Body"
   [provider request body]: ../api_provider_management/provider_details_post_example.json  "API Provider Enrolment Request"
   [provider request patch body]: ../api_provider_management/provider_details_enrolment_details_patch_example.json  "API Provider Enrolment Patch Request"
   [provider getauth body]: ../api_provider_management/provider_getauth_example.json    "Get Auth Example"

   [invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding"
   [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration"

  [Return To All Test Plans]: ../README.md

branch_name: refs/heads/develop

gha_language: Python


text:
---
title: "Our Daily Reading List - 05/07/2018"
author<EMAIL_ADDRESS>tags: ["margaret","Daily Readings"]
date: 2018-07-05 07:49:21
description: "1

 Slideshow: Halfway Through 2018, Here Are the Biggest GC Moves - by @Danclarkalm @CorpCounsel #corporate #law  Read Here

2

 In-house lawyers find juggling is the ‘new normal’ - by @jeremy..."
---

[https://clausehound.com/](https://clausehound.com/)

1

###  Slideshow: Halfway Through 2018, Here Are the Biggest GC Moves - by @Danclarkalm @CorpCounsel #corporate #law  [Read Here](https://www.law.com/corpcounsel/2018/06/29/slideshow-halfway-through-2018-here-are-the-biggest-gc-moves/)

2

###  In-house lawyers find juggling is the ‘new normal’ - by @jeremynobile #corporate #law [Read Here](http://www.crainscleveland.com/article/20180630/news/166711/house-lawyers-find-juggling-new-normal)

Annotated Legal Contracts
for the Price of a Coffee

3

###  Visualization Is New Frontier for IP Search Platforms - by @r_dipshan @Legaltech_news #legal #technology  [Read Here](https://www.law.com/legaltechnews/2018/06/27/visualization-is-new-frontier-for-ip-search-platforms/)

4

###  Cyber Security Insurance: Nine Questions to Ask to Determine Your Exposure - by @Polsinelli #legal #technology [Read Here](https://www.jdsupra.com/legalnews/cyber-security-insurance-nine-questions-91584/)

5

###  Advice to Entrepreneurs on Navigating the Licensing and Regulatory Landscapes of Legal Cannabis - by Lucas J. Wentworth #socent #law [Read Here](https://www.equities.com/news/advice-to-entrepreneurs-on-navigating-the-licensing-and-regulatory-landscapes-of-legal-cannabis)

license: MIT

repository: sahilkanaya/clausehound-blog

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: sahilkanaya/clausehound-blog


text:
# Retinal-Image-Quality-Assessment
Analyse adequacy of a retinal image
## Source

-> feature.cpp

Reads in an image of the retina and calculates the feature vector values

-> result.cpp

Takes in the feature vector and the coefficient vector(theta calculated using logistic regression) and declares whether the image is gradable or not

## Trial

Run:
```
$ make all
$./AssessImage.sh /path/to/retinal_image
```

## Sample Run
```
$ make all
$ ./AssessImage.sh Images/1.jpg
```
## Output:
Ungradable Retinal Image

Gradable Retinal Image

## References
* Herbert Davis, Stephen Russell, Eduardo Barriga, Michael Abramoff and Peter Soliz - "Vision-based, Real-time Retinal Image Quality Assessment"
* Gopal Datt Joshi, Jayanthi Sivaswamy - "Colour Retinal Image Enhancement based on Domain Knowledge"
* A. Gebejes, R. Huertas - "Texture Characterization based on Grey-Level Co-occurrence Matrix"
* João Miguel Pires Dias, Carlos Manta Oliveira, Luís A. da Silva Cruz - "Retinal image quality assessment using generic image quality indicators"


text:
---
id: compile
title: Source Compilation
sidebar_label: Source
---

Cylon has C++ core, Java and Python bindings. You can compile these in three steps.

Cylon can be build along with Arrow (Cylon will build Apache Arrow) or it can be build by pointing to an existing
Arrow installation.

This document shows how to build Cylon on Linux and Mac OS. The first section of the document shows how to install
the required dependencies on Linux (Ubuntu) and Mac OS. After required dependencies are installed,
the compiling is similar in Linux and Mac OS.

## Prerequisites

Here are the prerequisites for compiling Cylon.

1. CMake 3.16.5
2. OpenMPI 4.0.1 or higher (You can use any other MPI version as well, we tested with OpenMPI)
3. Python 3.7 or higher
4. C++ 14 or higher

### Python Environment

We need to specify a Python environment to the build script. If you're using a virtual environment,
make sure to set the virtual environment path. Or you can specify /usr as the path if you're installing in the system path.

#### Create a virtual environment

```
cd  $HOME/cylon
python3 -m venv ENV
source ENV/bin/activate
```

Here after we assume your Python ENV path is,

```bash
 $HOME/cylon/ENV
```

```txt
Note: User must install Pyarrow with the Cylon build to use Cylon APIs.
Do not use a prior installed pyarrow in your python environment.
Uninstall it before running the setup.
```

### Installing Dependencies Ubuntu

Cylon uses MPI for distributed execution. So we need an MPI version installed in the system. There are many implementations
of MPI standard such as MPICH and OpenMPI. We have tested Cylon with OpenMPI and you should be able to use any other MPI implementation like
MPICH as well.

In this document we will explain how to install OpenMPI. You can use the following command to install OpenMPI on
an Ubuntu system. If you would like to build OpenMPI with custom options, please refer to their [documentation](https://www.open-mpi.org/faq/?category=building) or you can
follow the quick tutorial at the end of the document to do so.

```bash
sudo apt install libopenmpi-dev
```

Here are some of the other dependencies required.

```bash
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update && apt-get install -y --no-install-recommends --no-install-suggests libssl-dev curl wget vim git build-essential python3.7-dev python3.7 maven libnuma-dev libc-dev python3-venv openmpi-bin libopenmpi-dev python3-pip python3-dev libutf8proc-dev libre2-dev
```

We need a later version of CMake. We can build cmake from source if the version in our system is less than 3.16.5.

```bash
curl -OL https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1.tar.gz
tar -xvf cmake-3.20.1.tar.gz
cd cmake-3.20.1
./bootstrap
make
sudo make install
```

### Installing Dependencies MacOS

You would need to install XCode and install an MPI version such as OpenMPI.

```bash
brew install open-mpi
```

Once those are installed you are ready to compile Cylon on macos.

## Build Cylon & PyCylon on Linux or Mac OS

Here we will walk you through building Cylon along with Apache Arrow.

We have provided a build script to make the build process easier. It is found in Cylon source root directory.
Please note that Cylon will build Apache Arrow (both `libarrow` and `pyarrow`) alongside Cylon.

### Build C++ APIs

```bash
./build.sh -pyenv <path to your environment> -bpath <path to cmake build directory> -ipath <path to binary install directory> --cpp [--release | --debug]
```

Example:

```bash
# make the cylon cpp library install directory
mkdir $HOME/cylon_install
./build.sh -pyenv $HOME/cylon/ENV -bpath $HOME/cylon/build -ipath $HOME/cylon_install --cpp --release
```

```txt
Note: The default build mode is release
```

Now lets try to run an C++ example and see whether our compilation is successful.

```bash
# export the lib path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/cylon_install/lib
cd $HOME/cylon_install
# this will run the join example with randomly generated data
./examples/join_example m o 40000 1 sort
```

It will generate an output like following.

```bash
I0714 01:49:30.757613 867371 join_example.cpp:57] Sort join algorithm
I0714 01:49:30.763633 867371 join_example.cpp:79] Read tables in 363[ms]
I0714 01:49:30.840909 867371 partition_op.cpp:80] 0 Partition start: Wed Jul 14 01:49:30 2021 time: 0
I0714 01:49:30.843380 867371 all_to_all_op.cpp:72] Shuffle time: 2
I0714 01:49:30.851606 867371 split_op.cpp:152] Split time: 10 Fin time: 8 Split time: 2 Call count: 1
I0714 01:49:30.852095 867371 partition_op.cpp:80] 0 Partition start: Wed Jul 14 01:49:30 2021 time: 0
I0714 01:49:30.854277 867371 all_to_all_op.cpp:72] Shuffle time: 2
I0714 01:49:30.862313 867371 split_op.cpp:152] Split time: 10 Fin time: 8 Split time: 2 Call count: 1
I0714 01:49:30.953450 867371 join_kernel.cpp:57] Done concatenating tables, rows :  39712
I0714 01:49:30.976418 867371 join_op.cpp:46] Join time : 110
I0714 01:49:31.037182 867371 join_example.cpp:100] First table had : 40000 and Second table had : 40000, Joined has : 39712
I0714 01:49:31.038038 867371 join_example.cpp:102] Join done in 272[ms]
```

### Build Python APIs

Cylon provides Python APIs with Cython. Cylon will build, Cylon CPP, Cylon Python, Arrow CPP and Arrow Python here. In this mode
it will install the Cylon and PyCylon libraries to the Python environment using pip. We only support pip through source builds.
If you want to use an existing Cylon binary you would need to use Conda packages.

You can use the following command to build the Python library.

```bash
./build.sh -pyenv <path to your environment> -bpath <path to cmake build directory> --python
```

Here is an example command.

```bash
./build.sh -pyenv $HOME/cylon/ENV -bpath $HOME/cylon/build -ipath $HOME/cylon_install --python
```

This command will install the PyCylon and PyArrow into the virtual environment we specified.

#### Updating library path

Before running the code in the base path of the cloned repo you need to update the runtime library path. Linux and Mac OS uses different environment variable names.
Following are two commands to update the path on these operating systems.

#### Linux

```bash
export LD_LIBRARY_PATH=<path to cmake build dir>/arrow/install/lib:<path to cmake build dir>/lib:$LD_LIBRARY_PATH
```

Here is an example command.
```bash
export LD_LIBRARY_PATH=$HOME/cylon/build/arrow/install/lib:$HOME/cylon/build/lib:$LD_LIBRARY_PATH
```

#### Mac OS

```bash
export DYLD_LIBRARY_PATH=<path to cmake build dir>/arrow/install/lib:<path to cmake build dir>/lib:$DYLD_LIBRARY_PATH
```

Here is an example command.
```bash
export DYLD_LIBRARY_PATH=$HOME/cylon/build/arrow/install/lib:$HOME/cylon/build/lib:$DYLD_LIBRARY_PATH
```

After this you can verify the build.

```bash
source ENV/bin/activate
```
Here is an example PyCylon programs to check whether installation is working.

```python
from pycylon import DataFrame, CylonEnv
from pycylon.net import MPIConfig

df1 = DataFrame([[1, 2, 3], [2, 3, 4]])
df2 = DataFrame([[1, 1, 1], [2, 3, 4]])
df3 = df1.merge(right=df2, on=[0, 1])
print(df3)
```
Congratulations you now have successfully installed PyCylon and Cylon.

### Running Tests

You can run Cylon tests as follows.

For C++ tests
```bash
./build.sh -pyenv <path to your environment> -bpath <path to cmake build directory> --cpp --test
```

Here is an example command.

```bash
./build.sh -pyenv $HOME/cylon/ENV -bpath $HOME/cylon/build --cpp --test
```

For Python tests

```bash
./build.sh -pyenv <path to your environment> -bpath <path to cmake build directory> --python --pytest
```

Here is an example command

```bash
./build.sh -pyenv $HOME/cylon/ENV -bpath $HOME/cylon/build --python --test
```

## Building Cylon With An Existing Arrow Installation

If you already have an arrow installation and wants to use that for the build, you can do so by pointing the build to that.

### Building PyCylon

Instead of building PyCylon and Apache Arrow together, you can use [`pyarrow` distribution from`pip`](https://pypi.org/project/pyarrow/) as follows.
This will build only the Cylon C++ and Python APIs. Here we will use the arrow libraries from the PyArrow installation.

First lets create a Python environment and install PyArrow in it.

```bash
python3 -m venv ENV
source ENV/bin/activate
pip install pyarrow==4.0.0
```

Then we can build Cylon pointing to this pyarrow with the following command.

```bash
./build.sh -pyenv <path to your env> -bpath <path to cmake build dir> --python_with_pyarrow  [--test | --pytest]
```

Here is an example command.

```bash
cd $HOME/cylon
./build.sh -pyenv $HOME/cylon/ENV -bpath $HOME/cylon/build --python_with_pyarrow
```

After this you can run the above PyCylon examples to make sure it is working.

## Building OpenMPI From Source

In this section we will explain how to build and install OpenMPI 4.0.1 from source. The instructions can be used to build a higher
version of OpenMPI as well.

* We recommend using `OpenMPI 4.0.1` or higher.
* Download OpenMPI 4.0.1 from [https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.1.tar.gz](https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.1.tar.gz)
* Extract the archive to a folder named `openmpi-4.0.1`
* Also create a directory named `build` in some location. We will use this to install OpenMPI
* Set the following environment variables

  ```text
  BUILD=<path-to-build-directory>
  OMPI_401=<path-to-openmpi-4.0.1-directory>
  PATH=$BUILD/bin:$PATH
  LD_LIBRARY_PATH=$BUILD/lib:$LD_LIBRARY_PATH
  export BUILD OMPI_401 PATH LD_LIBRARY_PATH
  ```

* The instructions to build OpenMPI depend on the platform. Therefore, we highly recommend looking into the `$OMPI_401/INSTALL` file. Platform specific build files are available in `$OMPI_401/contrib/platform` directory.
* In general, please specify `--prefix=$BUILD` and `--enable-mpi-java` as arguments to `configure` script. If Infiniband is available \(highly recommended\) specify `--with-verbs=<path-to-verbs-installation>`. Usually, the path to verbs installation is `/usr`. In summary, the following commands will build OpenMPI for a Linux system.

  ```text
  cd $OMPI_401
  ./configure --prefix=$BUILD --enable-mpi-java
  make -j 8;make install
  ```

branch_name: refs/heads/main


text:
## CHANGELOG

### 1.18.0 (2023-07-25)
- **Feature:** Added new interface `getHostAppThemeColors()` to get `HostThemeColor` which contains primary & secondary color set by the Host app
- **Feature:** Added new interface `isDarkMode()`. Interface to know if the Hostapp/Device is set to use the Dark
- **Feature:** Added new interface `sendAnalytics(analyticsInfo: MAAnalyticsInfo)`. This interface will be used to send analytics to host app.
- **Feature:** Added new interface in Universal Bridge i.e `sendInfoToHostapp` which helps the Miniapp to send `UniversalBridgeInfo` to the HostApp.

### 1.18.0-alpha (2023-07-12)

:warning: This version is an internal release. It is not fully tested and can produce unexpected behaviors. Due to potential changes, the full change log will be provided with the final version and its usage is discouraged.

This version improves MiniApp loading from cache and brings several UI improvements features and deprecation.

---

### 1.17.0 (2023-03-30)
- **Feature:** Added In-app purchases related interfaces. `getAllProducts()` , `purchaseProductWith(id: string)`, `consumePurchaseWith(id: string, transactionId: string)`. These interfaces can be used to prepare the list of products and make a in-app purchase with product id from associated with Mini App platform.

---

### 1.16.0 (2023-01-30)
- **Feature:** Added Universal Bridge related interface e.g. `sendJsonToHostapp` to send any JSON/String to the HostApp. Also, added support with `HostAppEvents` to receive any JSON/String to MiniApp from the HostApp.
- **Feature:** Added `allEmailList` property in `Contact` to support multiple email address of a specific contact.
- **Feature:** Added `closeMiniApp(withConfirmation: boolean)` interface which will help the miniapp to close on its own, provided Native Host application allows them to close.
- **Update:** Moved `setCloseAlert(alertInfo: CloseAlertInfo)` interface to a MiniApp.miniappUtils object

---

### 1.15.0 (2022-06-24)
- **Feature:** Added `setCloseAlert(alertInfo: CloseAlertInfo)` interface support to Mini Apps share info about Close confirm alert
- **Feature:** Added Secure storage related interfaces. `setItems(items: MiniAppSecureStorageKeyValues)` , `getItem(key: string)`, `removeItems(key: [string])`, `clear()`, `size()`. These interfaces can be used to storage items in the SDK.

---
### 1.14.0 (2022-04-12)
- **Feature:** Added `downloadFile(filename, url, headers)` to download and save the file with proper filename

---

### 1.13.0 (2021-12-17)

- **Feature:** Added default values for message form in demo app
- **Feature:** Added `hostLocale` to `HostEnvironmentInfo` to retrieve locale info from host app
- **Feature:** Added camera picture screen in demo app

---

### 1.12.0 (2021-10-10)

- **Feature:** Added `CustomPermissionName.FILE_DOWNLOAD` permission to support downloading attachments
- **Feature:** Added `getHostEnvironmentInfo()`  to retrieve Host app environment information
- **Feature:** Added support for Mini app external webview close events

---

### 1.11.0 (2021-08-05)
- **Feature:** Added interface to get user points
- **Feature:** Added an optional banner message field in messaging feature

---

### 1.10.0 (2021-06-29)
- **Feature:** Added `MiniAppError` class for a better bridge errors management [See here](README.md#Errors-management).

---

### 1.9.0 (2021-05-27)
- **Feature:** Added `Send Messsage` custom permission for sending message to specific contact. [See here](README.md#Request-Permissions).
- **Feature:** Added `MiniAppError` class for a better bridge errors management [See here](README.md#Errors-management).

---

### 1.8.0 (2021-04-22)

- **Feature:** Support send message to specific and multiple contacts. [See here](README.md#Send-message).

---

### 1.7.0 (2021-04-02)

- **Feature:** Support send message to contact. [See Send message documentation](README.md#Send-message).
- **Feature:** Added `Access Token` Custom permission.
- **Feature:** Added optional `Name` & `Email` properties to Contact object
- **Feature:** Added `Access Token` scopes and audience

---

### 1.6.1 (2021-01-06)

- **Fix:** Location permission support for iOS/Android Mini App SDK 2.6 and below.
- **Fix:** Reject promise from `MiniApp.requestLocationPermission` when the user denies location custom permission.

### 1.6.0 (2020-12-18)

- **Feature:** Added `CustomPermissionName.LOCATION`.
- **Change:** Updated `requestLocationPermission()` to `requestLocationPermission(permissionDescription?: string)`. From now `requestLocationPermission` will request both custom and device permission respectively. [See here](README.md#Request-Permissions).
- **Feature:** Added support for requesting Contact list from Host app. [See here](README.md#Requesting-User-details).

### 1.5.0 (2020-11-13)

- **Feature:** Added `MiniApp.getAccessToken` for retrieving an access token. [See here](README.md#Get-access-token).

### 1.4.0 (2020-11-02)

- **Feature:** Set and lock device screen orientation. [See here](README.md#Set-screen-orientation).

### 1.3.0 (2020-10-22)

- **Feature:** Added support for requesting the load and display of Interstitial & Rewarded Ads in Host app. [See here](README.md#4-Show-Ads).
- **Feature:** Added support for requesting User Name and Profile Photo from Host app. [See here](README.md#Requesting-User-details).
- **Feature:** Added `MiniApp.getPlatform` for retrieving the platform name of the device. [See here](README.md#check-androidios-device).

### v1.2.0 (2020-10-02)

- **Feature:** Added `MiniApp.requestCustomPermissions` for requesting `USER_NAME`, `PROFILE_PHOTO`, and `CONTACT_LIST` permissions. [See here](README.md#Request-Permissions)
- **Feature:** Added `MiniApp.shareInfo` for sharing content with other Apps. [See here](README.md#Share-Info).

### v1.1.0 (2020-7-21)

- Added support for requesting geolocation permission from the host application to allow fetching of the coordinates data thereafter. [See here](README.md#Request-Permissions).

### v1.0.0 (2020-5-13)

- Initial release.

repository: rakutentech/js-miniapp

gha_language: JavaScript

repo_name: rakutentech/js-miniapp


text:
---
{
    "description": "A overview on how to integrate Kickstand UI components into your applications.",
    "meta": [
        {
            "property": "og:title",
            "content": "Add to Your Project - Kickstand UI"
        },
        {
            "property": "og:description",
            "content": "A overview on how to integrate Kickstand UI components into your applications."
        }
    ]
}
---

# Framework Overview

Integrating Kickstand UI into your framework is not _required_ in order to take advantage of the component library. However, doing so enables the web components to behave like part of the framework.

## Build Process

Kickstand UI's styles are built using [SASS](https://sass-lang.com/). Using SASS is not required to use and customize Kickstand UI for your needs, but we have created some great [SASS tools](../../design-tokens/design-tokens.md) to really accelerate the development process.

In addition to compiling the SASS, you will need to incorporate post-processing into your build pipeline. The SASS is built without vendor prefixes and should be added using a tool like [PostCSS's](https://postcss.org/) [Autoprefixer](https://github.com/postcss/autoprefixer) to provide cross-browser consistency.

If there are any integration issues with any of the frameworks listed or if you are interested in how integrate with another framework, please feel free to [reach out](/contact.html), but also take a looks at Stencil's great [documentation](https://stenciljs.com/docs/overview).

repository: break-stuff/kickstand-ui-docs-beta

gha_language: Shell

repo_name: break-stuff/kickstand-ui-docs-beta


text:
#   Map editor for 'The Teleporter'

A repository with an external map editor for **_The Teleporter_** - a 2D game I made in my spare time.

####  Context
I created this project mainly to improve my non-existent skills in _C#_ (and also _.NET Framework_). The game is written in C++14 (with the help of the SFML library) and it represents a 2D Top-Down Shooter that is played on a tile-based map. Initially, I made the map editor incorporated directly into the game but the GUI was a chore to modify or improve so I decided to make an external one, this time in C#.

####  Technology
* Microsoft Visual C# **2015** with target framework: .NET Framework **4.5.2**:
  * WinForms (GUI)
  * WPF (GUI)
  * GDI+ (Drawing the map)

####  Goals
* Simple and in-theme GUI.
* High-performance when working with relatively large maps.
* Handy features and tools that help in editing the properties and tiles of the map.

#### License
This project is released under the The MIT License (MIT). Check out [LICENSE](../master/LICENSE) for more informations.

gha_language: C#


text:
# Zoo

#### _Animal tracker for Zoo_

#### By _**Niklas Long**_

## Description

_This application allows users to add, edit, and view animals and their details. Users can also filter the animal list by age._

## Setup/Installation Requirements

* _clone the repository_
* _cd into the repository_
* _run `npm install` and `bower install`_
* _run `gulp serve`_
* _visit localhost:3000 to view the app_

## Planning

1. Configuration/dependencies
  * Angular
  * Gulp
  * Npm
  * Bower
  * Tachyons

2. Specs
  * Spec 1: User can view animals
  * Spec 2: User can edit animals
  * Spec 3: User can add animals
  * Spec 4: User can filter animals by age

3. Integration
  * Initial routes and index page with all dependencies
  * Component for viewing: list-animal
  * Component for editing: edit-animal
  * Component for adding: new-animal
  * Pipe to filter animals by age: age.pipe

4. UX/UI
  * Develop custom style

5. Polish
  * Refactor code
  * Delete unused files/code
  * Make README awesome

### License

*{MIT}*

Copyright (c) 2017 **_{Niklas Long}_**

repository: niklaslong/epicodus-lessons

gha_language: HTML

repo_name: niklaslong/epicodus-lessons


text:
# Data Science Accelerator - *Spark based movie recommender*

## Overview

The accelerator is to illustrate how to efficiently build a movie recommendation system within 30 minutes!

The repository contains three parts

- **Data** Schemas and references to sample data used in the accelerator.
- **Code** Codes for training and scoring a movie recommender.
- **Docs** Documents helping to build a recommender with Azure Machine Learning Service.

## Business domain

Recommendation (e-commerce, entertainment, retail, etc.).

## Data science problem

The problem a recommendation system tries to resolve is

**Given historical observations of user preferences (i.e., ratings) on a set of items, how to predict and generate a set of items that the users will like most probably.**

## Data understanding

Typically data in a recommendation system has a schema of
|user|item|rating|[timestamp]|
where user, item, and rating refer to user ID, item ID, and ratings given by a user towards an item.

## Modeling

A recommender is built by using Spark built-in collaborative filtering algorithm, which is a matrix factorization typed algorithm that is regularized by alternating least squares technique.

## Solution architecture

The whole recommendation solution consists of Azure services such as Azure Data Science Virtual Machine, Azure blob storage, Azure Container Registry, Azure Container Services, etc. The building process is completed with Azure Machine Learning Service.


text:
This is a rust baremetal OS project for raspberry pi, hosted on OS X.

# Goal

The goal is a clustered lisp machine running as a sasos on a cluster of arm SOC boards. Host lang under lisp is rust.

# Colophon

### Platforms

* Development host: Mac OS X El Capitan
* Development board: Raspberry Pi 2, Pine64 plus

### Tools

* Shell: http://fishshell.com/
* Package manager: http://brew.sh/
* ARM bintools from here: https://launchpad.net/gcc-arm-embedded
* Build: https://www.gnu.org/software/make/
* Boot manager: http://elinux.org/RPi_U-Boot
* Rust: Multirust (nightly): https://github.com/brson/multirust (available from brew)

## Start TFTPD

So we don't have to mess with updating the kernel on the SD card, we set it up to use a boot manager to grab the kernel from the development machine using TFTP. OS X includes a TFTPD, but you have to start it. The included .plist adds an option to chroot to the server directory so that files are named relative to inside it.

    $ make tftpd

## Building the SD image

This gives you just what you need to start an rpi2, boot the bootloader, and have it start a kernel using TFTP. Key network settings for TFTP in boot.scr. You can probably control this outside if you have a more configurable DHCP host than mine.

    $ make sdimage

## Updating Rust

You need a libcore for your target architecture in the right place under rustc's sysroot (until multirust includes support for [cross-compilation](https://github.com/brson/multirust/pull/112). The makefile achieves this by using a git submodule holding rust. When you want to update rust, it also checks out the corresponding commit of libcore which is used to build libcore.

    $ make update-rust

## Build kernel

Builds the kernel and copies the u-boot ready image into the TFTPD server directory. Also creates some useful debugging files.

    $ make

# Thanks

* [Julia Evans](http://jvns.ca/blog/2014/03/21/my-rust-os-will-never-be-finished/)
* [Bodil Stokke](https://skillsmatter.com/skillscasts/4484-build-your-own-lisp-for-great-justice)
* [Philipp Oppermann](http://os.phil-opp.com/)
* [Lucas Hartmann](http://interim-os.com/) We follow in his footsteps!
* [Dawid Ciężarkiewicz](https://github.com/dpc/titanos) And Dawid's too!

license: Unlicense

repository: sokodev/arm-rust-clust

repo_name: sokodev/arm-rust-clust


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
![Android](https://img.shields.io/badge/Android-0095D5?style=for-the-badge&logo=android&logoColor=white)
![Kotlin](https://img.shields.io/badge/Kotlin-0095D5?&style=for-the-badge&logo=kotlin&logoColor=white)
[![circle-ci](https://circleci.com/gh/faniabdullah/become-android-dev-expert.svg?style=svg)](https://circleci.com/gh/faniabdullah/become-android-dev-expert/)

Movie Catalog App

   application that can view a list of currently playing movies, search for movies or tv shows, and can also add movies to favorites.
   This repository for learn About Mobile Development at Bangkit Academy led by Google, Tokopedia, Gojek, &   Traveloka »

    Explore the docs »

    View Demo
    ·
    Report Bug
    ·
    Request Feature

## About The Project
This repository for learn About Mobile Development at Bangkit Academy led by Google, Tokopedia, Gojek, & Traveloka » . detail course is "Become Android Developer Expert" at Dicoding

       **NOTE :**  This repository have some branch , consist of practice, submission 1 & submission 2
  > 1. Master - consists of a combination of branches practice & submission 1 and 2
  > 2. Submission 1 - contains tasks from submission 1 ( **Get 4 Star** )
  > 3. Submission 2 - contains tasks from submission 2 ( **Get 5 Star** )

* #### Dependencies :
  - [Lifecycle & Livedata](https://developer.android.com/jetpack/androidx/releases/lifecycle)
  - [Navigation Component](https://developer.android.com/jetpack/androidx/releases/navigation)
  - [kotlinx-coroutines](https://developer.android.com/kotlin/coroutines)
  - [Retrofit 2](https://square.github.io/retrofit/)
  - [Glide](https://github.com/bumptech/glide)
  - [Dagger Hilt](https://dagger.dev/hilt/)
  - [Ok Http 3](https://square.github.io/okhttp/)
  - [Room](https://developer.android.com/jetpack/androidx/releases/room)
  - [Leak Canary](https://square.github.io/leakcanary/)
  - [Air Bnb Lottie](https://airbnb.io/lottie/#/)

## Acknowledgements
  * [Clean Architecture Guide](https://developer.android.com/jetpack/guide)
  * [Reactive Programming Using Coroutines Flow](https://developer.android.com/kotlin/flow)
  * [Modularization](https://www.techyourchance.com/preliminary-over-modularization-of-android-projects)
  * [Dynamic Feture](https://developer.android.com/guide/playcore/feature-delivery/on-demand)
  * [Dynamic Feature with Navigation](https://developer.android.com/guide/navigation/navigation-dynamic)
  * [Continuous Integration Using CircleCi](https://circleci.com/)
  * [Performance ](https://developer.android.com/training/articles/perf-tips)
  * [Obfocuscation Security](https://developer.android.com/studio/build/shrink-code)
  * [encryption using SqlCipher ](https://www.zetetic.net/sqlcipher/sqlcipher-for-android/)
  * [SSL Pinning Security](https://developer.android.com/training/articles/security-config)
  * [Dependency injection With Dagger Hilt](https://developer.android.com/training/dependency-injection)
  * [Lottie Animation AirBnb ](https://airbnb.io/lottie/#/)

 ## Getting Started Application

 - ### Prerequisites
       - ##### Tools Sofware
        1. Android Studio at least version 4.1. [Android Studio](https://developer.android.com/studio)
        2. JRE (Java Runtime Environment) or JDK (Java Development Kit).

 - ### Installation
      1. Get a free API Key at [Themoviedb](https://developers.themoviedb.org/3)
      2. Clone this repository and import into Android Studio
          ```
             https://github.com/faniabdullah/become-android-dev-expert.git
          ```
      4. Enter your API in buildConfigField `build.graddle`
         ``` defaultConfig {
             buildConfigField("String", "MOVIE_TOKEN", '"Your Api Key"')
            }
         ```

## Usage

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

[Fani Abdullah ](https://www.linkedin.com/in/fani-abdullah/) -<EMAIL_ADDRESS>

[contributors-shield]: https://img.shields.io/github/contributors/faniabdullah/become-android-dev-expert.svg?style=for-the-badge
[contributors-url]: https://github.com/faniabdullah/become-android-dev-expert/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/faniabdullah/become-android-dev-expert.svg?style=for-the-badge
[forks-url]: https://github.com/faniabdullah/become-android-dev-expert/network/members
[stars-shield]: https://img.shields.io/github/stars/faniabdullah/become-android-dev-expert.svg?style=for-the-badge
[stars-url]: https://github.com/faniabdullah/become-android-dev-expert/stargazers
[issues-shield]: https://img.shields.io/github/issues/faniabdullah/become-android-dev-expert.svg?style=for-the-badge
[issues-url]: https://github.com/faniabdullah/become-android-dev-expert/issues
[license-shield]: https://img.shields.io/github/license/faniabdullah/become-android-dev-expert.svg?style=for-the-badge
[license-url]: https://github.com/faniabdullah/become-android-dev-expert/blob/master/LICENSE
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

repository: faniabdullah/become-android-dev-expert

repo_name: faniabdullah/become-android-dev-expert


text:
---
layout: post
title:  "Schedule"
date:   2015-10-28 09:20:00
tags:
image: /assets/article_images/2015-10-24-hello-world/bioinfo_soc_logo_banner.jpg
---

We have come up with a schedule for our first few talks in the _Code for Life_ seminar/workshop series, in Stopford G.054 for the first week then moving for the foreseeable future to Stopford 1.065:

* [_Code for Life - Git, GitHub, and Git LFS_](https://www.facebook.com/events/857217957729738/) (Louis Maddox), Stopford G.054 [_by PC Cluster 1_]
* _Code for Life - Introduction to SQL_ (Mark Reardon), Stopford 1.065

Full schedule for following weeks: [uombio.info/schedule](http://uombio.info/schedule/).

These events are open to undergrads, postgrads, and researchers: please take a moment to fill out [our signup questionnaire](http://uombio.info/join) to register your interest and receive an invitation to the mailing list.

extension: markdown


text:
ansible-role-zsh
================

A simple role to install and manage zsh

Requirements
------------

There are no specific additional reqiurements.

Role Variables
--------------

* `set_default_shell`
  * Type: Boolean
  * Usage: If `true`, sets fish as the default shell for `ansible_user`.
  * Default: `false`

Dependencies
------------

There are no specific additional dependencies.

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

```yaml
- hosts: local
  roles:
    - pridkett.zsh
  vars:
    zsh:
      set_default_shell: false
```

License
-------

MIT

Author Information
------------------

Patrick Wagstrom<EMAIL_ADDRESS>
- [Personal Home Page](https://patrick.wagstrom.net/)
- [GitHub Profile Page](https://github.com/pridkett/)

repository: pridkett/ansible-role-zsh

repo_name: pridkett/ansible-role-zsh


text:
---
layout: post
title: Serving a Vue, React or Ember JavaScript Application with Go.
categories: go, web, programming, javascript
---

It's 2016. You're about to tie together a Popular Front-End JavaScript framework with a web service
written in Go, but you're also looking for a way to have Go serve the static files as well as your
REST API. You want to:

* Serve your `/api/` routes from your Go service
* Also have it serve the static content for your application (e.g. your JS bundle, CSS, assets)
* Any other route will serve the `index.html` entrypoint, so that deep-linking into your JavaScript
  application still works when using a front-end router - e.g.
  [vue-router](https://github.com/vuejs/vue-router),
  [react-router](https://github.com/reactjs/react-router), Ember's routing.

Here's how.

## The Folder Layout

Here's a fairly simple folder layout: we have a simple [Vue.js](https://vuejs.org/) application
sitting alongside a Go service. Our Go's `main()` is contained in `serve.go`, with the datastore
interface and handlers inside `datastore/` and `handlers/`, respectively.

```sh
~ gorilla-vue tree -L 1
.
├── README.md
├── datastore
├── dist
├── handlers
├── index.html
├── node_modules
├── package.json
├── serve.go
├── src
└── webpack.config.js

~ gorilla-vue tree -L 1 dist
dist
├── build.js
└── build.js.map
```

With this in mind, let's see how we can serve `index.html` and the contents of our `dist/`
directory.

> Note: If you're looking for tips on how to structure a Go service, read through
> [@benbjohnson](https://twitter.com/benbjohnson)'s excellent Gophercon 2016
> [talk](http://go-talks.appspot.com/github.com/gophercon/2016-talks/BenJohnson-StructuringApplicationsForGrowth/main.slide#8).

## Serving Your JavaScript Entrypoint.

The example below uses [gorilla/mux](https://github.com/gorilla/mux), but you can achieve this with
vanilla [net/http](https://golang.org/pkg/net/http/) or
[httprouter](https://godoc.org/github.com/julienschmidt/httprouter), too.

The main takeaway is the combination of a catchall route and `http.ServeFile`, which effectively
serves our `index.html` for any unknown routes (instead of 404'ing). This allows something like
`example.com/deep-link` to still run your JS application, letting it handle the route explicitly.

```go
package main

import (
	"encoding/json"
	"flag"
	"net/http"
	"os"
	"time"

	"log"

	"github.com/gorilla/handlers"
	"github.com/gorilla/mux"
)

func main() {
	var entry string
	var static string
	var port string

	flag.StringVar(&entry, "entry", "./index.html", "the entrypoint to serve.")
	flag.StringVar(&static, "static", ".", "the directory to serve static files from.")
	flag.StringVar(&port, "port", "8000", "the `port` to listen on.")
	flag.Parse()

	r := mux.NewRouter()

    // Note: In a larger application, we'd likely extract our route-building logic into our handlers
    // package, given the coupling between them.

	// It's important that this is before your catch-all route ("/")
	api := r.PathPrefix("/api/v1/").Subrouter()
	api.HandleFunc("/users", GetUsersHandler).Methods("GET")
	// Optional: Use a custom 404 handler for our API paths.
	// api.NotFoundHandler = JSONNotFound

	// Serve static assets directly.
	r.PathPrefix("/dist").Handler(http.FileServer(http.Dir(static)))

	// Catch-all: Serve our JavaScript application's entry-point (index.html).
	r.PathPrefix("/").HandlerFunc(IndexHandler(entry))

	srv := &http.Server{
		Handler: handlers.LoggingHandler(os.Stdout, r),
		Addr:    "<IP_ADDRESS>:" + port,
		// Good practice: enforce timeouts for servers you create!
		WriteTimeout: 15 * time.Second,
		ReadTimeout:  15 * time.Second,
	}

	log.Fatal(srv.ListenAndServe())
}

func IndexHandler(entrypoint string) func(w http.ResponseWriter, r *http.Request) {
	fn := func(w http.ResponseWriter, r *http.Request) {
		http.ServeFile(w, r, entrypoint)
	}

	return http.HandlerFunc(fn)
}

func GetUsersHandler(w http.ResponseWriter, r *http.Request) {
	data := map[string]interface{}{
		"id": "12345",
		"ts": time.Now().Format(time.RFC3339),
	}

	b, err := json.Marshal(data)
	if err != nil {
		http.Error(w, err.Error(), 400)
		return
	}

	w.Write(b)
}
```

Build that, and then run it, specifying where to find the files:

```sh
go build serve.go
./serve -entry=~/gorilla-vue/index.html -static=~/gorilla-vue/dist/
```

> You can see an example app [live here](https://gorilla-dashboard.herokuapp.com)

## Summary

That's it! It's pretty simple to get this up and running, and there's already a few 'next steps' we
could take: some useful caching middleware for setting `Cache-Control` headers when serving our
static content or `index.html` or using Go's [html/template](https://golang.org/pkg/html/template/)
package to render the initial `index.html` (adding a CSRF meta tag, injecting hashed asset URLs).

If something is non-obvious and/or you get stuck, reach out [via
Twitter](http://twitter.com/elithrar).

gha_language: CSS


text:
# Slim Play Activator template

Generate your own version of the [slim-play app](https://github.com/lloydmeta/slim-play)

## How to use

1. Have [activator installed](https://www.typesafe.com/community/core-tools/activator-and-sbt)
2. `$ activator new my-slim-play slim-play-scala`, enter in your project's name and version
3. cd into the newly generated app dir and edit + run as needed via `$ activator run`

## Licence

The MIT License (MIT)

Copyright (c) 2016 by Lloyd Chan

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

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

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: gupash/play-demo-app

repo_name: gupash/play-demo-app


text:
# Archaeozygodiscus P.R. Bown, 1985 GENUS

#### Status
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
INA (Int. Nannoplank. Ass. ) Newsl. 7 (1): 32.

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
google-authenticator
=======

[![Build Status](https://img.shields.io/travis/com/amylum/google-authenticator.svg)](https://travis-ci.com/amylum/google-authenticator)
[![GitHub release](https://img.shields.io/github/release/amylum/google-authenticator.svg)](https://github.com/amylum/google-authenticator/releases)
[![Apache Licensed](http://img.shields.io/badge/license-Apache-green.svg)](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))

PAM package for [Google's HOTP/TOTP implementation](https://github.com/google/google-authenticator)

## Usage

To build a new package, update the submodule and run `make`. This launches the docker build container and builds the package.

To start a shell in the build environment for manual actions, run `make manual`.

## License

This repo is released under the MIT License. See the bundled LICENSE file for details.

Google's PAM code is licensed under the Apache License, Version 2.0.

repository: hnkien/google-authenticator

repo_name: hnkien/google-authenticator


text:
# Fandom Scraper
This script can scrape all the data you need \
This was originally made for Fandom Wiki which has information about any topic , transcripts etc. \
With a few adjustments you can potentially scrape any website

**How to setup:** \
1.Open a page you want to scrape , note down its URL , class of elements which actually have useful data (Use inspect element) \
2.Open fandom_scraper.py in your favourite editor (My recommendation is VS Code) \
3.Change the URL , Target Keyword , Class of elements to search and base

Now Run the script as shown below

**Usage :** (Assuming you have python and pip set up already)

`$pip install -r requirements.txt ` \
`$python fandom_scraper.py > output.txt`

As a example I have setup the script to scrape the Call of Duty Fandom for Transcripts \
This gives me every word spoken in every COD ever.

Future Improvements : \
Multiple Keywords support and faster scraper with async requests


text:
# Build Fields

Build object by builders of each fields.

## Installation

```
npm i build-fields
```

## Usage

```
const buildFields = reuqire('build-fields')
const {compose, prop, upperCase} = require('lodash/fp')

const src = {name: 'Bob', age: 20}

const builder = {
  name: compose(upperCase, prop('name')),
  friend: {
    name: 'Alice',
    age: prop('age')
  }
}

const result = buildFields(builder, src)
// or
const result = buildFields(builder)(src)

// result is {name: 'BOB', friend: {name: 'Alice', age: 20}}
```

## License

MIT


text:
# Index
Azure Machine Learning is a cloud service that you use to train, deploy, automate,
and manage machine learning models. This index should assist in navigating the Azure
Machine Learning notebook samples and encourage efficient retrieval of topics and content.
![

license: MIT,MS-PL

repository: dileepshaik/Azure-Machine-Learning-

detected_licenses: MIT MS-PL

repo_name: dileepshaik/Azure-Machine-Learning-


text:
# Migration Tasks
## Database
After the database has been created with terraform it will be blank and a one off task needs to be executed in development and test environments to populate it with test data.
### Development and Test Data Population
```
cf ssh school-experience-app-staging
>> cd /app
>> export PATH=${PATH}:/usr/local/bin
>> bundle exec rails db:schema:load
>> bundle exec rails db:seed
>> bundle exec rails db:migrate
>> bundle exec rails data:schools:mass_import
```

### Production
The database will need to be exported from the current production database and imported into the new one.

#### Export Existing Database

To produce an export from the Azure version of Postgres you will need to run the following command; However, first you will need to find the adminuser password and add your PC to the whitelist.

1. Using an online webpage like [WhatsMyIPAddress](https://whatismyipaddress.com/)
2. Enter the details into [Azure<EMAIL_ADDRESS>3. Get the AdminUser password from [Azure Production Key<EMAIL_ADDRESS>
This process will take a few minutes.

```
pg_dump  --host=s105p01-prod-postgres.postgres.database.azure.com --port=5432 --dbname=school_experience_prod --username=adminuser@s105p01-prod-postgres  -f output.sql
```

#### Import Database
Connect as a user with access to the new production postgres service

```
cf target -s get-into-teaching-production
cf conduit school-experience-prod-pg-common-svc -- psql
```
Delete the contents of the database,

```
drop owned by rdsbroker_459fc751_c929_4953_b732_5f15c72a12b5_manager;
```

Note: The owner may have changed if the database service has been destroyed and rebuilt

Import the data

```
\i output.sql
```

## API ( CRM Connection )
Needs to be amended. In the secrets.

``` make production edit-app-secrets```

## DFE Sign In DSI
The sign in DSI needs to be configured per environment. This is done by altering the values in the SE-SECRETS, via the command:

``` make production edit-app-secrets```

### Development and Test
The setting in the Sign In Service can be amended manually via the [UI](https://pp-manage.signin.education.gov.uk/)

repository: DFE-Digital/schools-experience

gha_language: Ruby

repo_name: DFE-Digital/schools-experience


text:
# ctrlh - the horde control CLI

This is a CLI to manage and set up Horde.

## Usage

```text
Usage: ctrlh --endpoint="localhost:1234" <command>

Horde management CLI

Flags:
  --help                         Show context-sensitive help.
  --endpoint="localhost:1234"    gRPC management endpoint
  --tls                          TLS enabled for gRPC
  --cert-file=STRING             Client certificate for management service
  --hostname-override=STRING     Host name override for certificate

Commands:
  ping          Ping the management service
  apn add       Add new APN in Horde
  apn rm        Remove APN from Horde
  apn list      List APNs registered in Horde
  nas add       Add new NAS
  nas rm        Remove existing NAS
  nas list      List NASes
  alloc add     Add allocation for device
  alloc rm      Remove allocation for device
  alloc list    List address allocations
  token add     Create a new API token for an user
  token rm      Remove an API token from an existing user
  user add      Create new API user and associated token in Horde
  util id       Decode API identifiers to internal identifiers
  util di       Encode internal identifiers into API identifiers

Run "ctrlh <command> --help" for more information on a command.
```


text:
# Assertions

Daedalic Test Automation Plugin comes with the following assertion nodes for use in your automated tests:

## Basic Assertions

| Node | Description |
| --- | --- |
| ![Assert Fail](AssertFail.png) | Finishes the current test as failure. |
| ![Assert True](AssertTrue.png) | Expects the specified value to be true. |
| ![Assert False](AssertFalse.png) | Expects the specified value to be false. |
| ![Assert Valid](AssertValid.png) | Expects the specified object to be valid. |
| ![Assert Invalid](AssertInvalid.png) | Expects the specified object not to be valid. |
| ![Assert Was Triggered](AssertWasTriggered.png) | Expects the specified trigger box to be triggered. |
| ![Assert Was Not Triggered](AssertWasNotTriggered.png) | Expects the specified trigger box not to be triggered. |

## Equality

| Node | Description |
| --- | --- |
| ![Assert Equal (Byte)](AssertEqualByte.png) | Expects the specified bytes to be equal. |
| ![Assert Equal (Integer)](AssertEqualInteger.png) | Expects the specified 32-bit integers to be equal. |
| ![Assert Equal (Integer64)](AssertEqualInteger64.png) | Expects the specified 64-bit integers to be equal. |
| ![Assert Equal (Float)](AssertEqualFloat.png) | Expects the specified floats to be (nearly) equal. |
| ![Assert Equal (Name)](AssertEqualName.png) | Expects the specified names to be equal. |
| ![Assert Equal (String)](AssertEqualString.png) | Expects the specified strings to be equal. |
| ![Assert Equal (Text)](AssertEqualText.png) | Expects the specified texts to be equal. |
| ![Assert Equal (Vector)](AssertEqualVector.png) | Expects the specified vectors to be (nearly) equal. |
| ![Assert Equal (Rotator)](AssertEqualRotator.png) | Expects the specified rotators to be (nearly) equal. |
| ![Assert Equal (Transform)](AssertEqualTransform.png) | Expects the specified transforms to be (nearly) equal. |

## Inequality

| Node | Description |
| --- | --- |
| ![Assert Not Equal (Byte)](AssertNotEqualByte.png) | Expects the specified bytes not to be equal. |
| ![Assert Compare (Byte)](AssertCompareByte.png) | Compares the specified bytes for order. |
| ![Assert Not Equal (Integer)](AssertNotEqualInteger.png) | Expects the specified 32-bit integers not to be equal. |
| ![Assert Compare (Integer)](AssertCompareInteger.png) | Compares the specified 32-bit integers for order. |
| ![Assert Not Equal (Integer64)](AssertNotEqualInteger64.png) | Expects the specified 64-bit integers not to be equal. |
| ![Assert Compare (Integer64)](AssertCompareInteger64.png) | Compares the specified 64-bit integers for order. |
| ![Assert Not Equal (Float)](AssertNotEqualFloat.png) | Expects the specified floats not to be equal. |
| ![Assert Compare (Float)](AssertCompareFloat.png) | Compares the specified floats for order. |
| ![Assert Not Equal (Name)](AssertNotEqualName.png) | Expects the specified names not to be equal. |
| ![Assert Not Equal (String)](AssertNotEqualString.png) | Expects the specified strings not to be equal. |
| ![Assert Not Equal (Text)](AssertNotEqualText.png) | Expects the specified texts not to be equal. |
| ![Assert Not Equal (Vector)](AssertNotEqualVector.png) | Expects the specified vectors not to be equal. |
| ![Assert Not Equal (Rotator)](AssertNotEqualRotator.png) | Expects the specified rotators not to be equal. |
| ![Assert Not Equal (Transform)](AssertNotEqualTransform.png) | Expects the specified transforms not to be equal. |

## Range Checks

| Node | Description |
| --- | --- |
| ![Assert In Range (Byte)](AssertInRangeByte.png) | Expects Value to be between MinInclusive and MaxInclusive. |
| ![Assert In Range (Integer)](AssertInRangeInteger.png) | Expects Value to be between MinInclusive and MaxInclusive. |
| ![Assert In Range (Integer64)](AssertInRangeInteger64.png) | Expects Value to be between MinInclusive and MaxInclusive. |
| ![Assert In Range (Float)](AssertInRangeFloat.png) | Expects Value to be between MinInclusive and MaxInclusive. |
| ![Assert Not In Range (Byte)](AssertNotInRangeByte.png) | Expects Value not to be between MinInclusive and MaxInclusive. |
| ![Assert Not In Range (Integer)](AssertNotInRangeInteger.png) | Expects Value not to be between MinInclusive and MaxInclusive. |
| ![Assert Not In Range (Integer64)](AssertNotInRangeInteger64.png) | Expects Value not to be between MinInclusive and MaxInclusive. |
| ![Assert Not In Range (Float)](AssertNotInRangeFloat.png) | Expects Value not to be between MinInclusive and MaxInclusive. |

## UMG Widgets

| Node | Description |
| --- | --- |
| ![Assert Widget Is Visible](AssertWidgetIsVisible.png) | Expects the specified widget to be valid and visible (e.g. added to viewport, not hidden or collapsed). |
| ![Assert Text Is Set](AssertTextIsSet.png) | Expects the specified text not to be empty. |
| ![Assert Rich Text Is Set](AssertRichTextIsSet.png) | Expects the specified rich text not to be empty. |
| ![Assert Image Is Set](AssertImageIsSet.png) | Expects the specified image to be set up to use a texture or material. |


text:
![Imgur](https://i.imgur.com/9awJmtb.png)

Elastic Compute Cloud (EC2) 101 - Part 1
======

**This is the most important topic for any Exam**

## Video Link

[![Imgur](https://i.imgur.com/QadOcM8.png)](https://acloud.guru/course/aws-certified-solutions-architect-associate/learn/ec2/73be2298-8762-a19e-2f5b-32b1b57c7b35/watch)

*Note - You will need an [acloud.guru](acloud.guru) account.*

## What is EC2?

`Virtual machines in the cloud.` Elastic Compute Cloud (EC2) is a web service that provides resizeable compute
capacity in the cloud. It reduces the time required to obtain and boot new server instances to minutes, allowing you
to quickly scale capacity both up and down, as your computing requirements change.

The service effectively shifts the economics of computing to an `a la carte` paradigm.  You simply pay for the
capacity you use. It provides the tools to build failure resilient applications and avoid common failure scenarios.

## Pricing Models

The service offers four `pricing models`.

### On Demand

* fixed rate by the hour (or by the second) with no commitments
  * Note - pricing by the second is a new feature. Only linux instances can be priced by the second. Windows instances
    are still only priced by the hour
* Users that want low cost and flexibility of EC2 without any up-front payment or long-term commitment
* Applications with short term, spiky or unpredictable workloads that cannot be interrupted
* Applications being developed or tested on EC2 for the first time

### Reserved

* 1 - 3 year term contract
* Intended for applications with steady state and predictable usage that require specific amount of capacity
* Users able to make upfront payments to reduce their total computing costs even further
* For those studying for the Professional exams, there are 3 different types of reserved instances (RI) options:
  1.  `Standard RI's` - up to 75% off on demand
  2.  `Convertible RI's` - up to 45% off on demand. Offers the capability to change the attributes of the RI as long as
      the exchange results in the creation of RI's of equal or greater value. For example you could change the RI from
      linux to windows
  3.  `Scheduled RI's` - (very new). these RI's are available to launch within a configurable schedule. This option
      allows you to match your capacity reservation to a predictable recurring schedule that only requires a
      fraction of a day, week, or a month

### Spot

* Market price bid. You lock in a price you want to pay. When the market price of the capacity you need
  hits that price, it becomes available
* Intended for applications with flexible end and start times that are only feasible at very low compute prices
* Another `Use Case` is for users with urgent computing needs for large amounts of additional capacity
* Example customers, are insurance companies that need to do big data processing and can wait until 3 AM on Saturday
  to minimize the price of the job

### Dedicated Host

* Physical dedicated EC2 server
* Useful for regulatory requirements that may not support multi-tenant virtualization
* Great for licensing which does not support multi-tenancy or cloud deployments
* Can be purchased On-Demand (hourly)
* Can be purchased as a Reservation for up to 70% off the On-Demand price

## EC2 Instance Types

![Imgur](https://i.imgur.com/iM2JHsP.png)

* `Family` - There are more being added all the time. Last year there were seven. Now there are ten. Families are
  organized (and named) based on their purpose. `D2` - the `D` stands for `density` or file servers. The `2` just
  means second generation. It used to be `D1`. You didn't know them all but it helps to have some understanding
  of what the different families are
  * `D` - density
  * `R` - RAM; memory optimized
  * `M` - think `main choice` general purpose
  * `C` - CPU; compute optimized
  * `G` - graphics
  * `I` - interface options (IOPs); high speed storage
  * `F` - (brand new) field programming -- google "FPGA"
  * `T` - low cost general purpose
  * `P` - graphics and general purpose -- machine learning
  * `X` - extreme RAM; extreme memory optimization
* How to Remember all the families: `Dr Mc GIFT PX`

  ![Imgur](https://i.imgur.com/XO09jj1.png)

##
**[Previous Lab/Lecture](../s3/s3-exam-tips.md) | [AWS (root)](../readme.adoc) | [Next Lab/Lecture](ec2-101-pt2.md)**

repository: bradyhouse/house

repo_name: bradyhouse/house


text:
# Sample: Azure SignalR Service integration with Event Grid and Azure Function

A step by step tutorial to build a chat room with real-time online counting using Azure Functions, Event Grid, App Service Authentication, and SignalR Service.

- [Prerequisites](#prerequisites)
- [Initialize the function app](#initialize-function-app)
- [Deploy and run function app on Azure](#deploy-to-azure)
- [Enable authentication on Azure](#enable-authentication)
- [Build the sample locally](#build-locally)

## Prerequisites

The following softwares are required to build this tutorial.

* [Node.js](https://nodejs.org/en/download/) (Version 10.x, required for JavaScript sample)
* [.NET SDK](https://www.microsoft.com/net/download) (Version 6.0, required for Functions extensions)
* [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools) (Version 4)
* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)

### Create an Azure SignalR Service instance

No matter you want to build and test the Azure Functions app on Azure or locally. The app will access a SignalR Service instance in Azure that needs to be created ahead of time.

1. Create Azure SignalR Service using `az cli`

    ```bash
    az signalr create -n <signalr-name> -g <resource-group-name> --sku Free_F1
    ```

    For more details about creating Azure SignalR Service, see the [tutorial](https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-azure-functions-javascript#create-an-azure-signalr-service-instance).

1. After the instance is deployed, open it in the portal and locate its `Settings` page. Change the Service Mode setting to **Serverless**.

    ![signalr-serverless](media/signalr-serverless.png)

### Create a Storage account

An Azure Storage account is required by a function app using Event Grid trigger. You will also host the web page for the chat UI using the static websites feature of Azure Storage if you try to deploy the application to Azure.

- Create a storage with kind `StorageV2` using `az cli`

    ```bash
     az storage account create -n <storage-account-name> -g <resource-group-name> -l <location> --sku Standard_LRS --kind StorageV2
    ```

## Initialize the function app

- Git clone the project and open the folder with VS Code

    ```bash
    git clone git@github.com:aspnet/AzureSignalR-samples.git
    ```

- In the repository, there're two Event Grid integration samples using different languages. For the JavaScript sample, navigate to

    ```bash
    AzureSignalR-samples/samples/EventGridIntegration/javascript
    ```

- If you want to use C# sample, navigate to

    ```bash
    AzureSignalR-samples/samples/EventGridIntegration/csharp
    ```

### Configure application settings

When running and debugging the Azure Functions runtime locally, application settings are read from **local.settings.json**. Also, you can upload there settings to remote when you try to deploy Function App to Azure. Update this file with the connection string of the SignalR Service instance that you created earlier.

1. Open the file **local.settings.json** and update the settings. (The file shown below is used by JavaScript sample, and the C# sample is similar)

    ```json
    {
      "IsEncrypted": false,
      "Values": {
        "AzureSignalRConnectionString": "<signalr-connection-string>",
        "WEBSITE_NODE_DEFAULT_VERSION": "10.14.1",
        "FUNCTIONS_WORKER_RUNTIME": "node",
        "AzureWebJobsStorage": "<Azure-storage-connection-string>",
        "AZURE_STORAGE_CONNECTION_STRING": "<Azure-storage-connection-string>"
      },
      "Host": {
        "LocalHttpPort": 7071,
        "CORS": "http://<IP_ADDRESS>:5500",
        "CORSCredentials": true
      }
    }
    ```

   - Replace `AzureSignalRConnectionString` with Azure SignalR Service connection string. Obtain the value from the **Keys** page in the Azure SignalR Service resource in the Azure portal; either the primary or secondary connection string can be used.

        ![Get SignalR Service key](media/signalr-get-key.png)

   - Replace `AzureWebJobsStorage` and `AZURE_STORAGE_CONNECTION_STRING` with connection string of storage created previously. `AzureWebJobsStorage` is used by Event Grid trigger and the `AZURE_STORAGE_CONNECTION_STRING` is used by storage client in codes.

1. Save the file.

1. Open the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`) and select **Azure Functions: Initialize Project for Use with VSCode**.

1. Open the terminal and run `func extensions install` to install all the dependencies.

## Deploy and run function app on Azure

### Deploy function app to Azure

1. In the VS Code, install the [Azure Functions Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions).

1. Open the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`) and select **Azure Functions: Deploy to Function App**.

1. When prompted, provide the following information.

    | Name | Value |
    |---|---|
    | Folder to deploy | Select the main project folder |
    | Subscription | Select your subscription |
    | Function app | Select **Create New Function App** |
    | Function app name | Enter a unique name |
    | Resource group | Select the same resource group as the SignalR Service instance |
    | Storage account | Select the storage account you created earlier |

    A new function app is created in Azure and the deployment begins. Wait for the deployment to complete.

### Upload function app local settings

1. Open the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`).

1. Search for and select the **Azure Functions: Upload local settings** command.

1. When prompted, provide the following information.

    | Name | Value |
    |---|---|
    | Local settings file | local.settings.json |
    | Subscription | Select your subscription |
    | Function app | Select the previously deployed function app |

    Local settings are uploaded to the function app in Azure. If prompted to overwrite existing settings, select **Yes to all**.

### Configure static websites

We use **Static Website** to host the web page. Find the [document](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website) for more details.

1. Enable the static website feature

    ```bash
    az storage blob service-properties update --account-name <storage-account-name> --static-website --index-document index.html
    ```

1. Get the url of function app

    ```bash
    hostname=$(az functionapp show -n <function-app-name> -g <resource-group-name> -o tsv --query defaultHostName)
    ```

    Replace the `apiBaseUrl` in `index.html` with the url `https://$(hostname)`

    Upload the `index.html` to Azure Storage

    ```bash
    az storage blob upload-batch -s content -d '$web' --account-name <storage-account-name>
    ```

    Get the primary url of website and save it for future use.

    ```bash
    az storage account show -n <storage-account-name> -g <resource-group-name> --query "primaryEndpoints.web" --output tsv
    ```

### Subscribe Azure SignalR events

Subscribe to Azure SignalR OnConnected and OnDisconnected events and let Event Grid trigger be enabled.

1. Open the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`).

1. Search for and select the **Azure Functions: Open in portal** command.

1. Select the Function `OnConnection` in the left panel. After the function shown, click `Add Event Grid subscription` and choose the Azure SignalR Service.
    ![Add subscription](media/add-subscription.png)

1. Fill the page as shown below.
    ![Subscribe Azure SignalR Service events](media/signalr-event-grid-subscribe.png)

### Enable function app cross origin resource sharing (CORS)

Although there is a CORS setting in **local.settings.json**, it is not propagated to the function app in Azure. You need to set it separately.

1. Open the function app in the Azure portal.

1. Under the **Platform features** tab, select **CORS**.

1. In the *Allowed origins* section, add an entry with the static website *primary endpoint* as the value (remove the trailing */*).

1. In order for the SignalR JavaScript SDK call your function app from a browser, support for credentials in CORS must be enabled. Select the "Enable Access-Control-Allow-Credentials" checkbox.

1. Click **Save** to persist the CORS settings.

### Try the application

1. In a browser, navigate to the storage account's primary web endpoint.

1. When you're connected, the online connection count is shown and you will get a welcome message.

1. Send public messages by entering them into the main chat box.

    ![Overview of the application](media/overview.png)

## Enable authentication on Azure

### Enable App Service Authentication

App Service Authentication supports authentication with Azure Active Directory, Facebook, Twitter, Microsoft account, and Google.

1. In the function app that was opened in the portal, locate the **Platform features** tab, select **Authentication/Authorization**.

1. Turn **On** App Service Authentication.

1. In **Action to take when request is not authenticated**, select "Allow Anonymous requests (no action)".

1. In **Allowed External Redirect URLs**, enter the URL of your storage account primary web endpoint that you previously noted.

1. Follow the documentation for the login provider of your choice to complete the configuration.

    - [Azure Active Directory](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-aad)
    - [Facebook](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-facebook)
    - [Twitter](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-twitter)
    - [Microsoft account](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-microsoft)
    - [Google](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-google)

     ![Authentication](media/authentication.png)

### Update the web app

1. Open **index.html** and update the value of `isAuthNeeded` to `true`.

1. The application can be configured with authentication using Azure Active Directory, Facebook, Twitter, Microsoft account, or Google. Select the authentication provider that you will use by setting the value of `authProvider`.

1. Use **Azure Storage: Deploy to Static Website** command to upload the **index.html** to Azure Storage

### Update negotiate function

1. Update the attribute parameter of negotiate function.

    - If you're using JavaScript sample, update in `userId` in `negotiate/function.json` to `"{headers.x-ms-client-principal-name}"`.

        ```json
        {
          "type": "signalRConnectionInfo",
          "name": "connectionInfo",
          "userId": "{headers.x-ms-client-principal-name}",
          "hubName": "EventGridIntegrationSampleChat",
          "direction": "in"
        }
        ```

    - If you're using C# sample, add parameter `UserId = "{headers.x-ms-signalr-userid}"` to `Negotiate` function.

        ```C#
        [SignalRConnectionInfo(HubName = HubName, UserId = "{headers.x-ms-signalr-userid}")] SignalRConnectionInfo connectionInfo
        ```

1. Deploy the function to Azure again

### Try the application with authentication

1. In a browser, navigate to the storage account's primary web endpoint.

1. Select **Login** to authenticate with your chosen authentication provider.

1. When you're connected, the online connection count is shown and you will get a welcome message.

1. Send public messages by entering them into the main chat box.

1. Send private messages by clicking on a username in the chat history. Only the selected recipient will receive these messages.

    ![Overview with auth](media/overview-with-auth.png)

## Build and run the sample locally

### Prerequisites

* [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) - serve web pages locally for testing
* [ngrok](https://ngrok.com/) - Public URLs for exposing your local Event Grid trigger

### Create an ngrok endpoint

When running Event Grid trigger locally, you need a tool to proxy events to your local endpoint like [ngrok](https://ngrok.com/). For more details about running Event Grid trigger locally, go to the [document](https://docs.microsoft.com/en-us/azure/azure-functions/functions-debug-event-grid-trigger-local).

Download *ngrok.exe* from [ngrok](https://ngrok.com/), and run with the following command:

```
ngrok http -host-header=localhost 7071
```

The -host-header parameter is needed because the functions runtime expects requests from localhost when it runs on localhost. 7071 is the default port number when the runtime runs locally.

The command creates output like the following:

```
Session Status                online
Version                       2.2.8
Region                        United States (us)
Web Interface                 http://<IP_ADDRESS>:4040
Forwarding                    http://263db807.ngrok.io -> localhost:7071
Forwarding                    https://263db807.ngrok.io -> localhost:7071

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00
```

You'll use the `https://{subdomain}.ngrok.io` URL for your Event Grid subscription.

### Run the Event Grid trigger function

The ngrok URL doesn't get special handling by Event Grid, so your function **must be running** locally when the subscription is created. If it isn't, the validation response doesn't get sent and the subscription creation fails.

### Create a subscription

Create an Event Grid subscription of SignalR Service, and give it your ngrok endpoint.

Use this endpoint pattern for Functions 2.x:

```
https://{SUBDOMAIN}.ngrok.io/runtime/webhooks/eventgrid?functionName={FUNCTION_NAME}
```

The `{FUNCTION_NAME}` parameter must be the name specified in the `FunctionName` attribute.

Here's an example to integrate with Azure SignalR Service using the Azure CLI:

```azurecli
az eventgrid event-subscription create --resource-id <signalr-service-resource-id> --name <event-grid-subscription-name> --endpoint https://263db807.ngrok.io/runtime/webhooks/eventgrid?functionName=OnConnection
```

## Run the client page and test

The chat application's UI is a simple single page application (SPA) created with the Vue JavaScript framework. It will be hosted separately from the function app. Locally, you will run the web interface using the Live Server VS Code extension.

1. Press **F5** to run the function app locally and attach a debugger.

1. With **index.html** open, start Live Server by opening the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`) and selecting **Live Server: Open with Live Server**. Live Server will open the application in a browser.
    - The `Host` section in **local.settings.json** configures the port and CORS settings for the local Functions host (this setting has no effect when running in Azure).

       > [!NOTE]
       > Live Server is typically configured to serve content from `http://<IP_ADDRESS>:5500`. If you find that it is using a different URL or you are using a different HTTP server, change the `CORS` setting to reflect the correct origin.

1. The application opens. You will get a welcome message from `Function` and real-time connected connection counting. Also, you can broadcast message in the chat sample.

repository: aspnet/AzureSignalR-samples

repo_name: aspnet/AzureSignalR-samples


text:
# ArcGIS API for JavaScript: Best Practices for Building Apps

The ArcGIS API 4.x for JavaScript is our next-generation web technology for building interactive, compelling web applications that run across any device. There are significant changes to the core features and programming patterns to enable a cleaner, more productive developer experience. Come to this session if you plan to migrate a JS app to the new API, or plan to write one from scratch. You will learn about key aspects of the new API design, and best practices for developing with the API.

## Slides

[View presentation](https://odoe.github.io/presentations/2018-UC/jsapi-best-practices/slides/)

repository: odoe/presentations

repo_name: odoe/presentations