text:
# Description

[Mimecast](https://www.mimecast.com) is a set of cloud services designed to provide next generation protection against
advanced email-borne threats such as malicious URLs, malware, impersonation attacks, as well as internally generated
threats, with a focus on email security.
This plugin utilizes the [Mimecast API](https://www.mimecast.com/developer/documentation).

# Key Features

* Email security
* Malicious URL and attachment detection

# Requirements

* Access API Key
* Secret Key
* Mimecast server
* API Username and Password

# Supported Product Versions

* Mimecast API 2022-11-07

# Documentation

* https://www.mimecast.com/tech-connect/documentation/api-overview

## Setup

The connection configuration accepts the following parameters:

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|access_key|credential_secret_key|None|True|The application access key|None|eWtOL3XZCOwG96BOiFTZRiC5rdvDmP4FFdwU2Y1DC1Us-gh7KyL5trUrZ9aEuzQMV7pPWWxTnPVtsJ6x3fajAh3cRskP0w8hNjaFFVkZB6G9dOytLM2ssQ7HY-p7gJoi|
|app_id|string|None|True|Application ID|None|78d2e4b1-8cc2-4806-nt79-6ef332a47374|
|app_key|credential_secret_key|None|True|The application key|None|475x54c6-4f61-4fab-8be7-a0710f3859e3|
|region|string|EU|True|The region for the Mimecast server|['EU', 'DE', 'US', 'CA', 'ZA', 'AU', 'Offshore', 'Sandbox']|EU|
|secret_key|credential_secret_key|None|True|The application secret key|None|FgHrtydiP4TynI+rTZF42Qu0FtGuhJtuNM5bDh82goJQHed9kJZ5t/ORwGnI5r2hkl/bzCosZ+KVapJFeaf3Yw==|

Example input:

```
{
  "access_key": "eWtOL3XZCOwG96BOiFTZRiC5rdvDmP4FFdwU2Y1DC1Us-gh7KyL5trUrZ9aEuzQMV7pPWWxTnPVtsJ6x3fajAh3cRskP0w8hNjaFFVkZB6G9dOytLM2ssQ7HY-p7gJoi",
  "app_id": "78d2e4b1-8cc2-4806-nt79-6ef332a47374",
  "app_key": "475x54c6-4f61-4fab-8be7-a0710f3859e3",
  "region": "EU",
  "secret_key": "FgHrtydiP4TynI+rTZF42Qu0FtGuhJtuNM5bDh82goJQHed9kJZ5t/ORwGnI5r2hkl/bzCosZ+KVapJFeaf3Yw=="
}
```

## Technical Details

### Actions

#### Track Messages

This action is used to search for messages processing, and current state using specific message information. Either one of `send_from`, `send_to`, `subject`, `sender_ip` fields, or `message_id` must not be empty.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|end_date|date|None|False|The date and time of the latest message to track|None|Example Reason|
|message_id|string|None|False|The internet message id of the message to track|None|ExampleID|
|routes|[]string|None|False|An array of routes to filter by. Possible values are internal, outbound and inbound|None|["internal", "outbound"]|
|search_reason|string|None|False|Reason for Tracking a email, used for activity tracking purposes|None|Example Reason|
|send_from|string|None|False|The sending email address or domain of the messages to<EMAIL_ADDRESS>|send_to|string|None|False|The recipient email address or domain of the messages to<EMAIL_ADDRESS>|sender_ip|string|None|False|The source IP address of messages to track|None|<IP_ADDRESS>|
|start_date|date|None|False|The date and time of the earliest message to track|None|Example Reason|
|subject|string|None|False|The subject of the messages to track|None|Example Email Subject|

Example input:

```
{
  "end_date": "Example Reason",
  "message_id": "ExampleID",
  "routes": [
    "internal",
    "outbound"
  ],
  "search_reason": "Example Reason",
  "send_from"<EMAIL_ADDRESS>  "send_to"<EMAIL_ADDRESS>  "sender_ip": "<IP_ADDRESS>",
  "start_date": "Example Reason",
  "subject": "Example Email Subject"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|tracked_emails|[]tracked_emails|True|An array of found tracked emails|[]|

Example output:

```
{
  "tracked_emails": [
    {
      "detectionLevel": "",
      "fromEnv": {
        "emailAddress"<EMAIL_ADDRESS>      },
      "fromHdr": {
        "emailAddress": ""
      },
      "id": "123456789",
      "info": "Envelope Rejected",
      "received": "2022-12-01T12:49:46+0000",
      "route": "inbound",
      "senderIP": "<IP_ADDRESS>",
      "sent": "2022-12-01T12:49:46+0000",
      "spamScore": 0,
      "status": "rejected",
      "subject": "Example Subject",
      "to": [
        {
          "displayableName": "Example User",
          "emailAddress"<EMAIL_ADDRESS>        }
      ]
    }
  ]
}
```

#### Delete Blocked Sender Policy

This action deletes a blocked sender policy.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|id|string|None|True|The Mimecast secure ID of an existing policy to be deleted|None|eWtOL3XZCOwG96BOiFTZRiC5rdvDmP4FFdwU2Y1DC1Us-gh7KyL5trUrZ9aEuzQMV7pPWWxTnPVtsJ6x3fajAh3cRskP0w8hNjaFFVkZB6G9dOytLM2ssQ7HY-p7gJoi|

Example input:

```
{
  "id": "eWtOL3XZCOwG96BOiFTZRiC5rdvDmP4FFdwU2Y1DC1Us-gh7KyL5trUrZ9aEuzQMV7pPWWxTnPVtsJ6x3fajAh3cRskP0w8hNjaFFVkZB6G9dOytLM2ssQ7HY-p7gJoi"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|success|boolean|True|Success status of delete request|True|

Example output:

```
{
  "success": true
}
```

#### Get Audit Events

This action is used to get audit of events in Mimecast service.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|audit_events_data|audit_events_data|None|True|Data for request|None|{"categories": ["test", "malware"], "endDateTime": "2022-02-02T08:15:30-05:00", "query": "example query", "startDateTime": "2022-02-02T08:15:30-05:00"}|
|audit_events_pagination|audit_events_request_pagination|None|False|Pagination object for request|None|{"pageSize": 25, "pageToken": "9de5069c5afe602b2ea0a04b66beb2c0"}|

Example input:

```
{
  "audit_events_data": {
    "categories": [
      "test",
      "malware"
    ],
    "endDateTime": "2022-02-02T08:15:30-05:00",
    "query": "example query",
    "startDateTime": "2022-02-02T08:15:30-05:00"
  },
  "audit_events_pagination": {
    "pageSize": 25,
    "pageToken": "9de5069c5afe602b2ea0a04b66beb2c0"
  }
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|pagination|pagination|False|Pagination for request|{}|
|response|[]audit_events_response|True|Event logs data|[]|

Example output:

```
{
  "response": [
    {
      "id": "wOi3MCwj2RMAhvN30QSmqOT7D-g10nypvPqTB5X5oQtdKJE4Qkl51X5Ue_U",
      "scheme": "https",
      "domain": "www.testset3444412312.net",
      "port": -1,
      "path": "/",
      "queryString": "",
      "matchType": "explicit",
      "action": "block",
      "comment": "",
      "disableUserAwareness": false,
      "disableRewrite": false,
      "disableLogClick": false
    }
  ],
  "pagination": {
    "pageSize": 25,
    "pageToken": "9de5069c5afe602b2ea0a04b66beb2c0"
  }
}
```

#### Create Managed URL

This action is used to create a managed URL.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|action|string|block|True|Set to 'block' to blacklist the URL, 'permit' to whitelist it|['block', 'permit']|block|
|comment|string|None|False|A comment about the why the URL is managed; for tracking purposes|None|Deemed malicious by VirusTotal|
|disable_log_click|boolean|None|True|Disable logging of user clicks on the URL|None|False|
|disable_rewrite|boolean|None|True|Disable rewriting of this URL in emails. Applies only if action = 'permit'|None|True|
|disable_user_awareness|boolean|None|True|Disable User Awareness challenges for this URL. Applies only if action = 'permit'|None|False|
|match_type|string|explicit|True|Set to 'explicit' to block or permit only instances of the full URL. Set to 'domain' to block or permit any URL with the same domain|['explicit', 'domain']|explicit|
|url|string|None|True|The URL to block or permit. Do not include a fragment|None|https://example.com|

Example input:

```
{
  "action": "block",
  "comment": "Deemed malicious by VirusTotal",
  "disable_log_click": false,
  "disable_rewrite": true,
  "disable_user_awareness": false,
  "match_type": "explicit",
  "url": "https://example.com"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|response|[]managed_url|False|Managed URL that was created|[]|

Example output:

```
{
  "response": [
    {
      "id": "wOi3MCwjYFqOT7D-I9AbwlwvY3ImP7QVjTLhGwOgsDbzzFK8SjGLNE4",
      "scheme": "https",
      "domain": "www.test.net",
      "port": -1,
      "path": "/",
      "queryString": "",
      "matchType": "explicit",
      "action": "permit",
      "comment": "",
      "disableUserAwareness": false,
      "disableRewrite": false,
      "disableLogClick": false
    }
  ]
}
```

#### Get Managed URL

This action is used to get information on a managed URL.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|action|string|none|False|Filter on whether or not the action is 'block' or 'permit'|['none', 'block', 'permit']|block|
|disable_log_click|string|None|False|Filter on whether or not clicks are logged for this URL|['None', 'False', 'True']|True|
|disable_rewrite|string|None|False|Filter on whether or not rewriting of this URL in emails is enabled|['None', 'False', 'True']|False|
|disable_user_awareness|string|None|False|Filter on whether or not User Awareness challenges for this URL|['None', 'False', 'True']|False|
|domain|string|None|False|The managed domain|None|https://example.com|
|domainOrUrl|string|None|False|A domain or URL to filter results|None|https://example.com|
|exactMatch|boolean|False|False|If true, the domainOrUrl value to act as an exact match value. If false, any partial matches will be returned|None|False|
|id|string|None|False|Filter on the Mimecast secure ID of the managed URL|None|wOi3MCwjYFYhZfkYlp2RMAhwOgsDZixCK43rDjLP0YPWrtBgqVtVbzzFK8SjGLNE4|
|match_type|string|none|False|Filter on whether or not the match type is 'explicit' or 'domain'|['none', 'explicit', 'domain']|domain|
|scheme|string|None|False|Filter on whether or not the protocol is HTTP or HTTPS|None|http|

Example input:

```
{
  "action": "block",
  "disable_log_click": true,
  "disable_rewrite": false,
  "disable_user_awareness": false,
  "domain": "https://example.com",
  "domainOrUrl": "https://example.com",
  "exactMatch": false,
  "id": "wOi3MCwjYFYhZfkYlp2RMAhwOgsDZixCK43rDjLP0YPWrtBgqVtVbzzFK8SjGLNE4",
  "match_type": "domain",
  "scheme": "http"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|response|[]managed_url|False|Managed URLs matching |[]|

Example output:

```
{
  "response": [
    {
      "id": "wOi3MCwjYFYhZfkYlp2RMAhvN30QSmqOT7D-I9Abwlmy7ZH7eCwvY3ImP7QVjTLho3KMtTMfYm2C21vDPXvKC5vmEJWDAcvTHtH4L4Kw20c",
      "scheme": "https",
      "domain": "steam.com",
      "port": -1,
      "matchType": "explicit",
      "action": "block",
      "comment": "ui test",
      "disableUserAwareness": true,
      "disableRewrite": true,
      "disableLogClick": false
    }
  ]
}
```

#### Delete Managed URL

This action is used to remove a Managed URL from the blocked list.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|id|string|None|True|The Mimecast secure ID of the managed URL|None|wOi3MCwjYFYhZfkYlp2RMAhvN30QSmqOT7D-I9Abwlmy7ZH7eCwvY3ImP7QVjTLhHMy6V8J3VOvTNMW2G-txx3o4zL0YXqWxuCVlGQ-1viE|

Example input:

```
{
  "id": "wOi3MCwjYFYhZfkYlp2RMAhvN30QSmqOT7D-I9Abwlmy7ZH7eCwvY3ImP7QVjTLhHMy6V8J3VOvTNMW2G-txx3o4zL0YXqWxuCVlGQ-1viE"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|success|boolean|False|Success status of delete request|True|

Example output:

```
{
  "response": [
    {
      "success": true
    }
  ]
}
```

#### Permit or Block Sender

This action is used to permit or block a sender.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|action|string|block|True|Either 'permit' (to bypass spam checks) or 'block' (to reject the email)|['block', 'permit']|block|
|sender|string|None|True|The email address of the external<EMAIL_ADDRESS>|to|string|None|True|The email address of the internal<EMAIL_ADDRESS>
Example input:

```
{
  "action": "block",
  "sender"<EMAIL_ADDRESS>  "to"<EMAIL_ADDRESS>}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|response|[]managed_sender|False|The Managed Sender that was created|[]|

Example output:

```
{
  "response": [
    {
      "id": "MTOKEN:eNoVzbEOgjAUQNF_eTMDGArK1oC2GARFjTpi-zQQ28ZWDGr8d3G-ybkfcCh6i62EBM4MB5Z2hpIiWlM_n0tecYv8nkXLBVH8WOvVTb_Kfcze-ZWefDUUzWHXVeYS1jHdgAeidw-j0AojcRTTbZkFNJ6RcGxPtK41GpLAA9Voh1r-t5OATL8_1zIraQ",
      "sender"<EMAIL_ADDRESS>      "to"<EMAIL_ADDRESS>      "type": "Block"
    }
  ]
}
```

#### Create Blocked Sender Policy

This action is used to create a blocked sender policy.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|description|string|None|True|A description for the policy which is kept with the email in the archive for future reference|None|A description|
|from_part|string|envelope_from|True|Must be: envelope_from, header_from or both|['envelope_from', 'header_from', 'both']|envelope_from|
|from_type|string|individual_email_address|True|Can be one of: everyone, internal_addresses, external_addresses, email_domain, profile_group or individual_email_address|['everyone', 'internal_addresses', 'external_addresses', 'email_domain', 'profile_group', 'individual_email_address']|internal_addresses|
|from_value|string|None|False|Required if `From Type` is one of email_domain, profile_group, individual_email_address. Expected values: If `From Type` is email_domain, a domain name without the @ symbol. If `From Type` is profile_group, the ID of the profile group. If `From Type` is individual_email_address, an email<EMAIL_ADDRESS>|option|string|block_sender|True|The block, option must be: no_action or block_sender|['block_sender', 'no_action']|block_sender|
|source_ips|string|None|False|A comma separated list of IP addresses using CIDR notation (X.X.X.X/XX). When set the policy only applies for connections from matching addresses|None|<IP_ADDRESS>/24|
|to_type|string|individual_email_address|True|Can be one of: everyone, internal_addresses, external_addresses, email_domain, profile_group or individual_email_address|['everyone', 'internal_addresses', 'external_addresses', 'email_domain', 'profile_group', 'individual_email_address']|everyone|
|to_value|string|None|False|Required if `To Type` is one of email_domain, profile_group, individual_email_address. Expected values: If `To Type` is email_domain, a domain name without the @ symbol. If `To Type` is profile_group, the ID of the profile group. If `To Type` is individual_email_address, an email<EMAIL_ADDRESS>
Example input:

```
{
  "description": "A description",
  "from_part": "envelope_from",
  "from_type": "internal_addresses",
  "from_value"<EMAIL_ADDRESS>  "option": "block_sender",
  "source_ips": "<IP_ADDRESS>/24",
  "to_type": "everyone",
  "to_value"<EMAIL_ADDRESS>}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|sender_policy|[]sender_policy|False|The policy that was created|[]|

Example output:

```
{
  "response": [
    {
      "option": "block_sender",
      "id": "eNo1jU0LgjAYgP_LrgpusZl2EzWwUoaKJHibb7W-pk4tif57euj-fHyQBjF0IGu0QW0c20cSFkXgKt_Z2Zz6nNN8wjqU5aqyEuOcRmP6arfgGXl_Si_X_UE0-p0pGFhl6RsyUaPuUkxLjzDiONREYtC9ekAnVA3zxc-SgHhrl9GZHqHTUj1n-G_mUwPRYmNM8fcHIHEysg",
      "policy": {
        "description": "komand test",
        "fromPart": "envelope_from",
        "from": {
          "type": "email_domain",
          "emailDomain": "example.com"
        },
        "to": {
          "type": "everyone"
        },
        "fromType": "email_domain",
        "fromValue": "example.com",
        "toType": "everyone",
        "fromEternal": true,
        "toEternal": true,
        "fromDate": "1900-01-01T00:00:00+0000",
        "toDate": "2100-01-01T23:59:59+0000",
        "override": false,
        "bidirectional": false,
        "conditions": {},
        "createTime": "2019-01-28T17:09:01+0000",
        "lastUpdated": "2019-01-28T17:09:01+0000"
      }
    }
  ]
}
```

#### Add Group Member

This action is used to add an email address or domain to a group.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|domain|string|None|False|A domain to add to a group. Use either email address or domain|None|https://example.com|
|email_address|string|None|False|The email address of a user to add to a group. Use either email address or<EMAIL_ADDRESS>|id|string|None|True|The Mimecast ID of the group to add to|None|eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_-fg_gJJbIxsBEdB2Dl-r1HDCMLeHuufXTZyt8_Gou3l_i21JWeK3TOgJizrBvFM0ez5EaDwcytO5AAeUoCNEFVUoHeAWJ91Lw7WQi7-7X1I3JtswWMK3NNjoASLXgUorIc3_ISA-8b4_Gl8xjA|

Example input:

```
{
  "domain": "https://example.com",
  "email_address"<EMAIL_ADDRESS>  "id": "eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_-fg_gJJbIxsBEdB2Dl-r1HDCMLeHuufXTZyt8_Gou3l_i21JWeK3TOgJizrBvFM0ez5EaDwcytO5AAeUoCNEFVUoHeAWJ91Lw7WQi7-7X1I3JtswWMK3NNjoASLXgUorIc3_ISA-8b4_Gl8xjA"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|email_address|string|False|The email address of the user that was added to the<EMAIL_ADDRESS>|folder_id|string|False|The Mimecast ID of the group that the user / domain was added to|eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_|
|id|string|False|The Mimecast ID of the user / domain that was added to the group|eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_-fg_gJJbIxsBEdB2Dl-r1HDCMLeHuufXTZyt8_Gou3l_i21JWeK3TOgJizrBvFM0ez5EaDwcytO5AAeUoCNEFVUoHeAWJ91Lw7WQi7-7X1I3JtswWMK3NNjoASLXgUorIc3_ISA-8b4_Gl8xjA|
|internal|boolean|False|Whether or not the user or domain is internal|True|

Example output:

```
{
  "id": "eNqrVipOTS4tSs1MUbJSctdOd43RNy3K9klKdA038M4xq8otcfIMqTQods2MNIrR99NOD_IsCyovdEt11A4pSQvKyPL2SS4orgjOTy01jdEvzlbSUUouLS7Jz00tSs5PSQUa6hzs52LoaG5pagKUK0stKs7Mz1OyMtRRSsvPSUktysnMywZZbmxgYmFRCwBatS7G",
  "folder_id": "eNoVzrkOgkAUQNF_eTWFIIjQEdk0OEaUgCUyD8HMojNiROO_i_3Nyf2AxmZQ2FPwgUgRxWbnzZOxKwsyiCjP-BnTe7jYxA5Pq1xsmRhJ4Sbv9SU4zfgrq8vjdSdbO3eDPRjAaH0Dv62ZRgOaQT8kR9VIihO_OpDQDFzPsafwiUr3UoBvGtBKRlH9F-ylZXnfH3hjMBs",
  "email_address"<EMAIL_ADDRESS>  "internal": true
}
```

#### Delete Group Member

This action is used to remove an email address or domain from a group.
Delete on an email or domain that does not exist will result in no operation performed.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|domain|string|None|False|A domain to remove from group. Use either email address or domain|None|example.com|
|email_address|string|None|False|The email address to remove from group. Use either email address or<EMAIL_ADDRESS>|id|string|None|True|The Mimecast ID of the group to remove from|None|eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_-fg_gJJbIxsBEdB2Dl-r1HDCMLeHuufXTZyt8_Gou3l_i21JWeK3TOgJizrBvFM0ez5EaDwcytO5AAeUoCNEFVUoHeAWJ91Lw7WQi7-7X1I3JtswWMK3NNjoASLXgUorIc3_ISA-8b4_Gl8xjA|

Example input:

```
{
  "domain": "example.com",
  "email_address"<EMAIL_ADDRESS>  "id": "eNoVzssKgkAUgOF3OWuhvDHlTjMqgjIilWgzN0UdHZnjBBK9e7b_-fg_gJJbIxsBEdB2Dl-r1HDCMLeHuufXTZyt8_Gou3l_i21JWeK3TOgJizrBvFM0ez5EaDwcytO5AAeUoCNEFVUoHeAWJ91Lw7WQi7-7X1I3JtswWMK3NNjoASLXgUorIc3_ISA-8b4_Gl8xjA"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|success|boolean|False|Status of success of the delete operation|True|

Example output:

```
{
  "success": true
}
```

#### Decode URL

This action is used to decode a Mimecast encoded URL.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|encoded_url|string|None|True|The Mimecast encoded URL|None|https://url.xx.m.mimecastprotect.com/TXH7fhe|

Example input:

```
{
  "encoded_url": "https://url.xx.m.mimecastprotect.com/TXH7fhe"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|decoded_url|string|True|Original decoded URL|https://example.com|

Example output:

```
{
  "decoded_url": "https://example.com"
}
```

#### Find Groups

This action is used to find groups that match a given query.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|query|string|None|False|A string to query for|None|mygroup|
|source|string|cloud|True|A group source to filter on, either "cloud" or "ldap"|['cloud', 'ldap']|cloud|

Example input:

```
{
  "query": "mygroup",
  "source": "cloud"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|groups|[]group|False|A list of groups that mach the query|[]|

Example output:

```
{
  "groups": [
    {
      "id": "eNoVzrEOgjAUQNF_eTMDaLGBDSUCBjAWjDqS9qGYlmorRjH-u7jfnNwPWOSDwU5ACJkbXJLZklWJ5nlBajWyFaeY3uPFZu2r9Mj6Qvbvck-TMTtHJ1e98uZQX7e6JYxGO3BAiuYGYdtIiw7wwT60QsO1wIlfVWXsRTTwyRQ-0dhO9xB6DrRaCjT_BULn1Pv-ACT0L3A",
      "description": "Relay",
      "source": "cloud",
      "parentId": "eNoVzr0OgjAUQOF3uasMkFAq3RqJ4h8E1IAjaS8EU6i2oqLx3cX95Mv5gEUxGGwlMHgWzUgCvk2t0HbI5iFXM0kxvkXBZkm6uMz7verH5ERX73XDz2732lXF8ZLq2s8pz8ABJasrsLpSFh0Qg73rDo3QEid-cUgij9OQ-FP4QGNb3QPzHKi1kmj-C-73B7L7LyY",
      "userCount": 0,
      "folderCount": 0
    },
    {
      "id": "eNoVzssOgjAQQNF_mTWJoGAjOwIqGkVFQUnc1HYgaKHaCvER_x3c35zcL2hkjcKSgwsqbWlmJmx6Hmz9NNAXJymam8LwEYyXM6cKT3G9FvU7Ssj8syi8zKxeK3o8XDcyt2Pi7cAAwekd3JwKjQawRj9lhYpJjr3v76PA8sjEsfuwRaVLWYNrGZBLwVH9H2wyIsNfB8G2MJw",
      "description": "Permitted senders",
      "source": "cloud",
      "parentId": "eNoVzr0OgjAUQOF3uasMkFAq3RqJ4h8E1IAjaS8EU6i2oqLx3cX95Mv5gEUxGGwlMHgWzUgCvk2t0HbI5iFXM0kxvkXBZkm6uMz7verH5ERX73XDz2732lXF8ZLq2s8pz8ABJasrsLpSFh0Qg73rDo3QEid-cUgij9OQ-FP4QGNb3QPzHKi1kmj-C-73B7L7LyY",
      "userCount": 0,
      "folderCount": 0
    }
  ]
}
```

#### Get TTP URL Logs

This action is used to get TTP URL logs.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|from|string|None|False|Start date of logs to return in the following format 2015-11-16T14:49:18+0000. Default is the start of the current day|None|2018-11-22T14:49:18+0000|
|max_pages|integer|100|False|Max pages returned, default 100|None|10|
|oldest_first|boolean|False|False|When true return results in descending order with oldest result first|None|False|
|page_size|integer|10|False|The number of results to request|None|10|
|route|string|all|True|Filters logs by route, must be one of inbound, outbound, internal, or all|['all', 'inbound', 'outbound', 'internal']|inbound|
|scan_result|string|all|True|Filters logs by scan result, must be one of clean, malicious, or all|['clean', 'malicious', 'all']|malicious|
|to|string|None|False|End date of logs to return in the following format 2015-11-16T14:49:18+0000. Default is time of request|None|2018-11-22T14:49:18+0000|
|url_to_filter|string|None|False|Regular expression to filter on. e.g. `examp` will return only URLs with the letters examp in them|None|exam.*|

Example input:

```
{
  "from": "2018-11-22T14:49:18+0000",
  "max_pages": 10,
  "oldest_first": false,
  "page_size": 10,
  "route": "inbound",
  "scan_result": "malicious",
  "to": "2018-11-22T14:49:18+0000",
  "url_to_filter": "exam.*"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|click_logs|[]click_logs|False|Click Logs|[]|

Example output:

```
{
  "click_logs": [
    {
      "userEmailAddress"<EMAIL_ADDRESS>      "url": "https://example.com",
      "ttpDefinition": "Default URL Protection Definition",
      "action": "warn",
      "adminOverride": "N/A",
      "userOverride": null,
      "scanResult": "malicious",
      "category": "Compromised",
      "userAwarenessAction": "N/A",
      "date": "2019-04-23T19:50:28+0000",
      "route": "inbound"
    }
  ]
}
```

### Triggers

_This plugin does not contain any triggers._

## Troubleshooting

For the Create Managed URL action, the URL must include `http://` or `https://` e.g. `http://google.com`
Most common cloud [URLs](https://www.mimecast.com/tech-connect/documentation/api-overview/global-base-urls/)

### Tasks

#### Monitor SIEM Logs

This task is used to monitor and retrieve the latest logs.

##### Input

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|token|string|None|False|Used to request the next available log file|None|9de5069c5afe602b2ea0a04b66beb2c0|

Example input:

```
{
  "token": "9de5069c5afe602b2ea0a04b66beb2c0"
}
```

##### Output

|Name|Type|Required|Description|Example|
|----|----|--------|-----------|-------|
|data|[]object|True|List of logs|[]|

Example output:

```
[
  {
    "Dir": "Example",
    "Rcpt"<EMAIL_ADDRESS>    "RcptHdrType": "To",
    "Sender"<EMAIL_ADDRESS>    "aCode": "1234code",
    "acc": "ABCD12345"
    "datetime": "2023-05-09T12:00:00"
  }
]
```

### Custom Output Types

#### click_logs

|Name|Type|Required|Description|
|----|----|--------|-----------|
|Action|string|False|The action that was taken for the click|
|Admin Override|string|False|The action defined by the administrator for the URL|
|Category|string|False|The category of the URL clicked|
|Date|string|False|The date that the URL was clicked|
|Route|string|False|The route of the email that contained the link|
|Scan Result|string|False|The result of the URL scan|
|TTP Definition|string|False|The description of the definition that triggered the URL to be rewritten by Mimecast|
|URL|string|False|The URL clicked|
|User Awareness Action|string|False|The action taken by the user if user awareness was applied|
|User Email Address|string|False|The email address of the user who clicked the link|
|User Override|string|False|The action requested by the user|

#### group

|Name|Type|Required|Description|
|----|----|--------|-----------|
|Description|string|False|The name of the group|
|Folder Count|integer|False|None|
|Id|string|False|None|
|Parent Id|string|False|None|
|Source|string|False|None|
|User Count|integer|False|None|

#### managed_sender

|Name|Type|Required|Description|
|----|----|--------|-----------|
|ID|string|False|The Mimecast secure ID of the managed sender object|
|Sender|string|False|The email address of the external sender|
|To|string|False|The email address of the internal recipient|
|Type|string|False|Either 'permit' (to bypass spam checks) or 'block' (to reject the email)|

#### managed_url

|Name|Type|Required|Description|
|----|----|--------|-----------|
|Action|string|False|Either block or permit|
|Comment|string|False|The comment that was posted in the request|
|Click Logging|boolean|False|If logging of user clicks on the URL is disabled|
|URL Rewriting|boolean|False|If rewriting of this URL in emails is disabled|
|User Awareness|boolean|False|If User Awareness challenges for this URL are disabled|
|Domain|string|False|The managed domain|
|ID|string|False|The Mimecast secure ID of the managed URL|
|Match Type|string|False|Either 'explicit' or 'domain'|
|Port|integer|False|Port|
|Scheme|string|False|The protocol to apply for the managed URL. Either HTTP or HTTPS|

#### policy

|Name|Type|Required|Description|
|----|----|--------|-----------|
|Bidirectional|boolean|False|If the policy is also applied in the reverse of the email flow, i.e. where the specified recipient in the policy becomes the sender, and the specified sender in the policy becomes the recipient|
|Conditions|object|False|An object with fields describing additional conditions that should affect when the policy is applied|
|Description|string|False|The description for the policy which is kept with the email in the archive for future reference|
|From|object|False|An object containing type and value fields defining which sender addresses the policy applies to|
|From Date|string|False|The date that the policy will apply from|
|From Eternal|boolean|False|If the policy is always applied or if there is a specific start date|
|From Part|string|False|Which from address is used in the policy. Can be any of envelope_from, header_from, both|
|From Type|string|False|Which sender addresses the policy applies to. CCan be one of everyone, internal_addresses, external_addresses, email_domain, profile_group, address_attribute_value, individual_email_address, free_mail_domains, header_display_name|
|From Value|string|False|A value defining which senders the policy applies to|
|Override|boolean|False|If true, this option overrides the order in which the policy is applied, and forces it to be applied first if there are multiple applicable policies, unless more specific policies of the same type have been configured with an override as well|
|To|object|False|An object containing type and value fields defining which recipient addresses the policy applies to|
|To Date|string|False|The date that the policy will apply until|
|To Eternal|boolean|False|If the policy should always be applied or if there is an end date|
|To Type|string|False|Which recipient addresses the policy applies to. Can be one of everyone, internal_addresses, external_addresses, email_domain, profile_group, address_attribute_value, individual_email_address, free_mail_domains, header_display_name|

#### sender_policy

|Name|Type|Required|Description|
|----|----|--------|-----------|
|ID|string|False|The Mimecast ID of the policy. Used when updating the policy|
|Option|string|False|The option set for the policy. Will be one of no_action, block_sender|
|Policy|policy|False|The policy that was created|

#### group

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Description|string|None|False|The name of the group|None|
|None|integer|None|False|None|None|
|None|string|None|False|None|None|
|None|string|None|False|None|None|
|None|string|None|False|None|None|
|None|integer|None|False|None|None|

#### click_logs

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Action|string|None|False|The action that was taken for the click|None|
|Admin Override|string|None|False|The action defined by the administrator for the URL|None|
|Category|string|None|False|The category of the URL clicked|None|
|Date|string|None|False|The date that the URL was clicked|None|
|Route|string|None|False|The route of the email that contained the link|None|
|Scan Result|string|None|False|The result of the URL scan|None|
|TTP Definition|string|None|False|The description of the definition that triggered the URL to be rewritten by Mimecast|None|
|URL|string|None|False|The URL clicked|None|
|User Awareness Action|string|None|False|The action taken by the user if user awareness was applied|None|
|User Email Address|string|None|False|The email address of the user who clicked the link|None|
|User Override|string|None|False|The action requested by the user|None|

#### audit_events_data

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Categories|[]string|None|False|A list of audit category types|['test', 'malware']|
|End Date Time|string|None|True|The end date of events in ISO 8601 date time format|2015-12-03T10:15:30+0000|
|Query|string|None|False|A character string to search for the audit events|test query|
|Start Date Time|string|None|True|The start date of events in ISO 8601 date time format|2011-12-03T10:15:30+0000|

#### audit_events_request_pagination

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Page Size|integer|25|False|The number of results to request|None|
|Page Token|string|None|False|The value of the next or previous fields from an earlier request|None|

#### audit_events_response

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Audit Type|string|None|False|The Mimecast audit type of the event|None|
|Category|string|None|False|The category of the event|None|
|Event Info|string|None|False|The detailed event information|None|
|Event Time|string|None|False|The time of the event in ISO 8601 format|None|
|ID|string|None|False|The Mimecast unique id of the event|None|

#### pagination

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Next|string|None|False|A pageToken value that can be used to request the next page of results. Only returned if there are more results to return|None|
|Page Size|integer|None|False|The number of results requested|None|
|Previous|string|None|False|A pageToken value that can be used to request the previous page of results. Only returned if there is a previous page|None|

#### search_criteria_object

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|End|string|None|False|The end date of messages included in ISO 8601 format|None|
|File Hash|string|None|False|The file hash used in creation of the remediation incident|None|
|From|string|None|False|The sender address of the message|None|
|Message ID|string|None|False|The message id use in creation of the remediation incident|None|
|Restore Code|string|None|False|The restore code used if the incident type is restore|None|
|Start|string|None|False|The start date of messages included in ISO 8601 format|None|
|Subject|string|None|False|Message subject line of the remediated message|None|
|To|string|None|False|The recipient email address of the message|None|
|Unremediate Code|string|None|False|The Mimecast code used to restore a previously remediated message|None|
|URL|string|None|False|URL used to create the remediation incident, if remediation type is URL|None|

#### response_remediation_incident

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Code|string|None|False|The incident code generated at creation, to be used as a reference for the remediation incident lookup|None|
|Create|string|None|False|Timestamp of the incident creation in ISO 8601 format|None|
|Failed|integer|None|False|The number of messages that failed to remediate|None|
|File Remediation Can be Cancelled|boolean|None|False|Indicates whether the file remediation incident can still be cancelled|None|
|File Remediation Cancelled|string|None|False|Timestamp of an incident cancellation, if it has been cancelled, in ISO 8601 format|None|
|File Remediation Expiry Time|string|None|False|Timestamp of a file-bases remediation should expiration in ISO 8601 format|None|
|ID|string|None|False|The Mimecast secure ID of the remediation incident|None|
|Identified|integer|None|False|Number of messages identified with provided search criteria|None|
|Modified|string|None|False|Timestamp of the incident's last modification date in ISO 8601 format|None|
|Reason|string|None|False|The reason provided at the creation of the remediation incident|None|
|Remediated by|string|None|False|Email address of the user who created the remediation incident|None|
|Remove From Device|string|None|False|The devices where the downloaded file should be removed from|None|
|Restored|integer|None|False|The number of messages that were restored, if incident was a restore|None|
|Search Criteria Object|search_criteria_object|None|False|The search criteria used to identify messages|None|
|Successful|integer|None|False|The number of successfully remediated messages|None|
|Type|string|None|False|Type of incident|None|

#### searchCriteria

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|End|string|None|False|The end date from the remediation incident creation|None|
|File Hash|string|None|False|The file hash provided during the remediation incident creation|None|
|From|string|None|False|The sender address provided at the remediation incident creation|None|
|Message ID|string|None|False|The message ID provided during the remediation incident creation|None|
|Restore Code|string|None|False|The code provided to restore a message|None|
|Start|string|None|False|The start date from the remediation incident creation|None|
|To|string|None|False|The recipient address provided at the remediation incident creation|None|
|Unremediate Code|string|None|False|Code used to restore messages that were previously removed by remediation incident|None|

#### get_remediation_incident_response

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Code|string|None|False|Incident code, used as a reference for a remediation incident|None|
|Create|string|None|False|Date that the remediation incident was created|None|
|Failed|integer|None|False|The number of messages that failed to remediate as part of the incident|None|
|ID|string|None|False|The Mimecast ID of the remediation incident, provided when the incident was created|None|
|Identified|integer|None|False|Number of messages identified by the search criteria|None|
|Modified|string|None|False|Date that the remediation incident was last updated|None|
|Reason|string|None|False|The reason provided when an incident was created|None|
|Restored|integer|None|False|The number of messages restored as part of the incident|None|
|Searchcriteria|[]searchCriteria|None|False|Conditions used to build a remediation incident. Includes messageId, file-hash, from or to addresses.|None|
|Successful|integer|None|False|The number of messages successfully remediated as part of the incident|None|
|Type|string|None|False|The type of incident action taken. Can be one of notify_only, automatic, manual or restored|None|

#### find_remediation_searchBy

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Field Name|string|None|False|Incident fields to filter based on|None|
|Value|string|None|False|The text used to filter results|None|

#### find_remediation_filterBy

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Type|string|None|False|Specify the type of incidents to return|None|

#### searchCritera

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|End|string|None|False|Date of most recent incidents to return|None|
|File Hash|string|None|False|File hash used to create remediation incident|None|
|From|string|None|False|Sender address or domain name used to create remediation incident|None|
|Message ID|string|None|False|Message ID used to create remediation incident|None|
|Restore Code|string|None|False|Restore code for remediation event|None|
|Start|string|None|False|Date of oldest results to return|None|
|To|string|None|False|Recipient address or domain name used to create remediation incident|None|
|Unremediate Code|string|None|False|Code required to perform a message restoration|None|

#### incidents

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Code|string|None|False|The remediation incident unique code|None|
|Create|string|None|False|The time stamp of the incident creation|None|
|Failed|integer|None|False|The number of messages that failed to remediate|None|
|ID|string|None|False|The Mimecast secure ID of the remediation incident|None|
|Identified|integer|None|False|The total number of messages identified as part of the remediation incident|None|
|Modified|string|None|False|The time stamp of the last modification to the incident|None|
|Reason|string|None|False|The reason provided when the remediation incident was created|None|
|Restored|integer|None|False|The number of messages restored from the remediation incident|None|
|Search Criteria|searchCritera|None|False|Criteria used when the remediation incident was created|None|
|Successful|integer|None|False|The number of messages sucessfully rememdiated|None|
|Type|string|None|False|The incident type|None|

#### sender

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Display Name|string|None|False|The display name of the sender|None|
|Email Address|string|None|False|The email address of the sender|None|

#### recipient

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Display Name|string|None|False|The display name of the recipient|None|
|Email Address|string|None|False|The email address of the recipient|None|

#### tracked_emails

|Name|Type|Default|Required|Description|Example|
| :--- | :--- | :--- | :--- | :--- | :--- |
|Attachments|boolean|None|False|Indicates whether the message has attachments or not|None|
|Detection Level|string|None|False|The spam scanning level applied to the message|None|
|Envelope From|sender|None|False|An object describing the envelope from address of the message|None|
|Header From|sender|None|False|An object describing the header from address information of the message|None|
|ID|string|None|False|The Mimecast ID of the message|None|
|Received|date|None|False|The date and time the message was received by Mimecast|None|
|Route|string|None|False|The route of the message|None|
|Sender IP Address|string|None|False|The source IP address of the message|None|
|Sent|date|None|False|The date and time that the message was sent / processed by Mimecast|None|
|Spam Score|integer|None|False|The spam score of the received message|None|
|Status|string|None|False|The status of the message|None|
|Subject|string|None|False|The subject of the message|None|
|To|[]recipient|None|False|An array of recipients|None|

# Version History

* 5.3.0 - Handled rate limiting error messaging | Update to latest plugin SDK
* 5.2.2 - Handled status code for `Monitor SIEM Logs` | Request limit set to 1 minute in `Monitor SIEM Logs`
* 5.2.1 - Connection: add connection version
* 5.2.0 - New task added `Monitor SIEM Logs` | Update plugin to be cloud enabled
* 5.1.0 - Create Blocked Sender Policy: Changed defaults to `individual_email_address` | New actions added `Delete Blocked Sender Policy`, `Track Messages`
* 5.1.0 - Create Blocked Sender Policy: Changed defaults to `individual_email_address` | New actions added `Delete Blocked Sender Policy`, `Track Messages`
* 5.0.2 - Add Group Member: Fix issue when users were running into email validation error when they add a domain, and leave the email address blank on the input section.
* 5.0.1 - Add Sandbox availability in region
* 5.0.0 - Update SDK version | Add new action Get Audit Events | Add unit tests for all actions | Update error handling for all action | Create separate class for API communication | Add base URL of API for plugin
* 4.1.2 - Fix bug in connection test where it could succeed when an empty response was returned
* 4.1.1 - Fix bug where the connection test would sometimes pass even with invalid credentials
* 4.1.0 - Update Get TTP URL Logs action to use pagination
* 4.0.1 - Add example inputs
* 4.0.0 - Update Get TTP URL Logs to allow for better URL filtering
* 3.1.0 - New action Delete Managed URL and Delete Group Member
* 3.0.1 - New spec and help.md format for the Extension Library
* 3.0.0 - Add URL in Get TTP URL Logs action to filter output | Update connection settings to the proper authentication supported by the Mimecast API
* 2.5.0 - New action Decode URL
* 2.4.0 - New action Get TTP URL Logs
* 2.3.0 - New actions Add Group Member and Find Group
* 2.2.0 - New action Create Blocked Sender Policy
* 2.1.0 - New action Permit or Block Sender
* 2.0.0 - Add Get Managed URL Action | Update descriptions and output titles
* 1.0.0 - Initial plugin

# Links

* [Mimecast](http://mimecast.com)

## References

* [Mimecast API](https://www.mimecast.com/developer/documentation)

gha_language: Python


text:
bower-rails
===========

rake tasks for bower on rails. Dependency file is bower.json in Rails root dir.

**Requirements**

* [node](http://nodejs.org) ([on github](https://github.com/joyent/node))
* [bower](https://github.com/twitter/bow) installed with npm

**Install**

in Gemfile

``` Ruby
	gem "bower-rails", "~> 0.2.1"
```

**Initialize**

To add an empty bower.json file to the project root.

``` Bash
	rails g bower_rails:initialize
```

**Configuration**

The bower.json file is two seperate bower [component.js](https://github.com/twitter/bower#defining-a-package) files. Defining a package in lib and vendor will install those packages to the corresponding directories.

**example bower.json file**

``` javascript
{
   "lib": {
    "dependencies": {
      "threex"      : "git@github.com:rharriso/threex.git",
      "gsvpano.js"  : "https://github.com/rharriso/GSVPano.js/blob/master/src/GSVPano.js"
    }
  },
  "vendor": {
    "dependencies": {
      "three.js"  : "https://raw.github.com/mrdoob/three.js/master/build/three.js"
    }
  }
}
```

**Available commands**

``` bash
  rake bower:install #install js components
  rake bower:update  #update js components
```

license: MIT

repository: tylerflint/bower-rails

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: tylerflint/bower-rails


text:
## Release your app to the App Store

*If you want to confirm that `fastlane` is installed before proceeding, open the Terminal and run `fastlane -v`. You should see the current version of `fastlane` displayed.*

Navigate to your iOS project directory, run `fastlane init`, and follow the prompts. The command will create the following:

- A fastlane directory within your project directory
  - fastlane/Fastfile, which stores your deployment pipelines (lanes)
  - fastelane/Appfile, which stores your Apple ID and Bundle ID

This lane uses two fastlane [actions](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md): `gym` and `deliver`. `gym` builds and packages iOS apps for you; it takes care of all the heavy lifting and makes it easy to generate a signed ipa file. `deliver` uploads screenshots, metadata, and your app to the App Store. Both actions use the corresponding tools behind the scenes: [`gym`](https://github.com/fastlane/fastlane/tree/master/gym) and [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver).

Open the fastlane/Fastfile in your preferred text editor, change the syntax highlighting to Ruby, and overwrite the contents with the following.

```ruby
default_platform :ios

platform :ios do
  lane :deploy do
    gym
    deliver
  end
end
```

Run `fastlane ios deploy` to execute the lane.

To get the full list of options for each action, run `fastlane action action_name`, eg. `fastlane action gym` or `fastlane action deliver`.

repository: atljeremy/setups

repo_name: atljeremy/setups


text:
# Solid Interoperability Panel
March 2nd, 2021

## Meeting
 * Call: https://meet.jit.si/solid-data-interoperability

## Present

- Justin B
- Josh C
- Benoit A
- Matthieu F
- Matthieu B
- Henry S
- Eric P
- Max L
- Ángel A
- Ruben D
- Hannes
- e Pavlik

## Agenda

- Announcements
    - Review prior minutes - See [prior minutes](https://github.com/solid/data-interoperability-panel/pull/85)
- Issues
    - [Community Server - Shape Tree Support](https://github.com/solid/community-server/issues/639)
- Pull requests
- Topic Items
    - BBC Use Case
    - Startin'Blox use case (cont'd)
    - Mellon use case
    - Pavlik may receive small grant to work on primer and some TypeScript modules (what to prioritize?)

## Minutes

### BBC Use Case

Hannes: Really big question in the public broadcast space about what does public service mean in the 21st century? Have been having interesting conversations with NY Public Library who is asking the same kind of questions.

- What is the BBC in a world within this new emerging data economy?
- What is the BBC's role within this ?
- Should the BBC be hosting a pod for its members, or purely be part of an application services ecosystem?
- Working with a research agency to talk to the underserved audience asking questions about personal data - what it means to them, etc. What does the audience think about this, and what should the BBC be doing based on that?
- What are the technical implications?
- Looked at different areas like mental health / well-being, finance and money, etc - provide a public service based on data to help with your daily life
- Tried to create user facing services before but they're hard to make
- Start simple / tell the story in a well that people understand
- Do a media recommender
    - Take in media activity
    - Recommend things you might like based on that
    - Connect your spotify account
    - Connect to your BBC account
    - Connect your prime video
    - Connect your netflix
    - Pull listing data down to the pod
    - Give people a chance to manipulate some of the raw data (e.g., top artists, top tv shows)
    - Present recommendation options (artists, podcasts, archives)
    - Can start to bring in data from third party service providers
        - Band that you liked / listened to is doing a comeback tour
    - Made a cornmarket data exchange - lets apps and services making use of personal data read and write the data effectively.
- Consent
    - Broken down into three broad areas:
      - Is this long-term access?
      - Scope of access?
      - What time window of access?

JB: Is the consent currently hard-coded?
ML: Yes, at the moment

JB: Would it be worth collaborating on the next phase of dynamic authz/consent to apply interoperability spec patterns?
ML: Yes

BA: What kind of performance issues?
ML: Ran into some issues with (`rdf.js`?) with slow performance over collections of resources. Should be an improvement coming in an inrupt client side library.

BA: Is this code currently open-source?
ML: Not at the moment, possibly in the future

Henry: speaking of efficiency, I have been looking at HTTP/3 (Quic) [I did some research notes on this](https://github.com/akka/akka-http/issues/3692) (not related to Solid yet, but just to work out what libs are available, what the advantages are, the extent of deployment, etc.)

repository: solid/data-interoperability-panel

branch_name: refs/heads/main

gha_language: Bikeshed

gha_license_id: MIT

repo_name: solid/data-interoperability-panel


text:
dejavu
==========

Audio fingerprinting and recognition algorithm implemented in Python, see the explanation here:
[How it works](http://willdrevo.com/fingerprinting-and-audio-recognition-with-python.html)

Dejavu can memorize audio by listening to it once and fingerprinting it. Then by playing a song and recording microphone input, Dejavu attempts to match the audio against the fingerprints held in the database, returning the song being played.

Note that for voice recognition, Dejavu is not the right tool! Dejavu excels at recognition of exact signals with reasonable amounts of noise.

## Installation and Dependencies:

# Installation of Dejavu

So far Dejavu has only been tested on Unix systems.

* [`pyaudio`](http://people.csail.mit.edu/hubert/pyaudio/) for grabbing audio from microphone
* [`ffmpeg`](https://github.com/FFmpeg/FFmpeg) for converting audio files to .wav format
* [`pydub`](http://pydub.com/), a Python `ffmpeg` wrapper
* [`numpy`](http://www.numpy.org/) for taking the FFT of audio signals
* [`scipy`](http://www.scipy.org/), used in peak finding algorithms
* [`matplotlib`](http://matplotlib.org/), used for spectrograms and plotting
* [`MySQLdb`](http://mysql-python.sourceforge.net/MySQLdb.html) for interfacing with MySQL databases

For installing `ffmpeg` on Mac OS X, I highly recommend [this post](http://jungels.net/articles/ffmpeg-howto.html).

## Fedora 20+

### Dependency installation on Fedora 20+

Install the dependencies:

    sudo yum install numpy scipy python-matplotlib ffmpeg portaudio-devel MySQL-python
    pip install PyAudio
    pip install pydub

Now setup virtualenv ([howto?](http://www.pythoncentral.io/how-to-install-virtualenv-python/)):

    pip install virtualenv
    virtualenv --system-site-packages env_with_system

Install from PyPI:

    source env_with_system/bin/activate
    pip install PyDejavu

You can also install the latest code from GitHub:

    source env_with_system/bin/activate
    pip install https://github.com/worldveil/dejavu/zipball/master

## Max OS X

### Dependency installation for Mac OS X

Tested on OS X Mavericks. An option is to install [Homebrew](http://brew.sh) and do the following:

```
brew install portaudio
brew install ffmpeg

sudo easy_install pyaudio
sudo easy_install pydub
sudo easy_install numpy
sudo easy_install scipy
sudo easy_install matplotlib
sudo easy_install pip

sudo pip install MySQL-python

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
```

However installing `portaudio` and/or `ffmpeg` from source is also doable.

## Setup

First, install the above dependencies.

Second, you'll need to create a MySQL database where Dejavu can store fingerprints. For example, on your local setup:

	$ mysql -u root -p
	Enter password: **********
	mysql> CREATE DATABASE dejavu DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;

Now you're ready to start fingerprinting your audio collection!

## Quickstart

```bash
$ git clone https://github.com/worldveil/dejavu.git ./dejavu
$ cd dejavu
$ python example.py
```

## Fingerprinting

Let's say we want to fingerprint all of July 2013's VA US Top 40 hits.

Start by creating a Dejavu object with your configurations settings (Dejavu takes an ordinary Python dictionary for the settings).

```python
>>> from dejavu import Dejavu
>>> config = {
...     "database": {
...         "host": "<IP_ADDRESS>",
...         "user": "root",
...         "passwd": <password above>,
...         "db": <name of the database you created above>,
...     }
... }
>>> djv = Dejavu(config)
```

Next, give the `fingerprint_directory` method three arguments:
* input directory to look for audio files
* audio extensions to look for in the input directory
* number of processes (optional)

```python
>>> djv.fingerprint_directory("va_us_top_40/mp3", [".mp3"], 3)
```

For a large amount of files, this will take a while. However, Dejavu is robust enough you can kill and restart without affecting progress: Dejavu remembers which songs it fingerprinted and converted and which it didn't, and so won't repeat itself.

You'll have a lot of fingerprints once it completes a large folder of mp3s:
```python
>>> print djv.db.get_num_fingerprints()
5442376
```

Also, any subsequent calls to `fingerprint_file` or `fingerprint_directory` will fingerprint and add those songs to the database as well. It's meant to simulate a system where as new songs are released, they are fingerprinted and added to the database seemlessly without stopping the system.

## Configuration options

The configuration object to the Dejavu constructor must be a dictionary.

The following keys are mandatory:

* `database`, with a value as a dictionary with keys that the database you are using will accept. For example with MySQL, the keys must can be anything that the [`MySQLdb.connect()`](http://mysql-python.sourceforge.net/MySQLdb.html) function will accept.

The following keys are optional:

* `fingerprint_limit`: allows you to control how many seconds of each audio file to fingerprint. Leaving out this key, or alternatively using `-1` and `None` will cause Dejavu to fingerprint the entire audio file. Default value is `None`.
* `database_type`: as of now, only `mysql` (the default value) is supported. If you'd like to subclass `Database` and add another, please fork and send a pull request!

An example configuration is as follows:

```python
>>> from dejavu import Dejavu
>>> config = {
...     "database": {
...         "host": "<IP_ADDRESS>",
...         "user": "root",
...         "passwd": "Password123",
...         "db": "dejavu_db",
...     },
...     "database_type" : "mysql",
...     "fingerprint_limit" : 10
... }
>>> djv = Dejavu(config)
```

## Tuning

Inside `fingerprint.py`, you may want to adjust following parameters (some values are given below).

    FINGERPRINT_REDUCTION = 30
    PEAK_SORT = False
    DEFAULT_OVERLAP_RATIO = 0.4
    DEFAULT_FAN_VALUE = 10
    DEFAULT_AMP_MIN = 15
    PEAK_NEIGHBORHOOD_SIZE = 30

These parameters are described in the `fingerprint.py` in detail. Read that in-order to understand the impact of changing these values.

## Recognizing

There are two ways to recognize audio using Dejavu. You can recognize by reading and processing files on disk, or through your computer's microphone.

### Recognizing: On Disk

Through the terminal:

```bash
$ python dejavu.py --recognize file sometrack.wav
{'song_id': 1, 'song_name': 'Taylor Swift - Shake It Off', 'confidence': 3948, 'offset_seconds': 30.00018, 'match_time': 0.7159781455993652, 'offset': 646L}
```

or in scripting, assuming you've already instantiated a Dejavu object:

```python
>>> from dejavu.recognize import FileRecognizer
>>> song = djv.recognize(FileRecognizer, "va_us_top_40/wav/Mirrors - Justin Timberlake.wav")
```

### Recognizing: Through a Microphone

With scripting:

```python
>>> from dejavu.recognize import MicrophoneRecognizer
>>> song = djv.recognize(MicrophoneRecognizer, seconds=10) # Defaults to 10 seconds.
```

and with the command line script, you specify the number of seconds to listen:

```bash
$ python dejavu.py --recognize mic 10
```

## Testing

Testing out different parameterizations of the fingerprinting algorithm is often useful as the corpus becomes larger and larger, and inevitable tradeoffs between speed and accuracy come into play.

Test your Dejavu settings on a corpus of audio files on a number of different metrics:

* Confidence of match (number fingerprints aligned)
* Offset matching accuracy
* Song matching accuracy
* Time to match

An example script is given in `test_dejavu.sh`, shown below:

```bash
#####################################
### Dejavu example testing script ###
#####################################

###########
# Clear out previous results
rm -rf ./results ./temp_audio

###########
# Fingerprint files of extension mp3 in the ./mp3 folder
python dejavu.py --fingerprint ./mp3/ mp3

##########
# Run a test suite on the ./mp3 folder by extracting 1, 2, 3, 4, and 5
# second clips sampled randomly from within each song 8 seconds
# away from start or end, sampling offset with random seed = 42, and finally,
# store results in ./results and log to ./results/dejavu-test.log
python run_tests.py \
    --secs 5 \
    --temp ./temp_audio \
    --log-file ./results/dejavu-test.log \
    --padding 8 \
    --seed 42 \
    --results ./results \
    ./mp3
```

repository: soruly/dejavu

repo_name: soruly/dejavu


text:
![logo](./logo.jpg)

[![Build Status](https://dev.azure.com/amilajack/amilajack/_apis/build/status/amilajack.joker?branchName=master)](https://dev.azure.com/amilajack/amilajack/_build/latest?definitionId=1&branchName=master)
[![NPM version](https://img.shields.io/npm/v/@amilajack/joker.svg)](https://www.npmjs.com/package/@amilajack/joker)
[![npm](https://img.shields.io/npm/dm/@amilajack/joker.svg)](https://npm-stat.com/charts.html?package=@amilajack/joker)
[![codecov](https://codecov.io/gh/amilajack/joker/branch/master/graph/badge.svg)](https://codecov.io/gh/amilajack/joker)

A modern and intuitive testing library for command-line apps

## Installation

```bash
npm install --save-dev @amilajack/joker
```

## How it looks

```js
const path = require('path');
const assert = require('assert');
const { default: Joker } = require('@amilajack/joker');

(async () => {
  await new Joker()
    .run('echo hello')
    .expect((result) => {
      assert(result.stdout === 'hello');
    })
    .code(0)
    .end();
})();
```

## API

See [full API docs](https://amilajack.github.io/joker/classes/runner)

## Features

### Formatting options

Joker can strip new line characters and colors. You can tell it to do so by passing an
object that looks like this:

```js
const options = {
  colors: false,
  newLines: false
};

new Joker(options);
```

### Custom expectations

While Joker comes with built-in expectations, you can use your own too.

```js
await new Joker()
  .run('unicorns')
  .expect(result => {
    if (result.stdout !== 'unicorns') {
      return new Error('NO!');
    }
  })
  .end();
```

### Custom middlewares

You can register as many before and after middlewares as you wish.

```js
await new Joker()
  .before(setupDatabase)
  .before(runMigrations)
  .run(cmd)
  .after(downgradeCron)
  .after(deleteDatabase)
  .end();
```

### Middleware order

The Middleware execution order is very simple - "before" middlewares always run
before everything else, "after" middlewares always run after everything else.
The other middlewares will match the order that you have specified.

```js
await new Joker()
  .before(before1)
  .before(before2)
  .after(after1)
  .after(after2)
  .writeFile(file, '')
  .run(cmd)
  .unlink(file)
  .end();

// Execution order:
// before1, before2, writeFile, cmd, unlink, after1, after2
```

### Plugins

Joker has primitive support for plugins. You can register any expectation or/and
any middleware by calling `joker.register`.

```js
const fn = () => {};
new Joker().register('foo', fn);
```

Or you may want to register many functions at once.

```js
const fn = () => {};
const fn1 = () => {};
joker.register({ baz: fn, bar: fn1 });
```

### Usage with a test runner

Joker plays nice with any test runner out there.

#### Jest

Here is a minimal example how you could use it with [Jest](http://jestjs.io) using async/await:

```js
describe('todo add', () => {
  it('adds a new todo item', async () => {
    const result = await new Joker()
      .run('todo add')
      .stdout('A new todo has been added')
      .end();
    expect(result.stdout).toMatchSnapshot();
  });
});
```

#### Mocha

Here is a minimal example how you could use it with [Mocha](http://mochajs.org) using callbacks:

```js
describe('todo add', () => {
  it('adds a new todo item', done => {
    new Joker()
      .run('todo add')
      .stdout('A new todo has been added')
      .end(done);
  });
});
```

### Usage without a test runner

While using a test runner is recommended Joker is completely 'nodeable'. Here is
a simple example how you could accomplish that:

```js
const assert = require('assert');

function refute(err) {
  assert(!err);
}

new Joker()
  .run(cmd)
  .end(refute);

new Joker()
  .run(anotherCmd)
  .end(refute);
```

### Responding to interactive prompts

Joker can respond to apps that run interactively using the `on()` and
`respond()` functions.

```js
await new Joker()
  .run(cmd)
  .on('Your name: ')
  .respond('Joe User\n')
  .end();
```

See [`test/prompt.test.ts`](https://github.com/amilajack/joker/blob/master/tests/prompt.test.ts) for more examples.

### Templates

Every `Joker` instance can be cloned, which allows you to build "templates" for tests. Here's some examples:

```js
const template = new Joker()
  .cwd(path.join(__dirname, 'fixtures'))
  .run('echo test');

const test1 = await template
  .clone()
  .stdout(/test/)
  .end();

const test2 = await template
  .clone()
  .stdout('test')
  .end();
```

## Credits

Special thanks to:

- [Martin Lazarov](https://github.com/mlazarov)
- [Radoslav Stankov](https://github.com/rstankov)

## Support

Do you like this project? Star the repository, spread the word - it really helps. You may want to follow
me on [Twitter](https://twitter.com/amilajack) and
[GitHub](https://github.com/amilajack). Thanks!

If this project is saving you (or your team) time, please consider supporting it on Patreon 👍 thank you!

    <img<EMAIL_ADDRESS>width="160">

repository: amilajack/joker

gha_language: TypeScript

repo_name: amilajack/joker


text:
# Mtaani
Author: Vivvianne Kimani

Date: 9th Aug 2019

## Description
This application allows one to be in the loop about everything happening in one's neighborhood. From contact information of different handyman to meeting announcements or even alerts.

## User Requirements

* Sign in with the application to start using.
* Set up a profile about me and a general location and my neighborhood name.
* Find a list of different businesses in my neighborhood.
* Find Contact Information for the health department and Police authorities near my neighborhood.
* Create Posts that will be visible to everyone in my neighborhood.
* Change My neighborhood when I decide to move out.
* Only view details of a single neighborhood.

## BDD

| Behaviour | Input | Output |
|:----------|-------|--------|
| Arrive on the landing page | Click register | Fill in the form | Alogin in form will appear |
| Click on login | Fill in the form | See posts in your neighbourhood |
| Click on New post | Create a new post | See your post on the home page |
| Click on post title | Either click on update or delete post | Your post will be either updated or deleted |
| Click on search | Search for your prefered business | See the business |
| Click on create business | fill in the form | Your business will be created |
| Click on see business | NA | See the businesses in the neighbourhood |
| Click on Profile | Click on update profile and update it and chhose neighbourhood| Profile will be updated |

## Live Link

One can view the live site here https://mtaanikwetu.herokuapp.com/

## Requirements

* Python3.6

#### Cloning the repository
git clone https://github.com/Vivvianne/Mtaani.git

#### Creating a virtual environment
python3 -m virtualenv virtual
source virtual/bin/activate

#### Installing dependencies
pip3 install -r requirements

## Technology used

* Python3.6
* Django 2.2.3
* Heroku

## Known Bugs

## Licence

[MIT](https://github.com/Vivvianne/Mtaani/blob/master/LICENSE)

repository: Vivvianne/Mtaani

repo_name: Vivvianne/Mtaani


text:
# _Leap year_

#### _Program that lets a user enter a year and returns weather it is a leap-year or not, {01/17/2017}_

#### By _**Sarah Leahy    **_

## Description

_This program will take input from a user and return weather it is a leap year or not. It is a demonstration of behavior driven development and the separation of back end and front end logic._

## Specifications
_If the year entered is divisible by four or by 400 it is a leap year. If the year is divisible by 100 it is not a leap year._

## Setup/Installation Requirements

* _clone the leap-year repository from git hub _
* _Open index.html in browser _
* _Access through gh-pages at sleahy115.github.io/leap-year _

## Known Bugs

_{Are there issues that have not yet been resolved that you want to let users know you know?  Outline any issues that would impact use of your application.  Share any workarounds that are in place. }_

## Support and contact details

_Please contact<EMAIL_ADDRESS>with any comments or questions_

## Technologies Used

_JavaScripts, jQuery, Bootstrap_

### License

*Licensed under MIT license *

Copyright (c) 2017 **_Sarah Leahy_**


text:
aiyprojects is an easy-to-use API for the AIY Vision Kit and
AIY Voice Kit.
You can use it for face detection and object recognition, or use it to create
voice commands with simple while loops - have a look at the
[demos](https://github.com/google/aiyprojects-raspbian/tree/aiyprojects/src/examples).

Documentation is at the [AIY Projects site](https://aiyprojects.withgoogle.com).

If you have a problem or are looking for developer docs, look at the
GitHub repository's
[README.md](https://github.com/google/aiyprojects-raspbian#support).

repository: sonjaq/aiyprojects-raspbian

branch_name: refs/heads/develop

repo_name: sonjaq/aiyprojects-raspbian


text:
---
title: "[Algorithm] Find the missing number in the array"
categories: [알고리즘]
tags: [algorithm, array]
mermaid: true
math: true
comments: true
pin: false
image:
  path:
  width:
  height:
  alt:
---

<https://www.educative.io/blog/crack-amazon-coding-interview-questions>

### 문제

You are given an array of positive numbers from 1 to n, such that all numbers from 1 to n are present except one number ‘x’. You have to find ‘x’. The input array is not sorted.

### 풀이

* `1 to n`, `one number`가 문제의 핵심
* `sum(1 to n)`: (n * (n + 1)) / 2
* `one number`: `1 to n` - sum(array)

### 코드

```python
def find_missing(input):
  # calculate sum of all elements
  # in input list
  sum_of_elements = sum(input)

  # There is exactly 1 number missing
  n = len(input) + 1
  actual_sum = (n * ( n + 1 ) ) / 2 # 🔑
  return actual_sum - sum_of_elements

def test(n):
  missing_element = random.randint(1, n)
  v = []
  for i in range(1, n):
    if i != missing_element:
      v.append(i)
```

<https://github.com/restato/Algorithms/blob/master/Array/find_the_missing_number_in_the_array.py>

### 정리

* Runtime Complexity: Linear, O(n)
* Memory Complexity: Constant, O(1)


text:
## Simple Browser with Electron + TypeScript + React
Simple Browser with minimal needed to developers

## Installation

Use a package manager of your choice (npm, yarn, etc.) in order to install all dependencies

```bash
npm install
```

```bash
yarn install
```

## Usage
In order to run this project 2 scripts will need to be executed `dev:react` and `dev:electron`, run each one in a different terminal and always run `dev:react` before `dev:electron`, or `dev` to run them in order automatically

```bash
npm run dev:react
```
```bash
npm run dev:electron
```

or

```bash
npm run dev
```

## Shortcuts

```
Cmd Or Ctrl + I -> open devtools
Cmd or Ctrl + W -> close browser
F5 -> refrsh page
```

## Packaging
To generate a project package run `package`

```bash
npm run package
```

## Contributing

Pull requests are always welcome 😃.

## License

[MIT](https://choosealicense.com/licenses/mit/)

repository: xbral/SimpleBrowser

repo_name: xbral/SimpleBrowser


text:
## gifs\_go

Go package for interacting with the gifs.com API for transcoding and importing
media to make at least .MP4, .JPG, .GIF outputs.

Import all your videos by uploading and by passing in any source.

It is super easy to import media and integrate in your code.
Please see the examples below on how to import a single source, then in bulk
each in one call. You can also see more usage and convenience methods in files:
- `examples_test.go`
- `gifs_test.go`
- `gifs.go`

### Examples

For the examples below, include these imports as the predicates to have runnable examples:
```go

package main

import (
	"fmt"

	gifs "github.com/gifs/gifs_go"
)
```

##### Show me the code:

##### Import example

[embedmd]:# (example_test.go go /func ExampleImport.*/ /\n}/)
```go
func ExampleImport() {
	g, err := gifs.New()
	if err != nil {
		fmt.Printf("failed to initialize a new GIFS client, err=%v\n", err)
		return
	}
	param := &gifs.Request{
		URL: "https://www.youtube.com/watch?v=D2EfpQiOQrY",
		Trim: &gifs.Trim{
			Start: 4.5,
			End:   20.5,
		},
		Title: "Migos Dab",
		Tags:  []string{"migos", "dab", "example test"},
	}

	res, err := g.Import(param)
	if err != nil {
		fmt.Printf("failed to import your media, err=%v\n", err)
		return
	}

	if res.Page != "" {
		fmt.Printf("We've got a page alright\n")
	}
	if res.Embed != "" {
		fmt.Printf("We've got an embed page alright\n")
	}
	if res.HasFiles() {
		fmt.Printf("We've got files\n")
	}
	if res.File(gifs.MP4) != "" {
		fmt.Printf("We've got an MP4 file at the bare minimum\n")
	}

	// We've got a page alright
	// We've got an embed page alright
	// We've got files
	// We've got an MP4 file at the bare minimum
}
```

##### ImportBulk example

[embedmd]:# (example_test.go go /func ExampleImportBulk.*/ /\n}/)
```go
func ExampleImportBulk() {
	g, err := gifs.New()
	if err != nil {
		fmt.Printf("failed to initialize a new GIFS client, err=%v\n", err)
		return
	}

	bulkRequest := &gifs.BulkImportRequest{
		ConcurrentImports: 3,
		Requests: []*gifs.Request{
			{
				Title: "Desiigner -- Panda",
				URL:   "https://www.youtube.com/watch?v=E5ONTXHS2mM",
				Tags:  []string{"panda", "broads in atlanta", "phantom", "desiigner"},
			},
			{
				Title: "She writes her own history.",
				URL:   "https://twitter.com/Nike/status/764611634711105537",
				Tags:  []string{"Nike", "She makes her own history", "Running"},
			},
		},
	}

	responses, err := g.ImportBulk(bulkRequest)
	if err != nil {
		fmt.Printf("Failed to bulk import; err=%v\n", err)
		return
	}

	resLen, bulksLen := len(responses), len(bulkRequest.Requests)
	if resLen != bulksLen {
		fmt.Printf("responsesLength(%d) does not match requestsLength (%d)\n", resLen, bulksLen)
		return
	}
}
```


text:
---
title:  "Entity Framework Performance Cheat Sheet"
date:   2012-08-01
excerpt: "Performance is important in our applications, this cheat sheet gives tips to improve the Big O performance of your Entity Framework applications and suggestions for when and what to optimise."
redirect_from:
  - 2012/8/1/entity_framework_performance_cheat_sheet
  - 2012/08/entity-framework-performance-cheat-sheet.html
---
I recently gave a presentation on Entity Framework performance for the guys at work and one of my colleagues suggested I turned it a cheat sheet, so here goes:

![Before starting a project]({{site.baseurl}}/images/posts/{{page.date | date: '%Y' }}/ef-cheat-sheet-before-starting.png)

![During your everyday coding]({{site.baseurl}}/images/posts/{{page.date | date: '%Y' }}/ef-cheat-sheet-everyday.png)

![When you are not meeting performance goals]({{site.baseurl}}/images/posts/{{page.date | date: '%Y' }}/ef-cheat-sheet-performance-options.png)

![If you need to squeeze every last drop of performance]({{site.baseurl}}/images/posts/{{page.date | date: '%Y' }}/ef-cheat-sheet-max-performance.png)

A PDF version of this can be found [**here**]({{site.baseurl}}/files/posts/{{page.date | date: '%Y' }}/EF%20Performance%20Cheat%20Sheet.pdf).

A big thanks to [Thomas Coats](http://thomascoats.com/) for his help with this.

repository: lukemcgregor/test-pages

repo_name: lukemcgregor/test-pages


text:
ts-mongo-orm
============

`ts-mongo-orm` is a MongoDB ORM inspired by ActiveRecord.

It's still under active development as I use it to build some apps, so until you see the `1.0.0` release, expect things
to change or be missing.

In its current state, it has a fairly complete type-safe wrapper around MongoDB, and I'm already using it productively
in deployed apps. See the "Future Work" section below for what's on the roadmap.

Installation
------------

```
npm install --save ts-mongo-orm
```

Note that the following peer dependencies are required:

- `@hapi/joi` and `@types/hapi__joi` for validation types.
- `mongodb` and `@types/mongodb` for connecting to and using MongoDB.

Example Usage
-------------

See [the ts-mongo-orm-example repo](https://github.com/tylerc/ts-mongo-orm-example) for an example program you can clone
and run.

Below are some selected examples.

Connect to the database:

```ts
import {DatabaseConnectDefault} from "ts-mongo-orm";

(async () => {
    await DatabaseConnectDefault("mongodb://localhost:27017/test");
})();
```

Create define a `User` `ActiveRecord`:

```ts
import {ActiveRecord, Document, Field, ObjectIdField} from "ts-mongo-orm";
import {ObjectId} from "mongodb";
import * as Joi from "@hapi/joi";

@Document
class User {
  static databaseName = "test";
  static collectionName = "users";

  @ObjectIdField()
  _id: ObjectId;

  @Field(Joi.string())
  email: string;

  @Field(Joi.string())
  name: string;

  @Field(Joi.string())
  passwordHash: string;

  @Field(Joi.string())
  passwordSalt: string;

  @Field(Joi.date())
  createdAt: Date;

  constructor() {
    this._id = new ObjectId("000000000000000000000000");
    this.email = "";
    this.name = "";
    this.passwordHash = "";
    this.passwordSalt = "";
    this.createdAt = new Date();
  }
}

export const UserActiveRecord = ActiveRecord.for(User, User);
```

Note that the `ActiveRecord` class has a separation between the _document_ class (which describes purely the data
that will be stored in the database the and validations for that data), and the _model_ class (which could define
additional logic, helpers, computed fields, etc.)

In the above example, there is no additional model logic, so the `User` class is passed for both arguments to
`ActiveRecord.for`. Defining additional model logic would might look like this:

```ts
class UserModel extends User {
  // This will appear on the active record object but will not get saved to the database:
  get nameAndEmail() {
    return this.name + " " + this.email;
  }
}

export const UserActiveRecord = ActiveRecord.for(User, UserModel);
```

Using the `UserActiveRecord` might look like this:

```ts
import {UserActiveRecord} from "./user";

export async function userFindAndLog(email: string) {
    // This query is fully type-checked:
    let user = await UserActiveRecord.findOne({email: email});

    if (user) {
        console.log(user.nameAndEmail);
    }
}

export async function userDeleteIfFound(email: string) {
    // This query is fully type-checked:
    let user = await UserActiveRecord.findOne({email: email});

    if (user) {
        console.log("Deleting " + user._id + "...");
        // Since user is an ActiveRecord instance, we can simply call delete()
        // on it to remove it from the DB:
        await user.delete();
    }
}
```

Goals
-----

- Be able to use the `ActiveRecord` pattern to find and update documents, similar to Ruby on Rails.
- Make it easy to validate objects going into and coming out of the database.
- Make it easy to define those validations by using decorators to annotate the necessary validations alongside the type
  definitions.
- Provide a typed version of most (or all if possible) MongoDB APIs, specific to each type of document. For example,
  `collection.update({}, {$set: {a: 1}})` should fail to typecheck if `a` is not a `number` or does not exist on the
  document type.
- Minimal overhead. Getting the type-safety guarantees and validation should not come at a huge cost of speed, but a
  small cost is expected.
- Optional:
  - If you need to bail out of the typings for whatever reason, that should be easy.
  - If you need to not use the `ActiveRecord` pattern, but instead update or query the database directly, that should be
    easy.

Non-Goals
---------

This package will not do these things:

- Have zero-overhead abstractions. Validation and the ActiveRecord pattern incur some cost by their very nature.
- Provide a type-safe way of dealing with aggregations.
- Have exhaustive support for various versions of the `mongodb` library. Pull requests that add support for older
  versions are welcome, but I will focus only on the `4.x` branch of the `mongodb` library.
- Support for validation libraries other than `joi`. Pull requests making this optional are welcome.
- Create typings for an existing DB automatically.

It's not that any of these things are bad, just that they are either outside the scope of this package, or require more
time than I have.

Issues and Pull Requests
------------------------

If you see an issue or a way to improve `ts-mongo-orm` feel free to open an issue or a pull request!

Please include as much as possible, and keep in mind that issues with associated pull requests are much more likely to
get merged, as my time to manage issues on this project is limited.

Future Work
-----------

- [ ] Updating to the v4.x driver broke some things. Might be worth rethinking how the superstructure of this module
      works so it's not as fragile to the whims of MongoDB. I'd rather expose the MongoDB API directly somehow, and
      just transparently provide my niceties on top.
- [ ] A mechanism for doing type-safe updates and queries on nested fields (e.g. a type safe `{$set: {"a.b.c": 123}}`)
- [ ] Lifecycle hooks (e.g. OnLoad, AfterInit, BeforeUpdate, BeforeInsert, etc.)
- [ ] Easy optional mechanism for running validations when _reading_ from the database.

License
-------

The license is MIT, see the `LICENSE` file for more details.

repository: tylerc/ts-mongo-orm

repo_name: tylerc/ts-mongo-orm


text:
# spharionthegame

This is the project of a simple point-and-clickgame made from a Brazillian Book called "Spharion"
Click below to play the game in Github Pages

https://atempel.github.io/spharionthegame/

repository: atempel/spharionthegame

gha_language: HTML

repo_name: atempel/spharionthegame


text:
---
title: "Controllable Single-Molecule Light Emission by Selective Charge Injection in Scanning Tunneling Microscopy"
authors:
- xiaoyanwu
- Rulin Wang
- Yu Zhang
- Bowen Song
- admin
date: "2019-06-03T00:00:00Z"
doi: ""

# Schedule page publish date (NOT publication's date).
publishDate: "2019-06-03T00:00:00Z"

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["2"]

# Publication name and optional abbreviated publication name.
publication: "*The Journal of Physical Chemistry C*"
publication_short: "J. Phys. Chem. C 2019, 123, 15761-15768"

abstract: Tunneling electron-induced light emission in scanning tunneling microscopy (STM) has recently been explored as a novel light source with tunable properties. Here, using first-principles-based atomistic simulations, we study the STM-induced luminescence of a single free-base phthalocyanine (H2Pc) molecule and propose a way to control the emission frequency of the STM molecular junction by precisely controlling the charge injection at different molecular positions. The luminescence is found to be directly related to the spatial distribution of the molecular states and thus depends sensitively on the tip position. Via careful refinement of the chemical structures, devices with desirable frequencies at different parts of the emitting unit can be designed. Our proposal has profound implications for applications in nanoscale optoelectronics and future hybrid electronic-photonic circuits.
# Summary. An optional shortened abstract.
summary: Tunneling electron-induced light emission in scanning tunneling microscopy (STM) has recently been explored as a novel light source with tunable properties. Here, using first-principles-based atomistic simulations, we study the STM-induced luminescence of a single free-base phthalocyanine (H2Pc) molecule and propose a way to control the emission frequency of the STM molecular junction by precisely controlling the charge injection at different molecular positions. The luminescence is found to be directly related to the spatial distribution of the molecular states and thus depends sensitively on the tip position. Via careful refinement of the chemical structures, devices with desirable frequencies at different parts of the emitting unit can be designed. Our proposal has profound implications for applications in nanoscale optoelectronics and future hybrid electronic-photonic circuits.
tags:
-
featured: false

# links:
# - name: ""
#   url: ""
url_pdf: https://pubs.acs.org/doi/abs/10.1021/acs.jpcc.9b02198
url_code: ''
url_dataset: ''
url_poster: ''
url_project: ''
url_slides: ''
url_source: ''
url_video: ''

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
projects: []

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
slides: example
---


text:
# juliex - a minimal futures executor

juliex is a concurrent executor for Rust futures. It is implemented as a
threadpool executor using a single, shared queue. Algorithmically, it is very
similar to the Threadpool executor provided by the futures crate. The main
difference is that juliex uses a crossbeam channel and performs a single
allocation per spawned future, whereas the futures Threadpool uses std
concurrency primitives and multiple allocations.

Similar to [romio][romio] - an IO reactor - juliex currently provides no user
configuration. It exposes the most minimal API possible.

## Example
```rust
#![feature(async_await, await_macro, futures_api)]

use std::io;

use futures::StreamExt;
use futures::executor;
use futures::io::AsyncReadExt;

use romio::{TcpListener, TcpStream};

fn main() -> io::Result<()> {
    executor::block_on(async {
        let mut listener = TcpListener::bind(&"<IP_ADDRESS>:7878".parse().unwrap())?;
        let mut incoming = listener.incoming();

        println!("Listening on <IP_ADDRESS>:7878");

        while let Some(stream) = await!(incoming.next()) {
            let stream = stream?;
            let addr = stream.peer_addr()?;

            juliex::spawn(async move {
                println!("Accepting stream from: {}", addr);

                await!(echo_on(stream)).unwrap();

                println!("Closing stream from: {}", addr);
            });
        }

        Ok(())
    })
}

async fn echo_on(stream: TcpStream) -> io::Result<()> {
    let (mut reader, mut writer) = stream.split();
    await!(reader.copy_into(&mut writer))?;
    Ok(())
}
```

## Safety
This crate uses `unsafe` internally around atomic access. Invariants around this
are manually checked.

## License
MIT OR Apache-2.0

[romio]: https://github.com/withoutboats/romio

repository: mehcode/juliex

gha_license_id: NOASSERTION

repo_name: mehcode/juliex


text:
---
title: Key Telegraf concepts
description: Includes information on supported input data formats, output data formats, aggregator and processor plugins, and includes a glossary of important terms.
menu:
  telegraf_1_17:
     name: Concepts
     weight: 30
---
This section discusses key concepts about Telegraf, the plug-in driven server agent component of the InfluxData time series platform. Topics covered include metrics, aggregator and processor plugins, and a glossary of important terms.

{{< children >}}


text:
# TensorflowJS Tutorials
![](https://js.tensorflow.org/images/TF_JS_lockup.png)
Learn how to use TensorflowJS to create and use Machine Learning algorithms in the browser.

## Getting Started

To get started clone the repository and run a script using `python <scriptname>` in the console.

### Prerequisites

For running the repository you need [Python3](https://www.python.org/) installed

## Authors

 **Gilbert Tanner**

repository: Badranh/Tutorials

repo_name: Badranh/Tutorials


text:
---
layout: post
title: "Toward a Standard Interface for User-Defined Scheduling in OpenMP"
date: 2019-06-21 01:47:32
categories: arXiv_CL
tags: arXiv_CL Face
author: Vivek Kale, Christian Iwainsky, Michael Klemm, Jonas Kondorfer, Florina Ciorba
mathjax: true
---

* content
{:toc}

##### Abstract
Parallel loops are an important part of OpenMP programs. Efficient scheduling of parallel loops can improve performance of the programs. The current OpenMP specification only offers three options for loop scheduling, which are insufficient in certain instances. Given the large number of other possible scheduling strategies, it is infeasible to standardize each one. A more viable approach is to extend the OpenMP standard to allow for users to define loop scheduling strategies. The approach will enable standard-compliant application-specific scheduling. This work analyzes the principal components required by user-defined scheduling and proposes two competing interfaces as candidates for the OpenMP standard. We conceptually compare the two proposed interfaces with respect to the three host languages of OpenMP, i.e., C, C++, and Fortran. These interfaces serve the OpenMP community as a basis for discussion and prototype implementation for user-defined scheduling.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1906.08911](http://arxiv.org/abs/1906.08911)

##### PDF
[http://arxiv.org/pdf/1906.08911](http://arxiv.org/pdf/1906.08911)


text:
## display

### Summary

The `display` CSS property specifies the type of rendering box used for an element. In HTML, default `display` property values are taken from behaviors described in the HTML specifications or from the browser/user default stylesheet. The default value in XML is `inline`.

In addition to the many different display box types, the value `none` lets you turn off the display of an element; when you use `none`, all descendant elements also have their display turned off. The document is rendered as though the element doesn't exist in the document tree.

* _[Initial value][0]_ `inline`
* _Applies to_ all elements
* _[Inherited][1]_ no
* _Media_ [`all`][2]
* _[Computed value][3]_ as the specified value, except for positioned and floating elements and the root element. In both cases the computed value may be a keyword other than the one specified.
* _Animatable_ no
* _Canonical order_ the unique non-ambiguous order defined by the formal grammar

### Syntax

    [Formal syntax][4]: none [|][5] inline [|][5] block [|][5] list-item [|][5] inline-block [|][5] inline-table [|][5] table [|][5] table-cell [|][5] table-column [|][5] table-column-group [|][5] table-footer-group [|][5] table-header-group [|][5] table-row [|][5] table-row-group [|][5] flex [|][5] inline-flex [|][5] grid [|][5] inline-grid [|][5] run-in [|][5] ruby [|][5] ruby-base [|][5] ruby-text [|][5] ruby-base-container [|][5] ruby-text-container [|][5] contents

    display: none

    display: inline
    display: block
    display: contents
    display: list-item
    display: inline-block
    display: inline-table
    display: table
    display: table-cell
    display: table-column
    display: table-column-group
    display: table-footer-group
    display: table-header-group
    display: table-row
    display: table-row-group
    display: flex
    display: inline-flex
    display: grid
    display: inline-grid
    display: ruby
    display: ruby-base
    display: ruby-text
    display: ruby-base-container
    display: ruby-text-container
    display: run-in

    display: inherit
    display: initial
    display: unset

### Values

_**display-value**_

> Is a keyword defining the rendering type to apply to the element. Its possible values and their meanings are:
> Value set
> Value
> Description
>
> Basic values (CSS 1)
> `none`
>
> Turns off the display of an element (it has no effect on layout); all descendant elements also have their display turned off. The document is rendered as though the element did not exist.
>
> To render an element box's dimensions, yet have its contents be invisible, see the [`visibility`][6] property.
>
> `inline`
> The element generates one or more inline element boxes.
>
> `block`
> The element generates a block element box.
>
> `list-item`
> The element generates a block box for the content and a separate list-item inline box.
>
> Extended values (CSS 2.1)
> `inline-block`
> The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would)
>
> Table model values (CSS 2.1)
> `inline-table`
> The` inline-table `value does not have a direct mapping in HTML. It behaves like a [`<table>`][7] HTML element, but as an inline box, rather than a block-level box. Inside the table box is a block-level context.
>
> `table`
> These elements behaves like  [`<table>`][7] HTML elements. It defines a block-level box.
>
> `table-caption`
> These elements behave like [`<caption>`][8] HTML elements.
>
> `table-cell`
> These elements behave like [`<td>`][9] HTML elements.
>
> `table-column`
> These elements behave like  [`<col>`][10] HTML elements.
>
> `table-column-group`
> These elements behave like  [`<colgroup>`][11] HTML elements.
>
> `table-footer-group`
> These elements behave like [`<tfoot>`][12] HTML elements.
>
> `table-header-group`
> These elements behave like [`<thead>`][13] HTML elements.
>
> `table-row`
> These elements behave like [`<tr>`][14] HTML elements.
>
> `table-row-group`
> These elements behave like [`<tbody>`][15] HTML elements
>
> Flexbox model values ([CSS3][16])
> `flex`
> The element behaves like a block element and lays out its content according to the flexbox model.
>
> `inline-flex`
> The element behaves like an inline element and lays out its content according to the flexbox model.
>
> Grid box model values ([CSS3][16]) __
> `grid`
>
> The element behaves like a block element and lays out its content according to the grid model.
>
> As this is experimental, [most browsers don't support it][17]. Especially pay attention that `-moz-grid` is not the prefixed version of this, but a [XUL layout model][18] that must not be used on a Web site.
>
> `inline-grid`
> The element behaves like an inline element and lays out its content according to the grid model.
>
> Ruby formatting model values ([CSS3][16])__
> `ruby`
> The element behaves like an inline element and lays out its content according to the ruby formatting model. It behaves like the corresponding [`<ruby>`][19] HTML elements.
>
> `ruby-base`
> These elements behave like [`<rb>`][20] elements.
>
> `ruby-text`
> These elements behave like [`<rt>`][21] elements.
>
> `ruby-base-container`
> These elements behave like [`<rbc>`][22] elements generated as anonymous boxes.
>
> `ruby-text-container`
> These elements behave like [`<rbc>`][22] elements.
>
> Experimental values __
> `run-in`
>
> * If the run-in box contains a block box, same as block.
> * If a block box follows the run-in box, the run-in box becomes the first inline box of the block box.
> * If an inline box follows, the run-in box becomes a block box.
>
> `contents`
> These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child boxes.
>
>

### Examples

[View Live Examples][23]

    p.secret  { display: none }
    <p style="display:none"> invisible text </p>

[0]: https://developer.mozilla.org/en/docs/CSS/initial_value
[1]: https://developer.mozilla.org/en/docs/CSS/inheritance
[2]: https://developer.mozilla.org/en/docs/CSS/@media#Media_groups
[3]: https://developer.mozilla.org/en/docs/CSS/computed_value
[4]: https://developer.mozilla.org/en/docs/CSS/Value_definition_syntax "CSS/Value_definition_syntax"
[5]: https://developer.mozilla.org/en/docs/CSS/Value_definition_syntax#Single_bar "Single bar: The two entities are optional, but exactly one must be present."
[6]: https://developer.mozilla.org/en/docs/Web/CSS/visibility "The visibility CSS property has two purposes:"
[7]: https://developer.mozilla.org/en/docs/Web/HTML/Element/table "The HTML Table Element (<table>) represents data in two dimensions or more."
[8]: https://developer.mozilla.org/en/docs/Web/HTML/Element/caption "The HTML <caption> Element (or HTML Table Caption Element) represents the title of a table. Though it is always the first descendant of a <table>, its styling, using CSS, may place it elsewhere, relative to the table."
[9]: https://developer.mozilla.org/en/docs/Web/HTML/Element/td "The Table cell HTML element (<td>) defines a cell of a table that contains data. It participates in the table model."
[10]: https://developer.mozilla.org/en/docs/Web/HTML/Element/col "The HTML <col> Element (or HTML Table Column Element) defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element."
[11]: https://developer.mozilla.org/en/docs/Web/HTML/Element/colgroup "The HTML <colgroup> Element (or HTML Table Column Group Element) defines a group of columns within a table."
[12]: https://developer.mozilla.org/en/docs/Web/HTML/Element/tfoot "The HTML Table Foot Element (<tfoot>) defines a set of rows summarizing the columns of the table."
[13]: https://developer.mozilla.org/en/docs/Web/HTML/Element/thead "The HTML Table Head Element (<thead>) defines a set of rows defining the head of the columns of the table."
[14]: https://developer.mozilla.org/en/docs/Web/HTML/Element/tr "The HTML Table Row Element (<tr>) defines a row of cells in a table. Those can be a mix of <td> and <th> elements."
[15]: https://developer.mozilla.org/en/docs/Web/HTML/Element/tbody "The HTML Table Body Element (<tbody>) defines one or more rows as the body of its parent <table> element when no <tr> elements are children of the parent.  In conjunction with a preceding <tfoot> and <thead> element, (<tbody>) provides additional semantic information for devices such as printers and displays. Of the parent table's child elements, (<tbody>) will represent the content, if longer than a page, that will most likely differ for each page printed. The <tfoot> and <thead> elements' content will be consistent for each page printed. For displays, (<tbody>) will enable separate scrolling from the <tfoot>, <thead> and <caption> elements of the same parent <table> element."
[16]: https://developer.mozilla.org/en/docs/CSS/CSS3 "CSS3"
[17]: https://developer.mozilla.org/en/docs/CSS/display#Browser_Compatibility "https://developer.mozilla.orghttps://developer.mozilla.org/en/CSS/display#Browser_Compatibility"
[18]: https://bugzilla.mozilla.org/show_bug.cgi?id=616605#c10 "https://bugzilla.mozilla.org/show_bug.cgi?id=616605#c10"
[19]: https://developer.mozilla.org/en/docs/Web/HTML/Element/ruby "The HTML <ruby> Element represents a ruby annotation. Ruby annotations are for showing pronounciation of East Asian characters."
[20]: https://developer.mozilla.org/en/docs/Web/HTML/Element/rb "This article hasn't been written yet. Please consider contributing!"
[21]: https://developer.mozilla.org/en/docs/Web/HTML/Element/rt "The HTML <rt> Element embraces pronunciation of character presented in a ruby annotations, which are for showing pronunciation of East Asian characters and the <rt> element is used inside of <ruby> element."
[22]: https://developer.mozilla.org/en/docs/Web/HTML/Element/rbc "This article hasn't been written yet. Please consider contributing!"
[23]: /samples/cssref/display.html


text:
# Forum

This is the version v2 of my forum

## Instlation

### Step 1.

> To run this project you must have PHP 7 installed as a prerequisite.

> This project using ide helper package so 2 files will be added after install composer dependencies you are free to add them in `.gitignore` file.
> If you want use Redis as your cache driver you need to install the Redis Server. You can either use homebrew on a Mac or compile from source (https://redis.io/topics/quickstart).

Begin by cloning this repository to your machine, and  install all composer dependencies.

```bash
git clone https://github.com/alaaDragneel/forum-v2.git
cd "forum-v2" && composer install && npm install
php artisan forumV2:install
npm run dev
```

### Step 2

Next, start the server and visit your forum. If using a tool like Laravel Valet, of course the URL will default to `http://forum-v2.test`.

1. Visit: `http://forum-v2.test/register` to register a new forum account.
2. Edit: `config/forum-v2.php`, and add any email address that should be for an administrator.
3. Visit: `http://forum-v2.test/admin/channels` to create channels for your forum.