text:
# [SciMLProblems](@id scimlproblems)

The cornerstone of the SciML common interface is the problem type definition.
These definitions are the encoding of mathematical problems into a numerically
computable form.

### Note About Symbolics and ModelingToolkit

The symbolic analog to the problem interface is the ModelingToolkit `AbstractSystem`.
For example, `ODESystem` is the symbolic analog to `ODEProblem`. Each of these system
types have a method for constructing the associated problem and function types.

## Definition of the AbstractSciMLProblem Interface

The following standard principles should be adhered to across all
`AbstractSciMLProblem` instantiations.

### In-place Specification

Each `AbstractSciMLProblem` type can be called with an "is inplace" (iip) choice. For example:

```julia
ODEProblem(f,u0,tspan,p)
ODEProblem{iip}(f,u0,tspan,p)
```

which is a boolean for whether the function is in the inplace form (mutating to
change the first value). This is automatically determined using the methods table
but note that for full type-inferability of the `AbstractSciMLProblem` this iip-ness should
be specified.

Additionally, the functions are fully specialized to reduce the runtimes. If one
would instead like to not specialize on the functions to reduce compile time,
then one can set `recompile` to false.

### Specialization Levels

Specialization levels in problem definitions are used to control the amount of compilation
specialization is performed on the model functions in order to trade off between runtime
performance, simplicity, and compile-time performance. The default choice of specialization
is `AutoSpecialize`, which seeks to allow for using fully precompiled solvers in common
scenarios but falls back to a runtime-optimal approach when further customization is used.

Specialization levels are given as the second type parameter in `AbstractSciMLProblem`
constructors. For example, this is done via:

```julia
ODEProblem{iip,specialization}(f,u0,tspan,p)
```

Note that `iip` choice is required for specialization choices to be made.

#### Specialization Choices

```@docs
SciMLBase.AbstractSpecialization
SciMLBase.AutoSpecialize
SciMLBase.NoSpecialize
SciMLBase.FunctionWrapperSpecialize
SciMLBase.FullSpecialize
```

!!! note

    The specialization level must be precompile snooped in the appropriate solver
    package in order to enable the full precompilation and system image generation
    for zero-latency usage. By default, this is only done with AutoSpecialize and
    on types `u isa Vector{Float64}`, `eltype(tspan) isa Float64`, and
    `p isa Union{Vector{Float64}, SciMLBase.NullParameters}`. Precompilation snooping
    in the solvers can be done using the Preferences.jl setup on the appropriate
    solver. See the solver library's documentation for more details.

### Default Parameters

By default, `AbstractSciMLProblem` types use the `SciMLBase.NullParameters()` singleton to
define the absence of parameters by default. The reason is because this throws an
informative error if the parameter is used or accessed within the user's function,
for example, `p[1]` will throw an informative error about forgetting to pass
parameters.

### Keyword Argument Splatting

All `AbstractSciMLProblem` types allow for passing keyword arguments that would get forwarded
to the solver. The reason for this is that in many cases, like in `EnsembleProblem`
usage, a `AbstractSciMLProblem` might be associated with some solver configuration, such as a
callback or tolerance. Thus, for flexibility the extra keyword arguments to the
`AbstractSciMLProblem` are carried to the solver.

### problem_type

`AbstractSciMLProblem` types include a non-public API definition of `problem_type` which holds
a trait type corresponding to the way the `AbstractSciMLProblem` was constructed. For example,
if a `SecondOrderODEProblem` constructor is used, the returned problem is simply a
`ODEProblem` for interoperability with any `ODEProblem` algorithm. However, in this case
the `problem_type` will be populated with the `SecondOrderODEProblem` type, indicating
the original definition and extra structure.

### Remake

```@docs
remake
```

## Problem Traits

```@docs
SciMLBase.isinplace(prob::SciMLBase.AbstractDEProblem)
SciMLBase.is_diagonal_noise
```

## AbstractSciMLProblem API

### Defaults and Preferences

`SpecializationLevel` at `SciMLBase` can be used to set the default specialization level. The following
shows how to set the specialization default to `FullSpecialize`:

```julia
using Preferences, UUIDs
set_preferences!(UUID("0bca4576-84f4-4d90-8ffe-ffa030f20462"), "SpecializationLevel" => "FullSpecialize")
```

The default is `AutoSpecialize`.

### Abstract SciMLProblems

```@docs
SciMLBase.AbstractSciMLProblem
SciMLBase.AbstractDEProblem
SciMLBase.AbstractLinearProblem
SciMLBase.AbstractNonlinearProblem
SciMLBase.AbstractIntegralProblem
SciMLBase.AbstractOptimizationProblem
SciMLBase.AbstractNoiseProblem
SciMLBase.AbstractODEProblem
SciMLBase.AbstractDiscreteProblem
SciMLBase.AbstractAnalyticalProblem
SciMLBase.AbstractRODEProblem
SciMLBase.AbstractSDEProblem
SciMLBase.AbstractDAEProblem
SciMLBase.AbstractDDEProblem
SciMLBase.AbstractConstantLagDDEProblem
SciMLBase.AbstractSecondOrderODEProblem
SciMLBase.AbstractBVProblem
SciMLBase.AbstractJumpProblem
SciMLBase.AbstractSDDEProblem
SciMLBase.AbstractConstantLagSDDEProblem
SciMLBase.AbstractPDEProblem
```

gha_language: Julia


text:
## Subscribers

> _Note: this pattern has been developed before hooks were a thing. We still support it for compatibility reason, but we recommend you move to hooks, which offer more flexibility._

### Creating a Subscriber

A `<Subscriber />` allows you to access Store state and actions in your views, via the render props pattern.
After defining a Store, we can create `Subscriber` components for that Store with `createSubscriber`:

```js
// components/counter.js
import { createStore, createSubscriber } from 'react-sweet-state';

const Store = createStore({
  initialState: { count: 0 },
  actions: {
    increment:
      () =>
      ({ setState, getState }) => {
        const currentCount = getState().count;
        setState({ count: currentCount + 1 });
      },
  },
});

export const CounterSubscriber = createSubscriber(Store);
```

### Using a Subscriber

Now you can use `CounterSubscriber` in your views, and it will expose the Store instance `state` and `actions` as arguments of the render prop function:

```js
// app.js
import { CounterSubscriber } from './components/counter';

const App = () => (
  <CounterSubscriber>
    {/* Store state is the first argument and actions are the second one */}
    {({ count }, { increment }) => (
      <div>
        {count}
        <button onClick={increment}>Add one</button>
      </div>
    )}
  </CounterSubscriber>
);
```

--

For more details about Subscribers see the [Subscribers API](../api/subscriber.md) or how to create [selector subscribers](../advanced/selector.md).

license: MIT

repository: atlassian/react-sweet-state

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: atlassian/react-sweet-state


text:
> [Go to French version](/fr/Règlements/Décrets,%20ordonnances%20et%20règlements%20statutaires/94/628.md)

# Prince Edward Island Milk Order

**SOR/94-628**

Enabling authorities:
- [AGRICULTURAL PRODUCTS MARKETING ACT](/en/Acts/Revised%20Statutes%20of%20Canada/A/A-6.md)

Date registered: 6 October 1994

----------

His Excellency the Governor General in Council, on the recommendation of the Minister of Agriculture, pursuant to subsections 2(1) and (2) of the [Agricultural Products Marketing Act](/en/Acts/Revised%20Statutes%20of%20Canada/A/A-6.md), is pleased hereby to repeal the Prince Edward Island Milk Order, 1988, made by Order in Council P.C. 1988-1607 of August 11, 1988[*], and to make the annexed Order granting authority to the Prince Edward Island Milk Marketing Board to regulate the marketing in interprovincial and export trade of milk produced in Prince Edward Island, in substitution therefor.

*: SOR/88-422, 1988 Canada Gazette Part II, p. 3625

**1** [Repealed, SOR/2001-16, s. 29]

## Interpretation

**2** In this Order,

***Act*** means the Natural Products Marketing Act of Prince Edward Island; (*Loi*)

***Board*** means the Prince Edward Island Milk Marketing Board established pursuant to the Act; (*Office*)

***milk*** means milk or cream from cows, produced in the Province of Prince Edward Island for consumer use in liquid form in Canada; (*lait*)

***Plan*** means any plan for the marketing of milk, established and amended from time to time pursuant to the Act. (*plan*)
> SOR/2001-16, s. 30.

## Interprovincial Trade

**3**

- **(1)** Subject to subsection (2), the Board is authorized to regulate the marketing of milk in interprovincial trade and for that purpose may, with respect to persons and property situated within the Province of Prince Edward Island, exercise all or any powers like the powers exercisable by the Board in relation to the marketing of milk locally within the province under the Act and a Plan.

- **(2)** The authority to regulate the marketing of milk in interprovincial trade does not include any power that is exercised by the Canadian Dairy Commission under the [Canadian Dairy Commission Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-15.md) in relation to the marketing of milk in interprovincial trade.
> SOR/2001-16, s. 31.

## Levies or Charges

**4** The Board may, in relation to the powers granted to it under section 3,
- **(a)** fix and impose levies or charges on milk or any component of milk and collect those levies or charges from persons described in subsection 3(1) who are engaged in the production or marketing of milk and for that purpose may classify those persons into groups and fix the levies or charges payable by the members of the different groups in different amounts; and
- **(b)** use the levies or charges for the purposes of the Board, including the creation of reserves, the payment of expenses and losses resulting from the sale or disposal of milk and the equalization or adjustment among producers of milk of moneys realized from the sale thereof during such period or periods of time as the Board may determine.
> SOR/2001-16, s. 32.

repository: TravisMadill/CanadianLaws

path: /en/Regulations/Statutory Orders and Regulations/94/628.md

repo_name: TravisMadill/CanadianLaws


text:
---
title: Platform API Client SDK - Java
---

## Resources

[![platform-client-v2](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/platform-client-v2/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/platform-client-v2)
[![Release Notes Badge](https://developer-content.genesys.cloud/images/sdk-release-notes.png)](https://github.com/MyPureCloud/platform-client-sdk-java/blob/master/releaseNotes.md)

* **Documentation** https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudjava/
* **Source** https://github.com/MyPureCloud/platform-client-sdk-java

## Install Using maven

Install the library from maven via the package [com.mypurecloud:platform-client-v2](https://mvnrepository.com/artifact/com.mypurecloud/platform-client-v2)

## Android Support

The SDK may be used in Android as of SDK version 5.0.1. This requires Java 8 support in Android Studio (2.4 Preview 6 or later). For more information, see the Android Developers Blog: [Java 8 Language Features Support Update](https://android-developers.googleblog.com/2017/04/java-8-language-features-support-update.html)

## Preview API's

**Warning:** Preview API's are included in this SDK. These resources are subject to both breaking and non-breaking changes at any time without notice. This includes, but is not limited to, changing resource names, paths, contracts, documentation, and removing resources entirely. For a full list of the preview API's see [here](https://developer.genesys.cloud/platform/preview-apis)

## Using the SDK

### Referencing the Package

Import the necessary packages:

```java
import com.mypurecloud.sdk.v2.ApiException;
import com.mypurecloud.sdk.v2.Configuration;
import com.mypurecloud.sdk.v2.api.UsersApi;
import com.mypurecloud.sdk.v2.model.User;
import com.mypurecloud.sdk.v2.model.UserMe;
import com.mypurecloud.sdk.v2.model.UsersEntityListing;
import com.mypurecloud.sdk.v2.PureCloudRegionHosts;
```

### Authenticating

The Java SDK contains a helper method to execute a Client Credentials OAuth flow. This is appropriate for non-user Java applications, typically when there is no UI. Invoking `authorizeClientCredentials(String clientId, String clientSecret)` will execute the client credentials OAuth grant and store the access token within the ApiClient class.

```java
String clientId = "a0bda580-cb41-4ff6-8f06-28ffb4227594";
String clientSecret = "e4meQ53cXGq53j6uffdULVjRl8It8M3FVsupKei0nSg";

//Set Region
PureCloudRegionHosts region = PureCloudRegionHosts.us_east_1;

ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).build();
ApiResponse<AuthResponse> authResponse = apiClient.authorizeClientCredentials(clientId, clientSecret);

// Don't actually do this, this logs your auth token to the console!
System.out.println(authResponse.getBody().toString());

// Use the ApiClient instance
Configuration.setDefaultApiClient(apiClient);

// Create API instances and make authenticated API requests
UsersApi apiInstance = new UsersApi();
UserEntityListing response = apiInstance.getUsers(null, null, null, null, null, null, null);
```

For user applications, the consuming application must complete an implicit, auth token, or SAML2 Bearer OAuth flow to get an access token outside the scope of the SDK. Once an access token is obtained, it should be set on the SDK via constructing a new ApiClient instance (use `withAccessToken(String token)`). For more information about authenticating with OAuth, see the Developer Center article [Authorization](https://developer.genesys.cloud/authorization/platform-auth/). For more information about SAML2 Bearer Oauth flow view the example below

#### Authentication with SAML2Bearer token

```java
String clientId = "a0bda580-cb41-4ff6-8f06-28ffb4227594";
String clientSecret = "e4meQ53cXGq53j6uffdULVjRl8It8M3FVsupKei0nSg";
String orgName = "YourOrg"; // Your org name
String encodedSamlAssertion= ""; // Base64 encoded SAML assertion

//Set Region
PureCloudRegionHosts region = PureCloudRegionHosts.us_east_1;

ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).build();
ApiResponse<AuthResponse> authResponse = apiClient.authorizeSaml2Bearer(clientId,clientSecret,orgName,encodedSamlAssertion);
System.out.println("Authentication successful. Access token expires in " + authResponse.getBody().getExpires_in() + " seconds");

```

#### Authentication with Authorization Code

See example on how to authenticate with an authorization code below. For more information see the article on [Code Authorization](https://developer.genesys.cloud/authorization/platform-auth/use-authorization-code)

```java
String clientId = "a0bda580-cb41-4ff6-8f06-28ffb4227594";
String clientSecret = "e4meQ53cXGq53j6uffdULVjRl8It8M3FVsupKei0nSg";
String authorizationCode = "YourAuthorizationCode"; // Your authorization code
String redirectUri= ""; // Your redirect URI

//Set Region
PureCloudRegionHosts region = PureCloudRegionHosts.us_east_1;

ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).build();
ApiResponse<AuthResponse> authResponse = apiClient.authorizeCodeAuthorization(clientId,clientSecret,authorizationCode,redirectUri);
System.out.println("Authentication successful. Access token expires in " + authResponse.getBody().getExpires_in() + " seconds");
```

By default the SDK will transparently request a new access token when it expires. If you wish to apply the refresh logic yourself, build the ApiClient with `withShouldRefreshAccessToken(false)` and store the refresh token. The `getExpires_in()` value of the `authResponse` can be used to preemptively request a new token. Use `refreshCodeAuthorization` to request a new token when necessary

```java
ApiClient apiClient = ApiClient.Builder.standard()
                        .withBasePath(region)
                        .withShouldRefreshAccessToken(false)
                        .build();
ApiResponse<AuthResponse> authResponse = apiClient.authorizeCodeAuthorization(clientId,clientSecret,authorizationCode,redirectUri);
String refreshToken = authResponse.getBody().getRefresh_token();
int expiresIn = authResponse.getBody().getExpires_in();
System.out.println("Authentication successful. Access token expires in " + expiresIn + " seconds");

// When token expires
authResponse = apiClient.refreshCodeAuthorization(clientId,clientSecret,refreshToken);
refreshToken = authResponse.getBody().getRefresh_token();
expiresIn = authResponse.getBody().getExpires_in();
```

### Building an ApiClient Instance

`ApiClient` implements a builder pattern to construct new instances:

```java
// Create ApiClient instance
//Set Region
PureCloudRegionHosts region = PureCloudRegionHosts.us_east_1;
ApiClient apiClient = ApiClient.Builder.standard()
		.withAccessToken(accessToken)
		.withBasePath(region)
		.build();

// Use the ApiClient instance
Configuration.setDefaultApiClient(apiClient);

// Create API instances and make authenticated API requests
UsersApi apiInstance = new UsersApi();
UserEntityListing response = apiInstance.getUsers(null, null, null, null, null, null);
```

#### Setting the access token

If not authorizing using the authorization method helpers, provide the access token to use for API requests:

```java
.withAccessToken("aisuefh89734hfkhsaldkh348jf")
```

#### Setting the environment

Provide the full base url if not using `https://api.mypurecloud.com`:

```java
.withBasePath("https://api.mypurecloud.ie")
```

#### Setting the HTTP connector

The SDK supports the following HTTP connectors:

* Apache (_default_, synchronous), use `ApacheHttpClientConnectorProvider`
* Ning (async), use `AsyncHttpClientConnectorProvider`
* OkHTTP (synchronous, recommended for Android), use `OkHttpClientConnectorProvider`

Specify the connector in the builder:

```java
.withProperty(ApiClientConnectorProperty.CONNECTOR_PROVIDER, new OkHttpClientConnectorProvider())
```

#### Setting the max retry time

By default, the Java SDK does not automatically retry any failed requests.
To enable automatic retries, provide a RetryConfiguration object with the maximum number of seconds to retry requests and the max number of retries when building the ApiClient instance.

Building a `RetryConfiguration` instance:

```java
ApiClient.RetryConfiguration retryConfiguration = new ApiClient.RetryConfiguration();
retryConfiguration.setMaxRetryTimeSec(30);
retryConfiguration.setRetryMax(5);
```

Setting `RetryConfiguration` instance to `ApiClient`:

```java
        .withRetryConfiguration(retryConfiguration)
```
Set the `maxRetryTimeSec` to the number of seconds to process retries before returning an error.
Set the 'MaxRetryTimeSec' to the number of seconds to process retries before returning an error.
When the retry time is a positive integer, the SDK will follow the recommended backoff logic using the provided configuration.
The best practices are documented in the [Rate Limiting](https://developer.genesys.cloud/platform/api/rate-limits) Developer Center article.

### SDK Logging

SDK users can choose between SL4J or our logging implementation, which makes use of STDOUT and an optional log file.

#### SL4J

Logging can be provided through SL4J, which uses HTTP request and response interceptors for requests when using the Apache connector. SL4J also logs exceptions from the Apache connector and Notification handler.
To use SL4J, include a relevant SL4J library in the dependencies and SL4J configuration file.

To provide a custom request interceptor, provide an object implementing `org.apache.http.HttpRequestInterceptor` to the following APIClient builder method:

```java
        .withHttpRequestInterceptor(requestInterceptor)
```

Use the following method to provide a custom response interceptor implementing `org.apache.http.HttpResponseInterceptor`:

```java
        .withHttpResponseInterceptor(responseInterceptor)
```

#### Standard Logging Implementation

Logging of API requests and responses can be controlled programmatically by creating an instance of `ApiClient.LoggingConfiguration` and passing it to the `withLoggingConfiguration` builder method of the `APIClient`.

`LogLevel` values:

1. trace (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers, Response Headers)
2. debug (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers)
3. error (HTTP Method, URL, Request Body, Response Body, HTTP Status Code, Request Headers, Response Headers)
4. none - default

`LogFormat` values:

1. JSON
2. Text - default

By default, the request and response bodies are not logged because these can contain PII. Be mindful of this data if choosing to log it.
To log to a file, provide a value to `setLogFilePath`. SDK users are responsible for the rotation of the log file.

Example logging configuration:

```java
ApiClient.LoggingConfiguration loggingConfiguration = new ApiClient.LoggingConfiguration();
loggingConfiguration.setLogLevel("trace");
loggingConfiguration.setLogFormat("json");
loggingConfiguration.setLogRequestBody(true);
loggingConfiguration.setLogResponseBody(true);
loggingConfiguration.setLogToConsole(true);
loggingConfiguration.setLogFilePath("/var/log/javasdk.log");

ApiClient apiClient = ApiClient.Builder.standard()
                        .withLoggingConfiguration(loggingConfiguration)
                        .build();
```

#### Configuration file

A number of configuration parameters can be applied using a configuration file. There are two sources for this file:

1. The SDK will look for `%HOMEDRIVE%%HOMEPATH%\.genesyscloudjava\config` on Windows, or `$HOME/.genesyscloudjava/config` on Unix.
2. Provide a valid file path to the ApiClient

Example setting the configuration file:

```java
        .withConfigFilePath("/path/to/config")
```

The SDK will take an event-driven approach to monitor for config file changes and will apply changes in near real-time, regardless of whether a config file was present at start-up. To disable this behavior, set `autoReloadConfig` to false like so:

```java
        .withAutoReloadConfig(false)
```

INI and JSON formats are supported. See below for examples of configuration values in both formats:

INI:

```ini
[logging]
log_level = trace
log_format = text
log_to_console = false
log_file_path = /var/log/javasdk.log
log_response_body = false
log_request_body = false
[retry]
retry_wait_min = 3
retry_wait_max = 10
retry_max = 5
[reauthentication]
refresh_access_token = true
refresh_token_wait_max = 10
[general]
live_reload_config = true
host = https://api.mypurecloud.com
```

JSON:

```json
{
    "logging": {
        "log_level": "trace",
        "log_format": "text",
        "log_to_console": false,
        "log_file_path": "/var/log/javasdk.log",
        "log_response_body": false,
        "log_request_body": false
    },
    "retry": {
        "retry_wait_min": 3,
        "retry_wait_max": 10,
        "retry_max": 5
    },
    "reauthentication": {
        "refresh_access_token": true,
        "refresh_token_wait_max": 10
    },
    "general": {
        "live_reload_config": true,
        "host": "https://api.mypurecloud.com"
    }
}
```

#### Other ApiClient.Builder methods

* `withDefaultHeader(String header, String value)` Specifies additional headers to be sent with every request
* `withUserAgent(String userAgent)` Overrides the default user agent header
* `withObjectMapper(ObjectMapper objectMapper)` Overrides the default `ObjectMapper` used for deserialization
* `withDateFormat(DateFormat dateFormat)` Overrides the default `DateFormat`
* `withConnectionTimeout(int connectionTimeout)` Overrides the default connection timeout
* `withShouldThrowErrors(boolean shouldThrowErrors)` Set to `false` to suppress throwing of all errors
* `withProxy(Proxy proxy)` Sets a proxy to use for requests
* `withAuthenticatedProxy(Proxy proxy, String user, String pass)` Sets an authenticated proxy to use for requests
* `withRefreshTokenWaitTime(int refreshTokenWaitTime)` Overrides the default time a thread will wait for another thread to request a new access token. The default is 10 seconds

### Making Requests

There are two steps to making requests:

1. Instantiate one of the API classes in the com.mypurecloud.sdk.v2.api namespace
2. Invoke the methods on the API object

Example of getting the authenticated user's information:

#### Using a request builder

Request builders allow requests to be constructed by only providing values for the properties you want to set. This is useful for methods with long signatures when you only need to set some properties and will help future-proof your code if the method signature changes (i.e. new parameters added).

```java
UsersApi usersApi = new UsersApi();
GetUsersMeRequest request = GetUsersMeRequest.builder()
        .withExpand(Collections.singletonList("presence"))
        .build();
UserMe me = usersApi.getUsersMe(request);
System.out.println("Hello " + me.getName());
```

#### Using method parameters

This request is identical to the request above, but uses the method with explicit parameters instead of a builder. These methods construct the request builder behind the scenes.

```java
UsersApi usersApi = new UsersApi();
UserMe me = usersApi.getUsersMe(Collections.singletonList("presence"));
System.out.println("Hello " + me.getName());
```

#### Getting extended info

The Java SDK has the ability to return extended information about the response in addition to the response body. There are varieties of each API method call that are suffixed with _WithHttpInfo_. E.g. The `UsersApi` has a method `getUsersMe(...)` as well as `getUsersMeWithHttpInfo(...)`. Additionally, the request builder classes (e.g. `GetUsersMeRequest`) has a method `withHttpInfo()` that can be used to transform the request into an `ApiRequest` object that will return the extended information.

The extended responses will be of type [ApiResponse<T>](https://github.com/MyPureCloud/platform-client-sdk-java/blob/master/build/src/main/java/com/mypurecloud/sdk/v2/ApiResponse.java). This interface provides methods to get the exception (can be null), get the HTTP status code, get the reason phrase associated with the status code, get all headers, get a specific header, get the correlation ID header, and get the response body as a raw string or as a typed object.

Examples:

```java
// Using the WithHttpInfo method
ApiResponse<UserMe> meWithHttpInfo = usersApi.getUsersMeWithHttpInfo(new ArrayList<String>());
System.out.println(meWithHttpInfo.getHeaders());
System.out.println(meWithHttpInfo.getCorrelationId());
System.out.println(meWithHttpInfo.getBody().getName());
```

```java
// Using the request builder
ApiRequest<Void> getUsersMeRequestWithHttpInfo = GetUsersMeRequest.builder()
        .withExpand(new ArrayList<String>())
        .build()
        .withHttpInfo();

// Execute request
ApiResponse<UserMe> meWithHttpInfo = usersApi.getUsersMe(getUsersMeRequestWithHttpInfo);
System.out.println(meWithHttpInfo.getHeaders());
System.out.println(meWithHttpInfo.getCorrelationId());
System.out.println(meWithHttpInfo.getBody().getName());
```

## NotificationHandler Helper Class

The Java SDK includes a helper class, `NotificationHandler`, to assist in managing Genesys Cloud notifications. The class will create a single notification channel, or use an existing one, and provides methods to add and remove subscriptions and raises an event with a deserialized notification object whenever one is received.

### Using NotificationHandler

**Create a new instance**

The preferred way to create a `NotificationHandler` instance is to use its builder to construct a new instance. This comes with the advantage of being able to set listeners and add subscriptions before the websocket is opened.

```java
NotificationHandler notificationHandler = NotificationHandler.Builder.standard()
        .withWebSocketListener(new MyWebSocketListener())
        // Individually
        .withNotificationListener(new UserPresenceListener(me.getId()))
        .withNotificationListener(new ChannelMetadataListener())
        // As a list
        .withNotificationListeners(new ArrayList<NotificationListener<?>>() { {
            add(new UserPresenceListener(me.getId()));
            add(new ChannelMetadataListener());
        }})
        .withAutoConnect(false)
        .build();
```

Alternatively, the `NotificationHandler` instance can be constructed with the default constructor and will connect to the websocket automatically. Listeners and subscriptions can then be managed from the instance regardless of how it was constructed. The following example is equivalent to the builder except that the socket will be connected in the constructor and the listeners and subscriptions will be added after it is connected:

```java
NotificationHandler notificationHandler = new NotificationHandler();
notificationHandler.setWebSocketListener(new MyWebSocketListener());
// Individually
notificationHandler.addSubscription(new UserPresenceListener(me.getId()));
notificationHandler.addSubscription(new ChannelMetadataListener());
// As a list
notificationHandler.addSubscriptions(new ArrayList<NotificationListener<?>>() { {
            add(new UserPresenceListener(me.getId()));
            add(new ChannelMetadataListener());
        }});
```

**Send a ping**

To test the connection, you may send a ping. For more information about this ping, see [Use the notification service](https://developer.genesys.cloud/notificationsalerts/notifications/) under the _WebSocket Health Check_ heading.

```java
notificationHandler.sendPing();
```

**Handle incoming notification events**

To handle incoming events, implement the `NotificationListener<T>` interface to handle registered topics and the `WebSocketListener` interface for information about the websocket itself. This is a basic example of how to handle user presence events:

```java
public class UserPresenceListener implements NotificationListener<PresenceEventUserPresence> {
    private String topic;

    public String getTopic() {
        return topic;
    }

    public Class<PresenceEventUserPresence> getEventBodyClass() {
        return PresenceEventUserPresence.class;
    }

    @Override
    public void onEvent(NotificationEvent<?> event) {
        System.out.println("system presence -> " + ((PresenceEventUserPresence)event.getEventBody()).getPresenceDefinition().getSystemPresence());
    }

    public UserPresenceListener(String userId) {
        this.topic = "v2.users." + userId + ".presence";
    }
}
```

And an example of listening to the channel metadata events (periodic heartbeat and ping/pong message):

```java
public class ChannelMetadataListener implements NotificationListener<ChannelMetadataNotification> {
    public String getTopic() {
        return "channel.metadata";
    }

    public Class<?> getEventBodyClass() {
        return ChannelMetadataNotification.class;
    }

    public void onEvent(NotificationEvent<?> notificationEvent) {
        System.out.println("[channel.metadata] " + ((ChannelMetadataNotification)notificationEvent.getEventBody()).getMessage());
    }
}
```

## SDK Source Code Generation

The SDK is automatically regenerated and published from the API's definition after each API release. For more information on the build process, see the [platform-client-sdk-common](https://github.com/MyPureCloud/platform-client-sdk-common) project.

## Versioning

The SDK's version is incremented according to the [Semantic Versioning Specification](https://semver.org/). The decision to increment version numbers is determined by [diffing the Platform API's swagger](https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/modules/swaggerDiff.js) for automated builds, and optionally forcing a version bump when a build is triggered manually (e.g. releasing a bugfix).

## Support

This package is intended to be forwards compatible with v2 of Genesys Cloud's Platform API. While the general policy for the API is not to introduce breaking changes, there are certain additions and changes to the API that cause breaking changes for the SDK, often due to the way the API is expressed in its swagger definition. Because of this, the SDK can have a major version bump while the API remains at major version 2. While the SDK is intended to be forward compatible, patches will only be released to the latest version. For these reasons, it is strongly recommended that all applications using this SDK are kept up to date and use the latest version of the SDK.

For any issues, questions, or suggestions for the SDK, visit the [Genesys Cloud Developer Forum](https://developer.genesys.cloud/forum/).

repository: MyPureCloud/platform-client-sdk-java

gha_language: HTML

repo_name: MyPureCloud/platform-client-sdk-java


text:
---
title: >-
  Hockey: Whanganui girls win national title with Central, while boys finish
  runnersup
date: 2019-07-16T04:30:22.949Z
image: >-
  https://res.cloudinary.com/whanganuihigh/image/upload/v1562554948/News/U18_Central_tourn.Baker.Hoskin.Madder_Chron_6.7.19.jpg
image_title: >-
  It was another national title for Whanganui's Rebecca Baker and Sophie
  Redmayne, front, but Patrick Madder and Connor Hoskin had to settle for
  runnerup, after their tournament finals on Saturday.
description: >-
  It was another national title for Whanganui's Rebecca Baker and Sophie
  Redmayne, front, but Patrick Madder and Connor Hoskin had to settle for
  runnerup, after their tournament finals on Saturday.
short: >-
  It was another national title for Whanganui's Rebecca Baker and Sophie
  Redmayne, front, but Patrick Madder and Connor Hoskin had to settle for
  runnerup, after their tournament finals on Saturday.
---
Whanganui's Rebecca Baker and Sophie Redmayne are national champions again after their Central Under 18 team made it a title three-peat in Wellington on Saturday with a 3-0 shutout of Auckland in the final.

Unfortunately, Patrick Madder and Connor Hoskin could not make it a local double, as their relatively young Central U18 Boys team lost a nail-biting final 2-1 to Canterbury.

In both divisions, Central had topped their pools as they made it to the final four, which is played in another round-robin format where teams face the two sides from the opposite pool, while bringing the result from their previous game with their other pool qualifier through with them.

Therefore, both Central teams began with the four points from their previous win over their pool-mate, but had an awkward start to the playoffs with losses.

The Central girls lost 4-2 to Auckland, despite a 56th minute goal from Redmayne.

That put the team into a must-win scenario against leading title favourites Canterbury, and in a thriller, Central went up 2-0 after 20 minutes, only for Canterbury to pull it back to 2-2 at fulltime after goals in the 37th and 50th minutes.

Entering a penalty shootout, Central held their nerve as Hannah Cotter, captain Rileigh Knapp and Kaitlin Cotter all nailed their attempts consecutively, while Canterbury got their first goal but then missed three straight against goalie Natalia Roughton.

That result sent Central through to the final for a rematch with Auckland, and despite being underdogs after two tough matches, the defending champions turned it around through the Cotter girls.

Kaitlin Cotter nailed a penalty stroke and then a penalty corner in the 35th and 38th minutes, and then Hannah Cotter sealed the win with a field goal in the 56th minute.

Baker, a New Zealand U18 training camp attendee last year, had another strong tournament, getting two goals, although Kaitlin Cotter was unquestionably the standout by scoring 11 of the team's 20 goals in six matches.

There was a similar journey in the boys competition, as Central started the playoff round with a 4-1 loss to Canterbury, who got away to a rapid start with a field goal and penalty corner in the 2nd-3rd minutes.

They scored again in the third quarter, and despite a Central penalty corner closing the gap to 3-1, they had left their run too late and Canterbury scored again before fulltime.

That put Central into a must-win situation with Auckland.

"Auckland was like a semifinal, but a North Harbour win over Canterbury would have been same points, and that would have made it really complicated, but fortunately that didn't happen," said assistant coach Jan Dixon, of Hockey Wanganui.

After a scoreless first half, Central went down 1-0 in the third quarter, but in a clutch performance, they took advantage of a yellow card for Auckland to score three rapid-fire goals from the 54th to 58th minutes for a 3-1 win.

Hoskin scored the equalising goal in the 54th minute from a penalty corner, with captain Daniel Foss and Jonathan McDonald following up in quick succession with a penalty stroke and field goal respectively.

And so that put Central through to the final and a rematch with Canterbury, where the underdogs just could not quite peg them back despite a much-improved performance.

Again, Canterbury made a fast start with a field goal in the sixth minute, but this time Central put the brakes on, and Foss was able to equalise with a penalty stroke in the second quarter.

Canterbury converted a penalty corner not long after halftime to regain the lead, and from there, the teams were at a stalemate.

Central's Samuel Porter picked up a yellow card with three minutes left, as his team was desperate to force an equaliser and send the match to penalties.

"It was a really good game, could have gone either way," said Dixon.

"We had opportunities, but both teams had opportunities, it was a really fast game."

Overall, Dixon was happy with the adaptable performances of the two Whanganui boys, as 17-year-old Madder was at his third U18 national tournament, while Hoskin, 16, was on debut.

"They played really well. Patrick we put on defence for the last two games, he went really well back there.

"Connor, we put him up front, when he usually plays mid for school."

The team got 13 goals in the tournament, with Foss the top scorer with four.

![](https://res.cloudinary.com/whanganuihigh/image/upload/v1563418425/News/Connor_Patrick_Chron_10.7.19.jpg "Connor Hoskin gets the handshake from Central captain Daniel Foss, while fellow Whanganui player Patrick Madder looks on.")

Being held at the same time in Pukekohe was the National Under 18 Men's Association tournament, consisting of 16 provincial teams made up of the best players not selected for the Vantage nationals.

Coached by Robbie Matthews, the Wanganui U18 team had to settle for 13th overall.

A 2-1 loss to Manawatu in their last pool game on Wednesday put Whanganui through to the lower tier of playoffs, where they lost a penalty shootout 3-2 to Counties Manukau, after both teams were deadlocked 1-1 at fulltime.

Wanganui rebounded to smash Thames Valley 10-0, scoring half of their entire total of goals for the six-game tournament, which included James Craig getting a hat trick in the second quarter alone.

The team then finished their tournament with a 2-0 win over North Harbour Development in the playoff for 13th-14th on Saturday morning.

Craig was the top goal-scorer with seven, while their most experienced player in Travis Bayler got five.

Bayler and a number of his team mates will have a quick turnaround by returning to the Whanganui Men's club team for their game with Palmerston North Boys High School at McDonald's Stadium on early Thursday evening.

It is their second game of Hockey Manawatu's Premier Group B round, and Whanganui need a good result after losing their opening match to High School Hockey Club A, 5-3 on July 7.

_By Jared Smith_\
_Whanganui Chronicle 16/7/19_

gha_language: Blade


text:
**All Your Exes双手简谱** 和五线谱完全对应。

_All Your Exes_ 由美国歌手Julia Michaels演唱，收录在其首张录音室专辑Not in Chronological Order中。

Julia Michaels，原名Julia Cavazos，2013年，以黛米•洛瓦托歌曲《Fire
Starter》词曲作者的身份出道。2017年10月5日，2017MTV欧洲音乐奖EMA提名揭晓，提名为最突出艺人。

同时，网站还为大家提供了《[ **Issues**](Music-7766-Issues-Julia-Michaels.html
"Issues")》曲谱下载

歌词下方是 _All Your Exes钢琴谱_ ，大家可以免费下载学习。

path: /流行/All Your Exes-Julia Michaels/README.md

branch_name: refs/heads/main


text:
# Simple-firebase
Firebase made a little bit easier.
Most common tasks for any application is to process data, save data to a database, modifying data and retrieve it when needed.
I put together a simple utility library which helps with CRUD operations (files and data) + Authentication.

## Instalation:

- Download file [`simple-firebase.js`](https://raw.githubusercontent.com/ClimenteA/simple-firebase/main/public/simple-firebase.js) to your public folder (where files are compiled);
- Add `simple-firebase.js` after firebase inititialization (`firebase` object needs to be available globaly).

```html

<!-- update the version number as needed or add files from gstatic -->
<script defer src="/__/firebase/8.2.2/firebase-app.js"></script>
<!-- include only the Firebase features as you need -->
<script defer src="/__/firebase/8.2.2/firebase-auth.js"></script>
<script defer src="/__/firebase/8.2.2/firebase-firestore.js"></script>
<script defer src="/__/firebase/8.2.2/firebase-storage.js"></script>
<!-- make sure you use the emulator for debuging -->
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
<script defer src="path/to/simple-firebase.js"></script>

```

Under `f` you have the following:
- `firebase` by accessing `f.FBS`;
- `firebase.firestore()` by accessing `f.DB`;
- `firebase.auth()` by accessing `f.AUTH`;
- `firebase.storage()` by accessing `f.STORE`.

In firestore:
- A collection is similar to a table;
- A document is similar to a table row;
- A field is similar to a column;
- A collection can have multiple documents the same way a table can have multiple rows;
- Each document has an ID the same way each row in a table has one.

Collections can have endless sub-collections. Almost each function under `f` is a promise and you can use `await` or `then` syntax on them.

### Add document(s)

```js

let myDoc = {
    "_id": "my_unique_id",
    "field_1": "value_1",
    "field_2": "value_2"
}

let custom_id = await f.add("collectionName", myDoc)

```
This creates a new collection (if not present) and adds `myDoc` to it with a custom ID (`"_id"`). If ID is already present, this will replace the existing data with the new one.

```js

let myDoc1 = {
    "field_1": "value_1",
    "field_2": "value_2"
}

let generated_id = await f.add("collectionName", myDoc1)

```
The code from above creates a new collection (if not present already) and adds `myDoc1` to it with an auto-generated ID made by firebase.

The "_id" field is created for both cases in the document (similar to MongoDB Atlas).

The `add` method will return the ID of the generated document so you can do additional work with it.

### Update document(s)

```js

let myOldDoc = {
    "field_1": "value_1"
}
let myNewDoc = {
    "field_1": "value_1_updated"
}

let updated_ids = await f.update("collectionName", myOldDoc, myNewDoc)

```
This will update the document(s) in the collection where `field_1` has `value_1` with the new value for `field_1`. If `field_1` is not found, the update will be skipped and `updated_ids` will be an empty list.

```js

let myNewDoc1 = {
    "_id": custom_id,
    "field_2": "value_2_updated"
}

let updated_id = await f.update("collectionName", myNewDoc1)

```
This will update the document with the `"_id"` specified.

### Find document(s)

```js

let fDoc = {
    "field_2": "value_2_updated"
}

let docList = await f.find("collectionName", fDoc)

```
The `find` method will fetch all documents from `collectionName` where `field_2` has the value `value_2_updated`. The third parameter of `find` method is a query parameter, which by default is `==`.

```js

let doc = await f.find("collectionName", custom_id)

```
You can also fetch a document from a collection by its ID.

### Delete document(s)

```js

let dDoc = {
    "field_2": "value_2_updated"
}

let deleted_ids = await f.delete("collectionName", dDoc)

```
The `delete` method will delete all documents from `collectionName` where `field_2` has the value `value_2_updated`.

```js

let deleted_id = await f.delete("collectionName", IDToDelete)

```
This will delete only the document with the given ID.

### Upload file(s)

```js

let downloadData1 = await f.uploadFile(afile)

```
The result from the `uploadFile` method it's a json object like:
```js
{
    path: "/files/hkvyljlrzcf_Screenshot from 2020-12-23 13-04-57.png",
    downloadURL: "https://firebasestorage.googleapis.com/v0/b/other-data/token=etc"
}
```
You can later construct the downloadURL from `path` or use the given `downloadURL`.

Files will be uploaded automatically in a folder named `files` with a prefix id by default to avoid file overwrites. The auto generated ID can be disabled by setting the method paramteter `generateID` (the one from `uploadFile`) to `false`. You can also set a custom `folder` or `fileName` if needed.

```js

let downloadData = await f.uploadFile(
    fileObj,
    folder=undefined,
    fileName=undefined,
    generateID=true
)

```

### Delete file

```js

await f.deleteFile(downloadData1.path)

```

## Authentification

### Check user auth status

```js
let logged
f.AUTH.onAuthStateChanged(user => {
    if (user) logged = true
    else logged = false
})
```
Save `logged` variable to the store of your chosen front-end framework.
Later, you can check, based on `logged` variable, if the user is logged in or not.

### Login/Register user (with Facebook, Google)

```js

f.facebookLogin()
// OR
f.googleLogin()

```
This methods will automatically create (if not already present) a `users` collection and it'll save the email and the name in a document with the user's id (`uid`).

### Logout user
```js

f.logoutUser()

```

### Delete authenticated user
```js

f.deleteUser()

```

# TODO

- Make it posibile to add/update a list of documents (by using [batch](https://stackoverflow.com/questions/54322153/how-to-add-multiple-docs-to-a-collection-in-firebase))

```js

//ADD

let myListofDocs = [
    {"field_1": "value_1", "field_2": "value_2"},
    {"field_1": "value_1", "field_2": "value_2"},
    {"field_1": "value_1", "field_2": "value_2"},
]

let generated_ids = await f.add("collectionName", myListofDocs)

//UPDATE
let myListofOldDocs = [
    {"field_1": "value_1", "field_2": "value_2"},
    {"field_1": "value_1", "field_2": "value_2"},
    {"field_1": "value_1", "field_2": "value_2"},
]

let myListofNewDocs = [
    {"field_1": "value_1_updated", "field_2": "value_2_updated"},
    {"field_1": "value_1_updated", "field_2": "value_2_updated"},
    {"field_1": "value_1_updated", "field_2": "value_2_updated"},
]

let updated_ids = await f.update("collectionName", myListofOldDocs, myListofNewDocs)

```

- Make it posible to upload in batches also, move parameters in a object.
- Maybe return just the path? and construct downloadUrl when needed

```js

// list of file objects with folder, fileName or generateID specified

let filesToUpload = [
    {fileObj},
    {fileObj, folder:"profilePics"},
    {fileObj, folder:"productPics", fileName:"boneBreaker"},
    {fileObj, folder:"productVid", fileName:"how to use it.mp4", generateID:false}
]

let downloadData = await f.uploadFiles(filesToUpload)

// list of file objects

let downloadData = await f.uploadFiles([fileObj1, fileObj2 etc])

```

- Delete files in batch

```js

await f.deleteFiles([downloadData1.path, downloadData2.path])

```

- add pagination for `find` method (probably by using generators)
- list collections and files (probably just a simple `collectionList` and `fileList` collection in firestore)
- automatic generation of security rules (limit fields, prohibid writes if user was the one who added the document, limit generation of collections)

**Feel free to fork it and improve it!**

repository: ClimenteA/simple-firebase

repo_name: ClimenteA/simple-firebase


text:
This version adds support for sbt 0.13.

Important: Starting with this version you have to add `crossBuildingSettings`
to your configuration. This was changed to adhere to the best-practices which
helps in multi-module projects where you don't want to enable sbt-cross-building
for all subprojects.

All changes and fixes:

  * [#15][]: don't mess with public settings when project is no sbt plugin
  * [#22][]: don't deliver broken ivy.xml with `publish-local`
  * [#14][]: use the latest scripted-sbt runner (0.13.0-RC3 for now) for all sbt versions. This
    allows to use the latest features of the runner when building for older sbt versions (though, you
    now need to run sbt with the sbt 0.13.x launcher because of jline incompatibilities).
  * [#16][]: allow `scriptedLaunchOpts` for all sbt versions
  * [#21][]: allow targeting sbt 0.13 from previous versions

[#14]: https://github.com/jrudolph/sbt-cross-building/issues/14
[#15]: https://github.com/jrudolph/sbt-cross-building/issues/15
[#16]: https://github.com/jrudolph/sbt-cross-building/issues/16
[#21]: https://github.com/jrudolph/sbt-cross-building/issues/21
[#22]: https://github.com/jrudolph/sbt-cross-building/issues/22

repository: jrudolph/sbt-cross-building

extension: markdown

gha_language: Scala

repo_name: jrudolph/sbt-cross-building


text:
snippets
========

Useful snippets of code: Implementation of important algorithms, data structures and random experiments.

### List of implementations:

- Prime Generation (Sieves):
    + Atkin
    + Sundaram
    + Eratosthenes
    + Fast Eratosthenes (my tweaks for ~50% speed-up!)

- Numeric Algorithms
    + Modular Exponentiation

- Disjoint Sets (Union-Find Algorithm)

repository: SaswatPadhi/snippets

repo_name: SaswatPadhi/snippets


text:
A Kubernetes DaemonSet to run 1 container per node to periodically polls the [EC2 Spot Instance Termination Notices](https://aws.amazon.com/blogs/aws/new-ec2-spot-instance-termination-notices/) endpoint.
Once a termination notice is received, it will try to gracefully stop all the pods running on the Kubernetes node, up to 2 minutes before the EC2 Spot Instance backing the node is terminated.

## Installation

### Helm

A helm chart has been created for this tool, and at time of writing was in the `stable` repository.

    $ helm install stable/k8s-spot-termination-handler

## Available docker images/tags

Tags denotes Kubernetes/`kubectl` versions.
Using the same version for your Kubernetes cluster and spot-termination-notice-handler is recommended.
Note that the `-1` (or similar) is the revision of this tool, in case we need versioning.

* `kubeaws/kube-spot-termination-notice-handler:1.8.5-1`
* `kubeaws/kube-spot-termination-notice-handler:1.9.0-1`
* `kubeaws/kube-spot-termination-notice-handler:1.10.11-2`
* `kubeaws/kube-spot-termination-notice-handler:1.11.3-1`
* `kubeaws/kube-spot-termination-notice-handler:1.12.0-2`
* `kubeaws/kube-spot-termination-notice-handler:1.13.7-1`
* `kubeaws/kube-spot-termination-notice-handler:1.15.10-1`

## Why use it

  * So that your kubernetes jobs backed by spot instances can keep running on another instances (typically on-demand instances)

## How it works

Each `spot-termination-notice-handler` pod polls the notice endpoint until it returns a http status `200`.
That status means a termination is scheduled for the EC2 spot instance running the handler pod, according to [my study](https://gist.github.com/mumoshu/f7f55e6e74aaf54f63d263326ca58ba3)).

Run `kubectl logs` against the handler pod to watch how it works.

```
$ kubectl logs --namespace kube-system spot-termination-notice-handler-ibyo6
This script polls the "EC2 Spot Instance Termination Notices" endpoint to gracefully stop and then reschedule all the pods running on this Kubernetes node, up to 2 minutes before the EC2 Spot Instance backing the node is terminated.
See https://aws.amazon.com/jp/blogs/aws/new-ec2-spot-instance-termination-notices/ for more information.
`kubectl drain minikubevm` will be executed once a termination notice is made.
Polling http://<IP_ADDRESS>/latest/meta-data/spot/termination-time every 5 second(s)
Fri Jul 29 07:38:59 UTC 2016: 404
Fri Jul 29 07:39:04 UTC 2016: 404
Fri Jul 29 07:39:09 UTC 2016: 404
Fri Jul 29 07:39:14 UTC 2016: 404
...
Fri Jul 29 hh:mm:ss UTC 2016: 200
```

## Building against a specific version of Kubernetes

Run `KUBE_VERSION=<your desired k8s version> make build` to specify the version number of k8s/kubectl.

## Slack Notifications
Introduced in version 0.9.2 of this application (the @mumoshu version), you are able to setup a Slack incoming web hook in order to send slack notifications to a channel, notifying the users that an instance has been terminated.

Incoming WebHooks require that you set the SLACK_URL environmental variable as part of your PodSpec.

You can also set SLACK_CHANNEL to send message to different slack channel insisted of default slack webhook url's channel.

The URL should look something like: https://hooks.slack.com/services/T67UBFNHQ/B4Q7WQM52/1ctEoFjkjdjwsa22934

Slack Setup:
* Docs: https://api.slack.com/incoming-webhooks
* Setup: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks

Show where things are happening by setting the `CLUSTER` environment variable to whatever you call your cluster.
Very handy if you have several clusters that report to the same Slack channel.

Example Pod Spec:

```
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: SLACK_URL
            value: "https://hooks.slack.com/services/T67UBFNHQ/B4Q7WQM52/1ctEoFjkjdjwsa22934"
          - name: SLACK_CHANNEL
          - value: "#devops"
          - name: CLUSTER
            value: development
```

## Sematext Cloud Event Notifications

The [Sematext Cloud](https://sematext.com/cloud) event URL is different for Europe and USA and includes the application token for your monitored App.

* USA URL: https://event-receiver.sematext.com/APPLICATION_TOKEN/event
* Europe URL: https://event-receiver.eu.sematext.com/APPLICATION_TOKEN/event

Sematext Setup:
* You get the APPLICATION_TOKEN when you create a [Docker monitoring app](https://sematext.com/docker/) in Sematext Cloud.
* API Docs: https://sematext.com/docs/events/#adding-events

Show where things are happening by setting the `CLUSTER` environment variable to whatever you call your cluster.
Very handy if you have several clusters that report to the same Slack channel.

Example Pod Spec:

```
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: SEMATEXT_URL
            value: "https://event-receiver.sematext.com/APPLICATION_TOKEN/event"
          - name: CLUSTER
            value: development
          - name: DETACH_ASG
            value: "true"
```

## Wechat Notifications

Incoming WebHooks require that you set the WECHAT_URL and WECHAT_KEY environmental variables as part of your PodSpec.

The URL should look something like: https://pushbear.ftqq.com/sub?key=3488-876437815599e06514b2bbc3864bc96a&text=SpotTermination&desp=SpotInstanceDetainInfo

Wechat Setup:
* You get the WECHAT_KEY by [pushbear](http://pushbear.ftqq.com/admin/)
* You bind WECHAT_KEY to a QR code after you create a [Wechat Service account](https://mp.weixin.qq.com/?lang=en_US).
* API Docs: http://pushbear.ftqq.com/admin/ ; https://mp.weixin.qq.com/?lang=en_US

Example Pod Spec:

```
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: WECHAT_URL
            value: "https://pushbear.ftqq.com/sub"
          - name: WECHAT_KEY
            value: "3488-876437815599e06514b2bbc3864bc96a"
          - name: CLUSTER
            value: development
          - name: DETACH_ASG
            value: "true"
```

## AutoScaling Detachment

**This feature currently only supports simple autoscaling - no spot fleet or similar.**

If you set the environment variable `DETACH_ASG` to _any value other than_ `false`, the handler will detach the instance from the ASG, which may bring a replacement instance up sooner.

The autoscaling group name is automatically detected by the handler.

## Credits

kube-spot-termination-notice-handler is a collaborative project to unify [@mumoshu and @kylegato's initial work](https://github.com/mumoshu/kube-spot-termination-notice-handler) and [@egeland's fork with various enhancements and simplifications](https://github.com/egeland/kube-spot-termination-notice-handler).

The project is currently maintained by:

- @egeland
- @kylegato
- @mumoshu

gha_language: Shell


text:
---
ID: 3599
post_title: 'Deirdrê [Irish Mythology from the Ancient Ulster Cycle] Audiobook'
author: abbie04m553726
post_excerpt: ""
layout: post
permalink: >
  https://universalflowuniversity.com/uncategorized/deirdre-irish-mythology-from-the-ancient-ulster-cycle-audiobook/
published: true
post_date: 2017-08-15 11:34:35
---
[embed]https://www.youtube.com/watch?v=8aynkpmd5TQ[/embed]

The Ulster Cycle (Irish: an Rúraíocht), formerly known as the Red Branch Cycle, one of the four great cycles of Irish mythology, is a body of medieval Irish heroic legends and sagas of the traditional heroes of the Ulaid in what is now eastern Ulster and northern Leinster, particularly counties Armagh, Down and Louth, and taking place around or before the 1st century AD. (quoted from wikipedia.org)
Deirdrê [Irish Myth from the Ancient Ulster Cycle] Audiobook (by Jean Lang)

repository: UniversalAdministrator/ufu

repo_name: UniversalAdministrator/ufu


text:
#### Features:
* Easy to use.
* Quick Setup.
* Frontend Sortings with different parameters.
* Responsive design.
* Flexibility in Displaying.
* Full screen support
* Touch and support for mobile devices
* Zoom animation
* Social sharing
* Keyboard access

#### Usage:

In OctoberCMS, This plugin can be used to show PhotoSwipe Gallery on your web pages with custom display options and animations.

#### **How to install:**
To install this plugin you have to type **ChiragPatel.PhotoSwipe** in Backend System Settings > Updates & Plugins > Install plugins.

#### **How to use:**
In backend, Click on ‘Photo Swipe’ icon where you can manage your galleries.

Here three components are attached, you can use as per your requirement:

1.) **Album List**

2.) **Gallery**

3.) **Images of Gallery**

To include **Album** component on your page:
1.  Click on CMS in Backend.
2.  Select page you want to include this plugin.
3.  Click Components and select component from **Photo Swipe** plugin **Album** and drag it to the desired position or simple Click on **View Gallery** and write `{% component ‘albums’ %}`  where you want to place Albums.

> Same process for other components: **Gallery** ( `{% component ‘viewGallery’ %}` ) & **Images of Gallery** ( `{% component ‘directGallery’ %}` ).

#### **Configuration:**

In your layout file, you have to write `{% placeholder photoswipe %}` in the body section.
> **Important note**: This is very important to initialize the **PhotoSwipe Gallery**. If you forget to implement this, it will not work. And make sure you have added JQuery script in your layout or page.

Different components have different properties as per below:

1. **Album List** component

   * **Sort By**: You can sort your albums on frontend by **Title**, **Date modified** and **Published On** with desirable **Sort By** property.

   * **Gallery Page**: In **Links** tab of properties, you have to select gallery page from dropdown to give link to the albums.
   > **Important Note:** Your gallery page should have **`:slug`** in **URL**

   Here is example of **Album List** component implemented in the page

       title = "Album"
       url = "/album"
       layout = "default"
       is_hidden = 0

       [albums]
       sortBy = "updated_at-asc"
       galleryPage = "gallery"
       ==
       <div class="container">
       {% component 'albums' %}
       </div>

2.  **Gallery** component

    * **Slug**: To show specific gallery, Enter the **slug** of gallery.

    > Note: If you want to show gallery with album links, Please do not change it's default value(`:slug`).

    * **Display Properties:** Here you get flexible display properties.

        *   **Infinite Loop**: If set to true you'll be able to swipe from last image to first image. (default value: `true`)

        *   **Close On Scroll**: If set to true on mouse scroll, gallery will be closed. (default value: `false`)

        *   **Close on Vertical Drag**: If set to true, gallery will be closed on dragging vertically. (default value: `false`)

        *   **Close On Esc Key**: If set to true on Esc Key press, gallery will be closed. (default value: `false`)

        *   **Pinch To Close**: If set to true, the gallery’s background will gradually fade out as the gesture is complete, the gallery will close. (default value: `false`)

        *   **Caption**: If set to true, Caption will be displayed  below image. (default value: `true`)

    * **Zoom Properties:**

        *   **Swipe while Zoomed In**: If set to true, It allows swipe navigation to **next/prev** item when current item is zoomed. (default value: `true`)

        > Note: Option is always false on devices that don't have hardware touch support.

        *   **Max Spread Zoom**: It is integer value that will define maximum **zoom level** when performing spread(zoom) gesture. (default value: `2`)

        *   **Double Tap Zoom Level**: It is integer value that will define **zoom level** to which image will be zoomed after **double-tap** gesture, or when user clicks on **zoom icon**, or **mouse-click** on image itself. (default value: `1`)

    * **Buttons:** You can change **availability** of different buttons.

        |Button|**If set to true**|Default value|
        |----------------|-------------------------------|-----------------------------|
        |**Share Button**|It will display share button.            |false|
        |**Zoom Button**|It will show zoom button.            |true|
        |**Fullscreen Button** |It will display fullscreen button.|true|
        |**Arrows Button**|It will show next/prev arrows.|true|
        |**Counter on Screen Button**|It will display counter(e.g. 1/5 ) on gallery.|true|

     >  Important Note: Your gallery page **URL** should contain **`:slug`** like Example's URL **`url = "/gallery/:slug"`**.

    Here is example of **Gallery** component implemented page:

        title = "Gallery"
        url = "/gallery/:slug"
        layout = "default"
        is_hidden = 0

        [viewGallery]
        slug = "{{ :slug }}"
        loop = 1
        closeOnScroll = 0
        closeOnVerticalDrag = 0
        escKey = 0
        pinchToClose = 0
        captionEl = 1
        swipeWhileZoom = 0
        maxSpreadZoom = 2
        getDoubleTapZoom = 1
        shareEl = 0
        zoomEl = 1
        fullscreenEl = 1
        arrowEl = 1
        counterEl = 1
        ==
        {% component 'viewGallery' %}

3.  **Images of Gallery** component

    * **Gallery**: It is dropdown of **published galleries**. Select the gallery you want to display images of it on the page.

    >   Other Properties are same as **Gallery Component**.

* **CSS Support**:

    *  If you want to change the size of the thumbnails of images, you can do by placing this class in your css

             .photo-swipe-gallery figure {
                //particularlly you should adjust only width e.g. width: 269px;
             }

    *   If you want to change the area of the albums, you can do by inserting this class in your css

            .responsive {
                //define only width e.g. width: 18%;
            }

    > Note: If you have good skill on CSS then you can customize **custom.css** file (path: plugins/chiragpatel/photoswipe/assets/resources/custom.css).

*   **Credit:** [PhotoSwipe](http://photoswipe.com/)


text:
# Torch Fire

A simple torch application for android

## Developer

- [@dwijottam-dutta](https://github.com/Dwijottam-Dutta)

## License

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

repository: Dwijottam-Dutta/Torch-Fire

repo_name: Dwijottam-Dutta/Torch-Fire


text:
# Open current url in any browser
Open the current webpage in another browser. Works with Chrome, Firefox, Safari and Opera.

**How to use**: First define a shortcut (e.g. double tap on the `ctrl` key). Then activate the workflow and choose the destination browser.

repository: andreaswilli/alfred-workflows

repo_name: andreaswilli/alfred-workflows


text:
# social-sim
A socially interaction simulation for studying infection

# Existing Models
The Institute for Disease Modeling has a really [interesting COVID model written in python. ](https://github.com/InstituteforDiseaseModeling) as well as a tool for [generating synthetic populations. ](https://institutefordiseasemodeling.github.io/synthpops/installation.html)

* http://covidagentmodel.com/
* http://covidsim.eu/

## Research

* [Your Model is Wrong](https://medium.com/@jamesjansson/covid-19-modelling-is-wrong-f7246e3dc396)
* [Network Modelling for Epidemics](http://statnet.org/nme/)
* https://scholarblogs.emory.edu/epi/2020/04/05/modeling-covid-19/

# Overview

Input to the simulator consists of:

* A list of people, organized into households
* A set of locations where people go, such as home, work, school or shopping.
* Weekly schedules for each person, with two variants:
** A typical schedule that the person will follow without restriction
** A restricted scheudle that accounts for policy changes, such as closing workplaces or social distancing.

The simulator runs by placing each person into a location according to the person's schedule and then solves a compartmental infection model to adjust the state of each person.

# Implementation

It may be sufficient to run the simulation with a timestep of 1 hour, rather than actually solving the system of ODEs for each location. Assuming that there is random mixing at each location, each person has a probability to be infected based on the number of infected people at the location and the susceptability of the person.

# Data

The source data is the Current Population Survey for 2019. The simulation selects 40,000 households, approximately 100,000 people, and allocates the households to 4 communities, each with 10,000 households. Each community is further divided into 9 neighborhoods.

People are assigned to workgroups based on their ocupation codes, with no workgroup being larger than 100 employees.

Some of the workgroups are restuarants, nighclubs and stores. These are also locations that will be allocated patrons.

Head household has a head of household, and some have a spouse.

## Components

## Friends Network

Gallup has a [poll on the number of friends pepople have](https://news.gallup.com/poll/10891/americans-satisfied-number-friends-closeness-friendships.aspx).

## Scheduling

## References

http://jameskitts.com/pubs/Demography_2009.pdf

## Data

Sarah Flood, Miriam King, Renae Rodgers, Steven Ruggles and J. Robert Warren. Integrated Public Use Microdata Series, Current Population Survey: Version 7.0 [dataset]. Minneapolis, MN: IPUMS, 2020. https://doi.org/10.18128/D030.V7.0

repository: sandiegodata-projects/social-sim

repo_name: sandiegodata-projects/social-sim


text:
```javascript
// zipWith3 :: (a -> b -> c -> d) ->
// [a] -> [b] -> [c] -> [d]
const zipWith3 = f =>
    xs => ys => zs => Array.from({
        length: Math.min(
            ...[xs, ys, zs].map(x => x.length)
        )
    }, (_, i) => f(xs[i])(ys[i])(zs[i]));
```

```applescript
-- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
on zipWith3(f, xs, ys, zs)
    set lng to minimum({length of xs, length of ys, length of zs})
    if 1 > lng then return {}
    set lst to {}
    tell mReturn(f)
        repeat with i from 1 to lng
            set end of lst to |λ|(item i of xs, item i of ys, item i of zs)
        end repeat
        return lst
    end tell
end zipWith3
```

repository: RobTrew/prelude-jxa

path: /MD javascript vs applescript/zipWith3.md

repo_name: RobTrew/prelude-jxa


text:
# Session Recording Heatmap (SRH)

Simple and fast session recorder with indexeddb, vanilla js and heatmap.

- [x] Background collect data
- [x] Store session data in indexed db
- [ ] Background sync with service worker
- [x] Show user data in admin screen
- [ ] Npm/Github Package(for now the code is [here](https://github.com/tresende/session-recording-with-heatmap/tree/master/src/srh))

<img src ="https://raw.githubusercontent.com/tresende/session-recording-with-heatmap/master/bg.png">

repository: rnjava/session-recording-with-heatmap

repo_name: rnjava/session-recording-with-heatmap


text:
# hourly-weather-feed

NOAA has an FTP site that publishes hourly weather data. This historic data goes back to year 2000, and contains measurements from a number of stations across the United States.

This Spring application grabs that data from the FTP site, and writes it to a MySQL database. The intention of this project was to make it easy for analysts to rapidly acquire a self-updating weather dataset that spans a long period of time.

There are two projects in this repo:

1. `migration`: a flyway migration to setup MySQL with the tables it needs to capture the weather data
2. `data`: the application that harvests the data from NOAA's FTP

To setup this feed, run the [Flyway](https://flywaydb.org/) migration first.

repository: alexwoolford/hourly-weather-feed

repo_name: alexwoolford/hourly-weather-feed


text:
# Milesina scolopendrii (Faull) D.M. Hend., 1961 SPECIES

#### Status
ACCEPTED

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

#### Published in
Notes R. bot. Gdn Edinb. 23: 504 (1961)

#### Original name
Uredo scolopendrii (Fuckel) J. Schröt., 1887

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Cops-WebDevelopment
Web Development Assignment for COPS(Club Of Programmers)
About:-
Web Development Assignment for COPS(Club Of Programmers)
This is a simple implementation of web development task given by the club of programmers of IIT-BHU.
In this webapp there are a list of buttons and the first button is the only functional one.
The other buttons have no function. If the user clicks the first button then the number of clicks displayed on the screen is increased.
However generaly in this kind of web app the user may spam the button and unnecessarily increase the traffic
and will lead to a lot of problems hence to counter this i have used throttling in javascript,which does not allows
the user to click inbetween two seconds of the latest click.

Built With:- 1.HTML 2.CSS 3.Vanila JavaScript 4.Bootstrap.


text:
# The Essentialist

- Once you give yourself permission to stop trying to do it all can you make your highest contribution towards the things that really matter.
- Dieter Rams: Almost everything is noise, and very few things are essential. His job is to filter through that noise until he gets to the essence.
- "Less but better." This means pursuing what is important in a disciplined way. The way of the Essentialist is to pause constantly to ask, "Am I investing in the right activities?" There are far more activities and opportunities in the world than we have time and resources to invest in.
- *E is not about how to get more things done; it's about how to get the right things done. It doesn't mean just doing less for the sake of less either. It's about making the wisest possible investment of your time and energy in order to operate at our highest point of contribution by doing only what is essential.*
- E: living by design, not by default. Distinguish the vital few, remove obstacles.
- E thinks, does, and gets:
  - "I choose to, only a few things really matter, and what are the trade-offs?"
  - Pause to discern what really matters, says "no" to everything except the essential, and chooses carefully in order to do great work.
- How can we make the choices that allow us to tap into more of the potential inside ourselves, and in people everywhere?
- Problem: saying no is awkward, and saying yes is celebrated in the moment. This is the "paradox of success".
  - Clarity of purpose → Enables us to succeed at whatever we're doing.
  - When we become successful, we gain a reputation as a "go to" person.
  - More demands for our time, which makes us get spread thinner and thinner, and we get distracted.
- Why? Too many choices, social pressure, "we can have it all".
- ***The top of the list of the most discussed regrets: "I wish I'd had the courage to live a life true to myself, not the life others expected of me."***
- Is there a chance I will wear this someday in the future? Do I love this? Do I look great in it? Do I wear this often? If the answer is no, then you know it's a candidate for elimination.

- What is the core mindset of an essentialist?
  - ***Individual choice: we can choose how to spend our energy and time.*** Without choice, there is no point in talking about trade-offs.
  - ***The prevalence of noise: almost everything is noise, and a very few things are exceptionally valuable.*** Because some things are so much more important, the effort in finding those things is worth it.
  - ***The reality of trade-offs.***

- ***Explore: What do I feel deeply inspired by? What am I particularly talented at? What meets a significant need in the world?***
- Eliminate.
- Execute.
- Push back vs time-wasting e-mail chains, sucky projects, unproductive meetings so they can be used at their highest level of contribution to their companies and in their careers?
- Stop celebrating being busy as a measurement of importance-celebrate how much time we spent listening, pondering, meditating, and enjoying time with the most important people in our lives.
- Vision: people living a life true to themselves instead of the life others expect of them. People learning to better tap into more of their intelligence, capability, resourcefulness, and initiative to live more meaningful lives.
- ***Tell me, what is it you plan to do with your one wild and precious life?***
- ***Will you wake up one day and say, "I wish I had been less true to myself and had done all the non-essential things others expected of me?"***

# Chapter 1: Essence

- The deeply entrenched assumptions we must conquer to live the way of the E: "I have to", "it's all important", and "I can do both". To embrace the essence of E requires replacing these false assumptions with three core truths: "I choose to", "Only a few things really matter", and "I can do anything but not everything".

# Chapter 2: Choose

- If you could do only one thing with your life right now, what would you do?
- You have to emotionally know that you can do things. You might be sacrificing your power by choosing to make a bad choice.
- Learned helplessness: common with so many people.

# Chapter 3: Discern

- The unimportance of practically everything: Animal Farm/Boxer the horse. His answer to everything is: "I will work harder."
- Pareto principle/20% of the efforts produce 80% of the results.
- Distinguish: the "trivial many" from the "vital few".
- Warren Buffett: Just bet heavily on the right investments (90% of his wealth on 10 investments).
- Power law theory: certain efforts produce exponentially more results than others.
- An Essentialist discerns more so he can do less.

# Chapter 4: Trade-Off

- Southwest Airlines: Flying only point-to-point flights. No serving meals. No assigning seats in advance. Only offering coach, no first class. They were made by design.
- Southwest had a coherent strategy that made them not compromise the quality of their service.
- Instead of asking, "what do I give up", ask, "what do I want to go big on?"

# Escape

- People can't figure out what is essential if they're constantly on call. They need space to figure out what really matters.
- Hiding places: No tech. Just a place for people to think and focus.
- Isaac Newton: 2 years of solitary confinement to make Principia Mathematica.
- CEO of LinkedIn: 2 hours of blank space on the calendar each day to think.

# Look

- Journalism is not about regurgitating the facts, but figuring out the point.
- Keep a journal: think of this as a storage device for backing up our brains' faulty hard drive. I suggest reading about your writing every few months to see how the trend of your writing has changed.

# Select

- If you rate something less than 90%, reject it.
- When there is a serious lack of clarity about what the team stands for and what their goals and roles are, people experience confusion, stress, and frustration. When there is a high level of clarity, people thrive.
- Common patterns when teams lack clarity of purpose: politics, "it's all good".
- Concrete + inspirational = essential intent.
- General + inspirational = mission/vision.
- Rosa Parks: "This is the last time I would ever ride in humiliation of this kind."
- We humans are wired to want to get along with others. So say no firmly, resolutely, and yet gracefully.
- Saying no:
  - Separating the decision from the relationship.
  - Saying "no" gracefully doesn't have to mean using the word "no".
  - Focus on the trade-off.
  - Remind yourself that everyone is selling something.
  - Make your peace with the fact that saying "no" often requires trading popularity for respect.
  - Clear no is more graceful than a vague or non-committal "yes".
- The "No" repertoire:
  - The awkward pause.
  - Soft "no". "Sorry, but I'm consumed with writing my book right now."
  - The 2FA "let me check my calendar and get back to you."
  - Autoresponder.
  - "I'd love to, but in order for me to do this, I'd have to deprioritize something."
  - Say it with humor.
  - Use the words "you are welcome to X, I'm willing to Y". I won't be able to drive you. You are saying what you will not do, but you are couching it in terms of what you are willing to do.
  - "I can't do it, but X might be interested."

# Uncommit

- Endowment effect: overvaluing things we own and undervaluing things that aren't ours. People would rather not unbook a more expensive trip that they know wouldn't be as fun as a cheaper trip.
- Just admit whenever you get lost.
- Neutral second opinion on doing things.
- Status quo bias: "We have always done it this way!"
- Zero-based budgeting: Everything must be justified from scratch. Assume all previous bets are off when you try to budget your time.
- When people make their problem our problem, we aren't helping them, we're enabling them.

# Execute

- Just always assume a 50% buffer for things.
- Improving results:
  - Be clear about the essential intent
  - Identify the "slowest hiker"/what actual blockers exist though?
- Essentialist: Starts small and gets big wins, celebrates small acts of progress
- Phelps: Routine + "watching the tape"/visualizing the perfect race.
- *Losing vs being beaten: being beaten means they are better than you. Losing means you lost focus, you didn't concentrate.*
- There is only now. Past is done, future is not yet here. Focus on the present and enjoy the moment.
- The Essential Life: Living a Life That Really Matters
  - The role of family in my life.
  - The pathetically tiny amount of time we have left of our lives. This is not depressing, but is thrilling. It removes fear of choosing the wrong thing.
- The person who visits cemeteries around the world when he travels. This keeps his own mortality front and center.
- PayPal: There is just one priority, and focus on that thing exclusively. What is your biggest and highest level of contribution to the shared mission of the company?

license: Unlicense

repository: daryllxd/lifelong-learning

gha_language: Elixir

gha_license_id: Unlicense

repo_name: daryllxd/lifelong-learning


text:
### Class ExecMagic

#### %py_script
> Register cell content as a task script and save it as a python file with specified path and filename. Return object of the [PyScript](https://github.com/griddynamics/ml-dsl/blob/master/docs/PyScript.md) class.
> |argument  | description|
> |----------|--------------------------|
> |-p, --path| Path to save task script.|
> |-n, --name| Name of script file.|
> |-e, --exec| Define if a task script is being executed at once running the cell.|
> |-o, --output_path| Output path for task script results.|
>
> ##### Example
>
> >     In [1]: %py_script -e -n test_job.py -p test/scripts -o results

#### %py_script_open
> Load the content of the python script and register it as a task script. Return object of the [PyScript](https://github.com/griddynamics/ml-dsl/blob/master/docs/PyScript.md) class.
> |argument  | description|
> |----------|--------------------------|
> |-p, --path| Path to script’s folder.|
> |-n, --name| Name of script file.|
> |-o, --output_path| Output path for task script results.|
>
> ##### Example
>
> >     In [1]: %py_script_open -n test_job.py -p test/scripts -o results

#### %py_load
> Loads content of python script to the cell.
> ##### Example
>
> >     In [1]: %py_load test/scripts/test_job.py

#### %py_data
> Start a data processing job with specified parameters. Return information about task job status as well as links to job on specified cloud platform and task output path.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -n, --name         | Name of script file. |
> | -pm, --platform    | Cloud [Platform](https://github.com/griddynamics/ml-dsl/blob/master/docs/Platform.md) to run the specified task.|
> | -p, --profile      | Name of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/PySparkJobProfile.md) which describes the identifying information, config of a cluster of Compute Engine instances, task’s  and additional information.|
> | -o, --output_path  | Output path for task script results. Example: gs://cluster/mldsl_example/prepared_data (Google Cloud Storage resource)|
> | optional arguments | Any [Arguments](https://github.com/griddynamics/ml-dsl/blob/master/docs/Arguments.md) described for your task. It’s recommended to use the functionality of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/PySparkJobProfile.md) class to describe the information.|
>
> ##### Example
>
> >     In [1]: platform = Platform.AWS
> >     In [2]: PROJECT_ID = 'test_job'
> >     In [3]: profile = Profile(...)
> >     	   ...
> >     	  Profile.set(PROJECT_ID, profile)
> >     In [4]: %py_data -n test_job.py -p $PROJECT_ID -pm $platform -o $output_path

#### %py_train
> Execute a training  job with specified parameters.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -n, --name         | Name of script file. |
> | -s, --package_src  | Package src directory. |
> | -pm, --platform    | Cloud [Platform](https://github.com/griddynamics/ml-dsl/blob/master/docs/Platform.md) to run the specified task.|
> | -p, --profile      | Name of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/AIProfile.md) which describes the identifying information, config of a cluster of Compute Engine instances, task’s  and additional information.|
> | -o, --output_path  | Output path for task script results. Example: gs://cluster/mldsl_example/models (Google Cloud Storage resource)|
> | optional arguments | Any [Arguments](https://github.com/griddynamics/ml-dsl/blob/master/docs/Arguments.md) described for your task. It’s recommended to use the functionality of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/AIProfile.md) class to describe the information.|
>
> ##### Example
>
> >     In [1]: platform = Platform.GCP
> >     In [2]: PROJECT_ID = 'demo_job'
> >     In [3]: ai_profile = AIProfile(...)
> >     	   ...
> >     	  Profile.set(PROJECT_ID, ai_profile)
> >     In [4]: %py_train -n ai_model.py -s demo/train -p $PROJECT_ID  -pm $platform -o path_to_save_model\
> >                       --train_path gs://train/demo_job_012345/train_data

#### %py_deploy
> Deploy your trained model on AI Platform.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -n, --name         | Name of script file. |
> | -s, --package_src  | Package src directory. |
> | -pm, --platform    | Cloud Cloud [Platform](https://github.com/griddynamics/ml-dsl/blob/master/docs/Platform.md) to run the specified task.|
> | -p, --profile      | Name of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/DeployAIProfile.md) which describes the identifying information, config of a cluster of Compute Engine instances, task’s  and additional information.|
>
> ##### Example
>
> >     In [1]: platform = Platform.GCP
> >     In [2]: PROJECT_ID = 'demo_job'
> >     In [3]: ai_profile = DeployAIProfile(...)
> >     	   ...
> >     	  Profile.set(PROJECT_ID, ai_profile)
> >     In [4]: %py_deploy -n mldsl_demo -p $PROJECT_ID -s demo/deploy  -pm $platform

#### %py_test
> Get online predictions from model resource for test data. Return your predictions in the response and paste to the next cell. Currently only Google Cloud Platform supported.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -t, --test         | Test data to get online predictions. |
> | -pm, --platform    | Cloud Cloud [Platform](https://github.com/griddynamics/ml-dsl/blob/master/docs/Platform.md) to run the specified task.|
> | -p, --profile      | Name of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/DeployAIProfile.md) which describes the identifying information, config of a cluster of Compute Engine instances, task’s  and additional information.|
>
> ##### Example
>
> >     In [1]: platform = Platform.GCP
> >     In [2]: PROJECT_ID = 'demo_job'
> >     In [3]: ai_profile = DeployAIProfile(...)
> >     	   ...
> >     	  Profile.set(PROJECT_ID, ai_profile)
> >     In [4]: %py_test -p $PROJECT_ID  -pm $platform -t $test

#### %logging
> Get logs of the specified Dataproc job and print them out. Currently only Google Cloud Platform supported.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -p, --project_id         | Project ID on Google Cloud Platform. |
> | -f, --filter    | Conditions to filter specific values of indexed fields, like the log entry's name, resource type, and resource labels.|
> | -r, --order_by      | One of ASC, DESC or None.|
> | -s, --page_size      | The maximum number of entries in each page of results.|
>
> ##### Example
>
> >     In [1]: project = test_project
> >     In [2]: filter = 'jsonPayload.application:application_123'
> >     In [3]: %logging -p $project -f $filter

#### %job_upgrade
> Implement changes for jobs. Start a new version of the job, wait for necessary validation (logs checking) and stop one of the job's version based on this checking: old one if validation was successful, new if the conditions were not met.
> | argument           | description  |
> |--------------------|------------------------------------------|
> | -n, --name         | Name of script file. |
> | -pm, --platform    | Cloud Cloud [Platform](https://github.com/griddynamics/ml-dsl/blob/master/docs/Platform.md) to run the specified task.|
> | -p, --profile      | Name of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/PySparkJobProfile.md) which describes the identifying information, config of a cluster of Compute Engine instances, task’s  and additional information.|
> | -o, --output_path  | Output path for task script results. Example: gs://cluster/mldsl_example/prepared_data (Google Cloud Storage resource)|
> | --old_job_id | Name of job’s previous version to upgrade.|
> | -v, --validator | Name of custom validator class.|
> | -vp, --validator_path | Path to script with validator class.|
> | optional arguments | Any [Arguments](https://github.com/griddynamics/ml-dsl/blob/master/docs/Arguments.md) described for your task. It’s recommended to use the functionality of [Profile](https://github.com/griddynamics/ml-dsl/blob/master/docs/profiles/PySparkJobProfile.md) class to describe the information.|
>
> ##### Example
>
> >     In [1]: platform = Platform.GCP
> >     In [2]: PROJECT_ID = 'test_upgrade_job'
> >     In [3]: profile = Profile(...)
> >     	   ...
> >     	  Profile.set(PROJECT_ID, profile)
> >     In [4]: %job_upgrade -n test_upgrade_job.py -p $PROJECT_ID -pm $platform -o gs://ai4ops/mldsl/data\
> >                          --old_job_id old_job_123 -v MyValidator -vp  /.mldsl/my_validator.py

repository: griddynamics/ml-dsl

repo_name: griddynamics/ml-dsl


text:
# Teaching

- **Spring 2020**
  * EE 652 - IC Design Laboratory
  * ES 215 - Computer Organisation and Architecture (CS)
  * ES 333 - Microprocessors and Embedded Systems

- **Fall 2019**
  * EE 617 - VLSI Design
  * EE 618 - Microelectronics Lab
  * ES 203 - Digital Systems

repository: joycee-mekie/joycee

repo_name: joycee-mekie/joycee


text:
---
layout: post
title: Virtual Private Network (VPN)
---

# ABCs

1. VPN is a *tunneling protocol* (TP) designed to facilitate travel employees' networking connection back to office (i.e. headquarter).

   However VPN can do more than that. For example, we use VPN to bypass firewall, ISP censorship etc. We call such VPN as Personal VPN.
2. There are many VPNs implementations over the world to choose from, which includes but are not limited to:

   PPTP, L2TP/IPSec, SSTP, OpenVPN, etc. Among of them, OpenVPN is the most widely deployed but rather complicated.

   Wireguard emerges as a state-of-the-art VPN technology based on DH key exchange and Poly1305 encryption.
3. Logically, most VPNs locate at link layer (layer 2) offering services to IP layer (layer 3). On the other hand VPN itself sits on top of TCP/UDP layer. Almost all VPNs create virtual interface at system level to which kernel transmits application IP packets.

   VPN service either resides in kernel (i.e. WireGuard kernel module or built-in tree) or run as a daemon at userspace space. Obviously, the former has greater performance.

   Upon receving IP payload, VPN encapsulates application's IP payload into VPN TCP or UDP packets which in turn are encapsulated into the Internet IP packets again.
4. Generally, UDP VPN (i.e. WireGuard) is faster than TCP VPN (OpenVPN) but less reliable.

## PPTP

Point-to-Point Tunneling Protocol (PPTP). A specification for PPTP was published in July 1999 as RFC 2637.

PPTP has many known security issues, and it's likely the NSA (and probably other intelligence agencies) are decrypting these supposedly "secure" connections. That means attackers and more repressive governments would have an easier way to compromise these connections.

PPTP is common and easy to set up. PPTP clients are built into many platforms, including Windows, Android etc. That's the only advantage, and it's not worth it. It's time to move on.

In Summary: PPTP is an obselete, old and vulnerable, although integrated into common operating systems and easy to set up. Stay away!

## L2TP/IPsec

L2TPv3 was proposed as standard RFC 3931 in 2005.

Layer 2 Tunneling Protocol (L2TP) is a tunneling protocol used to support virtual private networks (VPNs) or as part of the delivery of services by ISPs. It does not provide any encryption or confidentiality by itself. Rather, it relies on an encryption protocol that it passes within the tunnel to provide privacy.

Since L2TP is a VPN protocol that doesn't offer any encryption, it's usually implemented along with IPsec encryption. This is a *slower* solution than OpenVPN. The traffic must be converted into L2TP form, and then encryption added on top with IPsec. It's a two-step process.

## SSTP

Secure Socket Tunneling Protocol (SSTP) was introduced in Windows Vista Service Pack 1. It's a *proprietary* Microsoft protocol, and is best supported on Windows. It may be more stable on Windows because it's integrated into the operating system whereas OpenVPN isn't — that's the biggest potential advantage. Some support for it is available on other operating systems, but it's nowhere near as widespread.

# [OpenVPN](https://wiki.archlinux.org/index.php/OpenVPN)

Unlike PPTP and L2TP (proposed to RFC as standards), OpenVPN is actively maintained by [OpenVPN Technologies, Inc.](https://openvpn.net). Apart from the free [OpenVPN Community Edition (CE)](https://openvpn.net/index.php/open-source.html), OpenVPN Technologies, Inc. provides proprietary solution - [OpenVPN Access Server (AS)](https://openvpn.net/index.php/access-server/overview.html). The proprietary OpenVPN AS is almost the same to free OpenVPN CE, with advantage of easy configuration and deployment (web interface).

OpenVPN uses open-source technologies like the OpenSSL encryption library and SSL v3/TLS v1 protocols. It can be configured to run on any port, so you could configure a server to work over TCP port 443.

OpenVPN support isn't integrated into popular desktop or mobile operating systems. Connecting to an OpenVPN network requires extra installation - either a desktop application or a mobile app. Yes, you can even use mobile apps to connect to OpenVPN networks on Apple's iOS.

## Client

1. Android: OpenVPN for Android and OpenConnect (open source; no root requirement).
2. iOS: OpenVPN Connect (closed source).
2. GNU/Linux: *net-vpn/openvpn*.

# [Create PKI](https://wiki.archlinux.org/index.php/Easy-rsa)

>Username/password authentication is discouraged for sake of anonymity and privacy.

To set up OpenVPN server/client, we need to create Public Key Infrastructure (PKI).

OpenVPN relies on a bidirectional authentication strategy, so the client must authenticate the server's certificate and in parallel, the server must authenticate the client's certificate. This is accomplished by the 3rd party's signature (the CA) on both the client and server certificates. Once this is established, further checks are performed before the authentication is complete.

1. CA

   A public master Certificate Authority (CA) certificate and a private key thereof. CA is the root of trust web.

   (ca.key, ca.pub, ca.crt).
2. Server/Client key

   A separate public certificate and private key pair (hereafter referred to as a certificate) for each server and each client.

   (server.key, server.pub. server.crt); (client.key, client.pub, client.crt).
3. Other files

   *tls-auth* key file; *crl-verify* pem file; *dh* pem file etc.
4. An *.ovpn* file (can be imported) simplifies configuration.


text:
Create Slack signup page using Auth0 webtasks
======

With [Auth0 Webtasks](https://webtask.io) you can quickly create a signup page for your Slack team without worrying about hosting, backends, and devops.

Follow these 3 steps:

```bash
npm install -g wt-cli
wt init
wt create https://raw.githubusercontent.com/auth0/webtask-slack-signup/master/slack-invite.js \
    --name {your_slack_team}-signup \
    --capture \
    --secret SLACK_ORG={your_slack_team} \
    --secret SLACK_TOKEN={your_slack_admin_token}
```

The `{your_slack_admin_token}` can be obtained from Slack [here](https://api.slack.com/docs/oauth-test-tokens).

Optionally, you can also provide `--secret LOGO_URL={url_to_your_logo}` which will display your custom logo on the signup page. It should be square and not less than 100x100px.

Use the resulting URL as your Slack signup page. Enjoy!

repository: GMesyngier/webtask-slack-signup

repo_name: GMesyngier/webtask-slack-signup


text:
# ROSND Where AM I

## Dependencies for Running Locally
* ``amcl``, ``move_base`` and ``map-server``ROS packages.

  You could install them:(replace <distro> with kinetic, melodic...)
  ``$ sudo apt-get install ros-<distro>-navigation``
  ``$ sudo apt-get install ros-<distro>-map-server``
  ``$ sudo apt-get install ros-<distro>-move-base``
  ``$ sudo apt-get install ros-<distro>-amcl``
* ``Recommend ROS version -`` melodic

## Basic Build Instructions
1. Clone this repo to your work space e.g. c:/home/workspace/
2. cd /home/workspace/Udacity-RoboND-Where-AM-I/
3. catkin_make

## Launch the Project
1. cd /home/workspace/Udacity-RoboND-Where-AM-I/
2. source devel/setup.bash
3. roslaunch main main.launch
Following nodes will be launched:

## Rviz configuration
A RVIZ configuration is located /Udacity-RoboND-Where-AM-I/amcl.rviz


text:
## HTML/CSS/Git Intro - Iron News

### Description

One of the basic, foundational skills in being a professional web developer is the translation of a designer's mockup image into a webpage with HTML and CSS. One of the basic, foundational news portals for professional web developers is "Hacker News," which is kind of like a Reddit for the startup/design/development community with a very... *minimalist* design ethic.

Since it's so simple (there's only one image!) we're going to start off here.

At the same time, we're also going to get into the habit of frequently creating git commits as checkpoints.

### Objectives

##### Learning Objectives

After completing this assignment, you should be comfortable with

* Translating images/PSDs to HTML and CSS
* Hosting static pages on GitHub
* Using git on the command line
* Best practices for committing frequently

##### Performance Objectives

After completing this assignment, you be able to effectively use

* Chrome developer tools
* GitHub pages
* Terminal
* git
* Your text editor of choice

### Details

##### Deliverables

* A GitHub pages-hosted repo containing
    * `index.html`
    * `index.css`
    * All images in an `assets/images` folder

##### Requirements

* Valid, semantic, accessable HTML
* Valid CSS
* At least one git commit (with a message) every hour that you're working on this project

### Normal Mode

Using HTML and CSS, re-create the included image (`Iron News.png`) as a webpage. Don't worry about the text content (feel free to use an ipsum generator), but use the original image and *make your best effort* to match the dimensions and styles of original page to yours.

### Additional Resources

* [Hacker News](http://news.ycombinator.com)
* [Meet the Ipsums](http://meettheipsums.com/)

repository: boazblake/Course-Guide

repo_name: boazblake/Course-Guide