text:
package storage

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"github.com/Azure/go-autorest/autorest/validation"
	"github.com/Azure/go-autorest/tracing"
	"net/http"
)

// FileSharesClient is the the Azure Storage Management API.
type FileSharesClient struct {
	BaseClient
}

// NewFileSharesClient creates an instance of the FileSharesClient client.
func NewFileSharesClient(subscriptionID string) FileSharesClient {
	return NewFileSharesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// NewFileSharesClientWithBaseURI creates an instance of the FileSharesClient client using a custom endpoint.  Use this
// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewFileSharesClientWithBaseURI(baseURI string, subscriptionID string) FileSharesClient {
	return FileSharesClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// Create creates a new share under the specified account as described by request body. The share resource includes
// metadata and properties for that share. It does not include a list of the files contained by the share.
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// shareName - the name of the file share within the specified storage account. File share names must be
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
// character must be immediately preceded and followed by a letter or number.
// fileShare - properties of the file share to create.
// expand - optional, used to create a snapshot.
func (client FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, expand PutSharesExpand) (result FileShare, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Create")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: shareName,
			Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
				{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: fileShare,
			Constraints: []validation.Constraint{{Target: "fileShare.FileShareProperties", Name: validation.Null, Rule: false,
				Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.Null, Rule: false,
					Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMaximum, Rule: int64(102400), Chain: nil},
						{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
					}},
				}}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "Create", err.Error())
	}

	req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare, expand)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", nil, "Failure preparing request")
		return
	}

	resp, err := client.CreateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", resp, "Failure sending request")
		return
	}

	result, err = client.CreateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", resp, "Failure responding to request")
		return
	}

	return
}

// CreatePreparer prepares the Create request.
func (client FileSharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, expand PutSharesExpand) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"shareName":         autorest.Encode("path", shareName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(string(expand)) > 0 {
		queryParameters["$expand"] = autorest.Encode("query", expand)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
		autorest.WithJSON(fileShare),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) CreateSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client FileSharesClient) CreateResponder(resp *http.Response) (result FileShare, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Delete deletes specified share under its account.
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// shareName - the name of the file share within the specified storage account. File share names must be
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
// character must be immediately preceded and followed by a letter or number.
// xMsSnapshot - optional, used to delete a snapshot.
func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, xMsSnapshot string) (result autorest.Response, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Delete")
		defer func() {
			sc := -1
			if result.Response != nil {
				sc = result.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: shareName,
			Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
				{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "Delete", err.Error())
	}

	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, xMsSnapshot)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", nil, "Failure preparing request")
		return
	}

	resp, err := client.DeleteSender(req)
	if err != nil {
		result.Response = resp
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", resp, "Failure sending request")
		return
	}

	result, err = client.DeleteResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", resp, "Failure responding to request")
		return
	}

	return
}

// DeletePreparer prepares the Delete request.
func (client FileSharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, xMsSnapshot string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"shareName":         autorest.Encode("path", shareName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	if len(xMsSnapshot) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("x-ms-snapshot", autorest.String(xMsSnapshot)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) DeleteSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client FileSharesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
		autorest.ByClosing())
	result.Response = resp
	return
}

// Get gets properties of a specified share.
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// shareName - the name of the file share within the specified storage account. File share names must be
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
// character must be immediately preceded and followed by a letter or number.
// expand - optional, used to expand the properties within share's properties.
// xMsSnapshot - optional, used to retrieve properties of a snapshot.
func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand GetShareExpand, xMsSnapshot string) (result FileShare, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Get")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: shareName,
			Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
				{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "Get", err.Error())
	}

	req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, expand, xMsSnapshot)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", nil, "Failure preparing request")
		return
	}

	resp, err := client.GetSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", resp, "Failure sending request")
		return
	}

	result, err = client.GetResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", resp, "Failure responding to request")
		return
	}

	return
}

// GetPreparer prepares the Get request.
func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand GetShareExpand, xMsSnapshot string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"shareName":         autorest.Encode("path", shareName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(string(expand)) > 0 {
		queryParameters["$expand"] = autorest.Encode("query", expand)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	if len(xMsSnapshot) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("x-ms-snapshot", autorest.String(xMsSnapshot)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) GetSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client FileSharesClient) GetResponder(resp *http.Response) (result FileShare, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// List lists all shares.
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// maxpagesize - optional. Specified maximum number of shares that can be included in the list.
// filter - optional. When specified, only share names starting with the filter will be listed.
// expand - optional, used to expand the properties within share's properties.
func (client FileSharesClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (result FileShareItemsPage, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.List")
		defer func() {
			sc := -1
			if result.fsi.Response.Response != nil {
				sc = result.fsi.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "List", err.Error())
	}

	result.fn = client.listNextResults
	req, err := client.ListPreparer(ctx, resourceGroupName, accountName, maxpagesize, filter, expand)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.fsi.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", resp, "Failure sending request")
		return
	}

	result.fsi, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", resp, "Failure responding to request")
		return
	}
	if result.fsi.hasNextLink() && result.fsi.IsEmpty() {
		err = result.NextWithContext(ctx)
		return
	}

	return
}

// ListPreparer prepares the List request.
func (client FileSharesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(maxpagesize) > 0 {
		queryParameters["$maxpagesize"] = autorest.Encode("query", maxpagesize)
	}
	if len(filter) > 0 {
		queryParameters["$filter"] = autorest.Encode("query", filter)
	}
	if len(string(expand)) > 0 {
		queryParameters["$expand"] = autorest.Encode("query", expand)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) ListSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client FileSharesClient) ListResponder(resp *http.Response) (result FileShareItems, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listNextResults retrieves the next set of results, if any.
func (client FileSharesClient) listNextResults(ctx context.Context, lastResults FileShareItems) (result FileShareItems, err error) {
	req, err := lastResults.fileShareItemsPreparer(ctx)
	if err != nil {
		return result, autorest.NewErrorWithError(err, "storage.FileSharesClient", "listNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "storage.FileSharesClient", "listNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "listNextResults", resp, "Failure responding to next results request")
	}
	return
}

// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client FileSharesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (result FileShareItemsIterator, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.List")
		defer func() {
			sc := -1
			if result.Response().Response.Response != nil {
				sc = result.page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	result.page, err = client.List(ctx, resourceGroupName, accountName, maxpagesize, filter, expand)
	return
}

// Restore restore a file share within a valid retention days if share soft delete is enabled
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// shareName - the name of the file share within the specified storage account. File share names must be
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
// character must be immediately preceded and followed by a letter or number.
func (client FileSharesClient) Restore(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare) (result autorest.Response, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Restore")
		defer func() {
			sc := -1
			if result.Response != nil {
				sc = result.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: shareName,
			Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
				{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: deletedShare,
			Constraints: []validation.Constraint{{Target: "deletedShare.DeletedShareName", Name: validation.Null, Rule: true, Chain: nil},
				{Target: "deletedShare.DeletedShareVersion", Name: validation.Null, Rule: true, Chain: nil}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "Restore", err.Error())
	}

	req, err := client.RestorePreparer(ctx, resourceGroupName, accountName, shareName, deletedShare)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Restore", nil, "Failure preparing request")
		return
	}

	resp, err := client.RestoreSender(req)
	if err != nil {
		result.Response = resp
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Restore", resp, "Failure sending request")
		return
	}

	result, err = client.RestoreResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Restore", resp, "Failure responding to request")
		return
	}

	return
}

// RestorePreparer prepares the Restore request.
func (client FileSharesClient) RestorePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"shareName":         autorest.Encode("path", shareName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", pathParameters),
		autorest.WithJSON(deletedShare),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// RestoreSender sends the Restore request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) RestoreSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// RestoreResponder handles the response to the Restore request. The method always
// closes the http.Response Body.
func (client FileSharesClient) RestoreResponder(resp *http.Response) (result autorest.Response, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByClosing())
	result.Response = resp
	return
}

// Update updates share properties as specified in request body. Properties not mentioned in the request will not be
// changed. Update fails if the specified share does not already exist.
// Parameters:
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
// insensitive.
// accountName - the name of the storage account within the specified resource group. Storage account names
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
// shareName - the name of the file share within the specified storage account. File share names must be
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
// character must be immediately preceded and followed by a letter or number.
// fileShare - properties to update for the file share.
func (client FileSharesClient) Update(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (result FileShare, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Update")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: resourceGroupName,
			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
		{TargetValue: accountName,
			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: shareName,
			Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
				{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
		{TargetValue: client.SubscriptionID,
			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
		return result, validation.NewError("storage.FileSharesClient", "Update", err.Error())
	}

	req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", nil, "Failure preparing request")
		return
	}

	resp, err := client.UpdateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", resp, "Failure sending request")
		return
	}

	result, err = client.UpdateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", resp, "Failure responding to request")
		return
	}

	return
}

// UpdatePreparer prepares the Update request.
func (client FileSharesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"accountName":       autorest.Encode("path", accountName),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"shareName":         autorest.Encode("path", shareName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPatch(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
		autorest.WithJSON(fileShare),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client FileSharesClient) UpdateSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client FileSharesClient) UpdateResponder(resp *http.Response) (result FileShare, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}


text:
package client

import (
	"time"

	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request"
)

// NoOpRetryer provides a retryer that performs no retries.
// It should be used when we do not want retries to be performed.
type NoOpRetryer struct{}

// MaxRetries returns the number of maximum returns the service will use to make
// an individual API; For NoOpRetryer the MaxRetries will always be zero.
func (d NoOpRetryer) MaxRetries() int {
	return 0
}

// ShouldRetry will always return false for NoOpRetryer, as it should never retry.
func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool {
	return false
}

// RetryRules returns the delay duration before retrying this request again;
// since NoOpRetryer does not retry, RetryRules always returns 0.
func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration {
	return 0
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import print_function

import unittest
import gc

import wrapt

class TestWeakFunctionProxy(unittest.TestCase):

    def test_isinstance(self):
        def function(a, b):
            return a, b

        proxy = wrapt.WeakFunctionProxy(function)

        self.assertTrue(isinstance(proxy, type(function)))

    def test_no_callback(self):
        def function(a, b):
            return a, b

        proxy = wrapt.WeakFunctionProxy(function)

        self.assertEqual(proxy(1, 2), (1, 2))

        function = None
        gc.collect()

    def test_call_expired(self):
        def function(a, b):
            return a, b

        proxy = wrapt.WeakFunctionProxy(function)

        self.assertEqual(proxy(1, 2), (1, 2))

        function = None
        gc.collect()

        def run(*args):
            proxy()

        self.assertRaises(ReferenceError, run, ())

    def test_function(self):
        def function(a, b):
            return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        proxy = wrapt.WeakFunctionProxy(function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        function = None
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_instancemethod_delete_instance(self):
        class Class(object):
            def function(self, a, b):
                return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        c = Class()

        proxy = wrapt.WeakFunctionProxy(c.function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        c = None
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_instancemethod_delete_function(self):
        class Class(object):
            def function(self, a, b):
                return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        c = Class()

        proxy = wrapt.WeakFunctionProxy(c.function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        del c
        del Class.function
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_instancemethod_delete_function_and_instance(self):
        class Class(object):
            def function(self, a, b):
                return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        c = Class()

        proxy = wrapt.WeakFunctionProxy(c.function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        c = None
        del Class.function
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_classmethod(self):
        class Class(object):
            @classmethod
            def function(cls, a, b):
                self.assertEqual(cls, Class)
                return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        proxy = wrapt.WeakFunctionProxy(Class.function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        Class = None
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_staticmethod(self):
        class Class(object):
            @staticmethod
            def function(a, b):
                return a, b

        result = []

        def callback(proxy):
            result.append(id(proxy))

        proxy = wrapt.WeakFunctionProxy(Class.function, callback)

        self.assertEqual(proxy(1, 2), (1, 2))

        Class = None
        gc.collect()

        self.assertEqual(len(result), 1)
        self.assertEqual(id(proxy), result[0])

    def test_decorator_method(self):
        @wrapt.decorator
        def bark(wrapped, instance, args, kwargs):
            return 'bark'

        class Animal(object):
            @bark
            def squeal(self):
                return 'squeal'

        animal = Animal()

        self.assertEqual(animal.squeal(), 'bark')

        method = wrapt.WeakFunctionProxy(animal.squeal)

        self.assertEqual(method(), 'bark')

if __name__ == '__main__':
    unittest.main()


text:
package com.bitdubai.fermat_core.layer.dap_actor.asset_user;

import com.bitdubai.fermat_api.FermatException;
import com.bitdubai.fermat_api.Plugin;
import com.bitdubai.fermat_dap_api.layer.dap_actor.CantStartSubsystemException;
import com.bitdubai.fermat_dap_api.layer.dap_actor.DAPActorSubsystem;
import com.bitdubai.fermat_dap_plugin.layer.actor.asset.user.developer.bitdubai.DeveloperBitDubai;

/**
 * Created by Nerio on 11/09/15.
 */
public class AssetUserActorSubsystem implements DAPActorSubsystem {

    Plugin plugin;

    @Override
    public void start() throws CantStartSubsystemException {
        try {
            DeveloperBitDubai developerBitDubai = new DeveloperBitDubai();
            plugin = developerBitDubai.getPlugin();
        }
        catch (Exception exception)
        {
            throw new CantStartSubsystemException(FermatException.wrapException(exception),"AssetUserActorSubsystem","Unexpected Exception");
        }
    }

    @Override
    public Plugin getPlugin() {
        return plugin;
    }
}


text:
import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.join(
    os.path.dirname(os.path.realpath(__file__)), '../..'))
if PROJECT_ROOT not in sys.path:
    sys.path.insert(0, PROJECT_ROOT)

from kolla.image import build

def main():
    statuses = build.run_build()
    if statuses:
        bad_results, good_results, unmatched_results = statuses
        if bad_results:
            return 1
    return 0

if __name__ == '__main__':
    sys.exit(main())


text:
Current version: 1.1.2. [See version history](https://github.com/jspsych/jsPsych/blob/main/packages/plugin-html-slider-response/CHANGELOG.md).

This plugin displays HTML content and allows the participant to respond by dragging a slider.

## Parameters

In addition to the [parameters available in all plugins](../overview/plugins.md#parameters-available-in-all-plugins), this plugin accepts the following parameters. Parameters with a default value of *undefined* must be specified. Other parameters can be left unspecified if the default value is acceptable.

Parameter | Type | Default Value | Description
----------|------|---------------|------------
stimulus | HTML string | *undefined* | The string to be displayed
labels | array of strings | [] | Labels displayed at equidistant locations on the slider. For example, two labels will be placed at the ends of the slider. Three labels would place two at the ends and one in the middle. Four will place two at the ends, and the other two will be at 33% and 67% of the slider width.
button_label | string | 'Continue' | Label of the button to end the trial.
min | integer | 0 | Sets the minimum value of the slider.
max | integer | 100 | Sets the maximum value of the slider.
slider_start | integer | 50 | Sets the starting value of the slider
step | integer | 1 | Sets the step of the slider. This is the smallest amount by which the slider can change.
slider_width | integer | null | Set the width of the slider in pixels. If left null, then the width will be equal to the widest element in the display.
require_movement | boolean | false | If true, the participant must move the slider before clicking the continue button.
prompt | string | null | This string can contain HTML markup. Any content here will be displayed below the stimulus. The intention is that it can be used to provide a reminder about the action the participant is supposed to take (e.g., which key to press).
stimulus_duration | numeric | null | How long to display the stimulus in milliseconds. The visibility CSS property of the stimulus will be set to `hidden` after this time has elapsed. If this is null, then the stimulus will remain visible until the trial ends.
trial_duration | numeric | null | How long to wait for the participant to make a response before ending the trial in milliseconds. If the participant fails to make a response before this timer is reached, the participant's response will be recorded as null for the trial and the trial will end. If the value of this parameter is null, then the trial will wait for a response indefinitely.
response_ends_trial | boolean | true | If true, then the trial will end whenever the participant makes a response (assuming they make their response before the cutoff specified by the `trial_duration` parameter). If false, then the trial will continue until the value for `trial_duration` is reached. You can set this parameter to `false` to force the participant to view a stimulus for a fixed amount of time, even if they respond before the time is complete.

## Data Generated

In addition to the [default data collected by all plugins](../overview/plugins.md#data-collected-by-all-plugins), this plugin collects the following data for each trial.

Name | Type | Value
-----|------|------
response | numeric | The numeric value of the slider.
rt | numeric | The time in milliseconds for the participant to make a response. The time is measured from when the stimulus first appears on the screen until the participant's response.
stimulus | string | The HTML content that was displayed on the screen.
slider_start | numeric | The starting value of the slider.

## Install

Using the CDN-hosted JavaScript file:

```js
<script src="https://unpkg.com/@jspsych/plugin-html-slider-response@1.1.2"></script>
```

Using the JavaScript file downloaded from a GitHub release dist archive:

```js
<script src="jspsych/plugin-html-slider-response.js"></script>
```

Using NPM:

```
npm install @jspsych/plugin-html-slider-response
```
```js
import htmlSliderResponse from '@jspsych/plugin-html-slider-response';
```

## Examples

???+ example "Displaying question until participant moves the slider"
    === "Code"

        ```javascript
        var trial = {
            type: jsPsychHtmlSliderResponse,
            stimulus: `<div style="width:500px;">
                <p>How likely is it that team A will win this match?</p>
                <div style="width:240px; float: left;">
                    <p>TEAM A</p>
                    <p>10 wins, 5 losses, 6 draws</p>
                </div>
                <div style="width:240px; float: right;">
                    <p>TEAM B</p>
                    <p>6 wins, 4 losses, 11 draws</p>
                </div>
                </div>`,
            require_movement: true,
            labels: ['100% chance', '50% chance', '0% chance']
        };
        ```

    === "Demo"

    Open demo in new tab


text:
<?xml version="1.0" encoding="UTF-8"?>
<entities do-package="com.dianping.cat.core.dal" gen="true">

	<entity name="task" table="task" alias="t">
		<member name="count" value-type="int" select-expr="COUNT(*)" all="false" />
		<var name="start-limit" value-type="int" />
		<var name="end-limit" value-type="int" />
		<readsets>
			<readset name="REPORT_DOMAIN">
				<member name="report_domain" />
			</readset>
			<readset name="REPORT_NAME">
				<member name="report_name" />
			</readset>
			<readset name="REPORT_NAME_DOMAIN">
				<member name="report_domain" />
				<member name="report_name" />
			</readset>
			<readset name="COUNT">
				<member name="count" />
			</readset>
		</readsets>
		<query-defs>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
				INSERT IGNORE INTO

					(<FIELDS/>)
				VALUES
					(<VALUES/>)
				]]></statement>
			</query>
			<query name="find-by-status-consumer" type="SELECT">
				<param name="status" />
				<param name="consumer" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='status'/> = ${status}
					<IF type='NOT_NULL' field='consumer'>
						AND  <FIELD name='consumer'/> = ${consumer}
					</IF> limit 1
				]]></statement>
			</query>

			<query name="update-todo-to-doing" type="UPDATE">
				<statement><![CDATA[
					UPDATE

					SET <FIELD name='consumer'/>=${consumer},
						<FIELD name='status'/>=2,
						<FIELD name='start-date'/>=${start-date}
					WHERE <FIELD name='status'/> = 1
					AND <FIELD name='id'/> = ${id};
				]]></statement>
			</query>

			<query name="update-doing-to-done" type="UPDATE">
				<statement><![CDATA[
					UPDATE

					SET <FIELD name='status'/>=3,
						<FIELD name='end-date'/>=${end-date}
					WHERE <FIELD name='status'/> = 2
					AND <FIELD name='id'/> = ${id};
				]]></statement>
			</query>

			<query name="update-failure-to-done" type="UPDATE">
				<statement><![CDATA[

				UPDATE

				SET <FIELD name='status'/>=3,
					<FIELD name='end-date'/>=${end-date}
				WHERE <FIELD name='status'/> =4
				AND <FIELD name='id'/> = ${id};

				]]></statement>
			</query>

			<query name="update-status-to-todo" type="UPDATE">
				<statement><![CDATA[
					UPDATE

					SET <FIELD name='status'/>=1,
					WHERE <FIELD name='id'/> = ${id};
				]]></statement>
			</query>

			<query name="update-doing-to-fail" type="UPDATE">
				<statement><![CDATA[
					UPDATE

					SET <FIELD name='status'/>=4,
						<FIELD name='end-date'/>=${end-date},
						<FIELD name='failure-count'/> = <FIELD name='failure-count'/> + 1
					WHERE <FIELD name='status'/> = 2
					AND <FIELD name='id'/> = ${id};
				]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="hostinfo" table="hostinfo" alias="h">
		<member name="creation-date" insert-expr="NOW()" />
		<member name="last-modified-date" insert-expr="NOW()" update-expr="NOW()" />
		<query-defs>
			<query name="find-by-ip" type="SELECT">
				<param name="ip" />
				<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				WHERE <FIELD name='ip'/> = ${ip}
				]]></statement>
			</query>
			<query name="find-all-ip" type="SELECT" multiple="true">
				<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				]]></statement>
			</query>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
			INSERT INTO

			(<FIELDS/>) VALUES(<VALUES/>)
			ON DUPLICATE KEY
			UPDATE <FIELD name='domain'/> = ${domain},
            <FIELD name='last-modified-date'/> = NOW()]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="project" table="project" alias="p">
		<member name="creation-date" insert-expr="NOW()" />
		<member name="modify-date" insert-expr="NOW()" update-expr="NOW()" />
		<query-defs>
			<query name="find-all" type="SELECT" multiple="true">
				<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				]]></statement>
			</query>
			<query name="find-by-domain" type="SELECT">
				<param name="domain" />
				<statement><![CDATA[
				SELECT <FIELDS/>
				FROM
  WHERE binary(<FIELD name='domain'/>) = binary(${domain})
				]]></statement>
			</query>
			<query name="find-by-cmdb-domain" type="SELECT">
				<param name="domain" />
				<statement><![CDATA[
				SELECT <FIELDS/>
				FROM
  WHERE binary(<FIELD name='cmdb-domain'/>) = binary(${domain})
				]]></statement>
			</query>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
				INSERT INTO

				(<FIELDS/>) VALUES(<VALUES/>)
				ON DUPLICATE KEY
				UPDATE <FIELD name='domain'/> = ${domain},
            	<FIELD name='modify-date'/> = NOW()]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="report-content" table="report_content" alias="rc" class-name="HourlyReportContent">
	 <member name="creation-date" insert-expr="NOW()" />
	 <member name="content-length" value-type="long" all="false" select-expr="length(content)/1024/1024" length="19" nullable="false" />
	 <var name="start-id" value-type="int" />
	 <var name="capacity" value-type="double" />
	 <readsets>
		<readset name="LENGTH">
			<member name="report-id" />
			<member name="content-length" />
		</readset>
	 </readsets>
     <query-defs>
     	<query name="find-overload-report" type="SELECT" multiple="true">
			<param name="start-id" />
			<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				WHERE <FIELD name='report-id'/> > ${start-id}
				ORDER BY <FIELD name='report-id'/> asc limit 1000
				]]></statement>
		</query>
     </query-defs>
    </entity>
	<entity name="report" table="report" alias="r"  class-name="HourlyReport">
		<member name="creation-date" insert-expr="NOW()" />
		<var name="start-date" value-type="Date" />
		<var name="end-date" value-type="Date" />
		<readsets>
			<readset name="DOMAIN_NAME">
				<member name="domain" />
				<member name="name" />
			</readset>
		</readsets>
		<query-defs>
			<query name="find-all-by-domain-name-period" type="SELECT" multiple="true">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND binary(<FIELD name='domain'/>) = binary(${domain})
					]]></statement>
			</query>
			<query name="find-all-by-period-name" type="SELECT" multiple="true">
				<param name="period" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='name'/> = ${name}
					]]></statement>
			</query>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
					INSERT
					INTO
(<FIELDS/>)
					VALUES(<VALUES/>)
				]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="dailyreport" table="dailyreport" alias="dr" class-name="DailyReport">
		<member name="count" value-type="int" select-expr="COUNT(*)" all="false" />
		<var name="start-date" value-type="Date" />
		<var name="end-date" value-type="Date" />
		<readsets>
			<readset name="DOMAIN_NAME">
				<member name="domain" />
				<member name="name" />
			</readset>
			<readset name="COUNT">
				<member name="count" />
			</readset>
		</readsets>
		<query-defs>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
					INSERT INTO

						(<FIELDS/>)
					VALUES
						(<VALUES/>)
					]]></statement>
			</query>
			<query name="find-by-domain-name-period" type="SELECT">
				<param name="domain" />
				<param name="name" />
				<param name="period" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND binary(<FIELD name='domain'/>) = binary(${domain})
					]]></statement>
			</query>
			<query name="delete-by-domain-name-period" type="DELETE">
				<param name="domain" />
				<param name="name" />
				<param name="period" />
				<statement><![CDATA[
					DELETE
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND binary(<FIELD name='domain'/>) = binary(${domain})
					]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="graph" table="graph" alias="g">
		<var name="start-date" value-type="Date" />
		<var name="end-date" value-type="Date" />
		<readsets>
			<readset name="DOMAIN">
				<member name="domain" />
			</readset>
			<readset name="IP">
				<member name="ip" />
			</readset>
		</readsets>
		<query-defs>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
					INSERT INTO

						(<FIELDS/>)
					VALUES
						(<VALUES/>)
				]]></statement>
			</query>
			<query name="find-by-domain-name-ip-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="ip" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='domain'/> = ${domain}
					<IF type='NOT_NULL' field='ip'>
						AND  <FIELD name='ip'/> = ${ip}
					</IF>
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
					ORDER BY <FIELD name='period'/> ASC
				]]></statement>
			</query>
			<query name="find-singal-by-domain-name-ip-duration" type="SELECT">
				<param name="start-date" />
				<param name="ip" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='domain'/> = ${domain}
					<IF type='NOT_NULL' field='ip'>
						AND  <FIELD name='ip'/> = ${ip}
					</IF>
					AND <FIELD name='period'/> = ${start-date}
				]]></statement>
			</query>
			<query name="find-ip-by-domain-name-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT DISTINCT
					    <FIELDS/>
					FROM

					WHERE <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
				]]></statement>
			</query>
			<query name="find-domain-by-name-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="name" />
				<statement><![CDATA[
					SELECT DISTINCT
					    <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
				]]></statement>
			</query>

			<query name="delete-by-domain-name-period-ip" type="DELETE">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<param name="ip" />
				<statement><![CDATA[
					DELETE FROM

					WHERE <FIELD name='period'/> = ${period}
					<IF type='NOT_NULL' field='domain'>
						AND <FIELD name='domain'/> = ${domain}
					</IF>
					<IF type='NOT_NULL' field='name'>
						AND <FIELD name='name'/> = ${name}
					</IF>
					<IF type='NOT_NULL' field='ip'>
						AND <FIELD name='ip'/> = ${ip}
					</IF>
				]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="dailygraph" table="dailygraph" alias="d"  class-name="DailyGraph">
		<var name="start-date" value-type="Date" />
		<var name="end-date" value-type="Date" />
		<readsets>
			<readset name="DOMAIN">
				<member name="domain" />
			</readset>
			<readset name="IP">
				<member name="ip" />
			</readset>
		</readsets>
		<query-defs>
			<query name="insert" type="INSERT">
				<statement><![CDATA[
					INSERT INTO

						(<FIELDS/>)
					VALUES
						(<VALUES/>)
				]]></statement>
			</query>
			<query name="find-by-domain-name-ip-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="ip" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='domain'/> = ${domain}
					AND  <FIELD name='ip'/> = ${ip}
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
					ORDER BY <FIELD name='period'/> ASC
				]]></statement>
			</query>
			<query name="find-by-domain-name-ip-date" type="SELECT">
				<param name="start-date" />
				<param name="ip" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='ip'/> = ${ip}
					AND <FIELD name='period'/> = ${start-date}
				]]></statement>
			</query>
			<query name="find-ip-by-domain-name-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT DISTINCT
					    <FIELDS/>
					FROM

					WHERE <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
				]]></statement>
			</query>
			<query name="find-domain-by-name-duration" type="SELECT"
				multiple="true">
				<param name="start-date" />
				<param name="end-date" />
				<param name="name" />
				<statement><![CDATA[
					SELECT DISTINCT
					    <FIELDS/>
					FROM

					WHERE <FIELD name='name'/> = ${name}
					AND <FIELD name='period'/> >= ${start-date}
					AND <FIELD name='period'/> < ${end-date}
				]]></statement>
			</query>

			<query name="delete-by-domain-name-period-ip" type="DELETE">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<param name="ip" />
				<statement><![CDATA[
					DELETE FROM

					WHERE <FIELD name='period'/> = ${period}
					<IF type='NOT_NULL' field='domain'>
						AND <FIELD name='domain'/> = ${domain}
					</IF>
					<IF type='NOT_NULL' field='name'>
						AND <FIELD name='name'/> = ${name}
					</IF>
					<IF type='NOT_NULL' field='ip'>
						AND <FIELD name='ip'/> = ${ip}
					</IF>
				]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="monthreport" table="monthreport" alias="m" class-name="MonthlyReport">
		<member name="creation-date" insert-expr="NOW()" />
		<query-defs>
			<query name="find-report-by-domain-name-period" type="SELECT">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND binary(<FIELD name='domain'/>) = binary(${domain})
					]]></statement>
			</query>
			<query name="delete-report-by-domain-name-period" type="DELETE">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					DELETE
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					]]></statement>
			</query>
		</query-defs>
	</entity>

	<entity name="weeklyreport" table="weeklyreport" alias="w" class-name="WeeklyReport">
		<member name="creation-date" insert-expr="NOW()" />
		<query-defs>
			<query name="find-report-by-domain-name-period" type="SELECT">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					SELECT <FIELDS/>
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					AND binary(<FIELD name='domain'/>) = binary(${domain})
					]]></statement>
			</query>
			<query name="delete-report-by-domain-name-period" type="DELETE">
				<param name="period" />
				<param name="domain" />
				<param name="name" />
				<statement><![CDATA[
					DELETE
					FROM

					WHERE <FIELD name='period'/> = ${period}
					AND <FIELD name='domain'/> = ${domain}
					AND <FIELD name='name'/> = ${name}
					]]></statement>
			</query>
		</query-defs>
	</entity>
	<entity name="monthly-report-content" table="monthly_report_content" alias="mrc">
	 <member name="creation-date" insert-expr="NOW()" />
	 <member name="content-length" value-type="double" all="false" select-expr="length(content)/1024/1024" length="19" nullable="false" />
	 <var name="capacity" value-type="double" />
	 <var name="start-id" value-type="int" />
	 <readsets>
		<readset name="LENGTH">
			<member name="report-id" />
			<member name="content-length" />
		</readset>
	 </readsets>
     <query-defs>
     	<query name="find-overload-report" type="SELECT" multiple="true">
			<param name="start-id" />
			<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				WHERE <FIELD name='report-id'/> > ${start-id}
				ORDER BY <FIELD name='report-id'/> asc  limit 1000
				]]></statement>
		</query>
     </query-defs>
    </entity>
    <entity name="weekly-report-content" table="weekly_report_content" alias="wrc">
	 <member name="creation-date" insert-expr="NOW()" />
	 <member name="content-length" value-type="double" all="false" select-expr="length(content)/1024/1024" length="19" nullable="false" />
	 <var name="capacity" value-type="double" />
	 <var name="start-id" value-type="int" />
	 <readsets>
		<readset name="LENGTH">
			<member name="report-id" />
			<member name="content-length" />
		</readset>
	 </readsets>
     <query-defs>
     	<query name="find-overload-report" type="SELECT" multiple="true">
			<param name="start-id" />
			<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				WHERE <FIELD name='report-id'/> > ${start-id}
				ORDER BY <FIELD name='report-id'/> asc  limit 1000
				]]></statement>
		</query>
     </query-defs>
    </entity>
    <entity name="daily-report-content" table="daily_report_content" alias="drc">
	 <member name="creation-date" insert-expr="NOW()" />
	 <member name="content-length" value-type="double" all="false" select-expr="length(content)/1024/1024" length="19" nullable="false" />
	 <var name="start-id" value-type="int" />
	 <var name="end-id" value-type="int" />
	 <var name="capacity" value-type="double" />
	 <readsets>
		<readset name="LENGTH">
			<member name="report-id" />
			<member name="content-length" />
		</readset>
	 </readsets>
     <query-defs>
     	<query name="find-overload-report" type="SELECT" multiple="true">
			<param name="start-id" />
			<statement><![CDATA[
				SELECT <FIELDS/>
				FROM

				WHERE <FIELD name='report-id'/> > ${start-id}
				ORDER BY <FIELD name='report-id'/> asc  limit 1000
				]]></statement>
		</query>
     </query-defs>
    </entity>
</entities>


text:
<tool id="Cut1" name="Cut">
  <description>columns from a table</description>
  <command interpreter="perl">cutWrapper.pl $input "$columnList" $delimiter $out_file1</command>
  <inputs>
    <param name="columnList" size="10" type="text" value="c1,c2" label="Cut columns"/>
    <param name="delimiter" type="select" label="Delimited by">
      <option value="T">Tab</option>
      <option value="Sp">Whitespace</option>
      <option value="Dt">Dot</option>
      <option value="C">Comma</option>
      <option value="D">Dash</option>
      <option value="U">Underscore</option>
      <option value="P">Pipe</option>
    </param>
    <param format="tabular" name="input" type="data" label="From"/>
  </inputs>
  <outputs>
    <data format="tabular" name="out_file1" />
  </outputs>
  <tests>
    <test>
      <param name="columnList" value="c1,c2"/>
      <param name="delimiter" value="T"/>
      <param name="input" value="1.bed"/>
      <output name="out_file1" file="eq-cut.dat"/>
    </test>
  </tests>
  <help>

.. class:: warningmark

**WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on "edit attributes" link in the latest history item (as shown at the end of this help screen).

-----

**Syntax**

Columns are specified as **c1**, **c2**, and so on. Column count begins with **1**

-----

**Example**

For the following query::

   chr1 10   1000  gene1 0 +
   chr2 100  1500  gene2 0 +

running **cut** on columns "**c1,c4,c6**" will return::

   chr1 gene1 +
   chr2 gene2 +

-----

Output of this tool looses column assignments. To make new assignments "edit attributes" of the history item generated by this tool as shown here:

.. image:: ../static/images/SetAttr.png

</help>
</tool>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Option: theme_advanced_buttons<1-n_add_before></title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />

Option: theme_advanced_buttons<1-n_add_before>

		This option should contain a comma separated list of button/control names to add to the beginning of the specified toolbar row. The number 1-n is the row number to add the buttons/controls to. Below is a list of built in controls, plugins may include other controls names that can be inserted but these are documented in the individual plugins.
		This option can only be used when theme is set to advanced and when the theme_advanced_layout_manager option is set to the default value of "SimpleLayout".

		A complete reference of all built in buttons and controls can be found in the button/control reference page.

Example of usage of the theme_advanced_buttons<1-n>_add_before option:

tinyMCE.init({
	...
	theme_advanced_buttons1_add_before : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor"
	theme_advanced_buttons2_add_before : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code"
	theme_advanced_buttons3_add_before : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
});

Index

Copyright © 2003-2006 Moxiecode Systems AB


text:
register_namespace('player.station.insanity');

player.station.insanity.add_to_playlist = function(callback) {
    $.post('/app/_/random_station/', {}, function(data){
        var name = data.name;
        if (data.type == 'tag') {
            network.lastfm.api('tag.getTopArtists', {'tag': name, 'limit': 150}, function(data) {
                var artist = util.random.choice(network.lastfm.arrayize(data.topartists.artist));
                player.station.common.play_track_by_artist(artist.name, callback);
            });
        } else {
            network.lastfm.api('artist.getSimilar', {'artist': name}, function(data) {
                var sim_artists = network.lastfm.arrayize(data.similarartists.artist);
                sim_artists.splice(0, 0, {
                    'match': 1,
                    'name': name
                });
                var sim_artist = util.random.choice(sim_artists);
                player.station.common.play_track_by_artist(sim_artist.name, callback);
            });
        }
    });
};

player.station.insanity.get_html = function(name) {
    return 'режим безумия';
};


text:
package eu.fiveminutes.ui;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TextView;

import eu.fiveminutes.R;
import eu.fiveminutes.ui.util.TypefaceUtils;

/**
 *
 */
public class TypefacedTextView extends TextView implements TypefacedView {

    public TypefacedTextView(Context context) {
        super(context);
    }

    public TypefacedTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        TypefaceUtils.extractAndApplyTypeface(this, context, attrs, R.styleable.TypefacedTextView, R.styleable.TypefacedTextView_typeface);
    }

    public TypefacedTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        TypefaceUtils.extractAndApplyTypeface(this, context, attrs, R.styleable.TypefacedTextView, R.styleable.TypefacedTextView_typeface);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public TypefacedTextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        TypefaceUtils.extractAndApplyTypeface(this, context, attrs, R.styleable.TypefacedTextView, R.styleable.TypefacedTextView_typeface);
    }
}


text:
FOUNDATION_EXPORT double LottieVersionNumber;
FOUNDATION_EXPORT const unsigned char LottieVersionString[];


text:
// ======================================================================== //
// Copyright 2009-2016 Intel Corporation                                    //
//                                                                          //
// Licensed under the Apache License, Version 2.0 (the "License");          //
// you may not use this file except in compliance with the License.         //
// You may obtain a copy of the License at                                  //
//                                                                          //
//     http://www.apache.org/licenses/LICENSE-2.0                           //
//                                                                          //
// Unless required by applicable law or agreed to in writing, software      //
// distributed under the License is distributed on an "AS IS" BASIS,        //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and      //
// limitations under the License.                                           //
// ======================================================================== //

#pragma once

#include <mutex>

namespace ospcommon {
  namespace utility {

    /* This implements a 1-to-1 value fence. One thread can set (or "queue") a
     * value for another thread to later get. This is conceptually similar to
     * "doublebuffering" a single value. Note that all values from the producer
     * thread overwrite the "queued" value, where the consumer thread will
     * always get the last value set by the producer thread.
     */
    template <typename T>
    class TransactionalValue
    {
    public:

      TransactionalValue()  = default;
      ~TransactionalValue() = default;

      template <typename OtherType>
      TransactionalValue(const OtherType &ot);

      template <typename OtherType>
      TransactionalValue& operator=(const OtherType &ot);

      TransactionalValue<T>& operator=(const TransactionalValue<T>& fp);

      T &ref();
      T  get();

      bool update();

    private:

      bool newValue {false};
      T queuedValue;
      T currentValue;

      std::mutex mutex;
    };

    // Inlined TransactionalValue Members /////////////////////////////////////

    template <typename T>
    template <typename OtherType>
    inline TransactionalValue<T>::TransactionalValue(const OtherType &ot)
    {
      currentValue = ot;
    }

    template <typename T>
    template <typename OtherType>
    inline TransactionalValue<T> &
    TransactionalValue<T>::operator=(const OtherType &ot)
    {
      std::lock_guard<std::mutex> lock{mutex};
      queuedValue = ot;
      newValue    = true;
      return *this;
    }

    template <typename T>
    inline TransactionalValue<T> &
    TransactionalValue<T>::operator=(const TransactionalValue<T> &fp)
    {
      std::lock_guard<std::mutex> lock{mutex};
      queuedValue = fp.ref();
      newValue    = true;
      return *this;
    }

    template<typename T>
    inline T &TransactionalValue<T>::ref()
    {
      return currentValue;
    }

    template<typename T>
    inline T TransactionalValue<T>::get()
    {
      return currentValue;
    }

    template<typename T>
    inline bool TransactionalValue<T>::update()
    {
      bool didUpdate = false;
      if (newValue) {
        std::lock_guard<std::mutex> lock{mutex};
        currentValue = std::move(queuedValue);
        newValue     = false;
        didUpdate    = true;
      }

      return didUpdate;
    }

  } // ::ospcommon::utility
} // ::ospcommon


text:
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

// Common Data

const WORD IDC_LOADLIB = 1001;
HINSTANCE hInstance = NULL;
HWND hButton = NULL;
HMODULE hRunTime = NULL;
RUNTIMEFUNCPTR RunTime_Function = NULL;

// Window Procedure

LRESULT CALLBACK WindowProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uiMsg)
	{
	case WM_CREATE:
		hButton = CreateWindow(
			TEXT("BUTTON"), TEXT("Load Library"),
			WS_VISIBLE | WS_CHILD,
			16, 16 + 48, 240, 30,
			hWnd, (HMENU)IDC_LOADLIB, hInstance, NULL);
		break;

	case WM_PAINT:
	{
		PAINTSTRUCT ps = { 0 };
		HDC hdc = BeginPaint(hWnd, &ps);

		int iTextLen = 0;
		TCHAR szText[1024] = { 0 };

		iTextLen = _stprintf_s(szText, TEXT("Load-Time Result: %s"), LoadTime_Function(3.1415f));
		TextOut(hdc, 16, 16, szText, iTextLen);
		iTextLen = _stprintf_s(szText, TEXT("Run-Time Result: %s"), RunTime_Function ? RunTime_Function(3.1415f) : TEXT("Not loaded!"));
		TextOut(hdc, 16, 16 + 24, szText, iTextLen);

		EndPaint(hWnd, &ps);
	}
	return 0;

	case WM_COMMAND:
		if (LOWORD(wParam) == IDC_LOADLIB && HIWORD(wParam) == BN_CLICKED)
		{
			if (hRunTime)
			{
				RunTime_Function = NULL;
				FreeLibrary(hRunTime);
				hRunTime = NULL;
			}
			else
			{
				hRunTime = LoadLibrary(TEXT("RunTime.dll"));
				if (hRunTime)
					RunTime_Function = (RUNTIMEFUNCPTR)GetProcAddress(hRunTime, "RunTime_Function");
			}
			SetWindowText(hButton, hRunTime ? TEXT("Free Library") : TEXT("Load Library"));
			InvalidateRect(hWnd, NULL, TRUE);
		}
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;
	}

	return DefWindowProc(hWnd, uiMsg, wParam, lParam);
}

// Entry Point

int CALLBACK WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow)
{
	hInstance = hInst;

	WNDCLASSEX wcx = { 0 };
	wcx.cbSize = sizeof(WNDCLASSEX);
	wcx.style = CS_HREDRAW | CS_VREDRAW;
	wcx.lpfnWndProc = WindowProc;
	wcx.hInstance = hInstance;
	wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
	wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
	wcx.lpszClassName = TEXT("SomeClassName");
	if (RegisterClassEx(&wcx) == 0)
		return 1;

	HWND hWnd = CreateWindowEx(0,
		TEXT("SomeClassName"),
		TEXT("DLL Sample"),
		WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, 0,
		CW_USEDEFAULT, 0,
		NULL, NULL, hInstance, 0);
	if (NULL == hWnd)
		return 2;

	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);

	MSG msg = { 0 };
	while (GetMessage(&msg, NULL, 0, 0))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	return 0;
}


text: This is a Xamarin (C#) port of the Android (Java) project "Android-Iconics" by Mike Penz


text:
param(
[string]$CrmConnectionString,
[string]$UniqueName,
[string]$DisplayName,
[string]$PublisherUniqueName,
[string]$VersionNumber = '1.0.0.0',
[string]$Description = '',
[int]$Timeout #Optional - CRM connection timeout
)

$ErrorActionPreference = "Stop"

Write-Verbose 'Entering CreateSolution.ps1'

#Parameters
Write-Verbose "CrmConnectionString = $CrmConnectionString"
Write-Verbose "UniqueName = $UniqueName"
Write-Verbose "DisplayName = $DisplayName"
Write-Verbose "PublisherUniqueName = $PublisherUniqueName"
Write-Verbose "VersionNumber = $VersionNumber"
Write-Verbose "Description = $Description"
Write-Verbose "Timeout = $Timeout"

#Script Location
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Write-Verbose "Script Path: $scriptPath"

#Load XrmCIFramework
$xrmCIToolkit = $scriptPath + "\Xrm.Framework.CI.PowerShell.Cmdlets.dll"
Write-Verbose "Importing CIToolkit: $xrmCIToolkit"
Import-Module $xrmCIToolkit
Write-Verbose "Imported CIToolkit"

Write-Verbose "Creating Solution: $DisplayName"

$SolutionParams = @{
	ConnectionString = $CrmConnectionString
	UniqueName = $UniqueName
	DisplayName = $DisplayName
	PublisherUniqueName = $PublisherUniqueName
	VersionNumber = $VersionNumber
	Description = $Description
	Timeout = $Timeout
}

$solutionId = Add-XrmSolution @SolutionParams

Write-Host ("Solution Created with Id: {0}" -f $solutionId)

Write-Verbose 'Leaving CreateSolution.ps1'


text:
class EagerLoad
  def initialize(association)
    @association = association
  end

  def matches?(target)
    @target = target
    @target.default_scopes.select do |scope|
      scope[:include] == @association
    end.present?
  end

  def failure_message
    "expected #{@target.class.name} to eager load #{@association}"
  end

  def failure_message_when_negated
    "expected #{@target.class.name} to not eager load #{@association}"
  end
end

def eager_load(expected)
  EagerLoad.new(expected)
end


text:
namespace iTin.Export
{
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.IO;
    using System.Linq;

    using Helpers;

    ///
    /// Static class than contains extension methods for objects of type <see cref="T:System.IO.Stream" />.
    ///
    public static class StreamExtensions
    {
        #region public static methods

        #region [public] {static} (byte[]) AsByteArray(this Stream): Returns stream input as byte array
        ///
        /// Returns stream input as byte array.
        ///
        /// <param name="stream">Stream to convert.</param>
        /// <returns>
        /// Array of byte that represent the input stream.
        /// </returns>
        public static byte[] AsByteArray(this Stream stream)
        {
            SentinelHelper.ArgumentNull(stream);

            return AsByteArray(stream, false);
        }
        #endregion

        #region [public] {static} (byte[]) AsByteArray(this Stream, bool): Returns stream input as byte array
        ///
        /// Returns stream input as byte array.
        ///
        /// <param name="stream">Stream to convert.</param>
        /// <param name="closeAfter">if set to true close stream after convert it.</param>
        /// <returns>
        /// Array of byte that represent the input stream.
        /// </returns>
        public static byte[] AsByteArray(this Stream stream, bool closeAfter)
        {
            SentinelHelper.ArgumentNull(stream);

            var buffer = new byte[stream.Length];
            var position = stream.Position;

            stream.Seek(0L, SeekOrigin.Begin);
            stream.Read(buffer, 0, (int)stream.Length);
            stream.Seek(position, SeekOrigin.Begin);

            if (closeAfter)
            {
                stream.Close();
            }

            return buffer;
        }
        #endregion

        #region [public] {static} (Stream) Clone(this Stream): Create a new object that is a copy of specified instance
        ///
        /// Create a new object that is a copy of the current instance.
        ///
        /// <param name="stream">Stream to clone.</param>
        /// <returns>
        /// A new <see cref="T:System.IO.Stream" /> that is a copy of specified instance.
        /// </returns>
        public static Stream Clone(this Stream stream)
        {
            SentinelHelper.ArgumentNull(stream, nameof(stream));

            var ms = new MemoryStream();
            stream.CopyTo(ms);
            ms.Position = 0;

            return ms;
        }
        #endregion

        #region [public] {static} (IEnumerable<Stream>) Clone(this IEnumerable<Stream>): Create a new object that is a copy of specified instance
        ///
        /// Create a new object that is a copy of the current instance.
        ///
        /// <param name="items">Stream to clone.</param>
        /// <returns>
        /// A new <see cref="T:System.IO.Stream" /> that is a copy of specified instance.
        /// </returns>
        public static IEnumerable<Stream> Clone(this IEnumerable<Stream> items)
        {
            IList<Stream> streamList = items as IList<Stream> ?? items.ToList();
            SentinelHelper.ArgumentNull(streamList, nameof(items));

            List<Stream> clonedList = streamList.Select(item => item.Clone()).ToList();

            return clonedList;
        }
        #endregion

        #region [public] {static} (void) SaveToFile(this Stream, string): Saves this stream into file
        ///
        /// Saves this memory stream into file
        ///
        /// <param name="stream">Stream to save.</param>
        /// <param name="fileName">Destination file.</param>
        public static void SaveToFile(this Stream stream, string fileName)
        {
            SentinelHelper.ArgumentNull(stream);
            SentinelHelper.IsTrue(string.IsNullOrEmpty(fileName));

            var memoryStream = stream as MemoryStream ?? stream.ToMemoryStream();
            memoryStream.SaveToFile(fileName);
        }
        #endregion

        #region [public] {static} (MemoryStream) ToMemoryStream(this Stream): Convert a Stream into MemoryStream
        ///
        /// Convert a <see cref="T:System.IO.Stream" /> into <see cref="T:System.IO.MemoryStream" />.
        ///
        /// <param name="stream">The stream.</param>
        /// <returns>
        /// A <see cref="T:System.IO.MemoryStream" /> with content of a <see cref="T:System.IO.Stream" />.
        /// </returns>
        [SuppressMessage("Microsoft.Reliability", "CA2000:Eliminar (Dispose) objetos antes de perder el ámbito")]
        public static MemoryStream ToMemoryStream(this Stream stream)
        {
            SentinelHelper.ArgumentNull(stream);

            MemoryStream resultStream;
            MemoryStream tempStream = null;

            try
            {
                tempStream = new MemoryStream();
                tempStream.SetLength(stream.Length);
                stream.Read(tempStream.GetBuffer(), 0, (int)stream.Length);
                tempStream.Flush();

                resultStream = tempStream;
                tempStream = null;
            }
            finally
            {
                if (tempStream != null)
                {
                    tempStream.Dispose();
                }
            }

            return resultStream;
        }
    #endregion

        #endregion

        #region private static methods

        #region [private] {static} (void) SaveToFile(MemoryStream, string): Saves this memory stream into file
        ///
        /// Saves this memory stream into file
        ///
        /// <param name="stream">Stream to save.</param>
        /// <param name="fileName">Destination file.</param>
        private static void SaveToFile(this MemoryStream stream, string fileName)
        {
            using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                stream.WriteTo(fs);
            }
        }
        #endregion

        #endregion
    }
}


text: Rails.application.config.session_store :cookie_store, key: '_zebra_session'


text:
import React, { Component } from 'react';
import {
  Navbar,
  Nav,
  NavItem,
  Grid,
  Row,
  Col,
  MenuItem,
  FormGroup,
  FormControl,
  Button,
  NavDropdown,
  Image,
} from 'react-bootstrap';

import './Template.css';

class Template extends Component {
  render() {
    return (

        <Navbar fixedTop={true}>
          <Navbar.Header>
            <Navbar.Brand>

                Mioritic

            </Navbar.Brand>
            <Navbar.Toggle/>
          </Navbar.Header>
          <Navbar.Collapse>

              <NavDropdown eventKey={1} title="Introducere" id="intro">
                <MenuItem eventKey={1.1}>Acasă</MenuItem>
                <MenuItem eventKey={1.2}>Despre noi</MenuItem>
                <MenuItem eventKey={1.3}>Comunitate</MenuItem>
                <MenuItem eventKey={1.4}>Ajutor</MenuItem>
              </NavDropdown>
              <NavItem eventKey={2} href="/catalog">
                Catalog cursuri
              </NavItem>

            <Navbar.Form className="search-box">
              <FormGroup>
                <FormControl type="text" placeholder="Cauta" />
              </FormGroup>
              {' '}
              <Button type="submit">Submit</Button>
            </Navbar.Form>

              <NavItem eventKey={1} href="/profile">
                <Image src="/img/profile.jpg" circle className="profile-nav"/>
              </NavItem>

          </Navbar.Collapse>
        </Navbar>
        <Grid className="page-container">
          <Row>
            <Col>{this.props.children}</Col>
          </Row>
        </Grid>
        <Navbar className="footer">
          <Navbar.Text>
            Copyright Mioritic 2017
          </Navbar.Text>
        </Navbar>

    );
  }
}

export default Template;


text:
package client

import (
	"golang.org/x/net/context"
)

type clientKey struct{}

func FromContext(ctx context.Context) (Client, bool) {
	c, ok := ctx.Value(clientKey{}).(Client)
	return c, ok
}

func NewContext(ctx context.Context, c Client) context.Context {
	return context.WithValue(ctx, clientKey{}, c)
}