code stringlengths 4 1.01M | language stringclasses 2 values |
|---|---|
/*
* The MIT License
*
* Copyright 2015 Adam Kowalewski.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.adamkowalewski.opw.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Adam Kowalewski
*/
@Entity
@Table(name = "opw_link", catalog = "opw", schema = "")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "OpwLink.findAll", query = "SELECT o FROM OpwLink o"),
@NamedQuery(name = "OpwLink.findById", query = "SELECT o FROM OpwLink o WHERE o.id = :id"),
@NamedQuery(name = "OpwLink.findByLabel", query = "SELECT o FROM OpwLink o WHERE o.label = :label"),
@NamedQuery(name = "OpwLink.findByUrl", query = "SELECT o FROM OpwLink o WHERE o.url = :url"),
@NamedQuery(name = "OpwLink.findByComment", query = "SELECT o FROM OpwLink o WHERE o.comment = :comment"),
@NamedQuery(name = "OpwLink.findByActive", query = "SELECT o FROM OpwLink o WHERE o.active = :active"),
@NamedQuery(name = "OpwLink.findByDateCreated", query = "SELECT o FROM OpwLink o WHERE o.dateCreated = :dateCreated")})
public class OpwLink implements Serializable {
@Column(name = "dateCreated")
@Temporal(TemporalType.TIMESTAMP)
private Date dateCreated;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id", nullable = false)
private Integer id;
@Size(max = 128)
@Column(name = "label", length = 128)
private String label;
@Size(max = 256)
@Column(name = "url", length = 256)
private String url;
@Size(max = 256)
@Column(name = "comment", length = 256)
private String comment;
@Column(name = "active")
private Boolean active;
@JoinColumn(name = "opw_user_id", referencedColumnName = "id", nullable = false)
@ManyToOne(optional = false)
private OpwUser opwUserId;
@JoinColumn(name = "opw_wynik_id", referencedColumnName = "id", nullable = false)
@ManyToOne(optional = false)
private OpwWynik opwWynikId;
public OpwLink() {
}
public OpwLink(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
public OpwUser getOpwUserId() {
return opwUserId;
}
public void setOpwUserId(OpwUser opwUserId) {
this.opwUserId = opwUserId;
}
public OpwWynik getOpwWynikId() {
return opwWynikId;
}
public void setOpwWynikId(OpwWynik opwWynikId) {
this.opwWynikId = opwWynikId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof OpwLink)) {
return false;
}
OpwLink other = (OpwLink) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.adamkowalewski.opw.entity.OpwLink[ id=" + id + " ]";
}
public Date getDateCreated() {
return dateCreated;
}
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}
}
| Java |
<?php
namespace MF\QueryBuilderComposer;
use Doctrine\ORM\QueryBuilder;
interface Modifier
{
public function __invoke(QueryBuilder $queryBuilder): QueryBuilder;
}
| Java |
package backup
// 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/tracing"
"net/http"
)
// ProtectionPolicyOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service
type ProtectionPolicyOperationStatusesClient struct {
BaseClient
}
// NewProtectionPolicyOperationStatusesClient creates an instance of the ProtectionPolicyOperationStatusesClient
// client.
func NewProtectionPolicyOperationStatusesClient(subscriptionID string) ProtectionPolicyOperationStatusesClient {
return NewProtectionPolicyOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProtectionPolicyOperationStatusesClientWithBaseURI creates an instance of the
// ProtectionPolicyOperationStatusesClient 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 NewProtectionPolicyOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationStatusesClient {
return ProtectionPolicyOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get provides the status of the asynchronous operations like backup, restore. The status can be in progress,
// completed
// or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations
// create jobs. This method returns the list of jobs associated with operation.
// Parameters:
// vaultName - the name of the recovery services vault.
// resourceGroupName - the name of the resource group where the recovery services vault is present.
// policyName - backup policy name whose operation's status needs to be fetched.
// operationID - operation ID which represents an operation whose status needs to be fetched.
func (client ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result OperationStatus, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyOperationStatusesClient.Get")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName, operationID)
if err != nil {
err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure responding to request")
return
}
return
}
// GetPreparer prepares the Get request.
func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"operationId": autorest.Encode("path", operationID),
"policyName": autorest.Encode("path", policyName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2021-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
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 ProtectionPolicyOperationStatusesClient) 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 ProtectionPolicyOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
| Java |
package servicebus
// 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"
)
// QueuesClient is the client for the Queues methods of the Servicebus service.
type QueuesClient struct {
BaseClient
}
// NewQueuesClient creates an instance of the QueuesClient client.
func NewQueuesClient(subscriptionID string) QueuesClient {
return NewQueuesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewQueuesClientWithBaseURI creates an instance of the QueuesClient 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 NewQueuesClientWithBaseURI(baseURI string, subscriptionID string) QueuesClient {
return QueuesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates or updates a Service Bus queue. This operation is idempotent.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// parameters - parameters supplied to create or update a queue resource.
func (client QueuesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue) (result SBQueue, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.CreateOrUpdate")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "CreateOrUpdate", err.Error())
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, queueName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdate", resp, "Failure responding to request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client QueuesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue) (*http.Request, error) {
pathParameters := map[string]interface{}{
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
parameters.SystemData = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client QueuesClient) CreateOrUpdateResponder(resp *http.Response) (result SBQueue, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// CreateOrUpdateAuthorizationRule creates an authorization rule for a queue.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// authorizationRuleName - the authorization rule name.
// parameters - the shared access authorization rule.
func (client QueuesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.CreateOrUpdateAuthorizationRule")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: authorizationRuleName,
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule", err.Error())
}
req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateAuthorizationRuleSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateAuthorizationRuleResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure responding to request")
return
}
return
}
// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
func (client QueuesClient) CreateOrUpdateAuthorizationRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
parameters.SystemData = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateAuthorizationRuleSender sends the CreateOrUpdateAuthorizationRule request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) CreateOrUpdateAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
// closes the http.Response Body.
func (client QueuesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a queue from the specified namespace in a resource group.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
func (client QueuesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result autorest.Response, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "Delete", err.Error())
}
req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, queueName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Delete", resp, "Failure responding to request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client QueuesClient) DeletePreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
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 QueuesClient) 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 QueuesClient) 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
}
// DeleteAuthorizationRule deletes a queue authorization rule.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// authorizationRuleName - the authorization rule name.
func (client QueuesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result autorest.Response, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.DeleteAuthorizationRule")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: authorizationRuleName,
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "DeleteAuthorizationRule", err.Error())
}
req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "DeleteAuthorizationRule", nil, "Failure preparing request")
return
}
resp, err := client.DeleteAuthorizationRuleSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "DeleteAuthorizationRule", resp, "Failure sending request")
return
}
result, err = client.DeleteAuthorizationRuleResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "DeleteAuthorizationRule", resp, "Failure responding to request")
return
}
return
}
// DeleteAuthorizationRulePreparer prepares the DeleteAuthorizationRule request.
func (client QueuesClient) DeleteAuthorizationRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteAuthorizationRuleSender sends the DeleteAuthorizationRule request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) DeleteAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// DeleteAuthorizationRuleResponder handles the response to the DeleteAuthorizationRule request. The method always
// closes the http.Response Body.
func (client QueuesClient) DeleteAuthorizationRuleResponder(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 returns a description for the specified queue.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
func (client QueuesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result SBQueue, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "Get", err.Error())
}
req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, queueName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "Get", resp, "Failure responding to request")
return
}
return
}
// GetPreparer prepares the Get request.
func (client QueuesClient) GetPreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
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 QueuesClient) 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 QueuesClient) GetResponder(resp *http.Response) (result SBQueue, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetAuthorizationRule gets an authorization rule for a queue by rule name.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// authorizationRuleName - the authorization rule name.
func (client QueuesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result SBAuthorizationRule, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.GetAuthorizationRule")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: authorizationRuleName,
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "GetAuthorizationRule", err.Error())
}
req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "GetAuthorizationRule", nil, "Failure preparing request")
return
}
resp, err := client.GetAuthorizationRuleSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "GetAuthorizationRule", resp, "Failure sending request")
return
}
result, err = client.GetAuthorizationRuleResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "GetAuthorizationRule", resp, "Failure responding to request")
return
}
return
}
// GetAuthorizationRulePreparer prepares the GetAuthorizationRule request.
func (client QueuesClient) GetAuthorizationRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetAuthorizationRuleSender sends the GetAuthorizationRule request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) GetAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
// closes the http.Response Body.
func (client QueuesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListAuthorizationRules gets all authorization rules for a queue.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
func (client QueuesClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result SBAuthorizationRuleListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.ListAuthorizationRules")
defer func() {
sc := -1
if result.sarlr.Response.Response != nil {
sc = result.sarlr.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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "ListAuthorizationRules", err.Error())
}
result.fn = client.listAuthorizationRulesNextResults
req, err := client.ListAuthorizationRulesPreparer(ctx, resourceGroupName, namespaceName, queueName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAuthorizationRules", nil, "Failure preparing request")
return
}
resp, err := client.ListAuthorizationRulesSender(req)
if err != nil {
result.sarlr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAuthorizationRules", resp, "Failure sending request")
return
}
result.sarlr, err = client.ListAuthorizationRulesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAuthorizationRules", resp, "Failure responding to request")
return
}
if result.sarlr.hasNextLink() && result.sarlr.IsEmpty() {
err = result.NextWithContext(ctx)
return
}
return
}
// ListAuthorizationRulesPreparer prepares the ListAuthorizationRules request.
func (client QueuesClient) ListAuthorizationRulesPreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListAuthorizationRulesSender sends the ListAuthorizationRules request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) ListAuthorizationRulesSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
// closes the http.Response Body.
func (client QueuesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SBAuthorizationRuleListResult, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listAuthorizationRulesNextResults retrieves the next set of results, if any.
func (client QueuesClient) listAuthorizationRulesNextResults(ctx context.Context, lastResults SBAuthorizationRuleListResult) (result SBAuthorizationRuleListResult, err error) {
req, err := lastResults.sBAuthorizationRuleListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listAuthorizationRulesNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListAuthorizationRulesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listAuthorizationRulesNextResults", resp, "Failure sending next results request")
}
result, err = client.ListAuthorizationRulesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listAuthorizationRulesNextResults", resp, "Failure responding to next results request")
}
return
}
// ListAuthorizationRulesComplete enumerates all values, automatically crossing page boundaries as required.
func (client QueuesClient) ListAuthorizationRulesComplete(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result SBAuthorizationRuleListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.ListAuthorizationRules")
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.ListAuthorizationRules(ctx, resourceGroupName, namespaceName, queueName)
return
}
// ListByNamespace gets the queues within a namespace.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// skip - skip is only used if a previous operation returned a partial result. If a previous response contains
// a nextLink element, the value of the nextLink element will include a skip parameter that specifies a
// starting point to use for subsequent calls.
// top - may be used to limit the number of results to the most recent N usageDetails.
func (client QueuesClient) ListByNamespace(ctx context.Context, resourceGroupName string, namespaceName string, skip *int32, top *int32) (result SBQueueListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.ListByNamespace")
defer func() {
sc := -1
if result.sqlr.Response.Response != nil {
sc = result.sqlr.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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: skip,
Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil},
{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
}}}},
{TargetValue: top,
Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil},
{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
}}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "ListByNamespace", err.Error())
}
result.fn = client.listByNamespaceNextResults
req, err := client.ListByNamespacePreparer(ctx, resourceGroupName, namespaceName, skip, top)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", nil, "Failure preparing request")
return
}
resp, err := client.ListByNamespaceSender(req)
if err != nil {
result.sqlr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure sending request")
return
}
result.sqlr, err = client.ListByNamespaceResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure responding to request")
return
}
if result.sqlr.hasNextLink() && result.sqlr.IsEmpty() {
err = result.NextWithContext(ctx)
return
}
return
}
// ListByNamespacePreparer prepares the ListByNamespace request.
func (client QueuesClient) ListByNamespacePreparer(ctx context.Context, resourceGroupName string, namespaceName string, skip *int32, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"namespaceName": autorest.Encode("path", namespaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if skip != nil {
queryParameters["$skip"] = autorest.Encode("query", *skip)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListByNamespaceSender sends the ListByNamespace request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) ListByNamespaceSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListByNamespaceResponder handles the response to the ListByNamespace request. The method always
// closes the http.Response Body.
func (client QueuesClient) ListByNamespaceResponder(resp *http.Response) (result SBQueueListResult, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listByNamespaceNextResults retrieves the next set of results, if any.
func (client QueuesClient) listByNamespaceNextResults(ctx context.Context, lastResults SBQueueListResult) (result SBQueueListResult, err error) {
req, err := lastResults.sBQueueListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listByNamespaceNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByNamespaceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listByNamespaceNextResults", resp, "Failure sending next results request")
}
result, err = client.ListByNamespaceResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "listByNamespaceNextResults", resp, "Failure responding to next results request")
}
return
}
// ListByNamespaceComplete enumerates all values, automatically crossing page boundaries as required.
func (client QueuesClient) ListByNamespaceComplete(ctx context.Context, resourceGroupName string, namespaceName string, skip *int32, top *int32) (result SBQueueListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.ListByNamespace")
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.ListByNamespace(ctx, resourceGroupName, namespaceName, skip, top)
return
}
// ListKeys primary and secondary connection strings to the queue.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// authorizationRuleName - the authorization rule name.
func (client QueuesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result AccessKeys, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.ListKeys")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: authorizationRuleName,
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "ListKeys", err.Error())
}
req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListKeys", nil, "Failure preparing request")
return
}
resp, err := client.ListKeysSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListKeys", resp, "Failure sending request")
return
}
result, err = client.ListKeysResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListKeys", resp, "Failure responding to request")
return
}
return
}
// ListKeysPreparer prepares the ListKeys request.
func (client QueuesClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListKeysSender sends the ListKeys request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) ListKeysSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListKeysResponder handles the response to the ListKeys request. The method always
// closes the http.Response Body.
func (client QueuesClient) ListKeysResponder(resp *http.Response) (result AccessKeys, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// RegenerateKeys regenerates the primary or secondary connection strings to the queue.
// Parameters:
// resourceGroupName - name of the Resource group within the Azure subscription.
// namespaceName - the namespace name
// queueName - the queue name.
// authorizationRuleName - the authorization rule name.
// parameters - parameters supplied to regenerate the authorization rule.
func (client QueuesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/QueuesClient.RegenerateKeys")
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}}},
{TargetValue: namespaceName,
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
{TargetValue: queueName,
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: authorizationRuleName,
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
return result, validation.NewError("servicebus.QueuesClient", "RegenerateKeys", err.Error())
}
req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "RegenerateKeys", nil, "Failure preparing request")
return
}
resp, err := client.RegenerateKeysSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "RegenerateKeys", resp, "Failure sending request")
return
}
result, err = client.RegenerateKeysResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "RegenerateKeys", resp, "Failure responding to request")
return
}
return
}
// RegenerateKeysPreparer prepares the RegenerateKeys request.
func (client QueuesClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
"namespaceName": autorest.Encode("path", namespaceName),
"queueName": autorest.Encode("path", queueName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2021-06-01-preview"
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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// RegenerateKeysSender sends the RegenerateKeys request. The method will close the
// http.Response Body if it receives an error.
func (client QueuesClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always
// closes the http.Response Body.
func (client QueuesClient) RegenerateKeysResponder(resp *http.Response) (result AccessKeys, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
| Java |
<?php
return array (
'id' => 'docomo_n2701c_ver1',
'fallback' => 'docomo_generic_jap_ver2',
'capabilities' =>
array (
'columns' => '11',
'max_image_width' => '121',
'rows' => '11',
'resolution_width' => '176',
'resolution_height' => '198',
'max_image_height' => '190',
'flash_lite_version' => '',
),
);
| Java |
<?php
namespace HMLB\Date\Tests\Localization;
/*
* This file is part of the Date package.
*
* (c) Hugues Maignol <hugues@hmlb.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use HMLB\Date\Date;
use HMLB\Date\Tests\AbstractTestCase;
class ItTest extends AbstractTestCase
{
public function testDiffForHumansLocalizedInItalian()
{
Date::setLocale('it');
$scope = $this;
$this->wrapWithTestNow(
function () use ($scope) {
$d = Date::now()->addYear();
$scope->assertSame('1 anno da adesso', $d->diffForHumans());
$d = Date::now()->addYears(2);
$scope->assertSame('2 anni da adesso', $d->diffForHumans());
}
);
}
}
| Java |
// http://www.w3.org/2010/05/video/mediaevents.html
var poppy = popcorn( [ vid_elem_ref | 'id_string' ] );
poppy
// pass-through video control methods
.load()
.play()
.pause()
// property setters
.currentTime( time ) // skip forward or backwards `time` seconds
.playbackRate( rate )
.volume( delta )
.mute( [ state ] )
// sugar?
.rewind() // to beginning + stop??
.loop( [ state ] ) // toggle looping
// queuing (maybe unnecessary):
// enqueue method w/ optional args
.queue( 'method', args )
// enqueue arbitrary callback
.queue(function(next){ /* do stuff */ next(); })
// clear the queue
.clearQueue()
// execute arbitrary code @ time
poppy.exec( 1.23, function(){
// exec code
});
// plugin factory sample
popcorn.plugin( 'myPlugin' [, super_plugin ], init_options );
// call plugin (defined above)
poppy.myPlugin( time, options );
// define subtitle plugin
popcorn.plugin( 'subtitle', {
});
poppy
.subtitle( 1.5, {
html: '<p>SUPER AWESOME MEANING</p>',
duration: 5
})
.subtitle({
start: 1.5,
end: 6.5,
html: '<p>SUPER AWESOME MEANING</p>'
})
.subtitle([
{
start: 1.5,
html: '<p>SUPER AWESOME MEANING</p>'
},
{
start: 2.5,
end: 3.5,
html: '<p>OTHER NEAT TEXT</p>'
}
])
.data([
{
subtitle: [
{
start: 1.5,
html: '<p>SUPER AWESOME MEANING</p>'
},
{
start: 2.5,
end: 3.5,
html: '<p>OTHER NEAT TEXT</p>'
}
]
}
]);
// jQuery-dependent plugin, using $.ajax - extend popcorn.data
popcorn.plugin( 'data', popcorn.data, {
_setup: function( options ) {
// called when plugin is first registered (?)
},
_add: function( options ) {
// called when popcorn.data is called
// this == plugin (?)
if ( typeof options === 'string' ) {
$.ajax({
url: options
// stuff
});
} else {
return this.super.data.apply( this, arguments );
}
}
});
poppy.data( '/data.php' ) // data.php returns JSON?
/*
poppy.twitter( dom_elem | 'id_of_dom_elem', options ); // multiple twitters?? FAIL
poppy.twitter( 'load', options );
*/
var widget1 = $(dom_elem).twitter( options ); // ui widget factory initializes twitter widget
poppy.jQuery( 5.9, {
elem: widget1,
method: 'twitter',
args: [ 'search', '@cowboy' ]
})
poppy.jQuery( time, selector, methodname [, args... ] );
poppy.jQuery( 5.9, widget1, 'twitter', 'search', '@cowboy' );
poppy.jQuery( 5.9, '.div', 'css', 'color', 'red' );
poppy.jQuery( 5.9, '#form', 'submit' );
// sugar methods for jQuery
$(selector).popcorn( time, methodname [, args... ] );
$(selector).popcorn( time, fn );
// another idea, using jQuery special events api
$(selector).bind( 'popcorn', { time: 5.9 }, function(e){
$(this).css( 'color', 'red' );
});
// does $.fn[ methodname ].apply( $(selector), args );
| Java |
/*
_____ __ _____________ _______ ______ ___________
/ \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /____/| __(____ /__| /____ >\___ >__|
\/ |__| \/ \/ \/
Copyright (C) 2004 - 2020 Ingo Berg
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if defined(MUPARSER_DLL)
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#endif
#include <cassert>
#include "muParserDLL.h"
#include "muParser.h"
#include "muParserInt.h"
#include "muParserError.h"
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 26812)
#endif
#define MU_TRY \
try \
{
#define MU_CATCH \
} \
catch (muError_t &e) \
{ \
ParserTag *pTag = static_cast<ParserTag*>(a_hParser); \
pTag->exc = e; \
pTag->bError = true; \
if (pTag->errHandler) \
(pTag->errHandler)(a_hParser); \
} \
catch (...) \
{ \
ParserTag *pTag = static_cast<ParserTag*>(a_hParser); \
pTag->exc = muError_t(mu::ecINTERNAL_ERROR); \
pTag->bError = true; \
if (pTag->errHandler) \
(pTag->errHandler)(a_hParser); \
}
/** \file
\brief This file contains the implementation of the DLL interface of muparser.
*/
typedef mu::ParserBase::exception_type muError_t;
typedef mu::ParserBase muParser_t;
int g_nBulkSize;
class ParserTag
{
public:
ParserTag(int nType)
: pParser((nType == muBASETYPE_FLOAT)
? (mu::ParserBase*)new mu::Parser()
: (nType == muBASETYPE_INT) ? (mu::ParserBase*)new mu::ParserInt() : nullptr)
, exc()
, errHandler(nullptr)
, bError(false)
, m_nParserType(nType)
{}
~ParserTag()
{
delete pParser;
}
mu::ParserBase* pParser;
mu::ParserBase::exception_type exc;
muErrorHandler_t errHandler;
bool bError;
private:
ParserTag(const ParserTag& ref);
ParserTag& operator=(const ParserTag& ref);
int m_nParserType;
};
static muChar_t s_tmpOutBuf[2048];
//---------------------------------------------------------------------------
//
//
// unexported functions
//
//
//---------------------------------------------------------------------------
inline muParser_t* AsParser(muParserHandle_t a_hParser)
{
return static_cast<ParserTag*>(a_hParser)->pParser;
}
inline ParserTag* AsParserTag(muParserHandle_t a_hParser)
{
return static_cast<ParserTag*>(a_hParser);
}
#if defined(_WIN32)
BOOL APIENTRY DllMain(HANDLE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#endif
//---------------------------------------------------------------------------
//
//
// exported functions
//
//
//---------------------------------------------------------------------------
API_EXPORT(void) mupSetVarFactory(muParserHandle_t a_hParser, muFacFun_t a_pFactory, void* pUserData)
{
MU_TRY
muParser_t* p(AsParser(a_hParser));
p->SetVarFactory(a_pFactory, pUserData);
MU_CATCH
}
/** \brief Create a new Parser instance and return its handle. */
API_EXPORT(muParserHandle_t) mupCreate(int nBaseType)
{
switch (nBaseType)
{
case muBASETYPE_FLOAT: return (void*)(new ParserTag(muBASETYPE_FLOAT));
case muBASETYPE_INT: return (void*)(new ParserTag(muBASETYPE_INT));
default: return nullptr;
}
}
/** \brief Release the parser instance related with a parser handle. */
API_EXPORT(void) mupRelease(muParserHandle_t a_hParser)
{
MU_TRY
ParserTag* p = static_cast<ParserTag*>(a_hParser);
delete p;
MU_CATCH
}
API_EXPORT(const muChar_t*) mupGetVersion(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
#ifndef _UNICODE
sprintf(s_tmpOutBuf, "%s", p->GetVersion().c_str());
#else
wsprintf(s_tmpOutBuf, _T("%s"), p->GetVersion().c_str());
#endif
return s_tmpOutBuf;
MU_CATCH
return _T("");
}
/** \brief Evaluate the expression. */
API_EXPORT(muFloat_t) mupEval(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
return p->Eval();
MU_CATCH
return 0;
}
API_EXPORT(muFloat_t*) mupEvalMulti(muParserHandle_t a_hParser, int* nNum)
{
MU_TRY
if (nNum == nullptr)
throw std::runtime_error("Argument is null!");
muParser_t* const p(AsParser(a_hParser));
return p->Eval(*nNum);
MU_CATCH
return 0;
}
API_EXPORT(void) mupEvalBulk(muParserHandle_t a_hParser, muFloat_t* a_res, int nSize)
{
MU_TRY
muParser_t* p(AsParser(a_hParser));
p->Eval(a_res, nSize);
MU_CATCH
}
API_EXPORT(void) mupSetExpr(muParserHandle_t a_hParser, const muChar_t* a_szExpr)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->SetExpr(a_szExpr);
MU_CATCH
}
API_EXPORT(void) mupRemoveVar(muParserHandle_t a_hParser, const muChar_t* a_szName)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->RemoveVar(a_szName);
MU_CATCH
}
/** \brief Release all parser variables.
\param a_hParser Handle to the parser instance.
*/
API_EXPORT(void) mupClearVar(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->ClearVar();
MU_CATCH
}
/** \brief Release all parser variables.
\param a_hParser Handle to the parser instance.
*/
API_EXPORT(void) mupClearConst(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->ClearConst();
MU_CATCH
}
/** \brief Clear all user defined operators.
\param a_hParser Handle to the parser instance.
*/
API_EXPORT(void) mupClearOprt(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->ClearOprt();
MU_CATCH
}
API_EXPORT(void) mupClearFun(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->ClearFun();
MU_CATCH
}
API_EXPORT(void) mupDefineFun0(muParserHandle_t a_hParser,
const muChar_t* a_szName,
muFun0_t a_pFun,
muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun1(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun1_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun2(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun2_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun3(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun3_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun4(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun4_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun5(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun5_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun6(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun6_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun7(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun7_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun8(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun8_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun9(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun9_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineFun10(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun10_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun0(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun0_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun1(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun1_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun2(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun2_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun3(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun3_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun4(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun4_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun5(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun5_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun6(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun6_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun7(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun7_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun8(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun8_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun9(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun9_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkFun10(muParserHandle_t a_hParser, const muChar_t* a_szName, muBulkFun10_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineStrFun1(muParserHandle_t a_hParser, const muChar_t* a_szName, muStrFun1_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineStrFun2(muParserHandle_t a_hParser, const muChar_t* a_szName, muStrFun2_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineStrFun3(muParserHandle_t a_hParser, const muChar_t* a_szName, muStrFun3_t a_pFun)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, false);
MU_CATCH
}
API_EXPORT(void) mupDefineMultFun(muParserHandle_t a_hParser, const muChar_t* a_szName, muMultFun_t a_pFun, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineFun(a_szName, a_pFun, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineOprt(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun2_t a_pFun, muInt_t a_nPrec, muInt_t a_nOprtAsct, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineOprt(a_szName, a_pFun, a_nPrec, (mu::EOprtAssociativity)a_nOprtAsct, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineVar(muParserHandle_t a_hParser, const muChar_t* a_szName, muFloat_t* a_pVar)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineVar(a_szName, a_pVar);
MU_CATCH
}
API_EXPORT(void) mupDefineBulkVar(muParserHandle_t a_hParser, const muChar_t* a_szName, muFloat_t* a_pVar)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineVar(a_szName, a_pVar);
MU_CATCH
}
API_EXPORT(void) mupDefineConst(muParserHandle_t a_hParser, const muChar_t* a_szName, muFloat_t a_fVal)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineConst(a_szName, a_fVal);
MU_CATCH
}
API_EXPORT(void) mupDefineStrConst(muParserHandle_t a_hParser, const muChar_t* a_szName, const muChar_t* a_szVal)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineStrConst(a_szName, a_szVal);
MU_CATCH
}
API_EXPORT(const muChar_t*) mupGetExpr(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
// C# explodes when pMsg is returned directly. For some reason it can't access
// the memory where the message lies directly.
#ifndef _UNICODE
sprintf(s_tmpOutBuf, "%s", p->GetExpr().c_str());
#else
wsprintf(s_tmpOutBuf, _T("%s"), p->GetExpr().c_str());
#endif
return s_tmpOutBuf;
MU_CATCH
return _T("");
}
API_EXPORT(void) mupDefinePostfixOprt(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun1_t a_pOprt, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefinePostfixOprt(a_szName, a_pOprt, a_bAllowOpt != 0);
MU_CATCH
}
API_EXPORT(void) mupDefineInfixOprt(muParserHandle_t a_hParser, const muChar_t* a_szName, muFun1_t a_pOprt, muBool_t a_bAllowOpt)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->DefineInfixOprt(a_szName, a_pOprt, a_bAllowOpt != 0);
MU_CATCH
}
// Define character sets for identifiers
API_EXPORT(void) mupDefineNameChars(muParserHandle_t a_hParser, const muChar_t* a_szCharset)
{
muParser_t* const p(AsParser(a_hParser));
p->DefineNameChars(a_szCharset);
}
API_EXPORT(void) mupDefineOprtChars(muParserHandle_t a_hParser, const muChar_t* a_szCharset)
{
muParser_t* const p(AsParser(a_hParser));
p->DefineOprtChars(a_szCharset);
}
API_EXPORT(void) mupDefineInfixOprtChars(muParserHandle_t a_hParser, const muChar_t* a_szCharset)
{
muParser_t* const p(AsParser(a_hParser));
p->DefineInfixOprtChars(a_szCharset);
}
/** \brief Get the number of variables defined in the parser.
\param a_hParser [in] Must be a valid parser handle.
\return The number of used variables.
\sa mupGetExprVar
*/
API_EXPORT(int) mupGetVarNum(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::varmap_type VarMap = p->GetVar();
return (int)VarMap.size();
MU_CATCH
return 0; // never reached
}
/** \brief Return a variable that is used in an expression.
\param a_hParser [in] A valid parser handle.
\param a_iVar [in] The index of the variable to return.
\param a_szName [out] Pointer to the variable name.
\param a_pVar [out] Pointer to the variable.
\throw nothrow
Prior to calling this function call mupGetExprVarNum in order to get the
number of variables in the expression. If the parameter a_iVar is greater
than the number of variables both a_szName and a_pVar will be set to zero.
As a side effect this function will trigger an internal calculation of the
expression undefined variables will be set to zero during this calculation.
During the calculation user defined callback functions present in the expression
will be called, this is unavoidable.
*/
API_EXPORT(void) mupGetVar(muParserHandle_t a_hParser, unsigned a_iVar, const muChar_t** a_szName, muFloat_t** a_pVar)
{
// A static buffer is needed for the name since i can't return the
// pointer from the map.
static muChar_t szName[1024];
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::varmap_type VarMap = p->GetVar();
if (a_iVar >= VarMap.size())
{
*a_szName = 0;
*a_pVar = 0;
return;
}
mu::varmap_type::const_iterator item;
item = VarMap.begin();
for (unsigned i = 0; i < a_iVar; ++i)
++item;
#ifndef _UNICODE
strncpy(szName, item->first.c_str(), sizeof(szName));
#else
wcsncpy(szName, item->first.c_str(), sizeof(szName));
#endif
szName[sizeof(szName) - 1] = 0;
*a_szName = &szName[0];
*a_pVar = item->second;
return;
MU_CATCH
* a_szName = 0;
*a_pVar = 0;
}
/** \brief Get the number of variables used in the expression currently set in the parser.
\param a_hParser [in] Must be a valid parser handle.
\return The number of used variables.
\sa mupGetExprVar
*/
API_EXPORT(int) mupGetExprVarNum(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::varmap_type VarMap = p->GetUsedVar();
return (int)VarMap.size();
MU_CATCH
return 0; // never reached
}
/** \brief Return a variable that is used in an expression.
Prior to calling this function call mupGetExprVarNum in order to get the
number of variables in the expression. If the parameter a_iVar is greater
than the number of variables both a_szName and a_pVar will be set to zero.
As a side effect this function will trigger an internal calculation of the
expression undefined variables will be set to zero during this calculation.
During the calculation user defined callback functions present in the expression
will be called, this is unavoidable.
\param a_hParser [in] A valid parser handle.
\param a_iVar [in] The index of the variable to return.
\param a_szName [out] Pointer to the variable name.
\param a_pVar [out] Pointer to the variable.
\throw nothrow
*/
API_EXPORT(void) mupGetExprVar(muParserHandle_t a_hParser, unsigned a_iVar, const muChar_t** a_szName, muFloat_t** a_pVar)
{
// A static buffer is needed for the name since i can't return the
// pointer from the map.
static muChar_t szName[1024];
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::varmap_type VarMap = p->GetUsedVar();
if (a_iVar >= VarMap.size())
{
*a_szName = 0;
*a_pVar = 0;
return;
}
mu::varmap_type::const_iterator item;
item = VarMap.begin();
for (unsigned i = 0; i < a_iVar; ++i)
++item;
#ifndef _UNICODE
strncpy(szName, item->first.c_str(), sizeof(szName));
#else
wcsncpy(szName, item->first.c_str(), sizeof(szName));
#endif
szName[sizeof(szName) - 1] = 0;
*a_szName = &szName[0];
*a_pVar = item->second;
return;
MU_CATCH
* a_szName = 0;
*a_pVar = 0;
}
/** \brief Return the number of constants defined in a parser. */
API_EXPORT(int) mupGetConstNum(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::valmap_type ValMap = p->GetConst();
return (int)ValMap.size();
MU_CATCH
return 0; // never reached
}
API_EXPORT(void) mupSetArgSep(muParserHandle_t a_hParser, const muChar_t cArgSep)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->SetArgSep(cArgSep);
MU_CATCH
}
API_EXPORT(void) mupResetLocale(muParserHandle_t a_hParser)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->ResetLocale();
MU_CATCH
}
API_EXPORT(void) mupSetDecSep(muParserHandle_t a_hParser, const muChar_t cDecSep)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->SetDecSep(cDecSep);
MU_CATCH
}
API_EXPORT(void) mupSetThousandsSep(muParserHandle_t a_hParser, const muChar_t cThousandsSep)
{
MU_TRY
muParser_t* const p(AsParser(a_hParser));
p->SetThousandsSep(cThousandsSep);
MU_CATCH
}
//---------------------------------------------------------------------------
/** \brief Retrieve name and value of a single parser constant.
\param a_hParser [in] a valid parser handle
\param a_iVar [in] Index of the constant to query
\param a_pszName [out] pointer to a null terminated string with the constant name
\param [out] The constant value
*/
API_EXPORT(void) mupGetConst(muParserHandle_t a_hParser, unsigned a_iVar, const muChar_t** a_pszName, muFloat_t* a_fVal)
{
// A static buffer is needed for the name since i can't return the
// pointer from the map.
static muChar_t szName[1024];
MU_TRY
muParser_t* const p(AsParser(a_hParser));
const mu::valmap_type ValMap = p->GetConst();
if (a_iVar >= ValMap.size())
{
*a_pszName = 0;
*a_fVal = 0;
return;
}
mu::valmap_type::const_iterator item;
item = ValMap.begin();
for (unsigned i = 0; i < a_iVar; ++i)
++item;
#ifndef _UNICODE
strncpy(szName, item->first.c_str(), sizeof(szName));
#else
wcsncpy(szName, item->first.c_str(), sizeof(szName));
#endif
szName[sizeof(szName) - 1] = 0;
*a_pszName = &szName[0];
*a_fVal = item->second;
return;
MU_CATCH
* a_pszName = 0;
*a_fVal = 0;
}
/** \brief Add a custom value recognition function. */
API_EXPORT(void) mupAddValIdent(muParserHandle_t a_hParser, muIdentFun_t a_pFun)
{
MU_TRY
muParser_t* p(AsParser(a_hParser));
p->AddValIdent(a_pFun);
MU_CATCH
}
/** \brief Query if an error occurred.
After querying the internal error bit will be reset. So a consecutive call
will return false.
*/
API_EXPORT(muBool_t) mupError(muParserHandle_t a_hParser)
{
bool bError(AsParserTag(a_hParser)->bError);
AsParserTag(a_hParser)->bError = false;
return bError;
}
/** \brief Reset the internal error flag. */
API_EXPORT(void) mupErrorReset(muParserHandle_t a_hParser)
{
AsParserTag(a_hParser)->bError = false;
}
API_EXPORT(void) mupSetErrorHandler(muParserHandle_t a_hParser, muErrorHandler_t a_pHandler)
{
AsParserTag(a_hParser)->errHandler = a_pHandler;
}
/** \brief Return the message associated with the last error. */
API_EXPORT(const muChar_t*) mupGetErrorMsg(muParserHandle_t a_hParser)
{
ParserTag* const p(AsParserTag(a_hParser));
const muChar_t* pMsg = p->exc.GetMsg().c_str();
// C# explodes when pMsg is returned directly. For some reason it can't access
// the memory where the message lies directly.
#ifndef _UNICODE
sprintf(s_tmpOutBuf, "%s", pMsg);
#else
wsprintf(s_tmpOutBuf, _T("%s"), pMsg);
#endif
return s_tmpOutBuf;
}
/** \brief Return the message associated with the last error. */
API_EXPORT(const muChar_t*) mupGetErrorToken(muParserHandle_t a_hParser)
{
ParserTag* const p(AsParserTag(a_hParser));
const muChar_t* pToken = p->exc.GetToken().c_str();
// C# explodes when pMsg is returned directly. For some reason it can't access
// the memory where the message lies directly.
#ifndef _UNICODE
sprintf(s_tmpOutBuf, "%s", pToken);
#else
wsprintf(s_tmpOutBuf, _T("%s"), pToken);
#endif
return s_tmpOutBuf;
}
/** \brief Return the code associated with the last error.
*/
API_EXPORT(int) mupGetErrorCode(muParserHandle_t a_hParser)
{
return AsParserTag(a_hParser)->exc.GetCode();
}
/** \brief Return the position associated with the last error. */
API_EXPORT(int) mupGetErrorPos(muParserHandle_t a_hParser)
{
return (int)AsParserTag(a_hParser)->exc.GetPos();
}
API_EXPORT(muFloat_t*) mupCreateVar()
{
return new muFloat_t(0);
}
API_EXPORT(void) mupReleaseVar(muFloat_t* ptr)
{
delete ptr;
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif // MUPARSER_DLL
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.10.22 - v0.10.23: v8::internal::SmiTagging< 4 > Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.10.22 - v0.10.23
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><b>internal</b></li><li class="navelem"><a class="el" href="structv8_1_1internal_1_1_smi_tagging_3_014_01_4.html">SmiTagging< 4 ></a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="#pub-static-attribs">Static Public Attributes</a> |
<a href="structv8_1_1internal_1_1_smi_tagging_3_014_01_4-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::internal::SmiTagging< 4 > Struct Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ae47c1d7f0359f4560b84fa8e573974e2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae47c1d7f0359f4560b84fa8e573974e2"></a>
static int </td><td class="memItemRight" valign="bottom"><b>SmiToInt</b> (internal::Object *value)</td></tr>
<tr class="separator:ae47c1d7f0359f4560b84fa8e573974e2"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a4230f8d72054619f8141d0524733d8e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4230f8d72054619f8141d0524733d8e9"></a>
static const int </td><td class="memItemRight" valign="bottom"><b>kSmiShiftSize</b> = 0</td></tr>
<tr class="separator:a4230f8d72054619f8141d0524733d8e9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0857bbaab799b39a51f578744bf855f8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0857bbaab799b39a51f578744bf855f8"></a>
static const int </td><td class="memItemRight" valign="bottom"><b>kSmiValueSize</b> = 31</td></tr>
<tr class="separator:a0857bbaab799b39a51f578744bf855f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6847bed1398baca23b399c9b01121eaa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6847bed1398baca23b399c9b01121eaa"></a>
static const uintptr_t </td><td class="memItemRight" valign="bottom"><b>kEncodablePointerMask</b> = 0x1</td></tr>
<tr class="separator:a6847bed1398baca23b399c9b01121eaa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a387b431afa5d17958107860f8b2f53b9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a387b431afa5d17958107860f8b2f53b9"></a>
static const int </td><td class="memItemRight" valign="bottom"><b>kPointerToSmiShift</b> = 0</td></tr>
<tr class="separator:a387b431afa5d17958107860f8b2f53b9"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:45:06 for V8 API Reference Guide for node.js v0.10.22 - v0.10.23 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| Java |
using System;
using System.IO;
using Xunit;
namespace OpenSage.Tests.Data
{
internal static class TestUtility
{
public static T DoRoundtripTest<T>(
Func<Stream> getOriginalStream,
Func<Stream, T> parseCallback,
Action<T, Stream> serializeCallback,
bool skipRoundtripEqualityTest = false)
{
byte[] originalUncompressedBytes;
using (var originalUncompressedStream = new MemoryStream())
using (var entryStream = getOriginalStream())
{
entryStream.CopyTo(originalUncompressedStream);
originalUncompressedBytes = originalUncompressedStream.ToArray();
}
T parsedFile = default;
try
{
using (var entryStream = new MemoryStream(originalUncompressedBytes, false))
{
parsedFile = parseCallback(entryStream);
}
}
catch
{
File.WriteAllBytes("original.bin", originalUncompressedBytes);
throw;
}
byte[] serializedBytes;
using (var serializedStream = new MemoryStream())
{
serializeCallback(parsedFile, serializedStream);
serializedBytes = serializedStream.ToArray();
}
if (originalUncompressedBytes.Length != serializedBytes.Length)
{
File.WriteAllBytes("original.bin", originalUncompressedBytes);
File.WriteAllBytes("serialized.bin", serializedBytes);
}
Assert.Equal(originalUncompressedBytes.Length, serializedBytes.Length);
if (!skipRoundtripEqualityTest)
{
AssertUtility.Equal(originalUncompressedBytes, serializedBytes);
}
return parsedFile;
}
}
}
| Java |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\DoctrineMongoDBBundle\Command;
use Doctrine\ODM\MongoDB\Mapping\MappingException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Show information about mapped documents
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Jonathan H. Wage <jonwage@gmail.com>
*/
class InfoDoctrineODMCommand extends DoctrineODMCommand
{
protected function configure()
{
$this
->setName('doctrine:mongodb:mapping:info')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setDescription('Show basic information about all mapped documents.')
->setHelp(<<<EOT
The <info>doctrine:mapping:info</info> shows basic information about which
documents exist and possibly if their mapping information contains errors or not.
<info>./app/console doctrine:mapping:info</info>
If you are using multiple document managers you can pick your choice with the <info>--dm</info> option:
<info>./app/console doctrine:mapping:info --dm=default</info>
EOT
);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$documentManagerName = $input->getOption('dm') ?
$input->getOption('dm') :
$this->container->getParameter('doctrine.odm.mongodb.default_document_manager');
$documentManagerService = sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManagerName);
/* @var $documentManager Doctrine\ODM\MongoDB\DocumentManager */
$documentManager = $this->container->get($documentManagerService);
$documentClassNames = $documentManager->getConfiguration()
->getMetadataDriverImpl()
->getAllClassNames();
if (!$entityClassNames) {
throw new \Exception(
'You do not have any mapped Doctrine MongoDB ODM documents for any of your bundles. '.
'Create a class inside the Document namespace of any of your bundles and provide '.
'mapping information for it with Annotations directly in the classes doc blocks '.
'or with XML/YAML in your bundles Resources/config/doctrine/metadata/mongodb directory.'
);
}
$output->write(sprintf("Found <info>%d</info> documents mapped in document manager <info>%s</info>:\n",
count($documentClassNames), $documentManagerName), true);
foreach ($documentClassNames AS $documentClassName) {
try {
$cm = $documentManager->getClassMetadata($documentClassName);
$output->write("<info>[OK]</info> " . $documentClassName, true);
} catch(MappingException $e) {
$output->write("<error>[FAIL]</error> " . $documentClassName, true);
$output->write("<comment>" . $e->getMessage()."</comment>", true);
$output->write("", true);
}
}
}
} | Java |
#!/bin/bash
# This script overcomes a yucky bug in simplescalar's GCC, which
# prevents it from working on the user filesystem (due to a problem
# with the transition to 64-bit). Luckily /tmp is implemented differently
# and doesn'thave this problem so we copy the tree there and do the make there.
TMPNAME=/tmp/SSCA2v2.2-$USER
rm -rf $TMPNAME
# make clean here to avoid confusion
make clean
echo Copying the tree to $TMPNAME so we can build it there
cp -rf ../SSCA2v2.2 $TMPNAME
# now make it in the /tmp directory
pushd $TMPNAME
make CC=/homes/phjk/simplescalar/bin/gcc AR=/homes/phjk/simplescalar/bin/sslittle-na-sstrix-ar RANLIB=/homes/phjk/simplescalar/bin/sslittle-na-sstrix-ranlib
popd
# and link the binary back here
ln -s $TMPNAME/SSCA2
| Java |
<!--
Smart Data Platform - Reference Implementation
This page shows how to receive and visualize the data stream from
a sensor in real-time.
In particular data is received using Socket.IO, which provides an
abstraction layer to Websocket API.
Data visualizzation is based on D3js library (<http://d3js.org).
-->
<!DOCTYPE html>
<html>
<head>
<!-- javascript for provides realtime communication between your node.js server and clients-->
<script src="stomp.js" charset="utf-8"></script>
<!-- CSS file -->
<link rel="stylesheet" href="style.css" type="text/css">
<!-- javascript D3js for speedometer-->
<script type="text/javascript" src="http://iop.io/js/vendor/d3.v3.min.js"></script>
<script type="text/javascript" src="http://iop.io/js/vendor/polymer/PointerEvents/pointerevents.js"></script>
<script type="text/javascript" src="http://iop.io/js/vendor/polymer/PointerGestures/pointergestures.js"></script>
<script type="text/javascript" src="http://iop.io/js/iopctrl.js"></script>
<title>Smart Data Platform - Reference Implementation</title>
</head>
<body>
<div style="background-color:#fff;width:100%;">
<div>
<br>
<span style="border:3px solid #0080C0; color:#0080C0; padding:5px; font-size:40px; font-style:italic; font-weight:bold; width:89%;">
Smart Data Platform - Reference Implementation
</span>
<br><br>
</div>
<span id="connect"> </span>
<h1>Visualisation of temperature</h1>
<pre>
<div style="background-color:#000;width:81%;">
<font color=#0080C0 size=4>
<span id="message5"> </span>
<span id="message4"> </span>
<span id="message3"> </span>
<span id="message2"> </span>
<span id="message1"> </span>
</font>
</div>
</pre>
<!-- Inserted at field "message" the json received from the client. Used only for debug -->
<!-- <span id="message"> </span> -->
<div style="border:0px solid blue" id="speedometer"/>
</div>
<script>
var arrayTemp = new Array();
var arrayTime = new Array();
var _length = 0;
// function that create and manage the window and server connection
window.onload = function () {
// IP address of server
var ip = location.host;
ip="localhost";
// connect to server
var client = Stomp.client("ws://" +ip + ":61614");
d3.select("#connect").html("Status: Disconnected");
client.connect("guest", "password",
function(frame) {
d3.select("#connect").html("Status: Connected");
client.subscribe("/topic/output.sandbox.*", function(message) {
// Inserted at field "message" the json received from the client. Used only for debug
// d3.select("#message").html(message);
// create a json from messagge received
var json = message.body;
obj = JSON.parse(json);
// parser the json for print the value and time
// check if the value is into the range of speedometer
if(obj.values[0].components.c0 <= 50 && obj.values[0].components.c0 >= -50){
segDisplay.value(obj.values[0].components.c0);// setup the value of display
gauge.value(obj.values[0].components.c0); // setup the value of speedometer
if(_length < 5){//fill the array
_length = _length +1;
arrayTemp.push(obj.values[0].components.c0);
var dateS = obj.values[0].time.split("Z");
var date = new Date(dateS[0]);
arrayTime.push(date.toString());
printArray();
}else{//manage the dinamic array
arrayTemp = arrayTemp.slice(1,5);
arrayTime = arrayTime.slice(1,5);
arrayTemp.push(obj.values[0].components.c0);
var dateS = obj.values[0].time.split("Z");
var date = new Date(dateS[0]);
arrayTime.push(date.toString());
printArray();
}
}
});
},
function() {
//Error callback
d3.select("#connect").html("Status: Error");
}
);
};
// print the array in the pre
function printArray(){
d3.select("#message5").html(" TEMPERATURE " + arrayTemp[0].valueOf() + " TIME " + arrayTime[0].valueOf()+ " ");
d3.select("#message4").html(" TEMPERATURE " + arrayTemp[1].valueOf() + " TIME " + arrayTime[1].valueOf()+ " ");
d3.select("#message3").html(" TEMPERATURE " + arrayTemp[2].valueOf() + " TIME " + arrayTime[2].valueOf()+ " ");
d3.select("#message2").html(" TEMPERATURE " + arrayTemp[3].valueOf() + " TIME " + arrayTime[3].valueOf()+ " ");
d3.select("#message1").html(" TEMPERATURE " + arrayTemp[4].valueOf() + " TIME " + arrayTime[4].valueOf()+ " ");
}
// init speedometer setup
// create speedometer
var svg = d3.select("#speedometer")
.append("svg:svg")
.attr("width", 800)
.attr("height", 400);
// create speedometer
var gauge = iopctrl.arcslider()
.radius(180)
.events(false)
.indicator(iopctrl.defaultGaugeIndicator);
// add components at speedometer
gauge.axis().orient("in") // position number into gauge
.normalize(true)
.ticks(10) // set the number how integer
.tickSubdivide(9) // interval of decimals
.tickSize(10, 8, 10) // subdivides the gauge
.tickPadding(8) // padding
.scale(d3.scale.linear()
.domain([-50, 50])//range of speedometer
.range([-3*Math.PI/4, 3*Math.PI/4])); //create the circoference
// create a numeric display
var segDisplay = iopctrl.segdisplay()
.width(180)
.digitCount(5)
.negative(true)
.decimals(2);
// picutre the display
svg.append("g")
.attr("class", "segdisplay")
.attr("transform", "translate(130, 350)")
.call(segDisplay);
// attach the speedometer at the window
svg.append("g")
.attr("class", "gauge")
.call(gauge);
// end speedometer setup
</script>
</body>
</html>
| Java |
module LiveScript
module Source
VERSION = '1.5.0'
end
end
| Java |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Topup extends MY_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function __construct()
{
parent::__construct();
$this->load->model(array('admin_model','user_model'));
getCurrentAccountStatus($role_id = array(1));
}
public function index()
{
$session_data = $this->session->userdata('user_logged_in');
$role_id = $session_data['role_id'];
$user_id = $session_data['user_id'];
if($role_id == 1)
{
$this->load->library('form_validation');
$this->form_validation->set_rules('amount', 'Amount', 'trim|is_numeric|required|xss_clean|callback_amountchk');
$amount = $this->input->post('amount');
if($this->form_validation->run() == FALSE)
{
$data['title'] = 'Dashboard';
$data['content'] = 'super_admin/admin_home';
$this->load->view($this->layout_client,$data);
}
else
{
$topup_data=array(
'admin_id' => $user_id,
'topup_amount' => $amount,
'topup_status' => 1
);
$topup_id = topupAdminData($topup_data);
if($topup_id){
redirect('super_admin/admin_home');
return "topup sucess";
}
else
{
return "topup unsuccess";
}
}
}else
{
var_dump("incorrect url");
die();
}
}
public function amountchk()
{
if($this->input->post('amount')<0)
{
$this->form_validation->set_message('amount', 'Cant enter lessthan 0');
}
}
} | Java |
define(['myweb/jquery'], function ($) {
'use strict';
var error = function (message) {
$('.form-feedback').removeClass('form-success').addClass('form-error').text(message).fadeIn(200);
};
var success = function (message) {
$('.form-feedback').removeClass('form-error').addClass('form-success').text(message).fadeIn(200);
};
var clear = function () {
$('.form-feedback').hide().removeClass('form-success form-error').empty();
};
return {
error: error,
success: success,
clear: clear
};
});
| Java |
# encoding: UTF-8
include Vorax
describe 'tablezip layout' do
before(:each) do# {{{
@sp = Sqlplus.new('sqlplus')
@sp.default_convertor = :tablezip
@prep = [VORAX_CSTR,
"set tab off",
"set linesize 10000",
"set markup html on",
"set echo off",
"set pause off",
"set define &",
"set termout on",
"set verify off",
"set pagesize 4"].join("\n")
@result = ""
end# }}}
it 'should work with multiple statements' do# {{{
@sp.exec("select dummy d from dual;\nselect * from departments where id <= 2;", :prep => @prep)
@result << @sp.read_output(32767) while @sp.busy?
expected = <<OUTPUT
SQL>
D
-
X
SQL>
ID NAME DESCRIPTION
-- ----------- -----------------------------------
1 Bookkeeping This department is responsible for:
- financial reporting
- analysis
- other boring tasks
2 Marketing
SQL>
SQL>
OUTPUT
#puts @result
@result.should eq(expected)
end# }}}
it 'should work with multi line records' do# {{{
@sp.exec("select * from departments where id <= 10;", :prep => @prep)
@result << @sp.read_output(32767) while @sp.busy?
expected = <<OUTPUT
SQL>
ID NAME DESCRIPTION
-- ---------------- -----------------------------------
1 Bookkeeping This department is responsible for:
- financial reporting
- analysis
- other boring tasks
2 Marketing
3 Deliveries
4 CRM
ID NAME DESCRIPTION
-- ---------------- -----------------------------------
5 Legal Stuff
6 Management The bad guys department
7 Cooking
8 Public Relations
ID NAME DESCRIPTION
-- ---------------- -----------------------------------
9 Aquisitions
10 Cleaning
10 rows selected.
SQL>
SQL>
OUTPUT
#puts @result
@result.should eq(expected)
end# }}}
it 'should work with accept prompts' do# {{{
begin
pack_file = Tempfile.new(['vorax', '.sql'])
@sp.exec("accept var prompt \"Enter var: \"\nprompt &var", :prep => @prep, :pack_file => pack_file.path)
Timeout::timeout(10) {
@result << @sp.read_output(32767) while @result !~ /Enter var: \z/
@sp.send_text("muci\n")
@result << @sp.read_output(32767) while @result !~ /muci\n\z/
}
ensure
pack_file.unlink
end
end# }}}
it 'should work with <pre> tags' do# {{{
@sp.exec("set autotrace traceonly explain\nselect * from dual;", :prep => @prep)
@result << @sp.read_output(32767) while @sp.busy?
@result.should match(/SELECT STATEMENT/)
end# }}}
after(:each) do# {{{
@sp.terminate
end# }}}
end
| Java |
from django.contrib.admin.models import LogEntry
from django.contrib.auth.models import User, Group, Permission
from simple_history import register
from celsius.tools import register_for_permission_handling
register(User)
register(Group)
register_for_permission_handling(User)
register_for_permission_handling(Group)
register_for_permission_handling(Permission)
register_for_permission_handling(LogEntry)
| Java |
<!DOCTYPE html>
<!--[if IE 8]> <html class="ie ie8"> <![endif]-->
<!--[if IE 9]> <html class="ie ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html> <!--<![endif]-->
<head>
<!-- Basic -->
<meta charset="utf-8">
<title>VirUCA</title>
<meta name="keywords" content="" />
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Web Fonts -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800%7CShadows+Into+Light" rel="stylesheet" type="text/css">
<!-- Libs CSS -->
<link rel="stylesheet" href="<?=base_url()?>vendor/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="<?=base_url()?>vendor/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="<?=base_url()?>vendor/owl-carousel/owl.carousel.css" media="screen">
<link rel="stylesheet" href="<?=base_url()?>vendor/owl-carousel/owl.theme.css" media="screen">
<link rel="stylesheet" href="<?=base_url()?>vendor/magnific-popup/magnific-popup.css" media="screen">
<link rel="stylesheet" href="<?=base_url()?>vendor/isotope/jquery.isotope.css" media="screen">
<link rel="stylesheet" href="<?=base_url()?>vendor/mediaelement/mediaelementplayer.css" media="screen">
<!-- Theme CSS -->
<link rel="stylesheet" href="<?=base_url()?>css/theme.css">
<link rel="stylesheet" href="<?=base_url()?>css/theme-elements.css">
<link rel="stylesheet" href="<?=base_url()?>css/theme-blog.css">
<link rel="stylesheet" href="<?=base_url()?>css/theme-shop.css">
<link rel="stylesheet" href="<?=base_url()?>css/theme-animate.css">
<link rel="stylesheet" href="<?=base_url()?>css/panel.css?id=124">
<link rel="stylesheet" href="<?=base_url()?>css/tooltip.css">
<!-- Responsive CSS -->
<link rel="stylesheet" href="<?=base_url()?>css/theme-responsive.css" />
<!-- Skin CSS -->
<link rel="stylesheet" href="<?=base_url()?>css/skins/default.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="<?=base_url()?>css/custom.css">
<!-- Custom Loader -->
<link rel="stylesheet" href="<?=base_url()?>css/loader.css">
<!-- Libs -->
<script src="<?=base_url()?>vendor/jquery.js"></script>
<!-- Custom JS -->
<script src="<?=base_url()?>js/custom.js"></script>
<!-- Head Libs -->
<script src="<?=base_url()?>vendor/modernizr.js"></script>
<!--[if IE]>
<link rel="stylesheet" href="css/ie.css">
<![endif]-->
<!--[if lte IE 8]>
<script src="vendor/respond.js"></script>
<![endif]-->
<script type="text/javascript">
function AddFicha(idDiv, Texto) {
document.getElementById(idDiv).innerHTML += Texto;
}
</script>
</head>
<body>
<div id="preloader"><div id="loader"> </div></div>
<div class="body">
<?php $this->load->view('menuj_view');?>
<div role="main" class="main">
<div class="container">
<!-- Errores de inserción. -->
<?php if($this->session->flashdata('respuesta_ok')) { ?>
<div class="modal">
<div class="ventana">
<div class="alert alert-success">
<?php echo $this->session->flashdata('respuesta_ok');?>
</div>
<span class="cerrar">Cerrar</span>
</div>
</div>
<?php } ?>
<?php if($this->session->flashdata('respuesta_ko')) { ?>
<div class="modal">
<div class="ventana">
<div class="alert alert-danger">
<?php echo $this->session->flashdata('respuesta_ko'); ?>
<span class="cerrar">Cerrar</span>
</div>
</div>
</div>
<?php } ?>
<!-- Fin errores -->
<!-- Información de la partida -->
<?php
foreach ($partida as $jugador) {
$nJugadores = $jugador->nGrupos;
$iId_Partida = $jugador->iId;
$iTurno = $jugador->iTurno;
$iId_Panel = $jugador->iId_Panel;
$bFinalizada = $jugador->bFinalizada;
}
?>
<?php if ($bFinalizada) {
echo "<br><blockquote><strong>La partida ha finalizado</strong>. En la siguiente tabla puedes ver cómo han quedado los grupos</blockquote>";
}
?>
<div class="featured-box featured-box-primary">
<div class="box-content">
<?php
echo "<div>";
// Hay que restablecer la partida.
foreach ($resumen as $equipo) {
echo "<div style='float:left; padding-left:30px;'>";
if ($equipo->iGrupo == $iTurno)
echo "<span class='rojo'><b>Grupo ".$equipo->iGrupo."</b></span><br>";
else
echo "<span>Grupo ".$equipo->iGrupo."</span><br>";
echo "<img src='".base_url()."/assets/img/".$equipo->iGrupo.".png' aling='center'><br>";
if ($equipo->iCasilla == 0)
echo "Inicio";
else {
// Comprobamos si hay que poner las medallas y regalos.
echo "<div style='padding-top:5px;''>";
switch ($equipo->iPosJuego) {
case '1':
echo "<img src='".base_url()."/assets/img/gold.png' aling='center'><br>";
break;
case '2':
echo "<img src='".base_url()."/assets/img/silver.png' aling='center'><br>";
break;
case '3':
echo "<img src='".base_url()."/assets/img/bronze.png' aling='center'><br>";
break;
default:
if ($equipo->iPosJuego != 0)
echo "<img src='".base_url()."/assets/img/gift.png' aling='center'><br>";
break;
}
echo "</div>";
if ($equipo->iPosJuego == 0)
echo $equipo->iCasilla;
}
echo "</div>";
}
echo "</div>";
?>
<br class="clear">
</div>
</div>
<!-- panel -->
<?php
// Botones
if ($bFinalizada == 0) { ?>
<input type="hidden" data-bb="pregunta">
<input type="button" class="btn btn-warning"
data-bb="confirm"
data-pn="<?=$iId_Panel;?>"
data-id="<?=$iId_Partida;?>"
data-gr="<?=$iTurno;?>"
value="Tirar Dado">
<input type="button" class="btn btn-warning"
data-bb="confirm2"
data-id="<?=$iId_Partida;?>"
value="Finalizar partida">
<input type="button" class="btn btn-warning" value="Salir"
onclick="location.href='<?=base_url()?>index.php/jugar/salir/<?=$iId_Partida?>'">
<?php } else { ?>
<input type="button" class="btn btn-warning" value="Listado de partidas"
onclick="location.href='<?=base_url()?>index.php/partidas'">
<?php }
if (!$bFinalizada) {
// Pintamos el panel
$contCasilla = 1;
echo "<br class='clear'><br><div data-toggle='tooltip' title='Inicio' class='test fade' style='float:left;'>
<img src='".base_url()."/assets/img/inicio.png' aling='center'></div>";
foreach ($casillas as $casilla) {
// Pinto la casilla.
echo "<div data-toggle='tooltip' title='".$casilla->sCategoria."' id='casilla".$contCasilla."' class='test circulo fade' style='background:".$casilla->sColor."; border: 1px dotted black;'>";
echo "<h4 style='margin:0 !important;' class='fuego'><b>".$contCasilla."</b></h4>";
// Dependiendo de la función de la casilla, pintaremos esa función.
switch ($casilla->eFuncion) {
case 'Viento':
echo "<div style='padding-left:30px;'><img src='".base_url()."/assets/img/wind.png' aling='center'></div>";
break;
case 'Retroceder':
echo "<div style='padding-left:30px;'><img src='".base_url()."/assets/img/syringe.png' aling='center'></div>";
default:
# code...
break;
}
echo "</div>";
$contCasilla++;
}
echo "<div data-toggle='tooltip' title='Meta!' class='test fade' style='float:left;'>
<img src='".base_url()."/assets/img/meta.png' aling='center'></div>";
// Ahora colocamos las fichas en sus celdas.
echo "<div>";
// Hay que restablecer la partida.
foreach ($resumen as $equipo) {
if ($equipo->iCasilla != 0) {
// Hay que colocar la ficha en la celda.
$ficha = '<div class=ficha><img src='.base_url().'assets/img/'.$equipo->iGrupo.'.png?id=6></div>';
echo "<script>";
echo "AddFicha('casilla$equipo->iCasilla', '$ficha')";
echo "</script>";
}
}
// Fin de colocación de fichas.
?>
<br class="clear">
<hr class="short">
<!-- Leyenda -->
<blockquote>
<h4>Leyenda.</h4>
<ul>
<li><img src="<?=base_url()?>assets/img/6.png" align="middle"> Indica, según tu color, la posición en la que estás en el juego.</li>
<li><img src="<?=base_url()?>assets/img/syringe.png" align="middle"> Si aciertas la pregunta, guardas la posición, si no la aciertas vuelves a la casilla de <b>inicio</b></li>
<li><img src="<?=base_url()?>assets/img/wind.png" align="middle"> Si aciertas la pregunta, vas a la siguiente casilla de <b>viento</b>. Si no aciertas, vuelves a la casilla anterior.</li>
</ul>
</blockquote>
<!-- Resumen de la partida -->
<?php
} // Cierra el if de la partida finalizada.
if ($bFinalizada == 0) { ?>
<input type="hidden" data-bb="pregunta">
<input type="button" class="btn btn-warning"
data-bb="confirm"
data-pn="<?=$iId_Panel;?>"
data-id="<?=$iId_Partida;?>"
data-gr="<?=$iTurno;?>"
value="Tirar Dado">
<input type="button" class="btn btn-warning"
data-bb="confirm2"
data-id="<?=$iId_Partida;?>"
value="Finalizar partida">
<input type="button" class="btn btn-warning" value="Salir"
onclick="location.href='<?=base_url()?>index.php/jugar/salir/<?=$iId_Partida?>'">
<?php } else { ?>
<input type="button" class="btn btn-warning" value="Listado de partidas"
onclick="location.href='<?=base_url()?>index.php/partidas'">
<?php } ?>
</div>
</div>
<?php $this->load->view('footer');?>
</div>
<script src="<?=base_url()?>vendor/jquery.appear.js"></script>
<script src="<?=base_url()?>vendor/jquery.easing.js"></script>
<script src="<?=base_url()?>vendor/jquery.cookie.js"></script>
<script src="<?=base_url()?>vendor/bootstrap/js/bootstrap.js"></script>
<?php if ($this->session->flashdata('respuesta_ok') || $this->session->flashdata('respuesta_ko')) {
echo "<script type='text/javascript'>";
echo "$(document).ready(function(){";
echo "$('.modal').fadeIn();";
echo "$('.cerrar').click(function(){";
echo "$('.modal').fadeOut(300);";
echo "});});";
echo "</script>";
}
?>
<script type="text/javascript">
$(window).load(function() {
$('#preloader').fadeOut('slow');
$('body').css({'overflow':'visible'});
});
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<!-- BOOT BOX -->
<script src="<?=base_url()?>js/bootbox/boot.activate.js"></script>
<script src="<?=base_url()?>js/bootbox/bootbox.min.js"></script>
<script type="text/javascript">
function aleatorio(a,b) {return Math.round(Math.random()*(b-a)+parseInt(a));}
bootbox.setDefaults({
locale: "es"
});
$(function() {
var cajas = {};
var forzar = {};
$(document).on("click", "input[data-bb]", function(e) {
e.preventDefault();
var type = $(this).data("bb");
// Partida en curso
var iId_Partida = $(this).data("id");
// Grupo que tiene el turno
var iId_Grupo = $(this).data("gr");
// Panel
var iId_Panel = $(this).data("pn");
if (typeof cajas[type] === 'function') {
cajas[type](iId_Partida, iId_Grupo, iId_Panel);
} else {
if (typeof forzar[type] === 'function')
forzar[type](iId_Partida, iId_Grupo, iId_Panel);
}
});
cajas.confirm = function(id, gr, pn) {
var tirada = aleatorio(1,6);
//var tirada = 1;
var innerTxt = "";
innerTxt = innerTxt + '<div style="float:left; padding-left:5px; width:150px;"><img src="'
+ '<?=base_url()?>' + 'assets/img/dado'+tirada+'.png' + '"></div>';
innerTxt = innerTxt + '<div style="float:left; padding-left:10px; width:300px;"><blockquote><b>Grupo '+ gr +'</b>, has avanzado <b>'+tirada+'</b> posicion/es, a continuación vamos a formularte una pregunta ... ¿Preparado? </blockquote></div>';
innerTxt += "<br class='clear'>";
// Si confirma la tirada de dado, vamos a la página de preguntas.
bootbox.confirm(innerTxt, function(result) {
if (result == true) {
location.href = '<?=base_url()?>index.php/jugar/'
+ id
+ '/'
+ pn
+ '/'
+ gr
+ '/'
+ tirada;
}
});
};
cajas.confirm2 = function(id, gr, pn) {
var innerTxt = "Si finalizas la partida, no podrás volver a jugarla, el ranking de los jugadores quedará como hasta ahora. ¿Estás seguro/a que desea finalizar la partida de todos modos?";
innerTxt += "<br class='clear'>";
// Si confirma la tirada de dado, vamos a la página de preguntas.
bootbox.confirm(innerTxt, function(result) {
if (result == true) {
location.href = '<?=base_url()?>index.php/jugar/finalizar/'
+ id;
}
});
};
});
</script>
<!-- FIN BOOT -->
</body>
</html>
| Java |
namespace ConsoleStudentSystem.Models
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
public class User
{
private ICollection<UserProfile> userProfiles;
public User()
{
this.userProfiles = new HashSet<UserProfile>();
}
public virtual ICollection<UserProfile> UserProfiles
{
get { return userProfiles; }
set { userProfiles = value; }
}
}
}
| Java |
const gulp = require('gulp'),
zip = require('gulp-zip');
/**
* Metadata about the plugin.
*
* @var object
*/
const plugin = {
name: 'example-plugin',
directory: '.'
}
gulp.task('distribute', function () {
let paths = [
'vendor/twig/**/*',
'vendor/composer/**/*',
'vendor/autoload.php',
'src/**/*'
]
let src = gulp.src(paths, {
base: './'
})
let archive = src.pipe(zip(`${plugin.name}.zip`))
return archive.pipe(gulp.dest(plugin.directory))
});
| Java |
namespace RouteExtreme.Web
{
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.Google;
using Owin;
using RouteExtreme.Models;
using RouteExtreme.Data;
public partial class Startup
{
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Configure the db context, user manager and signin manager to use a single instance per request
app.CreatePerOwinContext(RouteExtremeDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, User>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
// Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
// Enables the application to remember the second login verification factor such as phone or email.
// Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
// This is similar to the RememberMe option when you log in.
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
//{
// ClientId = "",
// ClientSecret = ""
//});
}
}
} | Java |
package com.management.dao.impl.calcs;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import com.management.bean.calculate.ProjectCalc;
import com.management.bean.calculate.ProjectCalcs;
import com.management.dao.calcs.ProjectCalcDao;
import com.management.util.DBUtil;
public class ProjectCalcDaoImpl implements ProjectCalcDao {
@Override
public List<ProjectCalc> find() {
try {
Connection conn = DBUtil.getConnection();
String sql = "select * from project_calc";
QueryRunner qr = new QueryRunner();
return qr.query(conn, sql, new BeanListHandler<>(ProjectCalc.class));
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
@Override
public void add(ProjectCalc c) {
try {
Connection conn = DBUtil.getConnection();
String sql = "insert into project_calc(rank,category,weight,high,low) values(?,?,?,?,?)";
QueryRunner qr = new QueryRunner();
Object[] params = {c.getRank(),c.getCategory(),c.getWeight(),c.getHigh(),c.getLow()};
qr.update(conn, sql, params);
ProjectCalcs.update();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
@Override
public void update(ProjectCalc c) {
try {
Connection conn = DBUtil.getConnection();
String sql = "update project_calc set rank=?,category=?,weight=?,high=?,low=? where id=?";
QueryRunner qr = new QueryRunner();
Object[] params = {c.getRank(),c.getCategory(),c.getWeight(),c.getHigh(),c.getLow(),c.getId()};
qr.update(conn, sql, params);
ProjectCalcs.update();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
@Override
public void delete(int id) {
try {
Connection conn = DBUtil.getConnection();
String sql = "delete from project_calc where id=?";
QueryRunner qr = new QueryRunner();
qr.update(conn, sql,id);
ProjectCalcs.update();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
| Java |
# [Глава 1](../index.md#Глава-1-Построение-абстракций-с-помощью-процедур)
### Упражнение 1.2
Переведите следующее выражение в префиксную форму:
`(5 + 4 + (2 - (3 - (6 + 4/5)))) / (3 * (6 - 2) * (2 - 7))`
#### Решение
[Code](../../src/sicp/chapter01/1_02.clj) | [Test](../../test/sicp/chapter01/1_02_test.clj)
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v5.7.0 - v5.8.0: v8::HeapProfiler::ObjectNameResolver Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v5.7.0 - v5.8.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1HeapProfiler.html">HeapProfiler</a></li><li class="navelem"><a class="el" href="classv8_1_1HeapProfiler_1_1ObjectNameResolver.html">ObjectNameResolver</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classv8_1_1HeapProfiler_1_1ObjectNameResolver-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::HeapProfiler::ObjectNameResolver Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8-profiler_8h_source.html">v8-profiler.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa9ac9e83806c7c746b652f435cf66622"><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1HeapProfiler_1_1ObjectNameResolver.html#aa9ac9e83806c7c746b652f435cf66622">GetName</a> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Object.html">Object</a> > object)=0</td></tr>
<tr class="separator:aa9ac9e83806c7c746b652f435cf66622"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Callback interface for retrieving user friendly names of global objects. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aa9ac9e83806c7c746b652f435cf66622"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* v8::HeapProfiler::ObjectNameResolver::GetName </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Object.html">Object</a> > </td>
<td class="paramname"><em>object</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns name to be used in the heap snapshot for given node. Returned string must stay alive until snapshot collection is completed. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8-profiler_8h_source.html">v8-profiler.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| Java |
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using System.Windows.Media;
using WPFControls;
namespace FormsApp
{
partial class Form1 : Form
{
private ElementHost _ctrlHost;
private SolidColorBrush _initBackBrush;
private FontFamily _initFontFamily;
private double _initFontSize;
private FontStyle _initFontStyle;
private FontWeight _initFontWeight;
private SolidColorBrush _initForeBrush;
private MyControl _wpfAddressCtrl;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
_ctrlHost = new ElementHost {Dock = DockStyle.Fill};
panel1.Controls.Add(_ctrlHost);
_wpfAddressCtrl = new MyControl();
_wpfAddressCtrl.InitializeComponent();
_ctrlHost.Child = _wpfAddressCtrl;
_wpfAddressCtrl.OnButtonClick +=
avAddressCtrl_OnButtonClick;
_wpfAddressCtrl.Loaded += avAddressCtrl_Loaded;
}
private void avAddressCtrl_Loaded(object sender, EventArgs e)
{
_initBackBrush = _wpfAddressCtrl.MyControlBackground;
_initForeBrush = _wpfAddressCtrl.MyControlForeground;
_initFontFamily = _wpfAddressCtrl.MyControlFontFamily;
_initFontSize = _wpfAddressCtrl.MyControlFontSize;
_initFontWeight = _wpfAddressCtrl.MyControlFontWeight;
_initFontStyle = _wpfAddressCtrl.MyControlFontStyle;
}
private void avAddressCtrl_OnButtonClick(
object sender,
MyControlEventArgs args)
{
if (args.IsOk)
{
lblAddress.Text = @"Street Address: " + args.MyStreetAddress;
lblCity.Text = @"City: " + args.MyCity;
lblName.Text = "Name: " + args.MyName;
lblState.Text = "State: " + args.MyState;
lblZip.Text = "Zip: " + args.MyZip;
}
else
{
lblAddress.Text = "Street Address: ";
lblCity.Text = "City: ";
lblName.Text = "Name: ";
lblState.Text = "State: ";
lblZip.Text = "Zip: ";
}
}
private void radioBackgroundOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlBackground = _initBackBrush;
}
private void radioBackgroundLightGreen_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlBackground = new SolidColorBrush(Colors.LightGreen);
}
private void radioBackgroundLightSalmon_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlBackground = new SolidColorBrush(Colors.LightSalmon);
}
private void radioForegroundOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlForeground = _initForeBrush;
}
private void radioForegroundRed_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlForeground = new SolidColorBrush(Colors.Red);
}
private void radioForegroundYellow_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlForeground = new SolidColorBrush(Colors.Yellow);
}
private void radioFamilyOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontFamily = _initFontFamily;
}
private void radioFamilyTimes_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontFamily = new FontFamily("Times New Roman");
}
private void radioFamilyWingDings_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontFamily = new FontFamily("WingDings");
}
private void radioSizeOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontSize = _initFontSize;
}
private void radioSizeTen_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontSize = 10;
}
private void radioSizeTwelve_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontSize = 12;
}
private void radioStyleOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontStyle = _initFontStyle;
}
private void radioStyleItalic_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontStyle = FontStyles.Italic;
}
private void radioWeightOriginal_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontWeight = _initFontWeight;
}
private void radioWeightBold_CheckedChanged(object sender, EventArgs e)
{
_wpfAddressCtrl.MyControlFontWeight = FontWeights.Bold;
}
}
}
// </snippet1> | Java |
using System.Collections.Immutable;
using JetBrains.Annotations;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Queries.Expressions;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;
using Microsoft.Extensions.Primitives;
namespace JsonApiDotNetCoreTests.IntegrationTests.ResourceDefinitions.Reading;
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
public sealed class MoonDefinition : HitCountingResourceDefinition<Moon, int>
{
private readonly IClientSettingsProvider _clientSettingsProvider;
protected override ResourceDefinitionExtensibilityPoints ExtensibilityPointsToTrack => ResourceDefinitionExtensibilityPoints.Reading;
public MoonDefinition(IResourceGraph resourceGraph, IClientSettingsProvider clientSettingsProvider, ResourceDefinitionHitCounter hitCounter)
: base(resourceGraph, hitCounter)
{
// This constructor will be resolved from the container, which means
// you can take on any dependency that is also defined in the container.
_clientSettingsProvider = clientSettingsProvider;
}
public override IImmutableSet<IncludeElementExpression> OnApplyIncludes(IImmutableSet<IncludeElementExpression> existingIncludes)
{
base.OnApplyIncludes(existingIncludes);
if (!_clientSettingsProvider.IsMoonOrbitingPlanetAutoIncluded ||
existingIncludes.Any(include => include.Relationship.Property.Name == nameof(Moon.OrbitsAround)))
{
return existingIncludes;
}
RelationshipAttribute orbitsAroundRelationship = ResourceType.GetRelationshipByPropertyName(nameof(Moon.OrbitsAround));
return existingIncludes.Add(new IncludeElementExpression(orbitsAroundRelationship));
}
public override QueryStringParameterHandlers<Moon> OnRegisterQueryableHandlersForQueryStringParameters()
{
base.OnRegisterQueryableHandlersForQueryStringParameters();
return new QueryStringParameterHandlers<Moon>
{
["isLargerThanTheSun"] = FilterByRadius
};
}
private static IQueryable<Moon> FilterByRadius(IQueryable<Moon> source, StringValues parameterValue)
{
bool isFilterOnLargerThan = bool.Parse(parameterValue);
return isFilterOnLargerThan ? source.Where(moon => moon.SolarRadius > 1m) : source.Where(moon => moon.SolarRadius <= 1m);
}
}
| Java |
/*
* Author: Minho Kim (ISKU)
* Date: March 3, 2018
* E-mail: minho.kim093@gmail.com
*
* https://github.com/ISKU/Algorithm
* https://www.acmicpc.net/problem/13169
*/
import java.util.*;
public class Main {
private static long[] array;
private static int N;
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
array = new long[N];
for (int i = 0; i < N; i++)
array[i] = sc.nextInt();
System.out.print(sum(0, 0));
}
private static long sum(int i, long value) {
if (i == N)
return value;
return sum(i + 1, value + array[i]) ^ sum(i + 1, value);
}
} | Java |
from django import forms
from miniURL.models import Redirection
#Pour faire un formulaire depuis un modèle. (/!\ héritage différent)
class RedirectionForm(forms.ModelForm):
class Meta:
model = Redirection
fields = ('real_url', 'pseudo')
# Pour récupérer des données cel apeut ce faire avec un POST
# ou directement en donnant un objet du modele :
#form = ArticleForm(instance=article) # article est bien entendu un objet d'Article quelconque dans la base de données
# Le champs est ainsi préremplit.
# Quand on a recu une bonne formeModele il suffit de save() pour la mettre en base | Java |
<!DOCTYPE html>
<!--
Copyright 2012 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
<title>CoolClock</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../../polymer/polymer.js"></script>
<link rel="import" href="cool-clock.html">
</head>
<body>
<cool-clock></cool-clock>
<cool-clock></cool-clock>
</body>
</html>
| Java |
package pp.iloc.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import pp.iloc.model.Num.NumKind;
import pp.iloc.model.Operand.Type;
import pp.iloc.parse.FormatException;
/** ILOC program.
* @author Arend Rensink
*/
public class Program {
/** Indexed list of all instructions in the program. */
private final List<Instr> instrList;
/**
* Indexed list of all operations in the program.
* This is the flattened list of instructions.
*/
private final List<Op> opList;
/** Mapping from labels defined in the program to corresponding
* index locations.
*/
private final Map<Label, Integer> labelMap;
/** (Partial) mapping from symbolic constants used in the program
* to corresponding numeric values. */
private final Map<Num, Integer> symbMap;
/** Creates a program with an initially empty instruction list. */
public Program() {
this.instrList = new ArrayList<>();
this.opList = new ArrayList<>();
this.labelMap = new LinkedHashMap<>();
this.symbMap = new LinkedHashMap<>();
}
/** Adds an instruction to the instruction list of this program.
* @throws IllegalArgumentException if the instruction has a known label
*/
public void addInstr(Instr instr) {
instr.setProgram(this);
instr.setLine(this.opList.size());
if (instr.hasLabel()) {
registerLabel(instr);
}
this.instrList.add(instr);
for (Op op : instr) {
this.opList.add(op);
}
}
/** Registers the label of a given instruction. */
void registerLabel(Instr instr) {
Label label = instr.getLabel();
Integer loc = this.labelMap.get(label);
if (loc != null) {
throw new IllegalArgumentException(String.format(
"Label %s already occurred at location %d", label, loc));
}
this.labelMap.put(label, instr.getLine());
}
/** Returns the current list of instructions of this program. */
public List<Instr> getInstr() {
return Collections.unmodifiableList(this.instrList);
}
/** Returns the operation at a given line number. */
public Op getOpAt(int line) {
return this.opList.get(line);
}
/** Returns the size of the program, in number of operations. */
public int size() {
return this.opList.size();
}
/**
* Returns the location at which a given label is defined, if any.
* @return the location of an instruction with the label, or {@code -1}
* if the label is undefined
*/
public int getLine(Label label) {
Integer result = this.labelMap.get(label);
return result == null ? -1 : result;
}
/** Assigns a fixed numeric value to a symbolic constant.
* It is an error to assign to the same constant twice.
* @param name constant name, without preceding '@'
*/
public void setSymb(Num symb, int value) {
if (this.symbMap.containsKey(symb)) {
throw new IllegalArgumentException("Constant '" + symb
+ "' already assigned");
}
this.symbMap.put(symb, value);
}
/**
* Returns the value with which a given symbol has been
* initialised, if any.
*/
public Integer getSymb(Num symb) {
return this.symbMap.get(symb);
}
/**
* Returns the value with which a given named symbol has been
* initialised, if any.
* @param name name of the symbol, without '@'-prefix
*/
public Integer getSymb(String name) {
return getSymb(new Num(name));
}
/**
* Checks for internal consistency, in particular whether
* all used labels are defined.
*/
public void check() throws FormatException {
List<String> messages = new ArrayList<>();
for (Instr instr : getInstr()) {
for (Op op : instr) {
messages.addAll(checkOpnds(op.getLine(), op.getArgs()));
}
}
if (!messages.isEmpty()) {
throw new FormatException(messages);
}
}
private List<String> checkOpnds(int loc, List<Operand> opnds) {
List<String> result = new ArrayList<>();
for (Operand opnd : opnds) {
if (opnd instanceof Label) {
if (getLine((Label) opnd) < 0) {
result.add(String.format("Line %d: Undefined label '%s'",
loc, opnd));
}
}
}
return result;
}
/**
* Returns a mapping from registers to line numbers
* in which they appear.
*/
public Map<String, Set<Integer>> getRegLines() {
Map<String, Set<Integer>> result = new LinkedHashMap<>();
for (Op op : this.opList) {
for (Operand opnd : op.getArgs()) {
if (opnd.getType() == Type.REG) {
Set<Integer> ops = result.get(((Reg) opnd).getName());
if (ops == null) {
result.put(((Reg) opnd).getName(),
ops = new LinkedHashSet<>());
}
ops.add(op.getLine());
}
}
}
return result;
}
/**
* Returns a mapping from (symbolic) variables to line numbers
* in which they appear.
*/
public Map<String, Set<Integer>> getSymbLines() {
Map<String, Set<Integer>> result = new LinkedHashMap<>();
for (Op op : this.opList) {
for (Operand opnd : op.getArgs()) {
if (!(opnd instanceof Num)) {
continue;
}
if (((Num) opnd).getKind() != NumKind.SYMB) {
continue;
}
String name = ((Num) opnd).getName();
Set<Integer> lines = result.get(name);
if (lines == null) {
result.put(name, lines = new LinkedHashSet<>());
}
lines.add(op.getLine());
}
}
return result;
}
/** Returns a line-by-line printout of this program. */
@Override
public String toString() {
StringBuilder result = new StringBuilder();
for (Map.Entry<Num, Integer> symbEntry : this.symbMap.entrySet()) {
result.append(String.format("%s <- %d%n", symbEntry.getKey()
.getName(), symbEntry.getValue()));
}
for (Instr instr : getInstr()) {
result.append(instr.toString());
result.append('\n');
}
return result.toString();
}
@Override
public int hashCode() {
return this.instrList.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Program)) {
return false;
}
Program other = (Program) obj;
if (!this.instrList.equals(other.instrList)) {
return false;
}
return true;
}
/** Returns a string consisting of this program in a nice layout.
*/
public String prettyPrint() {
StringBuilder result = new StringBuilder();
// first print the symbolic declaration map
int idSize = 0;
for (Num symb : this.symbMap.keySet()) {
idSize = Math.max(idSize, symb.getName().length());
}
for (Map.Entry<Num, Integer> symbEntry : this.symbMap.entrySet()) {
result.append(String.format("%-" + idSize + "s <- %d%n", symbEntry
.getKey().getName(), symbEntry.getValue()));
}
if (idSize > 0) {
result.append('\n');
}
// then print the instructions
int labelSize = 0;
int sourceSize = 0;
int targetSize = 0;
for (Instr i : getInstr()) {
labelSize = Math.max(labelSize, i.toLabelString().length());
if (i instanceof Op && ((Op) i).getOpCode() != OpCode.out) {
Op op = (Op) i;
sourceSize = Math.max(sourceSize, op.toSourceString().length());
targetSize = Math.max(targetSize, op.toTargetString().length());
}
}
for (Instr i : getInstr()) {
result.append(i.prettyPrint(labelSize, sourceSize, targetSize));
}
return result.toString();
}
}
| Java |
/** audio player styles **/
.audio-player, .audio-player div,.audio-player button {
margin: 0;
padding: 0;
border: none;
outline: none;
}
div.audio-player {
position: relative;
width: 100% !important;
height: 76px !important;
margin: 0 auto;
}
/* play/pause control */
.mejs-controls .mejs-button button {
cursor: pointer;
display: block;
position: absolute;
text-indent: -9999px;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
width: 25px;
height: 25px;
top: 61px;
left: 24px;
background: transparent url('../images/play.png') 2px 0px no-repeat;
z-index: 1;
}
.mejs-controls .mejs-pause button {
background-position:2px -28px;
}
/* mute/unmute control */
.mejs-controls .mejs-mute button, .mejs-controls .mejs-unmute button {
width: 25px;
height: 20px;
top: 65px;
right: 92px;
background: transparent url('../images/audio.png') no-repeat 0px 0px;
}
/* volume scrubber bar */
.mejs-controls div.mejs-horizontal-volume-slider {
position: absolute;
top: 13px;
right: 15px;
cursor: pointer;
}
/* time scrubber bar */
.mejs-controls div.mejs-time-rail {
width: 380px;
}
.mejs-controls .mejs-time-rail span {
position: absolute;
display: block;
width: 380px;
height: 14px;
top: 40px;
left: 0px;
cursor: pointer;
-webkit-border-radius: 0px 0px 2px 2px;
-moz-border-radius: 0px 0px 2px 2px;
border-radius: 0px 0px 2px 2px;
}
.mejs-controls .mejs-time-rail .mejs-time-total {
background: #e2e2e2;
width: 433px !important; /* fixes display bug using jQuery 1.8+ */
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.mejs-controls .mejs-time-rail .mejs-time-loaded {
top: 0;
left: 0;
width: 0;
background: #076D90;
}
.mejs-controls .mejs-time-rail .mejs-time-current {
top: 0;
left: 0;
width: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #28545b;
}
/* metallic sliders */
.mejs-controls .mejs-time-rail .mejs-time-handle {
position: absolute;
display: block;
width: 20px;
height: 20px;
top: -1px;
left: 0px !important;
background: url('../images/dot.png') no-repeat;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle {
position: absolute;
display: block;
width: 12px !important;
height: 14px !important;
top: -2px;
background: url('../images/dot1.png') no-repeat 0px 0px;
}
/* time progress tooltip */
.mejs-controls .mejs-time-rail .mejs-time-float {
position: absolute;
display: none;
width: 33px;
height: 23px;
top: -26px;
margin-left: 0;
z-index: 9999;
background: url('../images/time-box.png');
}
.mejs-controls .mejs-time-rail .mejs-time-float-current {
width: 33px;
display: block;
left: 0;
top: 4px;
font-size: 10px;
font-weight: bold;
color: #666;
text-align: center;
z-index: 9999;
}
/* volume scrubber bar */
.mejs-controls div.mejs-horizontal-volume-slider {
position: absolute;
top: 70px;
right: 12px;
cursor: pointer;
z-index: 1;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
width: 80px !important;
height: 5px !important;
background: #e2e2e2;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
position: absolute;
width: 0 ;
height: 5px !important;
top: 0px;
left: 0px;
background:#44c7f4;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
/*--responsive--*/
@media(max-width:1440px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 445px !important;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
left: 24px;
}
}
@media(max-width:1280px){
}
@media(max-width:1024px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 356px !important;
top: 23px;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
left: 24px;
top: 36px;
}
div.audio-player {
height: 48px !important;
}
.mejs-controls .mejs-mute button, .mejs-controls .mejs-unmute button {
top: 40px;
}
.mejs-controls div.mejs-horizontal-volume-slider {
top: 45px;
}
}
@media(max-width:800px){
div#mep_0 {
width: 100% !important;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
left: 14px;
top: 39px;
}
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 280px !important;
}
}
@media(max-width:667px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 239px !important;
}
}
@media(max-width:640px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 335px !important;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
left: 12px;
}
}
@media(max-width:600px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 312px !important;
}
}
@media(max-width:667px){
div#mep_0 {
width: 100% !important;
}
}
@media(max-width:568px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 292px !important;
}
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 293px !important;
}
}
@media(max-width:480px){
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
left: 40px;
}
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 433px !important;
}
.audio-player div{
width:72px !important;
}
}
@media(max-width:414px){
.jp-volume-controls {
left: 122px;
}
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 367px !important;
}
@media(max-width:384px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 271px !important;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
width: 22px;
height: 22px;
left: 42px;
background: transparent url('../images/play.png') 0px -1px no-repeat;
background-size: 22px;
top: 41px;
left: 10px;
}
.mejs-controls .mejs-pause button {
background-position: 0px -23px;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
width: 72px !important;
}
}
@media(max-width:320px){
.mejs-controls .mejs-time-rail .mejs-time-total {
width: 271px !important;
}
.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
width: 22px;
height: 22px;
left: 42px;
background: transparent url('../images/play.png') 0px -1px no-repeat;
background-size: 22px;
top: 41px;
left: 10px;
}
.mejs-controls .mejs-pause button {
background-position: 0px -23px;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
width: 72px !important;
}
}
| Java |
<a href="https://sweetalert2.github.io/">
<img src="./assets/swal2-logo.png" width="498" alt="SweetAlert2">
</a>
A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement <br> for JavaScript's popup boxes. Zero dependencies.
---
### [Installation](https://sweetalert2.github.io/#download) | [Usage](https://sweetalert2.github.io/#usage) | [Examples](https://sweetalert2.github.io/#examples) | [Recipe gallery](https://sweetalert2.github.io/recipe-gallery/) | [Themes](https://github.com/sweetalert2/sweetalert2-themes) | [React](https://github.com/sweetalert2/sweetalert2-react-content) | [Angular](https://github.com/sweetalert2/ngx-sweetalert2) | [:heart: Donate](https://sweetalert2.github.io/#donations)
---
:moneybag: [Get $100 in free credits with DigitalOcean!](https://m.do.co/c/12907f2ba0bf)
---
Sponsors
--------
For all questions related to sponsorship please contact me via email limon.monte@protonmail.com
[<img src="https://sweetalert2.github.io/images/sponsors/flowcrypt-banner.png">](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=banner)
[<img src="https://sweetalert2.github.io/images/plus.png" width="80">](SPONSORS.md) | [<img src="https://avatars2.githubusercontent.com/u/28631236?s=80&v=4" width="80">](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/mybitcoinslots.png" width="80">](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/torc-stark.png" width="80">](https://torcstark.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/LifeDigital.png" width="80">](https://lifedigitalwiki.org/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/coderubik.png" width="80">](https://coderubik.com/?utm_source=sweetalert2&utm_medium=logo)
-|-|-|-|-|-
[Become a sponsor](SPONSORS.md) | [FlowCrypt](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [My Bitcoin slots](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo) | [TorcStark](https://torcstark.com/) | [life digital](https://lifedigitalwiki.org/?utm_source=sweetalert2&utm_medium=logo) | [Code Rubik](https://coderubik.com/?utm_source=sweetalert2&utm_medium=logo)
[<img src="https://sweetalert2.github.io/images/sponsors/halvinlaina.png" width="80">](https://halvinlaina.fi/) | [<img src="https://avatars0.githubusercontent.com/u/3986989?s=80&v=4" width="80">](https://github.com/tiagostutz) | [<img src="https://sweetalert2.github.io/images/sponsors/sebaebc.png" width="80">](https://github.com/sebaebc)
-|-|-
[Halvin Laina](https://halvinlaina.fi/) | [Tiago de Oliveira Stutz](https://github.com/tiagostutz) | [SebaEBC](https://github.com/sebaebc)
NSFW Sponsors
-------------
[<img src="https://sweetalert2.github.io/images/sponsors/sexdollsoff.png" width="80">](https://www.sexdollsoff.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/realsexdoll.png" width="80">](https://realsexdoll.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/yourdoll.jpg" width="80">](https://www.yourdoll.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/annies-dollhouse.png" width="80">](https://anniesdollhouse.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/sexdollcenter.png" width="80">](https://sexdollcenter.vip/) |
-|-|-|-|-
[SexDollsOff](https://www.sexdollsoff.com/) | [RealSexDoll](https://realsexdoll.com/) | [Your Doll](https://www.yourdoll.com/) | [Annie's Dollhouse](https://anniesdollhouse.com/) | [Sex Doll Center](https://sexdollcenter.vip/)
[<img src="https://sweetalert2.github.io/images/sponsors/sexangelbaby.png" width="80">](https://sexangelbaby.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/theadulttoyfinder.png" width="80">](https://theadulttoyfinder.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/fresh-materials.png" width="80">](https://www.thefreshmaterials.com/?utm_source=sweetalert2&utm_medium=logo)
-|-|-
[SexAngelbaby](https://sexangelbaby.com/) | [The Adult Toy Finder](https://theadulttoyfinder.com/?utm_source=sweetalert2&utm_medium=logo) | [Fresh Materials](https://www.thefreshmaterials.com/?utm_source=sweetalert2&utm_medium=logo)
[<img src="https://sweetalert2.github.io/images/sponsors/joylovedolls.png" width="80">](https://www.joylovedolls.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/my-sex-toy-guide.jpg" width="80">](https://www.mysextoyguide.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/best-blowjob-machines.jpg" width="80">](https://www.bestblowjobmachines.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/sextoycollective.jpg" width="80">](https://sextoycollective.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/doctorclimax.png" width="80">](https://doctorclimax.com/)
-|-|-|-|-
[Joy Love Dolls](https://www.joylovedolls.com/?utm_source=sweetalert2&utm_medium=logo) | [My Sex Toy Guide](https://www.mysextoyguide.com/?utm_source=sweetalert2&utm_medium=logo) | [Best Blowjob Machines](https://www.bestblowjobmachines.com/?utm_source=sweetalert2&utm_medium=logo) | [STC](https://sextoycollective.com/?utm_source=sweetalert2&utm_medium=logo) | [DoctorClimax](https://doctorclimax.com/)
Support and Donations
---------------------
Has SweetAlert2 helped you create an amazing application? You can show your support via [GitHub Sponsors](https://github.com/sponsors/limonte)
Alternative ways for donations (PayPal, cryptocurrencies, etc.) are listed here: https://sweetalert2.github.io/#donations
### [Hall of Donators :trophy:](DONATIONS.md)
| Java |
<!DOCTYPE html>
<html class="no-js " lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="keywords" content="jQuery,API,中文,jquery api,1.11,def.resolveWith(c,[a])"/>
<meta name="description" content="jQuery API 1.12.0 中文手册最新版,在线地址:http://jquery.cuishifeng.cn"/>
<meta name="robots" content="all">
<meta name="renderer" content="webkit">
<meta name="author" content="Shifone -http://jquery.cuishifeng.cn"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>def.resolveWith(c,[a]) | jQuery API 3.1.0 中文文档 | jQuery API 在线手册</title>
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="stylesheet" href="css/common.css?v=20151229">
</head>
<body >
<!--[if lt IE 9]>
<div class="browser-happy">
<div class="content">
<p>作为前端开发人员,还有这么low的浏览器,再不更新会遭鄙视的~~</p>
<a href="http://browsehappy.com/">立即更新</a>
</div>
</div>
<![endif]-->
<div class="main-container" >
<div id="main-wraper" class="main-wraper">
<div id="tips-con" style="display: block;" data-key="content-bkc">
<div id="tips-body" class="tips-body">推荐办理招商信用卡,新户开卡礼,积分享美食,更可获得4G可通话平板一台~<a href="http://www.cuishifeng.cn/go/card" target="_blank">click here</a></div>
</div>
<header class="top-nav">
<a href="index.html" class="pc" title="">首页</a> > <span class="sub-title">延迟对象</span> > def.resolveWith(c,[a])
<a class="source" href="source.html">源码下载</a>
</header>
<div id="content" >
<h2><span>返回值:Deferred Object</span>deferred.resolveWith(context,[args])</h2>
<h3>概述</h3>
<div class="desc">
<p>解决递延对象,并根据给定的上下文和参数调用任何完成的回调函数。</p>
<div class="longdesc">
<p>当递延被解决,任何doneCallbacks 添加的<a href="deferred.then.html" tppabs="deferred.then.html">deferred.then</a>或<a href="deferred.fail.html" tppabs="deferred.fail.html">deferred.fail</a>被调用。回调按他们添加的顺序执行。每个回调传递的args在deferred.reject()中调用。之后添加任何failCallbacks递延被拒绝进入状态时,立即执行添加,使用的参数被传递给.reject()调用。有关详细信息,请参阅文件<a href="http://api.jquery.com/category/deferred-object/">Deferred object</a> 。</p>
</div>
</div>
<h3>参数</h3>
<div class="parameter">
<h4><strong>context</strong><em>V1.5</em></h4>
<p>上下文作为this对象传递给 doneCallbacks 。 </p>
<h4><strong>args</strong><em>V1.5</em></h4>
<p>传递给doneCallbacks的可选参数 </p>
</div>
</div>
<div class="navigation clearfix">
<span class="alignleft">上一篇:<a href="deferred.resolve.html">def.resolve(args)</a></span>
<span class="alignright">下一篇:<a href="deferred.then.html">def.then(d[,f][,p])</a></span>
</div>
<div class="donate-con">
<div class="donate-btn">捐助</div>
<div class="donate-body">
<div class="donate-tips">本站为非盈利网站,所有的捐赠收入将用于支付带宽、服务器费用,您的支持将是本站撑下去的最大动力!</div>
<div class="donate-img"> <a href="source.html"><img src="images/qr_code.png" height="350" width="350" alt=""></a> </div>
</div>
</div>
</div><!-- main-wraper end -->
<footer id="footer-con" class="footer" style="display:none;" >
<p id="footer">Copyright © <a href="http://www.cuishifeng.cn" target="_blank">Shifone</a> 2012 - 2016 All rights reserved. </p>
</footer>
</div><!-- main -container end -->
<aside class="left-panel left-panel-hide" id="left-panel">
<div class="auto-query-con" >
<input type="text" name="query" id="autoquery" placeholder="请输入关键字"/>
</div>
<nav class="navigation">
<ul id="main-menu" class="main-menu">
<li class="">
<a class="menu-title" id="dashboard-menu" href="index.html">
<i class="fa fa-home"></i><span class="nav-label">Dashboard</span>
</a>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">核心</span>
</a>
<ul class="sub-menu">
<li><a href="jQuery_selector_context.html">jQuery([sel,[context]])</a></li>
<li><a href="jQuery_html_ownerDocument.html">jQuery(html,[ownerDoc])</a><sup>1.8*</sup></li>
<li><a href="jQuery_callback.html">jQuery(callback)</a></li>
<li><a href="jQuery.holdReady.html">jQuery.holdReady(hold)</a><sup>1.6+</sup></li>
<li><a href="each.html">each(callback)</a></li>
<li><a href="size.html">size()</a></li>
<li><a href="length.html">length</a></li>
<li><a href="selector.html">selector</a></li>
<li><a href="context.html">context</a></li>
<li><a href="get.html">get([index])</a></li>
<li><a href="index_1.html">index([selector|element])</a></li>
<li><a href="data.html">data([key],[value])</a></li>
<li><a href="removeData.html">removeData([name|list])</a><sup>1.7*</sup></li>
<li><a href="jQuery.data.html"><del>$.data(ele,[key],[val])</del></a><sup>1.8-</sup></li>
<li><a href="queue.html" title="queue(element,[queueName])">queue(e,[q])</a></li>
<li><a href="dequeue.html" title="dequeue([queueName])">dequeue([queueName])</a></li>
<li><a href="clearQueue.html" title="clearQueue([queueName])">clearQueue([queueName])</a></li>
<li><a href="jQuery.fn.extend.html">jQuery.fn.extend(object)</a></li>
<li><a href="jQuery.extend_object.html">jQuery.extend(object)</a></li>
<li><a href="jQuery.noConflict.html" title="jQuery.noConflict([extreme])">jQuery.noConflict([ex])</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">选择器</span>
</a>
<ul class="sub-menu">
<li><a href="id.html">#id</a></li>
<li><a href="element.html">element</a></li>
<li><a href="class.html">.class</a></li>
<li><a href="all.html">*</a></li>
<li><a href="multiple.html">selector1,selector2,selectorN</a></li>
<li><a href="descendant.html">ancestor descendant</a></li>
<li><a href="child.html">parent > child</a></li>
<li><a href="next_1.html">prev + next</a></li>
<li><a href="siblings_1.html">prev ~ siblings</a></li>
<li><a href="first_1.html">:first</a></li>
<li><a href="not_1.html">:not(selector)</a></li>
<li><a href="even.html">:even</a></li>
<li><a href="odd.html">:odd</a></li>
<li><a href="eq_1.html">:eq(index)</a></li>
<li><a href="gt.html">:gt(index)</a></li>
<li><a href="lang.html">:lang</a><sup>1.9+</sup></li>
<li><a href="last_1.html">:last</a></li>
<li><a href="lt.html">:lt(index)</a></li>
<li><a href="header.html">:header</a></li>
<li><a href="animated.html">:animated</a></li>
<li><a href="focus_1.html">:focus</a><sup>1.6+</sup></li>
<li><a href="root.html">:root</a><sup>1.9+</sup></li>
<li><a href="target.html">:target</a><sup>1.9+</sup></li>
<li><a href="contains.html">:contains(text)</a></li>
<li><a href="empty_1.html">:empty</a></li>
<li><a href="has_1.html">:has(selector)</a></li>
<li><a href="parent_1.html">:parent</a></li>
<li><a href="hidden_1.html">:hidden</a></li>
<li><a href="visible.html">:visible</a></li>
<li><a href="attributeHas.html">[attribute]</a></li>
<li><a href="attributeEquals.html">[attribute=value]</a></li>
<li><a href="attributeNotEqual.html">[attribute!=value]</a></li>
<li><a href="attributeStartsWith.html">[attribute^=value]</a></li>
<li><a href="attributeEndsWith.html">[attribute$=value]</a></li>
<li><a href="attributeContains.html">[attribute*=value]</a></li>
<li><a href="attributeMultiple.html">[attrSel1][attrSel2][attrSelN]</a></li>
<li><a href="firstChild.html">:first-child</a></li>
<li><a href="firstOfType.html">:first-of-type</a><sup>1.9+</sup></li>
<li><a href="lastChild.html">:last-child</a></li>
<li><a href="lastOfType.html">:last-of-type</a><sup>1.9+</sup></li>
<li><a href="nthChild.html">:nth-child</a></li>
<li><a href="nthLastChild.html">:nth-last-child</a><sup>1.9+</sup></li>
<li><a href="nthLastOfType.html">:nth-last-of-type</a><sup>1.9+</sup></li>
<li><a href="nthOfType.html">:nth-of-type</a><sup>1.9+</sup></li>
<li><a href="onlyChild.html">:only-child</a></li>
<li><a href="onlyOfType.html">:only-of-type</a><sup>1.9+</sup></li>
<li><a href="input.html">:input</a></li>
<li><a href="text_1.html">:text</a></li>
<li><a href="password.html">:password</a></li>
<li><a href="radio.html">:radio</a></li>
<li><a href="checkbox.html">:checkbox</a></li>
<li><a href="submit_1.html">:submit</a></li>
<li><a href="image.html">:image</a></li>
<li><a href="reset.html">:reset</a></li>
<li><a href="button.html">:button</a></li>
<li><a href="file_1.html">:file</a></li>
<li><a href="enabled_1.html">:enabled</a></li>
<li><a href="disabled_1.html">:disabled</a></li>
<li><a href="checked_1.html">:checked</a></li>
<li><a href="selected_1.html">:selected</a></li>
<li><a href="jQuery.escapeSelector.html">$.escapeSelector(selector)</a><sup>3.0+</sup></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">Ajax</span>
</a>
<ul class="sub-menu">
<li><a href="jQuery.Ajax.html">$.ajax(url,[settings])</a></li>
<li><a href="load.html">load(url,[data],[callback])</a></li>
<li><a href="jQuery.get.html">$.get(url,[data],[fn],[type])</a></li>
<li><a href="jQuery.getJSON.html">$.getJSON(url,[data],[fn])</a></li>
<li><a href="jQuery.getScript.html">$.getScript(url,[callback])</a></li>
<li><a href="jQuery.post.html">$.post(url,[data],[fn],[type])</a></li>
<li><a href="ajaxComplete.html">ajaxComplete(callback)</a></li>
<li><a href="ajaxError.html">ajaxError(callback)</a></li>
<li><a href="ajaxSend.html">ajaxSend(callback)</a></li>
<li><a href="ajaxStart.html">ajaxStart(callback)</a></li>
<li><a href="ajaxStop.html">ajaxStop(callback)</a></li>
<li><a href="ajaxSuccess.html">ajaxSuccess(callback)</a></li>
<li><a href="jQuery.ajaxPrefilter.html">$.ajaxPrefilter([type],fn)</a></li>
<li><a href="jQuery.ajaxSetup.html">$.ajaxSetup([options])</a></li>
<li><a href="serialize.html">serialize()</a></li>
<li><a href="serializearray.html">serializearray()</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">属性</span>
</a>
<ul class="sub-menu">
<li><a href="attr.html" title="attr(name|properties|key,value|fn)">attr(name|pro|key,val|fn)</a></li>
<li><a href="removeAttr.html">removeAttr(name)</a></li>
<li><a href="prop.html" title="prop(name|properties|key,value|fn)">prop(n|p|k,v|f)</a><sup>1.6+</sup></li>
<li><a href="removeProp.html">removeProp(name)</a><sup>1.6+</sup></li>
<li><a href="addClass.html">addClass(class|fn)</a></li>
<li><a href="removeClass.html">removeClass([class|fn])</a></li>
<li><a href="toggleClass.html">toggleClass(class|fn[,sw])</a></li>
<li><a href="html.html">html([val|fn])</a></li>
<li><a href="text.html">text([val|fn])</a></li>
<li><a href="val.html">val([val|fn|arr])</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">CSS</span>
</a>
<ul class="sub-menu">
<li><a href="css.html" title="css(name|properties|[,value|fn])">css(name|pro|[,val|fn])</a><sup>1.9*</sup></li>
<li><a href="jQuery.cssHooks.html">jQuery.cssHooks</a></li>
<li><a href="offset.html">offset([coordinates])</a></li>
<li><a href="position.html">position()</a></li>
<li><a href="scrollTop.html">scrollTop([val])</a></li>
<li><a href="scrollLeft.html">scrollLeft([val])</a></li>
<li><a href="height.html">heigh([val|fn])</a></li>
<li><a href="width.html">width([val|fn])</a></li>
<li><a href="innerHeight.html">innerHeight()</a></li>
<li><a href="innerWidth.html">innerWidth()</a></li>
<li><a href="outerHeight.html">outerHeight([soptions])</a></li>
<li><a href="outerWidth.html">outerWidth([options])</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">文档处理</span>
</a>
<ul class="sub-menu">
<li><a href="append.html">append(content|fn)</a></li>
<li><a href="appendTo.html">appendTo(content)</a></li>
<li><a href="prepend.html">prepend(content|fn)</a></li>
<li><a href="prependTo.html">prependTo(content)</a></li>
<li><a href="after.html">after(content|fn)</a></li>
<li><a href="before.html">before(content|fn)</a></li>
<li><a href="insertAfter.html">insertAfter(content)</a></li>
<li><a href="insertBefore.html">insertBefore(content)</a></li>
<li><a href="wrap.html" title="wrap(html|element|fn)">wrap(html|ele|fn)</a></li>
<li><a href="unwrap.html">unwrap()</a></li>
<li><a href="wrapAll.html" title="wrapall(html|element)">wrapall(html|ele)</a></li>
<li><a href="wrapInner.html" title="wrapInner(html|element|fn)">wrapInner(html|ele|fn)</a></li>
<li><a href="replaceWith.html">replaceWith(content|fn)</a></li>
<li><a href="replaceAll.html">replaceAll(selector)</a></li>
<li><a href="empty.html">empty()</a></li>
<li><a href="remove.html">remove([expr])</a></li>
<li><a href="detach.html">detach([expr])</a></li>
<li><a href="clone.html">clone([Even[,deepEven]])</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">筛选</span>
</a>
<ul class="sub-menu">
<li><a href="eq.html">eq(index|-index)</a></li>
<li><a href="first.html">first()</a></li>
<li><a href="last.html">last()</a></li>
<li><a href="hasClass.html">hasClass(class)</a></li>
<li><a href="filter.html" title="filter(expr|object|element|fn)">filter(expr|obj|ele|fn)</a></li>
<li><a href="is.html" title="is(expr|object|element|fn)">is(expr|obj|ele|fn)</a><sup>1.6*</sup></li>
<li><a href="map.html">map(callback)</a></li>
<li><a href="has.html" title="has(expr|element)">has(expr|ele)</a></li>
<li><a href="not.html" title="not(expr|element|fn)">not(expr|ele|fn)</a></li>
<li><a href="slice.html" title="slice(start,[end])">slice(start,[end])</a></li>
<li><a href="children.html">children([expr])</a></li>
<li><a href="closest.html" title="closest(expr,[context]|object|element)">closest(e|o|e)</a><sup>1.7*</sup></li>
<li><a href="find.html" title="find(expr|object|element)">find(e|o|e)</a><sup>1.6*</sup></li>
<li><a href="next.html">next([expr])</a></li>
<li><a href="nextAll.html">nextAll([expr])</a></li>
<li><a href="nextUntil.html" title="nextUntil([expr|element][,filter])">nextUntil([e|e][,f])</a><sup>1.6*</sup></li>
<li><a href="offsetParent.html">offsetParent()</a></li>
<li><a href="parent.html">parent([expr])</a></li>
<li><a href="parents.html">parents([expr])</a></li>
<li><a href="parentsUntil.html" title="parentsUntil([expr|element][,filter])">parentsUntil([e|e][,f])</a><sup>1.6*</sup></li>
<li><a href="prev.html">prev([expr])</a></li>
<li><a href="prevAll.html">prevall([expr])</a></li>
<li><a href="prevUntil.html" title="prevUntil([expr|element][,filter])">prevUntil([e|e][,f])</a><sup>1.6*</sup></li>
<li><a href="siblings.html">siblings([expr])</a></li>
<li><a href="add.html" title="add(expr|element|html|object[,context])">add(e|e|h|o[,c])</a></li>
<li><a href="andSelf.html">andSelf()</a></li>
<li><a href="addBack.html">addBack()</a><sup>1.9+</sup></li>
<li><a href="contents.html">contents()</a></li>
<li><a href="end.html">end()</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">事件</span>
</a>
<ul class="sub-menu">
<li><a href="ready.html">ready(fn)</a></li>
<li><a href="on.html" title="on(events,[selector],[data],fn)">on(eve,[sel],[data],fn)</a><sup>1.7+</sup></li>
<li><a href="off.html" title="off(events,[selector],[data],fn)">off(eve,[sel],[fn])</a><sup>1.7+</sup></li>
<li><a href="bind.html"><del>bind(type,[data],fn)</del></a><sup>3.0-</sup></li>
<li><a href="one.html">one(type,[data],fn)</a></li>
<li><a href="trigger.html">trigger(type,[data])</a></li>
<li><a href="triggerHandler.html">triggerHandler(type, [data])</a></li>
<li><a href="unbind.html" title="unbind(type,[data|fn])"><del>unbind(t,[d|f])</del></a><sup>3.0-</sup></li>
<li><a href="live.html"><del>live(type,[data],fn)</del></a><sup>1.7-</sup></li>
<li><a href="die.html"><del>die(type,[fn])</del></a><sup>1.7-</sup></li>
<li><a href="delegate.html" title="delegate(selector,[type],[data],fn)"><del>delegate(s,[t],[d],fn)</del></a><sup>3.0-</sup></li>
<li><a href="undelegate.html" title="undelegate([selector,[type],fn])"><del>undelegate([s,[t],fn])</del></a><sup>3.0-</sup></li>
<li><a href="hover.html">hover([over,]out)</a></li>
<li><a href="toggle.html">toggle(fn, fn2, [fn3, fn4, ...])</a></li>
<li><a href="blur.html">blur([[data],fn])</a></li>
<li><a href="change.html">change([[data],fn])</a></li>
<li><a href="click.html">click([[data],fn])</a></li>
<li><a href="dblclick_1.html">dblclick([[data],fn])</a></li>
<li><a href="error.html">error([[data],fn])</a></li>
<li><a href="focus.html">focus([[data],fn])</a></li>
<li><a href="focusin.html">focusin([data],fn)</a></li>
<li><a href="focusout.html">focusout([data],fn)</a></li>
<li><a href="keydown.html">keydown([[data],fn])</a></li>
<li><a href="keypress.html">keypress([[data],fn])</a></li>
<li><a href="keyup.html">keyup([[data],fn])</a></li>
<li><a href="mousedown.html">mousedown([[data],fn])</a></li>
<li><a href="mouseenter.html">mouseenter([[data],fn])</a></li>
<li><a href="mouseleave.html">mouseleave([[data],fn])</a></li>
<li><a href="mousemove.html">mousemove([[data],fn])</a></li>
<li><a href="mouseout.html">mouseout([[data],fn])</a></li>
<li><a href="mouseover.html">mouseover([[data],fn])</a></li>
<li><a href="mouseup.html">mouseup([[data],fn])</a></li>
<li><a href="resize.html">resize([[data],fn])</a></li>
<li><a href="scroll.html">scroll([[data],fn])</a></li>
<li><a href="select.html">select([[data],fn])</a></li>
<li><a href="submit.html">submit([[data],fn])</a></li>
<li><a href="unload.html">unload([[data],fn])</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">效果</span>
</a>
<ul class="sub-menu">
<li><a href="show.html" title="show([speed,[easing],[fn]])">show([s,[e],[fn]])</a></li>
<li><a href="hide.html" title="hide([speed,[easing],[fn]])">hide([s,[e],[fn]])</a></li>
<li><a href="toggle.html" title="toggle([speed],[easing],[fn])">toggle([s],[e],[fn])</a></li>
<li><a href="slideDown.html" title="slideDown([speed],[easing],[fn])">slideDown([s],[e],[fn])</a></li>
<li><a href="slideUp.html" title="slideUp([speed,[easing],[fn]])">slideUp([s,[e],[fn]])</a></li>
<li><a href="slideToggle.html" title="slideToggle([speed],[easing],[fn])">slideToggle([s],[e],[fn])</a></li>
<li><a href="fadeIn.html" title="fadeIn([speed],[easing],[fn])">fadeIn([s],[e],[fn])</a></li>
<li><a href="fadeOut.html" title="fadeOut([speed],[easing],[fn])">fadeOut([s],[e],[fn])</a></li>
<li><a href="fadeTo.html" title="fadeTo([[speed],opacity,[easing],[fn]])">fadeTo([[s],o,[e],[fn]])</a></li>
<li><a href="fadeToggle.html" title="fadeToggle([speed,[easing],[fn]])">fadeToggle([s,[e],[fn]])</a></li>
<li><a href="animate.html" title="animate(params,[speed],[easing],[fn])">animate(p,[s],[e],[fn])</a><sup>1.8*</sup></li>
<li><a href="stop.html" title="stop([clearQueue],[jumpToEnd])">stop([c],[j])</a><sup>1.7*</sup></li>
<li><a href="delay.html" title="delay(duration,[queueName])">delay(d,[q])</a></li>
<li><a href="finish.html" title="finish([queue])">finish([queue])</a><sup>1.9+</sup></li>
<li><a href="jQuery.fx.off.html">jQuery.fx.off</a></li>
<li><a href="jQuery.fx.interval.html">jQuery.fx.interval</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">工具</span>
</a>
<ul class="sub-menu">
<li><a href="jQuery.support.html">$.support</a></li>
<li><a href="jQuery.browser.html"><del>$.browser</del></a><sup>1.9-</sup></li>
<li><a href="jQuery.browser.version.html">$.browser.version</a></li>
<li><a href="jQuery.boxModel.html"><del>$.boxModel</del></a></li>
<li><a href="jQuery.each.html">$.each(object,[callback])</a></li>
<li><a href="jQuery.extend.html">$.extend([d],tgt,obj1,[objN])</a></li>
<li><a href="jQuery.grep.html">$.grep(array,fn,[invert])</a></li>
<li><a href="jQuery.sub.html"><del>$.sub()</del></a><sup>1.9-</sup></li>
<li><a href="jQuery.when.html">$.when(deferreds)</a></li>
<li><a href="jQuery.makeArray.html">$.makeArray(obj)</a></li>
<li><a href="jQuery.map.html">$.map(arr|obj,callback)</a><sup>1.6*</sup></li>
<li><a href="jQuery.inArray.html">$.inArray(val,arr,[from])</a></li>
<li><a href="jQuery.toArray.html">$.toArray()</a></li>
<li><a href="jQuery.merge.html">$.merge(first,second)</a></li>
<li><a href="jQuery.unique.html"><del>$.unique(array)</del></a><sup>3.0-</sup></li>
<li><a href="jQuery.uniqueSort.html">$.uniqueSort(array)</a><sup>3.0+</sup></li>
<li><a href="jQuery.parseJSON.html"><del>$.parseJSON(json)</del></a><sup>3.0-</sup></li>
<li><a href="jQuery.parseXML.html">$.parseXML(data)</a></li>
<li><a href="jQuery.noop.html">$.noop</a></li>
<li><a href="jQuery.proxy.html">$.proxy(function,context)</a></li>
<li><a href="jQuery.contains.html" title="$.contains(container,contained)">$.contains(c,c)</a></li>
<li><a href="jQuery.type.html">$.type(obj)</a></li>
<li><a href="jQuery.isArray.html">$.isArray(obj)</a></li>
<li><a href="jQuery.isFunction.html">$.isFunction(obj)</a></li>
<li><a href="jQuery.isEmptyObject.html">$.isEmptyObject(obj)</a></li>
<li><a href="jQuery.isPlainObject.html">$.isPlainObject(obj)</a></li>
<li><a href="jQuery.isWindow.html">$.isWindow(obj)</a></li>
<li><a href="jQuery.isNumeric.html">$.isNumeric(value)</a><sup>1.7+</sup></li>
<li><a href="jQuery.trim.html">$.trim(str)</a></li>
<li><a href="jQuery.param.html">$.param(obj,[traditional])</a></li>
<li><a href="jQuery.error.html">$.error(message)</a></li>
<li><a href="jquery.html">$.fn.jquery</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">事件对象</span>
</a>
<ul class="sub-menu">
<li><a href="event.currentTarget.html">eve.currentTarget</a></li>
<li><a href="event.data.html">eve.data</a></li>
<li><a href="event.delegateTarget.html">eve.delegateTarget</a><sup>1.7+</sup></li>
<li><a href="event.isDefaultPrevented.html">eve.isDefaultPrevented()</a></li>
<li><a href="event.isImmediatePropagationStopped.html" title="event.isImmediatePropagationStopped">eve.isImmediatePropag...()</a></li>
<li><a href="event.isPropagationStopped.html">eve.isPropagationStopped()</a></li>
<li><a href="event.namespace.html">eve.namespace</a></li>
<li><a href="event.pageX.html">eve.pageX</a></li>
<li><a href="event.pageY.html">eve.pageY</a></li>
<li><a href="event.preventDefault.html">eve.preventDefault()</a></li>
<li><a href="event.relatedTarget.html">eve.relatedTarget</a></li>
<li><a href="event.result.html">eve.result</a></li>
<li><a href="event.stopImmediatePropagation.html" title="event.stopImmediatePropagation">eve.stopImmediatePro...()</a></li>
<li><a href="event.stopPropagation.html">eve.stopPropagation()</a></li>
<li><a href="event.target.html">eve.target</a></li>
<li><a href="event.timeStamp.html">eve.timeStamp</a></li>
<li><a href="event.type.html">eve.type</a></li>
<li><a href="event.which.html">eve.which</a></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">延迟对象</span>
</a>
<ul class="sub-menu">
<li><a href="deferred.done.html" title="deferred.done(doneCallbacks[,doneCallbacks])">def.done(d,[d])</a></li>
<li><a href="deferred.fail.html">def.fail(failCallbacks)</a></li>
<li><a href="deferred.isRejected.html"><del>def.isRejected()</del></a><sup>1.7-</sup></li>
<li><a href="deferred.isResolved.html"><del>def.isResolved()</del></a><sup>1.7-</sup></li>
<li><a href="deferred.reject.html">def.reject(args)</a></li>
<li><a href="deferred.rejectWith.html" title="deferred.rejectWith(context,[args])">def.rejectWith(c,[a])</a></li>
<li><a href="deferred.resolve.html">def.resolve(args)</a></li>
<li><a href="deferred.resolveWith.html" title="deferred.resolveWith(context,[args])">def.resolveWith(c,[a])</a></li>
<li><a href="deferred.then.html" title="deferred.then(doneCallbacks,failCallbacks[, progressCallbacks])">def.then(d[,f][,p])</a><sup>1.8*</sup></li>
<li><a href="deferred.promise.html" title="deferred.promise([type],[target])">def.promise([ty],[ta])</a><sup>1.6+</sup></li>
<li><a href="deferred.pipe.html" title="deferred.pipe([doneFilter],[failFilter],[progressFilter])"><del>def.pipe([d],[f],[p])</del></a><sup>1.8-</sup></li>
<li><a href="deferred.always.html" title="deferred.always(alwaysCallbacks,[alwaysCallbacks])">def.always(al,[al])</a><sup>1.6+</sup></li>
<li><a href="deferred.notify.html">def.notify(args)</a><sup>1.7+</sup></li>
<li><a href="deferred.notifyWith.html" title="deferred.notifyWith(context,[args])">def.notifyWith(c,[a])</a><sup>1.7+</sup></li>
<li><a href="deferred.progress.html" title="deferred.progress(progressCallbacks)">def.progress(proCal)</a><sup>1.7+</sup></li>
<li><a href="deferred.state.html">def.state()</a><sup>1.7+</sup></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">回调函数</span>
</a>
<ul class="sub-menu">
<li><a href="callbacks.add.html">cal.add(callbacks)</a><sup>1.7+</sup></li>
<li><a href="callbacks.disable.html">cal.disable()</a><sup>1.7+</sup></li>
<li><a href="callbacks.empty.html">cal.empty()</a><sup>1.7+</sup></li>
<li><a href="callbacks.fire.html">cal.fire(arguments)</a><sup>1.7+</sup></li>
<li><a href="callbacks.fired.html">cal.fired()</a><sup>1.7+</sup></li>
<li><a href="callbacks.fireWith.html" title="callbacks.fireWith([context] [, args])">cal.fireWith([c] [,a])</a><sup>1.7+</sup></li>
<li><a href="callbacks.has.html">cal.has(callback)</a><sup>1.7+</sup></li>
<li><a href="callbacks.lock.html">cal.lock()</a><sup>1.7+</sup></li>
<li><a href="callbacks.locked.html">cal.locked()</a><sup>1.7+</sup></li>
<li><a href="callbacks.remove.html">cal.remove(callbacks)</a><sup>1.7+</sup></li>
<li><a href="jQuery.callbacks.html">$.callbacks(flags)</a><sup>1.7+</sup></li>
</ul>
</li>
<li class="has-submenu">
<a class="menu-title" href="javascript:void(0);">
<i class="fa fa-leaf"></i> <span class="nav-label">其它</span>
</a>
<ul class="sub-menu">
<li><a href="regexp.html">正则表达式</a></li>
<li><a href="html5.html">HTML5速查表</a></li>
<li><a href="http://www.cuishifeng.cn/go/card">信用卡优惠</a></li>
<li><a href="source.html">源码下载</a></li>
</ul>
</li>
</ul>
</nav>
</aside> <!-- left aside end -->
<script src="js/jquery-2.1.4.min.js?v=20160719"></script>
<script src="js/jquery.autocomplete.min.js?v=20160719"></script>
<script src="js/jquery.mousewheel.min.js?v=20160719"></script>
<script src="js/jquery.mCustomScrollbar.min.js?v=20160719"></script>
<script src="js/shifone.min.js?v=20160719"></script>
<div class="tongji">
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?bbcf1c00c855ede39d5ad2eac08d2ab7";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</div>
</body>
</html>
| Java |
import { IHiveMindNeuron, IHiveMindNeurons } from './HiveMindNeurons';
import { UserInput } from '../../BasicUserInput';
import { RequestContext } from '../../BasicRequestContext';
import { INeuronsResponse, ISingleNeuronsResponse, SingleNeuronsResponse } from './NeuronsResponse';
import { INeuronResponse } from '../../neurons/responses/SimpleResponse';
import { NeuronsResponseFactory } from './NeuronsResponseFactory';
export class PureEmergentHiveMindNeurons implements IHiveMindNeurons {
private neurons: IHiveMindNeuron[];
constructor(neurons: IHiveMindNeuron[]) {
this.neurons = neurons;
}
public findMatch(userInput: UserInput,
context: RequestContext,): Promise<INeuronsResponse> {
return new Promise((resolve) => {
let responses: ISingleNeuronsResponse[] = [];
const neuronResponses: Array<Promise<INeuronResponse>> = [];
for (let i = 0; i < this.neurons.length; i++) {
const neuron = this.neurons[i];
const promiseResponse = neuron.process(userInput, context);
neuronResponses.push(promiseResponse);
promiseResponse.then((response: INeuronResponse) => {
if (response.hasAnswer()) {
responses.push(new SingleNeuronsResponse(neuron, response));
}
}).catch(error => {
console.error('FATAL Neuron: ' + neuron + ' rejected...' + error);
});
}
Promise.all(
neuronResponses,
).then((allResolved: INeuronResponse[]) => {
const toResolve = NeuronsResponseFactory.createMultiple(responses);
this.placeNeuronsToTop(toResolve.getResponses().map(response => response.getFiredNeuron()));
resolve(toResolve);
}).catch(error => {
console.error('A neuron rejected instead of resolved, ' +
'neurons are never allowed to reject. If this happens ' +
'the neuron either needs to be fixed with error handling to ' +
'make it resolve a Silence() response or the neuron should ' +
'be removed. Error: ' + error);
});
});
}
private placeNeuronsToTop(neurons: IHiveMindNeuron[]) {
// reverse the neurons from highest to lowest -> lowest to highest, so the highest certainty is placed to the top
// last, making it the new top neuron
const neuronsReversed = neurons.concat([]).reverse();
neuronsReversed.forEach(toTop => {
if (this.neurons.indexOf(toTop) > 0) {
this.neurons = this.neurons.filter(neuron => neuron !== toTop);
this.neurons = [toTop].concat(this.neurons);
}
});
}
}
| Java |
require_relative 'spec_helper'
require_relative '../lib/nixonpi/animations/easing'
describe NixonPi::Easing do
before :each do
@object = Object.new
@object.extend(NixonPi::Easing)
end
# @param [Object] x percent complete (0.0 - 1.0)
# @param [Object] t elapsed time ms
# @param [Object] b start value
# @param [Object] c end value
# @param [Object] d total duration in ms
it 'should provide quadratic easing' do
1000.times.with_index do |x|
# percent complete - val - start - end - max
puts @object.ease_in_out_quad(x.to_f, 0.0, 255.0, 1000.0)
end
end
end
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>circuits: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">8.11.dev / circuits - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
circuits
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2020-07-27 01:07:00 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-27 01:07:00 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.11.dev Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/circuits"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Circuits"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: hardware verification" "category: Computer Science/Architecture" ]
authors: [ "Laurent Arditi" ]
bug-reports: "https://github.com/coq-contribs/circuits/issues"
dev-repo: "git+https://github.com/coq-contribs/circuits.git"
synopsis: "Some proofs of hardware (adder, multiplier, memory block instruction)"
description: """
definition and proof of a combinatorial adder, a
sequential multiplier, a memory block instruction"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/circuits/archive/v8.6.0.tar.gz"
checksum: "md5=b9ba5f4874f9845c96a9e72e12df3f32"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-circuits.8.6.0 coq.8.11.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.dev).
The following dependencies couldn't be met:
- coq-circuits -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-circuits.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-abel: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.9.0 / mathcomp-abel - 1.0.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-abel
<small>
1.0.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-23 18:18:12 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-23 18:18:12 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.9.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Cyril Cohen <cyril.cohen@inria.fr>"
homepage: "https://github.com/math-comp/abel"
dev-repo: "git+https://github.com/math-comp/abel.git"
bug-reports: "https://github.com/math-comp/abel/issues"
license: "CECILL-B"
synopsis: "Abel - Ruffini's theorem"
description: """
This repository contains a proof of Abel - Galois Theorem
(equivalence between being solvable by radicals and having a
solvable Galois group) and Abel - Ruffini Theorem (unsolvability of
quintic equations) in the Coq proof-assistant and using the
Mathematical Components library."""
build: [make "-j%{jobs}%" ]
install: [make "install"]
depends: [
"coq" { (>= "8.10" & < "8.14~") | = "dev" }
"coq-mathcomp-ssreflect" { (>= "1.11.0" & < "1.13~") | = "dev" }
"coq-mathcomp-fingroup"
"coq-mathcomp-algebra"
"coq-mathcomp-solvable"
"coq-mathcomp-field"
"coq-mathcomp-real-closed" { (>= "1.1.1") | = "dev" }
]
tags: [
"keyword:algebra"
"keyword:Galois"
"keyword:Abel Ruffini"
"keyword:unsolvability of quintincs"
"logpath:Abel"
]
authors: [
"Sophie Bernard"
"Cyril Cohen"
"Assia Mahboubi"
"Pierre-Yves Strub"
]
url {
src: "https://github.com/math-comp/Abel/archive/1.0.0.tar.gz"
checksum: "sha256=45ff1fc19ee16d1d97892a54fbbc9864e89fe79b0c7aa3cc9503e44bced5f446"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-abel.1.0.0 coq.8.9.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.9.0).
The following dependencies couldn't be met:
- coq-mathcomp-abel -> coq >= dev
no matching version
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-abel.1.0.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| Java |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 21:11:45 2017
@author: hubert
"""
import numpy as np
import matplotlib.pyplot as plt
class LiveBarGraph(object):
"""
"""
def __init__(self, band_names=['delta', 'theta', 'alpha', 'beta'],
ch_names=['TP9', 'AF7', 'AF8', 'TP10']):
"""
"""
self.band_names = band_names
self.ch_names = ch_names
self.n_bars = self.band_names * self.ch_names
self.x =
self.fig, self.ax = plt.subplots()
self.ax.set_ylim((0, 1))
y = np.zeros((self.n_bars,))
x = range(self.n_bars)
self.rects = self.ax.bar(x, y)
def update(self, new_y):
[rect.set_height(y) for rect, y in zip(self.rects, new_y)]
if __name__ == '__main__':
bar = LiveBarGraph()
plt.show()
while True:
bar.update(np.random.random(10))
plt.pause(0.1)
| Java |
#!/usr/bin/env bash
# DETAILS: Invokes rsyncs with well known better options.
# CREATED: 06/29/13 16:14:34 IST
# MODIFIED: 10/24/17 14:36:30 IST
#
# AUTHOR: Ravikiran K.S., ravikirandotks@gmail.com
# LICENCE: Copyright (c) 2013, Ravikiran K.S.
#set -uvx # Warn unset vars as error, Verbose (echo each command), Enable debug mode
# if rsync gives 'command not found' error, it means that non-interactive bash
# shell on server is unable to find rsync binary. So, use --rsync-path option
# to specify exact location of rsync binary on target server.
# To backup more than just home dir, the include file determines what is to be
# backed up now. The new rsync command (now uses in and excludes and "/" as src)
# $RSYNC -va --delete --delete-excluded --exclude-from="$EXCLUDES" \
# --include-from="$INCLUDES" /$SNAPSHOT_RW/home/daily.0;
# Sync ~/scripts on both eng-shell1 and local server (local being mastercopy)
#rsync -avmz -e ssh ~/scripts/ eng-shell1:~/scripts/
# Source .bashrc.dev only if invoked as a sub-shell. Not if sourced.
[[ "$(basename rsync.sh)" == "$(basename -- $0)" && -f $HOME/.bashrc.dev ]] && { source $HOME/.bashrc.dev; }
# contains a wildcard pattern per line of files to exclude. has no entries -- sync everything
RSYNC_EXCLUDE=$CUST_CONFS/rsyncexclude
# common rsync options
# -a - sync all file perms/attributes
# -h - display output in human readable form
# -i - itemize all changes
# -m - prune empty directories (let's keep them)
# -q - not used as -q hides almost every info
# -R - not used as creates confusion. use relative path names
# -u - skip files newer on destination (don't overwrite by fault)
# -v - not used as -v is too verbose
# -W - don't run diff algorithm. algo consumes lot of CPU and unreliable
# -x - don't go outside filesystem boundaries.
# -z - compress data while sync
# -e ssh - always use ssh for authentication
# --force - for if some operation requires special privileges
# --delete - if any file is absent in source, delete it in dest
# --delete-excluded - delete any files that are excluded in RSYNC_EXCLUDE on dest
# --out-format="%i|%n|" - Display itemized changes in this format.
# --safe-links - ignore symlinks that point outside the tree
RSYNC_OPTS="-ahiuWxz -e ssh --stats --force --delete --safe-links --out-format=%i|%n"
RSYNC_OPTS+=" --log-file=$SCRPT_LOGS/rsync.log --exclude-from=$RSYNC_EXCLUDE"
#RSYNC_OPTS+=" --rsync-path=/homes/raviks/tools/bin/freebsd/rsync"
function rsync_dir()
{
[[ "$#" != "2" ]] && (usage; exit $EINVAL)
SRC_DIR=$1
DST_DIR=$2
[[ "" != "$RSYNC_DRY_RUN" ]] && RSYNC_OPTS+=" -n"
echo "[SYNC] src: $SRC_DIR dst: $DST_DIR"
run rsync $RSYNC_OPTS $SRC_DIR $DST_DIR
unset SRC_DIR DST_DIR
}
function rsync_list()
{
[[ "$#" != "3" ]] && (usage; exit $EINVAL)
# Directory paths in $LIST_FILE are included only if specified with a closing slash. Ex. pathx/pathy/pathz/.
#RSYNC_OPTS+=" --files-from=$LIST_FILE" # this option not supported on freeBSD
LIST_FILE=$1; shift;
# If remote location, dont append /. awk also works: awk '{ print substr( $0, length($0) - 1, length($0) ) }'
tmpSrc=$(echo $1 | sed 's/^.*\(.\)$/\1/')
if [ "$tmpSrc" == ":" ] || [ "$tmpSrc" == "/" ]; then SRC="$1"; else SRC="$1/"; fi
tmpDst=$(echo $2 | sed 's/^.*\(.\)$/\1/')
if [ "$tmpDst" == ":" ] || [ "$tmpDst" == "/" ]; then DST="$2"; else DST="$2/"; fi
for dir in $(cat $LIST_FILE); do
rsync_dir $SRC$dir $DST$dir
done
unset LIST_FILE && unset SRC && unset DST && unset tmpSrc && unset tmpDst
}
usage()
{
echo "usage: rsync.sh [-d|-l <list-file>|-n] <src-dir> <dst-dir>"
echo "Options:"
echo " -r - start recursive rsync between given directory pair"
echo " -l <list-file> - do recursive rsync on all files/directores listed in given file"
echo " -n - enable DRY_RUN during rsync. Gives list of changes to be done"
echo "Note: In list-file, dir path names must be terminated with a / or /."
}
# Each shell script has to be independently testable.
# It can then be included in other files for functions.
main()
{
PARSE_OPTS="hl:rn"
local opts_found=0
while getopts ":$PARSE_OPTS" opt; do
case $opt in
[a-zA-Z0-9])
log DEBUG "-$opt was triggered, Parameter: $OPTARG"
local "opt_$opt"=1 && local "optarg_$opt"="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG"; usage; exit $EINVAL;
;;
:)
echo "[ERROR] Option -$OPTARG requires an argument";
usage; exit $EINVAL;
;;
esac
shift $((OPTIND-1)) && OPTIND=1 && local opts_found=1;
done
if ((!opts_found)); then
usage && exit $EINVAL;
fi
((opt_n)) && { export RSYNC_DRY_RUN=TRUE; }
((opt_r)) && { rsync_dir $*; }
((opt_l)) && { rsync_list "$optarg_l $*"; }
((opt_h)) && { usage; exit 0; }
exit 0
}
if [ "$(basename -- $0)" == "$(basename rsync.sh)" ]; then
main $*
fi
# VIM: ts=4:sw=4
| Java |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Transaction</title>
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Transaction";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../nxt/Trade.html" title="class in nxt"><span class="strong">Prev Class</span></a></li>
<li><a href="../nxt/TransactionProcessor.html" title="interface in nxt"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?nxt/Transaction.html" target="_top">Frames</a></li>
<li><a href="Transaction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">nxt</div>
<h2 title="Interface Transaction" class="title">Interface Transaction</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd>java.lang.Comparable<<a href="../nxt/Transaction.html" title="interface in nxt">Transaction</a>></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">Transaction</span>
extends java.lang.Comparable<<a href="../nxt/Transaction.html" title="interface in nxt">Transaction</a>></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getAmount()">getAmount</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../nxt/Attachment.html" title="interface in nxt">Attachment</a></code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getAttachment()">getAttachment</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../nxt/Block.html" title="interface in nxt">Block</a></code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getBlock()">getBlock</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getBytes()">getBytes</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>short</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getDeadline()">getDeadline</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getExpiration()">getExpiration</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getFee()">getFee</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getHash()">getHash</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getHeight()">getHeight</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Long</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getId()">getId</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>org.json.simple.JSONObject</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getJSONObject()">getJSONObject</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Long</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getRecipientId()">getRecipientId</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Long</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getReferencedTransactionId()">getReferencedTransactionId</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Long</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getSenderId()">getSenderId</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getSenderPublicKey()">getSenderPublicKey</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getSignature()">getSignature</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getStringId()">getStringId</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getTimestamp()">getTimestamp</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../nxt/TransactionType.html" title="class in nxt">TransactionType</a></code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#getType()">getType</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../nxt/Transaction.html#sign(java.lang.String)">sign</a></strong>(java.lang.String secretPhrase)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Comparable">
<!-- -->
</a>
<h3>Methods inherited from interface java.lang.Comparable</h3>
<code>compareTo</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre>java.lang.Long getId()</pre>
</li>
</ul>
<a name="getStringId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStringId</h4>
<pre>java.lang.String getStringId()</pre>
</li>
</ul>
<a name="getSenderId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSenderId</h4>
<pre>java.lang.Long getSenderId()</pre>
</li>
</ul>
<a name="getSenderPublicKey()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSenderPublicKey</h4>
<pre>byte[] getSenderPublicKey()</pre>
</li>
</ul>
<a name="getRecipientId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRecipientId</h4>
<pre>java.lang.Long getRecipientId()</pre>
</li>
</ul>
<a name="getHeight()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHeight</h4>
<pre>int getHeight()</pre>
</li>
</ul>
<a name="getBlock()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBlock</h4>
<pre><a href="../nxt/Block.html" title="interface in nxt">Block</a> getBlock()</pre>
</li>
</ul>
<a name="getTimestamp()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimestamp</h4>
<pre>int getTimestamp()</pre>
</li>
</ul>
<a name="getDeadline()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeadline</h4>
<pre>short getDeadline()</pre>
</li>
</ul>
<a name="getExpiration()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExpiration</h4>
<pre>int getExpiration()</pre>
</li>
</ul>
<a name="getAmount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAmount</h4>
<pre>int getAmount()</pre>
</li>
</ul>
<a name="getFee()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFee</h4>
<pre>int getFee()</pre>
</li>
</ul>
<a name="getReferencedTransactionId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getReferencedTransactionId</h4>
<pre>java.lang.Long getReferencedTransactionId()</pre>
</li>
</ul>
<a name="getSignature()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSignature</h4>
<pre>byte[] getSignature()</pre>
</li>
</ul>
<a name="getHash()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHash</h4>
<pre>java.lang.String getHash()</pre>
</li>
</ul>
<a name="getType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType</h4>
<pre><a href="../nxt/TransactionType.html" title="class in nxt">TransactionType</a> getType()</pre>
</li>
</ul>
<a name="getAttachment()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttachment</h4>
<pre><a href="../nxt/Attachment.html" title="interface in nxt">Attachment</a> getAttachment()</pre>
</li>
</ul>
<a name="sign(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sign</h4>
<pre>void sign(java.lang.String secretPhrase)</pre>
</li>
</ul>
<a name="getJSONObject()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJSONObject</h4>
<pre>org.json.simple.JSONObject getJSONObject()</pre>
</li>
</ul>
<a name="getBytes()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getBytes</h4>
<pre>byte[] getBytes()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../nxt/Trade.html" title="class in nxt"><span class="strong">Prev Class</span></a></li>
<li><a href="../nxt/TransactionProcessor.html" title="interface in nxt"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?nxt/Transaction.html" target="_top">Frames</a></li>
<li><a href="Transaction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| Java |
require 'spec_helper'
describe 'ssh::default' do
let(:chef_run){ ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '12.04').converge(described_recipe) }
it 'should include the ssh::client recipe' do
expect(chef_run).to include_recipe('ssh::client')
end
it 'should include the ssh::server recipe' do
expect(chef_run).to include_recipe('ssh::server')
end
end | Java |
<?php
namespace Ekyna\Bundle\CartBundle\Provider;
use Ekyna\Bundle\CartBundle\Model\CartProviderInterface;
use Ekyna\Bundle\OrderBundle\Entity\OrderRepository;
use Ekyna\Component\Sale\Order\OrderInterface;
use Ekyna\Component\Sale\Order\OrderTypes;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
/**
* Class CartProvider
* @package Ekyna\Bundle\CartBundle\Provider
* @author Étienne Dauvergne <contact@ekyna.com>
*/
class CartProvider implements CartProviderInterface
{
const KEY = 'cart_id';
/**
* @var SessionInterface
*/
protected $session;
/**
* @var OrderRepository
*/
protected $repository;
/**
* @var OrderInterface
*/
protected $cart;
/**
* @var string
*/
protected $key;
/**
* Constructor.
*
* @param SessionInterface $session
* @param OrderRepository $repository
* @param string $key
*/
public function __construct(SessionInterface $session, OrderRepository $repository, $key = self::KEY)
{
$this->session = $session;
$this->repository = $repository;
$this->key = $key;
}
/**
* {@inheritdoc}
*/
public function setCart(OrderInterface $cart)
{
$this->cart = $cart;
$this->cart->setType(OrderTypes::TYPE_CART);
$this->session->set($this->key, $cart->getId());
}
/**
* {@inheritdoc}
*/
public function clearCart()
{
$this->cart = null;
$this->session->set($this->key, null);
}
/**
* {@inheritdoc}
*/
public function hasCart()
{
if (null !== $this->cart) {
return true;
}
if (null !== $cartId = $this->session->get($this->key, null)) {
/** @var \Ekyna\Component\Sale\Order\OrderInterface $cart */
$cart = $this->repository->findOneBy([
'id' => $cartId,
'type' => OrderTypes::TYPE_CART
]);
if (null !== $cart) {
$this->setCart($cart);
return true;
} else {
$this->clearCart();
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function getCart()
{
if (!$this->hasCart()) {
if (null === $this->cart) {
$this->newCart();
}
}
return $this->cart;
}
/**
* Creates a new cart.
*
* @return \Ekyna\Component\Sale\Order\OrderInterface
*/
private function newCart()
{
$this->clearCart();
$this->setCart($this->repository->createNew(OrderTypes::TYPE_CART));
return $this->cart;
}
}
| Java |
<h1><?php echo $titulo_pagina; ?></h1>
<p>Usuários cadastrados no sistema</p>
<p class="alert bg-danger" style="display:none;"><strong>Mensagem!</strong> <span></span></p>
<p><a href="<?php echo base_url().'admin/usuarios/cadastrar'; ?>" class="btn btn-primary">Cadastrar</a></p>
<table class="table table-bordered table-hover table-condensed tablesorter" id="usuarios">
<thead>
<tr>
<th class="header col-md-6">Nome</th>
<th class="header">Email</th>
<th colspan="2" class="txtCenter">Ações</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($usuarios)) {
foreach($usuarios as $key => $value) {
echo '
<tr>
<td>'.$value->nome.'</td>
<td>'.$value->email.'</td>
<td class="col-md-1"><a href="'.base_url().'admin/usuarios/cadastrar/'.$value->id.'" class="btn btn-default" title="Editar"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a></td>
<td class="col-md-1"><a href="'.base_url().'admin/usuarios/excluir/'.$value->id.'" class="btn btn-danger" title="Excluir" onclick="return confirmar_exclusao(\'Usuário\')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a></td>
</tr>
';
}
} else {
echo '<tr><td colspan="4"><em>Não há Usuários Cadastrados</em></td></tr>';
} ?>
</tbody>
<?php if($total_registros > $itens_por_pagina) { ?>
<tfoot>
<tr>
<td colspan="4"><?php echo $paginador; ?></td>
</tr>
</tfoot>
<?php } ?>
</table> | Java |
# -*- coding: utf-8 -*-
from modules import Robot
import time
r = Robot.Robot()
state = [0, 1000, 1500]
(run, move, write) = range(3)
i = run
slowdown = 1
flag_A = 0
flag_C = 0
lock = [0, 0, 0, 0]
while(True):
a = r.Read()
for it in range(len(lock)):
if lock[it]:
lock[it] = lock[it] - 1
if a[0]: # kontrolka ciągła
flag_A = 0
flag_C = 0
if a[0] == 1 or a[0] == 5 or a[0] == 6:
r.A.run_forever(r.S/slowdown)
elif a[0] == 2 or a[0] == 7 or a[0] == 8:
r.A.run_forever(-r.S/slowdown)
else:
r.A.stop()
if a[0] == 3 or a[0] == 5 or a[0] == 7:
r.C.run_forever(r.S/slowdown)
elif a[0] == 4 or a[0] == 6 or a[0] == 8:
r.C.run_forever(-r.S/slowdown)
else:
r.C.stop()
elif a[1] and not lock[1]: # kontrolka lewa: dyskretna
if a[1] == 1 and i is not run: # kontrolka prawa: ciągła
r.changestate(state[i]-state[i-1])
i = i-1
time.sleep(0.5) # (state[i]-state[i-1])/r.S
if i is run:
slowdown = 1
elif a[1] == 2 and i is not write:
r.changestate(state[i]-state[i+1])
i = i+1
slowdown = 5
time.sleep(0.5) # (state[i+1]-state[i])/r.S
elif a[1] == 3:
r.B.run_forever(r.S)
elif a[1] == 4:
r.B.run_forever(-r.S)
elif a[1] == 9:
r.B.stop()
else:
pass
elif a[2]: # kontrolka one-klick
if a[2] == 1 or a[2] == 5 or a[2] == 6: # stop na 9 (beacon)
if flag_A == -1:
r.A.stop()
flag_A = 0
lock[0] = 30 # lock = 30
elif not lock[0]:
r.A.run_forever(r.S/slowdown)
flag_A = 1
elif a[2] == 2 or a[2] == 7 or a[2] == 8:
if flag_A == 1:
r.A.stop()
flag_A = 0
lock[1] = 30 # lock = 30
elif not lock[1]:
r.A.run_forever(-r.S/slowdown)
flag_A = -1
if a[2] == 3 or a[2] == 5 or a[2] == 7:
if flag_C == -1:
r.C.stop()
flag_C = 0
lock[2] = 30 # lock = 30
elif not lock[2]:
r.C.run_forever(r.S/slowdown)
flag_C = 1
elif a[2] == 4 or a[2] == 6 or a[2] == 8:
if flag_C == 1:
r.C.stop
flag_C = 0
lock[3] = 30 # lock = 30
elif not lock[3]:
r.C.run_forever(-r.S/slowdown)
flag_C = -1
if a[2] == 9:
r.stop()
flag_A = 0
flag_C = 0
elif a[3]: # alternatywna one-klick
if a[3] == 1: # 1 przycisk - oba silniki
if flag_A == -1 and flag_C == -1:
r.stop()
flag_A = 0
flag_C = 0
lock[0] = 30 # lock = 30
elif not lock[0]:
r.run(r.S/slowdown, r.S/slowdown)
flag_A = 1
flag_C = 1
elif a[3] == 2:
if flag_A == 1 and flag_C == 1:
r.stop()
flag_A = 0
flag_C = 0
lock[1] = 30 # lock = 30
elif not lock[1]:
r.run(-r.S/slowdown, -r.S/slowdown)
flag_A = -1
flag_C = -1
elif a[3] == 3:
if flag_A == 1 and flag_C == -1:
r.stop()
flag_A = 0
flag_C = 0
lock[2] = 30 # lock = 30
elif not lock[2]:
r.run(-r.S/slowdown, r.S/slowdown)
flag_A = -1
flag_C = 1
elif a[3] == 4:
if flag_A == -1 and flag_C == 1:
r.stop()
flag_A = 0
flag_C = 0
lock[3] = 30 # lock = 30
elif not lock[3]:
r.run(r.S/slowdown, -r.S/slowdown)
flag_A = 1
flag_C = -1
elif a[3] == 9:
r.stop()
flag_A = 0
flag_C = 0
else:
if not flag_A:
r.A.stop()
if not flag_C:
r.C.stop()
| Java |
//
// UIBarButtonItem+initWithImageName.h
// lottowinnersv2
//
// Created by Mac Mini on 4/17/14.
// Copyright (c) 2014 com.qaik. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (initWithImageName)
+ (instancetype)barbuttonItemWithImage:(UIImage *)image target:(id)target action:(SEL)action;
+ (instancetype)barbuttonItemWithImage:(UIImage *)image title:(NSString *)title target:(id)target action:(SEL)action;
+ (instancetype)barbuttonItemWithImage:(UIImage *)image disableImage:(UIImage *)disableImage title:(NSString *)title target:(id)target action:(SEL)action;
@end
| Java |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using Windows.Foundation.Collections;
using Windows.Media;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using MixedRemoteViewCompositor.Network;
namespace Viewer
{
public sealed partial class Playback : Page
{
private MediaExtensionManager mediaExtensionManager = null;
private Connector connector = null;
private Connection connection = null;
public Playback()
{
this.InitializeComponent();
}
private async void bnConnect_Click(object sender, RoutedEventArgs e)
{
ushort port = 0;
if (UInt16.TryParse(this.txPort.Text, out port))
{
if (string.IsNullOrEmpty(this.txAddress.Text))
{
this.txAddress.Text = this.txAddress.PlaceholderText;
}
this.connector = new Connector(this.txAddress.Text, port);
if (this.connector != null)
{
this.connection = await this.connector.ConnectAsync();
if(this.connection != null)
{
this.bnConnect.IsEnabled = false;
this.bnClose.IsEnabled = true;
this.bnStart.IsEnabled = true;
this.bnStop.IsEnabled = false;
this.connection.Disconnected += Connection_Disconnected;
var propertySet = new PropertySet();
var propertySetDictionary = propertySet as IDictionary<string, object>;
propertySet["Connection"] = this.connection;
RegisterSchemeHandler(propertySet);
}
}
}
}
private void bnClose_Click(object sender, RoutedEventArgs e)
{
CloseConnection();
}
private void bnStart_Click(object sender, RoutedEventArgs e)
{
StartPlayback();
}
private void bnStop_Click(object sender, RoutedEventArgs e)
{
StopPlayback();
}
private void Connection_Disconnected(Connection sender)
{
CloseConnection();
}
private void CloseConnection()
{
StopPlayback();
this.bnStart.IsEnabled = false;
this.bnConnect.IsEnabled = true;
this.bnClose.IsEnabled = false;
if (this.connection != null)
{
this.connection.Disconnected -= Connection_Disconnected;
this.connection.Uninitialize();
this.connection = null;
}
if (this.connector != null)
{
this.connector.Uninitialize();
this.connector = null;
}
}
private void StartPlayback()
{
this.videoPlayer.Source = new Uri(string.Format("mrvc://{0}:{1}", this.txAddress.Text, this.txPort.Text));
this.bnStart.IsEnabled = false;
this.bnStop.IsEnabled = true;
}
private void StopPlayback()
{
this.videoPlayer.Stop();
this.videoPlayer.Source = null;
this.bnStart.IsEnabled = true;
this.bnStop.IsEnabled = false;
}
public void RegisterSchemeHandler(PropertySet propertySet)
{
if (this.mediaExtensionManager == null)
{
this.mediaExtensionManager = new MediaExtensionManager();
}
this.mediaExtensionManager.RegisterSchemeHandler("MixedRemoteViewCompositor.Media.MrvcSchemeHandler", "mrvc:", propertySet);
}
}
}
| Java |
<html><body>
<h4>Windows 10 x64 (19042.610)</h4><br>
<h2>_OBJECT_REF_INFO</h2>
<font face="arial"> +0x000 ObjectHeader : Ptr64 <a href="./_OBJECT_HEADER.html">_OBJECT_HEADER</a><br>
+0x008 NextRef : Ptr64 Void<br>
+0x010 ImageFileName : [16] UChar<br>
+0x020 NextPos : Uint2B<br>
+0x022 MaxStacks : Uint2B<br>
+0x024 StackInfo : [0] <a href="./_OBJECT_REF_STACK_INFO.html">_OBJECT_REF_STACK_INFO</a><br>
</font></body></html> | Java |
#ifndef _SIMPLE_POLYGON_H
#define _SIMPLE_POLYGON_H
#include <vector>
#include <QtOpenGL>
#include "AGVector.h"
#include "Triangulate.h"
#define MAX_DIST 0.1
using std::vector;
class SimplePolygon {
public:
SimplePolygon();
~SimplePolygon();
void DrawPolygon();
void Clear();
void Update(AGVector v, bool remove);
void Update();
bool getTriangulate() {return _triangulate;};
void setTriangulate(bool b) {_triangulate = b;};
bool isColored() {return _color;};
void setColored(bool b) {_color = b;};
private:
vector<AGVector> *vertices;
vector<AGVector *> *triVerts;
int findPoint(AGVector v);
bool threeColor(vector<AGVector *> &tris);
int adjacent(AGVector **tri1, AGVector **tri2);
bool _triangulate;
bool _color;
};
#endif /* _SIMPLE_POLYGON_H */
| Java |
<?php
class ModelTask
{
public $Model;
public $MethodName;
public $Request;
public $ResponseInfo;
public $Response;
public $Headers;
public static function Prepare(&$model, $methodName)
{
$newTask = new self;
$newTask->Model = &$model;
$newTask->MethodName = $methodName;
$newTask->Request = null;
$newTask->ResponseInfo = null;
$newTask->Response = null;
$newTask->Headers = null;
return $newTask;
}
} | Java |
/*
* This code it's help you to check JS plugin function (e.g. jQuery) exist.
* When function not exist, the code will auto reload JS plugin from your setting.
*
* plugin_name: It's your plugin function name (e.g. jQuery). The type is string.
* reload_url: It's your reload plugin function URL. The type is string.
*
* Copyright 2015, opoepev (Matt, Paul.Lu, Yi-Chun Lu)
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
//Main code
var checkJSPluginExist = function (plugin_name, reload_url, depend_plugin_name) {
//window[plugin_name] || document.write('<script src="' + reload_url + '">\x3C/script>');
if (typeof depend_plugin_name !== 'undefined') {
if (typeof window[depend_plugin_name][plugin_name] !== "function") {
var tag = document.createElement('script');
tag.src = reload_url;
var headerElementTag = document.getElementsByTagName('head')[0];
headerElementTag.appendChild(tag);
return false;
}
} else {
if (typeof window[plugin_name] !== "function") {
var tag = document.createElement('script');
tag.src = reload_url;
var headerElementTag = document.getElementsByTagName('head')[0];
headerElementTag.appendChild(tag);
return false;
}
}
return true;
};
| Java |
# -*- coding: utf-8 -*-
from django.db import models
from Corretor.base import CorretorException
from Corretor.base import ExecutorException
from Corretor.base import CompiladorException
from Corretor.base import ComparadorException
from Corretor.base import LockException
from model_utils import Choices
class RetornoCorrecao(models.Model):
"""Um modelo que possui informacoes sobre o retorno da correcao de uma questao(ou questao de avaliacao).
"""
TIPOS = Choices(
(0,'loading',u'Loading'),
(1,'compilacao',u'Compilação'),
(2,'execucao',u'Execução'),
(3,'comparacao',u'Comparação'),
(4,'lock',u'Lock'),
(5,'correto',u'Correto'),
)
tipo = models.SmallIntegerField(u"Tipo",choices=TIPOS, default=TIPOS.loading)
msg = models.TextField(u"Mensagem",blank=True,null=True)
task_id = models.CharField(max_length=350,blank=True,null=True)
class Meta:
verbose_name = u'Retorno Correção'
app_label = 'Corretor'
def __unicode__(self):
return "%s: %s" %(self.TIPOS[self.tipo][1],self.msg)
def altera_dados(self,sucesso=True,erroException=None):
"""
Altera os dados do retorno atual para pegar os dados de erro ou para por a mensagem
que foi com sucesso.
"""
tipo = RetornoCorrecao.TIPOS.correto
correcao_msg = "Correto!"
# print ">>altera_dados"
# print ">>isinstance(erroException,CorretorException)",isinstance(erroException,CorretorException)
if sucesso == True:
# print ">>retorno.successful()"
tipo = RetornoCorrecao.TIPOS.correto
correcao_msg = "Correto!"
elif isinstance(erroException,CorretorException):
# print "erro: %s" % erroException.message
if isinstance(erroException,ExecutorException):
correcao_msg = erroException.message
tipo = RetornoCorrecao.TIPOS.execucao
if isinstance(erroException,CompiladorException):
correcao_msg = erroException.message
tipo = RetornoCorrecao.TIPOS.compilacao
if isinstance(erroException,ComparadorException):
correcao_msg = erroException.message
tipo = RetornoCorrecao.TIPOS.comparacao
if isinstance(erroException,LockException):
correcao_msg = erroException.message
tipo = RetornoCorrecao.TIPOS.lock
self.tipo = tipo
self.msg = correcao_msg
| Java |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ur_PK" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>ShadowCoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The BlackCoin developers
Copyright © 2014 The ShadowCoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>ایڈریس یا لیبل میں ترمیم کرنے پر ڈبل کلک کریں</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>نیا ایڈریس بنائیں</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your ShadowCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>چٹ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation> پتہ</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>چٹ کے بغیر</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>پاس فریز داخل کریں</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>نیا پاس فریز</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>نیا پاس فریز دہرائیں</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>بٹوا ان لاک</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>خفیہ کشائی کر یںبٹوے کے</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>پاس فریز تبدیل کریں</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-58"/>
<source>ShadowCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Show information about ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to a ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-200"/>
<source>ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+178"/>
<source>&About ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>ShadowCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to ShadowCoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid ShadowCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. ShadowCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>رقم</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation> پتہ</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>چٹ کے بغیر</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid ShadowCoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>ShadowCoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start ShadowCoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start ShadowCoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the ShadowCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the ShadowCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting ShadowCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show ShadowCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting ShadowCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the ShadowCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the ShadowCoin-Qt help message to get a list with possible ShadowCoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>ShadowCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>ShadowCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the ShadowCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the ShadowCoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 SDC</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>بیلنس:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 SDC</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a ShadowCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>چٹ کے بغیر</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a ShadowCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified ShadowCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a ShadowCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter ShadowCoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>رقم</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>ٹائپ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation> پتہ</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>رقم</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>کو بھیجا</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(N / A)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>تمام</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>آج</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>اس ہفتے</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>اس مہینے</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>پچھلے مہینے</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>اس سال</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>دیگر</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>کو بھیجا</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>ٹائپ</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>چٹ</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation> پتہ</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>رقم</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>ShadowCoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or shadowcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: shadowcoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: shadowcoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 32112 or testnet: 22112)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 51736 or testnet: 51996)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong ShadowCoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=shadowcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "ShadowCoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>یہ مدد کا پیغام</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. ShadowCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of ShadowCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart ShadowCoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>غلط رقم</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>ناکافی فنڈز</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. ShadowCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>نقص</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
| Java |
<?php include $_SERVER['DOCUMENT_ROOT'] . '/snippets/document/header/index.php'; ?>
<div class="layout-project">
<div class="project project_glow context-content">
<section class="project__layout">
<header class="project__header">
<div class="container">
<h1 class="project__title">Glow</h1>
</div>
</header>
<main class="project__main">
<div class="project__image project__image_desktop">
<div class="container">
<div class="image">
<img class="image__tag" src="../assets/images/glow__home__1440-1600-browser.png" alt="Glowcon Layout Home">
</div>
</div>
</div>
<div class="project__info">
<div class="container">
<div class="project__facts">
<ul class="list list_facts">
<li class="list__item">Project - WordPress Website</li>
<li class="list__item">Role - Development</li>
<li class="list__item">Agency - Bleech</li>
<li class="list__item">Year - 2019</li>
</ul>
</div>
</div>
</div>
<div class="project__image project__image_desktop">
<div class="container">
<div class="image">
<img class="image__tag" src="../assets/images/glow__media__1440-1600-browser.png" alt="Glowcon Media Example">
</div>
</div>
</div>
</main>
<footer class="project__footer">
<div class="container">
<a class="button button_circle" aria-label="Open Project URL" href="https://www.glowcon.de/" target="_blank" rel="noreferrer noopener">
<svg aria-hidden="true" width="44" height="44" viewBox="0 0 44 44" xmlns="https://www.w3.org/2000/svg"><path d="M29.22 25.1L44 10.32 33.68 0 18.9 14.78l4.457 4.456-4.12 4.12-4.457-4.455L0 33.68 10.32 44 25.1 29.22l-4.457-4.456 4.12-4.12 4.457 4.455zm-6.934 4.12L10.32 41.187 2.812 33.68 14.78 21.715l3.05 3.05-6.48 6.48 1.406 1.406 6.48-6.48 3.05 3.05zm-.572-14.44L33.68 2.813l7.507 7.506L29.22 22.285l-3.05-3.05 6.48-6.48-1.407-1.406-6.48 6.48-3.05-3.05z" fill-rule="evenodd"/></svg>
</a>
</div>
</footer>
</section>
</div>
</div>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/snippets/document/footer/index.php'; ?>
| Java |
const ASSERT = require('assert');
describe('SSL Specs', function () {
const PATH = require('path');
let Acts = require('./../index');
let testcert = PATH.join(__dirname, 'certs', 'test.cert');
let testkey = PATH.join(__dirname, 'certs', 'test.key');
it('boot with testcertificate without chain', function() {
return new Promise((resolve, reject) => {
try {
Acts.createServer(__dirname, {
server: {
address: 'localhost',
port: 8086,
ssl: {
usessl: true,
redirectnonsslrequests: true,
privatekey: testkey,
certificate: testcert,
certificationauthority: []
}
}
});
Acts.start(function () {
Acts.shutdown();
resolve();
});
} catch (e) {
reject(e);
}
});
});
it('boot with testcertificate with chain', function() {
return new Promise((resolve, reject) => {
try {
Acts.createServer(__dirname, {
server: {
address: 'localhost',
port: 8086,
ssl: {
usessl: true,
redirectnonsslrequests: true,
privatekey: testkey,
certificate: testcert,
certificationauthority: [testcert]
}
}
});
Acts.start(function () {
Acts.shutdown();
resolve();
});
} catch (e) {
reject(e);
}
});
});
});
| Java |
<?php
require "../zxcd9.php";
//$stmt = $db->prepare("SELECT * from fin_allotments where hrdbid=:id");
//$stmt->bindParam(':id', $_SESSION['id']);
//$stmt->execute();
//$rowfa = $stmt->fetch(PDO::FETCH_ASSOC);
//echo $rowfa['hrdbid'];
// echo $_SESSION['id'];
// while ($rowfa = $stmt->fetch(PDO::FETCH_ASSOC)) {
// echo $rowfa['hrdbid'].'<br>';
// }
$regionz = array("NCR", "CAR", "REGION I", "REGION II", "REGION III", "REGION IV-A", "REGION IV-B", "REGION V", "REGION VI", "REGION VII", "REGION VIII", "REGION IX", "REGION X", "REGION XI", "REGION XII", "CARAGA", "ARMM", "NIR");
//SELECT COUNT(region)as region,re FROM `fin_allotments` WHERE type="CMF" and region="NCR"
$cmf = [];
foreach ($regionz as $regvalue) {
$stmt = $db->prepare("SELECT COUNT(region) as regioncount FROM fin_allotments WHERE region = '".$regvalue."' and type='CMF' ");
$stmt->execute();
$row = $stmt->fetch();
$cmf[] = intval($row['regioncount']);
}
$dr = [];
foreach ($regionz as $regvalue) {
$stmt = $db->prepare("SELECT COUNT(region) as regioncount FROM fin_allotments WHERE region = '".$regvalue."' and type='DR'");
$stmt->execute();
$row = $stmt->fetch();
$dr[] = intval($row['regioncount']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SLP Online</title>
<meta name="description" content="SLP DSWD Livelihood"/>
<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="../imgs/favicon.ico" type="image/x-icon">
<link rel="icon" href="../imgs/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../css/flatbootstrap.css"/>
<script src="../js/jquery-1.10.2.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript" language="javascript" src="../js/jquery.dataTables.js"></script>
<style>
body {
background-color: #f7f9fb;
background-size: cover;
font-family: "Lato";
}
.navbar-nav > li > a, .navbar-brand {
padding-top:15px !important;
padding-bottom:0 !important;
height: 40px;
}
.navbar {min-height:45px !important;background-color: #000}
#bootstrapSelectForm .selectContainer .form-control-feedback {
right: -15px;
}
.disabled {
background:rgba(1,1,1,0.2);
border:0px solid;
cursor:progress;
}
.vcenter {
min-height: 90%;
min-height: 90vh;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align : center;
-webkit-align-items : center;
-moz-box-align : center;
-ms-flex-align : center;
align-items : center;
width: 100%;
-webkit-box-pack : center;
-moz-box-pack : center;
-ms-flex-pack : center;
-webkit-justify-content : center;
justify-content : center;
}
table {
border-collapse: inherit;
}
.slpdrop {
margin-bottom:1em;
}
.slpdropsub {
background: #000;
color:#fff;
}
.slpdropsub li a {
background: #000;
color:#fff;
}
-webkit-tap-highlight-color: rgba(0,0,0,0);
button {
outline: none;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
background: #000;
}
.dashpanel {
border:solid 1px #c5d6de;margin:1em;margin-top:0;background:#fff;text-align: center;
height:100%;
border-radius: 4px;
}
.bluetext {
color: #00ADDe;
}
.padfix {
padding-right: 0;
margin-bottom:1em;
margin-right: 1em;
}
.padfix2{
padding-right:0em;
padding-left: 1em;
}
.padfix3 {
padding-left:1em;
padding-right:0;
}
.padfix4 {
padding: 1em;
padding-right:0;
}
.dashpanelheader {
font-weight:900;padding-top:0.5em;padding-left:1em;font-size:18px;
margin-bottom: 0;text-align: left;
}
@media (min-width: 990px) {
.slpdrop {
font-weight:900;
font-size:22px;
}
.padfix {
padding-right: 0;
margin-right: 0;
margin-bottom: 0;
}
.padfix2{
padding-right:0em;
padding-left: 2em;
}
.padfix3 {
padding-left:0;
padding-right: 1em;
}
.padfix4 {
padding: 1em;
padding-right:1em;
}
}
.dashpanelsubhead {
text-align:left;padding-left:1.2em;margin-bottom:0;padding-bottom:0;
}
thead th {
text-align: center;
cursor: pointer;
}
.dataTables_paginate {
line-height:22px;
text-align:left;
}
h3 {
font-weight: 400
}
.nopad {
margin:0;
padding:0;
padding-top:4px;
}
.nopad::after {
color: #ccc;
content: attr(data-bg-text);
display: block;
font-size: 12px;
text-align:right;
line-height: 1;
padding:0;
margin:0;
margin-top: 0px;
position: relative;
bottom: 0px;
right: 0px;
}
.labelhover:hover {
background: #000;
color: #fff;
}
tr {
text-align: center;
}
.glyphcenter {
font-size:12px;
padding-right:2px;
}
.dataTables_filter, .dataTables_info { display: none; }
</style>
</head>
<body>
<?php require "navfin.php"; ?>
<script>
$(function () {
var colors = Highcharts.getOptions().colors;
regtot = [2,3,34,5,3,2,3,2,2,2,2,2,2,22,34];
regconf = [2,3,34,5,3,2,3,2,2,2,2,2,2,22,3];
$('#cont1').highcharts({
chart: {
type: 'column',
backgroundColor: null,
height: 150
},
title: {
text: ''
},
subtitle: {
text: ''
},
credits: {
enabled: false
},
legend: {
enabled: false
},
tooltip: {
formatter: function() {
var point = this.point,
s = '<b>'+this.x+'</b><br>Total: <b>'+point.total+'</b><br>'+point.series.name+': <b>'+point.y.toFixed(0)+'</b>';
return s;
},
hideDelay: 0
},
xAxis: {
categories: [
'NCR',
'CAR',
'I',
'II',
'III',
'IV-A',
'IV-B',
'V',
'VI',
'VII',
'VIII',
'IX',
'X',
'XI',
'XII',
'CARAGA',
'ARMM',
'NIR'
],
crosshair: true,
minorGridLineWidth: 0,
minorTickWidth: 0,
tickWidth: 0,
labels: {
enabled: true,
style: {
fontSize:'5px'
}
}
},
yAxis: {
min: 0,
gridLineWidth: 0,
title: '',
labels: {
enabled: false
}
},
plotOptions: {
column: {
pointPadding: 0,
borderWidth: 0
},
series: {
stacking: 'normal'
}
},
// series: [{
// name: 'CMF',
// color: colors[3],
// data: [23,23,55,23,15,09,18,20,50,33,38,21,12,10,40,20]
// },{
// name: 'DR',
// color: colors[8],
// data: [43,12,44,22,10,08,25,67,32,10,29,56,19,10,40,20]
//}]
series: [{
name: 'CMF',
color: colors[3],
data: [<?php echo $cmf[0].",".$cmf[1].",".$cmf[2].",".$cmf[3].",".$cmf[4].",".$cmf[5].",".$cmf[6].",".$cmf[7].",".$cmf[8].",".$cmf[9].",".$cmf[10].",".$cmf[11].",".$cmf[12].",".$cmf[13].",".$cmf[14].",".$cmf[15].",".$cmf[16].",".$cmf[17]; ?>]
},{
name: 'DR',
color: colors[8],
data: [<?php echo $dr[0].",".$dr[1].",".$dr[2].",".$dr[3].",".$dr[4].",".$dr[5].",".$dr[6].",".$dr[7].",".$dr[8].",".$dr[9].",".$dr[10].",".$dr[11].",".$dr[12].",".$dr[13].",".$dr[14].",".$dr[15].",".$dr[16].",".$dr[17]; ?>]
}]
});
});
function delcom(xx) {
var r = confirm("This will permanently delete this record. Are you sure?");
if (r == true) {
var formData = {
'action' : 'delallo',
'delid' : xx
};
$.ajax({
type: "POST",
url: "func.php",
data: formData,
success: function(data) {
$("#sucsubtext").html("Record deleted");
$('#myModal').modal();
$('#myModal').on('hidden.bs.modal', function () {location.href = "../finance/allotments_add.php"; });
location.reload();
}
});
}
}
function allotview(ee) {
var formData = { 'editid' : ee };
$.ajax({
type: "POST",
url: "allotments_view.php?id="+ee,
data: formData,
success: function(data) {
if (data == "visitpage") {
location.href="allotments_view.php?id="+ee;
}
}
});
}
</script>
<script type="text/javascript" language="javascript" class="init">
var oTable = "";
$(document).ready(function() {
function toTitleCase(str)
{
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
function parselimit(strz)
{
var m = new String(strz);
if (m.length > 32) {
m = m.substring(0,32);
m = m+"..";
}
return m;
}
function com(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function parseStatus(str) {
if (str == "0") {
status = "<span class='label label-primary'>Open</span>";
} else if (str == "1") {
status = "<span class='label label-primary'>Proposed</span>";
} else if (str == "2") {
status = "<span class='label label-warning'>In Progress</span>";
} else if (str == "3") {
status = "<span class='label label-info'>Completed</span>";
}
return status;
}
$.fn.DataTable.ext.pager.numbers_length = 5;
oTable = $('#viewdata').dataTable({
"aProcessing": true,
"aServerSide": true,
"orderCellsTop": true,
"ajax": "dt_allotments.php",
"dom": '<"top">rt<"bottom"ip><"clear">',
"aaSorting": [9,'desc'],
"fnRowCallback":
function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
$(nRow).attr('id', aData[0]);
// $(nRow).attr('subfeed', aData[1]);
return nRow;
},
"aoColumnDefs": [
{
"aTargets":[7],
"mData": null,
"mRender": function( data, type, full) {
return '<td>₱'+com(data[7])+'</td>';
}
},
{
"aTargets":[9],
"mData": null,
"mRender": function( data, type, full) {
var id='<?php echo $_SESSION['id']; ?>';
var lvl='<?php echo $_SESSION['permlvl']; ?>';
var d9=data[9];
if(lvl>0 || d9==id) {
return '<td><span class=" glyphicon glyphicon-search" onclick="allotview('+data[0]+')"></span> <span class="glyphicon glyphicon-remove" onclick="delcom('+data[0]+')"></span></td>';
}
else
{
return '<td><span class=" glyphicon glyphicon-search" onclick="allotview('+data[0]+')"></span></td>';
}
}
},
{ "bVisible": false, "aTargets":[0] }
]
});
$(document).ready(function() {
tableshown=false;
$("#searchme").keyup(function() {
if (tableshown==false) {
tableshown=true;
}
oTable.fnFilter(this.value);
});
});
});
</script>
<div class="row" style="margin:0;padding:0">
<div class="col-md-2">
<?php require "nav_side.php"; ?>
</div>
<div class="col-md-10">
<div class="row">
<div class="col-md-12">
<div style="border:solid 1px #c5d6de;background:#fff;text-align:left;padding:2em;margin-bottom:2em">
<div class="row">
<div class="col-md-4">
<h2 style="font-size:36px;margin-bottom:0em;margin-top:0em">Fund Allotments</h2>
Encoded by SLP-NPMO
<br><br>
<a href="allotments_add.php"><button class="btn btn-info btn-sm">Add Fund Allotment</button></a>
<button class="btn btn-success btn-sm" onclick="showsearch()"><span class="glyphicon glyphicon-search"></span> Search</button>
<br>
</div>
<div class="col-md-8" id="cont1" style="">
</div>
</div>
<div class="row" style="margin-top:1em;margin-bottom:1em;display:none;" id="searchfields">
<div class="row" style="padding:2em;padding-bottom:1em">
<input class="col-md-12 form-control" placeholder="Search keywords ..." id="searchme">
</div>
<div class="col-md-4">
<select class="form-control">
<option>Filter by Region</option>
</select>
</div>
<div class="col-md-4">
<select class="form-control">
<option>Filter by Type</option>
<option>CMF</option>
<option>DR</option>
</select>
</div>
<div class="col-md-4">
<select class="form-control">
<option>Filter by Fund Source</option>
<option>SLP GAA - MD</option>
<option>SLP GAA - EF</option>
<option>BUB</option>
<option>RRP</option>
</select>
</div>
</div>
<table class="table table-bordered table-hover" style="margin-top:2em;line-height:0.9;vertical-align:middle;border-top:2;padding-bottom:0;margin-bottom:0" id="viewdata">
<thead style="background:#f6f8fa">
<th></th>
<th>Region</th>
<th>Type</th>
<th>Sub-Type</th>
<th>Sub-Aro</th>
<th>UACS</th>
<th>Fund Source</th>
<th>Amount</th>
<th>Date</th>
<th></th>
</thead>
<!-- <tr>
<td>Region IV-B</td>
<td>CMF</td>
<td>Grant</td>
<td>2348712398</td>
<td>-</td>
<td>SLP-EF</td>
<td>468,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr>
<tr>
<td>Region IV-B</td>
<td>CMF</td>
<td>Grant</td>
<td>3021000003</td>
<td>-</td>
<td>SLP-MD</td>
<td>268,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr>
<tr>
<td>Region IV-B</td>
<td>DR</td>
<td>Admin</td>
<td>-</td>
<td>Travelling Expense</td>
<td>PAMANA</td>
<td>568,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr>
<tr data-toggle="tooltip" title="<div style='text-align:left'>Realigned to: <span style='font-weight:normal'>Training Expenses</span><br>Amount: <font color=red>-20,000.00</font><br>Original Amount: 188,232.00<br>Date: 09/27/2016</div>" data-html="true" data-placement="left" data-container="body">
<td>Region IV-B</td>
<td>DR</td>
<td>Admin</td>
<td>-</td>
<td>Salary</td>
<td>BUB</td>
<td>168,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr>
<tr data-toggle="tooltip" title="<div style='text-align:left'>Realigned from: <span style='font-weight:normal'>Salary</span><br>Amount: <span class='colgreen'>+20,000.00</span><br>Original Amount: 1,444,232.00<br>Date: 09/27/2016</div>" data-html="true" data-placement="left" data-container="body">
<td>NCR</td>
<td>CMF</td>
<td>Admin</td>
<td>-</td>
<td>Training Expenses</td>
<td>RRP</td>
<td>1,468,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr>
<tr>
<td>Region X</td>
<td>CMF</td>
<td>Admin</td>
<td>-</td>
<td>Mobile</td>
<td>RSF</td>
<td>868,232.00</td>
<td>06/17/2016</td>
<td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td>
</tr> -->
</table>
<button class="btn btn-primary btn-xs" style="margin-top:0.5em;margin-left:3px">Export to Excel</button>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog" style="margin-top:3em">
<div class="modal-dialog modal-sm">
<div class="modal-content" style="padding:1em;padding-top:0.5em;">
<h3 style="color:#5cb85c;margin-bottom:6px">Success!</h3>
<span style="font-size:13px" id="sucsubtext">Fund Allotments saved!</span><br><br>
<button type="button" class="btn btn-primary pull-right" style="background:#5cb85c;border:0;margin-top:0;padding:5px 10px 5px 10px" id="okaybtn" data-dismiss="modal">Okay</button>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- Modal -->
<script>
$('[data-toggle="tooltip"]').tooltip();
shown = false;
function showsearch() {
if (shown == true) {
$('#searchfields').fadeOut(399);
shown = false;
} else {
shown = true;
$('#searchfields').slideDown(399);
}
}
function getProv() {
var formData = {
'action' : 'province',
'regionid' : $('#region option:selected').val()
};
$.ajax({
type: "POST",
url: "getLocations.php",
data: formData,
success: function(data) {
$("#province").prop('disabled', false);
$("#province").html(data);
}
});
}
</script>
</body>
</html>
| Java |
package iso20022
type RepurchaseType6Code string
| Java |
<div class="sv-main-content"><div ui-view=""><div layout="row" layout-wrap="layout-wrap" ng-if="!mapView" style="max-width:1400px;margin: 0px auto"><div flex-sm="100" flex-gt-sm="50" flex-gt-md="33" flex-gt-lg="33" ng-repeat="agent in agents"><sv-broker-profile-thumb class="m"></sv-broker-profile-thumb></div></div></div></div> | Java |
namespace XHTMLClassLibrary.AttributeDataTypes
{
/// <summary>
/// One or more digits.
/// </summary>
public class Number : IAttributeDataType
{
private int? _number = null;
public string Value
{
get
{
if (_number.HasValue)
{
return _number.ToString();
}
return string.Empty;
}
set
{
_number = null;
int temp;
if(int.TryParse(value, out temp))
{
_number = temp;
}
}
}
}
}
| Java |
require "houston/releases/engine"
require "houston/releases/configuration"
module Houston
module Releases
extend self
def dependencies
[ :commits ]
end
def config(&block)
@configuration ||= Releases::Configuration.new
@configuration.instance_eval(&block) if block_given?
@configuration
end
end
# Extension Points
# ===========================================================================
#
# Read more about extending Houston at:
# https://github.com/houston/houston-core/wiki/Modules
# Register events that will be raised by this module
register_events {{
"release:create" => params("release").desc("A new release was created")
}}
# Add a link to feature that can be turned on for projects
Houston.add_project_feature :releases do
name "Releases"
path { |project| Houston::Releases::Engine.routes.url_helpers.releases_path(project) }
ability { |ability, project| ability.can?(:read, project.releases.build) }
field "releases.environments" do
name "Environments"
html do |f|
if @project.environments.none?
""
else
html = <<-HTML
<p class="instructions">
Generate release notes for these environments:
</p>
HTML
@project.environments.each do |environment|
id = :"releases.ignore.#{environment}"
value = f.object.public_send(id) || "0"
html << f.label(id, class: "checkbox") do
f.check_box(id, {checked: value == "0"}, "0", "1") +
" #{environment.titleize}"
end
end
html
end
end
end
end
end
| Java |
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .sub_resource import SubResource
class ApplicationGatewaySslPredefinedPolicy(SubResource):
"""An Ssl predefined policy.
:param id: Resource ID.
:type id: str
:param name: Name of Ssl predefined policy.
:type name: str
:param cipher_suites: Ssl cipher suites to be enabled in the specified
order for application gateway.
:type cipher_suites: list[str or
~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCipherSuite]
:param min_protocol_version: Minimum version of Ssl protocol to be
supported on application gateway. Possible values include: 'TLSv1_0',
'TLSv1_1', 'TLSv1_2'
:type min_protocol_version: str or
~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'},
'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'},
}
def __init__(self, **kwargs):
super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.cipher_suites = kwargs.get('cipher_suites', None)
self.min_protocol_version = kwargs.get('min_protocol_version', None)
| Java |
const path = require('path');
const inquirer = require('inquirer');
const yargs = require('yargs');
const {
sanitizeArgs,
ui,
invalidGitRepo,
ingredients,
addIngredients,
promiseTimeout
} = require('../common');
const {
cloneRepo,
deleteGitFolder,
establishLocalGitBindings,
addGitRemote,
pushLocalGitToOrigin,
stageChanges
} = require('../tasks/git');
const {
createEnvFile,
checkForExistingFolder,
executeCommand
} = require('../tasks/filesystem');
const {
readAndInitializeProjectRecipe,
bakeProject
} = require('../tasks/project');
const getDefaultProjectName = repoURL => {
let projectName = path.basename(repoURL).toLowerCase();
projectName = projectName.replace(/\.git$/, '');
projectName = projectName.replace(/\.+/g, '-');
projectName = projectName.replace(/-+/g, '-');
return projectName;
};
const getValidProjectName = name => {
return name
.replace(/\W+/g, ' ') // alphanumerics only
.trimRight()
.replace(/ /g, '-')
.toLowerCase();
};
module.exports = {
command: 'prepare',
desc:
'creates a new scaffold from an ezbake project in a specified Git source',
builder: yargs => {
return yargs
.option('n', {
alias: 'projectName',
describe: 'Alphanumeric project name'
})
.option('r', {
alias: 'gitRepoURL',
describe: 'The URL of the source Git repo to ezbake'
})
.option('b', {
alias: 'gitRepoBranch',
describe:
'The branch on the source repo which contains the .ezbake folder'
})
.option('o', {
alias: 'gitOriginURL',
describe:
'The URL of the Git destination repo to push to as a remote origin'
})
.option('s', {
alias: 'simple',
describe:
'Flag to indicate Whether to ask for authorName, authorEmail and projectDescription',
type: 'boolean',
default: false
});
},
handler: async argv => {
// console.log(argv);
let args = sanitizeArgs(argv);
// Sanitize Project Name, if passed in as parameter
if (args['projectName']) {
args['projectName'] = getValidProjectName(args['projectName']);
}
let baseIngredients = ingredients;
const TIMEOUT = 20000;
try {
// Mise en place
baseIngredients = baseIngredients.filter(ingredient => {
if (ingredient.name === 'projectName') {
// Override default project name
if (!args[ingredient.name] && args['gitOriginURL']) {
ingredient.default = getDefaultProjectName(args['gitOriginURL']);
}
}
// Exclude fields for which the values have already been provided with the command
if (args[ingredient.name]) {
console.log(`> ${ingredient.name}: ${args[ingredient.name]}`);
return false;
}
// Exclude some fields in case of simple setup
if (
args['simple'] &&
['authorName', 'authorEmail', 'projectDescription'].includes(
ingredient.name
)
) {
return false;
}
return true;
});
let projectIngredients = await inquirer.prompt(baseIngredients);
projectIngredients = Object.assign(projectIngredients, args);
projectIngredients.projectName = await checkForExistingFolder(
ui,
projectIngredients.projectName
);
// Check if the repo is valid
await cloneRepo(
ui,
projectIngredients.gitRepoURL,
projectIngredients.gitRepoBranch,
projectIngredients.projectName
).catch(invalidGitRepo);
let recipe = readAndInitializeProjectRecipe(
ui,
projectIngredients.projectName,
projectIngredients.gitRepoURL,
projectIngredients.gitRepoBranch
);
// Remove git bindings
await promiseTimeout(
TIMEOUT,
deleteGitFolder(ui, projectIngredients.projectName)
).catch(err => {
throw new Error(`Error: ${err} while deleting cloned Git folder.`);
});
// Ask away!
let ingredients = await inquirer.prompt(recipe.ingredients);
let allIngredients = Object.assign(
{
...projectIngredients,
...ingredients
},
{
projectNameDocker: projectIngredients.projectName.replace(/-/g, '_'),
projectAuthor:
projectIngredients.authorName +
' <' +
projectIngredients.authorEmail +
'>'
}
);
bakeProject(ui, allIngredients, recipe);
// .env file setup
if (recipe.env) {
let envAnswers = await inquirer.prompt(recipe.env);
createEnvFile(ui, projectIngredients.projectName, envAnswers);
}
// Finally, establish a local .git binding
// And optionally add the specified remote
await promiseTimeout(
TIMEOUT,
establishLocalGitBindings(ui, projectIngredients.projectName)
).catch(err => {
throw new Error(`Error: ${err} while establishing Git bindings.`);
});
if (projectIngredients.gitOriginURL) {
await addGitRemote(
ui,
projectIngredients.gitOriginURL,
projectIngredients.projectName
);
}
if (recipe.icing && Array.isArray(recipe.icing)) {
ui.log.write(`. Applying icing...`);
let projectDir = path.join(
process.cwd(),
`./${projectIngredients.projectName}`
);
process.chdir(projectDir);
for (let icing of recipe.icing) {
ui.log.write(` . ${icing.description}`);
if (Array.isArray(icing.cmd)) {
await executeCommand(
addIngredients(icing.cmd, allIngredients),
icing.cmdOptions
);
}
}
ui.log.write(`. Icing applied!`);
}
// Finally, stage and commit the changes.
// And optionally push to a remote repo
await stageChanges(
ui,
'[ezbake] - initial commit',
projectIngredients.projectName
);
if (projectIngredients.gitOriginURL) {
await pushLocalGitToOrigin(
ui,
projectIngredients.gitOriginURL,
projectIngredients.projectName
);
}
ui.log.write(`. Your project is ready!`);
process.exit(0);
} catch (error) {
ui.log.write(error.message);
process.exit(-1);
}
}
};
| Java |
import React from 'react'
import { useSelector } from 'react-redux'
import Container from 'react-bootstrap/Container'
import Row from 'react-bootstrap/Row'
import Col from 'react-bootstrap/Col'
import MoveSelector from '../containers/move-selector'
import Footer from '../containers/footer'
import Player from '../containers/player'
import WelcomeDlg from '../containers/welcome-dlg'
import History from '../features/history'
import { GlobalState } from '../reducers/consts'
const Game = () => {
const showWelcome = useSelector(state => state.globalState === GlobalState.New)
return (
<>
<WelcomeDlg show={showWelcome} />
<Container>
<Row>
<Col>
<Player color='white' />
</Col>
<Col>
<Player color='black' right />
</Col>
</Row>
<Row>
<Col className='px-0'>
<MoveSelector />
</Col>
<Col sm='3' className='pr-0 pl-1'>
<History />
</Col>
</Row>
<Row>
<Col className='px-0'>
<Footer />
</Col>
</Row>
</Container>
</>
)
}
export default Game
| Java |
<!-- TOC -->
- [General](#general)
- [R](#r)
- [Installazione](#installazione)
- [Scraping](#scraping)
- [scrape](#scrape)
- [Installazione](#installazione-1)
- [XML](#xml)
- [xml2json](#xml2json)
- [Installazione](#installazione-2)
- [XMLStarlet](#xmlstarlet)
- [Installazione](#installazione-3)
- [JSON](#json)
- [jq](#jq)
- [Installazione](#installazione-4)
- [CSV](#csv)
- [csvkit](#csvkit)
- [Installazione](#installazione-5)
- [Miller](#miller)
- [Installazione](#installazione-6)
- [HTML](#html)
- [pup](#pup)
- [YAML](#yaml)
- [yq](#yq)
- [gestione date e tempo](#gestione-date-e-tempo)
- [dateutils](#dateutils)
<!-- /TOC -->
# General
## R
### Installazione
`sudo apt-get -y install r-base`
# Scraping
## scrape
> Extract HTML elements using an XPath query or CSS3 selector.
URL: [https://github.com/jeroenjanssens/data-science-at-the-command-line/blob/master/tools/scrape](https://github.com/jeroenjanssens/data-science-at-the-command-line/blob/master/tools/scrape)
### Installazione
È uno script `python` quindi è necessario che sia installato nella propria macchina.
Richiede che sia preinstallato `lxml` (è un modulo python), che su una macchina LINUX si installa con:
sudo apt-get install libxml2-dev libxslt1-dev python-dev
e poi
sudo apt-get install python-lxml
E richiede anche il modulo python `cssselect`, che si installa con
sudo pip install cssselect
Devo scaricarlo, renderlo eseguibile e inserirlo nel PATH:
```bash
# vado nella cartella home dell'utente
cd ~
# scarico scrape, un tool di scraping
curl -sL "https://github.com/jeroenjanssens/data-science-at-the-command-line/raw/master/tools/scrape" > scrape
# rendo il file eseguibile
chmod +x scrape
# creo nella home dell'utente la cartella bin
mkdir ~/bin
# copio scrape nella cartella creata
cp scrape ~/bin
# modifico il file con le preferenze dell'utente
# NOTA BENE: nano è un editor di testo a riga di comando. se non installato: sudo apt-get install nano
nano ~/.bashrc
# aggiungo nell'ultima riga la stringa di sotto
export PATH=$PATH:~/bin
# salvo ed esco da nano
# passo all'ambiente le modifiche fatte
~/.bash_profile`
```
# XML
## xml2json
Converte una fonte `XML` in `JSON`.
URL: [https://github.com/Inist-CNRS/node-xml2json-command](https://github.com/Inist-CNRS/node-xml2json-command)
### Installazione
È basato su `nodejs` e quindi lo richiede. Se `nodejs` è installato lanciare il comando `npm install xml2json-command`.
Per installare `nodejs` su Linux (testato con Ubuntu 14.04):
curl -sL https://deb.nodesource.com/setup | sudo bash -
e poi
sudo apt-get install nodejs
## XMLStarlet
> XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.
URL: [http://xmlstar.sourceforge.net/](http://xmlstar.sourceforge.net/)
### Installazione
Per windows è disponibile come eseguibile su [SourceForge](https://sourceforge.net/projects/xmlstar/files/).
Su Linux (testato con Ubuntu 14.04) si installa con
sudo apt-get update
sudo apt-get install xmlstarlet
# JSON
## jq
> jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.
URL: [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/)
### Installazione
Per Windows è possibile scaricare l'eseguibile.
Su Linux (testato con Ubunut 14.04) si installa con
sudo apt-get install jq
# CSV
## csvkit
> csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats.
URL: [https://csvkit.readthedocs.io](https://csvkit.readthedocs.io)
### Installazione
È basata su Python, quindi lo richiede:
sudo apt-get install python-dev python-pip python-setuptools build-essential
Si installa con
sudo pip install csvkit
## Miller
Miller è "come awk, sed, cut, join, e sort" in un'unica applicazione.
URL: [http://johnkerl.org/miller/doc/index.html](http://johnkerl.org/miller/doc/index.html)
### Installazione
La modalità che consiglio è quella di scaricare l'ultimo eseguibile precompilato dalla sezione release del repo github: [https://github.com/johnkerl/miller/releases](https://github.com/johnkerl/miller/releases).
**Nota**: non ho idea se sia compilabile per Windows.
# HTML
## pup
> pup is a command line tool for processing HTML. It reads from stdin, prints to stdout, and allows the user to filter parts of the page using CSS selectors.
URL: [https://github.com/ericchiang/pup](https://github.com/ericchiang/pup)
# YAML
## yq
> Pure Python implementation of a subset of the features of jq for YAML documents.
URL: [https://github.com/kislyuk/yq](https://github.com/kislyuk/yq)
# gestione date e tempo
## dateutils
Una comodissiam suite di utility per gestire date e tempo da riga di comando
URL: [https://github.com/hroptatyr/dateutils](https://github.com/hroptatyr/dateutils) | Java |
namespace EnergyTrading.MDM.Test.Contracts.Validators
{
using System;
using System.Collections.Generic;
using System.Linq;
using EnergyTrading.MDM.ServiceHost.Unity.Configuration;
using global::MDM.ServiceHost.Unity.Sample.Configuration;
using Microsoft.Practices.Unity;
using NUnit.Framework;
using Moq;
using EnergyTrading.MDM.Contracts.Validators;
using EnergyTrading;
using EnergyTrading.Data;
using EnergyTrading.Validation;
using EnergyTrading.MDM;
using Broker = EnergyTrading.MDM.Contracts.Sample.Broker;
[TestFixture]
public partial class BrokerValidatorFixture : Fixture
{
[Test]
public void ValidatorResolution()
{
var container = CreateContainer();
var meConfig = new SimpleMappingEngineConfiguration(container);
meConfig.Configure();
var repository = new Mock<IRepository>();
container.RegisterInstance(repository.Object);
var config = new BrokerConfiguration(container);
config.Configure();
var validator = container.Resolve<IValidator<Broker>>("broker");
// Assert
Assert.IsNotNull(validator, "Validator resolution failed");
}
[Test]
public void ValidBrokerPasses()
{
// Assert
var start = new DateTime(1999, 1, 1);
var system = new MDM.SourceSystem { Name = "Test" };
var systemList = new List<MDM.SourceSystem> { system };
var systemRepository = new Mock<IRepository>();
var repository = new StubValidatorRepository();
systemRepository.Setup(x => x.Queryable<MDM.SourceSystem>()).Returns(systemList.AsQueryable());
var identifier = new EnergyTrading.Mdm.Contracts.MdmId
{
SystemName = "Test",
Identifier = "1",
StartDate = start.AddHours(-10),
EndDate = start.AddHours(-5)
};
var validatorEngine = new Mock<IValidatorEngine>();
var validator = new BrokerValidator(validatorEngine.Object, repository);
var broker = new Broker { Details = new EnergyTrading.MDM.Contracts.Sample.BrokerDetails{Name = "Test"}, Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { identifier } };
this.AddRelatedEntities(broker);
// Act
var violations = new List<IRule>();
var result = validator.IsValid(broker, violations);
// Assert
Assert.IsTrue(result, "Validator failed");
Assert.AreEqual(0, violations.Count, "Violation count differs");
}
[Test]
public void OverlapsRangeFails()
{
// Assert
var start = new DateTime(1999, 1, 1);
var finish = new DateTime(2020, 12, 31);
var validity = new DateRange(start, finish);
var system = new MDM.SourceSystem { Name = "Test" };
var brokerMapping = new PartyRoleMapping { System = system, MappingValue = "1", Validity = validity };
var list = new List<PartyRoleMapping> { brokerMapping };
var repository = new Mock<IRepository>();
repository.Setup(x => x.Queryable<PartyRoleMapping>()).Returns(list.AsQueryable());
var systemList = new List<MDM.SourceSystem>();
var systemRepository = new Mock<IRepository>();
systemRepository.Setup(x => x.Queryable<MDM.SourceSystem>()).Returns(systemList.AsQueryable());
var overlapsRangeIdentifier = new EnergyTrading.Mdm.Contracts.MdmId
{
SystemName = "Test",
Identifier = "1",
StartDate = start.AddHours(10),
EndDate = start.AddHours(15)
};
var identifierValidator = new NexusIdValidator<PartyRoleMapping>(repository.Object);
var validatorEngine = new Mock<IValidatorEngine>();
validatorEngine.Setup(x => x.IsValid(It.IsAny<EnergyTrading.Mdm.Contracts.MdmId>(), It.IsAny<IList<IRule>>()))
.Returns((EnergyTrading.Mdm.Contracts.MdmId x, IList<IRule> y) => identifierValidator.IsValid(x, y));
var validator = new BrokerValidator(validatorEngine.Object, repository.Object);
var broker = new Broker { Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { overlapsRangeIdentifier } };
// Act
var violations = new List<IRule>();
var result = validator.IsValid(broker, violations);
// Assert
Assert.IsFalse(result, "Validator succeeded");
}
[Test]
public void BadSystemFails()
{
// Assert
var start = new DateTime(1999, 1, 1);
var finish = new DateTime(2020, 12, 31);
var validity = new DateRange(start, finish);
var system = new MDM.SourceSystem { Name = "Test" };
var brokerMapping = new PartyRoleMapping { System = system, MappingValue = "1", Validity = validity };
var list = new List<PartyRoleMapping> { brokerMapping };
var repository = new Mock<IRepository>();
repository.Setup(x => x.Queryable<PartyRoleMapping>()).Returns(list.AsQueryable());
var badSystemIdentifier = new EnergyTrading.Mdm.Contracts.MdmId
{
SystemName = "Jim",
Identifier = "1",
StartDate = start.AddHours(-10),
EndDate = start.AddHours(-5)
};
var identifierValidator = new NexusIdValidator<PartyRoleMapping>(repository.Object);
var validatorEngine = new Mock<IValidatorEngine>();
validatorEngine.Setup(x => x.IsValid(It.IsAny<EnergyTrading.Mdm.Contracts.MdmId>(), It.IsAny<IList<IRule>>()))
.Returns((EnergyTrading.Mdm.Contracts.MdmId x, IList<IRule> y) => identifierValidator.IsValid(x, y));
var validator = new BrokerValidator(validatorEngine.Object, repository.Object);
var broker = new Broker { Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { badSystemIdentifier } };
// Act
var violations = new List<IRule>();
var result = validator.IsValid(broker, violations);
// Assert
Assert.IsFalse(result, "Validator succeeded");
}
partial void AddRelatedEntities(EnergyTrading.MDM.Contracts.Sample.Broker contract);
}
}
| Java |
## THIS REPO IS DEPRECATED (THIS PROJECT HAS BEEN MERGED)!! GO HERE, INSTEAD: https://github.com/apache/zeppelin/tree/master/elasticsearch
# zeppelin-elasticsearch-interpreter
Elasticsearch Interpreter for [Appache Zeppelin](https://zeppelin.incubator.apache.org/).

## Build
It's a Maven project, so it's simple:
```bash
mvn clean package
```
You should have a `elasticsearch-interpreter-jar-with-dependencies.jar` in the _target_ directory.
## Install
`ZEPPELIN_HOME` is your Zeppelin installation directory.
* Create a directory in <ZEPPELIN_HOME>/interpreters:
```bash
cd <ZEPPELIN_HOME>/interpreters
mkdir elasticsearch
```
* Copy the jar of elasticsearch-interpreter in the directory `<ZEPPELIN_HOME>/interpreters/elasticsearch`.
* In `<ZEPPELIN HOME>/conf/zeppelin-site.xml`, add the interpreter class:
```xml
<property>
<name>zeppelin.interpreters</name>
<value>__io.millesabords.zeppelin.elasticsearch.ElasticsearchInterpreter__,org.apache.zeppelin.spark.SparkInterpreter,...</value>
<description>Comma separated interpreter configurations. First interpreter become a default</description>
</property>
```
* Start Zeppelin:
```bash
<ZEPPELIN_HOME>/bin/zeppelin-daemon.sh start
```
## How to use the interpreter
### Configuration
First, you have to configure the interpreter by setting the values of:
* the name of the cluster
* the host of a node
* the port of node

### Commands
In a paragraph, use `%els` to select the Elasticsearch interpreter and then input all commands.
#### get
With the `get` command, you can get a document.
```bash
| get /index/type/id
```
Example:

#### search
With the `search` command, you can send a search query in Elasticsearch.
```bash
| search /index1,index2,.../type1,type2,... <size of the response> <JSON document containing the query>
```
Example:
* With a table containing the results:

* You can also use a predefined diagram:

#### count
With the `count` command, you can count documents in Elasticsearch.
```bash
| count /index1,index2,.../type1,type2,...
```
Example:

#### index
With the `index` command, you can index a new document in Elasticsearch.
```bash
| index /index/type/id <JSON document>
| index /index/type <JSON document>
```
#### get
With the `delete` command, you can delete a document.
```bash
| delete /index/type/id
```
### Why 'commands' instead of using http methods ?
Because, I think it's more easier to understand/write/maintain commands than HTTP requests. And it's closer to the Java API that uses XXXRequest, where XXX is Count, Search or Delete.
| Java |
/**********************************************************\
| |
| hprose |
| |
| Official WebSite: http://www.hprose.com/ |
| http://www.hprose.org/ |
| |
\**********************************************************/
/**********************************************************\
* *
* Callback.java *
* *
* Callback interface for Java. *
* *
* LastModified: Apr 10, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
package hprose.util.concurrent;
public interface Callback<V> {}
| Java |
class LateMigration < ActiveRecord::Migration
def up
puts "Doing schema LateMigration"
end
def down
puts "Undoing LateMigration"
end
end
| Java |
---
layout: tags
title: merge
---
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `mk_bare_fn` fn in crate `rustc_typeck`.">
<meta name="keywords" content="rust, rustlang, rust-lang, mk_bare_fn">
<title>rustc_typeck::middle::ty::mk_bare_fn - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../main.css">
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<section class="sidebar">
<a href='../../../rustc_typeck/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a>
<p class='location'><a href='../../index.html'>rustc_typeck</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>ty</a></p><script>window.sidebarCurrent = {name: 'mk_bare_fn', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press 'S' to search, '?' for more options..."
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../../index.html'>rustc_typeck</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>ty</a>::<wbr><a class='fn' href=''>mk_bare_fn</a><wbr><a class='stability Unstable' title=''>Unstable</a></span><span class='out-of-band'><span id='render-detail'>
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
</span><a id='src-218308' href='../../../rustc/middle/ty/fn.mk_bare_fn.html?gotosrc=218308'>[src]</a></span></h1>
<pre class='rust fn'>pub fn mk_bare_fn(cx: &<a class='struct' href='../../../rustc_typeck/middle/ty/struct.ctxt.html' title='rustc_typeck::middle::ty::ctxt'>ctxt</a><'tcx>, opt_def_id: <a class='enum' href='../../../core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='http://doc.rust-lang.org/nightly/syntax/ast/struct.DefId.html' title='syntax::ast::DefId'>DefId</a>>, fty: &'tcx <a class='struct' href='../../../rustc_typeck/middle/ty/struct.BareFnTy.html' title='rustc_typeck::middle::ty::BareFnTy'>BareFnTy</a><'tcx>) -> &'tcx <a class='struct' href='../../../rustc_typeck/middle/ty/struct.TyS.html' title='rustc_typeck::middle::ty::TyS'>TyS</a><'tcx></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div class="shortcuts">
<h1>Keyboard shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>typedef</code> (or
<code>tdef</code>).
</p>
</div>
</div>
<script>
window.rootPath = "../../../";
window.currentCrate = "rustc_typeck";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script async src="../../../search-index.js"></script>
</body>
</html> | Java |
const fs = require('fs');
const path = require('path');
class Service {
constructor() {
this.getFileRecursevly = this.getFileRecursevly.bind(this);
this.getFiles = this.getFiles.bind(this);
}
getFileRecursevly(folderPath, shortPath = '') {
var files = [];
var folder = fs.readdirSync(path.resolve(__dirname, folderPath));
var x = folder.forEach(file => {
var filePath = path.resolve(folderPath, file);
if (fs.lstatSync(filePath).isDirectory()) {
files.push({
folder: file,
files: this.getFileRecursevly(filePath, file)
})
} else {
files.push({ file: file, folder: shortPath });
}
})
return files;
}
getFiles(path) {
return new Promise((resolve, reject) => {
var files = this.getFileRecursevly(path)
resolve(files)
})
}
}
module.exports = Service; | Java |
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MemoryStandardStream.Read.cs" company="Naos Project">
// Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Naos.Database.Domain
{
using System;
using System.Collections.Generic;
using System.Linq;
using OBeautifulCode.Assertion.Recipes;
using OBeautifulCode.Serialization;
using static System.FormattableString;
public partial class MemoryStandardStream
{
/// <inheritdoc />
public override IReadOnlyCollection<long> Execute(
StandardGetInternalRecordIdsOp operation)
{
throw new NotImplementedException();
/*
operation.MustForArg(nameof(operation)).NotBeNull();
var memoryDatabaseLocator = operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>() ?? this.TryGetSingleLocator();
lock (this.streamLock)
{
IReadOnlyCollection<long> ProcessDefaultReturn()
{
switch (operation.RecordNotFoundStrategy)
{
case RecordNotFoundStrategy.ReturnDefault:
return new long[0];
case RecordNotFoundStrategy.Throw:
throw new InvalidOperationException(Invariant($"Expected stream {this.StreamRepresentation} to contain a matching record for {operation}, none was found and {nameof(operation.RecordNotFoundStrategy)} is '{operation.RecordNotFoundStrategy}'."));
default:
throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported."));
}
}
this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition);
if (partition == null)
{
return ProcessDefaultReturn();
}
var result = partition
.Where(
_ => _.Metadata.FuzzyMatchTypes(
operation.RecordFilter.IdTypes,
operation.RecordFilter.ObjectTypes,
operation.RecordFilter.VersionMatchStrategy))
.Select(_ => _.InternalRecordId)
.Union(
operation.RecordFilter.Ids.Any()
partition
.Where(
_ => _.Metadata.FuzzyMatchTypesAndId(
operation.StringSerializedId,
operation.IdentifierType,
operation.ObjectType,
operation.VersionMatchStrategy))
.Select(_ => _.InternalRecordId))
.ToList();
if (result.Any())
{
return result;
}
else
{
return ProcessDefaultReturn();
}
}
*/
}
/// <inheritdoc />
public override IReadOnlyCollection<StringSerializedIdentifier> Execute(
StandardGetDistinctStringSerializedIdsOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var result = new HashSet<StringSerializedIdentifier>();
lock (this.streamLock)
{
var locators = new List<MemoryDatabaseLocator>();
if (operation.SpecifiedResourceLocator != null)
{
locators.Add(operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>());
}
else
{
var allLocators = this.ResourceLocatorProtocols.Execute(new GetAllResourceLocatorsOp());
foreach (var locator in allLocators)
{
locators.Add(locator.ConfirmAndConvert<MemoryDatabaseLocator>());
}
}
foreach (var memoryDatabaseLocator in locators)
{
this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition);
if (partition != null)
{
foreach (var streamRecord in partition)
{
if (streamRecord.Metadata.FuzzyMatchTypes(
operation.RecordFilter.IdTypes,
operation.RecordFilter.ObjectTypes,
operation.RecordFilter.VersionMatchStrategy)
&& ((!operation.RecordFilter.Tags?.Any() ?? true)
|| streamRecord.Metadata.Tags.FuzzyMatchTags(operation.RecordFilter.Tags, operation.RecordFilter.TagMatchStrategy)))
{
result.Add(
new StringSerializedIdentifier(
streamRecord.Metadata.StringSerializedId,
streamRecord.Metadata.TypeRepresentationOfId.GetTypeRepresentationByStrategy(
operation.RecordFilter.VersionMatchStrategy)));
}
}
}
}
}
return result;
}
/// <inheritdoc />
public override StreamRecord Execute(
StandardGetLatestRecordOp operation)
{
throw new NotImplementedException();
/*
operation.MustForArg(nameof(operation)).NotBeNull();
var memoryDatabaseLocator = operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>() ?? this.TryGetSingleLocator();
lock (this.streamLock)
{
this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition);
var result = partition?
.OrderByDescending(_ => _.InternalRecordId)
.FirstOrDefault(
_ => _.Metadata.FuzzyMatchTypes(
operation.IdentifierType == null
? null
: new[]
{
operation.IdentifierType,
},
operation.ObjectType == null
? null
: new[]
{
operation.ObjectType,
},
operation.VersionMatchStrategy));
if (result != null)
{
return result;
}
switch (operation.RecordNotFoundStrategy)
{
case RecordNotFoundStrategy.ReturnDefault:
return null;
case RecordNotFoundStrategy.Throw:
throw new InvalidOperationException(Invariant($"Expected stream {this.StreamRepresentation} to contain a matching record for {operation}, none was found and {nameof(operation.RecordNotFoundStrategy)} is '{operation.RecordNotFoundStrategy}'."));
default:
throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported."));
}
}
*/
}
/// <inheritdoc />
public override string Execute(
StandardGetLatestStringSerializedObjectOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var delegatedOp = new StandardGetLatestRecordOp(
operation.RecordFilter,
operation.RecordNotFoundStrategy,
StreamRecordItemsToInclude.MetadataAndPayload,
operation.SpecifiedResourceLocator);
var record = this.Execute(delegatedOp);
string result;
if (record == null)
{
result = null;
}
else
{
if (record.Payload is StringDescribedSerialization stringDescribedSerialization)
{
result = stringDescribedSerialization.SerializedPayload;
}
else
{
switch (operation.RecordNotFoundStrategy)
{
case RecordNotFoundStrategy.ReturnDefault:
result = null;
break;
case RecordNotFoundStrategy.Throw:
throw new NotSupportedException(Invariant($"record {nameof(SerializationFormat)} not {SerializationFormat.String}, it is {record.Payload.GetSerializationFormat()}, but {nameof(RecordNotFoundStrategy)} is not {nameof(RecordNotFoundStrategy.ReturnDefault)}"));
default:
throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported."));
}
}
}
return result;
}
}
}
| Java |
package com.falcon.cms.web.rest;
import com.falcon.cms.web.rest.vm.LoggerVM;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import com.codahale.metrics.annotation.Timed;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
/**
* Controller for view and managing Log Level at runtime.
*/
@RestController
@RequestMapping("/management")
public class LogsResource {
@GetMapping("/logs")
@Timed
public List<LoggerVM> getList() {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
return context.getLoggerList()
.stream()
.map(LoggerVM::new)
.collect(Collectors.toList());
}
@PutMapping("/logs")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Timed
public void changeLevel(@RequestBody LoggerVM jsonLogger) {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel()));
}
}
| Java |
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [3.0.3](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.2...3.0.3) - 2016-06-17
### Fixed
- Add missing exporter service
## [3.0.2](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.1...3.0.2) - 2016-06-06
### Fixed
- Fixed `EntityManagerMockFactory` calling protected methods. This class is used by other bundles for testing.
## [3.0.1](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.0...3.0.1) - 2016-06-01
### Changed
- Updated Bootstrap from version 3.3.5 to version 3.3.6
- Updated Font-awesome from version 4.5.0 to version 4.6.3
### Fixed
- Typo on `choices_as_values` option for `EqualType`
| Java |
import DateParser from '../date-parser.js';
import ParsedInfo from '../../parsed-info';
import moment from 'moment';
Date.now = jest.fn(() => 1527130897000)
test('Parses 12 Jan', () => {
const dateParser = new DateParser();
dateParser.parse('12 Jan', ParsedInfo);
const { value, startIndex, endIndex } = ParsedInfo.dateParser;
expect({ value: value.unix(), startIndex, endIndex })
.toEqual({ value: 1515695400, startIndex: 0, endIndex: 6 });
});
test('Parses 22 May', () => {
const dateParser = new DateParser();
dateParser.parse('22 May', ParsedInfo);
const { value, startIndex, endIndex } = ParsedInfo.dateParser;
expect({ value: value.unix(), startIndex, endIndex })
.toEqual({ value: 1526927400, startIndex: 0, endIndex: 6 });
});
| Java |
package tranquvis.simplesmsremote.CommandManagement.Modules;
/**
* Created by Andreas Kaltenleitner on 31.10.2016.
*/
public class ModuleAudioTest extends ModuleTest {
} | Java |
---
topic: "Turtle Letters: 04"
desc: "Planning your letters inside a bounding box (planning P and C)"
indent: true
---
{% include turtle_letters_header.html %}
For each letter that you and your pair partner are going to draw,
start by drawing a bounding box like this on on a piece of
paper.
<img src="BoundingBox.png" title="BoundingBox.png" alt="BoundingBox.png" height="200" />
For example, consider my name: "Phill Conrad". I might plan out bounding
boxes like these. Here, I've chosen each of the important points, and
labelled them. Note, though, that these are only examples. I don't
expect that everyone with a P or a C in their name will make the same
choices about how to shape the letters. In fact, I hope each of you
will make slightly different choices.
<img src="BoundingBoxP1.png" title="fig:BoundingBoxP1.png" alt="BoundingBoxP1.png" height="200" /> <img src="BoundingBoxC1.png" title="fig:BoundingBoxC1.png" alt="BoundingBoxC1.png" height="200" />
For instance, as an alternative, I might use bounding boxes like these:
<img src="BoundingBoxP2.png" title="fig:BoundingBoxP2.png" alt="BoundingBoxP2.png" height="200" /> <img src="BoundingBoxC2.png" title="fig:BoundingBoxC2.png" alt="BoundingBoxC2.png" height="200" />
Or even these, if I get ambitious, and want to try to make rounded shapes using the turtle's [circle](http://docs.python.org/3.3/library/turtle.html#turtle.circle) function (note: that's a link to the documentation!)
<img src="BoundingBoxP3.png" title="fig:BoundingBoxP3.png" alt="BoundingBoxP3.png" height="200" /> <img src="BoundingBoxC3.png" title="fig:BoundingBoxC3.png" alt="BoundingBoxC3.png" height="200" />
A warning about that last approach: although it may seem like it isn't that tough, there are some subtle traps. For example, in the C, what if we are drawing a short, fat C where height > width? Then h-w will be negative, and there may be "issues". You might find that you would need more than one drawing, one for when (h-w)>0, and a different approach when (h-w)<0, and then use an if/else statement in your drawing code. It might be better to stick to approaches that don't involve interaction between height and width, which probably means straight lines. If you and your partner are up for the challenge of using curves and circles, you are welcome to try, but I advocate trying the straight line approach FIRST just to be safe.
Once you've planned your letters on paper, you are ready to start coding.
| Java |
#include "stdafx.h"
#include "record.hpp"
namespace tc { namespace log {
const char* record::type_acronym( void ) const {
switch( type ) {
case log::trace: return "T";
case log::debug: return "D";
case log::info: return "I";
case log::warn: return "W";
case log::error: return "E";
case log::fatal: return "F";
case log::all: return "A";
default:
return "!";
}
return "?";
}
record::record( tc::log::type type , const tc::log::tag& tag )
: type(type)
, tag(tag)
, ts(tc::timestamp::now())
, tid(tc::threading::current_thread_id())
{
}
record::~record( void ) {
}
}}
| Java |
/* Header Styles */
header.main{
background: rgb(252,252,252); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZjZmNmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmMmViZWEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(252,252,252,1) 0%, rgba(242,235,234,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,252,252,1)), color-stop(100%,rgba(242,235,234,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#f2ebea',GradientType=0 ); /* IE6-8 */
border-bottom:3px solid #c6065c;
}
header.main h1{margin:30px 0 0 0}
header.main img{border:none;}
/*header.main li{border-right:1px solid #222}
header.main li:nth-child(1){border-left:1px solid #222} */
header.main nav li{list-style:none;}
header.main nav li a{
padding:35px 8px 22px 8px;
display:block;
color:#ccc;
}
header.main nav li a:hover{
text-decoration: none;
}
header.main nav li span.nav-title,
header.main nav li span.nav-sub-title{
font:bold 22px Arial, Helvetica, sans-serif;
color:#c6065c;
display:block;
}
header.main nav li span.nav-sub-title{
font:normal 11px Arial, Helvetica, sans-serif;
color:#333;
}
header.main nav li.active,
header.main nav li a:hover{background:#c6065c;}
header.main nav li.active{
border-left:1px solid #e2f846;
border-right:1px solid #e2f846;
}
header.main nav li.active a,
header.main nav li.active span,
header.main nav li a:hover,
header.main nav li a:hover span{color:#fff;}
/* Content */
/* General Content Styles */
div.main{
/*background:url(../images/bg-content.jpg) #000;*/
padding:20px 0;
color:#333;
line-height:22px;
}
div.main a{ color:#c6065c;}
div.main.home .content{
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 0 0 1px rgba(0, 0, 0, 0.15) inset, 0 1px 1px rgba(0, 0, 0, 0.2);
border-right:1px solid #222;
}
/* sections default */
div.main section{
padding:10px;
border-left:1px solid #999;
border-top:1px solid #999;
background:#ececec;
}
div.main section:hover {
background:#cacaca;
}
div.main section.load-more{border-bottom:1px solid #999;}
div.main section.load-more:hover{}
div.main section.load-more{
padding:20px;
margin:0 auto;
width:100%;
display:block;
text-align:center;
color:#c6065c;
}
div.main section.active img{opacity:1;}
div.main section.active figure{}
div.main section.active figcaption{}
div.main section.active figcaption p{}
div.main section.active figcaption h3{}
div.main section footer{}
div.main section footer div.fb-like,
div.main section footer nav,
div.main section footer address,
div.main section footer nav ul{display:inline;}
div.main section footer div.fb-like img{border:0;}
/*div.main section img{
opacity: 0.9;
-moz-opacity: 0.9;
filter:alpha(opacity=9);
}*/
div.main section.active img{
opacity: 1;
-moz-opacity: 1;
filter:alpha(opacity=1);
}
div.main section nav.post-stats{text-align:right;}
div.main section nav.post-stats li{display:inline-block;}
div.main section nav.post-stats li.star{
background:url(../images/star-sprite.png);
height:21px;
width:21px;
}
div.main section nav.post-stats li.star span{display:none;}
div.main section nav.post-stats li a{
font:normal 14px Arial, Helvetica, sans-serif;
padding:3px 5px;
border-radius: 5px;
}
div.main section nav.post-stats li.pings a{
background:#c6065c;
border:1px solid #2b1009;
color:#fff;
}
div.main section nav.post-stats li.comments a{
background:#2b1009;
border:1px solid #2b1009;
color:#fff;
}
div.main section footer div.fb-like{
display:none;
}
/* Homepage Welcome - Social Box */
div.main div.welcome h1{
margin:5px 0;
font:bold 24px Helvetica;
}
div.main div.home-chrome{
margin-bottom:10px;
padding:5px;
border:1px solid #333;
background:#ececec;
}
/* Carousel Section */
section.carousel{
background:#fce6d3;
height:400px;
}
section.carousel .carousel-button{
position:absolute;
top:40%;
display:none; /* initally hidden */
}
section.carousel .carousel-button a{
display:block;
padding:10px;
margin:5px;
border:1px solid #333;
background:#222;
color:#fff;
font:bold 12px Arial, Helvetica, sans-serif;
opacity: 0.7;
-moz-opacity: 0.7;
filter:alpha(opacity=7);
}
section.carousel .carousel-button a:hover{
background:#c6065c;
border:1px solid #fff;
}
section.carousel .prev{left:0}
section.carousel .next{right:0}
section.carousel figure{
margin:0px 10px;
border:5px solid #333;
}
section.carousel.active figure{border:5px solid #222;}
section.carousel figcaption{
margin:-64px 0 0 0;
background:#2b1009;
opacity: 0.8;
-moz-opacity: 0.8;
filter:alpha(opacity=8);
padding:10px;
}
section.carousel.active figcaption{background:#000;}
section.carousel figcaption h3{
font:bold 16px Arial, Helvetica, sans-serif;
color:#fff;
margin:0;
}
section.carousel.active figcaption h3{}
section.carousel figcaption p{
font:normal 12px Arial, Helvetica, sans-serif;
color:#eee;
margin:0;
text-overflow: ellipsis; /* will make [...] at the end */
white-space: nowrap; /* paragraph to one line */
overflow:hidden;
}
section.carousel.active figcaption p{}
section.carousel footer{
margin:0 15px;
padding:2px 15px;
}
section.carousel footer span,
section.carousel footer time,
section.carousel footer address{}
/* Box Section */
section.box,
section.box.active{
height:400px;
overflow:hidden;
}
section.box p{
margin:0;
overflow:hidden;
}
section.box.active p{margin:0;}
section.box span.more{
float:right;
}
section.box h3,
section.box.active h3{
font:bold 18px Arial, Helvetica, sans-serif;
color:#fff;
margin:5px 0;
line-height:18px;
}
section.box.active h3{}
section.box div span,
section.box div time,
section.box div address{display:inline;}
section.box footer{
padding:5px 0;
width:100%;
}
section.box figure,
section.box.active figure{
width:100%;
height:200px;
overflow:hidden;
}
section.box footer div{
position:absolute;
top:185px;
}
section.box div.fb-like{
position:absolute;
top:175px;
display:none;
}
section.box div.like-convert{top:370px;}
section.box div.details-convert{top:370px;}
section.box div.video-thumbs{
display:none;
}
section.box div.video-thumbs img{padding:5px;}
section.box nav.post-stats{
position:absolute;
top:365px;
right:10px;
}
/* Small Box Section */
section.small-box{height:200px;}
section.small-box p{
line-height:22px;
margin:0;
display:none;
width:200px;
}
section.small-box.active p{width:200px;}
section.small-box h3{
font:bold 16px Arial, Helvetica, sans-serif;
color:#fff;
margin:5px 0;
line-height:18px;
}
section.small-box nav.post-stats,
section.small-box div.fb-like{
position:absolute;
top:165px;
}
section.small-box nav.post-stats{right:10px;}
section.small-box div.fb-like{left:10px;}
section.small-box div.video-thumbs{display:none;}
section.small-box div.post-details{visibility:hidden;}
section.small-box span.more{display:none;}
/* Skyscraper Section */
section.skyscraper{height:400px;}
section.skyscraper h3{
font:bold 16px Arial, Helvetica, sans-serif;
color:#fff;
margin:5px 0;
line-height:22px;
}
/* Listing Section */
div.main section.listing,
div.main section.listing.active,
div.main article.post section.load-more{
overflow:hidden;
background:none;
background:transparent;
border:none;
border-top:1px solid #cacaca;
line-height:22px;
}
div.main article.post section.load-more{
border-bottom:2px solid #cacaca;
}
div.main article.post section.load-more:hover{
background:#ececec;
}
div.main section.listing:hover{
background:#ececec;
}
section.listing p{
margin:0 0 0 1em;
overflow:hidden;
}
section.listing.active p{margin:0 0 0 1em;}
section.listing span.more{display:none;}
section.listing.active span.more{
text-align:right;
display:block;
}
section.listing h3,
section.listing.active h3{
font:bold 1.5em Arial, Helvetica, sans-serif;
color:#fff;
margin:5px 10px;
line-height:18px;
}
section.listing.active h3{}
section.listing div span,
section.listing div time,
section.listing div address{display:inline;}
section.listing footer{
padding:20px 0 0 0;
width:100%;
}
section.listing figure,
section.listing.active figure{overflow:hidden;}
section.listing footer div{
}
section.listing div.fb-like{display:none;}
section.listing div.video-thumbs{width:100%;}
section.listing nav.post-stats{right:0;}
section.listing footer div{font:italic 11px verdana;}
section.listing footer div a{color:#aaa;}
nav.post-carousel{
list-style:none;
margin:0 auto;
text-align:center;
}
nav.post-carousel ul li{
display:inline-block;
font:bold 20px Arial, Helvetica, sans-serif;
}
/* Widgets Sidebar */
h3.widget-title{
color:#c6065c;
}
/* Sidebar Styles */
div.main aside.widget-area nav,
div.main aside.widget-area div.fb-panel{
background:#000;
border-right:5px solid #222;
border-bottom::5px solid #222;
color:#fff;
height:400px;
}
div.main aside.widget-area ul {
list-style: none;
}
div.main aside.widget-area div.fb-panel{
background:#222;
}
aside.widget-area h2{
font:bold 15px Arial, Helvetica, sans-serif;
padding:5px 10px;
margin:0;
color:#fff;
}
aside.widget-area li.widget{
margin:0;
}
aside.widget-area li.widget{
background:#573615;
list-style:none;
border:5px solid #222;
border-bottom:none;
display:block;
font:bold 12px Arial, Helvetica, sans-serif;
}
aside.widget-area li.widget ul{
padding:5px 15px;
color:#fff;
display:block;
font:bold 12px Arial, Helvetica, sans-serif;
}
aside.widget-area li.widget ul{
margin:0;
list-style:none;
}
aside.widget-area li.widget ul li{
background:#54260d;
border:none;
border-bottom:none;
border-top:none;
text-indent:15px;
}
aside.widget-area li.widget ul li a{
color:#fff;
display:block;
padding:3px 5px;
font:normal 12px Arial, Helvetica, sans-serif;
}
aside.widget-area li.widget ul li a:hover{
color:#C6065C;
}
aside.widget-area li.widget.active-subnav{
width:100%;
background:#C6065C;
border:1px solid #C6065C;
border-bottom:2px solid #C6065C;
border-top:none;
margin-top:5px;
}
aside.widget-area li.widget.active-subnav a{
color:#fff;
}
/*aside.widget-area li.widget_categories ul{
margin:0;
}
aside.widget-area li.widget_categories ul li.cat-item{
background:url(../images/icon-sprite.png) top left no-repeat;
padding:0 0 0 25px;
}
aside.widget-area li.widget_categories ul li.cat-item{
background-position:0 -110px;
}
aside.widget-area li.widget_categories ul li.cat-item:hover,
aside.widget-area li.widget_categories ul li.cat-item.active{
background-position:0 -88px;
}*/
/* Single Post/Page Styles */
div.main.single .content{
background:transparent;
}
article.post{
background:transparent;
line-height:18px;
padding-right:20px;
}
div.main article.post section{
padding:10px;
}
article.post header{
padding:1em 0;
}
div.main article.post section header{
padding:0;
}
article.post h1{
color:#c6065c;
font:bold 2em arial;
margin:0;
}
article.post div.entry-content{
margin-bottom:50px;
}
article.post div.entry-content p{
padding:0;
}
article.post div.post-details{
margin:0 0 20px 0;
}
article.post footer.entry-meta{
padding:1em 3em 1em 3em;
font:italic 11px verdana;
}
article.post footer.entry-meta a{
color:#aaa;
}
div#author-info{
border: 1px dotted #222;
border-radius: 5px;
padding: 1em 2em;
margin: 2em 0;
background: #ececec;
}
div#author-info div#author-avatar{
float:left;
margin:0 1em 1em 0;
}
div#author-info div#author-avatar img{
border-radius: 48px;
border: 2px solid #333;
}
div#author-info div#author-description{
padding-left:7em;
font:normal 1em arial;
line-height: 1.5em;
color:#333;
}
div#author-info div#author-description h2{
font:bold 1em arial;
color:#333;
margin:0;
}
div#comments{
padding:10px;
}
div#comments ol.commentlist{
list-style: none;
margin:0 0 0 50px;
}
div#comments h2{
font:bold 20px arial;
color:#fff;
margin:20px;
}
div#comments article.comment{
padding:10px;
margin:10px 0;
border-radius:5px;
}
div#comments div.comment-author img{
float:left;
margin:0 1em 2em 0;
border:2px solid #aaa;
-webkit-box-shadow:0 5px 15px rgba(50, 50, 50, 0.75);
-moz-box-shadow:0 5px 15px rgba(50, 50, 50, 0.75);
box-shadow:0 5px 15px rgba(50, 50, 50, 0.75);
background:#fff;
}
div#comments div.comment-author span.fn{
font:bold 22px arial;
margin:0 10px 0 0 ;
}
div#comments div.comment-author time{
font:normal 12px arial;
}
div#comments div.comment-content{
min-height:70px;
background:#777;
padding:5px 5px 1px 5em;
margin:0.5em 0 0 1em;
color:#000;
}
div#respond{
padding:2em 4em;
float:left;
width: 100%;
}
div#respond h3#reply-title{
margin:0;
color:#333;
}
div#respond form input#author,
div#respond form input#email,
div#respond form input#url,
div#respond form textarea{
background:#ececec;
color:#333;
margin:0;
border:1px dotted #cacaca;
}
div#respond form input#submit{display:none;}
div#respond p.form-allowed-tags{
color:#333;
font:normal 11px arial;
}
div#respond p{margin:0}
div#respond code{
display:none;
}
aside aside{ padding: 0 10px; }
ul.posts{
padding: 0 !important;
list-style: none !important;
}
.navbar{
margin: 0;
border: none;
}
/* Misc Styles */
pre{
padding: 10px !important;
margin: 10px 0 !important;
border: 2px dashed #ccc;
background: #ececec;
}
| Java |
#!/bin/bash
## To avoid regression ensure that all of these do not return (unknown)
# annot_t.js
printf "annot_t.js:9:21 = "
assert_ok "$FLOW" type-at-pos annot_t.js 9 21 --strip-root --pretty
# any.js
printf "any.js:3:15 = "
assert_ok "$FLOW" type-at-pos any.js 3 15 --strip-root --pretty
printf "any.js:4:2 = "
assert_ok "$FLOW" type-at-pos any.js 4 2 --strip-root --pretty
printf "any.js:4:6 = "
assert_ok "$FLOW" type-at-pos any.js 4 6 --strip-root --pretty
printf "any.js:5:5 = "
assert_ok "$FLOW" type-at-pos any.js 5 5 --strip-root --pretty
printf "any.js:7:13 = "
assert_ok "$FLOW" type-at-pos any.js 7 13 --strip-root --pretty
printf "any.js:8:5 = "
assert_ok "$FLOW" type-at-pos any.js 8 5 --strip-root --pretty
printf "any.js:8:10 = "
assert_ok "$FLOW" type-at-pos any.js 8 10 --strip-root --pretty
printf "any.js:9:10 = "
assert_ok "$FLOW" type-at-pos any.js 9 10 --strip-root --pretty
# array.js
# TODO `Array` is not populated in type_tables
# printf "array.js:3:18 = "
# assert_ok "$FLOW" type-at-pos array.js 3 18 --strip-root --pretty
# TODO `$ReadOnlyArray` is not populated in type_tables
# printf "array.js:4:30 = "
# assert_ok "$FLOW" type-at-pos array.js 4 30 --strip-root --pretty
printf "array.js:6:15 = "
assert_ok "$FLOW" type-at-pos array.js 6 15 --strip-root --pretty
printf "array.js:10:15 = "
assert_ok "$FLOW" type-at-pos array.js 10 15 --strip-root --pretty
printf "array.js:15:4 = "
assert_ok "$FLOW" type-at-pos array.js 15 4 --strip-root --pretty
printf "array.js:19:4 = "
assert_ok "$FLOW" type-at-pos array.js 19 4 --strip-root --pretty
printf "array.js:23:4 = "
assert_ok "$FLOW" type-at-pos array.js 23 4 --strip-root --pretty
# new-array.js
printf "new-array.js:3:15 = "
assert_ok "$FLOW" type-at-pos new-array.js 3 15 --strip-root --pretty
# class-0.js
printf "class-0.js:3:7 = "
assert_ok "$FLOW" type-at-pos class-0.js 3 7 --strip-root --pretty
printf "class-0.js:4:3 = "
assert_ok "$FLOW" type-at-pos class-0.js 4 3 --strip-root --pretty
printf "class-0.js:4:10 = "
assert_ok "$FLOW" type-at-pos class-0.js 4 10 --strip-root --pretty
printf "class-0.js:9:5 = "
assert_ok "$FLOW" type-at-pos class-0.js 9 5 --strip-root --pretty
printf "class-0.js:12:5 = "
assert_ok "$FLOW" type-at-pos class-0.js 12 5 --strip-root --pretty
printf "class-0.js:15:5 = "
assert_ok "$FLOW" type-at-pos class-0.js 15 5 --strip-root --pretty
printf "class-0.js:21:5 = "
assert_ok "$FLOW" type-at-pos class-0.js 21 5 --strip-root --pretty
printf "class-0.js:24:5 = "
assert_ok "$FLOW" type-at-pos class-0.js 24 5 --strip-root --pretty
#class-1.js
# TODO this is not the ideal type
printf "class-1.js:4:3 = "
assert_ok "$FLOW" type-at-pos class-1.js 4 3 --strip-root --pretty
printf "class-1.js:8:3 = "
assert_ok "$FLOW" type-at-pos class-1.js 8 3 --strip-root --pretty
#class-2.js
printf "class-2.js:4:3 = "
assert_ok "$FLOW" type-at-pos class-2.js 4 3 --strip-root --pretty
printf "class-2.js:9:9 = "
assert_ok "$FLOW" type-at-pos class-2.js 9 9 --strip-root --pretty
printf "class-2.js:10:9 = "
assert_ok "$FLOW" type-at-pos class-2.js 10 9 --strip-root --pretty
printf "class-2.js:12:7 = "
assert_ok "$FLOW" type-at-pos class-2.js 12 7 --strip-root --pretty
printf "class-2.js:13:7 = "
assert_ok "$FLOW" type-at-pos class-2.js 13 7 --strip-root --pretty
#class-3.js
printf "class-3.js:4:3 = "
assert_ok "$FLOW" type-at-pos class-3.js 4 3 --strip-root --pretty
printf "class-3.js:9:9 = "
assert_ok "$FLOW" type-at-pos class-3.js 9 9 --strip-root --pretty
printf "class-3.js:10:9 = "
assert_ok "$FLOW" type-at-pos class-3.js 10 9 --strip-root --pretty
# class-bound.js
printf "class-bound.js:4:6 = "
assert_ok "$FLOW" type-at-pos class-bound.js 4 6 --strip-root --pretty
# class-getters-setters.js
printf "class-getters-setters.js:6:7 = "
assert_ok "$FLOW" type-at-pos class-getters-setters.js 6 7 --strip-root --pretty
printf "class-getters-setters.js:9:7 = "
assert_ok "$FLOW" type-at-pos class-getters-setters.js 9 7 --strip-root --pretty
# class-poly-0.js
printf "class-poly-0.js:5:7 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 5 7 --strip-root --pretty
printf "class-poly-0.js:5:9 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 5 9 --strip-root --pretty
printf "class-poly-0.js:10:26 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 10 26 --strip-root --pretty
# TODO constructor
# printf "class-poly-0.js:11:10 = "
# assert_ok "$FLOW" type-at-pos class-poly-0.js 11 10 --strip-root --pretty
printf "class-poly-0.js:12:7 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 12 7 --strip-root --pretty
printf "class-poly-0.js:16:7 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 16 7 --strip-root --pretty
printf "class-poly-0.js:16:10 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 16 10 --strip-root --pretty
printf "class-poly-0.js:17:7 = "
assert_ok "$FLOW" type-at-pos class-poly-0.js 17 7 --strip-root --pretty
#class-poly-1.js
printf "class-poly-1.js:9:5 = "
assert_ok "$FLOW" type-at-pos class-poly-1.js 9 5 --strip-root --pretty
printf "class-poly-1.js:9:11 = "
assert_ok "$FLOW" type-at-pos class-poly-1.js 9 11 --strip-root --pretty
# class-statics.js
printf "class-statics.js:4:10 = "
assert_ok "$FLOW" type-at-pos class-statics.js 4 10 --strip-root --pretty
printf "class-statics.js:8:10 = "
assert_ok "$FLOW" type-at-pos class-statics.js 8 10 --strip-root --pretty
printf "class-statics.js:9:7 = "
assert_ok "$FLOW" type-at-pos class-statics.js 9 7 --strip-root --pretty
printf "class-statics.js:11:8 = "
assert_ok "$FLOW" type-at-pos class-statics.js 11 8 --strip-root --pretty
printf "class-statics.js:16:5 = "
assert_ok "$FLOW" type-at-pos class-statics.js 16 5 --strip-root --pretty
printf "class-statics.js:17:5 = "
assert_ok "$FLOW" type-at-pos class-statics.js 17 5 --strip-root --pretty
# NOTE here Flow infers 'this', even though this is a static member
printf "class-statics.js:20:11 = "
assert_ok "$FLOW" type-at-pos class-statics.js 20 11 --strip-root --pretty
# class-statics-poly.js
printf "class-statics-poly.js:4:10 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 4 10 --strip-root --pretty
printf "class-statics-poly.js:8:10 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 8 10 --strip-root --pretty
# TODO the type 'Class<A>' is not parseable when 'A' is polymorphic
printf "class-statics-poly.js:9:7 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 9 7 --strip-root --pretty
printf "class-statics-poly.js:11:8 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 11 8 --strip-root --pretty
printf "class-statics-poly.js:16:5 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 16 5 --strip-root --pretty
printf "class-statics-poly.js:17:5 = "
assert_ok "$FLOW" type-at-pos class-statics-poly.js 17 5 --strip-root --pretty
# destructuring.js
printf "destructuring.js:3:6 = "
assert_ok "$FLOW" type-at-pos destructuring.js 3 6 --strip-root --pretty
printf "destructuring.js:17:13 = "
assert_ok "$FLOW" type-at-pos destructuring.js 17 13 --strip-root --pretty
# exact.js
printf "exact.js:4:6 = "
assert_ok "$FLOW" type-at-pos exact.js 4 6 --strip-root --pretty
printf "exact.js:5:13 = "
assert_ok "$FLOW" type-at-pos exact.js 5 13 --strip-root --pretty
printf "exact.js:6:13 = "
assert_ok "$FLOW" type-at-pos exact.js 6 13 --strip-root --pretty
printf "exact.js:7:13 = "
assert_ok "$FLOW" type-at-pos exact.js 7 13 --strip-root --pretty
printf "exact.js:9:17 = "
assert_ok "$FLOW" type-at-pos exact.js 9 17 --strip-root --pretty
printf "exact.js:10:7 = "
assert_ok "$FLOW" type-at-pos exact.js 10 7 --strip-root --pretty
printf "exact.js:13:13 = "
assert_ok "$FLOW" type-at-pos exact.js 13 13 --strip-root --pretty
printf "exact.js:16:13 = "
assert_ok "$FLOW" type-at-pos exact.js 16 13 --strip-root --pretty
printf "exact.js:18:6 = "
assert_ok "$FLOW" type-at-pos exact.js 18 6 --strip-root --pretty
printf "exact.js:19:6 = "
assert_ok "$FLOW" type-at-pos exact.js 19 6 --strip-root --pretty
# facebookism.js
printf "facebookism.js:3:8 = "
assert_ok "$FLOW" type-at-pos facebookism.js 3 8 --strip-root --pretty
# TODO `require`
# printf "facebookism.js:3:14 = "
# assert_ok "$FLOW" type-at-pos facebookism.js 3 14 --strip-root --pretty
# function.js
printf "function.js:4:3 = "
assert_ok "$FLOW" type-at-pos function.js 4 3 --strip-root --pretty
printf "function.js:8:3 = "
assert_ok "$FLOW" type-at-pos function.js 8 3 --strip-root --pretty
printf "function.js:12:3 = "
assert_ok "$FLOW" type-at-pos function.js 12 3 --strip-root --pretty
printf "function.js:16:3 = "
assert_ok "$FLOW" type-at-pos function.js 16 3 --strip-root --pretty
# function-poly-0.js
printf "function-poly-0.js:3:10 = "
assert_ok "$FLOW" type-at-pos function-poly-0.js 3 10 --strip-root --pretty
printf "function-poly-0.js:3:30 = "
assert_ok "$FLOW" type-at-pos function-poly-0.js 3 30 --strip-root --pretty
printf "function-poly-0.js:4:7 = "
assert_ok "$FLOW" type-at-pos function-poly-0.js 4 7 --strip-root --pretty
# function-poly-1.js
printf "function-poly-1.js:3:10 = "
assert_ok "$FLOW" type-at-pos function-poly-1.js 3 10 --strip-root --pretty
printf "function-poly-1.js:3:3 = "
assert_ok "$FLOW" type-at-pos function-poly-1.js 3 33 --strip-root --pretty
printf "function-poly-1.js:4:7 = "
assert_ok "$FLOW" type-at-pos function-poly-1.js 4 7 --strip-root --pretty
# function-poly-2.js
printf "function-poly-2.js:3:10 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 3 10 --strip-root --pretty
printf "function-poly-2.js:4:12 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 4 12 --strip-root --pretty
printf "function-poly-2.js:5:5 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 5 5 --strip-root --pretty
printf "function-poly-2.js:6:5 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 6 5 --strip-root --pretty
printf "function-poly-2.js:7:12 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 7 12 --strip-root --pretty
printf "function-poly-2.js:9:13 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 9 13 --strip-root --pretty
printf "function-poly-2.js:11:12 = "
assert_ok "$FLOW" type-at-pos function-poly-2.js 11 12 --strip-root --pretty
# function-poly-3.js
printf "function-poly-3.js:8:1 = "
assert_ok "$FLOW" type-at-pos function-poly-3.js 8 1 --strip-root --pretty
# function-poly-4.js
printf "function-poly-4.js:3:11 = "
assert_ok "$FLOW" type-at-pos function-poly-4.js 3 11 --strip-root --pretty
printf "function-poly-4.js:7:7 = "
assert_ok "$FLOW" type-at-pos function-poly-4.js 7 7 --strip-root --pretty
printf "function-poly-4.js:9:7 = "
assert_ok "$FLOW" type-at-pos function-poly-4.js 9 7 --strip-root --pretty
# function-poly-5.js
printf "function-poly-5.js:3:10 = "
assert_ok "$FLOW" type-at-pos function-poly-5.js 3 10 --strip-root --pretty
# generics.js
printf "generics.js:5:1 = "
assert_ok "$FLOW" type-at-pos generics.js 5 1 --strip-root --pretty
printf "generics.js:10:1 = "
assert_ok "$FLOW" type-at-pos generics.js 10 1 --strip-root --pretty
printf "generics.js:14:1 = "
assert_ok "$FLOW" type-at-pos generics.js 14 1 --strip-root --pretty
printf "generics.js:18:1 = "
assert_ok "$FLOW" type-at-pos generics.js 18 1 --strip-root --pretty
printf "generics.js:22:1 = "
assert_ok "$FLOW" type-at-pos generics.js 22 1 --strip-root --pretty
printf "generics.js:26:1 = "
assert_ok "$FLOW" type-at-pos generics.js 26 1 --strip-root --pretty
printf "generics.js:30:13 = "
assert_ok "$FLOW" type-at-pos generics.js 30 13 --strip-root --pretty
# implements.js
printf "implements.js:7:8 = "
assert_ok "$FLOW" type-at-pos implements.js 4 23 --strip-root --pretty
# import_lib.js
printf "import_lib.js:7:8 = "
assert_ok "$FLOW" type-at-pos import_lib.js 7 8 --strip-root --pretty
printf "import_lib.js:7:25 (--expand-json-output) = "
assert_ok "$FLOW" type-at-pos import_lib.js 7 25 --strip-root --pretty --expand-json-output
# import_lib_named.js
printf "import_lib_named.js:3:15 (--expand-json-output) = "
assert_ok "$FLOW" type-at-pos import_lib_named.js 3 15 --strip-root --pretty --expand-json-output
printf "import_lib_named.js:3:27 (--expand-json-output) = "
assert_ok "$FLOW" type-at-pos import_lib_named.js 3 27 --strip-root --pretty --expand-json-output
# interface.js
printf "interface.js:3:12 = "
assert_ok "$FLOW" type-at-pos interface.js 3 12 --strip-root --pretty
printf "interface.js:9:15 = "
assert_ok "$FLOW" type-at-pos interface.js 9 15 --strip-root --pretty
printf "interface.js:9:19 = "
assert_ok "$FLOW" type-at-pos interface.js 9 19 --strip-root --pretty
# # TODO: report specialized type
# printf "interface.js:10:6 = "
# assert_ok "$FLOW" type-at-pos interface.js 10 6 --strip-root --pretty
# printf "interface.js:11:6 = "
# assert_ok "$FLOW" type-at-pos interface.js 11 6 --strip-root --pretty
# printf "interface.js:13:6 = "
# assert_ok "$FLOW" type-at-pos interface.js 13 6 --strip-root --pretty
printf "interface.js:17:7 = "
assert_ok "$FLOW" type-at-pos interface.js 17 7 --strip-root --pretty
printf "interface.js:18:7 = "
assert_ok "$FLOW" type-at-pos interface.js 18 7 --strip-root --pretty
# declare_class.js
printf "declare_class.js:3:15 = "
assert_ok "$FLOW" type-at-pos declare_class.js 3 15 --strip-root --pretty
# mixed.js
printf "mixed.js:18:17 = "
assert_ok "$FLOW" type-at-pos mixed.js 18 17 --strip-root --pretty
# exports.js
printf "exports.js:3:24 = "
assert_ok "$FLOW" type-at-pos exports.js 3 24 --strip-root --pretty
printf "exports.js:5:25 = "
assert_ok "$FLOW" type-at-pos exports.js 5 25 --strip-root --pretty
# module-export.js
printf "module-export.js:7:13 = "
assert_ok "$FLOW" type-at-pos module-export.js 7 13 --strip-root --pretty
# module-import.js
printf "module-import.js:3:7 = "
assert_ok "$FLOW" type-at-pos module-import.js 3 7 --strip-root --pretty
# import-default.js
printf "import-default.js:3:16 = "
assert_ok "$FLOW" type-at-pos import-default.js 3 16 --strip-root --pretty
# import-typeof-class.js
printf "import-typeof-class.js:6:16 "
assert_ok "$FLOW" type-at-pos import-typeof-class.js 6 16 --strip-root --pretty --expand-json-output
printf "import-typeof-class.js:7:16 "
assert_ok "$FLOW" type-at-pos import-typeof-class.js 7 16 --strip-root --pretty --expand-json-output
# object.js
printf "object.js:3:15 = "
assert_ok "$FLOW" type-at-pos object.js 3 15 --strip-root --pretty
printf "object.js:3:19 = "
assert_ok "$FLOW" type-at-pos object.js 3 19 --strip-root --pretty
printf "object.js:3:24 = "
assert_ok "$FLOW" type-at-pos object.js 3 24 --strip-root --pretty
printf "object.js:3:29 = "
assert_ok "$FLOW" type-at-pos object.js 3 29 --strip-root --pretty
printf "object.js:3:40 = "
assert_ok "$FLOW" type-at-pos object.js 3 40 --strip-root --pretty
printf "object.js:6:5 = "
assert_ok "$FLOW" type-at-pos object.js 6 5 --strip-root --pretty
printf "object.js:6:7 = " # TODO can we do better with duplication?
assert_ok "$FLOW" type-at-pos object.js 6 7 --strip-root --pretty
printf "object.js:7:10 = "
assert_ok "$FLOW" type-at-pos object.js 7 10 --strip-root --pretty
printf "object.js:7:12 = "
assert_ok "$FLOW" type-at-pos object.js 7 12 --strip-root --pretty
printf "object.js:8:14 = "
assert_ok "$FLOW" type-at-pos object.js 8 14 --strip-root --pretty
printf "object.js:8:16 = "
assert_ok "$FLOW" type-at-pos object.js 8 16 --strip-root --pretty
printf "object.js:9:18 = "
assert_ok "$FLOW" type-at-pos object.js 9 18 --strip-root --pretty
printf "object.js:9:34 = "
assert_ok "$FLOW" type-at-pos object.js 9 34 --strip-root --pretty
printf "object.js:15:3 = "
assert_ok "$FLOW" type-at-pos object.js 15 3 --strip-root --pretty
printf "object.js:16:3 = "
assert_ok "$FLOW" type-at-pos object.js 16 3 --strip-root --pretty
printf "object.js:19:3 = "
assert_ok "$FLOW" type-at-pos object.js 19 3 --strip-root --pretty
printf "object.js:19:7 = "
assert_ok "$FLOW" type-at-pos object.js 19 7 --strip-root --pretty
printf "object.js:20:7 = "
assert_ok "$FLOW" type-at-pos object.js 20 7 --strip-root --pretty
printf "object.js:21:7 = "
assert_ok "$FLOW" type-at-pos object.js 21 7 --strip-root --pretty
printf "object.js:22:7 = "
assert_ok "$FLOW" type-at-pos object.js 22 7 --strip-root --pretty
printf "object.js:35:1 = "
assert_ok "$FLOW" type-at-pos object.js 35 1 --strip-root --pretty
# object-resolution.js
printf "object-resolution.js:5:2 = "
assert_ok "$FLOW" type-at-pos object-resolution.js 5 2 --strip-root --pretty
printf "object-resolution.js:10:2 = "
assert_ok "$FLOW" type-at-pos object-resolution.js 10 2 --strip-root --pretty
printf "object-resolution.js:13:5 = "
assert_ok "$FLOW" type-at-pos object-resolution.js 13 5 --strip-root --pretty
# optional.js
printf "optional.js:4:10 = "
assert_ok "$FLOW" type-at-pos optional.js 4 10 --strip-root --pretty
printf "optional.js:7:2 = "
assert_ok "$FLOW" type-at-pos optional.js 7 2 --strip-root --pretty
printf "optional.js:10:11 = "
assert_ok "$FLOW" type-at-pos optional.js 10 11 --strip-root --pretty
printf "optional.js:10:14 = "
assert_ok "$FLOW" type-at-pos optional.js 10 14 --strip-root --pretty
printf "optional.js:14:10 = "
assert_ok "$FLOW" type-at-pos optional.js 14 10 --strip-root --pretty
# predicates.js
# printf "predicates.js:4:12 (null) = "
# assert_ok "$FLOW" type-at-pos predicates.js 4 12 --strip-root --pretty
printf "predicates.js - undefined: "
assert_ok "$FLOW" type-at-pos predicates.js 5 12 --strip-root --pretty
printf "predicates.js - Array: "
assert_ok "$FLOW" type-at-pos predicates.js 6 6 --strip-root --pretty
printf "predicates.js - isArray: "
assert_ok "$FLOW" type-at-pos predicates.js 6 15 --strip-root --pretty
printf "predicates.js - y (refined obj): "
assert_ok "$FLOW" type-at-pos predicates.js 8 5 --strip-root --pretty
printf "predicates.js - if (y.FOO) obj: "
assert_ok "$FLOW" type-at-pos predicates.js 9 5 --strip-root --pretty
printf "predicates.js - if (y.FOO) prop: "
assert_ok "$FLOW" type-at-pos predicates.js 9 8 --strip-root --pretty
printf "predicates.js - if (y.FOO == '') obj: "
assert_ok "$FLOW" type-at-pos predicates.js 10 5 --strip-root --pretty
printf "predicates.js - if (y.FOO == '') prop: "
assert_ok "$FLOW" type-at-pos predicates.js 10 8 --strip-root --pretty
printf "predicates.js - if (y.FOO === '') obj: "
assert_ok "$FLOW" type-at-pos predicates.js 11 5 --strip-root --pretty
printf "predicates.js - if (y.FOO === '') prop: "
assert_ok "$FLOW" type-at-pos predicates.js 11 8 --strip-root --pretty
printf "predicates.js - if (y.FOO == null) prop: "
assert_ok "$FLOW" type-at-pos predicates.js 12 8 --strip-root --pretty
printf "predicates.js - if (y.FOO == undefined) prop: "
assert_ok "$FLOW" type-at-pos predicates.js 13 8 --strip-root --pretty
printf "predicates.js - if (Array.isArray(y.FOO)): "
assert_ok "$FLOW" type-at-pos predicates.js 14 22 --strip-root --pretty
# react_component.js
printf "react_component.js:3:9 = "
assert_ok "$FLOW" type-at-pos react_component.js 3 9 --strip-root --pretty
printf "react_component.js:13:33 = "
assert_ok "$FLOW" type-at-pos react_component.js 13 33 --strip-root --pretty
printf "react_component.js:18:17 = "
assert_ok "$FLOW" type-at-pos react_component.js 18 17 --strip-root --pretty
printf "react_component.js:31:7 = "
assert_ok "$FLOW" type-at-pos react_component.js 31 7 --strip-root --pretty --expand-json-output
printf "react_component.js:32:13 = "
assert_ok "$FLOW" type-at-pos react_component.js 32 13 --strip-root --pretty --expand-json-output
printf "react_component.js:32:29 = "
assert_ok "$FLOW" type-at-pos react_component.js 32 29 --strip-root --pretty --expand-json-output
# react.js
printf "react.js:2:7 = "
assert_ok "$FLOW" type-at-pos react.js 2 7 --strip-root --pretty
# recursive.js
printf "recursive.js:3:25 = "
assert_ok "$FLOW" type-at-pos recursive.js 3 25 --strip-root --pretty
printf "recursive.js:6:11 = "
assert_ok "$FLOW" type-at-pos recursive.js 6 11 --strip-root --pretty
printf "recursive.js:13:12 = "
assert_ok "$FLOW" type-at-pos recursive.js 13 12 --strip-root --pretty
printf "recursive.js:23:12 = "
assert_ok "$FLOW" type-at-pos recursive.js 23 12 --strip-root --pretty
printf "recursive.js:38:2 = "
assert_ok "$FLOW" type-at-pos recursive.js 38 2 --strip-root --pretty
printf "recursive.js:41:17 = "
assert_ok "$FLOW" type-at-pos recursive.js 41 17 --strip-root --pretty
printf "recursive.js:58:1 = "
assert_ok "$FLOW" type-at-pos recursive.js 58 1 --strip-root --pretty
printf "recursive.js:60:6 = "
assert_ok "$FLOW" type-at-pos recursive.js 60 6 --strip-root --pretty
printf "recursive.js:60:31 = "
assert_ok "$FLOW" type-at-pos recursive.js 60 31 --strip-root --pretty
# refinement.js
printf "refinement.js:7:25 = "
assert_ok "$FLOW" type-at-pos refinement.js 7 25 --strip-root --pretty
printf "refinement.js:8:25 = "
assert_ok "$FLOW" type-at-pos refinement.js 8 25 --strip-root --pretty
# require-class.js
printf "require-class.js:5:16 = "
assert_ok "$FLOW" type-at-pos require-class.js 5 16 --strip-root --expand-json-output --pretty
printf "require-class.js:6:16 = "
assert_ok "$FLOW" type-at-pos require-class.js 6 16 --strip-root --expand-json-output --pretty
# test.js
printf "test.js:5:1 = "
assert_ok "$FLOW" type-at-pos test.js 5 1 --strip-root --pretty
printf "test.js:8:7 = "
assert_ok "$FLOW" type-at-pos test.js 8 7 --strip-root --pretty
printf "test.js:10:7 = "
assert_ok "$FLOW" type-at-pos test.js 10 7 --strip-root --pretty
printf "test.js:12:7 = "
assert_ok "$FLOW" type-at-pos test.js 12 7 --strip-root --pretty
printf "test.js:14:7 = "
assert_ok "$FLOW" type-at-pos test.js 14 7 --strip-root --pretty
# templates.js
# NOTE: not supported any more
# printf "templates.js:2:7 = "
# assert_ok "$FLOW" type-at-pos templates.js 2 7 --strip-root --pretty
# trycatch.js
# TODO track type reaching catch variable
# printf "trycatch.js:5:10 = "
# assert_ok "$FLOW" type-at-pos trycatch.js 5 10 --strip-root --pretty
# type-destructor.js
printf "type-destructor.js:3:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 3 6 --strip-root --pretty
printf "type-destructor.js:4:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 4 6 --strip-root --pretty
printf "type-destructor.js:5:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 5 6 --strip-root --pretty
printf "type-destructor.js:8:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 8 6 --strip-root --pretty
printf "type-destructor.js:10:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 10 6 --strip-root --pretty
printf "type-destructor.js:12:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 12 6 --strip-root --pretty
printf "type-destructor.js:13:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 13 6 --strip-root --pretty
printf "type-destructor.js:15:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 15 6 --strip-root --pretty
printf "type-destructor.js:16:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 16 6 --strip-root --pretty
printf "type-destructor.js:17:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 17 6 --strip-root --pretty
printf "type-destructor.js:19:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 19 6 --strip-root --pretty
printf "type-destructor.js:20:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 20 6 --strip-root --pretty
printf "type-destructor.js:21:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 21 6 --strip-root --pretty
printf "type-destructor.js:23:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 23 6 --strip-root --pretty
printf "type-destructor.js:27:5 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 27 5 --strip-root --pretty
printf "type-destructor.js:28:5 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 28 5 --strip-root --pretty
printf "type-destructor.js:29:5 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 28 5 --strip-root --pretty
printf "type-destructor.js:33:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 33 6 --strip-root --pretty
printf "type-destructor.js:34:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 34 6 --strip-root --pretty
printf "type-destructor.js:36:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 36 6 --strip-root --pretty
printf "type-destructor.js:37:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 37 6 --strip-root --pretty
printf "type-destructor.js:41:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 41 6 --strip-root --pretty
printf "type-destructor.js:42:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 42 6 --strip-root --pretty
printf "type-destructor.js:44:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 44 6 --strip-root --pretty
printf "type-destructor.js:45:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 45 6 --strip-root --pretty
printf "type-destructor.js:47:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 47 6 --strip-root --pretty
printf "type-destructor.js:48:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 48 6 --strip-root --pretty
printf "type-destructor.js:62:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 62 6 --strip-root --pretty
printf "type-destructor.js:63:6 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 63 6 --strip-root --pretty
printf "type-destructor.js:68:13 = "
assert_ok "$FLOW" type-at-pos type-destructor.js 68 13 --strip-root --pretty
# unions.js
printf "unions.js:9:3 = "
assert_ok "$FLOW" type-at-pos unions.js 9 3 --strip-root --pretty
printf "unions.js:15:2 = "
assert_ok "$FLOW" type-at-pos unions.js 15 2 --strip-root --pretty
printf "unions.js:24:3 = "
assert_ok "$FLOW" type-at-pos unions.js 24 3 --strip-root --pretty
printf "unions.js:43:3 = "
assert_ok "$FLOW" type-at-pos unions.js 43 3 --strip-root --pretty
printf "unions.js:44:3 = "
assert_ok "$FLOW" type-at-pos unions.js 44 3 --strip-root --pretty
printf "unions.js:49:1 = "
assert_ok "$FLOW" type-at-pos unions.js 49 1 --strip-root --pretty
printf "unions.js:52:1 = "
assert_ok "$FLOW" type-at-pos unions.js 52 1 --strip-root --pretty
printf "unions.js:57:5 = "
assert_ok "$FLOW" type-at-pos unions.js 57 5 --strip-root --pretty
printf "unions.js:59:18 = "
assert_ok "$FLOW" type-at-pos unions.js 59 18 --strip-root --pretty
# opaque.js
printf "opaque.js:3:20 = "
assert_ok "$FLOW" type-at-pos opaque.js 3 20 --strip-root --pretty
printf "opaque.js:4:14 = "
assert_ok "$FLOW" type-at-pos opaque.js 4 14 --strip-root --pretty
printf "opaque.js:4:19 = "
assert_ok "$FLOW" type-at-pos opaque.js 4 19 --strip-root --pretty
printf "opaque.js:6:22 = "
assert_ok "$FLOW" type-at-pos opaque.js 6 22 --strip-root --pretty
printf "opaque.js:7:13 = "
assert_ok "$FLOW" type-at-pos opaque.js 7 13 --strip-root --pretty
printf "opaque.js:7:18 = "
assert_ok "$FLOW" type-at-pos opaque.js 7 18 --strip-root --pretty
printf "opaque.js:9:22 = "
assert_ok "$FLOW" type-at-pos opaque.js 9 22 --strip-root --pretty
printf "opaque.js:10:13 = "
assert_ok "$FLOW" type-at-pos opaque.js 10 13 --strip-root --pretty
printf "opaque.js:10:18 = "
assert_ok "$FLOW" type-at-pos opaque.js 10 18 --strip-root --pretty
printf "opaque.js:12:14 = "
assert_ok "$FLOW" type-at-pos opaque.js 12 14 --strip-root --pretty
printf "opaque.js:13:14 = "
assert_ok "$FLOW" type-at-pos opaque.js 13 14 --strip-root --pretty
printf "opaque.js:13:19 = "
assert_ok "$FLOW" type-at-pos opaque.js 13 19 --strip-root --pretty
printf "opaque.js:15:22 = "
assert_ok "$FLOW" type-at-pos opaque.js 15 22 --strip-root --pretty
printf "opaque.js:16:14 = "
assert_ok "$FLOW" type-at-pos opaque.js 16 14 --strip-root --pretty
printf "opaque.js:16:19 = "
assert_ok "$FLOW" type-at-pos opaque.js 16 19 --strip-root --pretty
printf "opaque.js:19:14 = "
assert_ok "$FLOW" type-at-pos opaque.js 19 14 --strip-root --pretty
printf "opaque.js:19:22 = "
assert_ok "$FLOW" type-at-pos opaque.js 19 22 --strip-root --pretty
printf "opaque.js:20:16 = "
assert_ok "$FLOW" type-at-pos opaque.js 20 16 --strip-root --pretty
printf "opaque.js:20:34 = "
assert_ok "$FLOW" type-at-pos opaque.js 20 34 --strip-root --pretty
printf "opaque.js:21:19 = "
assert_ok "$FLOW" type-at-pos opaque.js 21 19 --strip-root --pretty
printf "opaque.js:21:28 = "
assert_ok "$FLOW" type-at-pos opaque.js 21 28 --strip-root --pretty
printf "opaque.js:24:7 = "
assert_ok "$FLOW" type-at-pos opaque.js 24 7 --strip-root --pretty
# optional_chaining.js
printf "optional_chaining.js:16:7 = "
assert_ok "$FLOW" type-at-pos optional_chaining.js 16 7 --strip-root --pretty
printf "optional_chaining.js:16:11 = "
assert_ok "$FLOW" type-at-pos optional_chaining.js 16 11 --strip-root --pretty
printf "optional_chaining.js:16:16 = "
assert_ok "$FLOW" type-at-pos optional_chaining.js 16 16 --strip-root --pretty
printf "optional_chaining.js:16:20 = "
assert_ok "$FLOW" type-at-pos optional_chaining.js 16 20 --strip-root --pretty
printf "optional_chaining.js:16:24 = "
assert_ok "$FLOW" type-at-pos optional_chaining.js 16 24 --strip-root --pretty
# type-alias.js
printf "type-alias.js:3:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 3 6 --strip-root --pretty
printf "type-alias.js:4:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 4 6 --strip-root --pretty
printf "type-alias.js:5:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 5 6 --strip-root --pretty
printf "type-alias.js:6:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 6 6 --strip-root --pretty
printf "type-alias.js:7:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty
printf "type-alias.js:7:6 (--expand-type-aliases) = "
assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:8:6 = "
assert_ok "$FLOW" type-at-pos type-alias.js 8 6 --strip-root --pretty
printf "type-alias.js:12:12 "
assert_ok "$FLOW" type-at-pos type-alias.js 12 12 --strip-root --pretty
printf "type-alias.js:12:29 "
assert_ok "$FLOW" type-at-pos type-alias.js 12 29 --strip-root --pretty
# Test interaction with RPolyTest
printf "type-alias.js:15:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 15 8 --strip-root --pretty
printf "type-alias.js:16:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 16 8 --strip-root --pretty
printf "type-alias.js:17:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 17 8 --strip-root --pretty
printf "type-alias.js:18:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 18 8 --strip-root --pretty
printf "type-alias.js:19:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 19 8 --strip-root --pretty
printf "type-alias.js:20:8 "
assert_ok "$FLOW" type-at-pos type-alias.js 20 8 --strip-root --pretty
printf "type-alias.js:24:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 24 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:25:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 25 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:27:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 27 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:29:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 29 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:31:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 31 6 --strip-root --pretty --expand-type-aliases
printf "type-alias.js:34:6 "
assert_ok "$FLOW" type-at-pos type-alias.js 34 6 --strip-root --pretty --expand-json-output
| Java |
exports.LOADING = "LOADING";
exports.ERROR = "ERROR";
exports.SUCCESS = "SUCCESS";
exports.FETCH = "FETCH";
exports.CREATE = "CREATE";
exports.UPDATE = "UPDATE";
exports.DELETE = "DELETE";
exports.SET_EDIT_MODE = "SET_EDIT_MODE";
exports.SET_ADD_MODE = "SET_ADD_MODE";
exports.CLOSE_FORM = "CLOSE_FORM";
exports.SET_PAGE = "SET_PAGE"
| Java |
'use strict';
exports.ContainerBuilder = require('./CqrsContainerBuilder');
exports.EventStream = require('./EventStream');
exports.CommandBus = require('./CommandBus');
exports.EventStore = require('./EventStore');
exports.AbstractAggregate = require('./AbstractAggregate');
exports.AggregateCommandHandler = require('./AggregateCommandHandler');
exports.AbstractSaga = require('./AbstractSaga');
exports.SagaEventHandler = require('./SagaEventHandler');
exports.AbstractProjection = require('./AbstractProjection');
exports.InMemoryMessageBus = require('./infrastructure/InMemoryMessageBus');
exports.InMemoryEventStorage = require('./infrastructure/InMemoryEventStorage');
exports.InMemorySnapshotStorage = require('./infrastructure/InMemorySnapshotStorage');
exports.InMemoryView = require('./infrastructure/InMemoryView');
exports.getMessageHandlerNames = require('./utils/getMessageHandlerNames');
exports.subscribe = require('./subscribe');
| Java |
<!DOCTYPE html>
<html><head>
<script type="text/javascript" src="lightgl.js"></script>
<script type="text/javascript" src="csg.js"></script>
<script type="text/javascript" src="openjscad.js"></script>
<script type="text/javascript" src="braille.jscad" charset="utf-8"></script>
<script type="text/javascript" src="jquery-1.10.1.min.js"></script>
<style>
body {
font: 14px/20px 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif;
max-width: 820px;
margin: 0 auto;
padding: 10px;
}
canvas {
border: 1px solid black;
margin: 0px 8px;
}
pre, code {
font: 12px/20px Monaco, monospace;
border: 1px solid #CCC;
border-radius: 3px;
background: #F9F9F9;
padding: 0 3px;
color: #555;
}
pre {
padding: 10px;
width: 100%;
}
textarea {
font: 12px/20px Monaco, monospace;
padding: 5px 8px;
width: 300px;
height: 100px;
}
td {
vertical-align: top;
}
canvas { cursor: move; }
</style>
<link rel="stylesheet" href="openjscad.css" type="text/css" />
<script>
var gProcessor=null;
var detailsOffset = 4;
var detailsAmount = 7;
// Show all exceptions to the user:
OpenJsCad.AlertUserOfUncaughtExceptions();
function onload()
{
gProcessor = new OpenJsCad.Processor(document.getElementById("viewer"));
jQuery.get('braille.jscad', function(data)
{
gProcessor.setJsCad(data, "braille.jscad");
showDetails(false);
});
adaptControls();
}
function adaptControls()
{
if (gProcessor.viewer != null)
gProcessor.viewer.gl.clearColor(1, 1, 0.97, 1);
$("#viewer .viewer")[0].style.backgroundColor = "white";
$("#viewer .parametersdiv button")[0].onclick = parseParameters;
var moreElement = "<hr/><p><a id='more'></a></p>";
$("#viewer .parametersdiv .parameterstable").after(moreElement);
setLanguage("german");
}
function setLanguage(lang)
{
if (lang == "german")
{
// var $statusBar = $("#viewer .statusdiv");
// $statusBar.children("span")[0].innerHTML = "Fertig."
$("#viewer .parametersdiv button")[0].innerHTML = "3D Modell generieren";
}
}
function showDetails(show)
{
var tableRows = $("#viewer .parametersdiv .parameterstable tr");
for (var i=detailsOffset; i < tableRows.length && i < detailsOffset+detailsAmount; i++)
{
tableRows[i].style.display = (show) ? "table-row" : "none";
}
var moreLink = $("#more")[0];
moreLink.innerHTML = (show) ? "simple Einstellungen" : "Details einstellen";
moreLink.href = "javascript:showDetails(" + !show + ");";
}
function parseParameters()
{
var param_form_size = $("#viewer .parametersdiv .parameterstable tr:eq(4) td:eq(1) input")[0];
param_form_size.value = Math.min(Math.max(param_form_size.value, 0.0), 10.0);
var param_dot_height = $("#viewer .parametersdiv .parameterstable tr:eq(5) td:eq(1) input")[0];
param_dot_height.value = Math.min(Math.max(param_dot_height.value, 0.5), 0.8);
var param_dot_diameter = $("#viewer .parametersdiv .parameterstable tr:eq(6) td:eq(1) input")[0];
param_dot_diameter.value = Math.min(Math.max(param_dot_diameter.value, 1.4), 1.6);
var param_plate_thickness = $("#viewer .parametersdiv .parameterstable tr:eq(7) td:eq(1) input")[0];
param_plate_thickness.value = Math.max(param_plate_thickness.value, 0.0);
var param_resolution = $("#viewer .parametersdiv .parameterstable tr:eq(10) td:eq(1) input")[0];
var isnumber = !isNaN(parseInt(param_resolution.value)) && isFinite(param_resolution.value);
var resolution = (isnumber) ? parseInt(param_resolution.value) : 0;
resolution = Math.min(Math.max(param_resolution.value, 10), 30);
resolution += (resolution % 2);
param_resolution.value = resolution;
gProcessor.rebuildSolid();
}
</script>
<title>Text to 3d printable Braille</title>
</head>
<body onload="onload()">
<h1>Text to 3d printable Braille</h1>
<div id="viewer"></div>
</body>
</html>
| Java |
# Pull base image with batteries
FROM buildpack-deps:jessie
MAINTAINER EngageNExecute code@engagenexecute.com
# Install packages.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
locales \
python-dev \
cmake \
libpq-dev \
python-pip \
git-core \
libopencv-dev \
postgresql-9.4 \
python-opencv \
python-numpy
# Set UTF-8 as locales
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
# ENV UTF-8
ENV LC_ALL C.UTF-8
# Disable warning driver1394 (camera)
RUN ln /dev/null /dev/raw1394
| Java |
'use strict';
var _ = require('./underscore-mixins.js');
var fnToNode = new Map();
exports.load = function (nodes, prefix) {
let uuid = require('uuid');
if (prefix != null && prefix.length > 0) {
prefix = prefix + ':';
} else {
prefix = '';
}
_(nodes).forEach(function (fn, name) {
if (_.isFunction(fn)) {
fnToNode.set(fn, {
name: prefix + name,
id: uuid.v4(),
fn: fn,
ingoingLinks: new Map(),
outgoingLinks: new Map(),
counter: 0
});
} else {
exports.load(fn, name);
}
});
};
exports.clone = function (fn, name) {
var node = fnToNode.get(fn);
var newNodeLoader = {};
newNodeLoader[name] = node.fn.bind({});
exports.load(newNodeLoader);
return newNodeLoader[name];
};
exports.debug = function () {
fnToNode.forEach(function (node) {
console.log(
_(Array.from(node.ingoingLinks.keys())).pluck('name'),
node.name,
_(Array.from(node.outgoingLinks.keys())).pluck('name')
);
});
};
var defaultLinkOptions = {
primary: true
};
exports.link = function (fn) {
var node = fnToNode.get(fn);
return {
to: function (toFn, options) {
options = _(options || {}).defaults(defaultLinkOptions);
var toNode = fnToNode.get(toFn);
toNode.ingoingLinks.set(node, options);
node.outgoingLinks.set(toNode, options);
}
};
};
exports.unlink = function (fn) {
var node = fnToNode.get(fn);
return {
from: function (fromFn) {
var fromNode = fnToNode.get(fromFn);
fromNode.ingoingLinks.delete(node);
node.outgoingLinks.delete(fromNode);
}
};
};
exports.remove = function (fn) {
var node = fnToNode.get(fn),
todo = [];
node.ingoingLinks.forEach(function (inOptions, inNode) {
todo.push(function () {
exports.unlink(inNode.fn).from(fn);
});
node.outgoingLinks.forEach(function (outOptions, outNode) {
todo.push(function () {
exports.unlink(fn).from(outNode.fn);
exports.link(inNode.fn).to(outNode.fn, outOptions);
});
});
});
_(todo).invoke('call');
};
exports.replace = function (fn) {
var node = fnToNode.get(fn),
todo = [];
return {
by: function (byFn) {
node.ingoingLinks.forEach(function (inOptions, inNode) {
todo.push(function () {
exports.unlink(inNode.fn).from(node.fn);
exports.link(inNode.fn).to(byFn, inOptions);
});
});
node.outgoingLinks.forEach(function (outOptions, outNode) {
todo.push(function () {
exports.unlink(node.fn).from(outNode.fn);
exports.link(byFn).to(outNode.fn, outOptions);
});
});
_(todo).invoke('call');
}
}
};
exports.before = function (fn) {
var node = fnToNode.get(fn),
todo = [];
return {
insert: function (beforeFn) {
node.ingoingLinks.forEach(function (inOptions, inNode) {
todo.push(function () {
exports.unlink(inNode.fn).from(node.fn);
exports.link(inNode.fn).to(beforeFn, inOptions);
});
});
todo.push(function () {
exports.link(beforeFn).to(node.fn);
});
_(todo).invoke('call');
}
};
};
exports.after = function (fn) {
var node = fnToNode.get(fn),
todo = [];
return {
insert: function (afterFn) {
node.outgoingLinks.forEach(function (outOptions, outNode) {
todo.push(function () {
exports.unlink(node.fn).from(outNode.fn);
exports.link(afterFn).to(outNode.fn, outOptions);
});
});
todo.push(function () {
exports.link(node.fn).to(afterFn);
});
_(todo).invoke('call');
}
};
};
var runEntryNode;
function linksToStream(links) {
let plumber = require('gulp-plumber');
return _(links).chain()
.pluck('fn')
.map(exports.run)
.compact()
.concatVinylStreams()
.value()
.pipe(plumber());
}
exports.run = function (fn) {
var result,
node = fnToNode.get(fn);
runEntryNode = runEntryNode || node;
if (node.lastResult != null) {
return node.lastResult;
}
var primaryStreams = [],
secondaryStreams = [];
node.ingoingLinks.forEach(function (options, node) {
if (options.primary) {
primaryStreams.push(node);
} else {
secondaryStreams.push(node);
}
});
var primaryStream = linksToStream(primaryStreams),
secondaryStream = linksToStream(secondaryStreams);
result = fn(primaryStream, secondaryStream);
if (runEntryNode === node) {
fnToNode.forEach(function (node) {
delete node.lastResult;
});
}
else {
node.lastResult = result;
}
return result;
};
function isNotAlone(node) {
return (node.ingoingLinks.size + node.outgoingLinks.size) > 0;
}
function isSource(node) {
return node.ingoingLinks.size === 0;
}
function isOutput(node) {
return node.outgoingLinks.size === 0;
}
exports.renderGraph = function (renderer, filepath, callback) {
let graphdot = require('./graphdot.js');
var graph = graphdot.digraph('one_gulp_streams_graph');
graph.set('label', 'one-gulp streams graph\n\n');
graph.set('fontname', 'sans-serif');
graph.set('fontsize', '20');
graph.set('labelloc', 't');
graph.set('pad', '0.5,0.5');
graph.set('nodesep', '0.3');
graph.set('splines', 'spline');
graph.set('ranksep', '1');
graph.set('rankdir', 'LR');
var promises = [];
fnToNode.forEach(function (node) {
var nodeOptions = {
label: node.name,
shape: 'rectangle',
fontname: 'sans-serif',
style: 'bold',
margin: '0.2,0.1'
};
if (isSource(node)) {
nodeOptions.shape = 'ellipse';
nodeOptions.color = 'lavender';
nodeOptions.fontcolor = 'lavender';
nodeOptions.margin = '0.1,0.1';
}
if (isOutput(node)) {
nodeOptions.color = 'limegreen';
nodeOptions.fontcolor = 'white';
nodeOptions.style = 'filled';
nodeOptions.margin = '0.25,0.25';
}
if (isNotAlone(node)) {
node.graphNode = graph.addNode(node.id, nodeOptions);
if (isSource(node)) {
var donePromise = new Promise(function (resolve, reject) {
node.fn()
.on('data', function () {
node.counter += 1;
node.graphNode.set('color', 'mediumslateblue');
node.graphNode.set('fontcolor', 'mediumslateblue');
node.graphNode.set('label', node.name + ' (' + node.counter + ')');
})
.on('error', reject)
.on('end', resolve);
});
promises.push(donePromise);
}
}
});
Promise.all(promises).then(function () {
fnToNode.forEach(function (node) {
node.ingoingLinks.forEach(function (options, linkedNode) {
var edgeOptions = {};
if (options.primary) {
edgeOptions.penwidth = '1.5';
} else {
edgeOptions.arrowhead = 'empty';
edgeOptions.style = 'dashed';
}
if (isSource(linkedNode)) {
edgeOptions.color = linkedNode.graphNode.get('color');
}
graph.addEdge(linkedNode.graphNode, node.graphNode, edgeOptions);
});
});
graphdot.renderToSvgFile(graph, renderer, filepath, callback);
});
}; | Java |
Text Override
===
v.2.8.4
by: Matthew D. Jordan
### About
A simple interface to modify a dimension's text override value directly. It even features shortcuts for frequently used overrides. Clear a text override by entering an empty string at the command line. If you want to use a chuck of text that includes space characters, use the Literal option.
### Use:
Start Text Override by entering:
```command: textoverride```
```Select dimension(s):``` it will only select dimensions, so feel free to select regular objects, they will not be affected. You can also select your dimensions before you start the command.
```Enter Override Text:``` Guess what happens here? You can also enter shortcuts (upper or lower-case) for commonly used dimension notes. These are listed below and at the prompt. Also, you can clear a text override by entering nothing at the text prompt.
### Built-In Shortcuts:
|Shortcut...|Means...|
|:--:|--|
|t|5'-0" TYP|
|c|5'-0" OC|
|ct|5'-0" OC TYP|
|cc|5'-0" CTC|
|cct|5'-0" CTC TYP|
|nct|5'-0" <newline> OC TYP|
|th|5'-0" THRU|
|s|5'-0" (Skin)|
|p|(5'-0")|
|<none>|reset text override|
### GUI Helpers
The file ```textOverride-GUI-helpers.lsp``` adds specific autocad command functions to allow gui elements (toolbar buttons, menu items, and ribbon controls) to access textOverride shortcuts directly. | Java |
#!/bin/sh
#
# MediaWiki Setup Script
#
# This script will install and configure MediaWiki on
# an Ubuntu 14.04 droplet
export DEBIAN_FRONTEND=noninteractive;
# Generate root and wordpress mysql passwords
rootmysqlpass=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -dc 'a-zA-Z0-9'`;
mwmysqlpass=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -dc 'a-zA-Z0-9'`;
# Write passwords to file
echo "MySQL Passwords for this droplet " > /etc/motd.tail;
echo "-----------------------------------" >> /etc/motd.tail;
echo "Root MySQL Password: $rootmysqlpass" >> /etc/motd.tail;
echo "MediaWiki MySQL Database: mwdb" >> /etc/motd.tail;
echo "Mediawiki MySQL Username: mwsql" >> /etc/motd.tail;
echo "Mediawiki MySQL Password: $mwmysqlpass" >> /etc/motd.tail;
echo "-----------------------------------" >> /etc/motd.tail;
echo "You can remove this information with 'rm -f /etc/motd.tail'" >> /etc/motd.tail;
apt-get update;
apt-get -y install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-gd php5-intl php-pear php5-dev make libpcre3-dev php-apc;
# Set up database user
/usr/bin/mysqladmin -u root -h localhost create mwdb;
/usr/bin/mysqladmin -u root -h localhost password $rootmysqlpass;
/usr/bin/mysql -uroot -p$rootmysqlpass -e "CREATE USER mwsql@localhost IDENTIFIED BY '"$mwmysqlpass"'";
/usr/bin/mysql -uroot -p$rootmysqlpass -e "GRANT ALL PRIVILEGES ON mwdb.* TO mwsql@localhost";
rm -f /var/www/html/index.html;
wget http://releases.wikimedia.org/mediawiki/1.25/mediawiki-1.25.1.tar.gz -O /root/mediawiki.tar.gz;
cd /root;
tar -zxf /root/mediawiki.tar.gz;
cp -Rf /root/mediawiki-1.25.1/* /var/www/html/.;
#rm /root/mediawiki.tar.gz;
#rm -Rf /root/mediawiki-1.25.1;
chown -Rf www-data.www-data /var/www/html;
service apache2 restart;
cat /etc/motd.tail > /var/run/motd.dynamic;
chmod 0660 /var/run/motd.dynamic;
| Java |
# Zensible Mongo
Extension library to simplify working with mongo, it uses a builder pattern approach to performing calls to the mongo db, this allows for specific type of calls to be stored.
# Motivation
We all had to perform simple mongo actions but because of the mindboogling poor api of the offical mongo driver instead gone insane.
For instance lets say we want to find a single document by id
```
var filter = Builders<BsonDocument>.Filter.Eq("_id", id);
var result = collection.Find(filter);
var document = await result.SingleOrDefaultAsync()
```
Alternative with zensible mongo
```
var document = await collection.ForId(id).PullAsync();
```
Or lets assume you want to insert a document into mongo and get the id that it got inserted with
```
await collection.InsertOneAsync(document) <--- returns void
```
Hmm thats weired there doesn't seem to be a way to get the id... ofc it changes the id directly on the document you are passing it. Nice unsafe shared memory you got there!
Alternative with zensible mongo
```
var documentWithID = await collection.Create(document).PushAsync()
documentWithID.ShouldNotBe(document) //pass
```
ahh nice a cloned safe version that is different
# How To
### Query
For a look up simply chose a selector such as ForId, ForSingleWhere etc.
To Fetch a single document based on a condition.
```
var document = await collection.ForSingleWhere(d => d.IsDue).PullAsync();
```
ForSingleWhere should be be read: For a Single document Where (predicate) is true..
To fetch all documents based on a condition.
```
var document = await collection.ForAllWhere(d => d.IsDue).PullAsync();
```
ForAllWhere should be be read: For All document Where (predicate) is true...
To fetch all documents
```
var document = await collection.ForAllWhere(d => d.IsDue).PullAsync();
```
ForAllWhere should be be read: For All document Where (predicate) is true...
### Update
Like with the query we begin by ForId/ForSingleWhere/For..
```
var document = await collection.ForId(id)
.Set(d => d.Field, value)
.PushAsync();
```
BONUS: if the selection only refers to one document that document will be returned.
To change multiple fields simply string them together
```
var document = await collection.ForId(id)
.Set(d => d.Field1, value1)
.Set(d => d.Field2, value2)
.Set(d => d.Field3, value3)
..
..
.PushAsync();
```
### Delete
Like with query simply attach delete and the result will be a delete
```
var document = await collection.ForId(id).Delete().PushAsync();
```
BONUS: if the selection only refers to one document that document will be returned.
### Create
To insert a document in the mongo collection simply use Create
```
var newDocument = await collection.Create(document).PushAsync(); // newDocument != document
```
For multiple documents
```
var manyNewDocs = await collection.Create(doc1, doc2, ...).PushAsync();
```
## What is up with the Pull/Push?
One of the features of this extension library is that actions can be stored and then used.
for instance lets say I have a mail server and I want to define a query for all read mails.
```
var allReadMailsQuery = collection.ForAllWhere(m => m.IsRead)
```
Now when I need it I can either fetch it, delete it etc etc..
```
var allReadMails = await allReadMailsQuery.PullAsync();
await allReadMailsQuery.Delete().PushAsync();
...
...
```
| Java |
@echo off
ipython notebook Numba_Demo_002.ipynb
ipython nbconvert Numba_Demo_002.ipynb --to slides --post serve
pause | Java |
import { connect } from 'react-redux';
import Main from './Main';
import * as userActions from '../../state/user/userActions';
const mapStateToProps = (state, ownProps) => {
return {
activeTab: ownProps.location.pathname.split('/')[2]
};
};
const mapDispatchToProps = (dispatch) => {
return {
getUserData: () => dispatch(userActions.authRequest())
};
};
export default connect(mapStateToProps, mapDispatchToProps)(Main);
| Java |
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MembersComponent } from './members/members.component';
import { SeatingMapComponent } from './seating-map/seating-map.component';
const routes: Routes = [
{
path: 'members',
component: MembersComponent
},
{
path: 'seating-map',
component: SeatingMapComponent
},
{
path: '',
redirectTo: '/members',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
| Java |
# Update the X font indexes:
if [ -x /usr/bin/mkfontdir ]; then
/usr/bin/mkfontscale /usr/share/fonts/TTF
/usr/bin/mkfontdir /usr/share/fonts/TTF
/usr/bin/mkfontscale /usr/share/fonts/OTF
/usr/bin/mkfontdir /usr/share/fonts/OTF
fi
if [ -x /usr/bin/fc-cache ]; then
/usr/bin/fc-cache -f
fi
| Java |
(function(angular) {
'use strict';
angular
.module('jstube.chromeExtensionCleaner.popup')
.directive('jstubeNavbar', jstubeNavbar);
function jstubeNavbar() {
return {
restrict: 'E',
templateUrl: 'nav/_navbar.html',
controller: 'NavbarController',
controllerAs: 'nav'
};
}
} (window.angular)); | Java |
// Just re-export everything from the other files
export * from './base-table-name';
export * from './compound-constraint';
export * from './constraint';
export * from './constraint-type';
export * from './default-value';
export * from './error-response';
export * from './filter-operation';
export * from './filter';
export * from './master-table-name';
export * from './raw-constraint';
export * from './paginated-response';
export * from './session-ping';
export * from './special-default-value';
export * from './sql-row';
export * from './table-data-type';
export * from './table-header';
export * from './table-insert';
export * from './table-meta';
export * from './table-tier';
export * from './transformed-name';
| Java |
package com.dranawhite.mybatis.handler;
import com.alibaba.fastjson.JSON;
import com.dranawhite.mybatis.model.Address;
import com.dranawhite.mybatis.model.FullAddress;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import org.apache.ibatis.type.TypeHandler;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* @author dranawhite 2018/1/2
* @version 1.0
*/
@MappedTypes(FullAddress.class)
@MappedJdbcTypes(JdbcType.VARCHAR)
public class FullAddressJsonHandler implements TypeHandler<FullAddress> {
@Override
public void setParameter(PreparedStatement ps, int i, FullAddress parameter, JdbcType jdbcType)
throws SQLException {
String address = JSON.toJSONString(parameter);
ps.setString(i, address);
}
@Override
public FullAddress getResult(ResultSet rs, String columnName) throws SQLException {
String address = rs.getString(columnName);
return JSON.parseObject(address, FullAddress.class);
}
@Override
public FullAddress getResult(ResultSet rs, int columnIndex) throws SQLException {
String address = rs.getString(columnIndex);
return JSON.parseObject(address, FullAddress.class);
}
@Override
public FullAddress getResult(CallableStatement cs, int columnIndex) throws SQLException {
String address = cs.getString(columnIndex);
return JSON.parseObject(address, FullAddress.class);
}
}
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/favicon.ico" />
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/iosicon.png" />
<!-- DEVELOPMENT LESS -->
<!-- <link rel="stylesheet/less" href="css/photon.less" media="all" />
<link rel="stylesheet/less" href="css/photon-responsive.less" media="all" />
--> <!-- PRODUCTION CSS -->
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-min.css?v1.1" media="all" />
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-min-part2.css?v1.1" media="all" />
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-responsive-min.css?v1.1" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]-->
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="user-sub-menu-container">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.breadcrumb-container').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.user-sub-menu-container').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="form-centering-wrapper">
<div class="form-window-login">
<div class="form-window-login-logo">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="photon-min.css-v1.1.html#">Sign Up »</a>
<a href="photon-min.css-v1.1.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="photon-min.css-v1.1.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| Java |
from util.tipo import tipo
class S_PARTY_MEMBER_INTERVAL_POS_UPDATE(object):
def __init__(self, tracker, time, direction, opcode, data):
print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
| Java |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__(1);
var React = __webpack_require__(2);
var ReactDOM = __webpack_require__(3);
var Hello_1 = __webpack_require__(4);
var LabelTextbox_1 = __webpack_require__(5);
var WebUser_1 = __webpack_require__(6);
$(function () {
var id = "target";
var container = document.getElementById(id);
var model = new WebUser_1.default("James", null);
function validate() {
return model.validate();
}
var wrapper = React.createElement("div", null, React.createElement(Hello_1.default, {class: "welcome", compiler: "TypeScript", framework: "ReactJS"}), React.createElement(LabelTextbox_1.default, {class: "field-username", type: "text", label: "Username", model: model}), React.createElement("button", {onClick: validate}, "Validate"));
ReactDOM.render(wrapper, container);
});
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
* jQuery JavaScript Library v3.0.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2016-06-09T18:02Z
*/
( function( global, factory ) {
"use strict";
if ( typeof module === "object" && typeof module.exports === "object" ) {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
if ( !w.document ) {
throw new Error( "jQuery requires a window with a document" );
}
return factory( w );
};
} else {
factory( global );
}
// Pass this if window is not defined yet
}( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
// enough that all such attempts are guarded in a try block.
"use strict";
var arr = [];
var document = window.document;
var getProto = Object.getPrototypeOf;
var slice = arr.slice;
var concat = arr.concat;
var push = arr.push;
var indexOf = arr.indexOf;
var class2type = {};
var toString = class2type.toString;
var hasOwn = class2type.hasOwnProperty;
var fnToString = hasOwn.toString;
var ObjectFunctionString = fnToString.call( Object );
var support = {};
function DOMEval( code, doc ) {
doc = doc || document;
var script = doc.createElement( "script" );
script.text = code;
doc.head.appendChild( script ).parentNode.removeChild( script );
}
var
version = "3.0.0",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context );
},
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([a-z])/g,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: version,
constructor: jQuery,
// The default length of a jQuery object is 0
length: 0,
toArray: function() {
return slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num != null ?
// Return just the one element from the set
( num < 0 ? this[ num + this.length ] : this[ num ] ) :
// Return all the elements in a clean array
slice.call( this );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
each: function( callback ) {
return jQuery.each( this, callback );
},
map: function( callback ) {
return this.pushStack( jQuery.map( this, function( elem, i ) {
return callback.call( elem, i, elem );
} ) );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
},
end: function() {
return this.prevObject || this.constructor();
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: arr.sort,
splice: arr.splice
};
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[ 0 ] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
// Skip the boolean and the target
target = arguments[ i ] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if ( i === length ) {
target = this;
i--;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( ( options = arguments[ i ] ) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
( copyIsArray = jQuery.isArray( copy ) ) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray( src ) ? src : [];
} else {
clone = src && jQuery.isPlainObject( src ) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend( {
// Unique for each copy of jQuery on the page
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
// Assume jQuery is ready without the ready module
isReady: true,
error: function( msg ) {
throw new Error( msg );
},
noop: function() {},
isFunction: function( obj ) {
return jQuery.type( obj ) === "function";
},
isArray: Array.isArray,
isWindow: function( obj ) {
return obj != null && obj === obj.window;
},
isNumeric: function( obj ) {
// As of jQuery 3.0, isNumeric is limited to
// strings and numbers (primitives or objects)
// that can be coerced to finite numbers (gh-2662)
var type = jQuery.type( obj );
return ( type === "number" || type === "string" ) &&
// parseFloat NaNs numeric-cast false positives ("")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
!isNaN( obj - parseFloat( obj ) );
},
isPlainObject: function( obj ) {
var proto, Ctor;
// Detect obvious negatives
// Use toString instead of jQuery.type to catch host objects
if ( !obj || toString.call( obj ) !== "[object Object]" ) {
return false;
}
proto = getProto( obj );
// Objects with no prototype (e.g., `Object.create( null )`) are plain
if ( !proto ) {
return true;
}
// Objects with prototype are plain iff they were constructed by a global Object function
Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
type: function( obj ) {
if ( obj == null ) {
return obj + "";
}
// Support: Android <=2.3 only (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[ toString.call( obj ) ] || "object" :
typeof obj;
},
// Evaluates a script in a global context
globalEval: function( code ) {
DOMEval( code );
},
// Convert dashed to camelCase; used by the css and data modules
// Support: IE <=9 - 11, Edge 12 - 13
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
each: function( obj, callback ) {
var length, i = 0;
if ( isArrayLike( obj ) ) {
length = obj.length;
for ( ; i < length; i++ ) {
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
break;
}
}
} else {
for ( i in obj ) {
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
break;
}
}
}
return obj;
},
// Support: Android <=4.0 only
trim: function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArrayLike( Object( arr ) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
return arr == null ? -1 : indexOf.call( arr, elem, i );
},
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
merge: function( first, second ) {
var len = +second.length,
j = 0,
i = first.length;
for ( ; j < len; j++ ) {
first[ i++ ] = second[ j ];
}
first.length = i;
return first;
},
grep: function( elems, callback, invert ) {
var callbackInverse,
matches = [],
i = 0,
length = elems.length,
callbackExpect = !invert;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
callbackInverse = !callback( elems[ i ], i );
if ( callbackInverse !== callbackExpect ) {
matches.push( elems[ i ] );
}
}
return matches;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var length, value,
i = 0,
ret = [];
// Go through the array, translating each of the items to their new values
if ( isArrayLike( elems ) ) {
length = elems.length;
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret.push( value );
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret.push( value );
}
}
}
// Flatten any nested arrays
return concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var tmp, args, proxy;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
now: Date.now,
// jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist.
support: support
} );
// JSHint would error on this code due to the Symbol not being defined in ES5.
// Defining this global in .jshintrc would create a danger of using the global
// unguarded in another place, it seems safer to just disable JSHint for these
// three lines.
/* jshint ignore: start */
if ( typeof Symbol === "function" ) {
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
}
/* jshint ignore: end */
// Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
function( i, name ) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
} );
function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
type = jQuery.type( obj );
if ( type === "function" || jQuery.isWindow( obj ) ) {
return false;
}
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
var Sizzle =
/*!
* Sizzle CSS Selector Engine v2.3.0
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-01-04
*/
(function( window ) {
var i,
support,
Expr,
getText,
isXML,
tokenize,
compile,
select,
outermostContext,
sortInput,
hasDuplicate,
// Local document vars
setDocument,
document,
docElem,
documentIsHTML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
// Instance-specific data
expando = "sizzle" + 1 * new Date(),
preferredDoc = window.document,
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
}
return 0;
},
// Instance methods
hasOwn = ({}).hasOwnProperty,
arr = [],
pop = arr.pop,
push_native = arr.push,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf as it's faster than native
// https://jsperf.com/thor-indexof-vs-for/5
indexOf = function( list, elem ) {
var i = 0,
len = list.length;
for ( ; i < len; i++ ) {
if ( list[i] === elem ) {
return i;
}
}
return -1;
},
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
// Regular expressions
// http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
// Operator (capture 2)
"*([*^$|!~]?=)" + whitespace +
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
"*\\]",
pseudos = ":(" + identifier + ")(?:\\((" +
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// 1. quoted (capture 3; capture 4 or capture 5)
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
// 2. simple (capture 6)
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
// 3. anything else (capture 2)
".*" +
")\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rwhitespace = new RegExp( whitespace + "+", "g" ),
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + identifier + ")" ),
"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
"TAG": new RegExp( "^(" + identifier + "|[*])" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rnative = /^[^{]+\{\s*\[native \w/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rsibling = /[+~]/,
// CSS escapes
// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
funescape = function( _, escaped, escapedWhitespace ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
// Support: Firefox<24
// Workaround erroneous numeric interpretation of +"0x"
return high !== high || escapedWhitespace ?
escaped :
high < 0 ?
// BMP codepoint
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
},
// CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms
rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,
fcssescape = function( ch, asCodePoint ) {
if ( asCodePoint ) {
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
if ( ch === "\0" ) {
return "\uFFFD";
}
// Control characters and (dependent upon position) numbers get escaped as code points
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
}
// Other potentially-special ASCII characters get backslash-escaped
return "\\" + ch;
},
// Used for iframes
// See setDocument()
// Removing the function wrapper causes a "Permission Denied"
// error in IE
unloadHandler = function() {
setDocument();
},
disabledAncestor = addCombinator(
function( elem ) {
return elem.disabled === true;
},
{ dir: "parentNode", next: "legend" }
);
// Optimize for push.apply( _, NodeList )
try {
push.apply(
(arr = slice.call( preferredDoc.childNodes )),
preferredDoc.childNodes
);
// Support: Android<4.0
// Detect silently failing push.apply
arr[ preferredDoc.childNodes.length ].nodeType;
} catch ( e ) {
push = { apply: arr.length ?
// Leverage slice if possible
function( target, els ) {
push_native.apply( target, slice.call(els) );
} :
// Support: IE<9
// Otherwise append directly
function( target, els ) {
var j = target.length,
i = 0;
// Can't trust NodeList.length
while ( (target[j++] = els[i++]) ) {}
target.length = j - 1;
}
};
}
function Sizzle( selector, context, results, seed ) {
var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument,
// nodeType defaults to 9, since context defaults to document
nodeType = context ? context.nodeType : 9;
results = results || [];
// Return early from calls with invalid selector or context
if ( typeof selector !== "string" || !selector ||
nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
return results;
}
// Try to shortcut find operations (as opposed to filters) in HTML documents
if ( !seed ) {
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
setDocument( context );
}
context = context || document;
if ( documentIsHTML ) {
// If the selector is sufficiently simple, try using a "get*By*" DOM method
// (excepting DocumentFragment context, where the methods don't exist)
if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
// ID selector
if ( (m = match[1]) ) {
// Document context
if ( nodeType === 9 ) {
if ( (elem = context.getElementById( m )) ) {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
// Element context
} else {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( newContext && (elem = newContext.getElementById( m )) &&
contains( context, elem ) &&
elem.id === m ) {
results.push( elem );
return results;
}
}
// Type selector
} else if ( match[2] ) {
push.apply( results, context.getElementsByTagName( selector ) );
return results;
// Class selector
} else if ( (m = match[3]) && support.getElementsByClassName &&
context.getElementsByClassName ) {
push.apply( results, context.getElementsByClassName( m ) );
return results;
}
}
// Take advantage of querySelectorAll
if ( support.qsa &&
!compilerCache[ selector + " " ] &&
(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
if ( nodeType !== 1 ) {
newContext = context;
newSelector = selector;
// qSA looks outside Element context, which is not what we want
// Thanks to Andrew Dupont for this workaround technique
// Support: IE <=8
// Exclude object elements
} else if ( context.nodeName.toLowerCase() !== "object" ) {
// Capture the context ID, setting it first if necessary
if ( (nid = context.getAttribute( "id" )) ) {
nid = nid.replace( rcssescape, fcssescape );
} else {
context.setAttribute( "id", (nid = expando) );
}
// Prefix every selector in the list
groups = tokenize( selector );
i = groups.length;
while ( i-- ) {
groups[i] = "#" + nid + " " + toSelector( groups[i] );
}
newSelector = groups.join( "," );
// Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
context;
}
if ( newSelector ) {
try {
push.apply( results,
newContext.querySelectorAll( newSelector )
);
return results;
} catch ( qsaError ) {
} finally {
if ( nid === expando ) {
context.removeAttribute( "id" );
}
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Create key-value caches of limited size
* @returns {function(string, object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
function createCache() {
var keys = [];
function cache( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
if ( keys.push( key + " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
}
return (cache[ key + " " ] = value);
}
return cache;
}
/**
* Mark a function for special use by Sizzle
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
}
/**
* Support testing using an element
* @param {Function} fn Passed the created element and returns a boolean result
*/
function assert( fn ) {
var el = document.createElement("fieldset");
try {
return !!fn( el );
} catch (e) {
return false;
} finally {
// Remove from its parent by default
if ( el.parentNode ) {
el.parentNode.removeChild( el );
}
// release memory in IE
el = null;
}
}
/**
* Adds the same handler for all of the specified attrs
* @param {String} attrs Pipe-separated list of attributes
* @param {Function} handler The method that will be applied
*/
function addHandle( attrs, handler ) {
var arr = attrs.split("|"),
i = arr.length;
while ( i-- ) {
Expr.attrHandle[ arr[i] ] = handler;
}
}
/**
* Checks document order of two siblings
* @param {Element} a
* @param {Element} b
* @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
*/
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
a.sourceIndex - b.sourceIndex;
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( (cur = cur.nextSibling) ) {
if ( cur === b ) {
return -1;
}
}
}
return a ? 1 : -1;
}
/**
* Returns a function to use in pseudos for input types
* @param {String} type
*/
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
/**
* Returns a function to use in pseudos for buttons
* @param {String} type
*/
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
}
/**
* Returns a function to use in pseudos for :enabled/:disabled
* @param {Boolean} disabled true for :disabled; false for :enabled
*/
function createDisabledPseudo( disabled ) {
// Known :disabled false positives:
// IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)
// not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
return function( elem ) {
// Check form elements and option elements for explicit disabling
return "label" in elem && elem.disabled === disabled ||
"form" in elem && elem.disabled === disabled ||
// Check non-disabled form elements for fieldset[disabled] ancestors
"form" in elem && elem.disabled === false && (
// Support: IE6-11+
// Ancestry is covered for us
elem.isDisabled === disabled ||
// Otherwise, assume any non-<option> under fieldset[disabled] is disabled
/* jshint -W018 */
elem.isDisabled !== !disabled &&
("label" in elem || !disabledAncestor( elem )) !== disabled
);
};
}
/**
* Returns a function to use in pseudos for positionals
* @param {Function} fn
*/
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ (j = matchIndexes[i]) ] ) {
seed[j] = !(matches[j] = seed[j]);
}
}
});
});
}
/**
* Checks a node for validity as a Sizzle context
* @param {Element|Object=} context
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
function testContext( context ) {
return context && typeof context.getElementsByTagName !== "undefined" && context;
}
// Expose support vars for convenience
support = Sizzle.support = {};
/**
* Detects XML nodes
* @param {Element|Object} elem An element or a document
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
/**
* Sets document-related variables once based on the current document
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
// Update global variables
document = doc;
docElem = document.documentElement;
documentIsHTML = !isXML( document );
// Support: IE 9-11, Edge
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
if ( preferredDoc !== document &&
(subWindow = document.defaultView) && subWindow.top !== subWindow ) {
// Support: IE 11, Edge
if ( subWindow.addEventListener ) {
subWindow.addEventListener( "unload", unloadHandler, false );
// Support: IE 9 - 10 only
} else if ( subWindow.attachEvent ) {
subWindow.attachEvent( "onunload", unloadHandler );
}
}
/* Attributes
---------------------------------------------------------------------- */
// Support: IE<8
// Verify that getAttribute really returns attributes and not properties
// (excepting IE8 booleans)
support.attributes = assert(function( el ) {
el.className = "i";
return !el.getAttribute("className");
});
/* getElement(s)By*
---------------------------------------------------------------------- */
// Check if getElementsByTagName("*") returns only elements
support.getElementsByTagName = assert(function( el ) {
el.appendChild( document.createComment("") );
return !el.getElementsByTagName("*").length;
});
// Support: IE<9
support.getElementsByClassName = rnative.test( document.getElementsByClassName );
// Support: IE<10
// Check if getElementById returns elements by name
// The broken getElementById methods don't pick up programmatically-set names,
// so use a roundabout getElementsByName test
support.getById = assert(function( el ) {
docElem.appendChild( el ).id = expando;
return !document.getElementsByName || !document.getElementsByName( expando ).length;
});
// ID find and filter
if ( support.getById ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var m = context.getElementById( id );
return m ? [ m ] : [];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
};
} else {
// Support: IE6/7
// getElementById is not reliable as a find shortcut
delete Expr.find["ID"];
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== "undefined" &&
elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
}
// Tag
Expr.find["TAG"] = support.getElementsByTagName ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( tag );
// DocumentFragment nodes don't have gEBTN
} else if ( support.qsa ) {
return context.querySelectorAll( tag );
}
} :
function( tag, context ) {
var elem,
tmp = [],
i = 0,
// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
while ( (elem = results[i++]) ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Class
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
return context.getElementsByClassName( className );
}
};
/* QSA/matchesSelector
---------------------------------------------------------------------- */
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21)
// We allow this because of a bug in IE8/9 that throws an error
// whenever `document.activeElement` is accessed on an iframe
// So, we allow :focus to pass through QSA all the time to avoid the IE error
// See https://bugs.jquery.com/ticket/13378
rbuggyQSA = [];
if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert(function( el ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explicitly
// setting a boolean content attribute,
// since its presence should be enough
// https://bugs.jquery.com/ticket/12359
docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
"<select id='" + expando + "-\r\\' msallowcapture=''>" +
"<option selected=''></option></select>";
// Support: IE8, Opera 11-12.16
// Nothing should be selected when empty strings follow ^= or $= or *=
// The test attribute must be unknown in Opera but "safe" for WinRT
// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
if ( el.querySelectorAll("[msallowcapture^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
}
// Support: IE8
// Boolean attributes and "value" are not treated correctly
if ( !el.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
}
// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
rbuggyQSA.push("~=");
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !el.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
// Support: Safari 8+, iOS 8+
// https://bugs.webkit.org/show_bug.cgi?id=136851
// In-page `selector#id sibling-combinator selector` fails
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
rbuggyQSA.push(".#.+[+~]");
}
});
assert(function( el ) {
el.innerHTML = "<a href='' disabled='disabled'></a>" +
"<select disabled='disabled'><option/></select>";
// Support: Windows 8 Native Apps
// The type and name attributes are restricted during .innerHTML assignment
var input = document.createElement("input");
input.setAttribute( "type", "hidden" );
el.appendChild( input ).setAttribute( "name", "D" );
// Support: IE8
// Enforce case-sensitivity of name attribute
if ( el.querySelectorAll("[name=d]").length ) {
rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( el.querySelectorAll(":enabled").length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Support: IE9-11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
docElem.appendChild( el ).disabled = true;
if ( el.querySelectorAll(":disabled").length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Opera 10-11 does not throw on post-comma invalid pseudos
el.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
});
}
if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
docElem.webkitMatchesSelector ||
docElem.mozMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) {
assert(function( el ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( el, "*" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( el, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
}
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
/* Contains
---------------------------------------------------------------------- */
hasCompare = rnative.test( docElem.compareDocumentPosition );
// Element contains another
// Purposefully self-exclusive
// As in, an element does not contain itself
contains = hasCompare || rnative.test( docElem.contains ) ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
adown.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
));
} :
function( a, b ) {
if ( b ) {
while ( (b = b.parentNode) ) {
if ( b === a ) {
return true;
}
}
}
return false;
};
/* Sorting
---------------------------------------------------------------------- */
// Document order sorting
sortOrder = hasCompare ?
function( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
hasDuplicate = true;
return 0;
}
// Sort on method existence if only one input has compareDocumentPosition
var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
if ( compare ) {
return compare;
}
// Calculate position if both inputs belong to the same document
compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
a.compareDocumentPosition( b ) :
// Otherwise we know they are disconnected
1;
// Disconnected nodes
if ( compare & 1 ||
(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
// Choose the first element that is related to our preferred document
if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
return -1;
}
if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
return 1;
}
// Maintain original order
return sortInput ?
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
}
return compare & 4 ? -1 : 1;
} :
function( a, b ) {
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
}
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Parentless nodes are either documents or disconnected
if ( !aup || !bup ) {
return a === document ? -1 :
b === document ? 1 :
aup ? -1 :
bup ? 1 :
sortInput ?
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
// If the nodes are siblings, we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
}
// Otherwise we need full lists of their ancestors for comparison
cur = a;
while ( (cur = cur.parentNode) ) {
ap.unshift( cur );
}
cur = b;
while ( (cur = cur.parentNode) ) {
bp.unshift( cur );
}
// Walk down the tree looking for a discrepancy
while ( ap[i] === bp[i] ) {
i++;
}
return i ?
// Do a sibling check if the nodes have a common ancestor
siblingCheck( ap[i], bp[i] ) :
// Otherwise nodes in our document sort first
ap[i] === preferredDoc ? -1 :
bp[i] === preferredDoc ? 1 :
0;
};
return document;
};
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
if ( support.matchesSelector && documentIsHTML &&
!compilerCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch (e) {}
}
return Sizzle( expr, document, null, [ elem ] ).length > 0;
};
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
if ( ( context.ownerDocument || context ) !== document ) {
setDocument( context );
}
return contains( context, elem );
};
Sizzle.attr = function( elem, name ) {
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
var fn = Expr.attrHandle[ name.toLowerCase() ],
// Don't get fooled by Object.prototype properties (jQuery #13807)
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
fn( elem, name, !documentIsHTML ) :
undefined;
return val !== undefined ?
val :
support.attributes || !documentIsHTML ?
elem.getAttribute( name ) :
(val = elem.getAttributeNode(name)) && val.specified ?
val.value :
null;
};
Sizzle.escape = function( sel ) {
return (sel + "").replace( rcssescape, fcssescape );
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
/**
* Document sorting and removing duplicates
* @param {ArrayLike} results
*/
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
j = 0,
i = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
sortInput = !support.sortStable && results.slice( 0 );
results.sort( sortOrder );
if ( hasDuplicate ) {
while ( (elem = results[i++]) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
// Clear input after sorting to release objects
// See https://github.com/jquery/sizzle/pull/225
sortInput = null;
return results;
};
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
while ( (node = elem[i++]) ) {
// Do not traverse comment nodes
ret += getText( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (jQuery #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
attrHandle: {},
find: {},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 what (child|of-type)
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4 xn-component of xn+y argument ([+-]?\d*n|)
5 sign of xn-component
6 x of xn-component
7 sign of y-component
8 y of y-component
*/
match[1] = match[1].toLowerCase();
if ( match[1].slice( 0, 3 ) === "nth" ) {
// nth-* requires argument
if ( !match[3] ) {
Sizzle.error( match[0] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
// other types prohibit arguments
} else if ( match[3] ) {
Sizzle.error( match[0] );
}
return match;
},
"PSEUDO": function( match ) {
var excess,
unquoted = !match[6] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[3] ) {
match[2] = match[4] || match[5] || "";
// Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) &&
// Get excess from tokenize (recursively)
(excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
// excess is a negative index
match[0] = match[0].slice( 0, excess );
match[2] = unquoted.slice( 0, excess );
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"TAG": function( nodeNameSelector ) {
var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
return nodeNameSelector === "*" ?
function() { return true; } :
function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
classCache( className, function( elem ) {
return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
});
},
"ATTR": function( name, operator, check ) {
return function( elem ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
};
},
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
return first === 1 && last === 0 ?
// Shortcut for :nth-*(n)
function( elem ) {
return !!elem.parentNode;
} :
function( elem, context, xml ) {
var cache, uniqueCache, outerCache, node, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
useCache = !xml && !ofType,
diff = false;
if ( parent ) {
// :(first|last|only)-(child|of-type)
if ( simple ) {
while ( dir ) {
node = elem;
while ( (node = node[ dir ]) ) {
if ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) {
return false;
}
}
// Reverse direction for :only-* (if we haven't yet done so)
start = dir = type === "only" && !start && "nextSibling";
}
return true;
}
start = [ forward ? parent.firstChild : parent.lastChild ];
// non-xml :nth-child(...) stores cache data on `parent`
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
// ...in a gzip-friendly way
node = parent;
outerCache = node[ expando ] || (node[ expando ] = {});
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
(outerCache[ node.uniqueID ] = {});
cache = uniqueCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex && cache[ 2 ];
node = nodeIndex && parent.childNodes[ nodeIndex ];
while ( (node = ++nodeIndex && node && node[ dir ] ||
// Fallback to seeking `elem` from the start
(diff = nodeIndex = 0) || start.pop()) ) {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
} else {
// Use previously-cached element index if available
if ( useCache ) {
// ...in a gzip-friendly way
node = elem;
outerCache = node[ expando ] || (node[ expando ] = {});
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
(outerCache[ node.uniqueID ] = {});
cache = uniqueCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex;
}
// xml :nth-child(...)
// or :nth-last-child(...) or :nth(-last)?-of-type(...)
if ( diff === false ) {
// Use the same loop as above to seek `elem` from the start
while ( (node = ++nodeIndex && node && node[ dir ] ||
(diff = nodeIndex = 0) || start.pop()) ) {
if ( ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) &&
++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
outerCache = node[ expando ] || (node[ expando ] = {});
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
(outerCache[ node.uniqueID ] = {});
uniqueCache[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
break;
}
}
}
}
}
// Incorporate the offset, then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction(function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
// Potentially complex pseudos
"not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction(function( seed, matches, context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( (elem = unmatched[i]) ) {
seed[i] = !(matches[i] = elem);
}
}
}) :
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
// Don't keep the element (issue #299)
input[0] = null;
return !results.pop();
};
}),
"has": markFunction(function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
}),
"contains": markFunction(function( text ) {
text = text.replace( runescape, funescape );
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
// "Whether an element is represented by a :lang() selector
// is based solely on the element's language value
// being equal to the identifier C,
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo
"lang": markFunction( function( lang ) {
// lang value must be a valid identifier
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsHTML ?
elem.lang :
elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
elemLang = elemLang.toLowerCase();
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
}
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
return false;
};
}),
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
"root": function( elem ) {
return elem === docElem;
},
"focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},
// Boolean properties
"enabled": createDisabledPseudo( false ),
"disabled": createDisabledPseudo( true ),
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
// Contents
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
// but not by others (comment: 8; processing instruction: 7; etc.)
// nodeType < 6 works because attributes (2) do not appear as children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeType < 6 ) {
return false;
}
}
return true;
},
"parent": function( elem ) {
return !Expr.pseudos["empty"]( elem );
},
// Element/input types
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"text": function( elem ) {
var attr;
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
// Support: IE<8
// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
},
// Position-in-collection
"first": createPositionalPseudo(function() {
return [ 0 ];
}),
"last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ];
}),
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
}),
"even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
})
}
};
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
}
// Easy API for creating new setFilters
function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( (tokens = []) );
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
matched = match.shift();
tokens.push({
value: matched,
// Cast descendant combinators to space
type: match[0].replace( rtrim, " " )
});
soFar = soFar.slice( matched.length );
}
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
(match = preFilters[ type ]( match ))) ) {
matched = match.shift();
tokens.push({
value: matched,
type: type,
matches: match
});
soFar = soFar.slice( matched.length );
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
};
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[i].value;
}
return selector;
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
skip = combinator.next,
key = skip || dir,
checkNonElements = base && key === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
}
}
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var oldCache, uniqueCache, outerCache,
newCache = [ dirruns, doneName ];
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
if ( xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
return true;
}
}
}
} else {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || (elem[ expando ] = {});
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
if ( skip && skip === elem.nodeName.toLowerCase() ) {
elem = elem[ dir ] || elem;
} else if ( (oldCache = uniqueCache[ key ]) &&
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
// Assign to newCache so results back-propagate to previous elements
return (newCache[ 2 ] = oldCache[ 2 ]);
} else {
// Reuse newcache so results back-propagate to previous elements
uniqueCache[ key ] = newCache;
// A match means we're done; a fail means we have to keep checking
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
return true;
}
}
}
}
}
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
}
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = temp.length;
while ( i-- ) {
if ( (elem = temp[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
if ( seed ) {
if ( postFinder || preFilter ) {
if ( postFinder ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
temp = [];
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
}
postFinder( null, (matcherOut = []), temp, xml );
}
// Move matched elements from seed to results to keep them synchronized
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) &&
(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
seed[temp] = !(results[temp] = elem);
}
}
}
// Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
});
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
// Avoid hanging onto element (issue #299)
checkContext = null;
return ret;
} ];
for ( ; i < len; i++ ) {
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
} else {
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector(
// If the preceding token was a descendant combinator, insert an implicit any-element `*`
tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
).replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
j < len && toSelector( tokens )
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
setMatched = [],
contextBackup = outermostContext,
// We must always have either seed elements or outermost context
elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
len = elems.length;
if ( outermost ) {
outermostContext = context === document || context || outermost;
}
// Add elements passing elementMatchers directly to results
// Support: IE<9, Safari
// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
j = 0;
if ( !context && elem.ownerDocument !== document ) {
setDocument( elem );
xml = !documentIsHTML;
}
while ( (matcher = elementMatchers[j++]) ) {
if ( matcher( elem, context || document, xml) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
}
}
// Track unmatched elements for set filters
if ( bySet ) {
// They will have gone through all possible matchers
if ( (elem = !matcher && elem) ) {
matchedCount--;
}
// Lengthen the array for every element, matched or not
if ( seed ) {
unmatched.push( elem );
}
}
}
// `i` is now the count of elements visited above, and adding it to `matchedCount`
// makes the latter nonnegative.
matchedCount += i;
// Apply set filters to unmatched elements
// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
// no element matchers and no seed.
// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
// case, which will result in a "00" `matchedCount` that differs from `i` but is also
// numerically zero.
if ( bySet && i !== matchedCount ) {
j = 0;
while ( (matcher = setMatchers[j++]) ) {
matcher( unmatched, setMatched, context, xml );
}
if ( seed ) {
// Reintegrate element matches to eliminate the need for sorting
if ( matchedCount > 0 ) {
while ( i-- ) {
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
}
}
// Discard index placeholder values to get only actual matches
setMatched = condense( setMatched );
}
// Add matches to results
push.apply( results, setMatched );
// Seedless set matches succeeding multiple successful matchers stipulate sorting
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
Sizzle.uniqueSort( results );
}
}
// Override manipulation of globals by nested matchers
if ( outermost ) {
dirruns = dirrunsUnique;
outermostContext = contextBackup;
}
return unmatched;
};
return bySet ?
markFunction( superMatcher ) :
superMatcher;
}
compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
cached = compilerCache[ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
if ( !match ) {
match = tokenize( selector );
}
i = match.length;
while ( i-- ) {
cached = matcherFromTokens( match[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
// Save selector and tokenization
cached.selector = selector;
}
return cached;
};
/**
* A low-level selection function that works with Sizzle's compiled
* selector functions
* @param {String|Function} selector A selector or a pre-compiled
* selector function built with Sizzle.compile
* @param {Element} context
* @param {Array} [results]
* @param {Array} [seed] A set of elements to match against
*/
select = Sizzle.select = function( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( (selector = compiled.selector || selector) );
results = results || [];
// Try to minimize operations if there is only one selector in the list and no seed
// (the latter of which guarantees us context)
if ( match.length === 1 ) {
// Reduce context if the leading compound selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
if ( !context ) {
return results;
// Precompiled matchers will still verify ancestry, so step up a level
} else if ( compiled ) {
context = context.parentNode;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && toSelector( tokens );
if ( !selector ) {
push.apply( results, seed );
return results;
}
break;
}
}
}
}
// Compile and execute a filtering function if one is not provided
// Provide `match` to avoid retokenization if we modified the selector above
( compiled || compile( selector, match ) )(
seed,
context,
!documentIsHTML,
results,
!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
);
return results;
};
// One-time assignments
// Sort stability
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
// Support: Chrome 14-35+
// Always assume duplicates if they aren't passed to the comparison function
support.detectDuplicates = !!hasDuplicate;
// Initialize against the default document
setDocument();
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
// Detached nodes confoundingly follow *each other*
support.sortDetached = assert(function( el ) {
// Should return 1, but returns 4 (following)
return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
});
// Support: IE<8
// Prevent attribute/property "interpolation"
// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !assert(function( el ) {
el.innerHTML = "<a href='#'></a>";
return el.firstChild.getAttribute("href") === "#" ;
}) ) {
addHandle( "type|href|height|width", function( elem, name, isXML ) {
if ( !isXML ) {
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
}
});
}
// Support: IE<9
// Use defaultValue in place of getAttribute("value")
if ( !support.attributes || !assert(function( el ) {
el.innerHTML = "<input/>";
el.firstChild.setAttribute( "value", "" );
return el.firstChild.getAttribute( "value" ) === "";
}) ) {
addHandle( "value", function( elem, name, isXML ) {
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
return elem.defaultValue;
}
});
}
// Support: IE<9
// Use getAttributeNode to fetch booleans when getAttribute lies
if ( !assert(function( el ) {
return el.getAttribute("disabled") == null;
}) ) {
addHandle( booleans, function( elem, name, isXML ) {
var val;
if ( !isXML ) {
return elem[ name ] === true ? name.toLowerCase() :
(val = elem.getAttributeNode( name )) && val.specified ?
val.value :
null;
}
});
}
return Sizzle;
})( window );
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
// Deprecated
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
jQuery.escapeSelector = Sizzle.escape;
var dir = function( elem, dir, until ) {
var matched = [],
truncate = until !== undefined;
while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
if ( elem.nodeType === 1 ) {
if ( truncate && jQuery( elem ).is( until ) ) {
break;
}
matched.push( elem );
}
}
return matched;
};
var siblings = function( n, elem ) {
var matched = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
matched.push( n );
}
}
return matched;
};
var rneedsContext = jQuery.expr.match.needsContext;
var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
var risSimple = /^.[^:#\[\.,]*$/;
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, not ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep( elements, function( elem, i ) {
/* jshint -W018 */
return !!qualifier.call( elem, i, elem ) !== not;
} );
}
if ( qualifier.nodeType ) {
return jQuery.grep( elements, function( elem ) {
return ( elem === qualifier ) !== not;
} );
}
if ( typeof qualifier === "string" ) {
if ( risSimple.test( qualifier ) ) {
return jQuery.filter( qualifier, elements, not );
}
qualifier = jQuery.filter( qualifier, elements );
}
return jQuery.grep( elements, function( elem ) {
return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
} );
}
jQuery.filter = function( expr, elems, not ) {
var elem = elems[ 0 ];
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 && elem.nodeType === 1 ?
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
return elem.nodeType === 1;
} ) );
};
jQuery.fn.extend( {
find: function( selector ) {
var i, ret,
len = this.length,
self = this;
if ( typeof selector !== "string" ) {
return this.pushStack( jQuery( selector ).filter( function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
} ) );
}
ret = this.pushStack( [] );
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, self[ i ], ret );
}
return len > 1 ? jQuery.uniqueSort( ret ) : ret;
},
filter: function( selector ) {
return this.pushStack( winnow( this, selector || [], false ) );
},
not: function( selector ) {
return this.pushStack( winnow( this, selector || [], true ) );
},
is: function( selector ) {
return !!winnow(
this,
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
typeof selector === "string" && rneedsContext.test( selector ) ?
jQuery( selector ) :
selector || [],
false
).length;
}
} );
// Initialize a jQuery object
// A central reference to the root jQuery(document)
var rootjQuery,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
// Shortcut simple #id case for speed
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
init = jQuery.fn.init = function( selector, context, root ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Method init() accepts an alternate rootjQuery
// so migrate can support jQuery.sub (gh-2101)
root = root || rootjQuery;
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector[ 0 ] === "<" &&
selector[ selector.length - 1 ] === ">" &&
selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && ( match[ 1 ] || !context ) ) {
// HANDLE: $(html) -> $(array)
if ( match[ 1 ] ) {
context = context instanceof jQuery ? context[ 0 ] : context;
// Option to run scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present
jQuery.merge( this, jQuery.parseHTML(
match[ 1 ],
context && context.nodeType ? context.ownerDocument || context : document,
true
) );
// HANDLE: $(html, props)
if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
} else {
this.attr( match, context[ match ] );
}
}
}
return this;
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[ 2 ] );
if ( elem ) {
// Inject the element directly into the jQuery object
this[ 0 ] = elem;
this.length = 1;
}
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || root ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this[ 0 ] = selector;
this.length = 1;
return this;
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return root.ready !== undefined ?
root.ready( selector ) :
// Execute immediately if ready is not present
selector( jQuery );
}
return jQuery.makeArray( selector, this );
};
// Give the init function the jQuery prototype for later instantiation
init.prototype = jQuery.fn;
// Initialize central reference
rootjQuery = jQuery( document );
var rparentsprev = /^(?:parents|prev(?:Until|All))/,
// Methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend( {
has: function( target ) {
var targets = jQuery( target, this ),
l = targets.length;
return this.filter( function() {
var i = 0;
for ( ; i < l; i++ ) {
if ( jQuery.contains( this, targets[ i ] ) ) {
return true;
}
}
} );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
matched = [],
targets = typeof selectors !== "string" && jQuery( selectors );
// Positional selectors never match, since there's no _selection_ context
if ( !rneedsContext.test( selectors ) ) {
for ( ; i < l; i++ ) {
for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
// Always skip document fragments
if ( cur.nodeType < 11 && ( targets ?
targets.index( cur ) > -1 :
// Don't pass non-elements to Sizzle
cur.nodeType === 1 &&
jQuery.find.matchesSelector( cur, selectors ) ) ) {
matched.push( cur );
break;
}
}
}
}
return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
},
// Determine the position of an element within the set
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
}
// Index in selector
if ( typeof elem === "string" ) {
return indexOf.call( jQuery( elem ), this[ 0 ] );
}
// Locate the position of the desired element
return indexOf.call( this,
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[ 0 ] : elem
);
},
add: function( selector, context ) {
return this.pushStack(
jQuery.uniqueSort(
jQuery.merge( this.get(), jQuery( selector, context ) )
)
);
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter( selector )
);
}
} );
function sibling( cur, dir ) {
while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
return cur;
}
jQuery.each( {
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return siblings( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return siblings( elem.firstChild );
},
contents: function( elem ) {
return elem.contentDocument || jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var matched = jQuery.map( this, fn, until );
if ( name.slice( -5 ) !== "Until" ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
matched = jQuery.filter( selector, matched );
}
if ( this.length > 1 ) {
// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
jQuery.uniqueSort( matched );
}
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
matched.reverse();
}
}
return this.pushStack( matched );
};
} );
var rnotwhite = ( /\S+/g );
// Convert String-formatted options into Object-formatted ones
function createOptions( options ) {
var object = {};
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
} );
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
createOptions( options ) :
jQuery.extend( {}, options );
var // Flag to know if list is currently firing
firing,
// Last fire value for non-forgettable lists
memory,
// Flag to know if list was already fired
fired,
// Flag to prevent firing
locked,
// Actual callback list
list = [],
// Queue of execution data for repeatable lists
queue = [],
// Index of currently firing callback (modified by add/remove as needed)
firingIndex = -1,
// Fire callbacks
fire = function() {
// Enforce single-firing
locked = options.once;
// Execute callbacks for all pending executions,
// respecting firingIndex overrides and runtime changes
fired = firing = true;
for ( ; queue.length; firingIndex = -1 ) {
memory = queue.shift();
while ( ++firingIndex < list.length ) {
// Run callback and check for early termination
if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
options.stopOnFalse ) {
// Jump to end and forget the data so .add doesn't re-fire
firingIndex = list.length;
memory = false;
}
}
}
// Forget the data if we're done with it
if ( !options.memory ) {
memory = false;
}
firing = false;
// Clean up if we're done firing for good
if ( locked ) {
// Keep an empty list if we have data for future add calls
if ( memory ) {
list = [];
// Otherwise, this object is spent
} else {
list = "";
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// If we have memory from a past run, we should fire after adding
if ( memory && !firing ) {
firingIndex = list.length - 1;
queue.push( memory );
}
( function add( args ) {
jQuery.each( args, function( _, arg ) {
if ( jQuery.isFunction( arg ) ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
// Inspect recursively
add( arg );
}
} );
} )( arguments );
if ( memory && !firing ) {
fire();
}
}
return this;
},
// Remove a callback from the list
remove: function() {
jQuery.each( arguments, function( _, arg ) {
var index;
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( index <= firingIndex ) {
firingIndex--;
}
}
} );
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ?
jQuery.inArray( fn, list ) > -1 :
list.length > 0;
},
// Remove all callbacks from the list
empty: function() {
if ( list ) {
list = [];
}
return this;
},
// Disable .fire and .add
// Abort any current/pending executions
// Clear all callbacks and values
disable: function() {
locked = queue = [];
list = memory = "";
return this;
},
disabled: function() {
return !list;
},
// Disable .fire
// Also disable .add unless we have memory (since it would have no effect)
// Abort any pending executions
lock: function() {
locked = queue = [];
if ( !memory && !firing ) {
list = memory = "";
}
return this;
},
locked: function() {
return !!locked;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
if ( !locked ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
queue.push( args );
if ( !firing ) {
fire();
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
function Identity( v ) {
return v;
}
function Thrower( ex ) {
throw ex;
}
function adoptValue( value, resolve, reject ) {
var method;
try {
// Check for promise aspect first to privilege synchronous behavior
if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
method.call( value ).done( resolve ).fail( reject );
// Other thenables
} else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
method.call( value, resolve, reject );
// Other non-thenables
} else {
// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
resolve.call( undefined, value );
}
// For Promises/A+, convert exceptions into rejections
// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
// Deferred#then to conditionally suppress rejection.
} catch ( /*jshint -W002 */ value ) {
// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
reject.call( undefined, value );
}
}
jQuery.extend( {
Deferred: function( func ) {
var tuples = [
// action, add listener, callbacks,
// ... .then handlers, argument index, [final state]
[ "notify", "progress", jQuery.Callbacks( "memory" ),
jQuery.Callbacks( "memory" ), 2 ],
[ "resolve", "done", jQuery.Callbacks( "once memory" ),
jQuery.Callbacks( "once memory" ), 0, "resolved" ],
[ "reject", "fail", jQuery.Callbacks( "once memory" ),
jQuery.Callbacks( "once memory" ), 1, "rejected" ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
"catch": function( fn ) {
return promise.then( null, fn );
},
// Keep pipe for back-compat
pipe: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred( function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
// Map tuples (progress, done, fail) to arguments (done, fail, progress)
var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
// deferred.progress(function() { bind to newDefer or newDefer.notify })
// deferred.done(function() { bind to newDefer or newDefer.resolve })
// deferred.fail(function() { bind to newDefer or newDefer.reject })
deferred[ tuple[ 1 ] ]( function() {
var returned = fn && fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.progress( newDefer.notify )
.done( newDefer.resolve )
.fail( newDefer.reject );
} else {
newDefer[ tuple[ 0 ] + "With" ](
this,
fn ? [ returned ] : arguments
);
}
} );
} );
fns = null;
} ).promise();
},
then: function( onFulfilled, onRejected, onProgress ) {
var maxDepth = 0;
function resolve( depth, deferred, handler, special ) {
return function() {
var that = this,
args = arguments,
mightThrow = function() {
var returned, then;
// Support: Promises/A+ section 2.3.3.3.3
// https://promisesaplus.com/#point-59
// Ignore double-resolution attempts
if ( depth < maxDepth ) {
return;
}
returned = handler.apply( that, args );
// Support: Promises/A+ section 2.3.1
// https://promisesaplus.com/#point-48
if ( returned === deferred.promise() ) {
throw new TypeError( "Thenable self-resolution" );
}
// Support: Promises/A+ sections 2.3.3.1, 3.5
// https://promisesaplus.com/#point-54
// https://promisesaplus.com/#point-75
// Retrieve `then` only once
then = returned &&
// Support: Promises/A+ section 2.3.4
// https://promisesaplus.com/#point-64
// Only check objects and functions for thenability
( typeof returned === "object" ||
typeof returned === "function" ) &&
returned.then;
// Handle a returned thenable
if ( jQuery.isFunction( then ) ) {
// Special processors (notify) just wait for resolution
if ( special ) {
then.call(
returned,
resolve( maxDepth, deferred, Identity, special ),
resolve( maxDepth, deferred, Thrower, special )
);
// Normal processors (resolve) also hook into progress
} else {
// ...and disregard older resolution values
maxDepth++;
then.call(
returned,
resolve( maxDepth, deferred, Identity, special ),
resolve( maxDepth, deferred, Thrower, special ),
resolve( maxDepth, deferred, Identity,
deferred.notifyWith )
);
}
// Handle all other returned values
} else {
// Only substitute handlers pass on context
// and multiple values (non-spec behavior)
if ( handler !== Identity ) {
that = undefined;
args = [ returned ];
}
// Process the value(s)
// Default process is resolve
( special || deferred.resolveWith )( that, args );
}
},
// Only normal processors (resolve) catch and reject exceptions
process = special ?
mightThrow :
function() {
try {
mightThrow();
} catch ( e ) {
if ( jQuery.Deferred.exceptionHook ) {
jQuery.Deferred.exceptionHook( e,
process.stackTrace );
}
// Support: Promises/A+ section 2.3.3.3.4.1
// https://promisesaplus.com/#point-61
// Ignore post-resolution exceptions
if ( depth + 1 >= maxDepth ) {
// Only substitute handlers pass on context
// and multiple values (non-spec behavior)
if ( handler !== Thrower ) {
that = undefined;
args = [ e ];
}
deferred.rejectWith( that, args );
}
}
};
// Support: Promises/A+ section 2.3.3.3.1
// https://promisesaplus.com/#point-57
// Re-resolve promises immediately to dodge false rejection from
// subsequent errors
if ( depth ) {
process();
} else {
// Call an optional hook to record the stack, in case of exception
// since it's otherwise lost when execution goes async
if ( jQuery.Deferred.getStackHook ) {
process.stackTrace = jQuery.Deferred.getStackHook();
}
window.setTimeout( process );
}
};
}
return jQuery.Deferred( function( newDefer ) {
// progress_handlers.add( ... )
tuples[ 0 ][ 3 ].add(
resolve(
0,
newDefer,
jQuery.isFunction( onProgress ) ?
onProgress :
Identity,
newDefer.notifyWith
)
);
// fulfilled_handlers.add( ... )
tuples[ 1 ][ 3 ].add(
resolve(
0,
newDefer,
jQuery.isFunction( onFulfilled ) ?
onFulfilled :
Identity
)
);
// rejected_handlers.add( ... )
tuples[ 2 ][ 3 ].add(
resolve(
0,
newDefer,
jQuery.isFunction( onRejected ) ?
onRejected :
Thrower
)
);
} ).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 5 ];
// promise.progress = list.add
// promise.done = list.add
// promise.fail = list.add
promise[ tuple[ 1 ] ] = list.add;
// Handle state
if ( stateString ) {
list.add(
function() {
// state = "resolved" (i.e., fulfilled)
// state = "rejected"
state = stateString;
},
// rejected_callbacks.disable
// fulfilled_callbacks.disable
tuples[ 3 - i ][ 2 ].disable,
// progress_callbacks.lock
tuples[ 0 ][ 2 ].lock
);
}
// progress_handlers.fire
// fulfilled_handlers.fire
// rejected_handlers.fire
list.add( tuple[ 3 ].fire );
// deferred.notify = function() { deferred.notifyWith(...) }
// deferred.resolve = function() { deferred.resolveWith(...) }
// deferred.reject = function() { deferred.rejectWith(...) }
deferred[ tuple[ 0 ] ] = function() {
deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
return this;
};
// deferred.notifyWith = list.fireWith
// deferred.resolveWith = list.fireWith
// deferred.rejectWith = list.fireWith
deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
} );
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( singleValue ) {
var
// count of uncompleted subordinates
remaining = arguments.length,
// count of unprocessed arguments
i = remaining,
// subordinate fulfillment data
resolveContexts = Array( i ),
resolveValues = slice.call( arguments ),
// the master Deferred
master = jQuery.Deferred(),
// subordinate callback factory
updateFunc = function( i ) {
return function( value ) {
resolveContexts[ i ] = this;
resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
if ( !( --remaining ) ) {
master.resolveWith( resolveContexts, resolveValues );
}
};
};
// Single- and empty arguments are adopted like Promise.resolve
if ( remaining <= 1 ) {
adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
// Use .then() to unwrap secondary thenables (cf. gh-3000)
if ( master.state() === "pending" ||
jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
return master.then();
}
}
// Multiple arguments are aggregated like Promise.all array elements
while ( i-- ) {
adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
}
return master.promise();
}
} );
// These usually indicate a programmer mistake during development,
// warn about them ASAP rather than swallowing them by default.
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
jQuery.Deferred.exceptionHook = function( error, stack ) {
// Support: IE 8 - 9 only
// Console exists when dev tools are open, which can happen at any time
if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
}
};
// The deferred used on DOM ready
var readyList = jQuery.Deferred();
jQuery.fn.ready = function( fn ) {
readyList.then( fn );
return this;
};
jQuery.extend( {
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
}
} );
jQuery.ready.then = readyList.then;
// The ready event handler and self cleanup method
function completed() {
document.removeEventListener( "DOMContentLoaded", completed );
window.removeEventListener( "load", completed );
jQuery.ready();
}
// Catch cases where $(document).ready() is called
// after the browser event has already occurred.
// Support: IE <=9 - 10 only
// Older IE sometimes signals "interactive" too soon
if ( document.readyState === "complete" ||
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
window.setTimeout( jQuery.ready );
} else {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed );
}
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
len = elems.length,
bulk = key == null;
// Sets many values
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
access( elems, fn, i, key[ i ], true, emptyGet, raw );
}
// Sets one value
} else if ( value !== undefined ) {
chainable = true;
if ( !jQuery.isFunction( value ) ) {
raw = true;
}
if ( bulk ) {
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
fn = null;
// ...except when executing function values
} else {
bulk = fn;
fn = function( elem, key, value ) {
return bulk.call( jQuery( elem ), value );
};
}
}
if ( fn ) {
for ( ; i < len; i++ ) {
fn(
elems[ i ], key, raw ?
value :
value.call( elems[ i ], i, fn( elems[ i ], key ) )
);
}
}
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
len ? fn( elems[ 0 ], key ) : emptyGet;
};
var acceptData = function( owner ) {
// Accepts only:
// - Node
// - Node.ELEMENT_NODE
// - Node.DOCUMENT_NODE
// - Object
// - Any
/* jshint -W018 */
return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
};
function Data() {
this.expando = jQuery.expando + Data.uid++;
}
Data.uid = 1;
Data.prototype = {
cache: function( owner ) {
// Check if the owner object already has a cache
var value = owner[ this.expando ];
// If not, create one
if ( !value ) {
value = {};
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return an empty object.
if ( acceptData( owner ) ) {
// If it is a node unlikely to be stringify-ed or looped over
// use plain assignment
if ( owner.nodeType ) {
owner[ this.expando ] = value;
// Otherwise secure it in a non-enumerable property
// configurable must be true to allow the property to be
// deleted when data is removed
} else {
Object.defineProperty( owner, this.expando, {
value: value,
configurable: true
} );
}
}
}
return value;
},
set: function( owner, data, value ) {
var prop,
cache = this.cache( owner );
// Handle: [ owner, key, value ] args
// Always use camelCase key (gh-2257)
if ( typeof data === "string" ) {
cache[ jQuery.camelCase( data ) ] = value;
// Handle: [ owner, { properties } ] args
} else {
// Copy the properties one-by-one to the cache object
for ( prop in data ) {
cache[ jQuery.camelCase( prop ) ] = data[ prop ];
}
}
return cache;
},
get: function( owner, key ) {
return key === undefined ?
this.cache( owner ) :
// Always use camelCase key (gh-2257)
owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
},
access: function( owner, key, value ) {
// In cases where either:
//
// 1. No key was specified
// 2. A string key was specified, but no value provided
//
// Take the "read" path and allow the get method to determine
// which value to return, respectively either:
//
// 1. The entire cache object
// 2. The data stored at the key
//
if ( key === undefined ||
( ( key && typeof key === "string" ) && value === undefined ) ) {
return this.get( owner, key );
}
// When the key is not a string, or both a key and value
// are specified, set or extend (existing objects) with either:
//
// 1. An object of properties
// 2. A key and value
//
this.set( owner, key, value );
// Since the "set" path can have two possible entry points
// return the expected data based on which path was taken[*]
return value !== undefined ? value : key;
},
remove: function( owner, key ) {
var i,
cache = owner[ this.expando ];
if ( cache === undefined ) {
return;
}
if ( key !== undefined ) {
// Support array or space separated string of keys
if ( jQuery.isArray( key ) ) {
// If key is an array of keys...
// We always set camelCase keys, so remove that.
key = key.map( jQuery.camelCase );
} else {
key = jQuery.camelCase( key );
// If a key with the spaces exists, use it.
// Otherwise, create an array by matching non-whitespace
key = key in cache ?
[ key ] :
( key.match( rnotwhite ) || [] );
}
i = key.length;
while ( i-- ) {
delete cache[ key[ i ] ];
}
}
// Remove the expando if there's no more data
if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
// Support: Chrome <=35 - 45
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
if ( owner.nodeType ) {
owner[ this.expando ] = undefined;
} else {
delete owner[ this.expando ];
}
}
},
hasData: function( owner ) {
var cache = owner[ this.expando ];
return cache !== undefined && !jQuery.isEmptyObject( cache );
}
};
var dataPriv = new Data();
var dataUser = new Data();
// Implementation Summary
//
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
// 2. Improve the module's maintainability by reducing the storage
// paths to a single mechanism.
// 3. Use the same single mechanism to support "private" and "user" data.
// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
// 5. Avoid exposing implementation details on user objects (eg. expando properties)
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
rmultiDash = /[A-Z]/g;
function dataAttr( elem, key, data ) {
var name;
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? JSON.parse( data ) :
data;
} catch ( e ) {}
// Make sure we set the data so it isn't changed later
dataUser.set( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
jQuery.extend( {
hasData: function( elem ) {
return dataUser.hasData( elem ) || dataPriv.hasData( elem );
},
data: function( elem, name, data ) {
return dataUser.access( elem, name, data );
},
removeData: function( elem, name ) {
dataUser.remove( elem, name );
},
// TODO: Now that all calls to _data and _removeData have been replaced
// with direct calls to dataPriv methods, these can be deprecated.
_data: function( elem, name, data ) {
return dataPriv.access( elem, name, data );
},
_removeData: function( elem, name ) {
dataPriv.remove( elem, name );
}
} );
jQuery.fn.extend( {
data: function( key, value ) {
var i, name, data,
elem = this[ 0 ],
attrs = elem && elem.attributes;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = dataUser.get( elem );
if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
i = attrs.length;
while ( i-- ) {
// Support: IE 11 only
// The attrs elements can be null (#14894)
if ( attrs[ i ] ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.slice( 5 ) );
dataAttr( elem, name, data[ name ] );
}
}
}
dataPriv.set( elem, "hasDataAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each( function() {
dataUser.set( this, key );
} );
}
return access( this, function( value ) {
var data;
// The calling jQuery object (element matches) is not empty
// (and therefore has an element appears at this[ 0 ]) and the
// `value` parameter was not undefined. An empty jQuery object
// will result in `undefined` for elem = this[ 0 ] which will
// throw an exception if an attempt to read a data cache is made.
if ( elem && value === undefined ) {
// Attempt to get data from the cache
// The key will always be camelCased in Data
data = dataUser.get( elem, key );
if ( data !== undefined ) {
return data;
}
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
data = dataAttr( elem, key );
if ( data !== undefined ) {
return data;
}
// We tried really hard, but the data doesn't exist.
return;
}
// Set the data...
this.each( function() {
// We always store the camelCased key
dataUser.set( this, key, value );
} );
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each( function() {
dataUser.remove( this, key );
} );
}
} );
jQuery.extend( {
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = dataPriv.get( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray( data ) ) {
queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// Clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// Not public - generate a queueHooks object, or return the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
empty: jQuery.Callbacks( "once memory" ).add( function() {
dataPriv.remove( elem, [ type + "queue", key ] );
} )
} );
}
} );
jQuery.fn.extend( {
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[ 0 ], type );
}
return data === undefined ?
this :
this.each( function() {
var queue = jQuery.queue( this, type, data );
// Ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
} );
},
dequeue: function( type ) {
return this.each( function() {
jQuery.dequeue( this, type );
} );
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while ( i-- ) {
tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
} );
var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
var isHiddenWithinTree = function( elem, el ) {
// isHiddenWithinTree might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
// Inline style trumps all
return elem.style.display === "none" ||
elem.style.display === "" &&
// Otherwise, check computed style
// Support: Firefox <=43 - 45
// Disconnected elements can have computed display: none, so first confirm that elem is
// in the document.
jQuery.contains( elem.ownerDocument, elem ) &&
jQuery.css( elem, "display" ) === "none";
};
var swap = function( elem, options, callback, args ) {
var ret, name,
old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
ret = callback.apply( elem, args || [] );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
};
function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted,
scale = 1,
maxIterations = 20,
currentValue = tween ?
function() { return tween.cur(); } :
function() { return jQuery.css( elem, prop, "" ); },
initial = currentValue(),
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
// Starting value computation is required for potential unit mismatches
initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
rcssNum.exec( jQuery.css( elem, prop ) );
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || initialInUnit[ 3 ];
// Make sure we update the tween properties later on
valueParts = valueParts || [];
// Iteratively approximate from a nonzero starting point
initialInUnit = +initial || 1;
do {
// If previous iteration zeroed out, double until we get *something*.
// Use string for doubling so we don't accidentally see scale as unchanged below
scale = scale || ".5";
// Adjust and apply
initialInUnit = initialInUnit / scale;
jQuery.style( elem, prop, initialInUnit + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// Break the loop if scale is unchanged or perfect, or if we've just had enough.
} while (
scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
);
}
if ( valueParts ) {
initialInUnit = +initialInUnit || +initial || 0;
// Apply relative offset (+=/-=) if specified
adjusted = valueParts[ 1 ] ?
initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
+valueParts[ 2 ];
if ( tween ) {
tween.unit = unit;
tween.start = initialInUnit;
tween.end = adjusted;
}
}
return adjusted;
}
var defaultDisplayMap = {};
function getDefaultDisplay( elem ) {
var temp,
doc = elem.ownerDocument,
nodeName = elem.nodeName,
display = defaultDisplayMap[ nodeName ];
if ( display ) {
return display;
}
temp = doc.body.appendChild( doc.createElement( nodeName ) ),
display = jQuery.css( temp, "display" );
temp.parentNode.removeChild( temp );
if ( display === "none" ) {
display = "block";
}
defaultDisplayMap[ nodeName ] = display;
return display;
}
function showHide( elements, show ) {
var display, elem,
values = [],
index = 0,
length = elements.length;
// Determine new display value for elements that need to change
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
display = elem.style.display;
if ( show ) {
// Since we force visibility upon cascade-hidden elements, an immediate (and slow)
// check is required in this first loop unless we have a nonempty display value (either
// inline or about-to-be-restored)
if ( display === "none" ) {
values[ index ] = dataPriv.get( elem, "display" ) || null;
if ( !values[ index ] ) {
elem.style.display = "";
}
}
if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
values[ index ] = getDefaultDisplay( elem );
}
} else {
if ( display !== "none" ) {
values[ index ] = "none";
// Remember what we're overwriting
dataPriv.set( elem, "display", display );
}
}
}
// Set the display of the elements in a second loop to avoid constant reflow
for ( index = 0; index < length; index++ ) {
if ( values[ index ] != null ) {
elements[ index ].style.display = values[ index ];
}
}
return elements;
}
jQuery.fn.extend( {
show: function() {
return showHide( this, true );
},
hide: function() {
return showHide( this );
},
toggle: function( state ) {
if ( typeof state === "boolean" ) {
return state ? this.show() : this.hide();
}
return this.each( function() {
if ( isHiddenWithinTree( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
} );
}
} );
var rcheckableType = ( /^(?:checkbox|radio)$/i );
var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
var rscriptType = ( /^$|\/(?:java|ecma)script/i );
// We have to close these tags to support XHTML (#13200)
var wrapMap = {
// Support: IE <=9 only
option: [ 1, "<select multiple='multiple'>", "</select>" ],
// XHTML parsers do not magically insert elements in the
// same way that tag soup parsers do. So we cannot shorten
// this by omitting <tbody> or other required elements.
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
_default: [ 0, "", "" ]
};
// Support: IE <=9 only
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
function getAll( context, tag ) {
// Support: IE <=9 - 11 only
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
var ret = typeof context.getElementsByTagName !== "undefined" ?
context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== "undefined" ?
context.querySelectorAll( tag || "*" ) :
[];
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
jQuery.merge( [ context ], ret ) :
ret;
}
// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
var i = 0,
l = elems.length;
for ( ; i < l; i++ ) {
dataPriv.set(
elems[ i ],
"globalEval",
!refElements || dataPriv.get( refElements[ i ], "globalEval" )
);
}
}
var rhtml = /<|&#?\w+;/;
function buildFragment( elems, context, scripts, selection, ignored ) {
var elem, tmp, tag, wrap, contains, j,
fragment = context.createDocumentFragment(),
nodes = [],
i = 0,
l = elems.length;
for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) {
nodes.push( context.createTextNode( elem ) );
// Convert html into DOM nodes
} else {
tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
// Descend through wrappers to the right content
j = wrap[ 0 ];
while ( j-- ) {
tmp = tmp.lastChild;
}
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, tmp.childNodes );
// Remember the top-level container
tmp = fragment.firstChild;
// Ensure the created nodes are orphaned (#12392)
tmp.textContent = "";
}
}
}
// Remove wrapper from fragment
fragment.textContent = "";
i = 0;
while ( ( elem = nodes[ i++ ] ) ) {
// Skip elements already in the context collection (trac-4087)
if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
if ( ignored ) {
ignored.push( elem );
}
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( fragment.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
}
// Capture executables
if ( scripts ) {
j = 0;
while ( ( elem = tmp[ j++ ] ) ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
}
}
}
return fragment;
}
( function() {
var fragment = document.createDocumentFragment(),
div = fragment.appendChild( document.createElement( "div" ) ),
input = document.createElement( "input" );
// Support: Android 4.0 - 4.3 only
// Check state lost if the name is set (#11217)
// Support: Windows Web Apps (WWA)
// `name` and `type` must use .setAttribute for WWA (#14901)
input.setAttribute( "type", "radio" );
input.setAttribute( "checked", "checked" );
input.setAttribute( "name", "t" );
div.appendChild( input );
// Support: Android <=4.1 only
// Older WebKit doesn't clone checked state correctly in fragments
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: IE <=11 only
// Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
} )();
var documentElement = document.documentElement;
var
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
// Support: IE <=9 only
// See #13393 for more info
function safeActiveElement() {
try {
return document.activeElement;
} catch ( err ) { }
}
function on( elem, types, selector, data, fn, one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
on( elem, type, selector, data, types[ type ], one );
}
return elem;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return elem;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return elem.each( function() {
jQuery.event.add( this, types, fn, data, selector );
} );
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = dataPriv.get( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Ensure that invalid selectors throw exceptions at attach time
// Evaluate against documentElement in case elem is a non-element node (e.g., document)
if ( selector ) {
jQuery.find.matchesSelector( documentElement, selector );
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !( events = elemData.events ) ) {
events = elemData.events = {};
}
if ( !( eventHandle = elemData.handle ) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
jQuery.event.dispatch.apply( elem, arguments ) : undefined;
};
}
// Handle multiple events separated by a space
types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[ t ] ) || [];
type = origType = tmp[ 1 ];
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
// There *must* be a type, no attaching namespace-only handlers
if ( !type ) {
continue;
}
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend( {
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join( "." )
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !( handlers = events[ type ] ) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener if the special events handler returns false
if ( !special.setup ||
special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
if ( !elemData || !( events = elemData.events ) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[ t ] ) || [];
type = origType = tmp[ 1 ];
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[ 2 ] &&
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown ||
special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove data and the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
dataPriv.remove( elem, "handle events" );
}
},
dispatch: function( nativeEvent ) {
// Make a writable jQuery.Event from the native event object
var event = jQuery.event.fix( nativeEvent );
var i, j, ret, matched, handleObj, handlerQueue,
args = new Array( arguments.length ),
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[ 0 ] = event;
for ( i = 1; i < arguments.length; i++ ) {
args[ i ] = arguments[ i ];
}
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us
i = 0;
while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
event.currentTarget = matched.elem;
j = 0;
while ( ( handleObj = matched.handlers[ j++ ] ) &&
!event.isImmediatePropagationStopped() ) {
// Triggered event must either 1) have no namespace, or 2) have namespace(s)
// a subset or equal to those in the bound event (both can have no namespace).
if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) {
if ( ( event.result = ret ) === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
handlers: function( event, handlers ) {
var i, matches, sel, handleObj,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
// Support: IE <=9
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
//
// Support: Firefox <=42
// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
if ( delegateCount && cur.nodeType &&
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
for ( ; cur !== this; cur = cur.parentNode || this ) {
// Don't check non-elements (#13208)
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
// Don't conflict with Object.prototype properties (#13203)
sel = handleObj.selector + " ";
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) > -1 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( matches[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push( { elem: cur, handlers: matches } );
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( delegateCount < handlers.length ) {
handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
}
return handlerQueue;
},
addProp: function( name, hook ) {
Object.defineProperty( jQuery.Event.prototype, name, {
enumerable: true,
configurable: true,
get: jQuery.isFunction( hook ) ?
function() {
if ( this.originalEvent ) {
return hook( this.originalEvent );
}
} :
function() {
if ( this.originalEvent ) {
return this.originalEvent[ name ];
}
},
set: function( value ) {
Object.defineProperty( this, name, {
enumerable: true,
configurable: true,
writable: true,
value: value
} );
}
} );
},
fix: function( originalEvent ) {
return originalEvent[ jQuery.expando ] ?
originalEvent :
new jQuery.Event( originalEvent );
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== safeActiveElement() && this.focus ) {
this.focus();
return false;
}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if ( this === safeActiveElement() && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
this.click();
return false;
}
},
// For cross-browser consistency, don't fire native .click() on links
_default: function( event ) {
return jQuery.nodeName( event.target, "a" );
}
},
beforeunload: {
postDispatch: function( event ) {
// Support: Firefox 20+
// Firefox doesn't alert if the returnValue field is not set.
if ( event.result !== undefined && event.originalEvent ) {
event.originalEvent.returnValue = event.result;
}
}
}
}
};
jQuery.removeEvent = function( elem, type, handle ) {
// This "if" is needed for plain objects
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !( this instanceof jQuery.Event ) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = src.defaultPrevented ||
src.defaultPrevented === undefined &&
// Support: Android <=2.3 only
src.returnValue === false ?
returnTrue :
returnFalse;
// Create target properties
// Support: Safari <=6 - 7 only
// Target should not be a text node (#504, #13143)
this.target = ( src.target && src.target.nodeType === 3 ) ?
src.target.parentNode :
src.target;
this.currentTarget = src.currentTarget;
this.relatedTarget = src.relatedTarget;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
constructor: jQuery.Event,
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
isSimulated: false,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if ( e && !this.isSimulated ) {
e.preventDefault();
}
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = returnTrue;
if ( e && !this.isSimulated ) {
e.stopPropagation();
}
},
stopImmediatePropagation: function() {
var e = this.originalEvent;
this.isImmediatePropagationStopped = returnTrue;
if ( e && !this.isSimulated ) {
e.stopImmediatePropagation();
}
this.stopPropagation();
}
};
// Includes all common event props including KeyEvent and MouseEvent specific props
jQuery.each( {
altKey: true,
bubbles: true,
cancelable: true,
changedTouches: true,
ctrlKey: true,
detail: true,
eventPhase: true,
metaKey: true,
pageX: true,
pageY: true,
shiftKey: true,
view: true,
"char": true,
charCode: true,
key: true,
keyCode: true,
button: true,
buttons: true,
clientX: true,
clientY: true,
offsetX: true,
offsetY: true,
pointerId: true,
pointerType: true,
screenX: true,
screenY: true,
targetTouches: true,
toElement: true,
touches: true,
which: function( event ) {
var button = event.button;
// Add which for key events
if ( event.which == null && rkeyEvent.test( event.type ) ) {
return event.charCode != null ? event.charCode : event.keyCode;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event.which;
}
}, jQuery.event.addProp );
// Create mouseenter/leave events using mouseover/out and event-time checks
// so that event delegation works in jQuery.
// Do the same for pointerenter/pointerleave and pointerover/pointerout
//
// Support: Safari 7 only
// Safari sends mouseenter too often; see:
// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
// for the description of the bug (it existed in older Chrome versions as well).
jQuery.each( {
mouseenter: "mouseover",
mouseleave: "mouseout",
pointerenter: "pointerover",
pointerleave: "pointerout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj;
// For mouseenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
} );
jQuery.fn.extend( {
on: function( types, selector, data, fn ) {
return on( this, types, selector, data, fn );
},
one: function( types, selector, data, fn ) {
return on( this, types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ?
handleObj.origType + "." + handleObj.namespace :
handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each( function() {
jQuery.event.remove( this, types, fn, selector );
} );
}
} );
var
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
// Support: IE <=10 - 11, Edge 12 - 13
// In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/
rnoInnerhtml = /<script|<style|<link/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
function manipulationTarget( elem, content ) {
if ( jQuery.nodeName( elem, "table" ) &&
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
}
return elem;
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[ 1 ];
} else {
elem.removeAttribute( "type" );
}
return elem;
}
function cloneCopyEvent( src, dest ) {
var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
if ( dest.nodeType !== 1 ) {
return;
}
// 1. Copy private data: events, handlers, etc.
if ( dataPriv.hasData( src ) ) {
pdataOld = dataPriv.access( src );
pdataCur = dataPriv.set( dest, pdataOld );
events = pdataOld.events;
if ( events ) {
delete pdataCur.handle;
pdataCur.events = {};
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
}
// 2. Copy user data
if ( dataUser.hasData( src ) ) {
udataOld = dataUser.access( src );
udataCur = jQuery.extend( {}, udataOld );
dataUser.set( dest, udataCur );
}
}
// Fix IE bugs, see support tests
function fixInput( src, dest ) {
var nodeName = dest.nodeName.toLowerCase();
// Fails to persist the checked state of a cloned checkbox or radio button.
if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
dest.checked = src.checked;
// Fails to return the selected option to the default selected state when cloning options
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
}
function domManip( collection, args, callback, ignored ) {
// Flatten any nested arrays
args = concat.apply( [], args );
var fragment, first, scripts, hasScripts, node, doc,
i = 0,
l = collection.length,
iNoClone = l - 1,
value = args[ 0 ],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction ||
( l > 1 && typeof value === "string" &&
!support.checkClone && rchecked.test( value ) ) ) {
return collection.each( function( index ) {
var self = collection.eq( index );
if ( isFunction ) {
args[ 0 ] = value.call( this, index, self.html() );
}
domManip( self, args, callback, ignored );
} );
}
if ( l ) {
fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
// Require either new content or an interest in ignored elements to invoke the callback
if ( first || ignored ) {
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item
// instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
callback.call( collection[ i ], node, i );
}
if ( hasScripts ) {
doc = scripts[ scripts.length - 1 ].ownerDocument;
// Reenable scripts
jQuery.map( scripts, restoreScript );
// Evaluate executable scripts on first document insertion
for ( i = 0; i < hasScripts; i++ ) {
node = scripts[ i ];
if ( rscriptType.test( node.type || "" ) &&
!dataPriv.access( node, "globalEval" ) &&
jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Optional AJAX dependency, but won't run scripts if not present
if ( jQuery._evalUrl ) {
jQuery._evalUrl( node.src );
}
} else {
DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
}
}
}
}
}
}
return collection;
}
function remove( elem, selector, keepData ) {
var node,
nodes = selector ? jQuery.filter( selector, elem ) : elem,
i = 0;
for ( ; ( node = nodes[ i ] ) != null; i++ ) {
if ( !keepData && node.nodeType === 1 ) {
jQuery.cleanData( getAll( node ) );
}
if ( node.parentNode ) {
if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
setGlobalEval( getAll( node, "script" ) );
}
node.parentNode.removeChild( node );
}
}
return elem;
}
jQuery.extend( {
htmlPrefilter: function( html ) {
return html.replace( rxhtmlTag, "<$1></$2>" );
},
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var i, l, srcElements, destElements,
clone = elem.cloneNode( true ),
inPage = jQuery.contains( elem.ownerDocument, elem );
// Fix IE cloning issues
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
!jQuery.isXMLDoc( elem ) ) {
// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
for ( i = 0, l = srcElements.length; i < l; i++ ) {
fixInput( srcElements[ i ], destElements[ i ] );
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
if ( deepDataAndEvents ) {
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
for ( i = 0, l = srcElements.length; i < l; i++ ) {
cloneCopyEvent( srcElements[ i ], destElements[ i ] );
}
} else {
cloneCopyEvent( elem, clone );
}
}
// Preserve script evaluation history
destElements = getAll( clone, "script" );
if ( destElements.length > 0 ) {
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
}
// Return the cloned set
return clone;
},
cleanData: function( elems ) {
var data, elem, type,
special = jQuery.event.special,
i = 0;
for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
if ( acceptData( elem ) ) {
if ( ( data = elem[ dataPriv.expando ] ) ) {
if ( data.events ) {
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
// Support: Chrome <=35 - 45+
// Assign undefined instead of using delete, see Data#remove
elem[ dataPriv.expando ] = undefined;
}
if ( elem[ dataUser.expando ] ) {
// Support: Chrome <=35 - 45+
// Assign undefined instead of using delete, see Data#remove
elem[ dataUser.expando ] = undefined;
}
}
}
}
} );
jQuery.fn.extend( {
detach: function( selector ) {
return remove( this, selector, true );
},
remove: function( selector ) {
return remove( this, selector );
},
text: function( value ) {
return access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().each( function() {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.textContent = value;
}
} );
}, null, value, arguments.length );
},
append: function() {
return domManip( this, arguments, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
var target = manipulationTarget( this, elem );
target.appendChild( elem );
}
} );
},
prepend: function() {
return domManip( this, arguments, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
var target = manipulationTarget( this, elem );
target.insertBefore( elem, target.firstChild );
}
} );
},
before: function() {
return domManip( this, arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
} );
},
after: function() {
return domManip( this, arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
} );
},
empty: function() {
var elem,
i = 0;
for ( ; ( elem = this[ i ] ) != null; i++ ) {
if ( elem.nodeType === 1 ) {
// Prevent memory leaks
jQuery.cleanData( getAll( elem, false ) );
// Remove any remaining nodes
elem.textContent = "";
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function() {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
} );
},
html: function( value ) {
return access( this, function( value ) {
var elem = this[ 0 ] || {},
i = 0,
l = this.length;
if ( value === undefined && elem.nodeType === 1 ) {
return elem.innerHTML;
}
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
value = jQuery.htmlPrefilter( value );
try {
for ( ; i < l; i++ ) {
elem = this[ i ] || {};
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
elem.innerHTML = value;
}
}
elem = 0;
// If using innerHTML throws an exception, use the fallback method
} catch ( e ) {}
}
if ( elem ) {
this.empty().append( value );
}
}, null, value, arguments.length );
},
replaceWith: function() {
var ignored = [];
// Make the changes, replacing each non-ignored context element with the new content
return domManip( this, arguments, function( elem ) {
var parent = this.parentNode;
if ( jQuery.inArray( this, ignored ) < 0 ) {
jQuery.cleanData( getAll( this ) );
if ( parent ) {
parent.replaceChild( elem, this );
}
}
// Force callback invocation
}, ignored );
}
} );
jQuery.each( {
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var elems,
ret = [],
insert = jQuery( selector ),
last = insert.length - 1,
i = 0;
for ( ; i <= last; i++ ) {
elems = i === last ? this : this.clone( true );
jQuery( insert[ i ] )[ original ]( elems );
// Support: Android <=4.0 only, PhantomJS 1 only
// .get() because push.apply(_, arraylike) throws on ancient WebKit
push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
} );
var rmargin = ( /^margin/ );
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
var getStyles = function( elem ) {
// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView;
if ( !view || !view.opener ) {
view = window;
}
return view.getComputedStyle( elem );
};
( function() {
// Executing both pixelPosition & boxSizingReliable tests require only one layout
// so they're executed at the same time to save the second computation.
function computeStyleTests() {
// This is a singleton, we need to execute it only once
if ( !div ) {
return;
}
div.style.cssText =
"box-sizing:border-box;" +
"position:relative;display:block;" +
"margin:auto;border:1px;padding:1px;" +
"top:1%;width:50%";
div.innerHTML = "";
documentElement.appendChild( container );
var divStyle = window.getComputedStyle( div );
pixelPositionVal = divStyle.top !== "1%";
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
reliableMarginLeftVal = divStyle.marginLeft === "2px";
boxSizingReliableVal = divStyle.width === "4px";
// Support: Android 4.0 - 4.3 only
// Some styles come back with percentage values, even though they shouldn't
div.style.marginRight = "50%";
pixelMarginRightVal = divStyle.marginRight === "4px";
documentElement.removeChild( container );
// Nullify the div so it wouldn't be stored in the memory and
// it will also be a sign that checks already performed
div = null;
}
var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
container = document.createElement( "div" ),
div = document.createElement( "div" );
// Finish early in limited (non-browser) environments
if ( !div.style ) {
return;
}
// Support: IE <=9 - 11 only
// Style of cloned element affects source element cloned (#8908)
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
"padding:0;margin-top:1px;position:absolute";
container.appendChild( div );
jQuery.extend( support, {
pixelPosition: function() {
computeStyleTests();
return pixelPositionVal;
},
boxSizingReliable: function() {
computeStyleTests();
return boxSizingReliableVal;
},
pixelMarginRight: function() {
computeStyleTests();
return pixelMarginRightVal;
},
reliableMarginLeft: function() {
computeStyleTests();
return reliableMarginLeftVal;
}
} );
} )();
function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
style = elem.style;
computed = computed || getStyles( elem );
// Support: IE <=9 only
// getPropertyValue is only needed for .css('filter') (#12537)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"
// Android Browser returns percentage for some values,
// but width seems to be reliably pixels.
// This is against the CSSOM draft spec:
// https://drafts.csswg.org/cssom/#resolved-values
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret !== undefined ?
// Support: IE <=9 - 11 only
// IE returns zIndex value as an integer.
ret + "" :
ret;
}
function addGetHookIf( conditionFn, hookFn ) {
// Define the hook, we'll check on the first run if it's really needed.
return {
get: function() {
if ( conditionFn() ) {
// Hook not needed (or it's not possible to use it due
// to missing dependency), remove it.
delete this.get;
return;
}
// Hook needed; redefine it so that the support test is not executed again.
return ( this.get = hookFn ).apply( this, arguments );
}
};
}
var
// Swappable if display is none or starts with table
// except "table", "table-cell", or "table-caption"
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: "0",
fontWeight: "400"
},
cssPrefixes = [ "Webkit", "Moz", "ms" ],
emptyStyle = document.createElement( "div" ).style;
// Return a css property mapped to a potentially vendor prefixed property
function vendorPropName( name ) {
// Shortcut for names that are not vendor prefixed
if ( name in emptyStyle ) {
return name;
}
// Check for vendor prefixed names
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
i = cssPrefixes.length;
while ( i-- ) {
name = cssPrefixes[ i ] + capName;
if ( name in emptyStyle ) {
return name;
}
}
}
function setPositiveNumber( elem, value, subtract ) {
// Any relative (+/-) values have already been
// normalized at this point
var matches = rcssNum.exec( value );
return matches ?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
value;
}
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
var i = extra === ( isBorderBox ? "border" : "content" ) ?
// If we already have the right measurement, avoid augmentation
4 :
// Otherwise initialize for horizontal or vertical properties
name === "width" ? 1 : 0,
val = 0;
for ( ; i < 4; i += 2 ) {
// Both box models exclude margin, so add it if we want it
if ( extra === "margin" ) {
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
}
if ( isBorderBox ) {
// border-box includes padding, so remove it if we want content
if ( extra === "content" ) {
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
}
// At this point, extra isn't border nor margin, so remove border
if ( extra !== "margin" ) {
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
} else {
// At this point, extra isn't content, so add padding
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
// At this point, extra isn't content nor padding, so add border
if ( extra !== "padding" ) {
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
}
}
return val;
}
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value
var val,
valueIsBorderBox = true,
styles = getStyles( elem ),
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// Support: IE <=11 only
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
if ( elem.getClientRects().length ) {
val = elem.getBoundingClientRect()[ name ];
}
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test( val ) ) {
return val;
}
// Check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox &&
( support.boxSizingReliable() || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
}
// Use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
elem,
name,
extra || ( isBorderBox ? "border" : "content" ),
valueIsBorderBox,
styles
)
) + "px";
}
jQuery.extend( {
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
// Don't automatically add "px" to these possibly-unitless properties
cssNumber: {
"animationIterationCount": true,
"columnCount": true,
"fillOpacity": true,
"flexGrow": true,
"flexShrink": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"order": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
"float": "cssFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
style = elem.style;
name = jQuery.cssProps[ origName ] ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
// Gets hook for the prefixed version, then unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// Convert "+=" or "-=" to relative numbers (#7345)
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
value = adjustCSS( elem, name, ret );
// Fixes bug #9237
type = "number";
}
// Make sure that null and NaN values aren't set (#7116)
if ( value == null || value !== value ) {
return;
}
// If a number was passed in, add the unit (except for certain CSS properties)
if ( type === "number" ) {
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
}
// background-* props affect original clone's values
if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !( "set" in hooks ) ||
( value = hooks.set( elem, value, extra ) ) !== undefined ) {
style[ name ] = value;
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks &&
( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra, styles ) {
var val, num, hooks,
origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
// Try prefixed name followed by the unprefixed name
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks ) {
val = hooks.get( elem, true, extra );
}
// Otherwise, if a way to get the computed value exists, use that
if ( val === undefined ) {
val = curCSS( elem, name, styles );
}
// Convert "normal" to computed value
if ( val === "normal" && name in cssNormalTransform ) {
val = cssNormalTransform[ name ];
}
// Make numeric if forced or a qualifier was provided and val looks numeric
if ( extra === "" || extra ) {
num = parseFloat( val );
return extra === true || isFinite( num ) ? num || 0 : val;
}
return val;
}
} );
jQuery.each( [ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
// Certain elements can have dimension info if we invisibly show them
// but it must have a current display style that would benefit
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
// Support: Safari 8+
// Table columns in Safari have non-zero offsetWidth & zero
// getBoundingClientRect().width unless display is changed.
// Support: IE <=11 only
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
} ) :
getWidthOrHeight( elem, name, extra );
}
},
set: function( elem, value, extra ) {
var matches,
styles = extra && getStyles( elem ),
subtract = extra && augmentWidthOrHeight(
elem,
name,
extra,
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
);
// Convert to pixels if value adjustment is needed
if ( subtract && ( matches = rcssNum.exec( value ) ) &&
( matches[ 3 ] || "px" ) !== "px" ) {
elem.style[ name ] = value;
value = jQuery.css( elem, name );
}
return setPositiveNumber( elem, value, subtract );
}
};
} );
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
function( elem, computed ) {
if ( computed ) {
return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
elem.getBoundingClientRect().left -
swap( elem, { marginLeft: 0 }, function() {
return elem.getBoundingClientRect().left;
} )
) + "px";
}
}
);
// These hooks are used by animate to expand properties
jQuery.each( {
margin: "",
padding: "",
border: "Width"
}, function( prefix, suffix ) {
jQuery.cssHooks[ prefix + suffix ] = {
expand: function( value ) {
var i = 0,
expanded = {},
// Assumes a single number if not a string
parts = typeof value === "string" ? value.split( " " ) : [ value ];
for ( ; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
if ( !rmargin.test( prefix ) ) {
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
}
} );
jQuery.fn.extend( {
css: function( name, value ) {
return access( this, function( elem, name, value ) {
var styles, len,
map = {},
i = 0;
if ( jQuery.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;
for ( ; i < len; i++ ) {
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
}
return map;
}
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
}
} );
function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;
Tween.prototype = {
constructor: Tween,
init: function( elem, options, prop, end, easing, unit ) {
this.elem = elem;
this.prop = prop;
this.easing = easing || jQuery.easing._default;
this.options = options;
this.start = this.now = this.cur();
this.end = end;
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
},
cur: function() {
var hooks = Tween.propHooks[ this.prop ];
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
if ( hooks && hooks.set ) {
hooks.set( this );
} else {
Tween.propHooks._default.set( this );
}
return this;
}
};
Tween.prototype.init.prototype = Tween.prototype;
Tween.propHooks = {
_default: {
get: function( tween ) {
var result;
// Use a property on the element directly when it is not a DOM element,
// or when there is no matching style property that exists.
if ( tween.elem.nodeType !== 1 ||
tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
return tween.elem[ tween.prop ];
}
// Passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails.
// Simple values such as "10px" are parsed to Float;
// complex values such as "rotate(1rad)" are returned as-is.
result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {
// Use step hook for back compat.
// Use cssHook if its there.
// Use .style if available and use plain properties where available.
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.nodeType === 1 &&
( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
tween.elem[ tween.prop ] = tween.now;
}
}
}
};
// Support: IE <=9 only
// Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) {
tween.elem[ tween.prop ] = tween.now;
}
}
};
jQuery.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p * Math.PI ) / 2;
},
_default: "swing"
};
jQuery.fx = Tween.prototype.init;
// Back compat <1.8 extension point
jQuery.fx.step = {};
var
fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rrun = /queueHooks$/;
function raf() {
if ( timerId ) {
window.requestAnimationFrame( raf );
jQuery.fx.tick();
}
}
// Animations created synchronously will run synchronously
function createFxNow() {
window.setTimeout( function() {
fxNow = undefined;
} );
return ( fxNow = jQuery.now() );
}
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
i = 0,
attrs = { height: type };
// If we include width, step value is 1 to do all cssExpand values,
// otherwise step value is 2 to skip over Left and Right
includeWidth = includeWidth ? 1 : 0;
for ( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
if ( includeWidth ) {
attrs.opacity = attrs.width = type;
}
return attrs;
}
function createTween( value, prop, animation ) {
var tween,
collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
// We're done with this property
return tween;
}
}
}
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
isBox = "width" in props || "height" in props,
anim = this,
orig = {},
style = elem.style,
hidden = elem.nodeType && isHiddenWithinTree( elem ),
dataShow = dataPriv.get( elem, "fxshow" );
// Queue-skipping animations hijack the fx hooks
if ( !opts.queue ) {
hooks = jQuery._queueHooks( elem, "fx" );
if ( hooks.unqueued == null ) {
hooks.unqueued = 0;
oldfire = hooks.empty.fire;
hooks.empty.fire = function() {
if ( !hooks.unqueued ) {
oldfire();
}
};
}
hooks.unqueued++;
anim.always( function() {
// Ensure the complete handler is called before this completes
anim.always( function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
} );
} );
}
// Detect show/hide animations
for ( prop in props ) {
value = props[ prop ];
if ( rfxtypes.test( value ) ) {
delete props[ prop ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
// Pretend to be hidden if this is a "show" and
// there is still data from a stopped show/hide
if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
hidden = true;
// Ignore all other no-op show/hide data
} else {
continue;
}
}
orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
}
}
// Bail out if this is a no-op like .hide().hide()
propTween = !jQuery.isEmptyObject( props );
if ( !propTween && jQuery.isEmptyObject( orig ) ) {
return;
}
// Restrict "overflow" and "display" styles during box animations
if ( isBox && elem.nodeType === 1 ) {
// Support: IE <=9 - 11, Edge 12 - 13
// Record all 3 overflow attributes because IE does not infer the shorthand
// from identically-valued overflowX and overflowY
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Identify a display type, preferring old show/hide data over the CSS cascade
restoreDisplay = dataShow && dataShow.display;
if ( restoreDisplay == null ) {
restoreDisplay = dataPriv.get( elem, "display" );
}
display = jQuery.css( elem, "display" );
if ( display === "none" ) {
if ( restoreDisplay ) {
display = restoreDisplay;
} else {
// Get nonempty value(s) by temporarily forcing visibility
showHide( [ elem ], true );
restoreDisplay = elem.style.display || restoreDisplay;
display = jQuery.css( elem, "display" );
showHide( [ elem ] );
}
}
// Animate inline elements as inline-block
if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
if ( jQuery.css( elem, "float" ) === "none" ) {
// Restore the original display value at the end of pure show/hide animations
if ( !propTween ) {
anim.done( function() {
style.display = restoreDisplay;
} );
if ( restoreDisplay == null ) {
display = style.display;
restoreDisplay = display === "none" ? "" : display;
}
}
style.display = "inline-block";
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
anim.always( function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
} );
}
// Implement show/hide animations
propTween = false;
for ( prop in orig ) {
// General show/hide setup for this element animation
if ( !propTween ) {
if ( dataShow ) {
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
} else {
dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
}
// Store hidden/visible for toggle so `.stop().toggle()` "reverses"
if ( toggle ) {
dataShow.hidden = !hidden;
}
// Show elements before animating them
if ( hidden ) {
showHide( [ elem ], true );
}
/* jshint -W083 */
anim.done( function() {
// The final step of a "hide" animation is actually hiding the element
if ( !hidden ) {
showHide( [ elem ] );
}
dataPriv.remove( elem, "fxshow" );
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
} );
}
// Per-property setup
propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = propTween.start;
if ( hidden ) {
propTween.end = propTween.start;
propTween.start = 0;
}
}
}
}
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( jQuery.isArray( value ) ) {
easing = value[ 1 ];
value = props[ index ] = value[ 0 ];
}
if ( index !== name ) {
props[ name ] = value;
delete props[ index ];
}
hooks = jQuery.cssHooks[ name ];
if ( hooks && "expand" in hooks ) {
value = hooks.expand( value );
delete props[ name ];
// Not quite $.extend, this won't overwrite existing keys.
// Reusing 'index' because we have the correct "name"
for ( index in value ) {
if ( !( index in props ) ) {
props[ index ] = value[ index ];
specialEasing[ index ] = easing;
}
}
} else {
specialEasing[ name ] = easing;
}
}
}
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = Animation.prefilters.length,
deferred = jQuery.Deferred().always( function() {
// Don't match elem in the :animated selector
delete tick.elem;
} ),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// Support: Android 2.3 only
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ] );
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
},
animation = deferred.promise( {
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, {
specialEasing: {},
easing: jQuery.easing._default
}, options ),
originalProperties: properties,
originalOptions: options,
startTime: fxNow || createFxNow(),
duration: options.duration,
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
stop: function( gotoEnd ) {
var index = 0,
// If we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
if ( stopped ) {
return this;
}
stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
// Resolve when we played the last frame; otherwise, reject
if ( gotoEnd ) {
deferred.notifyWith( elem, [ animation, 1, 0 ] );
deferred.resolveWith( elem, [ animation, gotoEnd ] );
} else {
deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
return this;
}
} ),
props = animation.props;
propFilter( props, animation.opts.specialEasing );
for ( ; index < length ; index++ ) {
result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
if ( jQuery.isFunction( result.stop ) ) {
jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
jQuery.proxy( result.stop, result );
}
return result;
}
}
jQuery.map( props, createTween, animation );
if ( jQuery.isFunction( animation.opts.start ) ) {
animation.opts.start.call( elem, animation );
}
jQuery.fx.timer(
jQuery.extend( tick, {
elem: elem,
anim: animation,
queue: animation.opts.queue
} )
);
// attach callbacks from options
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
jQuery.Animation = jQuery.extend( Animation, {
tweeners: {
"*": [ function( prop, value ) {
var tween = this.createTween( prop, value );
adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
return tween;
} ]
},
tweener: function( props, callback ) {
if ( jQuery.isFunction( props ) ) {
callback = props;
props = [ "*" ];
} else {
props = props.match( rnotwhite );
}
var prop,
index = 0,
length = props.length;
for ( ; index < length ; index++ ) {
prop = props[ index ];
Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
Animation.tweeners[ prop ].unshift( callback );
}
},
prefilters: [ defaultPrefilter ],
prefilter: function( callback, prepend ) {
if ( prepend ) {
Animation.prefilters.unshift( callback );
} else {
Animation.prefilters.push( callback );
}
}
} );
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
};
// Go to the end state if fx are off or if document is hidden
if ( jQuery.fx.off || document.hidden ) {
opt.duration = 0;
} else {
opt.duration = typeof opt.duration === "number" ?
opt.duration : opt.duration in jQuery.fx.speeds ?
jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
}
// Normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
}
};
return opt;
};
jQuery.fn.extend( {
fadeTo: function( speed, to, easing, callback ) {
// Show any hidden elements after setting opacity to 0
return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
// Animate to the value specified
.end().animate( { opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
// Empty animations, or finishing resolves immediately
if ( empty || dataPriv.get( this, "finish" ) ) {
anim.stop( true );
}
};
doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
};
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each( function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = dataPriv.get( this );
if ( index ) {
if ( data[ index ] && data[ index ].stop ) {
stopQueue( data[ index ] );
}
} else {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
stopQueue( data[ index ] );
}
}
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this &&
( type == null || timers[ index ].queue === type ) ) {
timers[ index ].anim.stop( gotoEnd );
dequeue = false;
timers.splice( index, 1 );
}
}
// Start the next in the queue if the last step wasn't forced.
// Timers currently will call their complete callbacks, which
// will dequeue but only if they were gotoEnd.
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
} );
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each( function() {
var index,
data = dataPriv.get( this ),
queue = data[ type + "queue" ],
hooks = data[ type + "queueHooks" ],
timers = jQuery.timers,
length = queue ? queue.length : 0;
// Enable finishing flag on private data
data.finish = true;
// Empty the queue first
jQuery.queue( this, type, [] );
if ( hooks && hooks.stop ) {
hooks.stop.call( this, true );
}
// Look for any active animations, and finish them
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
timers[ index ].anim.stop( true );
timers.splice( index, 1 );
}
}
// Look for any animations in the old queue and finish them
for ( index = 0; index < length; index++ ) {
if ( queue[ index ] && queue[ index ].finish ) {
queue[ index ].finish.call( this );
}
}
// Turn off finishing flag
delete data.finish;
} );
}
} );
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
} );
// Generate shortcuts for custom animations
jQuery.each( {
slideDown: genFx( "show" ),
slideUp: genFx( "hide" ),
slideToggle: genFx( "toggle" ),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
} );
jQuery.timers = [];
jQuery.fx.tick = function() {
var timer,
i = 0,
timers = jQuery.timers;
fxNow = jQuery.now();
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
jQuery.timers.push( timer );
if ( timer() ) {
jQuery.fx.start();
} else {
jQuery.timers.pop();
}
};
jQuery.fx.interval = 13;
jQuery.fx.start = function() {
if ( !timerId ) {
timerId = window.requestAnimationFrame ?
window.requestAnimationFrame( raf ) :
window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
}
};
jQuery.fx.stop = function() {
if ( window.cancelAnimationFrame ) {
window.cancelAnimationFrame( timerId );
} else {
window.clearInterval( timerId );
}
timerId = null;
};
jQuery.fx.speeds = {
slow: 600,
fast: 200,
// Default speed
_default: 400
};
// Based off of the plugin by Clint Helfers, with permission.
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
jQuery.fn.delay = function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = window.setTimeout( next, time );
hooks.stop = function() {
window.clearTimeout( timeout );
};
} );
};
( function() {
var input = document.createElement( "input" ),
select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) );
input.type = "checkbox";
// Support: Android <=4.3 only
// Default value for a checkbox should be "on"
support.checkOn = input.value !== "";
// Support: IE <=11 only
// Must access selectedIndex to make default options select
support.optSelected = opt.selected;
// Support: IE <=11 only
// An input loses its value after becoming a radio
input = document.createElement( "input" );
input.value = "t";
input.type = "radio";
support.radioValue = input.value === "t";
} )();
var boolHook,
attrHandle = jQuery.expr.attrHandle;
jQuery.fn.extend( {
attr: function( name, value ) {
return access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each( function() {
jQuery.removeAttr( this, name );
} );
}
} );
jQuery.extend( {
attr: function( elem, name, value ) {
var ret, hooks,
nType = elem.nodeType;
// Don't get/set attributes on text, comment and attribute nodes
if ( nType === 3 || nType === 8 || nType === 2 ) {
return;
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === "undefined" ) {
return jQuery.prop( elem, name, value );
}
// Attribute hooks are determined by the lowercase version
// Grab necessary hook if one is defined
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
return;
}
if ( hooks && "set" in hooks &&
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
return ret;
}
elem.setAttribute( name, value + "" );
return value;
}
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
return ret;
}
ret = jQuery.find.attr( elem, name );
// Non-existent attributes return null, we normalize to undefined
return ret == null ? undefined : ret;
},
attrHooks: {
type: {
set: function( elem, value ) {
if ( !support.radioValue && value === "radio" &&
jQuery.nodeName( elem, "input" ) ) {
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
}
},
removeAttr: function( elem, value ) {
var name,
i = 0,
attrNames = value && value.match( rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( ( name = attrNames[ i++ ] ) ) {
elem.removeAttribute( name );
}
}
}
} );
// Hooks for boolean attributes
boolHook = {
set: function( elem, value, name ) {
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
elem.setAttribute( name, name );
}
return name;
}
};
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
var getter = attrHandle[ name ] || jQuery.find.attr;
attrHandle[ name ] = function( elem, name, isXML ) {
var ret, handle,
lowercaseName = name.toLowerCase();
if ( !isXML ) {
// Avoid an infinite loop by temporarily removing this function from the getter
handle = attrHandle[ lowercaseName ];
attrHandle[ lowercaseName ] = ret;
ret = getter( elem, name, isXML ) != null ?
lowercaseName :
null;
attrHandle[ lowercaseName ] = handle;
}
return ret;
};
} );
var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i;
jQuery.fn.extend( {
prop: function( name, value ) {
return access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
return this.each( function() {
delete this[ jQuery.propFix[ name ] || name ];
} );
}
} );
jQuery.extend( {
prop: function( elem, name, value ) {
var ret, hooks,
nType = elem.nodeType;
// Don't get/set properties on text, comment and attribute nodes
if ( nType === 3 || nType === 8 || nType === 2 ) {
return;
}
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks &&
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
return ret;
}
return ( elem[ name ] = value );
}
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
return ret;
}
return elem[ name ];
},
propHooks: {
tabIndex: {
get: function( elem ) {
// Support: IE <=9 - 11 only
// elem.tabIndex doesn't always return the
// correct value when it hasn't been explicitly set
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
// Use proper attribute retrieval(#12072)
var tabindex = jQuery.find.attr( elem, "tabindex" );
return tabindex ?
parseInt( tabindex, 10 ) :
rfocusable.test( elem.nodeName ) ||
rclickable.test( elem.nodeName ) && elem.href ?
0 :
-1;
}
}
},
propFix: {
"for": "htmlFor",
"class": "className"
}
} );
// Support: IE <=11 only
// Accessing the selectedIndex property
// forces the browser to respect setting selected
// on the option
// The getter ensures a default option is selected
// when in an optgroup
if ( !support.optSelected ) {
jQuery.propHooks.selected = {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
parent.parentNode.selectedIndex;
}
return null;
},
set: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
};
}
jQuery.each( [
"tabIndex",
"readOnly",
"maxLength",
"cellSpacing",
"cellPadding",
"rowSpan",
"colSpan",
"useMap",
"frameBorder",
"contentEditable"
], function() {
jQuery.propFix[ this.toLowerCase() ] = this;
} );
var rclass = /[\t\r\n\f]/g;
function getClass( elem ) {
return elem.getAttribute && elem.getAttribute( "class" ) || "";
}
jQuery.fn.extend( {
addClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if ( jQuery.isFunction( value ) ) {
return this.each( function( j ) {
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
} );
}
if ( typeof value === "string" && value ) {
classes = value.match( rnotwhite ) || [];
while ( ( elem = this[ i++ ] ) ) {
curValue = getClass( elem );
cur = elem.nodeType === 1 &&
( " " + curValue + " " ).replace( rclass, " " );
if ( cur ) {
j = 0;
while ( ( clazz = classes[ j++ ] ) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
// Only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue );
}
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if ( jQuery.isFunction( value ) ) {
return this.each( function( j ) {
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
} );
}
if ( !arguments.length ) {
return this.attr( "class", "" );
}
if ( typeof value === "string" && value ) {
classes = value.match( rnotwhite ) || [];
while ( ( elem = this[ i++ ] ) ) {
curValue = getClass( elem );
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 &&
( " " + curValue + " " ).replace( rclass, " " );
if ( cur ) {
j = 0;
while ( ( clazz = classes[ j++ ] ) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
// Only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue );
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
}
if ( jQuery.isFunction( value ) ) {
return this.each( function( i ) {
jQuery( this ).toggleClass(
value.call( this, i, getClass( this ), stateVal ),
stateVal
);
} );
}
return this.each( function() {
var className, i, self, classNames;
if ( type === "string" ) {
// Toggle individual class names
i = 0;
self = jQuery( this );
classNames = value.match( rnotwhite ) || [];
while ( ( className = classNames[ i++ ] ) ) {
// Check each className given, space separated list
if ( self.hasClass( className ) ) {
self.removeClass( className );
} else {
self.addClass( className );
}
}
// Toggle whole class name
} else if ( value === undefined || type === "boolean" ) {
className = getClass( this );
if ( className ) {
// Store className if set
dataPriv.set( this, "__className__", className );
}
// If the element has a class name or if we're passed `false`,
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
if ( this.setAttribute ) {
this.setAttribute( "class",
className || value === false ?
"" :
dataPriv.get( this, "__className__" ) || ""
);
}
}
} );
},
hasClass: function( selector ) {
var className, elem,
i = 0;
className = " " + selector + " ";
while ( ( elem = this[ i++ ] ) ) {
if ( elem.nodeType === 1 &&
( " " + getClass( elem ) + " " ).replace( rclass, " " )
.indexOf( className ) > -1
) {
return true;
}
}
return false;
}
} );
var rreturn = /\r/g,
rspaces = /[\x20\t\r\n\f]+/g;
jQuery.fn.extend( {
val: function( value ) {
var hooks, ret, isFunction,
elem = this[ 0 ];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] ||
jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks &&
"get" in hooks &&
( ret = hooks.get( elem, "value" ) ) !== undefined
) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// Handle most common string cases
ret.replace( rreturn, "" ) :
// Handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each( function( i ) {
var val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, jQuery( this ).val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map( val, function( value ) {
return value == null ? "" : value + "";
} );
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
} );
}
} );
jQuery.extend( {
valHooks: {
option: {
get: function( elem ) {
var val = jQuery.find.attr( elem, "value" );
return val != null ?
val :
// Support: IE <=10 - 11 only
// option.text throws exceptions (#14686, #14858)
// Strip and collapse whitespace
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one",
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// Support: IE <=9 only
// IE8-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
!option.disabled &&
( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var optionSet, option,
options = elem.options,
values = jQuery.makeArray( value ),
i = options.length;
while ( i-- ) {
option = options[ i ];
if ( option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) {
optionSet = true;
}
}
// Force browsers to behave consistently when non-matching value is set
if ( !optionSet ) {
elem.selectedIndex = -1;
}
return values;
}
}
}
} );
// Radios and checkboxes getter/setter
jQuery.each( [ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
}
}
};
if ( !support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) {
return elem.getAttribute( "value" ) === null ? "on" : elem.value;
};
}
} );
// Return jQuery for attributes-only inclusion
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
jQuery.extend( jQuery.event, {
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = hasOwn.call( event, "type" ) ? event.type : event,
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
cur = tmp = elem = elem || document;
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf( "." ) > -1 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split( "." );
type = namespaces.shift();
namespaces.sort();
}
ontype = type.indexOf( ":" ) < 0 && "on" + type;
// Caller can pass in a jQuery.Event object, Object, or just an event type string
event = event[ jQuery.expando ] ?
event :
new jQuery.Event( type, typeof event === "object" && event );
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
event.isTrigger = onlyHandlers ? 2 : 3;
event.namespace = namespaces.join( "." );
event.rnamespace = event.namespace ?
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
null;
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data == null ?
[ event ] :
jQuery.makeArray( data, [ event ] );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
if ( !rfocusMorph.test( bubbleType + type ) ) {
cur = cur.parentNode;
}
for ( ; cur; cur = cur.parentNode ) {
eventPath.push( cur );
tmp = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( tmp === ( elem.ownerDocument || document ) ) {
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
}
}
// Fire handlers on the event path
i = 0;
while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
event.type = i > 1 ?
bubbleType :
special.bindType || type;
// jQuery handler
handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
dataPriv.get( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Native handler
handle = ontype && cur[ ontype ];
if ( handle && handle.apply && acceptData( cur ) ) {
event.result = handle.apply( cur, data );
if ( event.result === false ) {
event.preventDefault();
}
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( ( !special._default ||
special._default.apply( eventPath.pop(), data ) === false ) &&
acceptData( elem ) ) {
// Call a native DOM method on the target with the same name as the event.
// Don't do default actions on window, that's where global variables be (#6170)
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
tmp = elem[ ontype ];
if ( tmp ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
elem[ type ]();
jQuery.event.triggered = undefined;
if ( tmp ) {
elem[ ontype ] = tmp;
}
}
}
}
return event.result;
},
// Piggyback on a donor event to simulate a different one
// Used only for `focus(in | out)` events
simulate: function( type, elem, event ) {
var e = jQuery.extend(
new jQuery.Event(),
event,
{
type: type,
isSimulated: true
}
);
jQuery.event.trigger( e, null, elem );
}
} );
jQuery.fn.extend( {
trigger: function( type, data ) {
return this.each( function() {
jQuery.event.trigger( type, data, this );
} );
},
triggerHandler: function( type, data ) {
var elem = this[ 0 ];
if ( elem ) {
return jQuery.event.trigger( type, data, elem, true );
}
}
} );
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
} );
jQuery.fn.extend( {
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
} );
support.focusin = "onfocusin" in window;
// Support: Firefox <=44
// Firefox doesn't have focus(in | out) events
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
//
// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
// focus(in | out) events fire after focus & blur events,
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
if ( !support.focusin ) {
jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler on the document while someone wants focusin/focusout
var handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
};
jQuery.event.special[ fix ] = {
setup: function() {
var doc = this.ownerDocument || this,
attaches = dataPriv.access( doc, fix );
if ( !attaches ) {
doc.addEventListener( orig, handler, true );
}
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
},
teardown: function() {
var doc = this.ownerDocument || this,
attaches = dataPriv.access( doc, fix ) - 1;
if ( !attaches ) {
doc.removeEventListener( orig, handler, true );
dataPriv.remove( doc, fix );
} else {
dataPriv.access( doc, fix, attaches );
}
}
};
} );
}
var location = window.location;
var nonce = jQuery.now();
var rquery = ( /\?/ );
// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
var xml;
if ( !data || typeof data !== "string" ) {
return null;
}
// Support: IE 9 - 11 only
// IE throws on parseFromString with invalid input.
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
} catch ( e ) {
xml = undefined;
}
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
};
var
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scalar (array or object), encode its numeric index.
buildParams(
prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
v,
traditional,
add
);
}
} );
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
// Serialize an array of form elements or a set of
// key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, valueOrFunction ) {
// If value is a function, invoke it and use its return value
var value = jQuery.isFunction( valueOrFunction ) ?
valueOrFunction() :
valueOrFunction;
s[ s.length ] = encodeURIComponent( key ) + "=" +
encodeURIComponent( value == null ? "" : value );
};
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
} );
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" );
};
jQuery.fn.extend( {
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map( function() {
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
} )
.filter( function() {
var type = this.type;
// Use .is( ":disabled" ) so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !rcheckableType.test( type ) );
} )
.map( function( i, elem ) {
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ) {
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
} ) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
} ).get();
}
} );
var
r20 = /%20/g,
rhash = /#.*$/,
rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat( "*" ),
// Anchor tag for parsing the document origin
originAnchor = document.createElement( "a" );
originAnchor.href = location.href;
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( ( dataType = dataTypes[ i++ ] ) ) {
// Prepend if requested
if ( dataType[ 0 ] === "+" ) {
dataType = dataType.slice( 1 ) || "*";
( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
// Otherwise append
} else {
( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
}
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if ( typeof dataTypeOrTransport === "string" &&
!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
} else if ( seekingTransport ) {
return !( selected = dataTypeOrTransport );
}
} );
return selected;
}
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
return target;
}
/* Handles responses to an ajax request:
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process
while ( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
/* Chain conversions given the request and the original response
* Also sets the responseXXX fields on the jqXHR instance
*/
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
current = dataTypes.shift();
// Convert to each sequential dataType
while ( current ) {
if ( s.responseFields[ current ] ) {
jqXHR[ s.responseFields[ current ] ] = response;
}
// Apply the dataFilter if provided
if ( !prev && isSuccess && s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
prev = current;
current = dataTypes.shift();
if ( current ) {
// There's only work to do if current dataType is non-auto
if ( current === "*" ) {
current = prev;
// Convert response if prev dataType is non-auto and differs from current
} else if ( prev !== "*" && prev !== current ) {
// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
// If none found, seek a pair
if ( !conv ) {
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split( " " );
if ( tmp[ 1 ] === current ) {
// If prev can be converted to accepted input
conv = converters[ prev + " " + tmp[ 0 ] ] ||
converters[ "* " + tmp[ 0 ] ];
if ( conv ) {
// Condense equivalence converters
if ( conv === true ) {
conv = converters[ conv2 ];
// Otherwise, insert the intermediate dataType
} else if ( converters[ conv2 ] !== true ) {
current = tmp[ 0 ];
dataTypes.unshift( tmp[ 1 ] );
}
break;
}
}
}
}
// Apply converter (if not an equivalence)
if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them
if ( conv && s.throws ) {
response = conv( response );
} else {
try {
response = conv( response );
} catch ( e ) {
return {
state: "parsererror",
error: conv ? e : "No conversion from " + prev + " to " + current
};
}
}
}
}
}
}
return { state: "success", data: response };
}
jQuery.extend( {
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajaxSettings: {
url: location.href,
type: "GET",
isLocal: rlocalProtocol.test( location.protocol ),
global: true,
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
throws: false,
traditional: false,
headers: {},
*/
accepts: {
"*": allTypes,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /\bxml\b/,
html: /\bhtml/,
json: /\bjson\b/
},
responseFields: {
xml: "responseXML",
text: "responseText",
json: "responseJSON"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": JSON.parse,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
url: true,
context: true
}
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
return settings ?
// Building a settings object
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
// Extending ajaxSettings
ajaxExtend( jQuery.ajaxSettings, target );
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var transport,
// URL without anti-cache param
cacheURL,
// Response headers
responseHeadersString,
responseHeaders,
// timeout handle
timeoutTimer,
// Url cleanup var
urlAnchor,
// Request state (becomes false upon send and true upon completion)
completed,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// uncached part of the url
uncached,
// Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context &&
( callbackContext.nodeType || callbackContext.jquery ) ?
jQuery( callbackContext ) :
jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks( "once memory" ),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// Default abort message
strAbort = "canceled",
// Fake xhr
jqXHR = {
readyState: 0,
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( completed ) {
if ( !responseHeaders ) {
responseHeaders = {};
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match == null ? null : match;
},
// Raw string
getAllResponseHeaders: function() {
return completed ? responseHeadersString : null;
},
// Caches the header
setRequestHeader: function( name, value ) {
if ( completed == null ) {
name = requestHeadersNames[ name.toLowerCase() ] =
requestHeadersNames[ name.toLowerCase() ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( completed == null ) {
s.mimeType = type;
}
return this;
},
// Status-dependent callbacks
statusCode: function( map ) {
var code;
if ( map ) {
if ( completed ) {
// Execute the appropriate callbacks
jqXHR.always( map[ jqXHR.status ] );
} else {
// Lazy-add the new callbacks in a way that preserves old ones
for ( code in map ) {
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
}
}
}
return this;
},
// Cancel the request
abort: function( statusText ) {
var finalText = statusText || strAbort;
if ( transport ) {
transport.abort( finalText );
}
done( 0, finalText );
return this;
}
};
// Attach deferreds
deferred.promise( jqXHR );
// Add protocol if not provided (prefilters might expect it)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || location.href ) + "" )
.replace( rprotocol, location.protocol + "//" );
// Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
// A cross-domain request is in order when the origin doesn't match the current origin.
if ( s.crossDomain == null ) {
urlAnchor = document.createElement( "a" );
// Support: IE <=8 - 11, Edge 12 - 13
// IE throws exception on accessing the href property if url is malformed,
// e.g. http://example.com:80x/
try {
urlAnchor.href = s.url;
// Support: IE <=8 - 11 only
// Anchor's host property isn't correctly set when s.url is relative
urlAnchor.href = urlAnchor.href;
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
urlAnchor.protocol + "//" + urlAnchor.host;
} catch ( e ) {
// If there is an error parsing the URL, assume it is crossDomain,
// it can be rejected by the transport if it is invalid
s.crossDomain = true;
}
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefilter, stop there
if ( completed ) {
return jqXHR;
}
// We can fire global events as of now if asked to
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
fireGlobals = jQuery.event && s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
}
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Save the URL in case we're toying with the If-Modified-Since
// and/or If-None-Match header later on
// Remove hash to simplify url manipulation
cacheURL = s.url.replace( rhash, "" );
// More options handling for requests with no content
if ( !s.hasContent ) {
// Remember the hash so we can put it back
uncached = s.url.slice( cacheURL.length );
// If data is available, append data to url
if ( s.data ) {
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Add anti-cache in uncached url if needed
if ( s.cache === false ) {
cacheURL = cacheURL.replace( rts, "" );
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
}
// Put hash and anti-cache on the URL that will be requested (gh-1732)
s.url = cacheURL + uncached;
// Change '%20' to '+' if this is encoded form body content (gh-2658)
} else if ( s.data && s.processData &&
( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
s.data = s.data.replace( r20, "+" );
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
if ( jQuery.etag[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
s.accepts[ s.dataTypes[ 0 ] ] +
( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend &&
( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
// Abort if not done already and return
return jqXHR.abort();
}
// Aborting is no longer a cancellation
strAbort = "abort";
// Install callbacks on deferreds
completeDeferred.add( s.complete );
jqXHR.done( s.success );
jqXHR.fail( s.error );
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// If request was aborted inside ajaxSend, stop there
if ( completed ) {
return jqXHR;
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = window.setTimeout( function() {
jqXHR.abort( "timeout" );
}, s.timeout );
}
try {
completed = false;
transport.send( requestHeaders, done );
} catch ( e ) {
// Rethrow post-completion exceptions
if ( completed ) {
throw e;
}
// Propagate others as results
done( -1, e );
}
}
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Ignore repeat invocations
if ( completed ) {
return;
}
completed = true;
// Clear timeout if it exists
if ( timeoutTimer ) {
window.clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
// Determine if successful
isSuccess = status >= 200 && status < 300 || status === 304;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// Convert no matter what (that way responseXXX fields are always set)
response = ajaxConvert( s, response, jqXHR, isSuccess );
// If successful, handle type chaining
if ( isSuccess ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
modified = jqXHR.getResponseHeader( "Last-Modified" );
if ( modified ) {
jQuery.lastModified[ cacheURL ] = modified;
}
modified = jqXHR.getResponseHeader( "etag" );
if ( modified ) {
jQuery.etag[ cacheURL ] = modified;
}
}
// if no content
if ( status === 204 || s.type === "HEAD" ) {
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
statusText = "notmodified";
// If we have data, let's convert it
} else {
statusText = response.state;
success = response.data;
error = response.error;
isSuccess = !error;
}
} else {
// Extract error from statusText and normalize for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger( "ajaxStop" );
}
}
}
return jqXHR;
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
}
} );
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// Shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
// The url can be an options object (which then must have .url)
return jQuery.ajax( jQuery.extend( {
url: url,
type: method,
dataType: type,
data: data,
success: callback
}, jQuery.isPlainObject( url ) && url ) );
};
} );
jQuery._evalUrl = function( url ) {
return jQuery.ajax( {
url: url,
// Make this explicit, since user can override this through ajaxSetup (#11264)
type: "GET",
dataType: "script",
cache: true,
async: false,
global: false,
"throws": true
} );
};
jQuery.fn.extend( {
wrapAll: function( html ) {
var wrap;
if ( this[ 0 ] ) {
if ( jQuery.isFunction( html ) ) {
html = html.call( this[ 0 ] );
}
// The elements to wrap the target around
wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
if ( this[ 0 ].parentNode ) {
wrap.insertBefore( this[ 0 ] );
}
wrap.map( function() {
var elem = this;
while ( elem.firstElementChild ) {
elem = elem.firstElementChild;
}
return elem;
} ).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each( function( i ) {
jQuery( this ).wrapInner( html.call( this, i ) );
} );
}
return this.each( function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
} );
},
wrap: function( html ) {
var isFunction = jQuery.isFunction( html );
return this.each( function( i ) {
jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
} );
},
unwrap: function( selector ) {
this.parent( selector ).not( "body" ).each( function() {
jQuery( this ).replaceWith( this.childNodes );
} );
return this;
}
} );
jQuery.expr.pseudos.hidden = function( elem ) {
return !jQuery.expr.pseudos.visible( elem );
};
jQuery.expr.pseudos.visible = function( elem ) {
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
};
jQuery.ajaxSettings.xhr = function() {
try {
return new window.XMLHttpRequest();
} catch ( e ) {}
};
var xhrSuccessStatus = {
// File protocol always yields status code 0, assume 200
0: 200,
// Support: IE <=9 only
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
xhrSupported = jQuery.ajaxSettings.xhr();
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
support.ajax = xhrSupported = !!xhrSupported;
jQuery.ajaxTransport( function( options ) {
var callback, errorCallback;
// Cross domain only allowed if supported through XMLHttpRequest
if ( support.cors || xhrSupported && !options.crossDomain ) {
return {
send: function( headers, complete ) {
var i,
xhr = options.xhr();
xhr.open(
options.type,
options.url,
options.async,
options.username,
options.password
);
// Apply custom fields if provided
if ( options.xhrFields ) {
for ( i in options.xhrFields ) {
xhr[ i ] = options.xhrFields[ i ];
}
}
// Override mime type if needed
if ( options.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( options.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
headers[ "X-Requested-With" ] = "XMLHttpRequest";
}
// Set headers
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
// Callback
callback = function( type ) {
return function() {
if ( callback ) {
callback = errorCallback = xhr.onload =
xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
if ( type === "abort" ) {
xhr.abort();
} else if ( type === "error" ) {
// Support: IE <=9 only
// On a manual native abort, IE9 throws
// errors on any property access that is not readyState
if ( typeof xhr.status !== "number" ) {
complete( 0, "error" );
} else {
complete(
// File: protocol always yields status 0; see #8605, #14207
xhr.status,
xhr.statusText
);
}
} else {
complete(
xhrSuccessStatus[ xhr.status ] || xhr.status,
xhr.statusText,
// Support: IE <=9 only
// IE9 has no XHR2 but throws on binary (trac-11426)
// For XHR2 non-text, let the caller handle it (gh-2498)
( xhr.responseType || "text" ) !== "text" ||
typeof xhr.responseText !== "string" ?
{ binary: xhr.response } :
{ text: xhr.responseText },
xhr.getAllResponseHeaders()
);
}
}
};
};
// Listen to events
xhr.onload = callback();
errorCallback = xhr.onerror = callback( "error" );
// Support: IE 9 only
// Use onreadystatechange to replace onabort
// to handle uncaught aborts
if ( xhr.onabort !== undefined ) {
xhr.onabort = errorCallback;
} else {
xhr.onreadystatechange = function() {
// Check readyState before timeout as it changes
if ( xhr.readyState === 4 ) {
// Allow onerror to be called first,
// but that will not handle a native abort
// Also, save errorCallback to a variable
// as xhr.onerror cannot be accessed
window.setTimeout( function() {
if ( callback ) {
errorCallback();
}
} );
}
};
}
// Create the abort callback
callback = callback( "abort" );
try {
// Do send the request (this may raise an exception)
xhr.send( options.hasContent && options.data || null );
} catch ( e ) {
// #14683: Only rethrow if this hasn't been notified as an error yet
if ( callback ) {
throw e;
}
}
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
} );
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
// Install script dataType
jQuery.ajaxSetup( {
accepts: {
script: "text/javascript, application/javascript, " +
"application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
} );
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
}
} );
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery( "<script>" ).prop( {
charset: s.scriptCharset,
src: s.url
} ).on(
"load error",
callback = function( evt ) {
script.remove();
callback = null;
if ( evt ) {
complete( evt.type === "error" ? 404 : 200, evt.type );
}
}
);
// Use native DOM manipulation to avoid our domManip AJAX trickery
document.head.appendChild( script[ 0 ] );
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
} );
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings
jQuery.ajaxSetup( {
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
this[ callback ] = true;
return callback;
}
} );
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" &&
( s.contentType || "" )
.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
rjsonp.test( s.data ) && "data"
);
// Handle iff the expected data type is "jsonp" or we have a parameter to set
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
s.jsonpCallback() :
s.jsonpCallback;
// Insert callback into url or form data
if ( jsonProp ) {
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
} else if ( s.jsonp !== false ) {
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
// Use data converter to retrieve json after script execution
s.converters[ "script json" ] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
return responseContainer[ 0 ];
};
// Force json dataType
s.dataTypes[ 0 ] = "json";
// Install callback
overwritten = window[ callbackName ];
window[ callbackName ] = function() {
responseContainer = arguments;
};
// Clean-up function (fires after converters)
jqXHR.always( function() {
// If previous value didn't exist - remove it
if ( overwritten === undefined ) {
jQuery( window ).removeProp( callbackName );
// Otherwise restore preexisting value
} else {
window[ callbackName ] = overwritten;
}
// Save back as free
if ( s[ callbackName ] ) {
// Make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
// Save the callback name for future use
oldCallbacks.push( callbackName );
}
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
overwritten( responseContainer[ 0 ] );
}
responseContainer = overwritten = undefined;
} );
// Delegate to script
return "script";
}
} );
// Support: Safari 8 only
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
// Because of that, this security measure has to be disabled in Safari 8.
// https://bugs.webkit.org/show_bug.cgi?id=137337
support.createHTMLDocument = ( function() {
var body = document.implementation.createHTMLDocument( "" ).body;
body.innerHTML = "<form></form><form></form>";
return body.childNodes.length === 2;
} )();
// Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context,
// defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
jQuery.parseHTML = function( data, context, keepScripts ) {
if ( typeof data !== "string" ) {
return [];
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
var base, parsed, scripts;
if ( !context ) {
// Stop scripts or inline event handlers from being executed immediately
// by using document.implementation
if ( support.createHTMLDocument ) {
context = document.implementation.createHTMLDocument( "" );
// Set the base href for the created document
// so any parsed elements with URLs
// are based on the document's URL (gh-2965)
base = context.createElement( "base" );
base.href = document.location.href;
context.head.appendChild( base );
} else {
context = document;
}
}
parsed = rsingleTag.exec( data );
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[ 1 ] ) ];
}
parsed = buildFragment( [ data ], context, scripts );
if ( scripts && scripts.length ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
};
/**
* Load a url into a page
*/
jQuery.fn.load = function( url, params, callback ) {
var selector, type, response,
self = this,
off = url.indexOf( " " );
if ( off > -1 ) {
selector = jQuery.trim( url.slice( off ) );
url = url.slice( 0, off );
}
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax( {
url: url,
// If "type" variable is undefined, then "GET" method will be used.
// Make value of this field explicit since
// user can override it through ajaxSetup method
type: type || "GET",
dataType: "html",
data: params
} ).done( function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}
return this;
};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [
"ajaxStart",
"ajaxStop",
"ajaxComplete",
"ajaxError",
"ajaxSuccess",
"ajaxSend"
], function( i, type ) {
jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn );
};
} );
jQuery.expr.pseudos.animated = function( elem ) {
return jQuery.grep( jQuery.timers, function( fn ) {
return elem === fn.elem;
} ).length;
};
/**
* Gets a window from an element
*/
function getWindow( elem ) {
return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
}
jQuery.offset = {
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
// Set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
curOffset = curElem.offset();
curCSSTop = jQuery.css( elem, "top" );
curCSSLeft = jQuery.css( elem, "left" );
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
// Need to be able to calculate position if either
// top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
}
if ( options.top != null ) {
props.top = ( options.top - curOffset.top ) + curTop;
}
if ( options.left != null ) {
props.left = ( options.left - curOffset.left ) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend( {
offset: function( options ) {
// Preserve chaining for setter
if ( arguments.length ) {
return options === undefined ?
this :
this.each( function( i ) {
jQuery.offset.setOffset( this, options, i );
} );
}
var docElem, win, rect, doc,
elem = this[ 0 ];
if ( !elem ) {
return;
}
// Support: IE <=11 only
// Running getBoundingClientRect on a
// disconnected node in IE throws an error
if ( !elem.getClientRects().length ) {
return { top: 0, left: 0 };
}
rect = elem.getBoundingClientRect();
// Make sure element is not hidden (display: none)
if ( rect.width || rect.height ) {
doc = elem.ownerDocument;
win = getWindow( doc );
docElem = doc.documentElement;
return {
top: rect.top + win.pageYOffset - docElem.clientTop,
left: rect.left + win.pageXOffset - docElem.clientLeft
};
}
// Return zeros for disconnected and hidden elements (gh-2310)
return rect;
},
position: function() {
if ( !this[ 0 ] ) {
return;
}
var offsetParent, offset,
elem = this[ 0 ],
parentOffset = { top: 0, left: 0 };
// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
// because it is its only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {
// Assume getBoundingClientRect is there when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
// Get *real* offsetParent
offsetParent = this.offsetParent();
// Get correct offsets
offset = this.offset();
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
// Add offsetParent borders
parentOffset = {
top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
};
}
// Subtract parent offsets and element margins
return {
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
};
},
// This method will return documentElement in the following cases:
// 1) For the element inside the iframe without offsetParent, this method will return
// documentElement of the parent window
// 2) For the hidden or detached element
// 3) For body or html element, i.e. in case of the html node - it will return itself
//
// but those exceptions were never presented as a real life use-cases
// and might be considered as more preferable results.
//
// This logic, however, is not guaranteed and can change at any point in the future
offsetParent: function() {
return this.map( function() {
var offsetParent = this.offsetParent;
while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || documentElement;
} );
}
} );
// Create scrollLeft and scrollTop methods
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
var top = "pageYOffset" === prop;
jQuery.fn[ method ] = function( val ) {
return access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? win[ prop ] : elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : win.pageXOffset,
top ? val : win.pageYOffset
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length );
};
} );
// Support: Safari <=7 - 9.1, Chrome <=37 - 49
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
// getComputedStyle returns percent when specified for top/left/bottom/right;
// rather than make the css module depend on the offset module, just check for it here
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// If curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
);
} );
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
function( defaultExtra, funcName ) {
// Margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
return funcName.indexOf( "outer" ) === 0 ?
elem[ "inner" + name ] :
elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
// whichever is greatest
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable );
};
} );
} );
jQuery.fn.extend( {
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
} );
jQuery.parseJSON = JSON.parse;
// Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that
// understands anonymous AMD modules. A named AMD is safest and most robust
// way to register. Lowercase jquery is used because AMD module names are
// derived from file names, and jQuery is normally delivered in a lowercase
// file name. Do this after creating the global so that if an AMD module wants
// to call noConflict to hide this version of jQuery, it will work.
// Note that for maximum portability, libraries that are not jQuery should
// declare themselves as anonymous modules, and avoid setting a global if an
// AMD loader is present. jQuery is a special case. For more information, see
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
if ( true ) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
return jQuery;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
var
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$;
jQuery.noConflict = function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
};
// Expose jQuery and $ identifiers, even in AMD
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566)
if ( !noGlobal ) {
window.jQuery = window.$ = jQuery;
}
return jQuery;
} ) );
/***/ },
/* 2 */
/***/ function(module, exports) {
module.exports = React;
/***/ },
/* 3 */
/***/ function(module, exports) {
module.exports = ReactDOM;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = __webpack_require__(2);
var HelloComponent = (function (_super) {
__extends(HelloComponent, _super);
function HelloComponent() {
_super.apply(this, arguments);
}
HelloComponent.prototype.render = function () {
return React.createElement("div", {className: this.props.class}, this.props.framework);
};
return HelloComponent;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = HelloComponent;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = __webpack_require__(2);
var LabelTextbox = (function (_super) {
__extends(LabelTextbox, _super);
function LabelTextbox() {
_super.apply(this, arguments);
}
LabelTextbox.prototype.update = function (event) {
var model = this.props.model;
var box = this.refs["box"];
model.UserId = box.value;
this.setState({ value: event.target.value });
};
LabelTextbox.prototype.render = function () {
var _this = this;
var classes = 'lb-txt ' + this.props.class;
var model = this.props.model;
return React.createElement("div", {className: classes}, React.createElement("div", {className: "label"}, this.props.label), React.createElement("div", {className: "txt-container"}, React.createElement("input", {ref: "box", className: "txt", type: this.props.type, onChange: function (e) { return _this.update(e); }, value: model.UserId})));
};
return LabelTextbox;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = LabelTextbox;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var validation_1 = __webpack_require__(7);
var validation_2 = __webpack_require__(7);
var validation_3 = __webpack_require__(7);
var WebUser = (function () {
function WebUser(userId, pwd) {
this.UserId = userId;
this.Pwd = pwd;
}
WebUser.prototype.validate = function () {
return validation_3.validate(this)[0];
};
__decorate([
validation_1.required
], WebUser.prototype, "UserId", void 0);
__decorate([
validation_1.required
], WebUser.prototype, "Pwd", void 0);
WebUser = __decorate([
validation_2.validatable
], WebUser);
return WebUser;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = WebUser;
/***/ },
/* 7 */
/***/ function(module, exports) {
"use strict";
function validatable(target) {
console.log("Validatable class annotation reached");
}
exports.validatable = validatable;
function init(target) {
if (!target.validators) {
target.validators = [];
}
}
function required(target, prop) {
console.log("Required property annotation reached");
init(target);
target.validators.push(function (modelErrors) {
if (!!this[prop]) {
modelErrors.push(prop.toString().concat(' validation success!'));
return true;
}
else {
modelErrors.push(prop.toString().concat(' cannot be empty!'));
return false;
}
});
}
exports.required = required;
function validate(target) {
var rlt = true;
var modelErrors = [];
if (target.validators != null && target.validators.length > 0) {
for (var _i = 0, _a = target.validators; _i < _a.length; _i++) {
var v = _a[_i];
rlt = v.call(target, modelErrors) && rlt;
}
}
console.log(modelErrors);
return [rlt, modelErrors];
}
exports.validate = validate;
/***/ }
/******/ ]);
//# sourceMappingURL=demo.bundle.js.map | Java |
export hom, hom_check
"""
`hom_check(G,H,d)` checks if the dictionary `d` is a graph homomorphism
from `G` to `H`.
"""
function hom_check(G::SimpleGraph, H::SimpleGraph, d::Dict)::Bool
for e in G.E
v, w = e
x = d[v]
y = d[w]
if !H[x, y]
return false
end
end
return true
end
"""
`hom(G,H)` finds a graph homomorphism from `G` to `H`.
"""
function hom(G::SimpleGraph{S}, H::SimpleGraph{T}) where {S,T}
m = Model(get_solver())
@variable(m, P[G.V, H.V], Bin)
for v in G.V
@constraint(m, sum(P[v, x] for x in H.V) == 1)
end
for e in G.E
u, v = e
for x in H.V
for y in H.V
if !H[x, y]
@constraint(m, P[u, x] + P[v, y] <= 1)
end
end
end
end
optimize!(m)
status = Int(termination_status(m))
if status != 1
error("No homomorphism")
end
PP = Int.(value.(P))
result = Dict{S,T}()
for v in G.V
for x in H.V
if PP[v, x] > 0
result[v] = x
end
end
end
return result
end
| Java |
"""Auto-generated file, do not edit by hand. BG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BG = PhoneMetadata(id='BG', country_code=359, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[23567]\\d{5,7}|[489]\\d{6,8}', possible_number_pattern='\\d{5,9}'),
fixed_line=PhoneNumberDesc(national_number_pattern='2(?:[0-8]\\d{5,6}|9\\d{4,6})|(?:[36]\\d|5[1-9]|8[1-6]|9[1-7])\\d{5,6}|(?:4(?:[124-7]\\d|3[1-6])|7(?:0[1-9]|[1-9]\\d))\\d{4,5}', possible_number_pattern='\\d{5,8}', example_number='2123456'),
mobile=PhoneNumberDesc(national_number_pattern='(?:8[7-9]|98)\\d{7}|4(?:3[0789]|8\\d)\\d{5}', possible_number_pattern='\\d{8,9}', example_number='48123456'),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{5}', possible_number_pattern='\\d{8}', example_number='80012345'),
premium_rate=PhoneNumberDesc(national_number_pattern='90\\d{6}', possible_number_pattern='\\d{8}', example_number='90123456'),
shared_cost=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
personal_number=PhoneNumberDesc(national_number_pattern='700\\d{5}', possible_number_pattern='\\d{5,9}', example_number='70012345'),
voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
emergency=PhoneNumberDesc(national_number_pattern='1(?:12|50|6[06])', possible_number_pattern='\\d{3}', example_number='112'),
voicemail=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
short_code=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
standard_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(2)(\\d{5})', format='\\1 \\2', leading_digits_pattern=['29'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(2)(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['2'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['43[124-7]|70[1-9]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['43[124-7]|70[1-9]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[78]00'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,3})', format='\\1 \\2 \\3', leading_digits_pattern=['[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['48|8[7-9]|9[08]'], national_prefix_formatting_rule='0\\1')])
| Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.