text
stringlengths 2
99.9k
| meta
dict |
---|---|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.239
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace EmbeddedPSConsole.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EmbeddedPSConsole.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* TLS-Attacker - A Modular Penetration Testing Framework for TLS
*
* Copyright 2014-2020 Ruhr University Bochum, Paderborn University,
* and Hackmanit GmbH
*
* Licensed under Apache License 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package de.rub.nds.tlsattacker.core.config.delegate;
import com.beust.jcommander.JCommander;
import de.rub.nds.tlsattacker.core.config.Config;
import org.apache.commons.lang3.builder.EqualsBuilder;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
public class DynamicWorkflowDelegateTest {
private DynamicWorkflowDelegate delegate;
private JCommander jcommander;
private String[] args;
@Before
public void setUp() {
this.delegate = new DynamicWorkflowDelegate();
this.jcommander = new JCommander(delegate);
}
/**
* Test of isDynamicWorkflow method, of class DynamicWorkflowDelegate.
*/
@Test(expected = UnsupportedOperationException.class)
public void testIsDynamicWorkflow() {
args = new String[1];
args[0] = "-dynamic_workflow";
assertTrue(delegate.isDynamicWorkflow() == null);
jcommander.parse(args);
assertTrue(delegate.isDynamicWorkflow());
}
/**
* Test of setDynamicWorkflow method, of class DynamicWorkflowDelegate.
*/
@Test(expected = UnsupportedOperationException.class)
public void testSetDynamicWorkflow() {
assertTrue(delegate.isDynamicWorkflow() == null);
delegate.setDynamicWorkflow(true);
assertTrue(delegate.isDynamicWorkflow());
}
/**
* Test of applyDelegate method, of class DynamicWorkflowDelegate.
*/
@Test(expected = UnsupportedOperationException.class)
public void testApplyDelegate() {
Config config = Config.createConfig();
config.setDynamicWorkflow(false);
args = new String[1];
args[0] = "-dynamic_workflow";
jcommander.parse(args);
delegate.applyDelegate(config);
assertTrue(config.isDynamicWorkflow());
}
@Test(expected = UnsupportedOperationException.class)
public void testNothingSetNothingChanges() {
Config config = Config.createConfig();
Config config2 = Config.createConfig();
delegate.applyDelegate(config);
assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate"));// little
// ugly
}
}
| {
"pile_set_name": "Github"
} |
package compute
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualMachineExtensionsClient is the compute Client
type VirtualMachineExtensionsClient struct {
ManagementClient
}
// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update the extension. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP
// requests.
//
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension
// should be create or updated. VMExtensionName is the name of the virtual machine extension. extensionParameters is
// parameters supplied to the Create Virtual Machine Extension operation.
func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (<-chan VirtualMachineExtension, <-chan error) {
resultChan := make(chan VirtualMachineExtension, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result VirtualMachineExtension
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
close(resultChan)
close(errChan)
}()
req, err := client.CreateOrUpdatePreparer(resourceGroupName, VMName, VMExtensionName, extensionParameters, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoRetryWithRegistration(client.Client),
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete the operation to delete the extension. This method may poll for completion. Polling can be canceled by
// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension
// should be deleted. VMExtensionName is the name of the virtual machine extension.
func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VMName string, VMExtensionName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result OperationStatusResponse
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
close(resultChan)
close(errChan)
}()
req, err := client.DeletePreparer(resourceGroupName, VMName, VMExtensionName, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// DeletePreparer prepares the Delete request.
func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName string, VMName string, VMExtensionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoRetryWithRegistration(client.Client),
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get the operation to get the extension.
//
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine containing the
// extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to apply on
// the operation.
func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
req, err := client.GetPreparer(resourceGroupName, VMName, VMExtensionName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
| {
"pile_set_name": "Github"
} |
#pragma once
#include <BsPrerequisites.h>
#include <RTTI/RTTIUtil.hpp>
#include <Scene/BsComponent.h>
#include <scripting/ScriptTypes.hpp>
namespace REGoth
{
namespace Scripting
{
class ScriptVMForGameWorld;
struct ScriptObject;
} // namespace Scripting
class GameWorld;
using HGameWorld = bs::GameObjectHandle<GameWorld>;
/**
* Base-component for components which need to be closely related to a script object.
*
* For example, an Item would have a component, a visual, and so on, but also have
* a script object which is initialized by scripts. So in order to a safe interface
* between the component and the script object, this class links them together.
*
* The script object linked to the ScriptBackedBy-component will be called *Backing
* Script Object*.
*
* Initialization
* ==============
*
* Via the constructor, the class inheriting from the ScriptBackedBy-component
* defines the class the backing script object should have. A script object of that
* class is then instantiated inside the `onInitialized()`-method, so be sure to
* call it if you're overriding it in the inheriting class!
*
*
* Serialization Strategy
* ======================
*
* To have this component properly serialized, we need to also make sure that the
* script object handle will stay valid after loading. Therefore, it is crucial that
* the ScriptObjectStorage is also serialized and all handles stay the same.
*
* When loading the object again, we have to hope our handle stayed the same and will
* skip creating a new instance of the backing script object inside `onInitialized()`.
*/
class ScriptBackedBy : public bs::Component
{
public:
ScriptBackedBy(const bs::HSceneObject& parent, const bs::String& className,
const bs::String& instance, HGameWorld gameWorld);
virtual ~ScriptBackedBy();
protected:
void onInitialized() override;
void onDestroyed() override;
/**
* @return Script object backing this component.
*
* Throws if it does not exist.
*/
Scripting::ScriptObject& scriptObjectData() const;
/**
* @return Handle of the script object backing this component.
*/
Scripting::ScriptObjectHandle scriptObject() const
{
return mScriptObject;
}
/**
* @return Script instance this was created from, e.g. `ITLSTORCH`.
*/
const bs::String& scriptInstanceName() const
{
return mScriptInstance;
}
/**
* @return Access to the script VM
*/
Scripting::ScriptVMForGameWorld& scriptVM() const;
/**
* @return Whether we already have instantiated a script object.
*/
bool hasInstantiatedScriptObject() const;
/**
* @return GameWorld this scene object is in.
*/
HGameWorld gameWorld() const
{
return mGameWorld;
}
private:
/**
* Instanciates the class backing this component. Must be called early, otherwise
* exceptions will be thrown when accessing the script object data.
*
* Throws if the class or instance doesn't exist.
*
* @param className Class to instanciate the object from, e.g. `C_ITEM`.
* @param instance Instance-name to instanciate, e.g. `ITFO_APPLE`.
*/
void instantiateScriptObject(const bs::String& className, const bs::String& instance);
/**
* Script object backing this item
*/
Scripting::ScriptObjectHandle mScriptObject = Scripting::SCRIPT_OBJECT_HANDLE_INVALID;
bs::String mScriptClassName;
bs::String mScriptInstance;
HGameWorld mGameWorld;
public:
REGOTH_DECLARE_RTTI(ScriptBackedBy)
protected:
ScriptBackedBy() = default; // For RTTI
};
} // namespace REGoth
| {
"pile_set_name": "Github"
} |
# repair_design max_fanout hands off special nets
source helpers.tcl
read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_def repair_fanout2.def
set_max_fanout 10 [current_design]
repair_design -buffer_cell BUF_X1
| {
"pile_set_name": "Github"
} |
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 [email protected]
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0.
You may use XOWA according to either of these licenses as is most appropriate
for your project on a case-by-case basis.
The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/
package gplx.xowa.langs.bldrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.xowa.langs.*;
public class Xob_i18n_parser {
public static void Load_msgs(boolean dirty, Xol_lang_itm lang, Io_url i18n_fil) {
String i18n_str = Io_mgr.Instance.LoadFilStr_args(i18n_fil).MissingIgnored_().Exec(); if (String_.Len_eq_0(i18n_str)) return;
Json_itm_wkr__msgs wkr = new Json_itm_wkr__msgs();
wkr.Ctor(dirty, lang.Msg_mgr());
wkr.Exec(Bry_.new_u8(i18n_str));
}
public static byte[] Xto_gfs(byte[] raw) {
Json_itm_wkr__gfs wkr = new Json_itm_wkr__gfs();
wkr.Exec(raw);
return wkr.Xto_bry();
}
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
@class NSString;
@interface FavURLItem : NSObject
{
NSString *_title;
NSString *_description;
NSString *_cleanUrl;
NSString *_thumbUrl;
int _openCache;
unsigned int _contentAttributeBitSetFlag;
NSString *_canvasInfoXml;
}
@property(retain, nonatomic) NSString *canvasInfoXml; // @synthesize canvasInfoXml=_canvasInfoXml;
@property(nonatomic) unsigned int contentAttributeBitSetFlag; // @synthesize contentAttributeBitSetFlag=_contentAttributeBitSetFlag;
@property(nonatomic) int openCache; // @synthesize openCache=_openCache;
@property(retain, nonatomic) NSString *thumbUrl; // @synthesize thumbUrl=_thumbUrl;
@property(retain, nonatomic) NSString *cleanUrl; // @synthesize cleanUrl=_cleanUrl;
@property(retain, nonatomic) NSString *description; // @synthesize description=_description;
@property(retain, nonatomic) NSString *title; // @synthesize title=_title;
- (void).cxx_destruct;
- (void)setContentOriginal:(_Bool)arg1;
- (_Bool)isContentOriginal;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)init;
@end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2017 Icenowy Zheng <[email protected]>
* Copyright (C) 2017 Jagan Teki <[email protected]>
*
* This file is dual-licensed: you can use it either under the terms
* of the GPL or the X11 license, at your option. Note that this dual
* licensing only applies to this file, and not this project as a
* whole.
*
* a) This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Or, alternatively,
*
* b) 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.
*/
/dts-v1/;
#include "sun50i-h5.dtsi"
#include <dt-bindings/gpio/gpio.h>
/ {
model = "FriendlyARM NanoPi NEO 2";
compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
aliases {
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
reg_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
};
&mmc0 {
compatible = "allwinner,sun50i-h5-mmc",
"allwinner,sun50i-a64-mmc",
"allwinner,sun5i-a13-mmc";
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
vmmc-supply = <®_vcc3v3>;
bus-width = <4>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
| {
"pile_set_name": "Github"
} |
export const PI = 3.141592;
var _sqrt = function(s, x, last){
return x != last ? _sqrt(s, (x + s / x) / 2.0, x) : x;
};
export function sqrt(s){
return _sqrt(s, s/2.0, 0.0);
};
export function square(x) {
return x * x;
};
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_02) on Tue Jul 01 09:51:08 CEST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>ProjectSourceSet (Gradle API 2.0)</title>
<meta name="date" content="2014-07-01">
<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ProjectSourceSet (Gradle API 2.0)";
}
//-->
</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-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/gradle/language/base/LanguageSourceSet.html" title="interface in org.gradle.language.base"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/gradle/language/base/ProjectSourceSet.html" target="_top">Frames</a></li>
<li><a href="ProjectSourceSet.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>Method</li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li>Method</li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.gradle.language.base</div>
<h2 title="Interface ProjectSourceSet" class="title">Interface ProjectSourceSet</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, org.gradle.util.Configurable<<a href="../../../../org/gradle/api/NamedDomainObjectContainer.html" title="interface in org.gradle.api">NamedDomainObjectContainer</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>>, <a href="../../../../org/gradle/api/DomainObjectCollection.html" title="interface in org.gradle.api">DomainObjectCollection</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html" title="interface in org.gradle.api">NamedDomainObjectCollection</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html" title="interface in org.gradle.api">NamedDomainObjectContainer</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, <a href="../../../../org/gradle/api/NamedDomainObjectSet.html" title="interface in org.gradle.api">NamedDomainObjectSet</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>></dd>
</dl>
<hr>
<br>
<pre><a href="../../../../org/gradle/api/Incubating.html" title="annotation in org.gradle.api">@Incubating</a>
public interface <span class="strong">ProjectSourceSet</span>
extends <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html" title="interface in org.gradle.api">NamedDomainObjectContainer</a><<a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base">FunctionalSourceSet</a>></pre>
<div class="block">A container of <a href="../../../../org/gradle/language/base/FunctionalSourceSet.html" title="interface in org.gradle.language.base"><code>FunctionalSourceSet</code></a>s. Added to a project by the
<a href="../../../../org/gradle/language/base/plugins/LanguageBasePlugin.html" title="class in org.gradle.language.base.plugins"><code>LanguageBasePlugin</code></a>.</div>
</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>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.gradle.api.NamedDomainObjectContainer">
<!-- -->
</a>
<h3>Methods inherited from interface org.gradle.api.<a href="../../../../org/gradle/api/NamedDomainObjectContainer.html" title="interface in org.gradle.api">NamedDomainObjectContainer</a></h3>
<code><a href="../../../../org/gradle/api/NamedDomainObjectContainer.html#configure(groovy.lang.Closure)">configure</a>, <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html#create(java.lang.String)">create</a>, <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html#create(java.lang.String, org.gradle.api.Action)">create</a>, <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html#create(java.lang.String, groovy.lang.Closure)">create</a>, <a href="../../../../org/gradle/api/NamedDomainObjectContainer.html#maybeCreate(java.lang.String)">maybeCreate</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.gradle.api.NamedDomainObjectSet">
<!-- -->
</a>
<h3>Methods inherited from interface org.gradle.api.<a href="../../../../org/gradle/api/NamedDomainObjectSet.html" title="interface in org.gradle.api">NamedDomainObjectSet</a></h3>
<code><a href="../../../../org/gradle/api/NamedDomainObjectSet.html#findAll(groovy.lang.Closure)">findAll</a>, <a href="../../../../org/gradle/api/NamedDomainObjectSet.html#matching(groovy.lang.Closure)">matching</a>, <a href="../../../../org/gradle/api/NamedDomainObjectSet.html#matching(org.gradle.api.specs.Spec)">matching</a>, <a href="../../../../org/gradle/api/NamedDomainObjectSet.html#withType(java.lang.Class)">withType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.gradle.api.NamedDomainObjectCollection">
<!-- -->
</a>
<h3>Methods inherited from interface org.gradle.api.<a href="../../../../org/gradle/api/NamedDomainObjectCollection.html" title="interface in org.gradle.api">NamedDomainObjectCollection</a></h3>
<code><a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#add(T)">add</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#addAll(java.util.Collection)">addAll</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#addRule(org.gradle.api.Rule)">addRule</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#addRule(java.lang.String, groovy.lang.Closure)">addRule</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#findByName(java.lang.String)">findByName</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getAsMap()">getAsMap</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getAt(java.lang.String)">getAt</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getByName(java.lang.String)">getByName</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getByName(java.lang.String, groovy.lang.Closure)">getByName</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getNamer()">getNamer</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getNames()">getNames</a>, <a href="../../../../org/gradle/api/NamedDomainObjectCollection.html#getRules()">getRules</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.gradle.api.DomainObjectCollection">
<!-- -->
</a>
<h3>Methods inherited from interface org.gradle.api.<a href="../../../../org/gradle/api/DomainObjectCollection.html" title="interface in org.gradle.api">DomainObjectCollection</a></h3>
<code><a href="../../../../org/gradle/api/DomainObjectCollection.html#all(org.gradle.api.Action)">all</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#all(groovy.lang.Closure)">all</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#whenObjectAdded(org.gradle.api.Action)">whenObjectAdded</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#whenObjectAdded(groovy.lang.Closure)">whenObjectAdded</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#whenObjectRemoved(org.gradle.api.Action)">whenObjectRemoved</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#whenObjectRemoved(groovy.lang.Closure)">whenObjectRemoved</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#withType(java.lang.Class, org.gradle.api.Action)">withType</a>, <a href="../../../../org/gradle/api/DomainObjectCollection.html#withType(java.lang.Class, groovy.lang.Closure)">withType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.util.Collection">
<!-- -->
</a>
<h3>Methods inherited from interface java.util.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></h3>
<code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#clear()" title="class or interface in java.util">clear</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util">contains</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#iterator()" title="class or interface in java.util">iterator</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#size()" title="class or interface in java.util">size</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#toArray()" title="class or interface in java.util">toArray</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.util.Set">
<!-- -->
</a>
<h3>Methods inherited from interface java.util.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a></h3>
<code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#add(E)" title="class or interface in java.util">add</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util">addAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#clear()" title="class or interface in java.util">clear</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util">contains</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#iterator()" title="class or interface in java.util">iterator</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#size()" title="class or interface in java.util">size</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#toArray()" title="class or interface in java.util">toArray</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</a></code></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-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/gradle/language/base/LanguageSourceSet.html" title="interface in org.gradle.language.base"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/gradle/language/base/ProjectSourceSet.html" target="_top">Frames</a></li>
<li><a href="ProjectSourceSet.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>Method</li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li>Method</li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"pile_set_name": "Github"
} |
package org.knowm.xchange.coinfloor.dto.trade;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.Order.OrderType;
public class CoinfloorOrder {
private final long id;
private final String datetime;
// 0 - buy, 1 - sell
private final int type;
private final BigDecimal price;
private final BigDecimal amount;
// this is used by the CoinfloorTradeService to temporarily store details of the currency pair
private CurrencyPair pair = null;
public CoinfloorOrder(
@JsonProperty("status") String status,
@JsonProperty("reason") Object reason,
@JsonProperty("id") int id,
@JsonProperty("datetime") String datetime,
@JsonProperty("type") int type,
@JsonProperty("price") BigDecimal price,
@JsonProperty("amount") BigDecimal amount) {
this.id = id;
this.datetime = datetime;
this.type = type;
this.price = price;
this.amount = amount;
}
public String getDatetime() {
return datetime;
}
public long getId() {
return id;
}
public int getType() {
return type;
}
public OrderType getSide() {
switch (type) {
case 0:
return OrderType.BID;
case 1:
return OrderType.ASK;
default:
return null;
}
}
public BigDecimal getPrice() {
return price;
}
public BigDecimal getAmount() {
return amount;
}
public CurrencyPair getCurrencyPair() {
return pair;
}
public void setCurrencyPair(CurrencyPair value) {
pair = value;
}
@Override
public String toString() {
return String.format(
"Order{id=%s, datetime=%s, side=%s, price=%s, amount=%s}",
id, datetime, getSide(), price, amount);
}
}
| {
"pile_set_name": "Github"
} |
Testing for single tests:
PYTHONPATH=$PYTHONPATH:$(pwd -P)/lib python3 -m unittest cdist.test.test_install.Install.test_explorer_ran
| {
"pile_set_name": "Github"
} |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <[email protected]>
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info
if version_info[0:2] < (2, 6):
def bin(value):
bitstring = []
if value > 0:
prefix = '0b'
elif value < 0:
prefix = '-0b'
value = abs(value)
else:
prefix = '0b0'
while value:
if value & 1 == 1:
bitstring.append('1')
else:
bitstring.append('0')
value >>= 1
bitstring.reverse()
return prefix + ''.join(bitstring)
else:
bin = bin
| {
"pile_set_name": "Github"
} |
module.exports = function equipment() {
return {
equipment: [
{ name: 'PC', value: 10211 },
{ name: 'Android', value: 6111 },
{ name: 'Iphone', value: 7711 },
{ name: '其他', value: 3711 },
],
channel: [
{ name: '合作方', value: 9400 },
{ name: '核算', value: 7400 },
{ name: '自营', value: 5400 },
{ name: '其它', value: 3400 },
],
};
};
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// *Preprocessed* version of the main "reverse_fold_impl.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl { namespace aux {
/// forward declaration
template<
long N
, typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_impl;
template< long N >
struct reverse_fold_chunk;
template<> struct reverse_fold_chunk<0>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef fwd_state0 bkwd_state0;
typedef bkwd_state0 state;
typedef iter0 iterator;
};
};
template<> struct reverse_fold_chunk<1>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef fwd_state1 bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter1 iterator;
};
};
template<> struct reverse_fold_chunk<2>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef fwd_state2 bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter2 iterator;
};
};
template<> struct reverse_fold_chunk<3>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef fwd_state3 bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter3 iterator;
};
};
template<> struct reverse_fold_chunk<4>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
typedef typename mpl::next<iter3>::type iter4;
typedef fwd_state4 bkwd_state4;
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter4 iterator;
};
};
template< long N >
struct reverse_fold_chunk
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
typedef typename mpl::next<iter3>::type iter4;
typedef reverse_fold_impl<
( (N - 4) < 0 ? 0 : N - 4 )
, iter4
, Last
, fwd_state4
, BackwardOp
, ForwardOp
> nested_chunk;
typedef typename nested_chunk::state bkwd_state4;
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef typename nested_chunk::iterator iterator;
};
};
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_step;
template<
typename Last
, typename State
>
struct reverse_fold_null_step
{
typedef Last iterator;
typedef State state;
};
template<>
struct reverse_fold_chunk< -1 >
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef typename if_<
typename is_same< First,Last >::type
, reverse_fold_null_step< Last,State >
, reverse_fold_step< First,Last,State,BackwardOp,ForwardOp >
>::type res_;
typedef typename res_::state state;
typedef typename res_::iterator iterator;
};
};
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_step
{
typedef reverse_fold_chunk< -1 >::template result_<
typename mpl::next<First>::type
, Last
, typename apply2<ForwardOp,State, typename deref<First>::type>::type
, BackwardOp
, ForwardOp
> nested_step;
typedef typename apply2<
BackwardOp
, typename nested_step::state
, typename deref<First>::type
>::type state;
typedef typename nested_step::iterator iterator;
};
template<
long N
, typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_impl
: reverse_fold_chunk<N>
::template result_< First,Last,State,BackwardOp,ForwardOp >
{
};
}}}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!-- Written by Eclipse BIRT 2.0 -->
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.1.2.v20070205-1728 Build <20070205-1728></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2006 <<Your Company Name here>></property>
<method name="beforeFactory"><![CDATA[importPackage(Packages.org.eclipse.birt.report.model.api);
importPackage(Packages.org.eclipse.birt.report.model.api.elements);
delm = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("QTYELEMENT");
mr = StructureFactory.createMapRule();
mr.setTestExpression("row[\"QUANTITYORDERED\"]");
mr.setOperator(DesignChoiceConstants.MAP_OPERATOR_GT);
mr.setValue1("40");
mr.setDisplay("A lot");
ph = delm.getPropertyHandle(StyleHandle.MAP_RULES_PROP);
ph.addItem(mr);]]></method>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="4">
<text-property name="displayName"></text-property>
<property name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver</property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
<encrypted-property name="odaPassword"></encrypted-property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="Data Set" id="5">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<property name="queryText">select *
from orderdetails</property>
<xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="detail" id="40">
<property name="backgroundColor">#FFFF80</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
</style>
<style name="headerfooter" id="41">
<property name="backgroundColor">#004080</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
<style name="groupheader" id="42">
<property name="backgroundColor">#0080FF</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table name="table1" id="6">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<expression name="expression">dataSetRow["ORDERNUMBER"]</expression>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<expression name="expression">dataSetRow["PRODUCTCODE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<expression name="expression">dataSetRow["QUANTITYORDERED"]</expression>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<expression name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<expression name="expression">dataSetRow["ORDERLINENUMBER"]</expression>
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="35"/>
<column id="36"/>
<column id="37"/>
<column id="38"/>
<column id="39"/>
<header>
<row id="7">
<property name="style">headerfooter</property>
<cell id="8">
<label id="9">
<text-property name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="10">
<label id="11">
<text-property name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="12">
<label id="13">
<text-property name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="18">
<property name="style">detail</property>
<cell id="19">
<data id="20">
<property name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="21">
<data id="22">
<property name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="23">
<data name="QTYELEMENT" id="24">
<property name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="25">
<data id="26">
<property name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="27">
<data id="28">
<property name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="29">
<property name="style">headerfooter</property>
<cell id="30"/>
<cell id="31"/>
<cell id="32"/>
<cell id="33"/>
<cell id="34"/>
</row>
</footer>
</table>
</body>
</report>
| {
"pile_set_name": "Github"
} |
\\ |..| .. //
/~ / /=
< <= > >=
+ - *
^ = ~
----------------------------------------------------
[
["operator", "\\\\"], ["operator", "|..|"], ["operator", ".."], ["operator", "//"],
["operator", "/~"], ["operator", "/"], ["operator", "/="],
["operator", "<"], ["operator", "<="], ["operator", ">"], ["operator", ">="],
["operator", "+"], ["operator", "-"], ["operator", "*"],
["operator", "^"], ["operator", "="], ["operator", "~"]
]
----------------------------------------------------
Checks for all operators | {
"pile_set_name": "Github"
} |
fun bar(o: Any): String {
return o as <caret>
}
| {
"pile_set_name": "Github"
} |
.\" **************************************************************************
.\" * _ _ ____ _
.\" * Project ___| | | | _ \| |
.\" * / __| | | | |_) | |
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <[email protected]>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
.\" *
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
.\" * copies of the Software, and permit persons to whom the Software is
.\" * furnished to do so, under the terms of the COPYING file.
.\" *
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
.\" * KIND, either express or implied.
.\" *
.\" **************************************************************************
.\"
.TH CURLOPT_EXPECT_100_TIMEOUT_MS 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
.SH NAME
CURLOPT_EXPECT_100_TIMEOUT_MS \- timeout for Expect: 100-continue response
.SH SYNOPSIS
.nf
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_EXPECT_100_TIMEOUT_MS,
long milliseconds);
.SH DESCRIPTION
Pass a long to tell libcurl the number of \fImilliseconds\fP to wait for a
server response with the HTTP status 100 (Continue), 417 (Expectation Failed)
or similar after sending a HTTP request containing an Expect: 100-continue
header. If this times out before a response is received, the request body is
sent anyway.
.SH DEFAULT
1000 milliseconds
.SH PROTOCOLS
HTTP
.SH EXAMPLE
TODO
.SH AVAILABILITY
Added in 7.36.0
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"
.BR CURLOPT_POST "(3), " CURLOPT_HTTPPOST "(3), "
| {
"pile_set_name": "Github"
} |
/*
Original highlight.js style (c) Ivan Sagalaev <[email protected]>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #BC6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78A960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HITransactionPopoverViewController">
<connections>
<outlet property="amountField" destination="A3b-sP-EFa" id="kC4-pB-gme"/>
<outlet property="confirmationsField" destination="hsi-lm-tcr" id="OYe-fS-ccM"/>
<outlet property="detailsField" destination="9qm-gK-hKY" id="g5N-Gw-jBX"/>
<outlet property="exchangeRateField" destination="X6s-Km-rIl" id="wLX-HK-Yfk"/>
<outlet property="recipientField" destination="Lus-Rl-2Lz" id="4PV-za-gFJ"/>
<outlet property="separatorAboveMetadataFields" destination="baj-gE-QEV" id="onY-dj-8mn"/>
<outlet property="shareButton" destination="NIe-Cw-BCJ" id="a6d-l8-AGU"/>
<outlet property="statusField" destination="z9Z-Zh-1fV" id="cGN-LW-MFY"/>
<outlet property="targetAddressField" destination="REV-aW-GWK" id="on0-85-CFe"/>
<outlet property="targetAddressLabel" destination="QdT-Oh-DCh" id="I4i-9y-T3A"/>
<outlet property="transactionIdField" destination="t1e-4W-2oE" id="49d-uJ-eFD"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="330" height="409"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Cgc-kK-Z68">
<rect key="frame" x="18" y="372" width="103" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Transaction ID:" id="2hR-33-nwC">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="t1e-4W-2oE">
<rect key="frame" x="18" y="332" width="294" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" selectable="YES" sendsActionOnEndEditing="YES" title="<9a3785e972d7f62af0e047911b5c991480a9a0cb9bf37dab4dfe9c46deca19c2>" id="Zfp-mP-dB5">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TPU-Gl-Q4M">
<rect key="frame" x="18" y="266" width="50" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Status:" id="uRB-Vb-JTA">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="z9Z-Zh-1fV">
<rect key="frame" x="72" y="266" width="71" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="<pending>" id="8ax-jV-4P7">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6B8-Wf-FKF">
<rect key="frame" x="18" y="241" width="101" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Confirmations:" id="x54-St-kEH">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hsi-lm-tcr">
<rect key="frame" x="123" y="241" width="28" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="<0>" id="xfw-5n-2IU">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="1Ak-no-qRW">
<rect key="frame" x="12" y="293" width="306" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5av-kV-hd8">
<rect key="frame" x="20" y="307" width="161" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="Show on blockchain.info..." bezelStyle="inline" alignment="center" refusesFirstResponder="YES" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Lay-eO-8hN">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
</buttonCell>
<connections>
<action selector="showOnBlockchainInfoClicked:" target="-2" id="7aa-Jy-Mfu"/>
</connections>
</button>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="baj-gE-QEV">
<rect key="frame" x="12" y="226" width="306" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="107" translatesAutoresizingMaskIntoConstraints="NO" id="QdT-Oh-DCh">
<rect key="frame" x="18" y="124" width="105" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Target address:" placeholderString="Received with address:" id="ybn-TT-lTo">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="108" translatesAutoresizingMaskIntoConstraints="NO" id="REV-aW-GWK">
<rect key="frame" x="18" y="105" width="269" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="<1DPDD72LLmm5xNTjahEad2r4iQfnuxc9QG>" id="pbA-g9-YQs">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="101" translatesAutoresizingMaskIntoConstraints="NO" id="wGY-Sd-47R">
<rect key="frame" x="18" y="199" width="59" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Amount:" id="3G0-0s-dgf">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="102" translatesAutoresizingMaskIntoConstraints="NO" id="A3b-sP-EFa">
<rect key="frame" x="81" y="199" width="126" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="<0 BTC (567 USD)>" id="Apl-ga-evL">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="103" translatesAutoresizingMaskIntoConstraints="NO" id="bfq-zJ-dtK">
<rect key="frame" x="18" y="174" width="103" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Exchange rate:" id="WBQ-QW-Ib4">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="104" translatesAutoresizingMaskIntoConstraints="NO" id="X6s-Km-rIl">
<rect key="frame" x="125" y="174" width="138" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="<1 BTC = 2000 USD>" id="0LL-6H-dbt">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="105" translatesAutoresizingMaskIntoConstraints="NO" id="qPd-7W-CcZ">
<rect key="frame" x="18" y="149" width="70" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Recipient:" id="FNo-KW-FSJ">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="106" translatesAutoresizingMaskIntoConstraints="NO" id="Lus-Rl-2Lz">
<rect key="frame" x="92" y="149" width="74" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="<recipient>" id="6IJ-am-yWe">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="109" translatesAutoresizingMaskIntoConstraints="NO" id="WH5-v3-hwQ">
<rect key="frame" x="18" y="80" width="54" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Details:" placeholderString="" id="6nl-hl-J8B">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NNf-lH-hmG">
<rect key="frame" x="20" y="20" width="290" height="57"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="siS-CE-hfA">
<rect key="frame" x="1" y="1" width="288" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="110" translatesAutoresizingMaskIntoConstraints="NO" id="9qm-gK-hKY">
<rect key="frame" x="0.0" y="0.0" width="288" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="<details>" id="8lY-mC-K4E">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="9qm-gK-hKY" secondAttribute="trailing" constant="2" id="Oyg-f2-SPT"/>
<constraint firstItem="9qm-gK-hKY" firstAttribute="leading" secondItem="siS-CE-hfA" secondAttribute="leading" constant="2" id="jgS-J8-MZn"/>
<constraint firstItem="9qm-gK-hKY" firstAttribute="top" secondItem="siS-CE-hfA" secondAttribute="top" id="vpo-G4-Itu"/>
</constraints>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="A2u-Yl-wo5">
<rect key="frame" x="1" y="43" width="306" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="AiR-rt-n8E">
<rect key="frame" x="273" y="1" width="16" height="58"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Odu-ld-Rhx">
<rect key="frame" x="0.0" y="0.0" width="17" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSShareTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="irF-Oe-P5T">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="NIe-Cw-BCJ">
<rect key="frame" x="286" y="372" width="34" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="bg0-Jl-pP1"/>
</constraints>
<buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="NSShareTemplate" imagePosition="only" alignment="center" refusesFirstResponder="YES" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="qgx-f5-xGH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="shareButtonPressed:" target="-2" id="et2-Hd-LTm"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="WH5-v3-hwQ" firstAttribute="top" secondItem="REV-aW-GWK" secondAttribute="bottom" constant="8" symbolic="YES" id="1uL-JP-kKi"/>
<constraint firstItem="bfq-zJ-dtK" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="2wy-WF-9HX"/>
<constraint firstAttribute="trailing" secondItem="baj-gE-QEV" secondAttribute="trailing" constant="12" id="3cy-zs-qV5"/>
<constraint firstItem="X6s-Km-rIl" firstAttribute="baseline" secondItem="bfq-zJ-dtK" secondAttribute="baseline" id="6eR-EX-IXI"/>
<constraint firstItem="NNf-lH-hmG" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="8nA-63-pVl"/>
<constraint firstItem="5av-kV-hd8" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="9Ir-nU-V8G"/>
<constraint firstItem="Lus-Rl-2Lz" firstAttribute="baseline" secondItem="qPd-7W-CcZ" secondAttribute="baseline" id="BGU-hC-4b5"/>
<constraint firstItem="TPU-Gl-Q4M" firstAttribute="baseline" secondItem="z9Z-Zh-1fV" secondAttribute="baseline" id="BPW-aJ-FoD"/>
<constraint firstItem="wGY-Sd-47R" firstAttribute="top" secondItem="baj-gE-QEV" secondAttribute="bottom" constant="12" id="DV6-Oj-Xd9"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="X6s-Km-rIl" secondAttribute="trailing" constant="20" symbolic="YES" id="EkC-wB-tGT"/>
<constraint firstItem="6B8-Wf-FKF" firstAttribute="top" secondItem="TPU-Gl-Q4M" secondAttribute="bottom" constant="8" symbolic="YES" id="Fbw-vY-fFs"/>
<constraint firstItem="baj-gE-QEV" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="GeH-Ev-Wcr"/>
<constraint firstAttribute="trailing" secondItem="NNf-lH-hmG" secondAttribute="trailing" constant="20" symbolic="YES" id="H3x-ic-2sK"/>
<constraint firstAttribute="trailing" secondItem="1Ak-no-qRW" secondAttribute="trailing" constant="12" id="H8p-OC-eeo"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Lus-Rl-2Lz" secondAttribute="trailing" constant="20" symbolic="YES" id="HZp-4g-JsI"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="REV-aW-GWK" secondAttribute="trailing" constant="20" symbolic="YES" id="Jv0-7r-ff5"/>
<constraint firstItem="REV-aW-GWK" firstAttribute="top" secondItem="QdT-Oh-DCh" secondAttribute="bottom" constant="3" id="M9y-R8-P0s"/>
<constraint firstItem="NNf-lH-hmG" firstAttribute="top" secondItem="WH5-v3-hwQ" secondAttribute="bottom" constant="3" id="Mv0-ah-bea"/>
<constraint firstItem="t1e-4W-2oE" firstAttribute="top" secondItem="Cgc-kK-Z68" secondAttribute="bottom" constant="8" symbolic="YES" id="NVR-L1-Nn1"/>
<constraint firstItem="QdT-Oh-DCh" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="QJn-2T-rwL"/>
<constraint firstItem="z9Z-Zh-1fV" firstAttribute="leading" secondItem="TPU-Gl-Q4M" secondAttribute="trailing" constant="8" symbolic="YES" id="R3C-zJ-MWS"/>
<constraint firstItem="1Ak-no-qRW" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="ThZ-pr-VBP"/>
<constraint firstItem="1Ak-no-qRW" firstAttribute="top" secondItem="5av-kV-hd8" secondAttribute="bottom" constant="12" id="VOn-gp-QML"/>
<constraint firstItem="qPd-7W-CcZ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="ZBI-ft-Wdo"/>
<constraint firstItem="X6s-Km-rIl" firstAttribute="leading" secondItem="bfq-zJ-dtK" secondAttribute="trailing" constant="8" symbolic="YES" id="a4Y-rO-F7I"/>
<constraint firstItem="Cgc-kK-Z68" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" symbolic="YES" id="aYR-RT-Pj7"/>
<constraint firstItem="TPU-Gl-Q4M" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="ai3-qg-wod"/>
<constraint firstItem="hsi-lm-tcr" firstAttribute="leading" secondItem="6B8-Wf-FKF" secondAttribute="trailing" constant="8" symbolic="YES" id="bER-tW-GhK"/>
<constraint firstItem="z9Z-Zh-1fV" firstAttribute="top" secondItem="1Ak-no-qRW" secondAttribute="bottom" constant="12" id="dPT-di-ijf"/>
<constraint firstItem="QdT-Oh-DCh" firstAttribute="top" secondItem="qPd-7W-CcZ" secondAttribute="bottom" constant="8" symbolic="YES" id="e6M-Ul-6eh"/>
<constraint firstAttribute="trailing" secondItem="t1e-4W-2oE" secondAttribute="trailing" constant="20" symbolic="YES" id="eza-LT-SfC"/>
<constraint firstAttribute="bottom" secondItem="NNf-lH-hmG" secondAttribute="bottom" constant="20" symbolic="YES" id="fJM-wH-AZh"/>
<constraint firstItem="wGY-Sd-47R" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="gEZ-LP-w2g"/>
<constraint firstItem="Cgc-kK-Z68" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="gmw-WG-Tv6"/>
<constraint firstItem="Lus-Rl-2Lz" firstAttribute="leading" secondItem="qPd-7W-CcZ" secondAttribute="trailing" constant="8" symbolic="YES" id="h1t-PR-rR0"/>
<constraint firstItem="NIe-Cw-BCJ" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="13" id="k14-Kz-3qU"/>
<constraint firstItem="6B8-Wf-FKF" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="ldV-6T-sIy"/>
<constraint firstItem="bfq-zJ-dtK" firstAttribute="top" secondItem="A3b-sP-EFa" secondAttribute="bottom" constant="8" symbolic="YES" id="mXB-s4-efx"/>
<constraint firstItem="A3b-sP-EFa" firstAttribute="leading" secondItem="wGY-Sd-47R" secondAttribute="trailing" constant="8" symbolic="YES" id="p2j-RQ-WpW"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="A3b-sP-EFa" secondAttribute="trailing" constant="20" symbolic="YES" id="pI0-0w-JEx"/>
<constraint firstItem="baj-gE-QEV" firstAttribute="top" secondItem="6B8-Wf-FKF" secondAttribute="bottom" constant="12" id="qq4-VJ-fNG"/>
<constraint firstItem="t1e-4W-2oE" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="r4U-vl-JgC"/>
<constraint firstItem="WH5-v3-hwQ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="rAM-p3-Hi2"/>
<constraint firstAttribute="trailing" secondItem="NIe-Cw-BCJ" secondAttribute="trailing" constant="12" id="rP1-uN-KV7"/>
<constraint firstItem="5av-kV-hd8" firstAttribute="top" secondItem="t1e-4W-2oE" secondAttribute="bottom" constant="8" id="rTV-hq-5q0"/>
<constraint firstItem="A3b-sP-EFa" firstAttribute="baseline" secondItem="wGY-Sd-47R" secondAttribute="baseline" id="to5-am-G0u"/>
<constraint firstItem="Lus-Rl-2Lz" firstAttribute="top" secondItem="bfq-zJ-dtK" secondAttribute="bottom" constant="8" symbolic="YES" id="uaX-5i-C5i"/>
<constraint firstItem="hsi-lm-tcr" firstAttribute="baseline" secondItem="6B8-Wf-FKF" secondAttribute="baseline" id="vh9-cH-W9o"/>
<constraint firstItem="REV-aW-GWK" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="wA5-d1-qVk"/>
</constraints>
</customView>
</objects>
<resources>
<image name="NSShareTemplate" width="18" height="16"/>
</resources>
</document>
| {
"pile_set_name": "Github"
} |
/**
* Russian translation for bootstrap-datepicker
* Victor Taranenko <[email protected]>
*/
;(function($){
$.fn.datepicker.dates['ru'] = {
days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"],
daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"],
daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"],
months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],
monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
today: "Сегодня",
weekStart: 1
};
}(jQuery));
| {
"pile_set_name": "Github"
} |
/*
Copyright (C) 2012 Tawanda Gwena
Copyright (C) 2012 Francis Duffy
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
<[email protected]>. The license is also available online at
<http://quantlib.org/license.shtml>.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef quantlib_forward_rate_agreement_i
#define quantlib_forward_rate_agreement_i
%include instruments.i
%include termstructures.i
%include interestrate.i
%{
using QuantLib::Position;
using QuantLib::ForwardRateAgreement;
typedef boost::shared_ptr<Instrument> ForwardRateAgreementPtr;
%}
struct Position {
enum Type { Long, Short };
};
%rename(ForwardRateAgreement) ForwardRateAgreementPtr;
class ForwardRateAgreementPtr : public boost::shared_ptr<Instrument> {
public:
%extend {
ForwardRateAgreementPtr(
const Date& valueDate,
const Date& maturityDate,
Position::Type type,
Rate strikeForwardRate,
Real notionalAmount,
const IborIndexPtr& index,
const Handle<YieldTermStructure>& discountCurve =
Handle<YieldTermStructure>()) {
boost::shared_ptr<IborIndex> libor =
boost::dynamic_pointer_cast<IborIndex>(index);
return new ForwardRateAgreementPtr(
new ForwardRateAgreement(valueDate, maturityDate, type,
strikeForwardRate, notionalAmount,
libor, discountCurve));
}
Real spotIncome(const Handle<YieldTermStructure>& discount) const {
return boost::dynamic_pointer_cast<ForwardRateAgreement>(*self)
->spotIncome(discount);
}
Real spotValue() const {
return boost::dynamic_pointer_cast<ForwardRateAgreement>(*self)
->spotValue();
}
InterestRate forwardRate() const {
return boost::dynamic_pointer_cast<ForwardRateAgreement>(*self)
->forwardRate();
}
}
};
#endif
| {
"pile_set_name": "Github"
} |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package width
import (
"testing"
"golang.org/x/text/internal/testtext"
)
const (
loSurrogate = 0xD800
hiSurrogate = 0xDFFF
)
func TestTables(t *testing.T) {
testtext.SkipIfNotLong(t)
runes := map[rune]Kind{}
getWidthData(func(r rune, tag elem, _ rune) {
runes[r] = tag.kind()
})
for r := rune(0); r < 0x10FFFF; r++ {
if loSurrogate <= r && r <= hiSurrogate {
continue
}
p := LookupRune(r)
if got, want := p.Kind(), runes[r]; got != want {
t.Errorf("Kind of %U was %s; want %s.", r, got, want)
}
want, mapped := foldRune(r)
if got := p.Folded(); (got == 0) == mapped || got != 0 && got != want {
t.Errorf("Folded(%U) = %U; want %U", r, got, want)
}
want, mapped = widenRune(r)
if got := p.Wide(); (got == 0) == mapped || got != 0 && got != want {
t.Errorf("Wide(%U) = %U; want %U", r, got, want)
}
want, mapped = narrowRune(r)
if got := p.Narrow(); (got == 0) == mapped || got != 0 && got != want {
t.Errorf("Narrow(%U) = %U; want %U", r, got, want)
}
}
}
// TestAmbiguous verifies that that ambiguous runes with a mapping always map to
// a halfwidth rune.
func TestAmbiguous(t *testing.T) {
for r, m := range mapRunes {
if m.e != tagAmbiguous {
continue
}
if k := mapRunes[m.r].e.kind(); k != EastAsianHalfwidth {
t.Errorf("Rune %U is ambiguous and maps to a rune of type %v", r, k)
}
}
}
| {
"pile_set_name": "Github"
} |
package feeder
type Enclosure struct {
Url string
Length int64
Type string
}
| {
"pile_set_name": "Github"
} |
Postprocessed antialiasing demo
===============================
[email protected]
Getting started:
================
Just start "DemoPostAA.exe". It'll can a minute to load all the textures up, but the console window should show progress messages as everything loads.
Controls:
=========
Click-drag to pan the camera
WASD moves
QE rotates
Hold Shift to make larger steps
Hold Ctrl to make smaller steps
Tab toggle the antialiasing pass on and off.
Model credits:
==============
Based on a 3DRender.com Lighting Challenge scene.
Museum Hall, modelled by Alvaro Luna
Dinosaurs modelled by Joel Anderson, www.joel3d.com
| {
"pile_set_name": "Github"
} |
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
"fmt"
"io"
"path/filepath"
"strings"
"k8s.io/gengo/generator"
"k8s.io/gengo/namer"
"k8s.io/gengo/types"
"k8s.io/code-generator/cmd/client-gen/generators/util"
)
// genFakeForGroup produces a file for a group client, e.g. ExtensionsClient for the extension group.
type genFakeForGroup struct {
generator.DefaultGen
outputPackage string
realClientPackage string
group string
version string
groupGoName string
// types in this group
types []*types.Type
imports namer.ImportTracker
// If the genGroup has been called. This generator should only execute once.
called bool
}
var _ generator.Generator = &genFakeForGroup{}
// We only want to call GenerateType() once per group.
func (g *genFakeForGroup) Filter(c *generator.Context, t *types.Type) bool {
if !g.called {
g.called = true
return true
}
return false
}
func (g *genFakeForGroup) Namers(c *generator.Context) namer.NameSystems {
return namer.NameSystems{
"raw": namer.NewRawNamer(g.outputPackage, g.imports),
}
}
func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) {
imports = g.imports.ImportLines()
if len(g.types) != 0 {
imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower(filepath.Base(g.realClientPackage)), g.realClientPackage))
}
return imports
}
func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
sw := generator.NewSnippetWriter(w, c, "$", "$")
m := map[string]interface{}{
"GroupGoName": g.groupGoName,
"Version": namer.IC(g.version),
"Fake": c.Universe.Type(types.Name{Package: "k8s.io/client-go/testing", Name: "Fake"}),
"RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}),
"RESTClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClient"}),
}
sw.Do(groupClientTemplate, m)
for _, t := range g.types {
tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...))
if err != nil {
return err
}
wrapper := map[string]interface{}{
"type": t,
"GroupGoName": g.groupGoName,
"Version": namer.IC(g.version),
"realClientPackage": strings.ToLower(filepath.Base(g.realClientPackage)),
}
if tags.NonNamespaced {
sw.Do(getterImplNonNamespaced, wrapper)
continue
}
sw.Do(getterImplNamespaced, wrapper)
}
sw.Do(getRESTClient, m)
return sw.Error()
}
var groupClientTemplate = `
type Fake$.GroupGoName$$.Version$ struct {
*$.Fake|raw$
}
`
var getterImplNamespaced = `
func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$(namespace string) $.realClientPackage$.$.type|public$Interface {
return &Fake$.type|publicPlural${c, namespace}
}
`
var getterImplNonNamespaced = `
func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$() $.realClientPackage$.$.type|public$Interface {
return &Fake$.type|publicPlural${c}
}
`
var getRESTClient = `
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *Fake$.GroupGoName$$.Version$) RESTClient() $.RESTClientInterface|raw$ {
var ret *$.RESTClient|raw$
return ret
}
`
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Note: this is a manually authored file that captures many common build settings across projects. -->
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_PropertySheetDisplayName>hhmain</_PropertySheetDisplayName>
</PropertyGroup>
<!-- See MSBuild Conditions: http://msdn.microsoft.com/en-us/library/7szfhaft.aspx -->
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>HH_FOR_DISTRIB;HH_NO_STACKWALKER;HH_NO_IMAGE_IO;HH_NO_MKL;HH_NO_SIMPLEX;HH_NO_VIDEO_LOOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'false'=='true'">
<ClCompile>
<PreprocessorDefinitions>HH_IMAGE_IO_TOO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(HhRoot)'==''">
<HhRoot>..</HhRoot> <!-- default; most of my projects live in an immediate subfolder of HhRoot -->
</PropertyGroup>
<!-- base properties -->
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(HhRoot)\libHh;$(HhRoot)\libHWin;$(HhRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HH_NO_LAPACK;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointModel>Fast</FloatingPointModel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OpenMPSupport>true</OpenMPSupport>
<UseFullPaths>true</UseFullPaths>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(HhRoot)\lib\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<!-- <AdditionalDependencies>libjpeg.lib;libpng.lib;libz.lib;librecipes.lib;%(AdditionalDependencies)</AdditionalDependencies> -->
<!-- <AdditionalDependencies>liblapack.lib;libF77.lib;libI77.lib;libBLAS.lib;%(AdditionalDependencies)</AdditionalDependencies> -->
</Link>
</ItemDefinitionGroup>
<!-- x86 (32-bit) properties -->
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<ClCompile>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
</ItemDefinitionGroup>
<!-- x64 (64-bit) properties -->
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<ClCompile>
<!-- Note that this option cannot be set explicitly to StreamingSIMDExtensions2 in x64 -->
<!-- The default (not set) on x64 is to use StreamingSIMDExtensions2 (SSE2), which is nicely portable -->
<!-- Setting to AdvancedVectorExtensions2 enables AVX+AVX2, but is less portable -->
<!-- <EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet> -->
</ClCompile>
<Link>
<!-- #pragma referenced: mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib libiomp5md.lib -->
</Link>
</ItemDefinitionGroup>
<!-- Release properties -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' OR '$(Configuration)'=='ReleaseMD'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<!-- Debug properties -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' OR '$(Configuration)'=='DebugMD'">
<ClCompile>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
</ItemDefinitionGroup>
<!-- dll (link to non-static libraries) properties -->
<ItemDefinitionGroup Condition="'$(Configuration)' == 'ReleaseMD'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)' == 'DebugMD'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<!-- extra -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32' OR '$(Configuration)|$(Platform)'=='DebugMD|Win32'">
<OutDir>$(HhRoot)\bin\Win32\debug\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' OR '$(Configuration)|$(Platform)'=='DebugMD|x64'">
<OutDir>$(HhRoot)\bin\debug\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32' OR '$(Configuration)|$(Platform)'=='ReleaseMD|Win32'">
<OutDir>$(HhRoot)\bin\Win32\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' OR '$(Configuration)|$(Platform)'=='ReleaseMD|x64'">
<OutDir>$(HhRoot)\bin\</OutDir>
</PropertyGroup>
<!-- precompiled headers -->
<!-- I give up on using a shared precompiled header across multiple projects using msbuild
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Release' OR '$(Configuration)' == 'ReleaseMD'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>$(HhRoot)\libHh\precompiled_libHh.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>$(HhRoot)\libHh\precompiled_libHh.h</ForcedIncludeFiles>
<- This still fails:
<AdditionalOptions>/Fp$(HhRoot)\libHh\$(IntDir)precompiled_libHh.pch</AdditionalOptions>
c:\hh\src\filtera3d\filtera3d.cpp : error C2859: c:\hh\src\filtera3d\x64\releasemd\vc120.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header. [c:\hh\src\Filtera3d\Filtera3d.vcxproj]
->
<- When using this option, msbuild removes the libHh *.pch file before starting build of non-libHh projects
<PrecompiledHeaderOutputFile>$(HhRoot)\libHh\$(IntDir)precompiled_libHh.pch</PrecompiledHeaderOutputFile>
->
</ClCompile>
</ItemDefinitionGroup>
-->
</Project>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>Onpreviewing / Onpreviewed - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
<style>
.editormd-preview-active {width: 80%;margin: 0 auto;}
</style>
</head>
<body>
<div id="layout">
<header>
<h1>Onpreviewing / Onpreviewed event handle</h1>
<p>Plaese press F12, open the develop tools.</p>
</header>
<div id="test-editormd">
<textarea style="display:none;">#### Settings
```javascript
{
onpreviewing : function() {
// console.log("onpreviewing =>", this, this.id, this.settings);
// on previewing you can custom css .editormd-preview-active
},
onpreviewed : function() {
// console.log("onpreviewed =>", this, this.id, this.settings);
}
}
```
</textarea>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="../editormd.js"></script>
<script type="text/javascript">
$(function() {
var testEditor = editormd("test-editormd", {
width : "90%",
height : 720,
path : '../lib/',
onpreviewing : function() {
console.log("onpreviewing =>", this, this.id, this.settings);
},
onpreviewed : function() {
console.log("onpreviewed =>", this, this.id, this.settings);
}
});
});
</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*
*/
#ifndef IP64_ETH_H
#define IP64_ETH_H
#include "contiki-conf.h"
/**
* The Ethernet address.
*/
struct ip64_eth_addr {
uint8_t addr[6];
};
extern struct ip64_eth_addr ip64_eth_addr;
void ip64_eth_addr_set(struct ip64_eth_addr *addr);
/**
* The Ethernet header.
*/
struct ip64_eth_hdr {
struct ip64_eth_addr dest;
struct ip64_eth_addr src;
uint16_t type;
};
#define IP64_ETH_TYPE_ARP 0x0806
#define IP64_ETH_TYPE_IP 0x0800
#define IP64_ETH_TYPE_IPV6 0x86dd
#endif /* IP64_ETH_H */
| {
"pile_set_name": "Github"
} |
import hashlib
import json
from unittest import TestCase
from blockchain import Blockchain
class BlockchainTestCase(TestCase):
def setUp(self):
self.blockchain = Blockchain()
def create_block(self, proof=123, previous_hash='abc'):
self.blockchain.new_block(proof, previous_hash)
def create_transaction(self, sender='a', recipient='b', amount=1):
self.blockchain.new_transaction(
sender=sender,
recipient=recipient,
amount=amount
)
class TestRegisterNodes(BlockchainTestCase):
def test_valid_nodes(self):
blockchain = Blockchain()
blockchain.register_node('http://192.168.0.1:5000')
self.assertIn('192.168.0.1:5000', blockchain.nodes)
def test_malformed_nodes(self):
blockchain = Blockchain()
blockchain.register_node('http//192.168.0.1:5000')
self.assertNotIn('192.168.0.1:5000', blockchain.nodes)
def test_idempotency(self):
blockchain = Blockchain()
blockchain.register_node('http://192.168.0.1:5000')
blockchain.register_node('http://192.168.0.1:5000')
assert len(blockchain.nodes) == 1
class TestBlocksAndTransactions(BlockchainTestCase):
def test_block_creation(self):
self.create_block()
latest_block = self.blockchain.last_block
# The genesis block is create at initialization, so the length should be 2
assert len(self.blockchain.chain) == 2
assert latest_block['index'] == 2
assert latest_block['timestamp'] is not None
assert latest_block['proof'] == 123
assert latest_block['previous_hash'] == 'abc'
def test_create_transaction(self):
self.create_transaction()
transaction = self.blockchain.current_transactions[-1]
assert transaction
assert transaction['sender'] == 'a'
assert transaction['recipient'] == 'b'
assert transaction['amount'] == 1
def test_block_resets_transactions(self):
self.create_transaction()
initial_length = len(self.blockchain.current_transactions)
self.create_block()
current_length = len(self.blockchain.current_transactions)
assert initial_length == 1
assert current_length == 0
def test_return_last_block(self):
self.create_block()
created_block = self.blockchain.last_block
assert len(self.blockchain.chain) == 2
assert created_block is self.blockchain.chain[-1]
class TestHashingAndProofs(BlockchainTestCase):
def test_hash_is_correct(self):
self.create_block()
new_block = self.blockchain.last_block
new_block_json = json.dumps(self.blockchain.last_block, sort_keys=True).encode()
new_hash = hashlib.sha256(new_block_json).hexdigest()
assert len(new_hash) == 64
assert new_hash == self.blockchain.hash(new_block)
| {
"pile_set_name": "Github"
} |
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
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.
*/
import isEmpty from 'lodash/isEmpty';
import React from 'react';
import { Card, CardContent, CardHeader, Hidden } from '@material-ui/core';
import {
GroupLayout,
LayoutProps,
RankedTester,
rankWith,
uiTypeIs,
withIncreasedRank,
} from '@jsonforms/core';
import {
MaterialLayoutRenderer,
MaterialLayoutRendererProps
} from '../util/layout';
import { withJsonFormsLayoutProps } from '@jsonforms/react';
export const groupTester: RankedTester = rankWith(1, uiTypeIs('Group'));
const style: { [x: string]: any } = { marginBottom: '10px' };
const GroupComponent = React.memo(({ visible, enabled, uischema, ...props }: MaterialLayoutRendererProps) => {
const groupLayout = uischema as GroupLayout;
return (
<Hidden xsUp={!visible}>
<Card style={style}>
{!isEmpty(groupLayout.label) && (
<CardHeader title={groupLayout.label} />
)}
<CardContent>
<MaterialLayoutRenderer {...props} visible={visible} enabled={enabled} elements={groupLayout.elements} />
</CardContent>
</Card>
</Hidden>
);
});
export const MaterializedGroupLayoutRenderer = ({ uischema, schema, path, visible, enabled, renderers, cells, direction }: LayoutProps) => {
const groupLayout = uischema as GroupLayout;
return (
<GroupComponent
elements={groupLayout.elements}
schema={schema}
path={path}
direction={direction}
visible={visible}
enabled={enabled}
uischema={uischema}
renderers={renderers}
cells={cells}
/>
);
};
export default withJsonFormsLayoutProps(MaterializedGroupLayoutRenderer);
export const materialGroupTester: RankedTester = withIncreasedRank(
1,
groupTester
);
| {
"pile_set_name": "Github"
} |
#light "off"
module FStar.Tactics.Result
// This file *is* extracted (unlike its twin in ulib).
// This refers to FStar.Tactics.Types.fsi in the current folder, which has the
// full definition of all relevant types (from ulib, we use an different
// interface that hides those definitions).
open FStar.Tactics.Types
type __result<'a> =
| Success of 'a * proofstate
| Failed of exn //error
* proofstate //the proofstate at time of failure
| {
"pile_set_name": "Github"
} |
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2012 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// 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.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// 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
// OWNER 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.
// +build !appengine,!js
// This file contains the implementation of the proto field accesses using package unsafe.
package proto
import (
"reflect"
"unsafe"
)
// NOTE: These type_Foo functions would more idiomatically be methods,
// but Go does not allow methods on pointer types, and we must preserve
// some pointer type for the garbage collector. We use these
// funcs with clunky names as our poor approximation to methods.
//
// An alternative would be
// type structPointer struct { p unsafe.Pointer }
// but that does not registerize as well.
// A structPointer is a pointer to a struct.
type structPointer unsafe.Pointer
// toStructPointer returns a structPointer equivalent to the given reflect value.
func toStructPointer(v reflect.Value) structPointer {
return structPointer(unsafe.Pointer(v.Pointer()))
}
// IsNil reports whether p is nil.
func structPointer_IsNil(p structPointer) bool {
return p == nil
}
// Interface returns the struct pointer, assumed to have element type t,
// as an interface value.
func structPointer_Interface(p structPointer, t reflect.Type) interface{} {
return reflect.NewAt(t, unsafe.Pointer(p)).Interface()
}
// A field identifies a field in a struct, accessible from a structPointer.
// In this implementation, a field is identified by its byte offset from the start of the struct.
type field uintptr
// toField returns a field equivalent to the given reflect field.
func toField(f *reflect.StructField) field {
return field(f.Offset)
}
// invalidField is an invalid field identifier.
const invalidField = ^field(0)
// IsValid reports whether the field identifier is valid.
func (f field) IsValid() bool {
return f != ^field(0)
}
// Bytes returns the address of a []byte field in the struct.
func structPointer_Bytes(p structPointer, f field) *[]byte {
return (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// BytesSlice returns the address of a [][]byte field in the struct.
func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
return (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// Bool returns the address of a *bool field in the struct.
func structPointer_Bool(p structPointer, f field) **bool {
return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// BoolVal returns the address of a bool field in the struct.
func structPointer_BoolVal(p structPointer, f field) *bool {
return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// BoolSlice returns the address of a []bool field in the struct.
func structPointer_BoolSlice(p structPointer, f field) *[]bool {
return (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// String returns the address of a *string field in the struct.
func structPointer_String(p structPointer, f field) **string {
return (**string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// StringVal returns the address of a string field in the struct.
func structPointer_StringVal(p structPointer, f field) *string {
return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// StringSlice returns the address of a []string field in the struct.
func structPointer_StringSlice(p structPointer, f field) *[]string {
return (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// ExtMap returns the address of an extension map field in the struct.
func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
return (*XXX_InternalExtensions)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// NewAt returns the reflect.Value for a pointer to a field in the struct.
func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f)))
}
// SetStructPointer writes a *struct field in the struct.
func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
*(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q
}
// GetStructPointer reads a *struct field in the struct.
func structPointer_GetStructPointer(p structPointer, f field) structPointer {
return *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// StructPointerSlice the address of a []*struct field in the struct.
func structPointer_StructPointerSlice(p structPointer, f field) *structPointerSlice {
return (*structPointerSlice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// A structPointerSlice represents a slice of pointers to structs (themselves submessages or groups).
type structPointerSlice []structPointer
func (v *structPointerSlice) Len() int { return len(*v) }
func (v *structPointerSlice) Index(i int) structPointer { return (*v)[i] }
func (v *structPointerSlice) Append(p structPointer) { *v = append(*v, p) }
// A word32 is the address of a "pointer to 32-bit value" field.
type word32 **uint32
// IsNil reports whether *v is nil.
func word32_IsNil(p word32) bool {
return *p == nil
}
// Set sets *v to point at a newly allocated word set to x.
func word32_Set(p word32, o *Buffer, x uint32) {
if len(o.uint32s) == 0 {
o.uint32s = make([]uint32, uint32PoolSize)
}
o.uint32s[0] = x
*p = &o.uint32s[0]
o.uint32s = o.uint32s[1:]
}
// Get gets the value pointed at by *v.
func word32_Get(p word32) uint32 {
return **p
}
// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
func structPointer_Word32(p structPointer, f field) word32 {
return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
}
// A word32Val is the address of a 32-bit value field.
type word32Val *uint32
// Set sets *p to x.
func word32Val_Set(p word32Val, x uint32) {
*p = x
}
// Get gets the value pointed at by p.
func word32Val_Get(p word32Val) uint32 {
return *p
}
// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
func structPointer_Word32Val(p structPointer, f field) word32Val {
return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
}
// A word32Slice is a slice of 32-bit values.
type word32Slice []uint32
func (v *word32Slice) Append(x uint32) { *v = append(*v, x) }
func (v *word32Slice) Len() int { return len(*v) }
func (v *word32Slice) Index(i int) uint32 { return (*v)[i] }
// Word32Slice returns the address of a []int32, []uint32, []float32, or []enum field in the struct.
func structPointer_Word32Slice(p structPointer, f field) *word32Slice {
return (*word32Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
// word64 is like word32 but for 64-bit values.
type word64 **uint64
func word64_Set(p word64, o *Buffer, x uint64) {
if len(o.uint64s) == 0 {
o.uint64s = make([]uint64, uint64PoolSize)
}
o.uint64s[0] = x
*p = &o.uint64s[0]
o.uint64s = o.uint64s[1:]
}
func word64_IsNil(p word64) bool {
return *p == nil
}
func word64_Get(p word64) uint64 {
return **p
}
func structPointer_Word64(p structPointer, f field) word64 {
return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
}
// word64Val is like word32Val but for 64-bit values.
type word64Val *uint64
func word64Val_Set(p word64Val, o *Buffer, x uint64) {
*p = x
}
func word64Val_Get(p word64Val) uint64 {
return *p
}
func structPointer_Word64Val(p structPointer, f field) word64Val {
return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
}
// word64Slice is like word32Slice but for 64-bit values.
type word64Slice []uint64
func (v *word64Slice) Append(x uint64) { *v = append(*v, x) }
func (v *word64Slice) Len() int { return len(*v) }
func (v *word64Slice) Index(i int) uint64 { return (*v)[i] }
func structPointer_Word64Slice(p structPointer, f field) *word64Slice {
return (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
| {
"pile_set_name": "Github"
} |
package io.quarkus.devtools.codestarts.core.reader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public interface CodestartFileReader {
CodestartFileReader DEFAULT = new DefaultCodestartFileReader();
List<CodestartFileReader> ALL = Collections.unmodifiableList(Arrays.asList(
DEFAULT,
new QuteCodestartFileReader(),
new IgnoreCodestartFileReader()));
boolean matches(String fileName);
String cleanFileName(String fileName);
Optional<String> read(Path sourceDirectory, Path relativeSourcePath, String languageName, Map<String, Object> data)
throws IOException;
class DefaultCodestartFileReader implements CodestartFileReader {
@Override
public boolean matches(String fileName) {
return false;
}
@Override
public String cleanFileName(String fileName) {
return fileName.replace("..", ".");
}
@Override
public Optional<String> read(Path sourceDirectory, Path relativeSourcePath, String languageName,
Map<String, Object> data) throws IOException {
return Optional
.of(new String(Files.readAllBytes(sourceDirectory.resolve(relativeSourcePath)), StandardCharsets.UTF_8));
}
}
}
| {
"pile_set_name": "Github"
} |
#ifndef _XT_LENGTH_H
#define _XT_LENGTH_H
#include <linux/types.h>
struct xt_length_info {
__u16 min, max;
__u8 invert;
};
#endif /*_XT_LENGTH_H*/
| {
"pile_set_name": "Github"
} |
/**
* 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.
*/
package com.microsoft.azure.management.network.v2019_11_01;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;
/**
* Defines values for VirtualNetworkGatewayConnectionProtocol.
*/
public final class VirtualNetworkGatewayConnectionProtocol extends ExpandableStringEnum<VirtualNetworkGatewayConnectionProtocol> {
/** Static value IKEv2 for VirtualNetworkGatewayConnectionProtocol. */
public static final VirtualNetworkGatewayConnectionProtocol IKEV2 = fromString("IKEv2");
/** Static value IKEv1 for VirtualNetworkGatewayConnectionProtocol. */
public static final VirtualNetworkGatewayConnectionProtocol IKEV1 = fromString("IKEv1");
/**
* Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation.
* @param name a name to look for
* @return the corresponding VirtualNetworkGatewayConnectionProtocol
*/
@JsonCreator
public static VirtualNetworkGatewayConnectionProtocol fromString(String name) {
return fromString(name, VirtualNetworkGatewayConnectionProtocol.class);
}
/**
* @return known VirtualNetworkGatewayConnectionProtocol values
*/
public static Collection<VirtualNetworkGatewayConnectionProtocol> values() {
return values(VirtualNetworkGatewayConnectionProtocol.class);
}
}
| {
"pile_set_name": "Github"
} |
struct Ludics(T) {
T[] rotor, taken = [T(1)];
T i;
size_t j;
T front = 1; // = taken[0];
bool running = false;
static immutable bool empty = false;
void popFront() pure nothrow @safe {
if (running)
goto RESUME;
else
running = true;
i = 2;
while (true) {
j = 0;
while (j < rotor.length) {
rotor[j]--;
if (!rotor[j])
break;
j++;
}
if (j < rotor.length) {
rotor[j] = taken[j + 1];
} else {
front = i;
return;
RESUME:
taken ~= i;
rotor ~= taken[j + 1];
}
i++; // Could overflow if T has a max.
}
}
}
void main() {
import std.stdio, std.range, std.algorithm, std.array;
Ludics!uint L;
writeln("First 25 ludic primes:\n", L.take(25));
writefln("\nThere are %d ludic numbers <= 1000.",
L.until!q{ a > 1000 }.walkLength);
writeln("\n2000'th .. 2005'th ludic primes:\n", L.drop(1999).take(6));
enum uint m = 250;
const few = L.until!(x => x > m).array;
const triplets = few.filter!(x => x + 6 < m && few.canFind(x + 2)
&& few.canFind(x + 6))
// Ugly output:
//.map!(x => tuple(x, x + 2, x + 6)).array;
.map!(x => [x, x + 2, x + 6]).array;
writefln("\nThere are %d triplets less than %d:\n%s",
triplets.length, m, triplets);
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*
* <p>Generated by an internal genrule from Flow types.
*
* @generated
* @nolint
*/
package com.facebook.fbreact.specs;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReactModuleWithSpec;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
public abstract class NativeShareModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
public NativeShareModuleSpec(ReactApplicationContext reactContext) {
super(reactContext);
}
@ReactMethod
public abstract void share(ReadableMap content, String dialogTitle, Promise promise);
}
| {
"pile_set_name": "Github"
} |
MPE_LOG_THREAD_LIBS=""
| {
"pile_set_name": "Github"
} |
{
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [
{
"corpusPath": "cdm:/foundations.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Common.cdm.json",
"moniker": "base_Common"
},
{
"corpusPath": "/core/operationsCommon/DataEntityView.cdm.json",
"moniker": "base_DataEntityView"
},
{
"corpusPath": "/core/operationsCommon/Tables/Finance/AccountsReceivable/Transaction/CustInvoiceTrans.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/Common/GAB/Main/LogisticsPostalAddress.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/SupplyChain/Inventory/Main/InventDim.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/SupplyChain/Inventory/Group/InventPackagingMaterialCode.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/SupplyChain/ProductInformationManagement/Main/InventTable.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/SupplyChain/SalesAndMarketing/WorksheetHeader/SalesTable.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/SupplyChain/Inventory/Group/InventPackagingClass_W.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Tables/Finance/Ledger/Main/CompanyInfo.cdm.json"
}
],
"definitions": [
{
"entityName": "InventPackagingMaterialTrans",
"extendsEntity": "base_Common/Common",
"exhibitsTraits": [
{
"traitReference": "is.CDM.entityVersion",
"arguments": [
{
"name": "versionNumber",
"value": "1.1"
}
]
}
],
"hasAttributes": [
{
"name": "PackagingClassId_W",
"dataType": "ItemPackagingClassId_W",
"isNullable": true,
"description": ""
},
{
"name": "FeeIsCalculated",
"dataType": "integer",
"isNullable": true,
"displayName": "Calculate fee",
"description": ""
},
{
"name": "InventDimId",
"dataType": "InventDimId",
"isNullable": true,
"description": ""
},
{
"name": "InvoiceDate",
"dataType": "InvoiceDate",
"description": ""
},
{
"name": "InvoiceId",
"dataType": "CustInvoiceId",
"isReadOnly": true,
"description": ""
},
{
"name": "ItemId",
"dataType": "ItemId",
"description": ""
},
{
"name": "LineNum",
"dataType": "LineNum",
"isNullable": true,
"description": ""
},
{
"name": "LogisticsPostalAddress",
"dataType": "RefRecId",
"isNullable": true,
"description": ""
},
{
"name": "PackagingWeight",
"dataType": "InventPackagingWeight",
"isNullable": true,
"description": ""
},
{
"name": "PackingUnit",
"dataType": "InventPackingUnit",
"isNullable": true,
"description": ""
},
{
"name": "PackingUnitQty",
"dataType": "InventPackingUnitQty",
"isNullable": true,
"description": ""
},
{
"name": "PackingUnitWeight",
"dataType": "InventPackingUnitWeight",
"isNullable": true,
"description": ""
},
{
"name": "PackMaterialCode",
"dataType": "InventPackingMaterialCode",
"description": ""
},
{
"name": "SalesId",
"dataType": "SalesId",
"description": ""
},
{
"name": "DataAreaId",
"dataType": "string",
"isReadOnly": true
},
{
"entity": {
"entityReference": "CustInvoiceTrans"
},
"name": "Relationship_CustInvoiceTransRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "LogisticsPostalAddress"
},
"name": "Relationship_DeliveryPostalAddress_FKRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "InventDim"
},
"name": "Relationship_InventDimRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "InventPackagingMaterialCode"
},
"name": "Relationship_InventPackagingMaterialCodeRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "InventTable"
},
"name": "Relationship_InventTableRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "SalesTable"
},
"name": "Relationship_SalesTableRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "InventPackagingClass_W"
},
"name": "Relationship_InventPackagingClass_WRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
},
{
"entity": {
"entityReference": "CompanyInfo"
},
"name": "Relationship_CompanyRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
}
],
"displayName": "Packing material transactions"
},
{
"dataTypeName": "ItemPackagingClassId_W",
"extendsDataType": "string"
},
{
"dataTypeName": "InventDimId",
"extendsDataType": "string"
},
{
"dataTypeName": "InvoiceDate",
"extendsDataType": "date"
},
{
"dataTypeName": "CustInvoiceId",
"extendsDataType": "string"
},
{
"dataTypeName": "ItemId",
"extendsDataType": "string"
},
{
"dataTypeName": "LineNum",
"extendsDataType": "decimal"
},
{
"dataTypeName": "RefRecId",
"extendsDataType": "bigInteger"
},
{
"dataTypeName": "InventPackagingWeight",
"extendsDataType": "decimal"
},
{
"dataTypeName": "InventPackingUnit",
"extendsDataType": "string"
},
{
"dataTypeName": "InventPackingUnitQty",
"extendsDataType": "decimal"
},
{
"dataTypeName": "InventPackingUnitWeight",
"extendsDataType": "decimal"
},
{
"dataTypeName": "InventPackingMaterialCode",
"extendsDataType": "string"
},
{
"dataTypeName": "SalesId",
"extendsDataType": "string"
}
]
} | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RCTTextLayoutManager.h"
#import "NSTextStorage+FontScaling.h"
#import "RCTAttributedTextUtils.h"
#import <React/RCTUtils.h>
#import <react/utils/ManagedObjectWrapper.h>
#import <react/utils/SimpleThreadSafeCache.h>
using namespace facebook::react;
@implementation RCTTextLayoutManager {
SimpleThreadSafeCache<AttributedString, std::shared_ptr<void>, 256> _cache;
}
static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(EllipsizeMode ellipsizeMode)
{
switch (ellipsizeMode) {
case EllipsizeMode::Clip:
return NSLineBreakByClipping;
case EllipsizeMode::Head:
return NSLineBreakByTruncatingHead;
case EllipsizeMode::Tail:
return NSLineBreakByTruncatingTail;
case EllipsizeMode::Middle:
return NSLineBreakByTruncatingMiddle;
}
}
- (TextMeasurement)measureNSAttributedString:(NSAttributedString *)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
layoutConstraints:(LayoutConstraints)layoutConstraints
{
if (attributedString.length == 0) {
// This is not really an optimization because that should be checked much earlier on the call stack.
// Sometimes, very irregularly, measuring an empty string crashes/freezes iOS internal text infrastructure.
// This is our last line of defense.
return {};
}
CGSize maximumSize = CGSize{layoutConstraints.maximumSize.width, CGFLOAT_MAX};
NSTextStorage *textStorage = [self _textStorageAndLayoutManagerWithAttributesString:attributedString
paragraphAttributes:paragraphAttributes
size:maximumSize];
NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
[layoutManager ensureLayoutForTextContainer:textContainer];
CGSize size = [layoutManager usedRectForTextContainer:textContainer].size;
size = (CGSize){RCTCeilPixelValue(size.width), RCTCeilPixelValue(size.height)};
__block auto attachments = TextMeasurement::Attachments{};
[textStorage
enumerateAttribute:NSAttachmentAttributeName
inRange:NSMakeRange(0, textStorage.length)
options:0
usingBlock:^(NSTextAttachment *attachment, NSRange range, BOOL *stop) {
if (!attachment) {
return;
}
CGSize attachmentSize = attachment.bounds.size;
CGRect glyphRect = [layoutManager boundingRectForGlyphRange:range inTextContainer:textContainer];
UIFont *font = [textStorage attribute:NSFontAttributeName atIndex:range.location effectiveRange:nil];
CGRect frame = {{glyphRect.origin.x,
glyphRect.origin.y + glyphRect.size.height - attachmentSize.height + font.descender},
attachmentSize};
auto rect = facebook::react::Rect{facebook::react::Point{frame.origin.x, frame.origin.y},
facebook::react::Size{frame.size.width, frame.size.height}};
attachments.push_back(TextMeasurement::Attachment{rect, false});
}];
return TextMeasurement{{size.width, size.height}, attachments};
}
- (TextMeasurement)measureAttributedString:(AttributedString)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
layoutConstraints:(LayoutConstraints)layoutConstraints
{
return [self measureNSAttributedString:[self _nsAttributedStringFromAttributedString:attributedString]
paragraphAttributes:paragraphAttributes
layoutConstraints:layoutConstraints];
}
- (void)drawAttributedString:(AttributedString)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
frame:(CGRect)frame
{
NSTextStorage *textStorage = [self
_textStorageAndLayoutManagerWithAttributesString:[self _nsAttributedStringFromAttributedString:attributedString]
paragraphAttributes:paragraphAttributes
size:frame.size];
NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
#if TARGET_OS_MACCATALYST
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextSetShouldSmoothFonts(context, NO);
#endif
NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];
[layoutManager drawBackgroundForGlyphRange:glyphRange atPoint:frame.origin];
[layoutManager drawGlyphsForGlyphRange:glyphRange atPoint:frame.origin];
#if TARGET_OS_MACCATALYST
CGContextRestoreGState(context);
#endif
}
- (LinesMeasurements)getLinesForAttributedString:(facebook::react::AttributedString)attributedString
paragraphAttributes:(facebook::react::ParagraphAttributes)paragraphAttributes
size:(CGSize)size
{
NSTextStorage *textStorage = [self
_textStorageAndLayoutManagerWithAttributesString:[self _nsAttributedStringFromAttributedString:attributedString]
paragraphAttributes:paragraphAttributes
size:size];
NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];
std::vector<LineMeasurement> paragraphLines{};
auto blockParagraphLines = ¶graphLines;
[layoutManager enumerateLineFragmentsForGlyphRange:glyphRange
usingBlock:^(
CGRect overallRect,
CGRect usedRect,
NSTextContainer *_Nonnull usedTextContainer,
NSRange lineGlyphRange,
BOOL *_Nonnull stop) {
NSRange range = [layoutManager characterRangeForGlyphRange:lineGlyphRange
actualGlyphRange:nil];
NSString *renderedString = [textStorage.string substringWithRange:range];
UIFont *font = [[textStorage attributedSubstringFromRange:range]
attribute:NSFontAttributeName
atIndex:0
effectiveRange:nil];
auto rect = facebook::react::Rect{
facebook::react::Point{usedRect.origin.x, usedRect.origin.y},
facebook::react::Size{usedRect.size.width, usedRect.size.height}};
auto line = LineMeasurement{std::string([renderedString UTF8String]),
rect,
-font.descender,
font.capHeight,
font.ascender,
font.xHeight};
blockParagraphLines->push_back(line);
}];
return paragraphLines;
}
- (NSTextStorage *)_textStorageAndLayoutManagerWithAttributesString:(NSAttributedString *)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
size:(CGSize)size
{
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:size];
textContainer.lineFragmentPadding = 0.0; // Note, the default value is 5.
textContainer.lineBreakMode = paragraphAttributes.maximumNumberOfLines > 0
? RCTNSLineBreakModeFromEllipsizeMode(paragraphAttributes.ellipsizeMode)
: NSLineBreakByClipping;
textContainer.maximumNumberOfLines = paragraphAttributes.maximumNumberOfLines;
NSLayoutManager *layoutManager = [NSLayoutManager new];
layoutManager.usesFontLeading = NO;
[layoutManager addTextContainer:textContainer];
NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString];
[textStorage addLayoutManager:layoutManager];
if (paragraphAttributes.adjustsFontSizeToFit) {
CGFloat minimumFontSize = !isnan(paragraphAttributes.minimumFontSize) ? paragraphAttributes.minimumFontSize : 4.0;
CGFloat maximumFontSize = !isnan(paragraphAttributes.maximumFontSize) ? paragraphAttributes.maximumFontSize : 96.0;
[textStorage scaleFontSizeToFitSize:size minimumFontSize:minimumFontSize maximumFontSize:maximumFontSize];
}
return textStorage;
}
- (SharedEventEmitter)getEventEmitterWithAttributeString:(AttributedString)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
frame:(CGRect)frame
atPoint:(CGPoint)point
{
NSTextStorage *textStorage = [self
_textStorageAndLayoutManagerWithAttributesString:[self _nsAttributedStringFromAttributedString:attributedString]
paragraphAttributes:paragraphAttributes
size:frame.size];
NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
CGFloat fraction;
NSUInteger characterIndex = [layoutManager characterIndexForPoint:point
inTextContainer:textContainer
fractionOfDistanceBetweenInsertionPoints:&fraction];
// If the point is not before (fraction == 0.0) the first character and not
// after (fraction == 1.0) the last character, then the attribute is valid.
if (textStorage.length > 0 && (fraction > 0 || characterIndex > 0) &&
(fraction < 1 || characterIndex < textStorage.length - 1)) {
RCTWeakEventEmitterWrapper *eventEmitterWrapper =
(RCTWeakEventEmitterWrapper *)[textStorage attribute:RCTAttributedStringEventEmitterKey
atIndex:characterIndex
effectiveRange:NULL];
return eventEmitterWrapper.eventEmitter;
}
return nil;
}
- (NSAttributedString *)_nsAttributedStringFromAttributedString:(AttributedString)attributedString
{
auto sharedNSAttributedString = _cache.get(attributedString, [](AttributedString attributedString) {
return wrapManagedObject(RCTNSAttributedStringFromAttributedString(attributedString));
});
return unwrapManagedObject(sharedNSAttributedString);
}
- (void)getRectWithAttributedString:(AttributedString)attributedString
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
enumerateAttribute:(NSString *)enumerateAttribute
frame:(CGRect)frame
usingBlock:(RCTTextLayoutFragmentEnumerationBlock)block
{
NSTextStorage *textStorage = [self
_textStorageAndLayoutManagerWithAttributesString:[self _nsAttributedStringFromAttributedString:attributedString]
paragraphAttributes:paragraphAttributes
size:frame.size];
NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;
NSTextContainer *textContainer = layoutManager.textContainers.firstObject;
[layoutManager ensureLayoutForTextContainer:textContainer];
NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];
NSRange characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];
[textStorage enumerateAttribute:enumerateAttribute
inRange:characterRange
options:0
usingBlock:^(NSString *value, NSRange range, BOOL *pause) {
if (!value) {
return;
}
[layoutManager
enumerateEnclosingRectsForGlyphRange:range
withinSelectedGlyphRange:range
inTextContainer:textContainer
usingBlock:^(CGRect enclosingRect, BOOL *_Nonnull stop) {
block(
enclosingRect,
[textStorage attributedSubstringFromRange:range].string,
value);
*stop = YES;
}];
}];
}
@end
| {
"pile_set_name": "Github"
} |
package parseutil
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/hashicorp/errwrap"
sockaddr "github.com/hashicorp/go-sockaddr"
"github.com/hashicorp/vault/sdk/helper/strutil"
"github.com/mitchellh/mapstructure"
)
func ParseDurationSecond(in interface{}) (time.Duration, error) {
var dur time.Duration
jsonIn, ok := in.(json.Number)
if ok {
in = jsonIn.String()
}
switch inp := in.(type) {
case nil:
// return default of zero
case string:
if inp == "" {
return dur, nil
}
var err error
// Look for a suffix otherwise its a plain second value
if strings.HasSuffix(inp, "s") || strings.HasSuffix(inp, "m") || strings.HasSuffix(inp, "h") || strings.HasSuffix(inp, "ms") {
dur, err = time.ParseDuration(inp)
if err != nil {
return dur, err
}
} else {
// Plain integer
secs, err := strconv.ParseInt(inp, 10, 64)
if err != nil {
return dur, err
}
dur = time.Duration(secs) * time.Second
}
case int:
dur = time.Duration(inp) * time.Second
case int32:
dur = time.Duration(inp) * time.Second
case int64:
dur = time.Duration(inp) * time.Second
case uint:
dur = time.Duration(inp) * time.Second
case uint32:
dur = time.Duration(inp) * time.Second
case uint64:
dur = time.Duration(inp) * time.Second
case float32:
dur = time.Duration(inp) * time.Second
case float64:
dur = time.Duration(inp) * time.Second
case time.Duration:
dur = inp
default:
return 0, errors.New("could not parse duration from input")
}
return dur, nil
}
func ParseInt(in interface{}) (int64, error) {
var ret int64
jsonIn, ok := in.(json.Number)
if ok {
in = jsonIn.String()
}
switch in.(type) {
case string:
inp := in.(string)
if inp == "" {
return 0, nil
}
var err error
left, err := strconv.ParseInt(inp, 10, 64)
if err != nil {
return ret, err
}
ret = left
case int:
ret = int64(in.(int))
case int32:
ret = int64(in.(int32))
case int64:
ret = in.(int64)
case uint:
ret = int64(in.(uint))
case uint32:
ret = int64(in.(uint32))
case uint64:
ret = int64(in.(uint64))
default:
return 0, errors.New("could not parse value from input")
}
return ret, nil
}
func ParseBool(in interface{}) (bool, error) {
var result bool
if err := mapstructure.WeakDecode(in, &result); err != nil {
return false, err
}
return result, nil
}
func ParseCommaStringSlice(in interface{}) ([]string, error) {
rawString, ok := in.(string)
if ok && rawString == "" {
return []string{}, nil
}
var result []string
config := &mapstructure.DecoderConfig{
Result: &result,
WeaklyTypedInput: true,
DecodeHook: mapstructure.StringToSliceHookFunc(","),
}
decoder, err := mapstructure.NewDecoder(config)
if err != nil {
return nil, err
}
if err := decoder.Decode(in); err != nil {
return nil, err
}
return strutil.TrimStrings(result), nil
}
func ParseAddrs(addrs interface{}) ([]*sockaddr.SockAddrMarshaler, error) {
out := make([]*sockaddr.SockAddrMarshaler, 0)
stringAddrs := make([]string, 0)
switch addrs.(type) {
case string:
stringAddrs = strutil.ParseArbitraryStringSlice(addrs.(string), ",")
if len(stringAddrs) == 0 {
return nil, fmt.Errorf("unable to parse addresses from %v", addrs)
}
case []string:
stringAddrs = addrs.([]string)
case []interface{}:
for _, v := range addrs.([]interface{}) {
stringAddr, ok := v.(string)
if !ok {
return nil, fmt.Errorf("error parsing %v as string", v)
}
stringAddrs = append(stringAddrs, stringAddr)
}
default:
return nil, fmt.Errorf("unknown address input type %T", addrs)
}
for _, addr := range stringAddrs {
sa, err := sockaddr.NewSockAddr(addr)
if err != nil {
return nil, errwrap.Wrapf(fmt.Sprintf("error parsing address %q: {{err}}", addr), err)
}
out = append(out, &sockaddr.SockAddrMarshaler{
SockAddr: sa,
})
}
return out, nil
}
| {
"pile_set_name": "Github"
} |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dr="http://schemas.digitalrune.com/windows"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:DigitalRune.Editor"
xmlns:search="clr-namespace:DigitalRune.Editor.Search">
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<DataTemplate DataType="{x:Type search:ToolBarQuickFindViewModel}">
<ComboBox Width="{Binding Width}"
IsEditable="True"
IsTextSearchCaseSensitive="True"
ItemsSource="{Binding Items}"
KeyboardNavigation.AcceptsReturn="True"
SelectedItem="{Binding SelectedItem}"
Text="{Binding Query.FindPattern}"
ToolTip="{Binding CommandItem, Converter={x:Static local:CommandItemToToolTipConverter.Instance}, Mode=OneWay}"
Visibility="{Binding CommandItem.IsVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}">
<i:Interaction.Behaviors>
<search:QuickFindBehavior />
<dr:WatermarkBehavior WatermarkText="Find (Ctrl+F)">
<dr:WatermarkBehavior.WatermarkStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="Gray" />
<Setter Property="Margin" Value="3,2" />
</Style>
</dr:WatermarkBehavior.WatermarkStyle>
</dr:WatermarkBehavior>
</i:Interaction.Behaviors>
</ComboBox>
</DataTemplate>
<DataTemplate DataType="{x:Type search:FindAndReplaceViewModel}">
<dr:DockTabItem Title="{Binding DisplayName}"
DockHeight="{Binding DockHeight}"
DockWidth="{Binding DockWidth}"
Icon="{Binding Icon}"
ToolTip="{Binding DockToolTip}">
<dr:DockTabItem.ContextMenu>
<ContextMenu ItemsSource="{Binding DockContextMenu}" UsesItemContainerTemplate="True" />
</dr:DockTabItem.ContextMenu>
<search:FindAndReplaceView />
</dr:DockTabItem>
</DataTemplate>
</ResourceDictionary>
| {
"pile_set_name": "Github"
} |
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
Tests what would happen if you have nested try-finally's with interesting control statements nested within them. The correct outcome is for this test to not crash during bytecompilation.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS It worked.
PASS successfullyParsed is true
TEST COMPLETE
| {
"pile_set_name": "Github"
} |
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
@import './variables.less';
@import './themes/@{so-theme}.less';
@import './themes/vars-inject.less';
// Document
//
// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
// 2. Change the default font family in all browsers.
// 3. Correct the line height in all browsers.
// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so
// we force a non-overlapping, non-auto-hiding scrollbar to counteract.
// 6. Change the default tap highlight to be completely transparent in iOS.
*,
*::before,
*::after {
box-sizing: border-box; // 1
}
html {
font-family: sans-serif; // 2
line-height: 1.15; // 3
-ms-overflow-style: scrollbar; // 5
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6
-webkit-text-size-adjust: 100%; // 4
-ms-text-size-adjust: 100%; // 4
}
// IE10+ doesn't honor `<meta name="viewport">` in some cases.
@at-root {
@-ms-viewport {
width: device-width;
}
}
// stylelint-disable selector-list-comma-newline-after
// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
article,
aside,
dialog,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
display: block;
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
color: @text-color;
font-family: @font-family-base;
font-size: @font-size-base;
line-height: @line-height-base;
}
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
margin: 0.67em 0;
font-size: 2em;
}
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main {
/* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
overflow: visible; /* 2 */
height: 0; /* 1 */
box-sizing: content-box; /* 1 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: @font-family-monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; // remove the gray background on active links in IE 10.
color: @link-color;
cursor: pointer;
outline: none;
text-decoration: @link-decoration;
-webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+.
transition: color 0.3s;
&:active,
&:hover {
color: @link-hover-color;
outline: 0;
text-decoration: @link-hover-decoration;
}
&[disabled] {
color: @link-disabled-color;
cursor: not-allowed;
pointer-events: none;
}
}
/**
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
margin: 0; /* 2 */
font-family: inherit;
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
padding: 0;
border-style: none;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
display: table; /* 1 */
max-width: 100%; /* 1 */
box-sizing: border-box; /* 1 */
padding: 0; /* 3 */
color: inherit; /* 2 */
white-space: normal; /* 1 */
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type='checkbox'],
[type='radio'] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
*/
[type='search']::-webkit-search-cancel-button,
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
*/
details, /* 1 */
menu {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Scripting
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
*/
template {
display: none;
}
/* Hidden
========================================================================== */
/**
* Add the correct display in IE 10-.
*/
[hidden] {
display: none;
}
//
// Typography
// --------------------------------------------------
// Headings
// -------------------------
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
color: @headings-color;
font-family: @headings-font-family;
font-weight: @headings-font-weight;
line-height: @headings-line-height;
small,
.small {
color: @headings-small-color;
font-weight: normal;
line-height: 1;
}
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: @line-height-computed;
margin-bottom: (@line-height-computed / 2);
small,
.small {
font-size: 65%;
}
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: (@line-height-computed / 2);
margin-bottom: (@line-height-computed / 2);
small,
.small {
font-size: 75%;
}
}
/*
h1, .h1 { font-size: @font-size-h1; }
h2, .h2 { font-size: @font-size-h2; }
h3, .h3 { font-size: @font-size-h3; }
h4, .h4 { font-size: @font-size-h4; }
h5, .h5 { font-size: @font-size-h5; }
h6, .h6 { font-size: @font-size-h6; }
*/
// Body text
// -------------------------
p {
margin: 0 0 (@line-height-computed / 2);
}
| {
"pile_set_name": "Github"
} |
<?php
return array(
"TITLE" => '标题',
"CATEGORY" => '分类',
"HITS" => '点击量',
"KEYWORDS" => '关键字',
"COMMENT_COUNT" => '评论量',
"SOURCE" => '来源',
"ABSTRACT" => '摘要',
"THUMBNAIL" => "缩略图",
"AUTHOR" => '作者',
"PUBLISH_DATE" => '发布时间'
); | {
"pile_set_name": "Github"
} |
CONFIG_NET_SCHED=y
#
# Queueing/Scheduling
#
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_INGRESS=m
#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=m
CONFIG_NET_EMATCH_NBYTE=m
CONFIG_NET_EMATCH_U32=m
CONFIG_NET_EMATCH_META=m
CONFIG_NET_EMATCH_TEXT=m
CONFIG_NET_EMATCH_IPSET=m
CONFIG_NET_EMATCH_IPT=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_SAMPLE=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m
CONFIG_NET_ACT_SKBEDIT=m
CONFIG_NET_ACT_CSUM=m
CONFIG_NET_ACT_VLAN=m
CONFIG_NET_ACT_BPF=m
CONFIG_NET_ACT_CONNMARK=m
CONFIG_NET_ACT_CTINFO=m
CONFIG_NET_ACT_SKBMOD=m
CONFIG_NET_ACT_IFE=m
CONFIG_NET_ACT_TUNNEL_KEY=m
CONFIG_NET_ACT_MPLS=m
CONFIG_NET_IFE_SKBMARK=m
CONFIG_NET_IFE_SKBPRIO=m
CONFIG_NET_IFE_SKBTCINDEX=m
CONFIG_NET_SCH_FIFO=y
| {
"pile_set_name": "Github"
} |
https://dl.google.com/dl/android/aosp/fugu-mob30g-factory-167614e5.tgz
image-fugu-mob30g.zip
boot.img
| {
"pile_set_name": "Github"
} |
/*
* LCD panel support for the TI OMAP H3 board
*
* Copyright (C) 2004 Nokia Corporation
* Author: Imre Deak <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/i2c/tps65010.h>
#include <asm/gpio.h>
#include "omapfb.h"
#define MODULE_NAME "omapfb-lcd_h3"
static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
{
return 0;
}
static void h3_panel_cleanup(struct lcd_panel *panel)
{
}
static int h3_panel_enable(struct lcd_panel *panel)
{
int r = 0;
/* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
r = tps65010_set_gpio_out_value(GPIO1, HIGH);
if (!r)
r = tps65010_set_gpio_out_value(GPIO2, HIGH);
if (r)
pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
return r;
}
static void h3_panel_disable(struct lcd_panel *panel)
{
int r = 0;
/* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
r = tps65010_set_gpio_out_value(GPIO1, LOW);
if (!r)
tps65010_set_gpio_out_value(GPIO2, LOW);
if (r)
pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
}
static unsigned long h3_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}
struct lcd_panel h3_panel = {
.name = "h3",
.config = OMAP_LCDC_PANEL_TFT,
.data_lines = 16,
.bpp = 16,
.x_res = 240,
.y_res = 320,
.pixel_clock = 12000,
.hsw = 12,
.hfp = 14,
.hbp = 72 - 12,
.vsw = 1,
.vfp = 1,
.vbp = 0,
.pcd = 0,
.init = h3_panel_init,
.cleanup = h3_panel_cleanup,
.enable = h3_panel_enable,
.disable = h3_panel_disable,
.get_caps = h3_panel_get_caps,
};
static int h3_panel_probe(struct platform_device *pdev)
{
omapfb_register_panel(&h3_panel);
return 0;
}
static int h3_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int h3_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
{
return 0;
}
static int h3_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver h3_panel_driver = {
.probe = h3_panel_probe,
.remove = h3_panel_remove,
.suspend = h3_panel_suspend,
.resume = h3_panel_resume,
.driver = {
.name = "lcd_h3",
.owner = THIS_MODULE,
},
};
module_platform_driver(h3_panel_driver);
| {
"pile_set_name": "Github"
} |
//>>built
define("dojox/charting/themes/CubanShirts",["../SimpleTheme","./common"],function(_1,_2){
_2.CubanShirts=new _1({colors:["#d42d2a","#004f80","#989736","#2085c7","#7f7f33"]});
return _2.CubanShirts;
});
| {
"pile_set_name": "Github"
} |
package sdkrand
import (
"math/rand"
"sync"
"time"
)
// lockedSource is a thread-safe implementation of rand.Source
type lockedSource struct {
lk sync.Mutex
src rand.Source
}
func (r *lockedSource) Int63() (n int64) {
r.lk.Lock()
n = r.src.Int63()
r.lk.Unlock()
return
}
func (r *lockedSource) Seed(seed int64) {
r.lk.Lock()
r.src.Seed(seed)
r.lk.Unlock()
}
// SeededRand is a new RNG using a thread safe implementation of rand.Source
var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
| {
"pile_set_name": "Github"
} |
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3d, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions, and the following disclaimer.
2. 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.
3. Neither the name of the University nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
=============================================================================*/
#include <stdint.h>
#include "platform.h"
#include "primitiveTypes.h"
#ifndef softfloat_addCarryM
uint_fast8_t
softfloat_addCarryM(
uint_fast8_t size_words,
const uint32_t *aPtr,
const uint32_t *bPtr,
uint_fast8_t carry,
uint32_t *zPtr
)
{
unsigned int index, lastIndex;
uint32_t wordA, wordZ;
index = indexWordLo( size_words );
lastIndex = indexWordHi( size_words );
for (;;) {
wordA = aPtr[index];
wordZ = wordA + bPtr[index] + carry;
zPtr[index] = wordZ;
if ( wordZ != wordA ) carry = (wordZ < wordA);
if ( index == lastIndex ) break;
index += wordIncr;
}
return carry;
}
#endif
| {
"pile_set_name": "Github"
} |
// +build linux
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package empty_dir
import (
"os"
"path"
"testing"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
utiltesting "k8s.io/client-go/util/testing"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
"k8s.io/kubernetes/pkg/volume/util"
)
// Construct an instance of a plugin, by name.
func makePluginUnderTest(t *testing.T, plugName, basePath string) volume.VolumePlugin {
plugMgr := volume.VolumePluginMgr{}
plugMgr.InitPlugins(ProbeVolumePlugins(), nil /* prober */, volumetest.NewFakeVolumeHost(basePath, nil, nil))
plug, err := plugMgr.FindPluginByName(plugName)
if err != nil {
t.Errorf("Can't find the plugin by name")
}
return plug
}
func TestCanSupport(t *testing.T) {
tmpDir, err := utiltesting.MkTmpdir("emptydirTest")
if err != nil {
t.Fatalf("can't make a temp dir: %v", err)
}
defer os.RemoveAll(tmpDir)
plug := makePluginUnderTest(t, "kubernetes.io/empty-dir", tmpDir)
if plug.GetPluginName() != "kubernetes.io/empty-dir" {
t.Errorf("Wrong name: %s", plug.GetPluginName())
}
if !plug.CanSupport(&volume.Spec{Volume: &v1.Volume{VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}}}) {
t.Errorf("Expected true")
}
if plug.CanSupport(&volume.Spec{Volume: &v1.Volume{VolumeSource: v1.VolumeSource{}}}) {
t.Errorf("Expected false")
}
}
type fakeMountDetector struct {
medium v1.StorageMedium
isMount bool
}
func (fake *fakeMountDetector) GetMountMedium(path string) (v1.StorageMedium, bool, error) {
return fake.medium, fake.isMount, nil
}
func TestPluginEmptyRootContext(t *testing.T) {
doTestPlugin(t, pluginTestConfig{
medium: v1.StorageMediumDefault,
expectedSetupMounts: 0,
expectedTeardownMounts: 0})
}
func TestPluginHugetlbfs(t *testing.T) {
doTestPlugin(t, pluginTestConfig{
medium: v1.StorageMediumHugePages,
expectedSetupMounts: 1,
expectedTeardownMounts: 0,
shouldBeMountedBeforeTeardown: true,
})
}
type pluginTestConfig struct {
medium v1.StorageMedium
idempotent bool
expectedSetupMounts int
shouldBeMountedBeforeTeardown bool
expectedTeardownMounts int
}
// doTestPlugin sets up a volume and tears it back down.
func doTestPlugin(t *testing.T, config pluginTestConfig) {
basePath, err := utiltesting.MkTmpdir("emptydir_volume_test")
if err != nil {
t.Fatalf("can't make a temp rootdir: %v", err)
}
defer os.RemoveAll(basePath)
var (
volumePath = path.Join(basePath, "pods/poduid/volumes/kubernetes.io~empty-dir/test-volume")
metadataDir = path.Join(basePath, "pods/poduid/plugins/kubernetes.io~empty-dir/test-volume")
plug = makePluginUnderTest(t, "kubernetes.io/empty-dir", basePath)
volumeName = "test-volume"
spec = &v1.Volume{
Name: volumeName,
VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{Medium: config.medium}},
}
physicalMounter = mount.FakeMounter{}
mountDetector = fakeMountDetector{}
pod = &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
UID: types.UID("poduid"),
},
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-2Mi"): resource.MustParse("100Mi"),
},
},
},
},
},
}
)
if config.idempotent {
physicalMounter.MountPoints = []mount.MountPoint{
{
Path: volumePath,
},
}
util.SetReady(metadataDir)
}
mounter, err := plug.(*emptyDirPlugin).newMounterInternal(volume.NewSpecFromVolume(spec),
pod,
&physicalMounter,
&mountDetector,
volume.VolumeOptions{})
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
if mounter == nil {
t.Errorf("Got a nil Mounter")
}
volPath := mounter.GetPath()
if volPath != volumePath {
t.Errorf("Got unexpected path: %s", volPath)
}
if err := mounter.SetUp(nil); err != nil {
t.Errorf("Expected success, got: %v", err)
}
// Stat the directory and check the permission bits
fileinfo, err := os.Stat(volPath)
if !config.idempotent {
if err != nil {
if os.IsNotExist(err) {
t.Errorf("SetUp() failed, volume path not created: %s", volPath)
} else {
t.Errorf("SetUp() failed: %v", err)
}
}
if e, a := perm, fileinfo.Mode().Perm(); e != a {
t.Errorf("Unexpected file mode for %v: expected: %v, got: %v", volPath, e, a)
}
} else if err == nil {
// If this test is for idempotency and we were able
// to stat the volume path, it's an error.
t.Errorf("Volume directory was created unexpectedly")
}
// Check the number of mounts performed during setup
if e, a := config.expectedSetupMounts, len(physicalMounter.Log); e != a {
t.Errorf("Expected %v physicalMounter calls during setup, got %v", e, a)
} else if config.expectedSetupMounts == 1 &&
(physicalMounter.Log[0].Action != mount.FakeActionMount || (physicalMounter.Log[0].FSType != "tmpfs" && physicalMounter.Log[0].FSType != "hugetlbfs")) {
t.Errorf("Unexpected physicalMounter action during setup: %#v", physicalMounter.Log[0])
}
physicalMounter.ResetLog()
// Make an unmounter for the volume
teardownMedium := v1.StorageMediumDefault
if config.medium == v1.StorageMediumMemory {
teardownMedium = v1.StorageMediumMemory
}
unmounterMountDetector := &fakeMountDetector{medium: teardownMedium, isMount: config.shouldBeMountedBeforeTeardown}
unmounter, err := plug.(*emptyDirPlugin).newUnmounterInternal(volumeName, types.UID("poduid"), &physicalMounter, unmounterMountDetector)
if err != nil {
t.Errorf("Failed to make a new Unmounter: %v", err)
}
if unmounter == nil {
t.Errorf("Got a nil Unmounter")
}
// Tear down the volume
if err := unmounter.TearDown(); err != nil {
t.Errorf("Expected success, got: %v", err)
}
if _, err := os.Stat(volPath); err == nil {
t.Errorf("TearDown() failed, volume path still exists: %s", volPath)
} else if !os.IsNotExist(err) {
t.Errorf("TearDown() failed: %v", err)
}
// Check the number of physicalMounter calls during tardown
if e, a := config.expectedTeardownMounts, len(physicalMounter.Log); e != a {
t.Errorf("Expected %v physicalMounter calls during teardown, got %v", e, a)
} else if config.expectedTeardownMounts == 1 && physicalMounter.Log[0].Action != mount.FakeActionUnmount {
t.Errorf("Unexpected physicalMounter action during teardown: %#v", physicalMounter.Log[0])
}
physicalMounter.ResetLog()
}
func TestPluginBackCompat(t *testing.T) {
basePath, err := utiltesting.MkTmpdir("emptydirTest")
if err != nil {
t.Fatalf("can't make a temp dir: %v", err)
}
defer os.RemoveAll(basePath)
plug := makePluginUnderTest(t, "kubernetes.io/empty-dir", basePath)
spec := &v1.Volume{
Name: "vol1",
}
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(volume.NewSpecFromVolume(spec), pod, volume.VolumeOptions{})
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
if mounter == nil {
t.Fatalf("Got a nil Mounter")
}
volPath := mounter.GetPath()
if volPath != path.Join(basePath, "pods/poduid/volumes/kubernetes.io~empty-dir/vol1") {
t.Errorf("Got unexpected path: %s", volPath)
}
}
// TestMetrics tests that MetricProvider methods return sane values.
func TestMetrics(t *testing.T) {
// Create an empty temp directory for the volume
tmpDir, err := utiltesting.MkTmpdir("empty_dir_test")
if err != nil {
t.Fatalf("Can't make a tmp dir: %v", err)
}
defer os.RemoveAll(tmpDir)
plug := makePluginUnderTest(t, "kubernetes.io/empty-dir", tmpDir)
spec := &v1.Volume{
Name: "vol1",
}
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(volume.NewSpecFromVolume(spec), pod, volume.VolumeOptions{})
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
if mounter == nil {
t.Fatalf("Got a nil Mounter")
}
// Need to create the subdirectory
os.MkdirAll(mounter.GetPath(), 0755)
expectedEmptyDirUsage, err := volumetest.FindEmptyDirectoryUsageOnTmpfs()
if err != nil {
t.Errorf("Unexpected error finding expected empty directory usage on tmpfs: %v", err)
}
// TODO(pwittroc): Move this into a reusable testing utility
metrics, err := mounter.GetMetrics()
if err != nil {
t.Errorf("Unexpected error when calling GetMetrics %v", err)
}
if e, a := expectedEmptyDirUsage.Value(), metrics.Used.Value(); e != a {
t.Errorf("Unexpected value for empty directory; expected %v, got %v", e, a)
}
if metrics.Capacity.Value() <= 0 {
t.Errorf("Expected Capacity to be greater than 0")
}
if metrics.Available.Value() <= 0 {
t.Errorf("Expected Available to be greater than 0")
}
}
func TestGetHugePagesMountOptions(t *testing.T) {
testCases := map[string]struct {
pod *v1.Pod
shouldFail bool
expectedResult string
}{
"testWithProperValues": {
pod: &v1.Pod{
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-2Mi"): resource.MustParse("100Mi"),
},
},
},
},
},
},
shouldFail: false,
expectedResult: "pagesize=2Mi",
},
"testWithProperValuesAndDifferentPageSize": {
pod: &v1.Pod{
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("2Gi"),
},
},
},
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("4Gi"),
},
},
},
},
},
},
shouldFail: false,
expectedResult: "pagesize=1Gi",
},
"InitContainerAndContainerHasProperValues": {
pod: &v1.Pod{
Spec: v1.PodSpec{
InitContainers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("2Gi"),
},
},
},
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("4Gi"),
},
},
},
},
},
},
shouldFail: false,
expectedResult: "pagesize=1Gi",
},
"InitContainerAndContainerHasDifferentPageSizes": {
pod: &v1.Pod{
Spec: v1.PodSpec{
InitContainers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-2Mi"): resource.MustParse("2Gi"),
},
},
},
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("4Gi"),
},
},
},
},
},
},
shouldFail: true,
expectedResult: "",
},
"ContainersWithMultiplePageSizes": {
pod: &v1.Pod{
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-1Gi"): resource.MustParse("2Gi"),
},
},
},
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceName("hugepages-2Mi"): resource.MustParse("100Mi"),
},
},
},
},
},
},
shouldFail: true,
expectedResult: "",
},
"PodWithNoHugePagesRequest": {
pod: &v1.Pod{},
shouldFail: true,
expectedResult: "",
},
}
for testCaseName, testCase := range testCases {
value, err := getPageSizeMountOptionFromPod(testCase.pod)
if testCase.shouldFail && err == nil {
t.Errorf("Expected an error in %v", testCaseName)
} else if !testCase.shouldFail && err != nil {
t.Errorf("Unexpected error in %v, got %v", testCaseName, err)
} else if testCase.expectedResult != value {
t.Errorf("Unexpected mountOptions for Pod. Expected %v, got %v", testCase.expectedResult, value)
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
function testAssignmentExpressionWithDivEqual( &$foo )
{
$foo /= 4;
}
| {
"pile_set_name": "Github"
} |
/*
* ModeShape (http://www.modeshape.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.modeshape.sequencer.wsdl;
import static org.modeshape.sequencer.wsdl.WsdlLexicon.Namespace.PREFIX;
import org.modeshape.common.annotation.Immutable;
/**
* A lexicon of names used within the XSD sequencer.
*/
@Immutable
public class WsdlLexicon {
public static class Namespace {
public static final String URI = "http://schemas.xmlsoap.org/wsdl/";
public static final String PREFIX = "wsdl";
}
public static final String WSDL_DOCUMENT = PREFIX + ":wsdlDocument";
public static final String SCHEMA = PREFIX + ":schema";
public static final String IMPORTED_XSD = PREFIX + ":importedXsd";
public static final String INCLUDED_XSD = PREFIX + ":includedXsd";
public static final String REDEFINED_XSD = PREFIX + ":redefinedXsd";
public static final String NC_NAME = PREFIX + ":ncName";
public static final String NAMESPACE = PREFIX + ":namespace";
public static final String MESSAGES = PREFIX + ":messages";
public static final String MESSAGE = PREFIX + ":message";
public static final String PART = PREFIX + ":part";
public static final String ELEMENT_REFERENCE = PREFIX + ":element";
public static final String ELEMENT_NAME = PREFIX + ":elementName";
public static final String ELEMENT_NAMESPACE = PREFIX + ":elementNamespace";
public static final String TYPE_REFERENCE = PREFIX + ":type";
public static final String TYPE_NAME = PREFIX + ":typeName";
public static final String TYPE_NAMESPACE = PREFIX + ":typeNamespace";
public static final String OPERATION = PREFIX + ":operation";
public static final String INPUT = PREFIX + ":input";
public static final String OUTPUT = PREFIX + ":output";
public static final String FAULT = PREFIX + ":fault";
public static final String MESSAGE_REFERENCE = PREFIX + ":message";
public static final String MESSAGE_NAME = PREFIX + ":messageName";
public static final String MESSAGE_NAMESPACE = PREFIX + ":messageNamespace";
public static final String OPERATION_INPUT = PREFIX + ":operationInput";
public static final String OPERATION_OUTPUT = PREFIX + ":operationOutput";
public static final String PARAMETER_ORDER = PREFIX + ":parameterOrder";
public static final String PORT_TYPES = PREFIX + ":portTypes";
public static final String PORT_TYPE = PREFIX + ":portType";
public static final String BINDINGS = PREFIX + ":bindings";
public static final String BINDING = PREFIX + ":binding";
public static final String BINDING_OPERATION = PREFIX + ":bindingOperation";
public static final String BINDING_OPERATION_INPUT = PREFIX + ":bindingOperationInput";
public static final String BINDING_OPERATION_OUTPUT = PREFIX + ":bindingOperationOutput";
public static final String BINDING_OPERATION_FAULT = PREFIX + ":bindingOperationFault";
public static final String INPUT_REFERENCE = PREFIX + ":input";
public static final String INPUT_NAME = PREFIX + ":inputName";
public static final String OUTPUT_REFERENCE = PREFIX + ":output";
public static final String OUTPUT_NAME = PREFIX + ":outputName";
public static final String SERVICES = PREFIX + ":services";
public static final String SERVICE = PREFIX + ":service";
public static final String PORT = PREFIX + ":port";
public static final String BINDING_REFERENCE = PREFIX + ":binding";
public static final String BINDING_NAME = PREFIX + ":bindingName";
public static final String BINDING_NAMESPACE = PREFIX + ":bindingNamespace";
/*
* SOAP Extensions
*/
public static final String SOAP_ADDRESS = PREFIX + ":soapAddress";
public static final String SOAP_LOCATION = PREFIX + ":soapLocation";
public static final String SOAP_BINDING = PREFIX + ":soapBinding";
public static final String STYLE = PREFIX + ":style";
public static final String TRANSPORT = PREFIX + ":transport";
public static final String SOAP_OPERATION = PREFIX + ":soapOperation";
public static final String SOAP_ACTION = PREFIX + ":soapAction";
public static final String SOAP_BODY = PREFIX + ":soapBody";
public static final String ENCODING_STYLE = PREFIX + ":encodingStyle";
public static final String PARTS = PREFIX + ":parts";
public static final String USE = PREFIX + ":use";
public static final String SOAP_FAULT = PREFIX + ":soapFault";
public static final String SOAP_HEADER = PREFIX + ":soapHeader";
public static final String SOAP_HEADER_FAULT = PREFIX + ":soapHeaderFault";
/*
* MIME Extensions
*/
public static final String MIME_MULTIPART_RELATED = PREFIX + ":mimeMultipartRelated";
public static final String MIME_PART = PREFIX + ":mimePart";
public static final String MIME_TYPE = PREFIX + ":mimeType";
public static final String MIME_CONTENT = PREFIX + ":mimeContent";
public static final String MIME_XML = PREFIX + ":mimeXml";
/*
* HTTP Extensions
*/
public static final String HTTP_URL_REPLACEMENT = PREFIX + ":httpUrlReplacement";
public static final String HTTP_URL_ENCODED = PREFIX + ":httpUrlEncoded";
public static final String HTTP_ADDRESS = PREFIX + ":httpAddress";
public static final String HTTP_BINDING = PREFIX + ":httpBinding";
public static final String HTTP_OPERATION = PREFIX + ":httpOperation";
public static final String LOCATION = PREFIX + ":location";
public static final String VERB = PREFIX + ":verb";
}
| {
"pile_set_name": "Github"
} |
/**************************************
CSS Reset
***************************************/
body,p,h1,h2,h3,ul,li,input,div {
margin: 0;
padding: 0;
}
input,img {
border: none;
}
ul,li {
list-style: none;
}
a {
text-decoration: none;
color: #444444 ;
}
a:hover {
color: red;
}
body {
background-color: #FFFFFF;
font: normal normal 12px Arial,Verdana,"\5b8b\4f53";
color: #606060;
}
h1,h2,h3,b,strong {
font-weight: normal;
font-size: 12px;
}
/**************************************
Float
***************************************/
.fl { float: left; }
.fr { float: right; }
.clearfix:after {
content: "";
height: 0;
line-height: 0;
display: block;
visibility: hidden;
clear: both;
}
.clearfix { zoom: 1;}
/**************************************
Font
***************************************/
.f13 { font-size: 13px;}
.f14 { font-size: 14px;}
.center { margin: 0 auto;}
.sj {
border-style: solid dashed dashed dashed;
border-width: 5px;
border-color: #606060 transparent transparent transparent;
width: 0;
height: 0;
display: inline-block;
vertical-align: sub;
}
.center {
margin: 0 auto;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context="com.lin.reswipecard.DemoActivity">
<Button
android:layout_width="match_parent"
android:id="@+id/normal"
android:padding="10dp"
android:textSize="16sp"
android:text="测试"
android:gravity="center"
android:layout_height="wrap_content"/>
<Button
android:layout_width="match_parent"
android:id="@+id/tantan"
android:padding="10dp"
android:textSize="16sp"
android:text="探探效果"
android:visibility="gone"
android:gravity="center"
android:layout_height="wrap_content"/>
<Button
android:layout_width="match_parent"
android:id="@+id/fanyijun"
android:visibility="gone"
android:padding="10dp"
android:textSize="16sp"
android:text="翻译君效果"
android:gravity="center"
android:layout_height="wrap_content"/>
</LinearLayout>
| {
"pile_set_name": "Github"
} |
resource "aws_instance" "bar" {
provisioner "shell" {}
}
| {
"pile_set_name": "Github"
} |
module Refactor.InlineBinding.NotOccurring where
a = () | {
"pile_set_name": "Github"
} |
#!/bin/bash
numsockets=2
for ((i=0;i<10;i++)); do ./linux.sh $numsockets; done
for ((i=0;i<10;i++)); do ./docker.sh $numsockets; done
for ((i=0;i<10;i++)); do ./vm.sh $numsockets; done
numsockets=1
for ((i=0;i<10;i++)); do ./linux.sh $numsockets; done
for ((i=0;i<10;i++)); do ./docker.sh $numsockets; done
for ((i=0;i<10;i++)); do ./vm.sh $numsockets; done
| {
"pile_set_name": "Github"
} |
---
title: Modal React component
components: Modal
githubLabel: 'component: Modal'
waiAria: 'https://www.w3.org/TR/wai-aria-practices/#dialog_modal'
---
# Modal
<p class="description">モーダルコンポーネントは、ダイアログ、ポップオーバー、ライトボックスなどを作成するための強固な基盤を提供します。</p>
コンポーネントは、backdropコンポーネントの前にその `children`ノードをレンダリングします。 `Modal` には、次のような重要な機能があります。 `Modal` には、次のような重要な機能があります。 `Modal` には、次のような重要な機能があります。 `Modal` には、次のような重要な機能があります。
- 💄 一度に1つだけでは不十分な場合に、モーダルスタッキングを管理します。
- 🔐モーダルの下のインタラクションを無効にするためのバックドロップを作成します。
- 🔐open開いている間、ページコンテンツのスクロールを無効にします。
- ♿️フォーカスを適切に管理します。モーダルコンテンツに移動し、 して、モーダルが閉じられるまでそこに保持します。
- ♿️適切なARIAロールを自動的に追加します。
- [5 kB gzipped](/size-snapshot).
[The palette](/system/palette/) style関数。
> **用語の注記**。 「モーダル」という用語は「ダイアログ」を意味するために使用されることがありますが、これは誤った呼び名です。 A modal window describes parts of a UI. 要素が[アプリケーションの他の部分との対話をブロックする場合](https://en.wikipedia.org/wiki/Modal_window)、その要素はモーダルであると見なされます。
要素が[アプリケーションの他の部分との対話をブロックする場合](https://en.wikipedia.org/wiki/Modal_window)、その要素はモーダルであると見なされます。 This component should respect the following conditions:
- [Dialog](/components/dialogs/)
- [Drawer](/components/drawers/)
- [Menu](/components/menus/)
- [Popover](/components/popover/)
## Simple modal
{{"demo": "pages/components/modal/SimpleModal.js"}}
`アウトライン:0` CSSプロパティでアウトライン(多くの場合、青または金)を無効にできることに注意してください。
## Transitions
The open/close state of the modal can be animated with a transition component. This component should respect the following conditions:
- Be a direct child descendent of the modal.
- `in`プロパティを持っています。 これは、オープン/クローズ状態に対応します。
- Call the `onEnter` callback prop when the enter transition starts.
- Call the `onExited` callback prop when the exit transition is completed. These two callbacks allow the modal to unmount the child content when closed and fully transitioned.
Modal has built-in support for [react-transition-group](https://github.com/reactjs/react-transition-group).
{{"demo": "pages/components/modal/TransitionsModal.js"}}
Alternatively, you can use [react-spring](https://github.com/react-spring/react-spring).
{{"demo": "pages/components/modal/SpringModal.js"}}
## Server-side modal
React は、サーバー上の [`createPortal()`](https://reactjs.org/docs/portals.html) APIを[サポートしません。](https://github.com/facebook/react/issues/13097) In order to display the modal, you need to disable the portal feature with the `disablePortal` prop: In order to display the modal, you need to disable the portal feature with the `disablePortal` prop: In order to display the modal, you need to disable the portal feature with the `disablePortal` prop: In order to display the modal, you need to disable the portal feature with the `disablePortal` prop:
{{"demo": "pages/components/modal/ServerModal.js"}}
## 制限事項
### Focus trap
The modal moves the focus back to the body of the component if the focus tries to escape it.
This is done for accessibility purposes, however, it might create issues. In the event the users need to interact with another part of the page, e.g. with a chatbot window, you can disable the behavior:
```jsx
<Modal disableEnforceFocus />
```
## アクセシビリティ
(WAI-ARIA: https://www.w3.org/TR/wai-aria-practices/#dialog_modal)
- **用語の注記**。 「モーダル」という用語は「ダイアログ」を意味するために使用されることがありますが、これは誤った呼び名です。 A modal window describes parts of a UI. 要素が[アプリケーションの他の部分との対話をブロックする場合](https://en.wikipedia.org/wiki/Modal_window)、その要素はモーダルであると見なされます。
```jsx
<Modal
aria-labelledby="modal-title"
aria-describedby="modal-description"
>
<h2 id="modal-title">
My Title
</h2>
<p id="modal-description">
My Description
</p>
</Modal>
```
- The [WAI-ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html) can help you set the initial focus on the most relevant element, based on your modal content.
- Windows under a modal are **inert**. Keep in mind that a "modal window" overlays on either the primary window or another modal window. Keep in mind that a "modal window" overlays on either the primary window or another modal window. This might create [conflicting behaviors](#focus-trap).
| {
"pile_set_name": "Github"
} |
module.exports = function(hljs) {
var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
var HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';
return {
aliases: ['hx'],
keywords: {
keyword: 'break case cast catch continue default do dynamic else enum extern ' +
'for function here if import in inline never new override package private get set ' +
'public return static super switch this throw trace try typedef untyped using var while ' +
HAXE_BASIC_TYPES,
built_in:
'trace this',
literal:
'true false null _'
},
contains: [
{ className: 'string', // interpolate-able strings
begin: '\'', end: '\'',
contains: [
hljs.BACKSLASH_ESCAPE,
{ className: 'subst', // interpolation
begin: '\\$\\{', end: '\\}'
},
{ className: 'subst', // interpolation
begin: '\\$', end: '\\W}'
}
]
},
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
{ className: 'meta', // compiler meta
begin: '@:', end: '$'
},
{ className: 'meta', // compiler conditionals
begin: '#', end: '$',
keywords: {'meta-keyword': 'if else elseif end error'}
},
{ className: 'type', // function types
begin: ':[ \t]*', end: '[^A-Za-z0-9_ \t\\->]',
excludeBegin: true, excludeEnd: true,
relevance: 0
},
{ className: 'type', // types
begin: ':[ \t]*', end: '\\W',
excludeBegin: true, excludeEnd: true
},
{ className: 'type', // instantiation
begin: 'new *', end: '\\W',
excludeBegin: true, excludeEnd: true
},
{ className: 'class', // enums
beginKeywords: 'enum', end: '\\{',
contains: [
hljs.TITLE_MODE
]
},
{ className: 'class', // abstracts
beginKeywords: 'abstract', end: '[\\{$]',
contains: [
{ className: 'type',
begin: '\\(', end: '\\)',
excludeBegin: true, excludeEnd: true
},
{ className: 'type',
begin: 'from +', end: '\\W',
excludeBegin: true, excludeEnd: true
},
{ className: 'type',
begin: 'to +', end: '\\W',
excludeBegin: true, excludeEnd: true
},
hljs.TITLE_MODE
],
keywords: {
keyword: 'abstract from to'
}
},
{ className: 'class', // classes
begin: '\\b(class|interface) +', end: '[\\{$]', excludeEnd: true,
keywords: 'class interface',
contains: [
{ className: 'keyword',
begin: '\\b(extends|implements) +',
keywords: 'extends implements',
contains: [
{
className: 'type',
begin: hljs.IDENT_RE,
relevance: 0
}
]
},
hljs.TITLE_MODE
]
},
{ className: 'function',
beginKeywords: 'function', end: '\\(', excludeEnd: true,
illegal: '\\S',
contains: [
hljs.TITLE_MODE
]
}
],
illegal: /<\//
};
}; | {
"pile_set_name": "Github"
} |
<html>
<head>
<title>BOOST_PP_LIST_TO_ARRAY</title>
<link rel="stylesheet" type="text/css" href="../styles.css"></head>
<body>
<div style="margin-left: 0px;"> The <b>BOOST_PP_LIST_TO_ARRAY</b> macro
converts a <i>list</i> to an <i>array</i>. </div>
<h4> Usage </h4>
<div class="code"> <b>BOOST_PP_LIST_TO_ARRAY</b>(<i>list</i>) </div>
<h4> Arguments </h4>
<dl>
<dt>list</dt>
<dd> The <i>list</i> to be converted. </dd>
</dl>
<h4>Remarks</h4>
<div>
This macro uses <b>BOOST_PP_WHILE</b>.
Within <b>BOOST_PP_WHILE</b>, it is more efficient to use <b>BOOST_PP_LIST_TO_ARRAY_D</b>.
</div>
<h4>See Also</h4>
<ul>
<li><a href="list_to_array_d.html">BOOST_PP_LIST_TO_ARRAY_D</a></li>
</ul>
<h4> Requirements </h4>
<div> <b>Header:</b> <a href="../headers/list/to_array.html"><boost/preprocessor/list/to_array.hpp></a>
</div>
<h4> Sample Code </h4>
<div>
<pre>#include <<a href="../headers/list/to_array.html">boost/preprocessor/list/to_array.hpp</a>><br><br>#define LIST (a, (b, (c, <a href="nil.html">BOOST_PP_NIL</a>)))<br><br><a href="list_to_array.html">BOOST_PP_LIST_TO_ARRAY</a>(LIST) // expands to (3, (a, b, c))<br></pre>
</div>
<hr size="1">
<div style="margin-left: 0px;"> <i></i><i>© Copyright Edward Diener 2011</i> </div>
<div style="margin-left: 0px;">
<p><small>Distributed under the Boost Software License, Version 1.0.
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
// Scintilla source code edit control
/** @file PerLine.h
** Manages data associated with each line of the document
**/
// Copyright 1998-2009 by Neil Hodgson <[email protected]>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PERLINE_H
#define PERLINE_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
/**
* This holds the marker identifier and the marker type to display.
* MarkerHandleNumbers are members of lists.
*/
struct MarkerHandleNumber {
int handle;
int number;
MarkerHandleNumber *next;
};
/**
* A marker handle set contains any number of MarkerHandleNumbers.
*/
class MarkerHandleSet {
MarkerHandleNumber *root;
public:
MarkerHandleSet();
~MarkerHandleSet();
int Length() const;
int MarkValue() const; ///< Bit set of marker numbers.
bool Contains(int handle) const;
bool InsertHandle(int handle, int markerNum);
void RemoveHandle(int handle);
bool RemoveNumber(int markerNum, bool all);
void CombineWith(MarkerHandleSet *other);
};
class LineMarkers : public PerLine {
SplitVector<MarkerHandleSet *> markers;
/// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
int handleCurrent;
public:
LineMarkers() : handleCurrent(0) {
}
virtual ~LineMarkers();
virtual void Init();
virtual void InsertLine(int line);
virtual void RemoveLine(int line);
int MarkValue(int line);
int MarkerNext(int lineStart, int mask) const;
int AddMark(int line, int marker, int lines);
void MergeMarkers(int pos);
bool DeleteMark(int line, int markerNum, bool all);
void DeleteMarkFromHandle(int markerHandle);
int LineFromHandle(int markerHandle);
};
class LineLevels : public PerLine {
SplitVector<int> levels;
public:
virtual ~LineLevels();
virtual void Init();
virtual void InsertLine(int line);
virtual void RemoveLine(int line);
void ExpandLevels(int sizeNew=-1);
void ClearLevels();
int SetLevel(int line, int level, int lines);
int GetLevel(int line) const;
};
class LineState : public PerLine {
SplitVector<int> lineStates;
public:
LineState() {
}
virtual ~LineState();
virtual void Init();
virtual void InsertLine(int line);
virtual void RemoveLine(int line);
int SetLineState(int line, int state);
int GetLineState(int line);
int GetMaxLineState() const;
};
class LineAnnotation : public PerLine {
SplitVector<char *> annotations;
public:
LineAnnotation() {
}
virtual ~LineAnnotation();
virtual void Init();
virtual void InsertLine(int line);
virtual void RemoveLine(int line);
bool MultipleStyles(int line) const;
int Style(int line) const;
const char *Text(int line) const;
const unsigned char *Styles(int line) const;
void SetText(int line, const char *text);
void ClearAll();
void SetStyle(int line, int style);
void SetStyles(int line, const unsigned char *styles);
int Length(int line) const;
int Lines(int line) const;
};
typedef std::vector<int> TabstopList;
class LineTabstops : public PerLine {
SplitVector<TabstopList *> tabstops;
public:
LineTabstops() {
}
virtual ~LineTabstops();
virtual void Init();
virtual void InsertLine(int line);
virtual void RemoveLine(int line);
bool ClearTabstops(int line);
bool AddTabstop(int line, int x);
int GetNextTabstop(int line, int x) const;
};
#ifdef SCI_NAMESPACE
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
# frozen_string_literal: true
require_relative 'terraform/apply_command'
require_relative 'terraform/destroy_command'
module Pharos
class TerraformCommand < Pharos::Command
subcommand "apply", "apply terraform configuration", Pharos::Terraform::ApplyCommand
subcommand "destroy", "destroy terraformed infrastructure", Pharos::Terraform::DestroyCommand
end
end
| {
"pile_set_name": "Github"
} |
#!/bin/sh
cd `dirname $0`
exec erl -pa $PWD/ebin $PWD/deps/*/ebin -boot start_sasl -s reloader -s reversehttp "$@"
| {
"pile_set_name": "Github"
} |
package com.java.hoohack.useCommand;
public class LightOffCommand implements Command {
private Light light;
public LightOffCommand(Light light) {
this.light = light;
}
@Override
public void execute() {
light.off();
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2007, Google Inc.
// All rights reserved.
//
// 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.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// 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
// OWNER 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.
//
// Author: [email protected] (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
//
// This file tests the built-in actions generated by a script.
#include "gmock/gmock-generated-actions.h"
#include <functional>
#include <sstream>
#include <string>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace testing {
namespace gmock_generated_actions_test {
using ::std::plus;
using ::std::string;
using ::std::tr1::get;
using ::std::tr1::make_tuple;
using ::std::tr1::tuple;
using ::std::tr1::tuple_element;
using testing::_;
using testing::Action;
using testing::ActionInterface;
using testing::ByRef;
using testing::DoAll;
using testing::Invoke;
using testing::Return;
using testing::ReturnNew;
using testing::SetArgPointee;
using testing::StaticAssertTypeEq;
using testing::Unused;
using testing::WithArgs;
// For suppressing compiler warnings on conversion possibly losing precision.
inline short Short(short n) { return n; } // NOLINT
inline char Char(char ch) { return ch; }
// Sample functions and functors for testing various actions.
int Nullary() { return 1; }
class NullaryFunctor {
public:
int operator()() { return 2; }
};
bool g_done = false;
bool Unary(int x) { return x < 0; }
const char* Plus1(const char* s) { return s + 1; }
bool ByConstRef(const string& s) { return s == "Hi"; }
const double g_double = 0;
bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
string ByNonConstRef(string& s) { return s += "+"; } // NOLINT
struct UnaryFunctor {
int operator()(bool x) { return x ? 1 : -1; }
};
const char* Binary(const char* input, short n) { return input + n; } // NOLINT
void VoidBinary(int, char) { g_done = true; }
int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
void VoidTernary(int, char, bool) { g_done = true; }
int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
string Concat4(const char* s1, const char* s2, const char* s3,
const char* s4) {
return string(s1) + s2 + s3 + s4;
}
int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
struct SumOf5Functor {
int operator()(int a, int b, int c, int d, int e) {
return a + b + c + d + e;
}
};
string Concat5(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5) {
return string(s1) + s2 + s3 + s4 + s5;
}
int SumOf6(int a, int b, int c, int d, int e, int f) {
return a + b + c + d + e + f;
}
struct SumOf6Functor {
int operator()(int a, int b, int c, int d, int e, int f) {
return a + b + c + d + e + f;
}
};
string Concat6(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5, const char* s6) {
return string(s1) + s2 + s3 + s4 + s5 + s6;
}
string Concat7(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5, const char* s6,
const char* s7) {
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
}
string Concat8(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5, const char* s6,
const char* s7, const char* s8) {
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
}
string Concat9(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5, const char* s6,
const char* s7, const char* s8, const char* s9) {
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
}
string Concat10(const char* s1, const char* s2, const char* s3,
const char* s4, const char* s5, const char* s6,
const char* s7, const char* s8, const char* s9,
const char* s10) {
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
}
// A helper that turns the type of a C-string literal from const
// char[N] to const char*.
inline const char* CharPtr(const char* s) { return s; }
// Tests InvokeArgument<N>(...).
// Tests using InvokeArgument with a nullary function.
TEST(InvokeArgumentTest, Function0) {
Action<int(int, int(*)())> a = InvokeArgument<1>(); // NOLINT
EXPECT_EQ(1, a.Perform(make_tuple(2, &Nullary)));
}
// Tests using InvokeArgument with a unary function.
TEST(InvokeArgumentTest, Functor1) {
Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
EXPECT_EQ(1, a.Perform(make_tuple(UnaryFunctor())));
}
// Tests using InvokeArgument with a 5-ary function.
TEST(InvokeArgumentTest, Function5) {
Action<int(int(*)(int, int, int, int, int))> a = // NOLINT
InvokeArgument<0>(10000, 2000, 300, 40, 5);
EXPECT_EQ(12345, a.Perform(make_tuple(&SumOf5)));
}
// Tests using InvokeArgument with a 5-ary functor.
TEST(InvokeArgumentTest, Functor5) {
Action<int(SumOf5Functor)> a = // NOLINT
InvokeArgument<0>(10000, 2000, 300, 40, 5);
EXPECT_EQ(12345, a.Perform(make_tuple(SumOf5Functor())));
}
// Tests using InvokeArgument with a 6-ary function.
TEST(InvokeArgumentTest, Function6) {
Action<int(int(*)(int, int, int, int, int, int))> a = // NOLINT
InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
EXPECT_EQ(123456, a.Perform(make_tuple(&SumOf6)));
}
// Tests using InvokeArgument with a 6-ary functor.
TEST(InvokeArgumentTest, Functor6) {
Action<int(SumOf6Functor)> a = // NOLINT
InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
EXPECT_EQ(123456, a.Perform(make_tuple(SumOf6Functor())));
}
// Tests using InvokeArgument with a 7-ary function.
TEST(InvokeArgumentTest, Function7) {
Action<string(string(*)(const char*, const char*, const char*,
const char*, const char*, const char*,
const char*))> a =
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
EXPECT_EQ("1234567", a.Perform(make_tuple(&Concat7)));
}
// Tests using InvokeArgument with a 8-ary function.
TEST(InvokeArgumentTest, Function8) {
Action<string(string(*)(const char*, const char*, const char*,
const char*, const char*, const char*,
const char*, const char*))> a =
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
EXPECT_EQ("12345678", a.Perform(make_tuple(&Concat8)));
}
// Tests using InvokeArgument with a 9-ary function.
TEST(InvokeArgumentTest, Function9) {
Action<string(string(*)(const char*, const char*, const char*,
const char*, const char*, const char*,
const char*, const char*, const char*))> a =
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
EXPECT_EQ("123456789", a.Perform(make_tuple(&Concat9)));
}
// Tests using InvokeArgument with a 10-ary function.
TEST(InvokeArgumentTest, Function10) {
Action<string(string(*)(const char*, const char*, const char*,
const char*, const char*, const char*,
const char*, const char*, const char*,
const char*))> a =
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
EXPECT_EQ("1234567890", a.Perform(make_tuple(&Concat10)));
}
// Tests using InvokeArgument with a function that takes a pointer argument.
TEST(InvokeArgumentTest, ByPointerFunction) {
Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
InvokeArgument<0>(static_cast<const char*>("Hi"), Short(1));
EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
}
// Tests using InvokeArgument with a function that takes a const char*
// by passing it a C-string literal.
TEST(InvokeArgumentTest, FunctionWithCStringLiteral) {
Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
InvokeArgument<0>("Hi", Short(1));
EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
}
// Tests using InvokeArgument with a function that takes a const reference.
TEST(InvokeArgumentTest, ByConstReferenceFunction) {
Action<bool(bool(*function)(const string& s))> a = // NOLINT
InvokeArgument<0>(string("Hi"));
// When action 'a' is constructed, it makes a copy of the temporary
// string object passed to it, so it's OK to use 'a' later, when the
// temporary object has already died.
EXPECT_TRUE(a.Perform(make_tuple(&ByConstRef)));
}
// Tests using InvokeArgument with ByRef() and a function that takes a
// const reference.
TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction) {
Action<bool(bool(*)(const double& x))> a = // NOLINT
InvokeArgument<0>(ByRef(g_double));
// The above line calls ByRef() on a const value.
EXPECT_TRUE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
double x = 0;
a = InvokeArgument<0>(ByRef(x)); // This calls ByRef() on a non-const.
EXPECT_FALSE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
}
// Tests using WithArgs and with an action that takes 1 argument.
TEST(WithArgsTest, OneArg) {
Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
EXPECT_TRUE(a.Perform(make_tuple(1.5, -1)));
EXPECT_FALSE(a.Perform(make_tuple(1.5, 1)));
}
// Tests using WithArgs with an action that takes 2 arguments.
TEST(WithArgsTest, TwoArgs) {
Action<const char*(const char* s, double x, short n)> a =
WithArgs<0, 2>(Invoke(Binary));
const char s[] = "Hello";
EXPECT_EQ(s + 2, a.Perform(make_tuple(CharPtr(s), 0.5, Short(2))));
}
// Tests using WithArgs with an action that takes 3 arguments.
TEST(WithArgsTest, ThreeArgs) {
Action<int(int, double, char, short)> a = // NOLINT
WithArgs<0, 2, 3>(Invoke(Ternary));
EXPECT_EQ(123, a.Perform(make_tuple(100, 6.5, Char(20), Short(3))));
}
// Tests using WithArgs with an action that takes 4 arguments.
TEST(WithArgsTest, FourArgs) {
Action<string(const char*, const char*, double, const char*, const char*)> a =
WithArgs<4, 3, 1, 0>(Invoke(Concat4));
EXPECT_EQ("4310", a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
CharPtr("3"), CharPtr("4"))));
}
// Tests using WithArgs with an action that takes 5 arguments.
TEST(WithArgsTest, FiveArgs) {
Action<string(const char*, const char*, const char*,
const char*, const char*)> a =
WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
EXPECT_EQ("43210",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
CharPtr("3"), CharPtr("4"))));
}
// Tests using WithArgs with an action that takes 6 arguments.
TEST(WithArgsTest, SixArgs) {
Action<string(const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 2, 1, 0>(Invoke(Concat6));
EXPECT_EQ("012210",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"))));
}
// Tests using WithArgs with an action that takes 7 arguments.
TEST(WithArgsTest, SevenArgs) {
Action<string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 2, 1, 0>(Invoke(Concat7));
EXPECT_EQ("0123210",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 8 arguments.
TEST(WithArgsTest, EightArgs) {
Action<string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 0, 1, 2, 3>(Invoke(Concat8));
EXPECT_EQ("01230123",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 9 arguments.
TEST(WithArgsTest, NineArgs) {
Action<string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 1, 2, 3, 2, 3>(Invoke(Concat9));
EXPECT_EQ("012312323",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 10 arguments.
TEST(WithArgsTest, TenArgs) {
Action<string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(Concat10));
EXPECT_EQ("0123210123",
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
CharPtr("3"))));
}
// Tests using WithArgs with an action that is not Invoke().
class SubstractAction : public ActionInterface<int(int, int)> { // NOLINT
public:
virtual int Perform(const tuple<int, int>& args) {
return get<0>(args) - get<1>(args);
}
};
TEST(WithArgsTest, NonInvokeAction) {
Action<int(const string&, int, int)> a = // NOLINT
WithArgs<2, 1>(MakeAction(new SubstractAction));
EXPECT_EQ(8, a.Perform(make_tuple(string("hi"), 2, 10)));
}
// Tests using WithArgs to pass all original arguments in the original order.
TEST(WithArgsTest, Identity) {
Action<int(int x, char y, short z)> a = // NOLINT
WithArgs<0, 1, 2>(Invoke(Ternary));
EXPECT_EQ(123, a.Perform(make_tuple(100, Char(20), Short(3))));
}
// Tests using WithArgs with repeated arguments.
TEST(WithArgsTest, RepeatedArguments) {
Action<int(bool, int m, int n)> a = // NOLINT
WithArgs<1, 1, 1, 1>(Invoke(SumOf4));
EXPECT_EQ(4, a.Perform(make_tuple(false, 1, 10)));
}
// Tests using WithArgs with reversed argument order.
TEST(WithArgsTest, ReversedArgumentOrder) {
Action<const char*(short n, const char* input)> a = // NOLINT
WithArgs<1, 0>(Invoke(Binary));
const char s[] = "Hello";
EXPECT_EQ(s + 2, a.Perform(make_tuple(Short(2), CharPtr(s))));
}
// Tests using WithArgs with compatible, but not identical, argument types.
TEST(WithArgsTest, ArgsOfCompatibleTypes) {
Action<long(short x, char y, double z, char c)> a = // NOLINT
WithArgs<0, 1, 3>(Invoke(Ternary));
EXPECT_EQ(123, a.Perform(make_tuple(Short(100), Char(20), 5.6, Char(3))));
}
// Tests using WithArgs with an action that returns void.
TEST(WithArgsTest, VoidAction) {
Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
g_done = false;
a.Perform(make_tuple(1.5, 'a', 3));
EXPECT_TRUE(g_done);
}
// Tests DoAll(a1, a2).
TEST(DoAllTest, TwoActions) {
int n = 0;
Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
Return(2));
EXPECT_EQ(2, a.Perform(make_tuple(&n)));
EXPECT_EQ(1, n);
}
// Tests DoAll(a1, a2, a3).
TEST(DoAllTest, ThreeActions) {
int m = 0, n = 0;
Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
SetArgPointee<1>(2),
Return(3));
EXPECT_EQ(3, a.Perform(make_tuple(&m, &n)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
}
// Tests DoAll(a1, a2, a3, a4).
TEST(DoAllTest, FourActions) {
int m = 0, n = 0;
char ch = '\0';
Action<int(int*, int*, char*)> a = // NOLINT
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
Return(3));
EXPECT_EQ(3, a.Perform(make_tuple(&m, &n, &ch)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', ch);
}
// Tests DoAll(a1, a2, a3, a4, a5).
TEST(DoAllTest, FiveActions) {
int m = 0, n = 0;
char a = '\0', b = '\0';
Action<int(int*, int*, char*, char*)> action = // NOLINT
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
}
// Tests DoAll(a1, a2, ..., a6).
TEST(DoAllTest, SixActions) {
int m = 0, n = 0;
char a = '\0', b = '\0', c = '\0';
Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
EXPECT_EQ('c', c);
}
// Tests DoAll(a1, a2, ..., a7).
TEST(DoAllTest, SevenActions) {
int m = 0, n = 0;
char a = '\0', b = '\0', c = '\0', d = '\0';
Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
SetArgPointee<5>('d'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
EXPECT_EQ('c', c);
EXPECT_EQ('d', d);
}
// Tests DoAll(a1, a2, ..., a8).
TEST(DoAllTest, EightActions) {
int m = 0, n = 0;
char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0';
Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
char*)> action =
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
SetArgPointee<5>('d'),
SetArgPointee<6>('e'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
EXPECT_EQ('c', c);
EXPECT_EQ('d', d);
EXPECT_EQ('e', e);
}
// Tests DoAll(a1, a2, ..., a9).
TEST(DoAllTest, NineActions) {
int m = 0, n = 0;
char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0', f = '\0';
Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
char*, char*)> action =
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
SetArgPointee<5>('d'),
SetArgPointee<6>('e'),
SetArgPointee<7>('f'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
EXPECT_EQ('c', c);
EXPECT_EQ('d', d);
EXPECT_EQ('e', e);
EXPECT_EQ('f', f);
}
// Tests DoAll(a1, a2, ..., a10).
TEST(DoAllTest, TenActions) {
int m = 0, n = 0;
char a = '\0', b = '\0', c = '\0', d = '\0';
char e = '\0', f = '\0', g = '\0';
Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
char*, char*, char*)> action =
DoAll(SetArgPointee<0>(1),
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
SetArgPointee<5>('d'),
SetArgPointee<6>('e'),
SetArgPointee<7>('f'),
SetArgPointee<8>('g'),
Return(3));
EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
EXPECT_EQ('b', b);
EXPECT_EQ('c', c);
EXPECT_EQ('d', d);
EXPECT_EQ('e', e);
EXPECT_EQ('f', f);
EXPECT_EQ('g', g);
}
// The ACTION*() macros trigger warning C4100 (unreferenced formal
// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
// the macro definition, as the warnings are generated when the macro
// is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here.
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4100)
#endif
// Tests the ACTION*() macro family.
// Tests that ACTION() can define an action that doesn't reference the
// mock function arguments.
ACTION(Return5) { return 5; }
TEST(ActionMacroTest, WorksWhenNotReferencingArguments) {
Action<double()> a1 = Return5();
EXPECT_DOUBLE_EQ(5, a1.Perform(make_tuple()));
Action<int(double, bool)> a2 = Return5();
EXPECT_EQ(5, a2.Perform(make_tuple(1, true)));
}
// Tests that ACTION() can define an action that returns void.
ACTION(IncrementArg1) { (*arg1)++; }
TEST(ActionMacroTest, WorksWhenReturningVoid) {
Action<void(int, int*)> a1 = IncrementArg1();
int n = 0;
a1.Perform(make_tuple(5, &n));
EXPECT_EQ(1, n);
}
// Tests that the body of ACTION() can reference the type of the
// argument.
ACTION(IncrementArg2) {
StaticAssertTypeEq<int*, arg2_type>();
arg2_type temp = arg2;
(*temp)++;
}
TEST(ActionMacroTest, CanReferenceArgumentType) {
Action<void(int, bool, int*)> a1 = IncrementArg2();
int n = 0;
a1.Perform(make_tuple(5, false, &n));
EXPECT_EQ(1, n);
}
// Tests that the body of ACTION() can reference the argument tuple
// via args_type and args.
ACTION(Sum2) {
StaticAssertTypeEq< ::std::tr1::tuple<int, char, int*>, args_type>();
args_type args_copy = args;
return get<0>(args_copy) + get<1>(args_copy);
}
TEST(ActionMacroTest, CanReferenceArgumentTuple) {
Action<int(int, char, int*)> a1 = Sum2();
int dummy = 0;
EXPECT_EQ(11, a1.Perform(make_tuple(5, Char(6), &dummy)));
}
// Tests that the body of ACTION() can reference the mock function
// type.
int Dummy(bool flag) { return flag? 1 : 0; }
ACTION(InvokeDummy) {
StaticAssertTypeEq<int(bool), function_type>();
function_type* fp = &Dummy;
return (*fp)(true);
}
TEST(ActionMacroTest, CanReferenceMockFunctionType) {
Action<int(bool)> a1 = InvokeDummy();
EXPECT_EQ(1, a1.Perform(make_tuple(true)));
EXPECT_EQ(1, a1.Perform(make_tuple(false)));
}
// Tests that the body of ACTION() can reference the mock function's
// return type.
ACTION(InvokeDummy2) {
StaticAssertTypeEq<int, return_type>();
return_type result = Dummy(true);
return result;
}
TEST(ActionMacroTest, CanReferenceMockFunctionReturnType) {
Action<int(bool)> a1 = InvokeDummy2();
EXPECT_EQ(1, a1.Perform(make_tuple(true)));
EXPECT_EQ(1, a1.Perform(make_tuple(false)));
}
// Tests that ACTION() works for arguments passed by const reference.
ACTION(ReturnAddrOfConstBoolReferenceArg) {
StaticAssertTypeEq<const bool&, arg1_type>();
return &arg1;
}
TEST(ActionMacroTest, WorksForConstReferenceArg) {
Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
const bool b = false;
EXPECT_EQ(&b, a.Perform(tuple<int, const bool&>(0, b)));
}
// Tests that ACTION() works for arguments passed by non-const reference.
ACTION(ReturnAddrOfIntReferenceArg) {
StaticAssertTypeEq<int&, arg0_type>();
return &arg0;
}
TEST(ActionMacroTest, WorksForNonConstReferenceArg) {
Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
int n = 0;
EXPECT_EQ(&n, a.Perform(tuple<int&, bool, int>(n, true, 1)));
}
// Tests that ACTION() can be used in a namespace.
namespace action_test {
ACTION(Sum) { return arg0 + arg1; }
} // namespace action_test
TEST(ActionMacroTest, WorksInNamespace) {
Action<int(int, int)> a1 = action_test::Sum();
EXPECT_EQ(3, a1.Perform(make_tuple(1, 2)));
}
// Tests that the same ACTION definition works for mock functions with
// different argument numbers.
ACTION(PlusTwo) { return arg0 + 2; }
TEST(ActionMacroTest, WorksForDifferentArgumentNumbers) {
Action<int(int)> a1 = PlusTwo();
EXPECT_EQ(4, a1.Perform(make_tuple(2)));
Action<double(float, void*)> a2 = PlusTwo();
int dummy;
EXPECT_DOUBLE_EQ(6, a2.Perform(make_tuple(4.0f, &dummy)));
}
// Tests that ACTION_P can define a parameterized action.
ACTION_P(Plus, n) { return arg0 + n; }
TEST(ActionPMacroTest, DefinesParameterizedAction) {
Action<int(int m, bool t)> a1 = Plus(9);
EXPECT_EQ(10, a1.Perform(make_tuple(1, true)));
}
// Tests that the body of ACTION_P can reference the argument types
// and the parameter type.
ACTION_P(TypedPlus, n) {
arg0_type t1 = arg0;
n_type t2 = n;
return t1 + t2;
}
TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
Action<int(char m, bool t)> a1 = TypedPlus(9);
EXPECT_EQ(10, a1.Perform(make_tuple(Char(1), true)));
}
// Tests that a parameterized action can be used in any mock function
// whose type is compatible.
TEST(ActionPMacroTest, WorksInCompatibleMockFunction) {
Action<std::string(const std::string& s)> a1 = Plus("tail");
const std::string re = "re";
EXPECT_EQ("retail", a1.Perform(make_tuple(re)));
}
// Tests that we can use ACTION*() to define actions overloaded on the
// number of parameters.
ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; }
ACTION_P(OverloadedAction, default_value) {
return arg0 ? arg1 : default_value;
}
ACTION_P2(OverloadedAction, true_value, false_value) {
return arg0 ? true_value : false_value;
}
TEST(ActionMacroTest, CanDefineOverloadedActions) {
typedef Action<const char*(bool, const char*)> MyAction;
const MyAction a1 = OverloadedAction();
EXPECT_STREQ("hello", a1.Perform(make_tuple(false, CharPtr("world"))));
EXPECT_STREQ("world", a1.Perform(make_tuple(true, CharPtr("world"))));
const MyAction a2 = OverloadedAction("hi");
EXPECT_STREQ("hi", a2.Perform(make_tuple(false, CharPtr("world"))));
EXPECT_STREQ("world", a2.Perform(make_tuple(true, CharPtr("world"))));
const MyAction a3 = OverloadedAction("hi", "you");
EXPECT_STREQ("hi", a3.Perform(make_tuple(true, CharPtr("world"))));
EXPECT_STREQ("you", a3.Perform(make_tuple(false, CharPtr("world"))));
}
// Tests ACTION_Pn where n >= 3.
ACTION_P3(Plus, m, n, k) { return arg0 + m + n + k; }
TEST(ActionPnMacroTest, WorksFor3Parameters) {
Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
EXPECT_DOUBLE_EQ(3123.4, a1.Perform(make_tuple(3000, true)));
Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
const std::string re = "re";
EXPECT_EQ("retail->", a2.Perform(make_tuple(re)));
}
ACTION_P4(Plus, p0, p1, p2, p3) { return arg0 + p0 + p1 + p2 + p3; }
TEST(ActionPnMacroTest, WorksFor4Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4);
EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(make_tuple(10)));
}
ACTION_P5(Plus, p0, p1, p2, p3, p4) { return arg0 + p0 + p1 + p2 + p3 + p4; }
TEST(ActionPnMacroTest, WorksFor5Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(make_tuple(10)));
}
ACTION_P6(Plus, p0, p1, p2, p3, p4, p5) {
return arg0 + p0 + p1 + p2 + p3 + p4 + p5;
}
TEST(ActionPnMacroTest, WorksFor6Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(make_tuple(10)));
}
ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6) {
return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6;
}
TEST(ActionPnMacroTest, WorksFor7Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(make_tuple(10)));
}
ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7) {
return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7;
}
TEST(ActionPnMacroTest, WorksFor8Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8, a1.Perform(make_tuple(10)));
}
ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8) {
return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8;
}
TEST(ActionPnMacroTest, WorksFor9Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, a1.Perform(make_tuple(10)));
}
ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param) {
arg0_type t0 = arg0;
last_param_type t9 = last_param;
return t0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + t9;
}
TEST(ActionPnMacroTest, WorksFor10Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10,
a1.Perform(make_tuple(10)));
}
// Tests that the action body can promote the parameter types.
ACTION_P2(PadArgument, prefix, suffix) {
// The following lines promote the two parameters to desired types.
std::string prefix_str(prefix);
char suffix_char = static_cast<char>(suffix);
return prefix_str + arg0 + suffix_char;
}
TEST(ActionPnMacroTest, SimpleTypePromotion) {
Action<std::string(const char*)> no_promo =
PadArgument(std::string("foo"), 'r');
Action<std::string(const char*)> promo =
PadArgument("foo", static_cast<int>('r'));
EXPECT_EQ("foobar", no_promo.Perform(make_tuple(CharPtr("ba"))));
EXPECT_EQ("foobar", promo.Perform(make_tuple(CharPtr("ba"))));
}
// Tests that we can partially restrict parameter types using a
// straight-forward pattern.
// Defines a generic action that doesn't restrict the types of its
// parameters.
ACTION_P3(ConcatImpl, a, b, c) {
std::stringstream ss;
ss << a << b << c;
return ss.str();
}
// Next, we try to restrict that either the first parameter is a
// string, or the second parameter is an int.
// Defines a partially specialized wrapper that restricts the first
// parameter to std::string.
template <typename T1, typename T2>
// ConcatImplActionP3 is the class template ACTION_P3 uses to
// implement ConcatImpl. We shouldn't change the name as this
// pattern requires the user to use it directly.
ConcatImplActionP3<std::string, T1, T2>
Concat(const std::string& a, T1 b, T2 c) {
if (true) {
// This branch verifies that ConcatImpl() can be invoked without
// explicit template arguments.
return ConcatImpl(a, b, c);
} else {
// This branch verifies that ConcatImpl() can also be invoked with
// explicit template arguments. It doesn't really need to be
// executed as this is a compile-time verification.
return ConcatImpl<std::string, T1, T2>(a, b, c);
}
}
// Defines another partially specialized wrapper that restricts the
// second parameter to int.
template <typename T1, typename T2>
ConcatImplActionP3<T1, int, T2>
Concat(T1 a, int b, T2 c) {
return ConcatImpl(a, b, c);
}
TEST(ActionPnMacroTest, CanPartiallyRestrictParameterTypes) {
Action<const std::string()> a1 = Concat("Hello", "1", 2);
EXPECT_EQ("Hello12", a1.Perform(make_tuple()));
a1 = Concat(1, 2, 3);
EXPECT_EQ("123", a1.Perform(make_tuple()));
}
// Verifies the type of an ACTION*.
ACTION(DoFoo) {}
ACTION_P(DoFoo, p) {}
ACTION_P2(DoFoo, p0, p1) {}
TEST(ActionPnMacroTest, TypesAreCorrect) {
// DoFoo() must be assignable to a DoFooAction variable.
DoFooAction a0 = DoFoo();
// DoFoo(1) must be assignable to a DoFooActionP variable.
DoFooActionP<int> a1 = DoFoo(1);
// DoFoo(p1, ..., pk) must be assignable to a DoFooActionPk
// variable, and so on.
DoFooActionP2<int, char> a2 = DoFoo(1, '2');
PlusActionP3<int, int, char> a3 = Plus(1, 2, '3');
PlusActionP4<int, int, int, char> a4 = Plus(1, 2, 3, '4');
PlusActionP5<int, int, int, int, char> a5 = Plus(1, 2, 3, 4, '5');
PlusActionP6<int, int, int, int, int, char> a6 = Plus(1, 2, 3, 4, 5, '6');
PlusActionP7<int, int, int, int, int, int, char> a7 =
Plus(1, 2, 3, 4, 5, 6, '7');
PlusActionP8<int, int, int, int, int, int, int, char> a8 =
Plus(1, 2, 3, 4, 5, 6, 7, '8');
PlusActionP9<int, int, int, int, int, int, int, int, char> a9 =
Plus(1, 2, 3, 4, 5, 6, 7, 8, '9');
PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
// Avoid "unused variable" warnings.
(void)a0;
(void)a1;
(void)a2;
(void)a3;
(void)a4;
(void)a5;
(void)a6;
(void)a7;
(void)a8;
(void)a9;
(void)a10;
}
// Tests that an ACTION_P*() action can be explicitly instantiated
// with reference-typed parameters.
ACTION_P(Plus1, x) { return x; }
ACTION_P2(Plus2, x, y) { return x + y; }
ACTION_P3(Plus3, x, y, z) { return x + y + z; }
ACTION_P10(Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
}
TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes) {
int x = 1, y = 2, z = 3;
const tuple<> empty = make_tuple();
Action<int()> a = Plus1<int&>(x);
EXPECT_EQ(1, a.Perform(empty));
a = Plus2<const int&, int&>(x, y);
EXPECT_EQ(3, a.Perform(empty));
a = Plus3<int&, const int&, int&>(x, y, z);
EXPECT_EQ(6, a.Perform(empty));
int n[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
a = Plus10<const int&, int&, const int&, int&, const int&, int&, const int&,
int&, const int&, int&>(n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7],
n[8], n[9]);
EXPECT_EQ(55, a.Perform(empty));
}
class NullaryConstructorClass {
public:
NullaryConstructorClass() : value_(123) {}
int value_;
};
// Tests using ReturnNew() with a nullary constructor.
TEST(ReturnNewTest, NoArgs) {
Action<NullaryConstructorClass*()> a = ReturnNew<NullaryConstructorClass>();
NullaryConstructorClass* c = a.Perform(make_tuple());
EXPECT_EQ(123, c->value_);
delete c;
}
class UnaryConstructorClass {
public:
explicit UnaryConstructorClass(int value) : value_(value) {}
int value_;
};
// Tests using ReturnNew() with a unary constructor.
TEST(ReturnNewTest, Unary) {
Action<UnaryConstructorClass*()> a = ReturnNew<UnaryConstructorClass>(4000);
UnaryConstructorClass* c = a.Perform(make_tuple());
EXPECT_EQ(4000, c->value_);
delete c;
}
TEST(ReturnNewTest, UnaryWorksWhenMockMethodHasArgs) {
Action<UnaryConstructorClass*(bool, int)> a =
ReturnNew<UnaryConstructorClass>(4000);
UnaryConstructorClass* c = a.Perform(make_tuple(false, 5));
EXPECT_EQ(4000, c->value_);
delete c;
}
TEST(ReturnNewTest, UnaryWorksWhenMockMethodReturnsPointerToConst) {
Action<const UnaryConstructorClass*()> a =
ReturnNew<UnaryConstructorClass>(4000);
const UnaryConstructorClass* c = a.Perform(make_tuple());
EXPECT_EQ(4000, c->value_);
delete c;
}
class TenArgConstructorClass {
public:
TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5,
int a6, int a7, int a8, int a9, int a10)
: value_(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10) {
}
int value_;
};
// Tests using ReturnNew() with a 10-argument constructor.
TEST(ReturnNewTest, ConstructorThatTakes10Arguments) {
Action<TenArgConstructorClass*()> a =
ReturnNew<TenArgConstructorClass>(1000000000, 200000000, 30000000,
4000000, 500000, 60000,
7000, 800, 90, 0);
TenArgConstructorClass* c = a.Perform(make_tuple());
EXPECT_EQ(1234567890, c->value_);
delete c;
}
// Tests that ACTION_TEMPLATE works when there is no value parameter.
ACTION_TEMPLATE(CreateNew,
HAS_1_TEMPLATE_PARAMS(typename, T),
AND_0_VALUE_PARAMS()) {
return new T;
}
TEST(ActionTemplateTest, WorksWithoutValueParam) {
const Action<int*()> a = CreateNew<int>();
int* p = a.Perform(make_tuple());
delete p;
}
// Tests that ACTION_TEMPLATE works when there are value parameters.
ACTION_TEMPLATE(CreateNew,
HAS_1_TEMPLATE_PARAMS(typename, T),
AND_1_VALUE_PARAMS(a0)) {
return new T(a0);
}
TEST(ActionTemplateTest, WorksWithValueParams) {
const Action<int*()> a = CreateNew<int>(42);
int* p = a.Perform(make_tuple());
EXPECT_EQ(42, *p);
delete p;
}
// Tests that ACTION_TEMPLATE works for integral template parameters.
ACTION_TEMPLATE(MyDeleteArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) {
delete std::tr1::get<k>(args);
}
// Resets a bool variable in the destructor.
class BoolResetter {
public:
explicit BoolResetter(bool* value) : value_(value) {}
~BoolResetter() { *value_ = false; }
private:
bool* value_;
};
TEST(ActionTemplateTest, WorksForIntegralTemplateParams) {
const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
int n = 0;
bool b = true;
BoolResetter* resetter = new BoolResetter(&b);
a.Perform(make_tuple(&n, resetter));
EXPECT_FALSE(b); // Verifies that resetter is deleted.
}
// Tests that ACTION_TEMPLATES works for template template parameters.
ACTION_TEMPLATE(ReturnSmartPointer,
HAS_1_TEMPLATE_PARAMS(template <typename Pointee> class,
Pointer),
AND_1_VALUE_PARAMS(pointee)) {
return Pointer<pointee_type>(new pointee_type(pointee));
}
TEST(ActionTemplateTest, WorksForTemplateTemplateParameters) {
using ::testing::internal::linked_ptr;
const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
linked_ptr<int> p = a.Perform(make_tuple());
EXPECT_EQ(42, *p);
}
// Tests that ACTION_TEMPLATE works for 10 template parameters.
template <typename T1, typename T2, typename T3, int k4, bool k5,
unsigned int k6, typename T7, typename T8, typename T9>
struct GiantTemplate {
public:
explicit GiantTemplate(int a_value) : value(a_value) {}
int value;
};
ACTION_TEMPLATE(ReturnGiant,
HAS_10_TEMPLATE_PARAMS(
typename, T1,
typename, T2,
typename, T3,
int, k4,
bool, k5,
unsigned int, k6,
class, T7,
class, T8,
class, T9,
template <typename T> class, T10),
AND_1_VALUE_PARAMS(value)) {
return GiantTemplate<T10<T1>, T2, T3, k4, k5, k6, T7, T8, T9>(value);
}
TEST(ActionTemplateTest, WorksFor10TemplateParameters) {
using ::testing::internal::linked_ptr;
typedef GiantTemplate<linked_ptr<int>, bool, double, 5,
true, 6, char, unsigned, int> Giant;
const Action<Giant()> a = ReturnGiant<
int, bool, double, 5, true, 6, char, unsigned, int, linked_ptr>(42);
Giant giant = a.Perform(make_tuple());
EXPECT_EQ(42, giant.value);
}
// Tests that ACTION_TEMPLATE works for 10 value parameters.
ACTION_TEMPLATE(ReturnSum,
HAS_1_TEMPLATE_PARAMS(typename, Number),
AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)) {
return static_cast<Number>(v1) + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;
}
TEST(ActionTemplateTest, WorksFor10ValueParameters) {
const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
EXPECT_EQ(55, a.Perform(make_tuple()));
}
// Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
// on the number of value parameters.
ACTION(ReturnSum) { return 0; }
ACTION_P(ReturnSum, x) { return x; }
ACTION_TEMPLATE(ReturnSum,
HAS_1_TEMPLATE_PARAMS(typename, Number),
AND_2_VALUE_PARAMS(v1, v2)) {
return static_cast<Number>(v1) + v2;
}
ACTION_TEMPLATE(ReturnSum,
HAS_1_TEMPLATE_PARAMS(typename, Number),
AND_3_VALUE_PARAMS(v1, v2, v3)) {
return static_cast<Number>(v1) + v2 + v3;
}
ACTION_TEMPLATE(ReturnSum,
HAS_2_TEMPLATE_PARAMS(typename, Number, int, k),
AND_4_VALUE_PARAMS(v1, v2, v3, v4)) {
return static_cast<Number>(v1) + v2 + v3 + v4 + k;
}
TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
const Action<int()> a0 = ReturnSum();
const Action<int()> a1 = ReturnSum(1);
const Action<int()> a2 = ReturnSum<int>(1, 2);
const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);
EXPECT_EQ(0, a0.Perform(make_tuple()));
EXPECT_EQ(1, a1.Perform(make_tuple()));
EXPECT_EQ(3, a2.Perform(make_tuple()));
EXPECT_EQ(6, a3.Perform(make_tuple()));
EXPECT_EQ(12345, a4.Perform(make_tuple()));
}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // namespace gmock_generated_actions_test
} // namespace testing
| {
"pile_set_name": "Github"
} |
// SSDT to correct some problems headphone/mic on CX20752.
//
// Note: For use with the Anti-pop patches (seee RehabMan NUC repo)
//
// created by nayeweiyang/XuWang
DefinitionBlock ("", "SSDT", 1, "hack", "CX20752", 0)
{
External(_SB.PCI0.HDEF, DeviceObj)
Name(_SB.PCI0.HDEF.RMCF, Package()
{
"CodecCommander", Package()
{
"Custom Commands", Package()
{
Package(){}, // signifies Array instead of Dictionary
Package()
{
// 0x19 SET_PIN_WIDGET_CONTROL 0x24
"Command", Buffer() { 0x01, 0x97, 0x07, 0x24 },
"On Init", ">y",
"On Sleep", ">n",
"On Wake", ">y",
},
Package()
{
// 0x1a SET_PIN_WIDGET_CONTROL 0x24
"Command", Buffer() { 0x01, 0xa7, 0x07, 0x24 },
"On Init", ">y",
"On Sleep", ">n",
"On Wake", ">y",
},
},
"Perform Reset", ">n",
"Perform Reset on External Wake", ">n",
},
})
}
//EOF
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED
#define BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/has_xxx.hpp>
namespace boost { namespace mpl { namespace aux {
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false)
}}}
#endif // BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
ALTER TABLE {$NAMESPACE}_legalpad.legalpad_documentsignature
ADD exemptionPHID VARCHAR(64) COLLATE utf8_bin AFTER isExemption;
| {
"pile_set_name": "Github"
} |
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Carlos Henrique <[email protected]>, 2019. #zanata
# gnome-mpv <[email protected]>, 2019. #zanata
# Carlos Henrique <[email protected]>, 2020. #zanata
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-20 20:48+0700\n"
"PO-Revision-Date: 2020-08-10 05:01-0400\n"
"Last-Translator: Carlos Henrique <[email protected]>\n"
"Language-Team: Portuguese (Brazil)\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"X-Generator: Zanata 4.6.2\n"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:11
msgid ""
"Whether the settings has already been migrated from the previous version"
msgstr "Se as configurações já migraram da versão anterior"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:17
msgid "Whether or not to automatically resize window to fit video"
msgstr "Redimensionar ou não a janela automaticamente para o tamanho do vídeo"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:23
msgid "Enable or disable dark theme"
msgstr "Ativa ou desativa tema escuro"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:29
msgid "Enable or disable client-side decorations"
msgstr "Ativa ou desativa decorações de janela"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:35
msgid "Whether or not to use floating controls in windowed mode"
msgstr "Se Usa ou não controles flutuantes no modo janela"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:41
msgid "Whether or not to autohide mouse cursor in windowed mode"
msgstr "Se é ou não para ocultar cursor do mouse no modo de janela"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:47
msgid "The minimum cursor speed at which floating controls will be unhidden."
msgstr ""
"A velocidade mínima do cursor flutuante no qual os controles serão "
"reexibidos."
#: data/io.github.celluloid_player.Celluloid.gschema.xml:54
msgid ""
"The size of the dead zone in which cursor movement will not cause the "
"controls to be shown."
msgstr ""
"O tamanho da zona morta na qual o movimento do cursor não fará com que os "
"controles sejam mostrados."
#: data/io.github.celluloid_player.Celluloid.gschema.xml:60
msgid "Whether or not to use skip buttons for controlling playlist"
msgstr ""
"Se quer ou não usar botões de pular, para controlar a lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:66
msgid ""
"Whether or not to make file chooser dialog remember last folder accessed"
msgstr ""
"Se deseja ou não fazer o seletor de arquivos lembrar a última página "
"acessada"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:72
msgid "Whether or not to create new windows when there is already an instance"
msgstr "Se quer ou não criar novas janelas quando já existe uma instância"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:78
#: src/celluloid-application.c:575
msgid "Options to pass to mpv"
msgstr "Opções para passar para o mpv"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:84
msgid "Path to mpv configuration file"
msgstr "Caminho para o arquivo de configuração do mpv"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:90
msgid "Load or don't load mpv configuration file"
msgstr "Carregar ou não, o arquivo de configuração do mpv"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:96
msgid "Path to mpv input configuration file"
msgstr "Caminho para o arquivo de atalhos do mpv"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:102
msgid "Load or don't load mpv input configuration file"
msgstr "Carregar ou não, o arquivo de atalhos do mpv"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:108
msgid "Whether or not to enable MPRIS support"
msgstr "Se ativa ou desativa suporte para MPRIS"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:114
msgid ""
"Whether or not to enable GNOME-Settings-Daemon-based media keys support"
msgstr ""
"Se ativa ou desativa suporte para comandos de mídia do GNOME-Settings-Daemon"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:120
msgid "Whether or not to prefetch metadata for non-current playlist entries"
msgstr ""
"Se faz ou não uma pré-busca dos metadados para as entradas nas listas de "
"reprodução não atuais"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:126
msgid ""
"Whether or not to display an error message when playback of a file ends with"
" an error"
msgstr ""
"Se quer ou não, exibir uma mensagem de erro quando a reprodução de um "
"arquivo termina com um erro"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:132
msgid "Whether or not to inhibit session idling when something is playing"
msgstr ""
"Inibir ou não a ociosidade da sessão quando algo está sendo reproduzido"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:142
msgid "Width of the window"
msgstr "Largura da janela"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:148
msgid "Height of the window"
msgstr "Altura da janela"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:154
msgid "Whether or not the window is maximized"
msgstr "Se a janela está ou não maximizada"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:161
msgid "Volume of player"
msgstr "Volume do reprodutor"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:167
msgid "Whether or not to loop when the end of playlist is reached"
msgstr "Se deve ou não repetir a lista quando ela terminar"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:173
msgid "Width of the playlist"
msgstr "Largura da lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:179
msgid "Show or not show the controls"
msgstr "Mostra ou não os controles"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:185
msgid "Show or not show the playlist"
msgstr "Mostrar ou não a lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.gschema.xml:191
msgid "URI of the last folder accessed"
msgstr "URI da última pasta acessada"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:7
#: data/io.github.celluloid_player.Celluloid.desktop.in:4
#: src/celluloid-application.c:451
msgid "Celluloid"
msgstr "Celluloid"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:8
msgid "GTK+ frontend for mpv"
msgstr "Interface em GTK+ para o mpv"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:16
msgid ""
"Celluloid is a simple media player that can play virtually all video and "
"audio formats. It supports playlists and MPRIS2 media player controls. The "
"design of Celluloid follows the GNOME Human Interface Guidelines, but can "
"also be adapted for other systems that don't use client-side decorations "
"(CSD). It is based on the mpv library and GTK."
msgstr ""
"O Celluloid é um media player simples que pode reproduzir praticamente todos"
" os formatos de vídeo e áudio. Ele suporta listas de reprodução e controles "
"MPRIS2 media player. O design do Celluloid segue as Diretrizes da interface "
"humana do GNOME, mas também pode ser adaptado para outros sistemas que não "
"usam decorações do lado do cliente (CSD). É baseado na biblioteca mpv e GTK."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:23
msgid "Features:"
msgstr "Recursos:"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:25
msgid "Drag and drop playlist"
msgstr "Arrastar e soltar lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:26
msgid "Loading external mpv configuration files"
msgstr "Carregando arquivos externos de configuração do mpv"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:27
msgid "MPRIS2 D-Bus interface"
msgstr "Interface MPRIS2 D-BUS"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:30
msgid "The Celluloid Developers"
msgstr "Os Desenvolvedores do Celluloid"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:34
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:87
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:117
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:156
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:187
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:215
msgid "This release contains the following changes:"
msgstr "Esta versão contém as seguintes alterações:"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:38
msgid ""
"Adjust the range of volume button based on the value of the volume-max "
"property."
msgstr ""
"Ajuste o botão do intervalo de volume, com base no valor da propriedade "
"volume-máximo."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:42
msgid "Retain window maximization state across sessions."
msgstr "Manter o estado de maximização da janela entre as sessões."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:45
msgid "Retain loop state across sessions."
msgstr "Manter o estado do loop entre as sessões."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:48
msgid "Implement playlist search."
msgstr "Implementar pesquisa na lista de reprodução."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:51
msgid "Update the list of shortcuts in Keyboard Shortcuts dialog."
msgstr "Atualizar a lista de atalhos na caixa de diálogo, Atalhos do teclado."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:54
msgid "Correctly handle quotes and escape sequences in extra mpv options."
msgstr ""
"Manuseie corretamente as citações e sequências de escape em opções extras do"
" mpv."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:57
msgid "Display time at cursor position when hovering the seek bar."
msgstr ""
"Mostra o tempo na posição do cursor ao passar o mouse na barra de busca."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:60
msgid ""
"Deprecate '--mpv-options'. Options starting with '--mpv-' can be used to set"
" mpv options instead. For example, passing '--mpv-vf=vflip' to Celluloid is "
"equivalent to passing '--vf=vflip' to mpv."
msgstr ""
"Preterir '--mpv-options'. Opções começando com '--mpv-' podem ser usadas "
"para definir as opções do mpv. Por exemplo, passar '--mpv-vf = vflip' para o"
" Celluloid é equivalente a passar '--vf = vflip' para o mpv."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:66
msgid ""
"Add support for configuring dead zone, an area in which mouse movement will "
"not cause controls to be shown."
msgstr ""
"Adicionado suporte para configurar a zona morta, uma área na qual o "
"movimento do mouse não fará com que os controles sejam mostrados."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:70
msgid "Make window sizing work correctly with HiDPI displays."
msgstr ""
"Faz o dimensionamento da janela funcionar corretamente em monitores HiDPI."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:73
msgid "Add Finnish translation by Kimmo Kujansuu."
msgstr "Adicionada a tradução finlandesa por Kimmo Kujansuu."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:76
msgid "Add Slovenian translation by @bertronika."
msgstr "Adicionada tradução eslovena por @bertronika"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:80
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:110
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:149
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:180
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:208
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:236
msgid "This listing is incomplete. See git log for complete changelog."
msgstr "Esta listagem está incompleta. Veja log git para changelog completo."
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:91
msgid "Add Persian translation by @danialbehzadi"
msgstr "Adic. tradução Persa por @danialbehzadi"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:94
msgid "Add Ukranian translation by @vl-nix"
msgstr "Adic. tradução ucraniana por @vl-nix"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:97
msgid ""
"Add support for showing/hiding window decorations using the mpv option "
"--border"
msgstr ""
"Adicionado suporte para mostrar/ocultar as decorações de janela usando a opção \n"
"\"--border\" do mpv"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:100
msgid "Add menu item for opening discs"
msgstr "Adicionado item de menu para abrir discos"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:103
msgid "Block cursor autohide when volume popup is open in windowed mode"
msgstr ""
"Ocultar automaticamente o bloco do cursor quando o pop-up de volume estiver "
"aberto no modo de janela"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:106
msgid "Fix crash with mpv 0.30"
msgstr "Corrigido erro com o mpv 0.30"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:121
msgid "Rename project to Celluloid"
msgstr "Projeto renomeado para Celluloid"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:124
msgid "Add Turkish translation by @TeknoMobil"
msgstr "Adic. tradução Turca por @TeknoMobil"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:127
msgid "Add Esperanto translation by @F3nd0"
msgstr "Adic. tradução Esperanto por @F3nd0"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:130
msgid "Migrate from opengl-cb to the new render API"
msgstr "Migrado do opengl-cb para o novo renderizador API"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:133
msgid "Handle numpad keybindings"
msgstr " Manipulável com combinações de teclas numéricas"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:136
msgid "Handle unicode keybindings"
msgstr "Manipulável com combinações de teclas unicode"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:139
msgid "Forward media key events to mpv"
msgstr "Encaminha eventos-chave da mídia para o mpv"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:142
msgid ""
"Add dconf key for controlling cursor speed at which controls are unhidden"
msgstr ""
"Adicionado chave dconf para controlar a velocidade do cursor na qual os "
"controles estão ocultos"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:145
msgid "Add option for suppressing playback errors"
msgstr "Adicionada opção para suprimir erros de reprodução"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:160
msgid "Split up the General tab in the preferences dialog"
msgstr "Dividir o separador Geral na aba de diálogo de preferências"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:163
msgid "Improve behavior when toggling playlist under tiling window managers"
msgstr ""
"Melhorar o comportamento alternando a lista de reprodução gerenciadas em "
"janelas lado a lado"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:166
msgid "Move app menu items to primary menu"
msgstr "Mover itens do menu de aplicativos para o menu principal"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:169
msgid "Use separate MPRIS DBus connection for each window"
msgstr "Usar janelas separadas para conexões MPRIS D-BUS"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:172
msgid "Add support for MPRIS property LoopStatus"
msgstr "Adicionar suporte para a propriedade MPRIS LoopStatus"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:175
msgid ""
"Add option --mpv-options for setting arbitrary mpv options from the command-"
"line"
msgstr ""
"Adicionar a opção --mpv-options para definir opções arbitrárias do mpv em "
"linha de comando"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:191
msgid "Set default screenshot directory to XDG_PICTURES_DIR"
msgstr "Definir o local padrão para a tela de captura XDG_PICTURES_DIR"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:194
msgid ""
"Improve handling of --window-scale, --autofit, --autofit-larger, and "
"--autofit-smaller"
msgstr ""
" Melhorar o tratamento de --window-scale, --autofit, --autofit-larger, e "
"--autofit-smaller"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:198
msgid "Add command line option for setting WM_ROLE"
msgstr "Adicionar linha de comando para opção de definir WM_ROLE"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:201
msgid "Add context menu item for removing playlist items"
msgstr "Adicionar menu de contexto para remover itens da lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:204
msgid "Add context menu item for copying location of playlist items"
msgstr ""
"Adicionar item de menu de contexto para copiar a localização de itens da "
"lista de reprodução"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:219
msgid ""
"Add option to make skip buttons change playlist entries rather than chapters"
msgstr ""
"Adicionar a opção para fazer os botões de pular carregarem de lista de "
"reprodução, ao invés de pular capítulos"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:223
msgid "Make the file chooser accept non-local locations"
msgstr "Fazer o seletor de arquivos aceitar locais não-locais"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:226
msgid "Add right-click menu entry for looping a single file"
msgstr ""
"Adicionar menu de contexto no botão direito para fazer a repetição de um "
"único arquivo"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:229
msgid "Handle property change events for fullscreen and window-scale"
msgstr ""
"Manipular eventos de mudança de propriedade para tela inteira e escala de "
"janela"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:232
msgid "Add option to autohide mouse cursor in windowed mode"
msgstr "Adic. opção auto-ocultar o ponteiro do mouse no modo tela cheia"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:246
msgid "The main window showing the application in action"
msgstr "Mostrando o aplicativo em ação na janela principal"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:250
msgid "The main window with CSD disabled"
msgstr "Janela principal com CSD desativado"
#: data/io.github.celluloid_player.Celluloid.appdata.xml.in:254
msgid "The main window with playlist open"
msgstr "Janela principal com a lista de reprodução aberta"
#: data/io.github.celluloid_player.Celluloid.desktop.in:5
msgid "Multimedia Player"
msgstr "Tocador Multimídia"
#: data/io.github.celluloid_player.Celluloid.desktop.in:6
msgid "Play movies and videos"
msgstr "Reproduz filmes e vídeos"
#. Translators: Search terms to find this application. Don't translate the
#. semicolons! The list MUST also end with a semicolon!
#: data/io.github.celluloid_player.Celluloid.desktop.in:17
msgid "Video;Movie;Film;Clip;Series;Player;DVD;TV;Disc;Album;Music;GNOME;mpv;"
msgstr "Vídeo;Filme;Clipes;Séries;Tocar;DVD;TV;Disco;Álbum;Música;GNOME;mpv;"
#: data/io.github.celluloid_player.Celluloid.desktop.in:23
msgid "New Window"
msgstr "Nova Janela"
#: src/celluloid-application.c:495
msgid "Playing"
msgstr "Reproduzindo"
#: src/celluloid-application.c:551
msgid "Show release version"
msgstr "Mostrar a versão"
#: src/celluloid-application.c:559
msgid "Enqueue"
msgstr "Enfileirar"
#: src/celluloid-application.c:567
msgid "Create a new window"
msgstr "Criar uma nova janela"
#: src/celluloid-application.c:576
msgid "OPTIONS"
msgstr "OPÇÕES"
#: src/celluloid-application.c:583
msgid "Set the window role"
msgstr "Definir o papel da janela"
#: src/celluloid-application.c:591
msgid "Don't connect to an already-running instance"
msgstr "Não conectar a uma instância já em execução"
#: src/celluloid-control-box.c:362
msgid "Pause"
msgstr "Pausar"
#: src/celluloid-control-box.c:362 src/celluloid-control-box.c:565
msgid "Play"
msgstr "reproduzir"
#: src/celluloid-control-box.c:568
msgid "Stop"
msgstr "Parar"
#: src/celluloid-control-box.c:571
msgid "Forward"
msgstr "Avançar"
#: src/celluloid-control-box.c:574
msgid "Rewind"
msgstr "Retroceder"
#: src/celluloid-control-box.c:577
msgid "Next Chapter"
msgstr "Próximo Capítulo"
#: src/celluloid-control-box.c:580
msgid "Previous Chapter"
msgstr "Capítulo Anterior"
#: src/celluloid-control-box.c:583
msgid "Loop Playlist"
msgstr "Repetir a Lista"
#: src/celluloid-control-box.c:586
msgid "Shuffle Playlist"
msgstr "Misturar a lista de reprodução"
#: src/celluloid-control-box.c:589 src/celluloid-header-bar.c:91
msgid "Toggle Fullscreen"
msgstr "Alternar para Tela Cheia"
#: src/celluloid-controller.c:992 src/celluloid-view.c:1558
msgid "Error"
msgstr "Erro"
#: src/celluloid-file-chooser.c:139 src/celluloid-plugins-manager.c:170
msgid "All Files"
msgstr "Todos os Arquivos"
#: src/celluloid-file-chooser.c:147
msgid "Media Files"
msgstr "Arquivos de Mídia"
#: src/celluloid-file-chooser.c:158
msgid "Audio Files"
msgstr "Arquivos de Áudio"
#: src/celluloid-file-chooser.c:166
msgid "Video Files"
msgstr "Arquivos de Vídeo"
#: src/celluloid-file-chooser.c:174
msgid "Image Files"
msgstr "Arquivos de Imagem"
#: src/celluloid-file-chooser.c:184
msgid "Subtitle Files"
msgstr "Arquivos de Legenda"
#: src/celluloid-menu.c:106
msgid "None"
msgstr "Nenhum"
#. For simplicity, also dup the default string used when the
#. * track has no title.
#: src/celluloid-menu.c:121
msgid "Unknown"
msgstr "Desconhecido"
#: src/celluloid-menu.c:154
msgid "_Load External…"
msgstr "_Carregar Externa..."
#. Disable the menu item by setting the action to something
#. * invalid.
#: src/celluloid-menu.c:207
msgid "No disc found"
msgstr "Disco não encontrado"
#: src/celluloid-menu.c:235
msgid "_File"
msgstr "_Arquivo"
#: src/celluloid-menu.c:236 src/celluloid-menu.c:318
msgid "_Open…"
msgstr "_Abrir..."
#: src/celluloid-menu.c:237 src/celluloid-menu.c:319
msgid "Open _Folder…"
msgstr "Abrir _Pasta..."
#: src/celluloid-menu.c:238 src/celluloid-menu.c:320
msgid "Open _Location…"
msgstr "_Abrir Local..."
#: src/celluloid-menu.c:239
msgid "Open _Disc…"
msgstr "Abrir _Disco..."
#: src/celluloid-menu.c:240 src/celluloid-menu.c:290
msgid "_Save Playlist"
msgstr "_Salvar Lista de Reprodução"
#: src/celluloid-menu.c:241 src/celluloid-menu.c:323
msgid "_New Window"
msgstr "_Nova Janela"
#: src/celluloid-menu.c:242
msgid "_Quit"
msgstr "_Sair"
#: src/celluloid-menu.c:243
msgid "_Edit"
msgstr "_Editar"
#: src/celluloid-menu.c:244 src/celluloid-menu.c:296
msgid "_Preferences"
msgstr "_Preferências"
#: src/celluloid-menu.c:245 src/celluloid-menu.c:292
msgid "_Video Track"
msgstr "_Faixa de Vídeo"
#: src/celluloid-menu.c:246 src/celluloid-menu.c:293
msgid "_Audio Track"
msgstr "_Faixa de Áudio"
#: src/celluloid-menu.c:247 src/celluloid-menu.c:294
msgid "S_ubtitle Track"
msgstr "F_aixa de Legendas"
#: src/celluloid-menu.c:248
msgid "_View"
msgstr "_Exibir"
#: src/celluloid-menu.c:249 src/celluloid-menu.c:287
msgid "_Toggle Controls"
msgstr "_Mostrar Controles"
#: src/celluloid-menu.c:250 src/celluloid-menu.c:289
msgid "_Toggle Playlist"
msgstr "_Mostrar Lista de Reprodução"
#: src/celluloid-menu.c:251
msgid "_Fullscreen"
msgstr "_Tela Cheia"
#: src/celluloid-menu.c:252
msgid "_Help"
msgstr "_Ajuda"
#: src/celluloid-menu.c:253 src/celluloid-menu.c:297
msgid "_Keyboard Shortcuts"
msgstr "_Teclas de Atalho"
#: src/celluloid-menu.c:254 src/celluloid-menu.c:298
msgid "_About Celluloid"
msgstr "_Sobre o Celluloid"
#: src/celluloid-menu.c:321
msgid "Open _Disc"
msgstr "Abrir _Disco"
#: src/celluloid-mpv.c:240
#, c-format
msgid "Playback was terminated abnormally. Reason: %s."
msgstr "A reprodução foi encerrada de forma inesperada. Motivo: %s."
#: src/celluloid-open-location-dialog.c:130
msgid "Location:"
msgstr "Local:"
#: src/celluloid-open-location-dialog.c:136
#: src/celluloid-preferences-dialog.c:401
msgid "_Cancel"
msgstr "_Cancelar"
#: src/celluloid-open-location-dialog.c:138
msgid "_Open"
msgstr "_Abrir"
#: src/celluloid-player.c:550
msgid "Failed to apply one or more MPV options."
msgstr "Falha ao aplicar uma ou mais opções do MPV."
#: src/celluloid-playlist-widget.c:784
msgid "_Copy Location"
msgstr "_Copiar Local"
#: src/celluloid-playlist-widget.c:785
msgid "_Remove"
msgstr "_Remover"
#: src/celluloid-playlist-widget.c:787
msgid "_Add…"
msgstr "_Adicionar..."
#: src/celluloid-playlist-widget.c:788
msgid "Add _Folder…"
msgstr "Adic _Pasta..."
#: src/celluloid-playlist-widget.c:789
msgid "Add _Location…"
msgstr "Adicionar _Local"
#: src/celluloid-playlist-widget.c:790
msgid "_Shuffle"
msgstr "_Aleatório"
#: src/celluloid-playlist-widget.c:791
msgid "Loop _File"
msgstr "Repetir_Arquivo"
#: src/celluloid-playlist-widget.c:792
msgid "Loop _Playlist"
msgstr "Repetir _Lista"
#: src/celluloid-playlist-widget.c:933 src/celluloid-shortcuts-window.c:136
msgid "Playlist"
msgstr "Lista de Reprodução"
#: src/celluloid-playlist-widget.c:941
msgid "Playlist is empty"
msgstr "Lista está vazia"
#: src/celluloid-plugins-manager.c:163 src/celluloid-plugins-manager.c:409
msgid "Add Plugin"
msgstr "Adic. Plugin"
#: src/celluloid-plugins-manager.c:175
msgid "Lua Plugins"
msgstr "Plugins Lua"
#: src/celluloid-plugins-manager.c:181
msgid "JavaScript Plugins"
msgstr "Plugins JavaScript"
#: src/celluloid-plugins-manager.c:186
msgid "C Plugins"
msgstr "Plugins C"
#: src/celluloid-plugins-manager.c:334
#, c-format
msgid "Failed to copy file from '%s' to '%s'. Reason: %s"
msgstr "Falha ao copiar arquivo de '%s' para '%s'. Motivo: %s"
#: src/celluloid-plugins-manager.c:385
msgid "No plugins found"
msgstr "Nenhum plugin encontrado"
#: src/celluloid-plugins-manager-item.c:79
msgid "Remove"
msgstr "Remover"
#: src/celluloid-plugins-manager-item.c:178
msgid ""
"Are you sure you want to remove this script? This action cannot be undone."
msgstr ""
"Tem certeza que deseja remover este script? Esta ação não poderá ser "
"desfeita."
#: src/celluloid-plugins-manager-item.c:199
#, c-format
msgid "Failed to delete file '%s'. Reason: %s"
msgstr "Falha ao remover o arquivo %s. Motivo: %s"
#: src/celluloid-preferences-dialog.c:304
msgid "Automatically resize window to fit video"
msgstr "Redimensionar automaticamente a janela para caber o vídeo"
#: src/celluloid-preferences-dialog.c:307
msgid "Enable client-side decorations"
msgstr "Ativar decorações de janela independentes"
#: src/celluloid-preferences-dialog.c:310
msgid "Enable dark theme"
msgstr "Ativar tema escuro"
#: src/celluloid-preferences-dialog.c:313
msgid "Use floating controls in windowed mode"
msgstr "Usar controles flutuantes no modo janela"
#: src/celluloid-preferences-dialog.c:316
msgid "Autohide mouse cursor in windowed mode"
msgstr "Auto ocultar o ponteiro do mouse no modo janela"
#: src/celluloid-preferences-dialog.c:319
msgid "Use skip buttons for controlling playlist"
msgstr "Use os botões de pular para controlar a lista de reprodução"
#: src/celluloid-preferences-dialog.c:322
msgid "Remember last file's location"
msgstr "Lembrar o local do último arquivo"
#: src/celluloid-preferences-dialog.c:327
msgid "Load MPV configuration file"
msgstr "Carregar arquivo de configuração MPV"
#: src/celluloid-preferences-dialog.c:330
msgid "MPV configuration file:"
msgstr "Arquivo de configuração MPV:"
#: src/celluloid-preferences-dialog.c:333
msgid "Load MPV input configuration file"
msgstr "Carregar arquivo de comandos MPV"
#: src/celluloid-preferences-dialog.c:336
msgid "MPV input configuration file:"
msgstr "Arquivo de configuração MPV:"
#: src/celluloid-preferences-dialog.c:341
msgid "Always open new window"
msgstr "Sempre abrir uma nova janela"
#: src/celluloid-preferences-dialog.c:344
msgid "Ignore playback errors"
msgstr "Ignorar erros de reprodução"
#: src/celluloid-preferences-dialog.c:347
msgid "Prefetch metadata"
msgstr "Pré-busca de metadados"
#: src/celluloid-preferences-dialog.c:350
msgid "Enable MPRIS support"
msgstr "Ativar suporte para MPRIS"
#: src/celluloid-preferences-dialog.c:353
msgid "Enable media keys support"
msgstr "Ativar suporte para atalhos de mídia"
#: src/celluloid-preferences-dialog.c:356
msgid "Extra MPV options:"
msgstr "Opções Extras do MPV:"
#: src/celluloid-preferences-dialog.c:389
msgid "Interface"
msgstr "Aparência"
#: src/celluloid-preferences-dialog.c:392
msgid "Config Files"
msgstr "Arquivos de Configuração"
#: src/celluloid-preferences-dialog.c:395
msgid "Miscellaneous"
msgstr "Diversos"
#: src/celluloid-preferences-dialog.c:398
msgid "Plugins"
msgstr "Plugins"
#: src/celluloid-preferences-dialog.c:403
msgid "_Save"
msgstr "_Salvar"
#: src/celluloid-preferences-dialog.c:421
msgid "Preferences"
msgstr "Preferências"
#: src/celluloid-shortcuts-window.c:57
msgid "Open file"
msgstr "Abrir arquivo"
#: src/celluloid-shortcuts-window.c:58
msgid "Open location"
msgstr "Abrir local"
#: src/celluloid-shortcuts-window.c:59
msgid "Add file to playlist"
msgstr "Adiciona um arquivo à lista de reprodução"
#: src/celluloid-shortcuts-window.c:60
msgid "Add location to playlist"
msgstr "Adiciona um local à lista de reprodução"
#: src/celluloid-shortcuts-window.c:61
msgid "Show preferences dialog"
msgstr "Mostra diálogo de preferências"
#: src/celluloid-shortcuts-window.c:62
msgid "Toggle controls"
msgstr "Exibe os controles"
#: src/celluloid-shortcuts-window.c:63
msgid "Toggle playlist"
msgstr "Mostra a lista de reprodução"
#: src/celluloid-shortcuts-window.c:64
msgid "Toggle fullscreen mode"
msgstr "Alterna o modo tela cheia"
#: src/celluloid-shortcuts-window.c:65
msgid "Leave fullscreen mode"
msgstr "Sai do modo tela cheia"
#: src/celluloid-shortcuts-window.c:66
msgid "Toggle OSD states between normal and playback time/duration"
msgstr ""
"Alterna os modos de sobreposição de tela (OSD) entre normal e tempo/duração"
#: src/celluloid-shortcuts-window.c:67
msgid "Show filename on the OSD"
msgstr "Exibe o nome do arquivo na tela (OSD)"
#: src/celluloid-shortcuts-window.c:68
msgid "Show progress, elapsed time, and duration on the OSD"
msgstr "Mostra o progresso, tempo passado, e a duração na tela (OSD)"
#: src/celluloid-shortcuts-window.c:71
msgid "Seek backward/forward 5 seconds"
msgstr "Avança/retrocede 5 segundos"
#: src/celluloid-shortcuts-window.c:72
msgid "Exact seek backward/forward 1 second"
msgstr "Avança/retrocede exatamente 1 segundo"
#: src/celluloid-shortcuts-window.c:73
msgid "Seek backward/forward 1 minute"
msgstr "Avança/retrocede 1 minuto"
#: src/celluloid-shortcuts-window.c:74
msgid "Exact seek backward/forward 5 seconds"
msgstr "Avança/retrocede 5 minutos"
#: src/celluloid-shortcuts-window.c:75
msgid "Seek to previous/next subtitle"
msgstr "Procura a legenda anterior/seguinte"
#: src/celluloid-shortcuts-window.c:76
msgid "Step backward/forward a single frame"
msgstr "Avança/retrocede um único quadro"
#: src/celluloid-shortcuts-window.c:77
msgid "Seek to the beginning of the previous/next chapter"
msgstr "Ir para o início do anterior/próximo capítulo"
#: src/celluloid-shortcuts-window.c:80
msgid "Decrease/increase playback speed by 10%"
msgstr "Aumenta/diminui a velocidade de reprodução em 10%"
#: src/celluloid-shortcuts-window.c:81
msgid "Halve/double current playback speed"
msgstr "Reproduz com metade/dobro da velocidade atual"
#: src/celluloid-shortcuts-window.c:82
msgid "Reset playback speed to normal"
msgstr "Reinicia a reprodução com velocidade normal"
#: src/celluloid-shortcuts-window.c:83
msgid "Go backward/forward in the playlist"
msgstr "Avança/volta na lista de reprodução"
#: src/celluloid-shortcuts-window.c:84
msgid "Remove selected playlist item"
msgstr "Remove item selecionado da lista de reprodução"
#: src/celluloid-shortcuts-window.c:85
msgid "Save playlist"
msgstr "Salva a lista de reprodução"
#: src/celluloid-shortcuts-window.c:86
msgid "Set/clear A-B loop points"
msgstr "Define/limpa os pontos de loop A-B"
#: src/celluloid-shortcuts-window.c:87
msgid "Toggle infinite looping"
msgstr "Muda para modo de repetição infinita"
#: src/celluloid-shortcuts-window.c:88
msgid "Pause or unpause"
msgstr "Pausa ou Continua"
#: src/celluloid-shortcuts-window.c:89
msgid "Quit"
msgstr "Sair"
#: src/celluloid-shortcuts-window.c:90
msgid "Save current playback position and quit"
msgstr "Salva a posição de reprodução e sai"
#: src/celluloid-shortcuts-window.c:93
msgid "Enter search mode"
msgstr "Entrar no Modo busca"
#: src/celluloid-shortcuts-window.c:94
msgid "Jump to next match"
msgstr "Ir para o próximo correspondente"
#: src/celluloid-shortcuts-window.c:95
msgid "Jump to previous match"
msgstr "Ir para o correspondente anterior"
#: src/celluloid-shortcuts-window.c:96
msgid "Exit search mode"
msgstr "Sai do modo busca"
#: src/celluloid-shortcuts-window.c:99
msgid "Cycle through audio tracks"
msgstr "Percorre pelas faixas de áudio"
#: src/celluloid-shortcuts-window.c:100 src/celluloid-shortcuts-window.c:101
msgid "Decrease/increase volume"
msgstr "Aumenta/diminui volume"
#: src/celluloid-shortcuts-window.c:102
msgid "Mute or unmute"
msgstr "Silencia ou não"
#: src/celluloid-shortcuts-window.c:103
msgid "Adjust audio delay by +/- 0.1 seconds"
msgstr "Ajusta o atraso de áudio em +/- 0,1 Segundos"
#: src/celluloid-shortcuts-window.c:106
msgid "Toggle subtitle visibility"
msgstr "Alterna a visibilidade das legendas"
#: src/celluloid-shortcuts-window.c:107
msgid "Cycle through available subtitles"
msgstr "Percorre pelas legendas disponíveis"
#: src/celluloid-shortcuts-window.c:108
msgid "Adjust subtitle delay by +/- 0.1 seconds"
msgstr "Ajusta o atraso da legenda por +/- 0.1 segundos"
#: src/celluloid-shortcuts-window.c:109
msgid "Toggle SSA/ASS subtitles style override"
msgstr "Substitui alternadamente o estilo das legendas SSA/ASS"
#: src/celluloid-shortcuts-window.c:110
msgid "Move subtitles up/down"
msgstr "Move as legendas para cima/para baixo"
#: src/celluloid-shortcuts-window.c:111
msgid "Toggle VSFilter aspect compatibility mode"
msgstr "Alterna o modo de compatibilidade de aspecto do VSFilter"
#: src/celluloid-shortcuts-window.c:114
msgid "Cycle through video tracks"
msgstr "Percorre pelas trilhas de vídeo"
#: src/celluloid-shortcuts-window.c:115
msgid "Decrease/increase pan-and-scan range"
msgstr "Diminui/aumenta o alcance da varredura de tela"
#: src/celluloid-shortcuts-window.c:116
msgid "Take a screenshot"
msgstr "Faz uma captura de tela"
#: src/celluloid-shortcuts-window.c:117
msgid "Take a screenshot, without subtitles"
msgstr "Faz uma captura de tela sem legendas"
#: src/celluloid-shortcuts-window.c:118
msgid "Take a screenshot, as the window shows it"
msgstr "Faz uma captura de tela da janela mostrada"
#: src/celluloid-shortcuts-window.c:119
msgid "Resize video to half its original size"
msgstr "Redimensiona o vídeo para a metade do tamanho original"
#: src/celluloid-shortcuts-window.c:120
msgid "Resize video to its original size"
msgstr "Redimensiona o vídeo para o tamanho original"
#: src/celluloid-shortcuts-window.c:121
msgid "Resize video to double its original size"
msgstr "Redimensiona o vídeo para o dobro da tela original"
#: src/celluloid-shortcuts-window.c:122
msgid "Adjust contrast"
msgstr "Ajusta o contraste"
#: src/celluloid-shortcuts-window.c:123
msgid "Adjust brightness"
msgstr "Ajusta o brilho"
#: src/celluloid-shortcuts-window.c:124
msgid "Adjust gamma"
msgstr "Ajusta o gama"
#: src/celluloid-shortcuts-window.c:125
msgid "Adjust saturation"
msgstr "Ajusta a saturação"
#: src/celluloid-shortcuts-window.c:126
msgid "Activate or deactivate deinterlacer"
msgstr "Ativa ou desativa desentrelace"
#: src/celluloid-shortcuts-window.c:127
msgid "Cycle aspect ratio override"
msgstr "Percorre pela proporção de aspecto ignorado"
#: src/celluloid-shortcuts-window.c:130
msgid "User Interface"
msgstr "Interface de Usuário"
#: src/celluloid-shortcuts-window.c:131
msgid "Video"
msgstr "Vídeo"
#: src/celluloid-shortcuts-window.c:132
msgid "Audio"
msgstr "Áudio"
#: src/celluloid-shortcuts-window.c:133
msgid "Subtitle"
msgstr "Legenda"
#: src/celluloid-shortcuts-window.c:134
msgid "Playback"
msgstr "Reproduzir"
#: src/celluloid-shortcuts-window.c:135
msgid "Seeking"
msgstr "Procurando"
#: src/celluloid-view.c:728
msgid "Load Audio Track…"
msgstr "Carregar Faixa de Áudio..."
#: src/celluloid-view.c:732
msgid "Load Video Track…"
msgstr "Carregar Faixa de Vídeo…"
#: src/celluloid-view.c:736
msgid "Load Subtitle Track…"
msgstr "Carregar Faixa de Legenda"
#: src/celluloid-view.c:901
msgid ""
"Enabling or disabling client-side decorations requires restarting to take "
"effect."
msgstr ""
"Ativando ou desativando as decorações do lado do cliente, será necessário a "
"reinicialização para que entre em vigor."
#: src/celluloid-view.c:1444
msgid "Add Folder to Playlist"
msgstr "Adic Pasta à Lista de Reprodução"
#: src/celluloid-view.c:1444
msgid "Open Folder"
msgstr "Abrir Pasta"
#: src/celluloid-view.c:1449
msgid "Add File to Playlist"
msgstr "Adic. arquivo à Lista de Reprodução"
#: src/celluloid-view.c:1449
msgid "Open File"
msgstr "Abrir Arquivo"
#: src/celluloid-view.c:1485
msgid "Add Location to Playlist"
msgstr "Adic. Local à lista de Reprodução"
#: src/celluloid-view.c:1486
msgid "Open Location"
msgstr "Abrir Local"
#: src/celluloid-view.c:1532
msgid "Save Playlist"
msgstr "Salva Lista de Reprodução"
#: src/celluloid-view.c:1598
msgid "A GTK frontend for MPV"
msgstr "Uma interface em GTK para o MPV"
#: src/celluloid-view.c:1608
msgid "translator-credits"
msgstr "Carlos Henrique de Freitas Ferreira."
| {
"pile_set_name": "Github"
} |
[Hearts x10]
58000000 0C5B0BC8
78000000 02B2E5D4
68000000 41200000 41200000
[Money x999999]
58000000 0C5A0F00
78000000 005B3F74
68000000 000F423F 000F423F
[EXP x50.000]
58000000 0C5A0F00
78000000 005B4114
68000000 0000C350 0000C350
[Arrows x99]
58000000 0C5A0F00
78000000 005B42B4
68000000 00000063 00000063
[Bombs x99]
58000000 0C5A0F00
78000000 005B4454
68000000 00000063 00000063 | {
"pile_set_name": "Github"
} |
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char* argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
| {
"pile_set_name": "Github"
} |
@ RUN: llvm-mc -triple=armv7-linux-gnueabi -show-encoding < %s | FileCheck %s
@ CHECK: ldc p12, c4, [r0, #4] @ encoding: [0x01,0x4c,0x90,0xed]
@ CHECK: stc p14, c6, [r2, #-224] @ encoding: [0x38,0x6e,0x02,0xed]
ldc p12, cr4, [r0, #4]
stc p14, cr6, [r2, #-224]
@ RUN: llvm-mc -triple=armv7-linux-gnueabi -show-encoding < %s | FileCheck %s
@ CHECK: ldc p12, c4, [r0, #4] @ encoding: [0x01,0x4c,0x90,0xed]
@ CHECK: stc p14, c6, [r2, #-224] @ encoding: [0x38,0x6e,0x02,0xed]
ldc p12, cr4, [r0, #4]
stc p14, cr6, [r2, #-224]
| {
"pile_set_name": "Github"
} |
var Strings = require('../../src/utils/strings');
describe('utils strings', function () {
it('string format', function () {
var _ = Strings.format;
var str = '{0}-{1}!={2}';
_(str, '3', '4', 2).should.equal('3-4!=2');
str = '{0}-{1}!={2}';
_(str, '3', '4').should.equal('3-4!={2}');
});
it('string substitute', function () {
Strings.substitute('{a}!={b}', { a:1, b:2 }).should.equal('1!=2');
Strings.substitute('{a}!={b}{c}', { a:1, b:null }).should.equal('1!=');
Strings.substitute('\\{a}!={b}', { a:1, b:2 }).should.equal('{a}!=2');
});
it('toArray', function () {
var _ = Strings.toArray;
var raw = '1,2,3';
_(raw, ',').should.deep.equal(['1', '2', '3']);
var raw = '1|2,3';
_(raw, '|').should.deep.equal(['1', '2,3']);
raw = '1,2,3';
_(raw).should.deep.equal(['1,2,3']);
raw = [1, 2, 3];
_(raw, ',').should.deep.equal(['1', '2', '3']);
raw = [1, 2, 3];
_(raw).should.deep.equal([1, 2, 3]);
raw = 123;
_(raw).should.deep.equal(['123']);
raw = '123';
_(raw).should.deep.equal(['123']);
_(null).should.deep.equal([]);
_(undefined).should.deep.equal([]);
});
it('nextUid', function () {
var uid;
for(var i=0; i<100; i++) {
uid = Strings.nextUid();
}
uid.length.should.eql(8);
});
});
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
~
-->
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="StockQuoteProxy" transports="https http" startOnLoad="true" trace="disable">
<target>
<endpoint>
<wsdl service="SimpleStockQuoteService" port="SimpleStockQuoteServiceHttpSoap11Endpoint" uri="http://localhost:9000/services/SimpleStockQuoteService?wsdl"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL key="conf:/proxy/sample_proxy_1.wsdl"/>
</proxy>
<sequence name="proxy">
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</sequence>
<sequence name="fault">
<log level="full">
<property name="MESSAGE" value="Executing default "fault" sequence"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</log>
<drop/>
</sequence>
</definitions>
| {
"pile_set_name": "Github"
} |
---
root:
items:
- type: stacking-context
bounds: [0, 0, 120, 120]
items:
- type: rect
bounds: [0, 0, 120, 120]
color: [0, 0, 0, 1]
- type: rect
bounds: [10, 10, 100, 100]
color: [9, 9, 137, 1]
| {
"pile_set_name": "Github"
} |
---
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.0.4; fr-be; DA220HQL Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
os:
name: Android
short_name: AND
version: "4.0.4"
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: "534.30"
device:
type: smart display
brand: AC
model: DA220HQL
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; Android 4.2.1; DA241HL Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Safari/537.36
os:
name: Android
short_name: AND
version: "4.2.1"
platform: ""
client:
type: browser
name: Chrome
short_name: CH
version: "34.0.1847.114"
engine: Blink
engine_version: ""
device:
type: smart display
brand: AC
model: DA241HL
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; VSD220 Build/IMM76D.UI23ED12_VSC) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
os:
name: Android
short_name: AND
version: "4.0.4"
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: "534.30"
device:
type: smart display
brand: VS
model: VSD220
os_family: Android
browser_family: Android Browser
| {
"pile_set_name": "Github"
} |
#' R2nparray
#'
#' @name R2nparray
#' @docType package
NULL
| {
"pile_set_name": "Github"
} |
from __future__ import absolute_import
#typing
#overrides
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.vocabulary import Vocabulary
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers.token_indexer import TokenIndexer
class SingleIdTokenIndexer(TokenIndexer):
u"""
This :class:`TokenIndexer` represents tokens as single integers.
Parameters
----------
namespace : ``str``, optional (default=``tokens``)
We will use this namespace in the :class:`Vocabulary` to map strings to indices.
lowercase_tokens : ``bool``, optional (default=``False``)
If ``True``, we will call ``token.lower()`` before getting an index for the token from the
vocabulary.
"""
# pylint: disable=no-self-use
def __init__(self, namespace = u'tokens', lowercase_tokens = False) :
self.namespace = namespace
self.lowercase_tokens = lowercase_tokens
#overrides
def count_vocab_items(self, token , counter ):
# If `text_id` is set on the token (e.g., if we're using some kind of hash-based word
# encoding), we will not be using the vocab for this token.
if getattr(token, u'text_id', None) is None:
text = token.text
if self.lowercase_tokens:
text = text.lower()
counter[self.namespace][text] += 1
#overrides
def tokens_to_indices(self,
tokens ,
vocabulary ,
index_name ) :
indices = []
for token in tokens:
if getattr(token, u'text_id', None) is not None:
# `text_id` being set on the token means that we aren't using the vocab, we just use
# this id instead.
indices.append(token.text_id)
else:
text = token.text
if self.lowercase_tokens:
text = text.lower()
indices.append(vocabulary.get_token_index(text, self.namespace))
return {index_name: indices}
#overrides
def get_padding_token(self) :
return 0
#overrides
def get_padding_lengths(self, token ) : # pylint: disable=unused-argument
return {}
#overrides
def pad_token_sequence(self,
tokens ,
desired_num_tokens ,
padding_lengths ) : # pylint: disable=unused-argument
return dict((key, pad_sequence_to_length(val, desired_num_tokens[key]))
for key, val in list(tokens.items()))
SingleIdTokenIndexer = TokenIndexer.register(u"single_id")(SingleIdTokenIndexer)
| {
"pile_set_name": "Github"
} |
namespace Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview
{
using static Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Extensions;
/// <summary>Properties of HostPool.</summary>
public partial class HostPoolPatchProperties :
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IHostPoolPatchProperties,
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IHostPoolPatchPropertiesInternal
{
/// <summary>Backing field for <see cref="CustomRdpProperty" /> property.</summary>
private string _customRdpProperty;
/// <summary>Custom rdp property of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public string CustomRdpProperty { get => this._customRdpProperty; set => this._customRdpProperty = value; }
/// <summary>Backing field for <see cref="Description" /> property.</summary>
private string _description;
/// <summary>Description of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public string Description { get => this._description; set => this._description = value; }
/// <summary>Backing field for <see cref="FriendlyName" /> property.</summary>
private string _friendlyName;
/// <summary>Friendly name of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; }
/// <summary>Backing field for <see cref="LoadBalancerType" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.LoadBalancerType? _loadBalancerType;
/// <summary>The type of the load balancer.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.LoadBalancerType? LoadBalancerType { get => this._loadBalancerType; set => this._loadBalancerType = value; }
/// <summary>Backing field for <see cref="MaxSessionLimit" /> property.</summary>
private int? _maxSessionLimit;
/// <summary>The max session limit of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public int? MaxSessionLimit { get => this._maxSessionLimit; set => this._maxSessionLimit = value; }
/// <summary>Internal Acessors for RegistrationInfo</summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatch Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IHostPoolPatchPropertiesInternal.RegistrationInfo { get => (this._registrationInfo = this._registrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.RegistrationInfoPatch()); set { {_registrationInfo = value;} } }
/// <summary>Backing field for <see cref="PersonalDesktopAssignmentType" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PersonalDesktopAssignmentType? _personalDesktopAssignmentType;
/// <summary>PersonalDesktopAssignment type for HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PersonalDesktopAssignmentType? PersonalDesktopAssignmentType { get => this._personalDesktopAssignmentType; set => this._personalDesktopAssignmentType = value; }
/// <summary>Backing field for <see cref="PreferredAppGroupType" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PreferredAppGroupType? _preferredAppGroupType;
/// <summary>
/// The type of preferred application group type, default to Desktop Application Group
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PreferredAppGroupType? PreferredAppGroupType { get => this._preferredAppGroupType; set => this._preferredAppGroupType = value; }
/// <summary>Backing field for <see cref="RegistrationInfo" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatch _registrationInfo;
/// <summary>The registration info of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
internal Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatch RegistrationInfo { get => (this._registrationInfo = this._registrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.RegistrationInfoPatch()); set => this._registrationInfo = value; }
/// <summary>Expiration time of registration token.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Inlined)]
public global::System.DateTime? RegistrationInfoExpirationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatchInternal)RegistrationInfo).ExpirationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatchInternal)RegistrationInfo).ExpirationTime = value; }
/// <summary>The type of resetting the token.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Inlined)]
public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.RegistrationTokenOperation? RegistrationInfoRegistrationTokenOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatchInternal)RegistrationInfo).RegistrationTokenOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatchInternal)RegistrationInfo).RegistrationTokenOperation = value; }
/// <summary>Backing field for <see cref="Ring" /> property.</summary>
private int? _ring;
/// <summary>The ring number of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public int? Ring { get => this._ring; set => this._ring = value; }
/// <summary>Backing field for <see cref="SsoContext" /> property.</summary>
private string _ssoContext;
/// <summary>Path to keyvault containing ssoContext secret.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public string SsoContext { get => this._ssoContext; set => this._ssoContext = value; }
/// <summary>Backing field for <see cref="ValidationEnvironment" /> property.</summary>
private bool? _validationEnvironment;
/// <summary>Is validation environment.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Origin(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.PropertyOrigin.Owned)]
public bool? ValidationEnvironment { get => this._validationEnvironment; set => this._validationEnvironment = value; }
/// <summary>Creates an new <see cref="HostPoolPatchProperties" /> instance.</summary>
public HostPoolPatchProperties()
{
}
}
/// Properties of HostPool.
public partial interface IHostPoolPatchProperties :
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IJsonSerializable
{
/// <summary>Custom rdp property of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Custom rdp property of HostPool.",
SerializedName = @"customRdpProperty",
PossibleTypes = new [] { typeof(string) })]
string CustomRdpProperty { get; set; }
/// <summary>Description of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Description of HostPool.",
SerializedName = @"description",
PossibleTypes = new [] { typeof(string) })]
string Description { get; set; }
/// <summary>Friendly name of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Friendly name of HostPool.",
SerializedName = @"friendlyName",
PossibleTypes = new [] { typeof(string) })]
string FriendlyName { get; set; }
/// <summary>The type of the load balancer.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The type of the load balancer.",
SerializedName = @"loadBalancerType",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.LoadBalancerType) })]
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.LoadBalancerType? LoadBalancerType { get; set; }
/// <summary>The max session limit of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The max session limit of HostPool.",
SerializedName = @"maxSessionLimit",
PossibleTypes = new [] { typeof(int) })]
int? MaxSessionLimit { get; set; }
/// <summary>PersonalDesktopAssignment type for HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"PersonalDesktopAssignment type for HostPool.",
SerializedName = @"personalDesktopAssignmentType",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PersonalDesktopAssignmentType) })]
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PersonalDesktopAssignmentType? PersonalDesktopAssignmentType { get; set; }
/// <summary>
/// The type of preferred application group type, default to Desktop Application Group
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The type of preferred application group type, default to Desktop Application Group",
SerializedName = @"preferredAppGroupType",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PreferredAppGroupType) })]
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PreferredAppGroupType? PreferredAppGroupType { get; set; }
/// <summary>Expiration time of registration token.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Expiration time of registration token.",
SerializedName = @"expirationTime",
PossibleTypes = new [] { typeof(global::System.DateTime) })]
global::System.DateTime? RegistrationInfoExpirationTime { get; set; }
/// <summary>The type of resetting the token.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The type of resetting the token.",
SerializedName = @"registrationTokenOperation",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.RegistrationTokenOperation) })]
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.RegistrationTokenOperation? RegistrationInfoRegistrationTokenOperation { get; set; }
/// <summary>The ring number of HostPool.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The ring number of HostPool.",
SerializedName = @"ring",
PossibleTypes = new [] { typeof(int) })]
int? Ring { get; set; }
/// <summary>Path to keyvault containing ssoContext secret.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Path to keyvault containing ssoContext secret.",
SerializedName = @"ssoContext",
PossibleTypes = new [] { typeof(string) })]
string SsoContext { get; set; }
/// <summary>Is validation environment.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Is validation environment.",
SerializedName = @"validationEnvironment",
PossibleTypes = new [] { typeof(bool) })]
bool? ValidationEnvironment { get; set; }
}
/// Properties of HostPool.
internal partial interface IHostPoolPatchPropertiesInternal
{
/// <summary>Custom rdp property of HostPool.</summary>
string CustomRdpProperty { get; set; }
/// <summary>Description of HostPool.</summary>
string Description { get; set; }
/// <summary>Friendly name of HostPool.</summary>
string FriendlyName { get; set; }
/// <summary>The type of the load balancer.</summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.LoadBalancerType? LoadBalancerType { get; set; }
/// <summary>The max session limit of HostPool.</summary>
int? MaxSessionLimit { get; set; }
/// <summary>PersonalDesktopAssignment type for HostPool.</summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PersonalDesktopAssignmentType? PersonalDesktopAssignmentType { get; set; }
/// <summary>
/// The type of preferred application group type, default to Desktop Application Group
/// </summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.PreferredAppGroupType? PreferredAppGroupType { get; set; }
/// <summary>The registration info of HostPool.</summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfoPatch RegistrationInfo { get; set; }
/// <summary>Expiration time of registration token.</summary>
global::System.DateTime? RegistrationInfoExpirationTime { get; set; }
/// <summary>The type of resetting the token.</summary>
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Support.RegistrationTokenOperation? RegistrationInfoRegistrationTokenOperation { get; set; }
/// <summary>The ring number of HostPool.</summary>
int? Ring { get; set; }
/// <summary>Path to keyvault containing ssoContext secret.</summary>
string SsoContext { get; set; }
/// <summary>Is validation environment.</summary>
bool? ValidationEnvironment { get; set; }
}
} | {
"pile_set_name": "Github"
} |
#!/bin/bash
# This script will install Oracle(Sun) Java 8 into an existing chroot
set -e
CHROOTDIR=$1
ARCH=$2
if [ ! -d "$CHROOTDIR" ]; then
dj_make_chroot -d "$CHROOTDIR" -D Ubuntu -a "$ARCH"
fi
function cleanup {
# Unmount things on cleanup
umount -f "$CHROOTDIR/proc" >/dev/null 2>&1 || /bin/true
umount -f "$CHROOTDIR/sys" >/dev/null 2>&1 || /bin/true
umount -f "$CHROOTDIR/dev/pts" >/dev/null 2>&1 || /bin/true
}
trap cleanup EXIT
# A local caching proxy to use for debian packages
# (typically an install of aptcacher-ng), for example:
#DEBPROXY="http://aptcacher-ng.example.com:3142/"
[ -z "$DEBPROXY" ] && DEBPROXY=""
# To prevent (libc6) upgrade questions:
export DEBIAN_FRONTEND=noninteractive
mount -t proc proc "$CHROOTDIR/proc"
mount -t sysfs sysfs "$CHROOTDIR/sys"
# Required for some warning messages about writing to log files
mount --bind /dev/pts "$CHROOTDIR/dev/pts"
chroot "$CHROOTDIR" /bin/sh -c debconf-set-selections <<EOF
debconf shared/accepted-oracle-license-v1-1 select true
debconf shared/accepted-oracle-license-v1-1 seen true
EOF
PROXYSETTINGS="http_proxy=\"$DEBPROXY\" https_proxy=\"$DEBPROXY\""
chroot "$CHROOTDIR" /bin/sh -c "$PROXYSETTINGS apt-add-repository -y ppa:webupd8team/java"
chroot "$CHROOTDIR" /bin/sh -c "$PROXYSETTINGS apt-get update"
chroot "$CHROOTDIR" /bin/sh -c "$PROXYSETTINGS apt-get install oracle-java8-installer"
chroot "$CHROOTDIR" /bin/sh -c "apt-get autoremove --purge"
chroot "$CHROOTDIR" /bin/sh -c "apt-get clean"
umount "$CHROOTDIR/dev/pts"
umount "$CHROOTDIR/sys"
umount "$CHROOTDIR/proc"
| {
"pile_set_name": "Github"
} |
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# include/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
pkgdatadir = $(datadir)/geos
pkgincludedir = $(includedir)/geos
pkglibdir = $(libdir)/geos
pkglibexecdir = $(libexecdir)/geos
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-pc-linux-gnu
host_triplet = arm-linux-eabi
target_triplet = arm-linux-eabi
subdir = include
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/ac_pkg_swig.m4 \
$(top_srcdir)/macros/ac_python_devel.m4 \
$(top_srcdir)/macros/libtool.m4 \
$(top_srcdir)/macros/ltoptions.m4 \
$(top_srcdir)/macros/ltsugar.m4 \
$(top_srcdir)/macros/ltversion.m4 \
$(top_srcdir)/macros/lt~obsolete.m4 \
$(top_srcdir)/macros/python.m4 $(top_srcdir)/macros/ruby.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h $(top_builddir)/include/geos/platform.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(includedir)"
HEADERS = $(include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run aclocal-1.11
ALLOCA =
AMTAR = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run tar
AM_CFLAGS = -pedantic -Wall -ansi -Wno-long-long
AM_CXXFLAGS = -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long
AR = ar
AS = as
AUTOCONF = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run autoconf
AUTOHEADER = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run autoheader
AUTOMAKE = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run automake-1.11
AWK = awk
CAPI_INTERFACE_AGE = 8
CAPI_INTERFACE_CURRENT = 9
CAPI_INTERFACE_REVISION = 2
CAPI_VERSION = 1.8.2
CAPI_VERSION_MAJOR = 1
CAPI_VERSION_MINOR = 8
CAPI_VERSION_PATCH = 2
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = dlltool
DSYMUTIL =
DUMPBIN = link -dump -symbols
ECHO_C = \c
ECHO_N =
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
FGREP = /usr/bin/grep -F
GREP = /usr/bin/grep
INLINE_FLAGS = -DGEOS_INLINE
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
INTERFACE_AGE =
INTERFACE_CURRENT =
INTERFACE_REVISION =
JTS_PORT = 1.12.0
LD = /Volumes/Old500GBdrive/Users/jaak/suuredfailid/apps/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LDFLAGS =
LIBOBJS = ${LIBOBJDIR}memcmp$U.o
LIBS =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
LTLIBOBJS = ${LIBOBJDIR}memcmp$U.lo
MAINT = #
MAKEINFO = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/missing --run makeinfo
MKDIR_P = .././install-sh -c -d
NM = link -dump -symbols
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OTOOL =
OTOOL64 =
PACKAGE = geos
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_URL =
PACKAGE_VERSION =
PATH_SEPARATOR = :
PHP =
PHPUNIT =
PHP_CONFIG =
PYTHON =
PYTHON_CPPFLAGS =
PYTHON_EXEC_PREFIX =
PYTHON_EXTRA_LIBS =
PYTHON_LDFLAGS =
PYTHON_PLATFORM =
PYTHON_PREFIX =
PYTHON_SITE_PKG =
PYTHON_VERSION =
RANLIB = ranlib
RUBY =
RUBY_BIN_DIR =
RUBY_EXTENSION_DIR =
RUBY_INCLUDE_DIR =
RUBY_LIB_DIR =
RUBY_SHARED_LIB =
RUBY_SITE_ARCH =
RUBY_SO_NAME =
RUBY_VERSION =
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
SWIG =
SWIG_LIB =
SWIG_PYTHON_CPPFLAGS =
SWIG_PYTHON_OPT =
VERSION = 3.4.2
VERSION_MAJOR = 3
VERSION_MINOR = 4
VERSION_PATCH = 2
abs_builddir = /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/include
abs_srcdir = /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/include
abs_top_builddir = /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2
abs_top_srcdir = /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN = link -dump -symbols
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = x86_64-pc-linux-gnu
build_alias = x86_64-pc-linux-gnu
build_cpu = x86_64
build_os = linux-gnu
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = arm-linux-eabi
host_alias = arm-linux-eabi
host_cpu = arm
host_os = eabi
host_vendor = linux
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /Users/jaak/git/hellomap3d-23rc/AdvancedMap3D/jni/geos-3.4.2/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
lt_ECHO = /bin/echo
mandir = ${datarootdir}/man
mkdir_p = $(top_builddir)/./install-sh -c -d
oldincludedir = /usr/include
pdfdir = ${docdir}
pkgpyexecdir =
pkgpythondir =
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
pyexecdir =
pythondir =
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target = arm-linux-eabi
target_alias =
target_cpu = arm
target_os = eabi
target_vendor = linux
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
#
# This file is part of project GEOS (http://trac.osgeo.org/geos/)
#
SUBDIRS = \
geos
include_HEADERS = \
geos.h
EXTRA_DIST = CMakeLists.txt
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
$(srcdir)/config.h.in: # $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-includeHEADERS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-libtool \
ctags ctags-recursive distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-includeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0+
//
// soc-jack.c -- ALSA SoC jack handling
//
// Copyright 2008 Wolfson Microelectronics PLC.
//
// Author: Mark Brown <[email protected]>
#include <sound/jack.h>
#include <sound/soc.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/suspend.h>
#include <trace/events/asoc.h>
struct jack_gpio_tbl {
int count;
struct snd_soc_jack *jack;
struct snd_soc_jack_gpio *gpios;
};
/**
* snd_soc_jack_report - Report the current status for a jack
*
* @jack: the jack
* @status: a bitmask of enum snd_jack_type values that are currently detected.
* @mask: a bitmask of enum snd_jack_type values that being reported.
*
* If configured using snd_soc_jack_add_pins() then the associated
* DAPM pins will be enabled or disabled as appropriate and DAPM
* synchronised.
*
* Note: This function uses mutexes and should be called from a
* context which can sleep (such as a workqueue).
*/
void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
{
struct snd_soc_dapm_context *dapm;
struct snd_soc_jack_pin *pin;
unsigned int sync = 0;
int enable;
if (!jack)
return;
trace_snd_soc_jack_report(jack, mask, status);
dapm = &jack->card->dapm;
mutex_lock(&jack->mutex);
jack->status &= ~mask;
jack->status |= status & mask;
trace_snd_soc_jack_notify(jack, status);
list_for_each_entry(pin, &jack->pins, list) {
enable = pin->mask & jack->status;
if (pin->invert)
enable = !enable;
if (enable)
snd_soc_dapm_enable_pin(dapm, pin->pin);
else
snd_soc_dapm_disable_pin(dapm, pin->pin);
/* we need to sync for this case only */
sync = 1;
}
/* Report before the DAPM sync to help users updating micbias status */
blocking_notifier_call_chain(&jack->notifier, jack->status, jack);
if (sync)
snd_soc_dapm_sync(dapm);
snd_jack_report(jack->jack, jack->status);
mutex_unlock(&jack->mutex);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_report);
/**
* snd_soc_jack_add_zones - Associate voltage zones with jack
*
* @jack: ASoC jack
* @count: Number of zones
* @zones: Array of zones
*
* After this function has been called the zones specified in the
* array will be associated with the jack.
*/
int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_zone *zones)
{
int i;
for (i = 0; i < count; i++) {
INIT_LIST_HEAD(&zones[i].list);
list_add(&(zones[i].list), &jack->jack_zones);
}
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_jack_add_zones);
/**
* snd_soc_jack_get_type - Based on the mic bias value, this function returns
* the type of jack from the zones declared in the jack type
*
* @jack: ASoC jack
* @micbias_voltage: mic bias voltage at adc channel when jack is plugged in
*
* Based on the mic bias value passed, this function helps identify
* the type of jack from the already declared jack zones
*/
int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage)
{
struct snd_soc_jack_zone *zone;
list_for_each_entry(zone, &jack->jack_zones, list) {
if (micbias_voltage >= zone->min_mv &&
micbias_voltage < zone->max_mv)
return zone->jack_type;
}
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_jack_get_type);
/**
* snd_soc_jack_add_pins - Associate DAPM pins with an ASoC jack
*
* @jack: ASoC jack
* @count: Number of pins
* @pins: Array of pins
*
* After this function has been called the DAPM pins specified in the
* pins array will have their status updated to reflect the current
* state of the jack whenever the jack status is updated.
*/
int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_pin *pins)
{
int i;
for (i = 0; i < count; i++) {
if (!pins[i].pin) {
dev_err(jack->card->dev, "ASoC: No name for pin %d\n",
i);
return -EINVAL;
}
if (!pins[i].mask) {
dev_err(jack->card->dev, "ASoC: No mask for pin %d"
" (%s)\n", i, pins[i].pin);
return -EINVAL;
}
INIT_LIST_HEAD(&pins[i].list);
list_add(&(pins[i].list), &jack->pins);
snd_jack_add_new_kctl(jack->jack, pins[i].pin, pins[i].mask);
}
/* Update to reflect the last reported status; canned jack
* implementations are likely to set their state before the
* card has an opportunity to associate pins.
*/
snd_soc_jack_report(jack, 0, 0);
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_jack_add_pins);
/**
* snd_soc_jack_notifier_register - Register a notifier for jack status
*
* @jack: ASoC jack
* @nb: Notifier block to register
*
* Register for notification of the current status of the jack. Note
* that it is not possible to report additional jack events in the
* callback from the notifier, this is intended to support
* applications such as enabling electrical detection only when a
* mechanical detection event has occurred.
*/
void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
struct notifier_block *nb)
{
blocking_notifier_chain_register(&jack->notifier, nb);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_register);
/**
* snd_soc_jack_notifier_unregister - Unregister a notifier for jack status
*
* @jack: ASoC jack
* @nb: Notifier block to unregister
*
* Stop notifying for status changes.
*/
void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&jack->notifier, nb);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_unregister);
#ifdef CONFIG_GPIOLIB
/* gpio detect */
static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
{
struct snd_soc_jack *jack = gpio->jack;
int enable;
int report;
enable = gpiod_get_value_cansleep(gpio->desc);
if (gpio->invert)
enable = !enable;
if (enable)
report = gpio->report;
else
report = 0;
if (gpio->jack_status_check)
report = gpio->jack_status_check(gpio->data);
snd_soc_jack_report(jack, report, gpio->report);
}
/* irq handler for gpio pin */
static irqreturn_t gpio_handler(int irq, void *data)
{
struct snd_soc_jack_gpio *gpio = data;
struct device *dev = gpio->jack->card->dev;
trace_snd_soc_jack_irq(gpio->name);
if (device_may_wakeup(dev))
pm_wakeup_event(dev, gpio->debounce_time + 50);
queue_delayed_work(system_power_efficient_wq, &gpio->work,
msecs_to_jiffies(gpio->debounce_time));
return IRQ_HANDLED;
}
/* gpio work */
static void gpio_work(struct work_struct *work)
{
struct snd_soc_jack_gpio *gpio;
gpio = container_of(work, struct snd_soc_jack_gpio, work.work);
snd_soc_jack_gpio_detect(gpio);
}
static int snd_soc_jack_pm_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{
struct snd_soc_jack_gpio *gpio =
container_of(nb, struct snd_soc_jack_gpio, pm_notifier);
switch (action) {
case PM_POST_SUSPEND:
case PM_POST_HIBERNATION:
case PM_POST_RESTORE:
/*
* Use workqueue so we do not have to care about running
* concurrently with work triggered by the interrupt handler.
*/
queue_delayed_work(system_power_efficient_wq, &gpio->work, 0);
break;
}
return NOTIFY_DONE;
}
static void jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
int i;
for (i = 0; i < count; i++) {
gpiod_unexport(gpios[i].desc);
unregister_pm_notifier(&gpios[i].pm_notifier);
free_irq(gpiod_to_irq(gpios[i].desc), &gpios[i]);
cancel_delayed_work_sync(&gpios[i].work);
gpiod_put(gpios[i].desc);
gpios[i].jack = NULL;
}
}
static void jack_devres_free_gpios(struct device *dev, void *res)
{
struct jack_gpio_tbl *tbl = res;
jack_free_gpios(tbl->jack, tbl->count, tbl->gpios);
}
/**
* snd_soc_jack_add_gpios - Associate GPIO pins with an ASoC jack
*
* @jack: ASoC jack
* @count: number of pins
* @gpios: array of gpio pins
*
* This function will request gpio, set data direction and request irq
* for each gpio in the array.
*/
int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
int i, ret;
struct jack_gpio_tbl *tbl;
tbl = devres_alloc(jack_devres_free_gpios, sizeof(*tbl), GFP_KERNEL);
if (!tbl)
return -ENOMEM;
tbl->jack = jack;
tbl->count = count;
tbl->gpios = gpios;
for (i = 0; i < count; i++) {
if (!gpios[i].name) {
dev_err(jack->card->dev,
"ASoC: No name for gpio at index %d\n", i);
ret = -EINVAL;
goto undo;
}
if (gpios[i].desc) {
/* Already have a GPIO descriptor. */
goto got_gpio;
} else if (gpios[i].gpiod_dev) {
/* Get a GPIO descriptor */
gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev,
gpios[i].name,
gpios[i].idx, GPIOD_IN);
if (IS_ERR(gpios[i].desc)) {
ret = PTR_ERR(gpios[i].desc);
dev_err(gpios[i].gpiod_dev,
"ASoC: Cannot get gpio at index %d: %d",
i, ret);
goto undo;
}
} else {
/* legacy GPIO number */
if (!gpio_is_valid(gpios[i].gpio)) {
dev_err(jack->card->dev,
"ASoC: Invalid gpio %d\n",
gpios[i].gpio);
ret = -EINVAL;
goto undo;
}
ret = gpio_request_one(gpios[i].gpio, GPIOF_IN,
gpios[i].name);
if (ret)
goto undo;
gpios[i].desc = gpio_to_desc(gpios[i].gpio);
}
got_gpio:
INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
gpios[i].jack = jack;
ret = request_any_context_irq(gpiod_to_irq(gpios[i].desc),
gpio_handler,
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING,
gpios[i].name,
&gpios[i]);
if (ret < 0)
goto err;
if (gpios[i].wake) {
ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1);
if (ret != 0)
dev_err(jack->card->dev,
"ASoC: Failed to mark GPIO at index %d as wake source: %d\n",
i, ret);
}
/*
* Register PM notifier so we do not miss state transitions
* happening while system is asleep.
*/
gpios[i].pm_notifier.notifier_call = snd_soc_jack_pm_notifier;
register_pm_notifier(&gpios[i].pm_notifier);
/* Expose GPIO value over sysfs for diagnostic purposes */
gpiod_export(gpios[i].desc, false);
/* Update initial jack status */
schedule_delayed_work(&gpios[i].work,
msecs_to_jiffies(gpios[i].debounce_time));
}
devres_add(jack->card->dev, tbl);
return 0;
err:
gpio_free(gpios[i].gpio);
undo:
jack_free_gpios(jack, i, gpios);
devres_free(tbl);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_jack_add_gpios);
/**
* snd_soc_jack_add_gpiods - Associate GPIO descriptor pins with an ASoC jack
*
* @gpiod_dev: GPIO consumer device
* @jack: ASoC jack
* @count: number of pins
* @gpios: array of gpio pins
*
* This function will request gpio, set data direction and request irq
* for each gpio in the array.
*/
int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
struct snd_soc_jack *jack,
int count, struct snd_soc_jack_gpio *gpios)
{
int i;
for (i = 0; i < count; i++)
gpios[i].gpiod_dev = gpiod_dev;
return snd_soc_jack_add_gpios(jack, count, gpios);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_add_gpiods);
/**
* snd_soc_jack_free_gpios - Release GPIO pins' resources of an ASoC jack
*
* @jack: ASoC jack
* @count: number of pins
* @gpios: array of gpio pins
*
* Release gpio and irq resources for gpio pins associated with an ASoC jack.
*/
void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
jack_free_gpios(jack, count, gpios);
devres_destroy(jack->card->dev, jack_devres_free_gpios, NULL, NULL);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_free_gpios);
#endif /* CONFIG_GPIOLIB */
| {
"pile_set_name": "Github"
} |
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System;
using System.Windows;
using System.Windows.Data;
namespace Xceed.Wpf.Toolkit.Core.Converters
{
public class BorderThicknessToStrokeThicknessConverter : IValueConverter
{
#region IValueConverter Members
public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
{
Thickness thickness = ( Thickness )value;
return ( thickness.Bottom + thickness.Left + thickness.Right + thickness.Top ) / 4;
}
public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
{
int? thick = ( int? )value;
int thickValue = thick.HasValue ? thick.Value : 0;
return new Thickness( thickValue, thickValue, thickValue, thickValue );
}
#endregion
}
}
| {
"pile_set_name": "Github"
} |
<template>
<div :class="classes">
<label :class="[prefixCls + '-label']" :for="labelFor" :style="labelStyles" v-if="label || $slots.label"><slot name="label">{{ label }}</slot></label>
<div :class="[prefixCls + '-content']" :style="contentStyles">
<slot></slot>
<transition name="fade">
<div :class="[prefixCls + '-error-tip']" v-if="validateState === 'error' && showMessage && form.showMessage">{{ validateMessage }}</div>
</transition>
</div>
</div>
</template>
<script>
import AsyncValidator from 'async-validator';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-form-item';
function getPropByPath(obj, path) {
let tempObj = obj;
path = path.replace(/\[(\w+)\]/g, '.$1');
path = path.replace(/^\./, '');
let keyArr = path.split('.');
let i = 0;
for (let len = keyArr.length; i < len - 1; ++i) {
let key = keyArr[i];
if (key in tempObj) {
tempObj = tempObj[key];
} else {
throw new Error('[iView warn]: please transfer a valid prop path to form item!');
}
}
return {
o: tempObj,
k: keyArr[i],
v: tempObj[keyArr[i]]
};
}
export default {
name: 'FormItem',
mixins: [ Emitter ],
props: {
label: {
type: String,
default: ''
},
labelWidth: {
type: Number
},
prop: {
type: String
},
required: {
type: Boolean,
default: false
},
rules: {
type: [Object, Array]
},
error: {
type: String
},
validateStatus: {
type: Boolean
},
showMessage: {
type: Boolean,
default: true
},
labelFor: {
type: String
}
},
data () {
return {
prefixCls: prefixCls,
isRequired: false,
validateState: '',
validateMessage: '',
validateDisabled: false,
validator: {}
};
},
watch: {
error: {
handler (val) {
this.validateMessage = val;
this.validateState = val ? 'error' : '';
},
immediate: true
},
validateStatus (val) {
this.validateState = val;
},
rules (){
this.setRules();
}
},
inject: ['form'],
computed: {
classes () {
return [
`${prefixCls}`,
{
[`${prefixCls}-required`]: this.required || this.isRequired,
[`${prefixCls}-error`]: this.validateState === 'error',
[`${prefixCls}-validating`]: this.validateState === 'validating'
}
];
},
// form() {
// let parent = this.$parent;
// while (parent.$options.name !== 'iForm') {
// parent = parent.$parent;
// }
// return parent;
// },
fieldValue () {
const model = this.form.model;
if (!model || !this.prop) { return; }
let path = this.prop;
if (path.indexOf(':') !== -1) {
path = path.replace(/:/, '.');
}
return getPropByPath(model, path).v;
},
labelStyles () {
let style = {};
const labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.form.labelWidth;
if (labelWidth || labelWidth === 0) {
style.width = `${labelWidth}px`;
}
return style;
},
contentStyles () {
let style = {};
const labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.form.labelWidth;
if (labelWidth || labelWidth === 0) {
style.marginLeft = `${labelWidth}px`;
}
return style;
}
},
methods: {
setRules() {
let rules = this.getRules();
if (rules.length&&this.required) {
return;
}else if (rules.length) {
rules.every((rule) => {
this.isRequired = rule.required;
});
}else if (this.required){
this.isRequired = this.required;
}
this.$off('on-form-blur', this.onFieldBlur);
this.$off('on-form-change', this.onFieldChange);
this.$on('on-form-blur', this.onFieldBlur);
this.$on('on-form-change', this.onFieldChange);
},
getRules () {
let formRules = this.form.rules;
const selfRules = this.rules;
formRules = formRules ? formRules[this.prop] : [];
return [].concat(selfRules || formRules || []);
},
getFilteredRule (trigger) {
const rules = this.getRules();
return rules.filter(rule => !rule.trigger || rule.trigger.indexOf(trigger) !== -1);
},
validate(trigger, callback = function () {}) {
this.$nextTick(() => {
let rules = this.getFilteredRule(trigger);
if (!rules || rules.length === 0) {
if (!this.required) {
this.validateState = '';
callback();
return true;
}else {
rules = [{required: true}];
}
}
this.validateState = 'validating';
let descriptor = {};
descriptor[this.prop] = rules;
const validator = new AsyncValidator(descriptor);
let model = {};
model[this.prop] = this.fieldValue;
validator.validate(model, { firstFields: true }, errors => {
this.validateState = !errors ? 'success' : 'error';
this.validateMessage = errors ? errors[0].message : '';
callback(this.validateMessage);
});
this.validateDisabled = false;
});
},
resetField () {
this.validateState = '';
this.validateMessage = '';
let model = this.form.model;
let value = this.fieldValue;
let path = this.prop;
if (path.indexOf(':') !== -1) {
path = path.replace(/:/, '.');
}
let prop = getPropByPath(model, path);
// if (Array.isArray(value) && value.length > 0) {
// this.validateDisabled = true;
// prop.o[prop.k] = [];
// } else if (value !== this.initialValue) {
// this.validateDisabled = true;
// prop.o[prop.k] = this.initialValue;
// }
if (Array.isArray(value)) {
this.validateDisabled = true;
prop.o[prop.k] = [].concat(this.initialValue);
} else {
this.validateDisabled = true;
prop.o[prop.k] = this.initialValue;
}
},
onFieldBlur() {
this.validate('blur');
},
onFieldChange() {
if (this.validateDisabled) {
this.validateDisabled = false;
return;
}
this.validate('change');
}
},
mounted () {
if (this.prop) {
this.dispatch('iForm', 'on-form-item-add', this);
Object.defineProperty(this, 'initialValue', {
value: this.fieldValue
});
this.setRules();
}
},
beforeDestroy () {
this.dispatch('iForm', 'on-form-item-remove', this);
}
};
</script>
| {
"pile_set_name": "Github"
} |
import * as React from 'react';
import './App.css';
import JqxListBox, { IListBoxProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxlistbox';
class App extends React.PureComponent<{}, IListBoxProps> {
constructor(props: {}) {
super(props);
this.state = {
source: [ "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Anguilla", "Antigua & Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia & Herzegovina", "Botswana", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Cape Verde", "Cayman Islands", "Chad", "Chile", "China", "Colombia", "Congo", "Cook Islands", "Costa Rica", "Cote D Ivoire", "Croatia", "Cruise Ship", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Estonia", "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji", "Finland", "France", "French Polynesia", "French West Indies", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kuwait", "Kyrgyz Republic", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Mauritania", "Mauritius", "Mexico", "Moldova", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Namibia", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palestine", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russia", "Rwanda", "Saint Pierre & Miquelon", "Samoa", "San Marino", "Satellite", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "South Africa", "South Korea", "Spain", "Sri Lanka", "St Kitts & Nevis", "St Lucia", "St Vincent", "St. Lucia", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Timor L'Este", "Togo", "Tonga", "Trinidad & Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks & Caicos", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "Uruguay", "Uzbekistan", "Venezuela", "Vietnam", "Virgin Islands (US)", "Yemen", "Zambia", "Zimbabwe"]
}
}
public render() {
return (
<JqxListBox theme={'material-purple'} width={'100%'} height={'200px'} source={this.state.source} />
);
}
}
export default App; | {
"pile_set_name": "Github"
} |
extern void f (/*@out@*/ char *s);
extern void g (/*@special@*/ char *s) /*@allocates s@*/ ;
void t (/*@only@*/ char *s1, /*@only@*/ char *s2)
{
free (s1);
f (s1);
free (s2);
g (s2);
}
| {
"pile_set_name": "Github"
} |
import React from 'react';
import {
AutoField,
AutoForm,
ErrorField,
SubmitField,
} from '../../lib/universal';
import { bridge as schema } from './GuestSchema2';
export function GuestFormProfessionAdditionalInfo() {
return (
<AutoForm schema={schema} onSubmit={console.log}>
<h4>IT meeting guest questionnaire</h4>
<AutoField name="lastName" />
<ErrorField name="lastName">
<span>You have to provide your last name!</span>
</ErrorField>
<AutoField name="firstName" />
<ErrorField
name="firstName"
errorMessage="You have to provide your first name!"
/>
<span>Do you want to share your work experience with us?</span>
<AutoField name="workExperience" />
<ErrorField
name="workExperience"
errorMessage="Your work experience cannot be lesser than 0 or greater than 100 years!"
/>
<AutoField name="profession" />
<AutoField name="additionalInfo" />
<SubmitField />
</AutoForm>
);
}
| {
"pile_set_name": "Github"
} |
/*
All modification made by Intel Corporation: © 2016 Intel Corporation
All contributions by the University of California:
Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
All rights reserved.
All other contributions:
Copyright (c) 2014, 2015, the respective contributors
All rights reserved.
For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md
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.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
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 OWNER 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.
*/
// This program converts a set of images to a lmdb/leveldb by storing them
// as Datum proto buffers.
// Usage:
// convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME
//
// where ROOTFOLDER is the root folder that holds all the images, and LISTFILE
// should be a list of files as well as their labels, in the format as
// subfolder1/file1.JPEG 7
// ....
#include <algorithm>
#include <fstream> // NOLINT(readability/streams)
#include <string>
#include <utility>
#include <vector>
#include "boost/scoped_ptr.hpp"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/db.hpp"
#include "caffe/util/format.hpp"
#include "caffe/util/io.hpp"
#include "caffe/util/rng.hpp"
using namespace caffe; // NOLINT(build/namespaces)
using std::pair;
using boost::scoped_ptr;
DEFINE_bool(gray, false,
"When this option is on, treat images as grayscale ones");
DEFINE_bool(shuffle, false,
"Randomly shuffle the order of images and their labels");
DEFINE_string(backend, "lmdb",
"The backend {lmdb, leveldb} for storing the result");
DEFINE_int32(resize_width, 0, "Width images are resized to");
DEFINE_int32(resize_height, 0, "Height images are resized to");
DEFINE_bool(check_size, false,
"When this option is on, check that all the datum have the same size");
DEFINE_bool(encoded, false,
"When this option is on, the encoded image will be save in datum");
DEFINE_string(encode_type, "",
"Optional: What type should we encode the image as ('png','jpg',...).");
int main(int argc, char** argv) {
#ifdef USE_OPENCV
::google::InitGoogleLogging(argv[0]);
// Print output to stderr (while still logging)
FLAGS_alsologtostderr = 1;
#ifndef GFLAGS_GFLAGS_H_
namespace gflags = google;
#endif
gflags::SetUsageMessage("Convert a set of images to the leveldb/lmdb\n"
"format used as input for Caffe.\n"
"Usage:\n"
" convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME\n"
"The ImageNet dataset for the training demo is at\n"
" http://www.image-net.org/download-images\n");
gflags::ParseCommandLineFlags(&argc, &argv, true);
if (argc < 4) {
gflags::ShowUsageWithFlagsRestrict(argv[0], "tools/convert_imageset");
return 1;
}
const bool is_color = !FLAGS_gray;
const bool check_size = FLAGS_check_size;
const bool encoded = FLAGS_encoded;
const string encode_type = FLAGS_encode_type;
std::ifstream infile(argv[2]);
std::vector<std::pair<std::string, int> > lines;
std::string line;
size_t pos;
int label;
while (std::getline(infile, line)) {
pos = line.find_last_of(' ');
label = atoi(line.substr(pos + 1).c_str());
lines.push_back(std::make_pair(line.substr(0, pos), label));
}
if (FLAGS_shuffle) {
// randomly shuffle data
LOG(INFO) << "Shuffling data";
shuffle(lines.begin(), lines.end());
}
LOG(INFO) << "A total of " << lines.size() << " images.";
if (encode_type.size() && !encoded)
LOG(INFO) << "encode_type specified, assuming encoded=true.";
int resize_height = std::max<int>(0, FLAGS_resize_height);
int resize_width = std::max<int>(0, FLAGS_resize_width);
// Create new DB
scoped_ptr<db::DB> db(db::GetDB(FLAGS_backend));
db->Open(argv[3], db::NEW);
scoped_ptr<db::Transaction> txn(db->NewTransaction());
// Storing to db
std::string root_folder(argv[1]);
Datum datum;
int count = 0;
int data_size = 0;
bool data_size_initialized = false;
for (int line_id = 0; line_id < lines.size(); ++line_id) {
bool status;
std::string enc = encode_type;
if (encoded && !enc.size()) {
// Guess the encoding type from the file name
string fn = lines[line_id].first;
size_t p = fn.rfind('.');
if ( p == fn.npos )
LOG(WARNING) << "Failed to guess the encoding of '" << fn << "'";
enc = fn.substr(p);
std::transform(enc.begin(), enc.end(), enc.begin(), ::tolower);
}
status = ReadImageToDatum(root_folder + lines[line_id].first,
lines[line_id].second, resize_height, resize_width, is_color,
enc, &datum);
if (status == false) continue;
if (check_size) {
if (!data_size_initialized) {
data_size = datum.channels() * datum.height() * datum.width();
data_size_initialized = true;
} else {
const std::string& data = datum.data();
CHECK_EQ(data.size(), data_size) << "Incorrect data field size "
<< data.size();
}
}
// sequential
string key_str = caffe::format_int(line_id, 8) + "_" + lines[line_id].first;
// Put in db
string out;
CHECK(datum.SerializeToString(&out));
txn->Put(key_str, out);
if (++count % 1000 == 0) {
// Commit db
txn->Commit();
txn.reset(db->NewTransaction());
LOG(INFO) << "Processed " << count << " files.";
}
}
// write the last batch
if (count % 1000 != 0) {
txn->Commit();
LOG(INFO) << "Processed " << count << " files.";
}
#else
LOG(FATAL) << "This tool requires OpenCV; compile with USE_OPENCV.";
#endif // USE_OPENCV
return 0;
}
| {
"pile_set_name": "Github"
} |
package gui
import (
"errors"
"fmt"
"os"
"runtime"
"time"
log "github.com/sirupsen/logrus"
"github.com/coyim/coyim/config"
"github.com/coyim/coyim/coylog"
"github.com/coyim/coyim/gui/muc"
"github.com/coyim/coyim/gui/settings"
"github.com/coyim/coyim/i18n"
ournet "github.com/coyim/coyim/net"
rosters "github.com/coyim/coyim/roster"
sessions "github.com/coyim/coyim/session/access"
"github.com/coyim/coyim/session/events"
"github.com/coyim/coyim/xmpp/interfaces"
"github.com/coyim/coyim/xmpp/jid"
"github.com/coyim/gotk3adapter/gdki"
"github.com/coyim/gotk3adapter/glibi"
"github.com/coyim/gotk3adapter/gtki"
"github.com/coyim/gotk3adapter/pangoi"
)
const (
programName = "CoyIM"
applicationID = "im.coy.CoyIM"
localizationDomain = "coy"
)
type gtkUI struct {
roster *roster
app gtki.Application
window gtki.ApplicationWindow `gtk-widget:"mainWindow"`
accountsMenu gtki.MenuItem `gtk-widget:"AccountsMenu"`
searchBox gtki.Box `gtk-widget:"search-box"`
search gtki.SearchBar `gtk-widget:"search-area"`
searchEntry gtki.Entry `gtk-widget:"search-entry"`
notificationArea gtki.Box `gtk-widget:"notification-area"`
viewMenu *viewMenu
optionsMenu *optionsMenu
unified *unifiedLayout
unifiedCached *unifiedLayout
config *config.ApplicationConfig
*accountManager
displaySettings *displaySettings
keyboardSettings *keyboardSettings
keySupplier config.KeySupplier
tags *tags
toggleConnectAllAutomaticallyRequest chan bool
setShowAdvancedSettingsRequest chan bool
commands chan interface{}
sessionFactory sessions.Factory
dialerFactory interfaces.DialerFactory
settings *settings.Settings
//Desktop notifications
deNotify *desktopNotifications
actionTimes map[string]time.Time
log coylog.Logger
hooks OSHooks
mainBuilder *builder
mucGUI muc.GUI
}
// Graphics represent the graphic configuration
type Graphics struct {
gtk gtki.Gtk
glib glibi.Glib
gdk gdki.Gdk
pango pangoi.Pango
}
// CreateGraphics creates a Graphic represention from the given arguments
func CreateGraphics(gtkVal gtki.Gtk, glibVal glibi.Glib, gdkVal gdki.Gdk, pangoVal pangoi.Pango) Graphics {
return Graphics{
gtk: gtkVal,
glib: glibVal,
gdk: gdkVal,
pango: pangoVal,
}
}
var g Graphics
var coyimVersion string
// UI is the user interface functionality exposed to main
type UI interface {
Loop()
}
func argsWithApplicationName() *[]string {
newSlice := make([]string, len(os.Args))
copy(newSlice, os.Args)
newSlice[0] = programName
return &newSlice
}
// NewGTK returns a new client for a GTK ui
func NewGTK(version string, sf sessions.Factory, df interfaces.DialerFactory, gx Graphics, hooks OSHooks) UI {
runtime.LockOSThread()
coyimVersion = version
g = gx
initSignals()
//*.mo files should be in ./i18n/locale_code.utf8/LC_MESSAGES/
g.glib.InitI18n(localizationDomain, "./i18n")
g.gtk.Init(argsWithApplicationName())
ensureInstalled()
initMUC()
ret := >kUI{
commands: make(chan interface{}, 5),
toggleConnectAllAutomaticallyRequest: make(chan bool, 100),
setShowAdvancedSettingsRequest: make(chan bool, 100),
dialerFactory: df,
actionTimes: make(map[string]time.Time),
deNotify: newDesktopNotifications(),
log: log.StandardLogger().WithField("component", "gui"),
hooks: hooks,
}
hooks.AfterInit()
var err error
flags := glibi.APPLICATION_FLAGS_NONE
if *config.MultiFlag {
flags = glibi.APPLICATION_NON_UNIQUE
}
ret.app, err = g.gtk.ApplicationNew(applicationID, flags)
if err != nil {
panic(err)
}
ret.keySupplier = config.CachingKeySupplier(ret.getMasterPassword)
ret.accountManager = newAccountManager(ret, ret.log)
ret.sessionFactory = sf
ret.settings = settings.For("")
ret.addAction(ret.app, "quit", ret.quit)
ret.addAction(ret.app, "about", ret.aboutDialog)
ret.addAction(ret.app, "preferences", ret.showGlobalPreferences)
if config.MUCEnabledMockups {
ret.mucGUI = muc.InitGUI(
g.gtk,
g.glib,
g.gdk,
g.pango,
)
}
return ret
}
func (u *gtkUI) confirmAccountRemoval(acc *config.Account, removeAccountFunc func(*config.Account)) {
builder := newBuilder("ConfirmAccountRemoval")
obj := builder.getObj("RemoveAccount")
dialog := obj.(gtki.MessageDialog)
dialog.SetTransientFor(u.window)
_ = dialog.SetProperty("secondary-text", acc.Account)
response := dialog.Run()
if gtki.ResponseType(response) == gtki.RESPONSE_YES {
removeAccountFunc(acc)
}
dialog.Destroy()
}
type torRunningNotification struct {
area gtki.Box `gtk-widget:"infobar"`
image gtki.Image `gtk-widget:"image"`
label gtki.Label `gtk-widget:"message"`
}
// TODO: add a spinner
func torRunningNotificationInit(info gtki.Box) *torRunningNotification {
b := newBuilder("TorRunningNotification")
torRunningNotif := &torRunningNotification{}
panicOnDevError(b.bindObjects(torRunningNotif))
info.Add(torRunningNotif.area)
torRunningNotif.area.ShowAll()
return torRunningNotif
}
func (n *torRunningNotification) renderTorNotification(label, imgName string) {
doInUIThread(func() {
prov := providerWithCSS("box { background-color: #f1f1f1; color: #000000; border: 1px solid #d3d3d3; border-radius: 2px;}")
updateWithStyle(n.area, prov)
})
n.label.SetText(i18n.Local(label))
n.image.SetFromIconName(imgName, gtki.ICON_SIZE_BUTTON)
}
func (u *gtkUI) installTor() {
builder := newBuilder("TorInstallHelper")
obj := builder.getObj("dialog")
dialog := obj.(gtki.MessageDialog)
info := builder.getObj("tor-running-notification").(gtki.Box)
torNotif := torRunningNotificationInit(info)
builder.ConnectSignals(map[string]interface{}{
"on_close": func() {
dialog.Destroy()
},
// TODO: change logos
"on_press_label": func() {
if !ournet.Tor.Detect() {
err := "Tor is still not running"
torNotif.renderTorNotification(err, "software-update-urgent")
u.log.Info("Tor is still not running")
} else {
err := "Tor is now running"
torNotif.renderTorNotification(err, "emblem-default")
u.log.Info("Tor is now running")
}
},
})
doInUIThread(func() {
dialog.SetTransientFor(u.window)
dialog.ShowAll()
})
}
func (u *gtkUI) wouldYouLikeToInstallTor(k func(bool)) {
builder := newBuilder("TorHelper")
dialog := builder.getObj("TorHelper")
torHelper := dialog.(gtki.MessageDialog)
torHelper.SetDefaultResponse(gtki.RESPONSE_YES)
torHelper.SetTransientFor(u.window)
responseType := gtki.ResponseType(torHelper.Run())
result := responseType == gtki.RESPONSE_YES
torHelper.Destroy()
k(result)
}
func (u *gtkUI) initialSetupWindow() {
if !ournet.Tor.Detect() {
u.log.Info("Tor is not running")
u.wouldYouLikeToInstallTor(func(res bool) {
if res {
u.installTor()
} else {
u.initialSetupForConfigFile()
}
})
} else {
u.initialSetupForConfigFile()
}
}
func (u *gtkUI) initialSetupForConfigFile() {
u.wouldYouLikeToEncryptYourFile(func(res bool) {
u.config.SetShouldSaveFileEncrypted(res)
k := func() {
go u.showFirstAccountWindow()
}
if res {
u.captureInitialMasterPassword(k, func() {})
} else {
k()
}
})
}
func (u *gtkUI) loadConfig(configFile string) {
u.config.WhenLoaded(u.configLoaded)
ok := false
var conf *config.ApplicationConfig
var err error
for !ok {
conf, ok, err = config.LoadOrCreate(configFile, u.keySupplier)
if !ok {
u.log.WithError(err).Warn("couldn't open encrypted file - either the user didn't supply a password, or the password was incorrect")
u.keySupplier.Invalidate()
u.keySupplier.LastAttemptFailed()
}
}
// We assign config here, AFTER the return - so that a nil config means we are in a state of incorrectness and shouldn't do stuff.
// We never check, since a panic here is a serious programming error
u.config = conf
if err != nil {
u.log.WithError(err).Warn("something went wrong")
doInUIThread(u.initialSetupWindow)
return
}
if u.config.UpdateToLatestVersion() {
_ = u.saveConfigOnlyInternal()
}
}
func (u *gtkUI) updateUnifiedOrNot() {
if u.settings.GetSingleWindow() && u.unified == nil {
u.unified = u.unifiedCached
}
if !u.settings.GetSingleWindow() {
u.unified = nil
}
}
func (u *gtkUI) configLoaded(c *config.ApplicationConfig) {
u.settings = settings.For(c.GetUniqueID())
u.roster.restoreCollapseStatus()
u.deNotify.updateWith(u.settings)
u.updateUnifiedOrNot()
u.buildAccounts(c, u.sessionFactory, u.dialerFactory)
doInUIThread(func() {
if u.viewMenu != nil {
u.viewMenu.setFromConfig(c)
}
if u.optionsMenu != nil {
u.optionsMenu.setFromConfig(c)
}
if u.window != nil {
_, _ = u.window.Emit(accountChangedSignal.String())
}
})
u.addInitialAccountsToRoster()
if c.ConnectAutomatically {
u.connectAllAutomatics(false)
}
go u.listenToToggleConnectAllAutomatically()
go u.listenToSetShowAdvancedSettings()
}
func (u *gtkUI) saveConfigInternal() error {
err := u.saveConfigOnlyInternal()
if err != nil {
return err
}
u.addNewAccountsFromConfig(u.config, u.sessionFactory, u.dialerFactory)
if u.window != nil {
_, _ = u.window.Emit(accountChangedSignal.String())
}
return nil
}
func (u *gtkUI) saveConfigOnlyInternal() error {
return u.config.Save(u.keySupplier)
}
func (u *gtkUI) SaveConfig() {
go func() {
err := u.saveConfigInternal()
if err != nil {
u.log.WithError(err).Warn("Failed to save config file")
}
}()
}
func (u *gtkUI) removeSaveReload(acc *config.Account) {
//TODO: the account configs should be managed by the account manager
u.accountManager.removeAccount(acc, func() {
u.config.Remove(acc)
u.SaveConfig()
})
}
func (u *gtkUI) saveConfigOnly() {
go func() {
err := u.saveConfigOnlyInternal()
if err != nil {
u.log.WithError(err).Warn("Failed to save config file")
}
}()
}
func (u *gtkUI) onActivate() {
if activeWindow := u.app.GetActiveWindow(); activeWindow != nil {
activeWindow.Present()
return
}
applyHacks()
u.mainWindow()
// TODO: This code and the related to it should
// be removed when we finish the MUC functionality.
if config.MUCEnabledMockups {
u.mucGUI.ShowWindow()
}
go u.watchCommands()
go u.loadConfig(*config.ConfigFile)
}
func (u *gtkUI) Loop() {
_, _ = u.app.Connect("activate", u.onActivate)
u.app.Run([]string{})
}
func (u *gtkUI) initRoster() {
u.roster = u.newRoster()
}
func (u *gtkUI) mainWindow() {
builder := newBuilder("Main")
u.mainBuilder = builder
builder.ConnectSignals(map[string]interface{}{
"on_close_window": u.quit,
"on_add_contact_window": u.addContactWindow,
"on_new_conversation": u.newCustomConversation,
"on_about_dialog": u.aboutDialog,
"on_feedback_dialog": u.feedbackDialog,
"on_toggled_check_Item_Merge": u.toggleMergeAccounts,
"on_toggled_check_Item_Show_Offline": u.toggleShowOffline,
"on_toggled_check_Item_Show_Waiting": u.toggleShowWaiting,
"on_toggled_check_Item_Sort_By_Status": u.toggleSortByStatus,
"on_toggled_encrypt_configuration_file": u.toggleEncryptedConfig,
"on_preferences": u.showGlobalPreferences,
"on_muc_show_public_rooms": u.mucShowPublicRooms,
"on_muc_show_join_room": u.mucShowJoinRoom,
"on_create_chat_room": u.mucCreateChatRoom,
})
panicOnDevError(builder.bindObjects(u))
u.window.SetApplication(u.app)
u.displaySettings = detectCurrentDisplaySettingsFrom(u.window)
u.keyboardSettings = newKeyboardSettings()
// This must happen after u.displaySettings is initialized
// So now, roster depends on displaySettings which depends on mainWindow
u.initRoster()
addItemsThatShouldToggleOnGlobalMenuStatus(builder.getObj("newConvMenu").(isSensitive))
addItemsThatShouldToggleOnGlobalMenuStatus(builder.getObj("addMenu").(isSensitive))
// ViewMenu
u.viewMenu = new(viewMenu)
panicOnDevError(builder.bindObjects(u.viewMenu))
u.displaySettings.defaultSettingsOn(u.viewMenu.merge)
u.displaySettings.defaultSettingsOn(u.viewMenu.offline)
u.displaySettings.defaultSettingsOn(u.viewMenu.waiting)
u.displaySettings.defaultSettingsOn(u.viewMenu.sortStatus)
// OptionsMenu
u.optionsMenu = new(optionsMenu)
u.optionsMenu.encryptConfig = builder.getObj("EncryptConfigurationFileCheckMenuItem").(gtki.CheckMenuItem)
u.displaySettings.defaultSettingsOn(u.optionsMenu.encryptConfig)
u.initMenuBar()
obj := builder.getObj("Vbox")
vbox := obj.(gtki.Box)
vbox.PackStart(u.roster.widget, true, true, 0)
obj = builder.getObj("Hbox")
hbox := obj.(gtki.Box)
u.unified = newUnifiedLayout(u, vbox, hbox)
u.unifiedCached = u.unified
u.config.WhenLoaded(func(a *config.ApplicationConfig) {
if a.Display.HideFeedbackBar {
return
}
doInUIThread(u.addFeedbackInfoBar)
})
u.initSearchBar()
u.connectShortcutsMainWindow(u.window)
u.window.SetIcon(coyimIcon.GetPixbuf())
g.gtk.WindowSetDefaultIcon(coyimIcon.GetPixbuf())
//Ideally, this should respect widgets initial value for "display",
//and only call window.Show()
u.updateGlobalMenuStatus()
u.initializeMenus()
u.hooks.BeforeMainWindow(u)
u.setupSystemTray()
u.window.ShowAll()
}
func (u *gtkUI) setupSystemTray() {
si, _ := g.gtk.StatusIconNewFromPixbuf(coyimIcon.GetPixbuf())
si.SetTooltipText("CoyIM")
si.SetHasTooltip(true)
si.SetTitle("CoyIM")
si.SetVisible(true)
_, _ = si.Connect("activate", func() {
if u.window.IsActive() {
u.window.Hide()
} else {
u.window.Present()
}
})
}
func (u *gtkUI) addInitialAccountsToRoster() {
for _, account := range u.getAllAccounts() {
u.roster.update(account, rosters.New())
}
}
func (u *gtkUI) addFeedbackInfoBar() {
builder := newBuilder("FeedbackInfo")
obj := builder.getObj("feedbackInfo")
infobar := obj.(gtki.InfoBar)
u.notificationArea.PackEnd(infobar, true, true, 0)
infobar.ShowAll()
builder.ConnectSignals(map[string]interface{}{
"handleResponse": func(info gtki.InfoBar, response gtki.ResponseType) {
if response != gtki.RESPONSE_CLOSE {
return
}
infobar.Hide()
infobar.Destroy()
u.config.Display.HideFeedbackBar = true
u.saveConfigOnly()
},
})
obj = builder.getObj("feedbackButton")
button := obj.(gtki.Button)
_, _ = button.Connect("clicked", func() {
doInUIThread(u.feedbackDialog)
})
}
func (u *gtkUI) quit() {
u.accountManager.disconnectAll()
u.app.Quit()
}
func (u *gtkUI) askForPassword(accountName string, addGoogleWarning bool, cancel func(), connect func(string) error, savePass func(string)) {
dialogTemplate := "AskForPassword"
builder := newBuilder(dialogTemplate)
dialog := builder.getObj(dialogTemplate).(gtki.Dialog)
label := builder.getObj("accountName").(gtki.Label)
label.SetText(accountName)
label.SetSelectable(true)
if addGoogleWarning {
msg := builder.getObj("message").(gtki.Label)
msg.SetText(i18n.Local("You are trying to connect to a Google account - sometimes Google will not allow connections even if you have entered the correct password. Try turning on App specific password, or if that fails allow less secure applications to access the account (don't worry, CoyIM is plenty secure)."))
msg.SetSelectable(true)
}
passwordEntry := builder.getObj("password").(gtki.Entry)
savePassword := builder.getObj("savePassword").(gtki.CheckButton)
builder.ConnectSignals(map[string]interface{}{
"on_entered_password": func() {
password, _ := passwordEntry.GetText()
shouldSave := savePassword.GetActive()
if len(password) > 0 {
go func() {
_ = connect(password)
}()
if shouldSave {
go savePass(password)
}
dialog.Destroy()
}
},
"on_cancel_password": func() {
cancel()
dialog.Destroy()
},
})
dialog.SetTransientFor(u.window)
dialog.ShowAll()
}
func (u *gtkUI) feedbackDialog() {
builder := newBuilder("Feedback")
obj := builder.getObj("dialog")
dialog := obj.(gtki.Dialog)
builder.ConnectSignals(map[string]interface{}{
"on_close": func() {
dialog.Destroy()
},
})
doInUIThread(func() {
dialog.SetTransientFor(u.window)
dialog.ShowAll()
})
}
func (u *gtkUI) shouldViewAccounts() bool {
return !u.config.Display.MergeAccounts
}
func (u *gtkUI) aboutDialog() {
//TODO: This dialog automatically parses HTML and display clickable links.
//We may need to use g_markup_escape_text().
dialog, _ := g.gtk.AboutDialogNew()
dialog.SetName(i18n.Local("CoyIM!"))
dialog.SetProgramName(programName)
dialog.SetAuthors(authors())
dialog.SetVersion(coyimVersion)
dialog.SetLicense(`GNU GENERAL PUBLIC LICENSE, Version 3`)
dialog.SetWrapLicense(true)
dialog.SetTransientFor(u.window)
dialog.Run()
dialog.Destroy()
}
func (u *gtkUI) newCustomConversation() {
accounts := u.getAllConnectedAccounts()
var dialog gtki.Window
var model gtki.ListStore
var accountInput gtki.ComboBox
var peerInput gtki.Entry
builder := newBuilder("NewCustomConversation")
builder.getItems(
"NewCustomConversation", &dialog,
"accounts-model", &model,
"accounts", &accountInput,
"address", &peerInput,
)
dialog.SetApplication(u.app)
for _, acc := range accounts {
iter := model.Append()
_ = model.SetValue(iter, 0, acc.Account())
_ = model.SetValue(iter, 1, acc.ID())
}
if len(accounts) > 0 {
accountInput.SetActive(0)
}
builder.ConnectSignals(map[string]interface{}{
"on_close": dialog.Destroy,
"on_start": func() {
iter, err := accountInput.GetActiveIter()
if err != nil {
u.log.WithError(err).Warn("Error encountered when getting account")
return
}
val, err := model.GetValue(iter, 1)
if err != nil {
u.log.WithError(err).Warn("Error encountered when getting account")
return
}
accountID, _ := val.GetString()
account, ok := u.accountManager.getAccountByID(accountID)
if !ok {
return
}
j, _ := peerInput.GetText()
jj := jid.Parse(j)
switch jjj := jj.(type) {
case jid.WithResource:
u.openTargetedConversationView(account, jjj, true)
default:
u.openConversationView(account, jj, true)
}
dialog.Destroy()
},
})
dialog.SetTransientFor(u.window)
dialog.ShowAll()
}
func (u *gtkUI) addContactWindow() {
dialog := u.presenceSubscriptionDialog(func(accountID string, peer jid.WithoutResource, msg, nick string, autoAuth bool) error {
account, ok := u.accountManager.getAccountByID(accountID)
if !ok {
return fmt.Errorf(i18n.Local("There is no account with the id %q"), accountID)
}
if !account.connected() {
return errors.New(i18n.Local("Can't send a contact request from an offline account"))
}
err := account.session.RequestPresenceSubscription(peer, msg)
rl := u.accountManager.getContacts(account)
rl.SubscribeRequest(peer, "", accountID)
if nick != "" {
account.session.GetConfig().SavePeerDetails(peer.String(), nick, []string{})
u.SaveConfig()
}
if autoAuth {
account.session.AutoApprove(peer.String())
}
return err
})
dialog.SetTransientFor(u.window)
dialog.Show()
}
func (u *gtkUI) listenToToggleConnectAllAutomatically() {
for {
val := <-u.toggleConnectAllAutomaticallyRequest
u.config.ConnectAutomatically = val
u.saveConfigOnly()
}
}
func (u *gtkUI) setConnectAllAutomatically(val bool) {
u.toggleConnectAllAutomaticallyRequest <- val
}
func (u *gtkUI) setShowAdvancedSettings(val bool) {
u.setShowAdvancedSettingsRequest <- val
}
func (u *gtkUI) listenToSetShowAdvancedSettings() {
for {
val := <-u.setShowAdvancedSettingsRequest
u.config.AdvancedOptions = val
u.saveConfigOnly()
}
}
func (u *gtkUI) initMenuBar() {
_, _ = u.window.Connect(accountChangedSignal.String(), func() {
doInUIThread(func() {
u.buildAccountsMenu()
u.accountsMenu.ShowAll()
u.rosterUpdated()
})
})
u.buildAccountsMenu()
u.accountsMenu.ShowAll()
}
func (u *gtkUI) initSearchBar() {
u.searchEntry.SetCanFocus(true)
u.searchEntry.Map()
u.search.SetHAlign(gtki.ALIGN_FILL)
u.search.SetHExpand(true)
u.search.ConnectEntry(u.searchEntry)
u.roster.view.SetSearchEntry(u.searchEntry)
prov := providerWithCSS("entry { min-width: 300px; }")
updateWithStyle(u.searchEntry, prov)
prov = providerWithCSS("box { border: none; }")
updateWithStyle(u.searchBox, prov)
// TODO: unify with dark themes
prov = providerWithCSS("searchbar {background-color: #e8e8e7; }")
updateWithStyle(u.search, prov)
}
func (u *gtkUI) rosterUpdated() {
doInUIThread(u.roster.redraw)
if u.unified != nil {
doInUIThread(u.unified.update)
}
}
func (u *gtkUI) editAccount(account *account) {
u.accountDialog(account.session, account.session.GetConfig(), func() {
u.SaveConfig()
account.session.ReloadKeys()
})
}
func (u *gtkUI) removeAccount(account *account) {
u.confirmAccountRemoval(account.session.GetConfig(), func(c *config.Account) {
account.session.SetWantToBeOnline(false)
account.disconnect()
u.removeSaveReload(c)
})
}
func (u *gtkUI) toggleAutoConnectAccount(account *account) {
account.session.GetConfig().ToggleConnectAutomatically()
u.saveConfigOnly()
}
func (u *gtkUI) presenceUpdated(account *account, peer jid.WithResource, ev events.Presence) {
//TODO: Ignore presence updates for yourself.
if account == nil {
return
}
u.NewConversationViewFactory(account, peer, false).IfConversationView(func(c conversationView) {
doInUIThread(func() {
c.appendStatus(u.roster.displayNameFor(account, peer.NoResource()), time.Now(), ev.Show, ev.Status, ev.Gone)
})
}, func() {})
}
func (u *gtkUI) toggleAlwaysEncryptAccount(account *account) {
account.session.GetConfig().ToggleAlwaysEncrypt()
u.saveConfigOnly()
}
func (u *gtkUI) openConversationView(account *account, peer jid.Any, userInitiated bool) conversationView {
return u.NewConversationViewFactory(account, peer, false).OpenConversationView(userInitiated)
}
func (u *gtkUI) openTargetedConversationView(account *account, peer jid.Any, userInitiated bool) conversationView {
return u.NewConversationViewFactory(account, peer, true).OpenConversationView(userInitiated)
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid transactions.
In this test we connect to one node over p2p, and test tx requests."""
from test_framework.blocktools import create_block, create_coinbase
from test_framework.messages import (
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxOut,
)
from test_framework.mininode import P2PDataStore
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
wait_until,
)
from data import invalid_txs
class InvalidTxRequestTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [[
"-acceptnonstdtxn=1",
]]
self.setup_clean_chain = True
def bootstrap_p2p(self, *, num_connections=1):
"""Add a P2P connection to the node.
Helper to connect and wait for version handshake."""
for _ in range(num_connections):
self.nodes[0].add_p2p_connection(P2PDataStore())
def reconnect_p2p(self, **kwargs):
"""Tear down and bootstrap the P2P connection to the node.
The node gets disconnected several times in this test. This helper
method reconnects the p2p and restarts the network thread."""
self.nodes[0].disconnect_p2ps()
self.bootstrap_p2p(**kwargs)
def run_test(self):
node = self.nodes[0] # convenience reference to the node
self.bootstrap_p2p() # Add one p2p connection to the node
best_block = self.nodes[0].getbestblockhash()
tip = int(best_block, 16)
best_block_time = self.nodes[0].getblock(best_block)['time']
block_time = best_block_time + 1
self.log.info("Create a new block with an anyone-can-spend coinbase.")
height = 1
block = create_block(tip, create_coinbase(height), block_time)
block.solve()
# Save the coinbase for later
block1 = block
tip = block.sha256
node.p2p.send_blocks_and_test([block], node, success=True)
self.log.info("Mature the block.")
self.nodes[0].generatetoaddress(100, self.nodes[0].get_deterministic_priv_key().address)
# Iterate through a list of known invalid transaction types, ensuring each is
# rejected. Some are consensus invalid and some just violate policy.
for BadTxTemplate in invalid_txs.iter_all_templates():
self.log.info("Testing invalid transaction: %s", BadTxTemplate.__name__)
template = BadTxTemplate(spend_block=block1)
tx = template.get_tx()
node.p2p.send_txs_and_test(
[tx], node, success=False,
expect_disconnect=template.expect_disconnect,
reject_reason=template.reject_reason,
)
if template.expect_disconnect:
self.log.info("Reconnecting to peer")
self.reconnect_p2p()
# Make two p2p connections to provide the node with orphans
# * p2ps[0] will send valid orphan txs (one with low fee)
# * p2ps[1] will send an invalid orphan tx (and is later disconnected for that)
self.reconnect_p2p(num_connections=2)
self.log.info('Test orphan transaction handling ... ')
# Create a root transaction that we withhold until all dependent transactions
# are sent out and in the orphan cache
SCRIPT_PUB_KEY_OP_TRUE = b'\x51\x75' * 15 + b'\x51'
tx_withhold = CTransaction()
tx_withhold.vin.append(CTxIn(outpoint=COutPoint(block1.vtx[0].sha256, 0)))
tx_withhold.vout.append(CTxOut(nValue=50 * COIN - 12000, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE))
tx_withhold.calc_sha256()
# Our first orphan tx with some outputs to create further orphan txs
tx_orphan_1 = CTransaction()
tx_orphan_1.vin.append(CTxIn(outpoint=COutPoint(tx_withhold.sha256, 0)))
tx_orphan_1.vout = [CTxOut(nValue=10 * COIN, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE)] * 3
tx_orphan_1.calc_sha256()
# A valid transaction with low fee
tx_orphan_2_no_fee = CTransaction()
tx_orphan_2_no_fee.vin.append(CTxIn(outpoint=COutPoint(tx_orphan_1.sha256, 0)))
tx_orphan_2_no_fee.vout.append(CTxOut(nValue=10 * COIN, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE))
# A valid transaction with sufficient fee
tx_orphan_2_valid = CTransaction()
tx_orphan_2_valid.vin.append(CTxIn(outpoint=COutPoint(tx_orphan_1.sha256, 1)))
tx_orphan_2_valid.vout.append(CTxOut(nValue=10 * COIN - 12000, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE))
tx_orphan_2_valid.calc_sha256()
# An invalid transaction with negative fee
tx_orphan_2_invalid = CTransaction()
tx_orphan_2_invalid.vin.append(CTxIn(outpoint=COutPoint(tx_orphan_1.sha256, 2)))
tx_orphan_2_invalid.vout.append(CTxOut(nValue=11 * COIN, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE))
self.log.info('Send the orphans ... ')
# Send valid orphan txs from p2ps[0]
node.p2p.send_txs_and_test([tx_orphan_1, tx_orphan_2_no_fee, tx_orphan_2_valid], node, success=False)
# Send invalid tx from p2ps[1]
node.p2ps[1].send_txs_and_test([tx_orphan_2_invalid], node, success=False)
assert_equal(0, node.getmempoolinfo()['size']) # Mempool should be empty
assert_equal(2, len(node.getpeerinfo())) # p2ps[1] is still connected
self.log.info('Send the withhold tx ... ')
with node.assert_debug_log(expected_msgs=["bad-txns-in-belowout"]):
node.p2p.send_txs_and_test([tx_withhold], node, success=True)
# Transactions that should end up in the mempool
expected_mempool = {
t.hash
for t in [
tx_withhold, # The transaction that is the root for all orphans
tx_orphan_1, # The orphan transaction that splits the coins
tx_orphan_2_valid, # The valid transaction (with sufficient fee)
]
}
# Transactions that do not end up in the mempool
# tx_orphan_no_fee, because it has too low fee (p2ps[0] is not disconnected for relaying that tx)
# tx_orphan_invaid, because it has negative fee (p2ps[1] is disconnected for relaying that tx)
wait_until(lambda: 1 == len(node.getpeerinfo()), timeout=12) # p2ps[1] is no longer connected
assert_equal(expected_mempool, set(node.getrawmempool()))
if __name__ == '__main__':
InvalidTxRequestTest().main()
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Limitless - Responsive Web Application Kit by Eugene Kopyov</title>
<!-- Global stylesheets -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
<link href="assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="assets/css/core.css" rel="stylesheet" type="text/css">
<link href="assets/css/components.css" rel="stylesheet" type="text/css">
<link href="assets/css/colors.css" rel="stylesheet" type="text/css">
<!-- /global stylesheets -->
<!-- Core JS files -->
<script type="text/javascript" src="assets/js/plugins/loaders/pace.min.js"></script>
<script type="text/javascript" src="assets/js/core/libraries/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/core/libraries/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/plugins/loaders/blockui.min.js"></script>
<script type="text/javascript" src="assets/js/plugins/ui/nicescroll.min.js"></script>
<script type="text/javascript" src="assets/js/plugins/ui/drilldown.js"></script>
<!-- /core JS files -->
<!-- Theme JS files -->
<script type="text/javascript" src="assets/js/core/app.js"></script>
<script type="text/javascript" src="assets/js/pages/support_chat_layouts.js"></script>
<!-- /theme JS files -->
</head>
<body class="sidebar-xs">
<!-- Main navbar -->
<div class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="index.html"><img src="assets/images/logo_light.png" alt=""></a>
<ul class="nav navbar-nav pull-right visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
</ul>
</div>
<div class="navbar-collapse collapse" id="navbar-mobile">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-git-compare"></i>
<span class="visible-xs-inline-block position-right">Git updates</span>
<span class="badge bg-warning-400">9</span>
</a>
<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-heading">
Git updates
<ul class="icons-list">
<li><a href="#"><i class="icon-sync"></i></a></li>
</ul>
</div>
<ul class="media-list dropdown-content-body width-350">
<li class="media">
<div class="media-left">
<a href="#" class="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-pull-request"></i></a>
</div>
<div class="media-body">
Drop the IE <a href="#">specific hacks</a> for temporal inputs
<div class="media-annotation">4 minutes ago</div>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="#" class="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-commit"></i></a>
</div>
<div class="media-body">
Add full font overrides for popovers and tooltips
<div class="media-annotation">36 minutes ago</div>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="#" class="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-branch"></i></a>
</div>
<div class="media-body">
<a href="#">Chris Arney</a> created a new <span class="text-semibold">Design</span> branch
<div class="media-annotation">2 hours ago</div>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="#" class="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-merge"></i></a>
</div>
<div class="media-body">
<a href="#">Eugene Kopyov</a> merged <span class="text-semibold">Master</span> and <span class="text-semibold">Dev</span> branches
<div class="media-annotation">Dec 18, 18:36</div>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="#" class="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-pull-request"></i></a>
</div>
<div class="media-body">
Have Carousel ignore keyboard events
<div class="media-annotation">Dec 12, 05:46</div>
</div>
</li>
</ul>
<div class="dropdown-content-footer">
<a href="#" data-popup="tooltip" title="All activity"><i class="icon-menu display-block"></i></a>
</div>
</div>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-people"></i>
<span class="visible-xs-inline-block position-right">Users</span>
</a>
<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-heading">
Users online
<ul class="icons-list">
<li><a href="#"><i class="icon-gear"></i></a></li>
</ul>
</div>
<ul class="media-list dropdown-content-body width-300">
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face18.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading text-semibold">Jordana Ansley</a>
<span class="display-block text-muted text-size-small">Lead web developer</span>
</div>
<div class="media-right media-middle"><span class="status-mark border-success"></span></div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face24.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading text-semibold">Will Brason</a>
<span class="display-block text-muted text-size-small">Marketing manager</span>
</div>
<div class="media-right media-middle"><span class="status-mark border-danger"></span></div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face17.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading text-semibold">Hanna Walden</a>
<span class="display-block text-muted text-size-small">Project manager</span>
</div>
<div class="media-right media-middle"><span class="status-mark border-success"></span></div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face19.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading text-semibold">Dori Laperriere</a>
<span class="display-block text-muted text-size-small">Business developer</span>
</div>
<div class="media-right media-middle"><span class="status-mark border-warning-300"></span></div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face16.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading text-semibold">Vanessa Aurelius</a>
<span class="display-block text-muted text-size-small">UX expert</span>
</div>
<div class="media-right media-middle"><span class="status-mark border-grey-400"></span></div>
</li>
</ul>
<div class="dropdown-content-footer">
<a href="#" data-popup="tooltip" title="All users"><i class="icon-menu display-block"></i></a>
</div>
</div>
</li>
</ul>
<p class="navbar-text"><span class="label bg-success-400">Online</span></p>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown language-switch">
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="assets/images/flags/gb.png" class="position-left" alt="">
English
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a class="deutsch"><img src="assets/images/flags/de.png" alt=""> Deutsch</a></li>
<li><a class="ukrainian"><img src="assets/images/flags/ua.png" alt=""> Українська</a></li>
<li><a class="english"><img src="assets/images/flags/gb.png" alt=""> English</a></li>
<li><a class="espana"><img src="assets/images/flags/es.png" alt=""> España</a></li>
<li><a class="russian"><img src="assets/images/flags/ru.png" alt=""> Русский</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-bubbles4"></i>
<span class="visible-xs-inline-block position-right">Messages</span>
<span class="badge bg-warning-400">2</span>
</a>
<div class="dropdown-menu dropdown-content width-350">
<div class="dropdown-content-heading">
Messages
<ul class="icons-list">
<li><a href="#"><i class="icon-compose"></i></a></li>
</ul>
</div>
<ul class="media-list dropdown-content-body">
<li class="media">
<div class="media-left">
<img src="assets/images/demo/users/face10.jpg" class="img-circle img-sm" alt="">
<span class="badge bg-danger-400 media-badge">5</span>
</div>
<div class="media-body">
<a href="#" class="media-heading">
<span class="text-semibold">James Alexander</span>
<span class="media-annotation pull-right">04:58</span>
</a>
<span class="text-muted">who knows, maybe that would be the best thing for me...</span>
</div>
</li>
<li class="media">
<div class="media-left">
<img src="assets/images/demo/users/face3.jpg" class="img-circle img-sm" alt="">
<span class="badge bg-danger-400 media-badge">4</span>
</div>
<div class="media-body">
<a href="#" class="media-heading">
<span class="text-semibold">Margo Baker</span>
<span class="media-annotation pull-right">12:16</span>
</a>
<span class="text-muted">That was something he was unable to do because...</span>
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face24.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading">
<span class="text-semibold">Jeremy Victorino</span>
<span class="media-annotation pull-right">22:48</span>
</a>
<span class="text-muted">But that would be extremely strained and suspicious...</span>
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face4.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading">
<span class="text-semibold">Beatrix Diaz</span>
<span class="media-annotation pull-right">Tue</span>
</a>
<span class="text-muted">What a strenuous career it is that I've chosen...</span>
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face25.jpg" class="img-circle img-sm" alt=""></div>
<div class="media-body">
<a href="#" class="media-heading">
<span class="text-semibold">Richard Vango</span>
<span class="media-annotation pull-right">Mon</span>
</a>
<span class="text-muted">Other travelling salesmen live a life of luxury...</span>
</div>
</li>
</ul>
<div class="dropdown-content-footer">
<a href="#" data-popup="tooltip" title="All messages"><i class="icon-menu display-block"></i></a>
</div>
</div>
</li>
<li class="dropdown dropdown-user">
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="assets/images/demo/users/face11.jpg" alt="">
<span>Victoria</span>
<i class="caret"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#"><i class="icon-user-plus"></i> My profile</a></li>
<li><a href="#"><i class="icon-coins"></i> My balance</a></li>
<li><a href="#"><span class="badge badge-warning pull-right">58</span> <i class="icon-comment-discussion"></i> Messages</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-cog5"></i> Account settings</a></li>
<li><a href="#"><i class="icon-switch2"></i> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
<!-- /main navbar -->
<!-- Second navbar -->
<div class="navbar navbar-default" id="navbar-second">
<ul class="nav navbar-nav no-border visible-xs-block">
<li><a class="text-center collapsed" data-toggle="collapse" data-target="#navbar-second-toggle"><i class="icon-menu7"></i></a></li>
</ul>
<div class="navbar-collapse collapse" id="navbar-second-toggle">
<ul class="nav navbar-nav">
<li><a href="index.html"><i class="icon-display4 position-left"></i> Dashboard</a></li>
<li class="dropdown mega-menu mega-menu-wide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-puzzle4 position-left"></i> Components <span class="caret"></span></a>
<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-body">
<div class="row">
<div class="col-md-3">
<span class="menu-heading underlined">Forms</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-pencil3"></i> Form components</a>
<ul>
<li><a href="form_inputs_basic.html">Basic inputs</a></li>
<li><a href="form_checkboxes_radios.html">Checkboxes & radios</a></li>
<li><a href="form_input_groups.html">Input groups</a></li>
<li><a href="form_controls_extended.html">Extended controls</a></li>
<li>
<a href="#">Selects</a>
<ul>
<li><a href="form_select2.html">Select2 selects</a></li>
<li><a href="form_multiselect.html">Bootstrap multiselect</a></li>
<li><a href="form_select_box_it.html">SelectBoxIt selects</a></li>
<li><a href="form_bootstrap_select.html">Bootstrap selects</a></li>
</ul>
</li>
<li><a href="form_tag_inputs.html">Tag inputs</a></li>
<li><a href="form_dual_listboxes.html">Dual Listboxes</a></li>
<li><a href="form_editable.html">Editable forms</a></li>
<li><a href="form_validation.html">Validation</a></li>
<li><a href="form_inputs_grid.html">Inputs grid</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-footprint"></i> Wizards</a>
<ul>
<li><a href="wizard_steps.html">Steps wizard</a></li>
<li><a href="wizard_form.html">Form wizard</a></li>
<li><a href="wizard_stepy.html">Stepy wizard</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-spell-check"></i> Editors</a>
<ul>
<li><a href="editor_summernote.html">Summernote editor</a></li>
<li><a href="editor_ckeditor.html">CKEditor</a></li>
<li><a href="editor_wysihtml5.html">WYSIHTML5 editor</a></li>
<li><a href="editor_code.html">Code editor</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-select2"></i> Pickers</a>
<ul>
<li><a href="picker_date.html">Date & time pickers</a></li>
<li><a href="picker_color.html">Color pickers</a></li>
<li><a href="picker_location.html">Location pickers</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-insert-template"></i> Form layouts</a>
<ul>
<li><a href="form_layout_vertical.html">Vertical form</a></li>
<li><a href="form_layout_horizontal.html">Horizontal form</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Appearance</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-grid"></i> Components</a>
<ul>
<li><a href="components_modals.html">Modals</a></li>
<li><a href="components_dropdowns.html">Dropdown menus</a></li>
<li><a href="components_tabs.html">Tabs component</a></li>
<li><a href="components_pills.html">Pills component</a></li>
<li><a href="components_navs.html">Accordion and navs</a></li>
<li><a href="components_buttons.html">Buttons</a></li>
<li><a href="components_notifications_pnotify.html">PNotify notifications</a></li>
<li><a href="components_notifications_others.html">Other notifications</a></li>
<li><a href="components_popups.html">Tooltips and popovers</a></li>
<li><a href="components_alerts.html">Alerts</a></li>
<li><a href="components_pagination.html">Pagination</a></li>
<li><a href="components_labels.html">Labels and badges</a></li>
<li><a href="components_loaders.html">Loaders and bars</a></li>
<li><a href="components_thumbnails.html">Thumbnails</a></li>
<li><a href="components_page_header.html">Page header</a></li>
<li><a href="components_breadcrumbs.html">Breadcrumbs</a></li>
<li><a href="components_media.html">Media objects</a></li>
<li><a href="components_affix.html">Affix and Scrollspy</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-browser"></i> Content panels</a>
<ul>
<li><a href="panels.html">Panels</a></li>
<li><a href="panels_heading.html">Heading elements</a></li>
<li><a href="panels_draggable.html">Draggable panels</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-droplets"></i> Content styling</a>
<ul>
<li><a href="appearance_text_styling.html">Text styling</a></li>
<li><a href="appearance_typography.html">Typography</a></li>
<li><a href="appearance_helpers.html">Helper classes</a></li>
<li><a href="appearance_syntax_highlighter.html">Syntax highlighter</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-gift"></i> Extra components</a>
<ul>
<li><a href="extra_sliders_noui.html">NoUI sliders</a></li>
<li><a href="extra_sliders_ion.html">Ion range sliders</a></li>
<li><a href="extra_trees.html">Dynamic tree views</a></li>
<li><a href="extra_context_menu.html">Context menu</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-wrench3"></i> Tools</a>
<ul>
<li><a href="tools_session_timeout.html">Session timeout</a></li>
<li><a href="tools_idle_timeout.html">Idle timeout</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Extensions</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-puzzle4"></i> Extensions</a>
<ul>
<li><a href="extension_image_cropper.html">Image cropper</a></li>
<li><a href="extension_blockui.html">Block UI</a></li>
<li><a href="extension_dnd.html">Drag and drop</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-popout"></i> JQuery UI</a>
<ul>
<li><a href="jqueryui_interactions.html">Interactions</a></li>
<li><a href="jqueryui_forms.html">Forms</a></li>
<li><a href="jqueryui_components.html">Components</a></li>
<li><a href="jqueryui_sliders.html">Sliders</a></li>
<li><a href="jqueryui_navigation.html">Navigation</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-upload"></i> File uploaders</a>
<ul>
<li><a href="uploader_plupload.html">Plupload</a></li>
<li><a href="uploader_bootstrap.html">Bootstrap file uploader</a></li>
<li><a href="uploader_dropzone.html">Dropzone</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-calendar3"></i> Event calendars</a>
<ul>
<li><a href="fullcalendar_views.html">Basic views</a></li>
<li><a href="fullcalendar_styling.html">Event styling</a></li>
<li><a href="fullcalendar_formats.html">Language and time</a></li>
<li><a href="fullcalendar_advanced.html">Advanced usage</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-sphere"></i> Internationalization</a>
<ul>
<li><a href="internationalization_switch_direct.html">Direct translation</a></li>
<li><a href="internationalization_switch_query.html">Querystring parameter</a></li>
<li><a href="internationalization_on_init.html">Set language on init</a></li>
<li><a href="internationalization_after_init.html">Set language after init</a></li>
<li><a href="internationalization_fallback.html">Language fallback</a></li>
<li><a href="internationalization_callbacks.html">Callbacks</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Tables</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-table2"></i> Basic tables</a>
<ul>
<li><a href="table_basic.html">Basic examples</a></li>
<li><a href="table_sizing.html">Table sizing</a></li>
<li><a href="table_borders.html">Table borders</a></li>
<li><a href="table_styling.html">Table styling</a></li>
<li><a href="table_elements.html">Table elements</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-grid7"></i> Data tables</a>
<ul>
<li><a href="datatable_basic.html">Basic initialization</a></li>
<li><a href="datatable_styling.html">Basic styling</a></li>
<li><a href="datatable_advanced.html">Advanced examples</a></li>
<li><a href="datatable_sorting.html">Sorting options</a></li>
<li><a href="datatable_api.html">Using API</a></li>
<li><a href="datatable_data_sources.html">Data sources</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-alignment-unalign"></i> Data tables extensions</a>
<ul>
<li><a href="datatable_extension_reorder.html">Columns reorder</a></li>
<li><a href="datatable_extension_row_reorder.html">Row reorder</a></li>
<li><a href="datatable_extension_fixed_columns.html">Fixed columns</a></li>
<li><a href="datatable_extension_fixed_header.html">Fixed header</a></li>
<li><a href="datatable_extension_autofill.html">Auto fill</a></li>
<li><a href="datatable_extension_key_table.html">Key table</a></li>
<li><a href="datatable_extension_scroller.html">Scroller</a></li>
<li><a href="datatable_extension_select.html">Select</a></li>
<li>
<a href="#">Buttons</a>
<ul>
<li><a href="datatable_extension_buttons_init.html">Initialization</a></li>
<li><a href="datatable_extension_buttons_flash.html">Flash buttons</a></li>
<li><a href="datatable_extension_buttons_print.html">Print buttons</a></li>
<li><a href="datatable_extension_buttons_html5.html">HTML5 buttons</a></li>
</ul>
</li>
<li><a href="datatable_extension_colvis.html">Columns visibility</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-file-spreadsheet"></i> Handsontable</a>
<ul>
<li><a href="handsontable_basic.html">Basic configuration</a></li>
<li><a href="handsontable_advanced.html">Advanced setup</a></li>
<li><a href="handsontable_cols.html">Column features</a></li>
<li><a href="handsontable_cells.html">Cell features</a></li>
<li><a href="handsontable_types.html">Basic cell types</a></li>
<li><a href="handsontable_custom_checks.html">Custom & checkboxes</a></li>
<li><a href="handsontable_ac_password.html">Autocomplete & password</a></li>
<li><a href="handsontable_search.html">Search</a></li>
<li><a href="handsontable_context.html">Context menu</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-versions"></i> Responsive options</a>
<ul>
<li><a href="table_responsive.html">Responsive basic tables</a></li>
<li><a href="datatable_responsive.html">Responsive data tables</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</li>
<li class="dropdown mega-menu mega-menu-wide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-stars position-left"></i> Features <span class="caret"></span></a>
<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-body">
<div class="row">
<div class="col-md-3">
<span class="menu-heading underlined">Main content</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-stack2"></i> Page layouts</a>
<ul>
<li><a href="layout_navbar_fixed.html">Fixed navbar</a></li>
<li><a href="layout_navbar_hideable.html">Hideable navbar</a></li>
<li><a href="layout_sidebar_sticky_custom.html">Sticky sidebar (custom scroll)</a></li>
<li><a href="layout_sidebar_sticky_native.html">Sticky sidebar (native scroll)</a></li>
<li><a href="layout_footer_fixed.html">Fixed footer</a></li>
<li><a href="../RTL/index.html">RTL version</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-align-center-horizontal"></i> Fixed width</a>
<ul>
<li><a href="boxed_full.html">Boxed full width</a></li>
<li><a href="boxed_default.html">Boxed with default sidebar</a></li>
<li><a href="boxed_mini.html">Boxed with mini sidebar</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-copy"></i> Layouts</a>
<ul>
<li><a href="../../layout_1/LTR/index.html" id="layout1">Layout 1</a></li>
<li><a href="../../layout_2/LTR/index.html" id="layout2">Layout 2</a></li>
<li><a href="../../layout_3/LTR/index.html" id="layout3">Layout 3</a></li>
<li><a href="index.html" id="layout4">Layout 4 <span class="label bg-warning-400">Current</span></a></li>
<li class="disabled"><a href="../../layout_5/LTR/index.html" id="layout5">Layout 5 <span class="label bg-slate-300">Coming soon</span></a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-droplet2"></i> Color system</a>
<ul>
<li><a href="colors_primary.html">Primary palette</a></li>
<li><a href="colors_danger.html">Danger palette</a></li>
<li><a href="colors_success.html">Success palette</a></li>
<li><a href="colors_warning.html">Warning palette</a></li>
<li><a href="colors_info.html">Info palette</a></li>
<li class="divider"></li>
<li><a href="colors_pink.html">Pink palette</a></li>
<li><a href="colors_violet.html">Violet palette</a></li>
<li><a href="colors_purple.html">Purple palette</a></li>
<li><a href="colors_indigo.html">Indigo palette</a></li>
<li><a href="colors_blue.html">Blue palette</a></li>
<li><a href="colors_teal.html">Teal palette</a></li>
<li><a href="colors_green.html">Green palette</a></li>
<li><a href="colors_orange.html">Orange palette</a></li>
<li><a href="colors_brown.html">Brown palette</a></li>
<li><a href="colors_grey.html">Grey palette</a></li>
<li><a href="colors_slate.html">Slate palette</a></li>
</ul>
</li>
<li><a href="appearance_content_grid.html"><i class="icon-grid52"></i> Grid system</a></li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Layout</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-indent-decrease2"></i> Sidebars</a>
<ul>
<li><a href="sidebar_default_collapse.html">Default collapsible</a></li>
<li><a href="sidebar_default_hide.html">Default hideable</a></li>
<li><a href="sidebar_mini_collapse.html">Mini collapsible</a></li>
<li><a href="sidebar_mini_hide.html">Mini hideable</a></li>
<li>
<a href="#">Dual sidebar</a>
<ul>
<li><a href="sidebar_dual.html">Dual sidebar</a></li>
<li><a href="sidebar_dual_double_collapse.html">Dual double collapse</a></li>
<li><a href="sidebar_dual_double_hide.html">Dual double hide</a></li>
<li><a href="sidebar_dual_swap.html">Swap sidebars</a></li>
</ul>
</li>
<li>
<a href="#">Double sidebar</a>
<ul>
<li><a href="sidebar_double_collapse.html">Collapse main sidebar</a></li>
<li><a href="sidebar_double_hide.html">Hide main sidebar</a></li>
<li><a href="sidebar_double_fix_default.html">Fix default width</a></li>
<li><a href="sidebar_double_fix_mini.html">Fix mini width</a></li>
<li><a href="sidebar_double_visible.html">Opposite sidebar visible</a></li>
</ul>
</li>
<li><a href="sidebar_categories.html">Separate categories</a></li>
<li><a href="sidebar_hidden.html">Hidden sidebar</a></li>
<li><a href="sidebar_dark.html">Dark sidebar</a></li>
<li><a href="sidebar_components.html">Sidebar components</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-sort"></i> Vertical navigation</a>
<ul>
<li><a href="navigation_vertical_collapsible.html">Collapsible menu</a></li>
<li><a href="navigation_vertical_accordion.html">Accordion menu</a></li>
<li><a href="navigation_vertical_sizing.html">Navigation sizing</a></li>
<li><a href="navigation_vertical_bordered.html">Bordered navigation</a></li>
<li><a href="navigation_vertical_right_icons.html">Right icons</a></li>
<li><a href="navigation_vertical_labels_badges.html">Labels and badges</a></li>
<li><a href="navigation_vertical_disabled.html">Disabled navigation links</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-transmission"></i> Horizontal navigation</a>
<ul>
<li><a href="navigation_horizontal_click.html">Submenu on click</a></li>
<li><a href="navigation_horizontal_hover.html">Submenu on hover</a></li>
<li><a href="navigation_horizontal_elements.html">With custom elements</a></li>
<li><a href="navigation_horizontal_tabs.html">Tabbed navigation</a></li>
<li><a href="navigation_horizontal_disabled.html">Disabled navigation links</a></li>
<li><a href="navigation_horizontal_mega.html">Horizontal mega menu</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-paragraph-justify3"></i> Navbars</a>
<ul>
<li><a href="navbar_single.html">Single navbar</a></li>
<li>
<a href="#">Multiple navbars</a>
<ul>
<li><a href="navbar_multiple_navbar_navbar.html">Navbar + navbar</a></li>
<li><a href="navbar_multiple_header_navbar.html">Header + navbar</a></li>
<li><a href="navbar_multiple_navbar_content.html">Navbar + content</a></li>
<li><a href="navbar_multiple_top_bottom.html">Top + bottom</a></li>
</ul>
</li>
<li><a href="navbar_colors.html">Color options</a></li>
<li><a href="navbar_sizes.html">Sizing options</a></li>
<li><a href="navbar_hideable.html">Hide on scroll</a></li>
<li><a href="navbar_components.html">Navbar components</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-tree5"></i> Menu levels</a>
<ul>
<li><a href="#"><i class="icon-IE"></i> Second level</a></li>
<li>
<a href="#"><i class="icon-firefox"></i> Second level with child</a>
<ul>
<li><a href="#"><i class="icon-android"></i> Third level</a></li>
<li>
<a href="#"><i class="icon-apple2"></i> Third level with child</a>
<ul>
<li><a href="#"><i class="icon-html5"></i> Fourth level</a></li>
<li><a href="#"><i class="icon-css3"></i> Fourth level</a></li>
</ul>
</li>
<li><a href="#"><i class="icon-windows"></i> Third level</a></li>
</ul>
</li>
<li><a href="#"><i class="icon-chrome"></i> Second level</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Data visualization</span>
<ul class="menu-list">
<li>
<a href="#"><i class="icon-graph"></i> Echarts library</a>
<ul>
<li><a href="echarts_lines_areas.html">Lines and areas</a></li>
<li><a href="echarts_columns_waterfalls.html">Columns and waterfalls</a></li>
<li><a href="echarts_bars_tornados.html">Bars and tornados</a></li>
<li><a href="echarts_scatter.html">Scatter charts</a></li>
<li><a href="echarts_pies_donuts.html">Pies and donuts</a></li>
<li><a href="echarts_funnels_chords.html">Funnels and chords</a></li>
<li><a href="echarts_candlesticks_others.html">Candlesticks and others</a></li>
<li><a href="echarts_combinations.html">Chart combinations</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-statistics"></i> D3 library</a>
<ul>
<li><a href="d3_lines_basic.html">Simple lines</a></li>
<li><a href="d3_lines_advanced.html">Advanced lines</a></li>
<li><a href="d3_bars_basic.html">Simple bars</a></li>
<li><a href="d3_bars_advanced.html">Advanced bars</a></li>
<li><a href="d3_pies.html">Pie charts</a></li>
<li><a href="d3_circle_diagrams.html">Circle diagrams</a></li>
<li><a href="d3_tree.html">Tree layout</a></li>
<li><a href="d3_other.html">Other charts</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-stats-dots"></i> Dimple library</a>
<ul>
<li>
<a href="#">Line charts</a>
<ul>
<li><a href="dimple_lines_horizontal.html">Horizontal orientation</a></li>
<li><a href="dimple_lines_vertical.html">Vertical orientation</a></li>
</ul>
</li>
<li>
<a href="#">Bar charts</a>
<ul>
<li><a href="dimple_bars_horizontal.html">Horizontal orientation</a></li>
<li><a href="dimple_bars_vertical.html">Vertical orientation</a></li>
</ul>
</li>
<li>
<a href="#">Area charts</a>
<ul>
<li><a href="dimple_area_horizontal.html">Horizontal orientation</a></li>
<li><a href="dimple_area_vertical.html">Vertical orientation</a></li>
</ul>
</li>
<li>
<a href="#">Step charts</a>
<ul>
<li><a href="dimple_step_horizontal.html">Horizontal orientation</a></li>
<li><a href="dimple_step_vertical.html">Vertical orientation</a></li>
</ul>
</li>
<li><a href="dimple_pies.html">Pie charts</a></li>
<li><a href="dimple_rings.html">Ring charts</a></li>
<li><a href="dimple_scatter.html">Scatter charts</a></li>
<li><a href="dimple_bubble.html">Bubble charts</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-stats-bars"></i> C3 library</a>
<ul>
<li><a href="c3_lines_areas.html">Lines and areas</a></li>
<li><a href="c3_bars_pies.html">Bars and pies</a></li>
<li><a href="c3_advanced.html">Advanced examples</a></li>
<li><a href="c3_axis.html">Chart axis</a></li>
<li><a href="c3_grid.html">Grid options</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-google"></i> Google visualization</a>
<ul>
<li><a href="google_lines.html">Line charts</a></li>
<li><a href="google_bars.html">Bar charts</a></li>
<li><a href="google_pies.html">Pie charts</a></li>
<li><a href="google_scatter_bubble.html">Bubble & scatter charts</a></li>
<li><a href="google_other.html">Other charts</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-md-3">
<span class="menu-heading underlined">Extras</span>
<ul class="menu-list">
<li><a href="animations_css3.html"><i class="icon-spinner3 spinner position-left"></i> CSS3 animations</a></li>
<li>
<a href="#"><i class="icon-spinner10 spinner position-left"></i> Velocity animations</a>
<ul>
<li><a href="animations_velocity_basic.html">Basic usage</a></li>
<li><a href="animations_velocity_ui.html">UI pack effects</a></li>
<li><a href="animations_velocity_examples.html">Advanced examples</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-map5"></i> Maps integration</a>
<ul>
<li>
<a href="#">Google maps</a>
<ul>
<li><a href="maps_google_basic.html">Basics</a></li>
<li><a href="maps_google_controls.html">Controls</a></li>
<li><a href="maps_google_markers.html">Markers</a></li>
<li><a href="maps_google_drawings.html">Map drawings</a></li>
<li><a href="maps_google_layers.html">Layers</a></li>
</ul>
</li>
<li><a href="maps_vector.html">Vector maps</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-magazine"></i> Timelines</a>
<ul>
<li><a href="timelines_left.html">Left timeline</a></li>
<li><a href="timelines_right.html">Right timeline</a></li>
<li><a href="timelines_center.html">Centered timeline</a></li>
</ul>
</li>
<li>
<a href="#"><i class="icon-thumbs-up2 position-left"></i> Icons</a>
<ul>
<li><a href="icons_glyphicons.html">Glyphicons</a></li>
<li><a href="icons_icomoon.html">Icomoon</a></li>
<li><a href="icons_fontawesome.html">Font awesome</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-make-group position-left"></i> Page kits <span class="caret"></span>
</a>
<ul class="dropdown-menu width-250">
<li class="dropdown-header">Apps</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-task"></i> Task manager</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Options</li>
<li><a href="task_manager_grid.html">Task grid</a></li>
<li><a href="task_manager_list.html">Task list</a></li>
<li><a href="task_manager_detailed.html">Task detailed</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-cash3"></i> Invoicing</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Options</li>
<li><a href="invoice_template.html">Invoice template</a></li>
<li><a href="invoice_grid.html">Invoice grid</a></li>
<li><a href="invoice_archive.html">Invoice archive</a></li>
</ul>
</li>
<li class="dropdown-header">User</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-people"></i> User pages</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Basic</li>
<li><a href="user_pages_cards.html">User cards</a></li>
<li><a href="user_pages_list.html">User list</a></li>
<li class="dropdown-header highlight">Profiles</li>
<li><a href="user_pages_profile.html">Simple profile</a></li>
<li><a href="user_pages_profile_cover.html">Profile with cover</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-user-plus"></i> Login & registration</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Basic</li>
<li><a href="login_simple.html">Simple login</a></li>
<li><a href="login_advanced.html">More login info</a></li>
<li><a href="login_registration.html">Simple registration</a></li>
<li><a href="login_registration_advanced.html">More registration info</a></li>
<li><a href="login_validation.html">With validation</a></li>
<li><a href="login_tabbed.html">Tabbed form</a></li>
<li><a href="login_modals.html">Inside modals</a></li>
<li class="dropdown-header highlight">Service</li>
<li><a href="login_unlock.html">Unlock user</a></li>
<li><a href="login_password_recover.html">Reset password</a></li>
<li class="dropdown-header highlight">Other</li>
<li><a href="login_hide_navbar.html">Hide navbar</a></li>
<li><a href="login_transparent.html">Transparent box</a></li>
<li><a href="login_background.html">Background option</a></li>
</ul>
</li>
<li class="dropdown-header">Kits</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-search4"></i> Search</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Basic</li>
<li><a href="search_basic.html">Basic search results</a></li>
<li><a href="search_users.html">User search results</a></li>
<li class="dropdown-header highlight">Media</li>
<li><a href="search_images.html">Image search results</a></li>
<li><a href="search_videos.html">Video search results</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-images2"></i> Gallery</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Options</li>
<li><a href="gallery_grid.html">Media grid</a></li>
<li><a href="gallery_titles.html">Media with titles</a></li>
<li><a href="gallery_description.html">Media with description</a></li>
<li><a href="gallery_library.html">Media library</a></li>
</ul>
</li>
<li class="dropdown-header">Tools</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-lifebuoy"></i> Support</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Chats</li>
<li class="active"><a href="support_conversation_layouts.html">Conversation layouts</a></li>
<li><a href="support_conversation_options.html">Conversation options</a></li>
<li class="dropdown-header highlight">Knowledgebase</li>
<li><a href="support_knowledgebase.html">Knowledgebase</a></li>
<li><a href="support_faq.html">FAQ page</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#"><i class="icon-warning"></i> Error pages</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header highlight">Options</li>
<li><a href="error_403.html">Error 403</a></li>
<li><a href="error_404.html">Error 404</a></li>
<li><a href="error_405.html">Error 405</a></li>
<li><a href="error_500.html">Error 500</a></li>
<li><a href="error_503.html">Error 503</a></li>
<li><a href="error_offline.html">Offline page</a></li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-strategy position-left"></i> Starter kit <span class="caret"></span>
</a>
<ul class="dropdown-menu width-200">
<li class="dropdown-header">Basic layouts</li>
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-grid2"></i> Columns</a>
<ul class="dropdown-menu">
<li class="dropdown-header highlight">Options</li>
<li><a href="starters/1_col.html">One column</a></li>
<li><a href="starters/2_col.html">Two columns</a></li>
<li class="dropdown-submenu">
<a href="#">Three columns</a>
<ul class="dropdown-menu">
<li class="dropdown-header highlight">Sidebar position</li>
<li><a href="starters/3_col_dual.html">Dual sidebars</a></li>
<li><a href="starters/3_col_double.html">Double sidebars</a></li>
</ul>
</li>
<li><a href="starters/4_col.html">Four columns</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-paragraph-justify3"></i> Navbars</a>
<ul class="dropdown-menu">
<li class="dropdown-header highlight">Fixed navbars</li>
<li><a href="starters/layout_navbar_fixed_main.html">Fixed main navbar</a></li>
<li><a href="starters/layout_navbar_fixed_secondary.html">Fixed secondary navbar</a></li>
<li><a href="starters/layout_navbar_fixed_both.html">Both navbars fixed</a></li>
</ul>
</li>
<li class="dropdown-header">Optional layouts</li>
<li><a href="starters/layout_boxed.html"><i class="icon-align-center-horizontal"></i> Fixed width</a></li>
<li><a href="starters/layout_sidebar_sticky.html"><i class="icon-flip-vertical3"></i> Sticky sidebar</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="changelog.html">
<i class="icon-history position-left"></i>
Changelog
<span class="label label-inline position-right bg-success-400">1.2.1</span>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-cog3"></i>
<span class="visible-xs-inline-block position-right">Share</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#"><i class="icon-user-lock"></i> Account security</a></li>
<li><a href="#"><i class="icon-statistics"></i> Analytics</a></li>
<li><a href="#"><i class="icon-accessibility"></i> Accessibility</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-gear"></i> All settings</a></li>
</ul>
</li>
</ul>
</div>
</div>
<!-- /second navbar -->
<!-- Page header -->
<div class="page-header">
<div class="page-header-content">
<div class="page-title">
<h4><i class="icon-arrow-left52 position-left"></i> <span class="text-semibold">Conversation</span> - Layouts</h4>
<ul class="breadcrumb breadcrumb-caret position-right">
<li><a href="index.html">Home</a></li>
<li><a href="support_conversation_layouts.html">Conversation</a></li>
<li class="active">Layouts</li>
</ul>
</div>
<div class="heading-elements">
<div class="heading-btn-group">
<a href="#" class="btn btn-link btn-float has-text"><i class="icon-bars-alt text-primary"></i><span>Statistics</span></a>
<a href="#" class="btn btn-link btn-float has-text"><i class="icon-calculator text-primary"></i> <span>Invoices</span></a>
<a href="#" class="btn btn-link btn-float has-text"><i class="icon-calendar5 text-primary"></i> <span>Schedule</span></a>
</div>
</div>
</div>
</div>
<!-- /page header -->
<!-- Page container -->
<div class="page-container">
<!-- Page content -->
<div class="page-content">
<!-- Secondary sidebar -->
<div class="sidebar sidebar-secondary sidebar-default">
<div class="sidebar-content">
<!-- Title -->
<div class="category-title h6">
<span>Alternative options</span>
<ul class="icons-list">
<li><a href="#"><i class="icon-gear"></i></a></li>
</ul>
</div>
<!-- /title -->
<!-- Search messages -->
<div class="sidebar-category">
<div class="category-title">
<span>Search messages</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content">
<form action="#">
<div class="has-feedback has-feedback-left">
<input type="search" class="form-control" placeholder="Type and hit Enter">
<div class="form-control-feedback">
<i class="icon-search4 text-size-base text-muted"></i>
</div>
</div>
</form>
</div>
</div>
<!-- /search messages -->
<!-- Actions -->
<div class="sidebar-category">
<div class="category-title">
<span>Actions</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content">
<a href="#" class="btn bg-pink-400 btn-rounded btn-block btn-xs">New message</a>
<a href="#" class="btn bg-teal-400 btn-rounded btn-block btn-xs">New conference</a>
</div>
</div>
<!-- /actions -->
<!-- Sub navigation -->
<div class="sidebar-category">
<div class="category-title">
<span>Navigation</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content no-padding">
<ul class="navigation navigation-alt navigation-accordion">
<li class="navigation-header">Actions</li>
<li><a href="#"><i class="icon-compose"></i> Compose message</a></li>
<li><a href="#"><i class="icon-collaboration"></i> Conference</a></li>
<li><a href="#"><i class="icon-user-plus"></i> Add users <span class="label label-success">32 online</span></a></li>
<li><a href="#"><i class="icon-users"></i> Create team</a></li>
<li class="navigation-divider"></li>
<li><a href="#"><i class="icon-files-empty"></i> All messages <span class="badge badge-danger">99+</span></a></li>
<li><a href="#"><i class="icon-file-plus"></i> Active discussions <span class="badge badge-default">32</span></a></li>
<li><a href="#"><i class="icon-file-locked"></i> Closed discussions</a></li>
<li class="navigation-header">Options</li>
<li><a href="#"><i class="icon-reading"></i> Message history</a></li>
<li><a href="#"><i class="icon-cog3"></i> Settings</a></li>
</ul>
</div>
</div>
<!-- /sub navigation -->
<!-- Latest updates -->
<div class="sidebar-category">
<div class="category-title">
<span>Latest updates</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content">
<ul class="media-list">
<li class="media">
<div class="media-left"><a href="#" class="btn border-success text-success btn-flat btn-icon btn-sm btn-rounded"><i class="icon-checkmark3"></i></a></div>
<div class="media-body">
<a href="#">Richard Vango</a> has been registered
<div class="media-annotation">4 minutes ago</div>
</div>
</li>
<li class="media">
<div class="media-left"><a href="#" class="btn border-slate text-slate btn-flat btn-icon btn-sm btn-rounded"><i class="icon-infinite"></i></a></div>
<div class="media-body">
Server went offline for monthly maintenance
<div class="media-annotation">36 minutes ago</div>
</div>
</li>
<li class="media">
<div class="media-left"><a href="#" class="btn border-success text-success btn-flat btn-icon btn-sm btn-rounded"><i class="icon-checkmark3"></i></a></div>
<div class="media-body">
<a href="#">Chris Arney</a> has been registered
<div class="media-annotation">2 hours ago</div>
</div>
</li>
<li class="media">
<div class="media-left"><a href="#" class="btn border-danger text-danger btn-flat btn-icon btn-sm btn-rounded"><i class="icon-cross2"></i></a></div>
<div class="media-body">
<a href="#">Chris Arney</a> left main conversation
<div class="media-annotation">Dec 18, 18:36</div>
</div>
</li>
<li class="media">
<div class="media-left"><a href="#" class="btn border-primary text-primary btn-flat btn-icon btn-sm btn-rounded"><i class="icon-plus3"></i></a></div>
<div class="media-body">
<a href="#">Beatrix Diaz</a> just joined conversation
<div class="media-annotation">Dec 12, 05:46</div>
</div>
</li>
</ul>
</div>
</div>
<!-- /latest updates -->
<!-- Online users -->
<div class="sidebar-category">
<div class="category-title">
<span>Online users</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content no-padding">
<ul class="media-list media-list-linked">
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face1.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">James Alexander</span>
<span class="text-size-small text-muted display-block">UI/UX expert</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-success"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face2.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Jeremy Victorino</span>
<span class="text-size-small text-muted display-block">Senior designer</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-danger"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face6.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading"><span class="text-semibold">Jordana Mills</span></div>
<span class="text-muted">Sales consultant</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-grey-300"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face9.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading"><span class="text-semibold">William Miles</span></div>
<span class="text-muted">SEO expert</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-success"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Margo Baker</span>
<span class="text-size-small text-muted display-block">Google</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-success"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face4.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Beatrix Diaz</span>
<span class="text-size-small text-muted display-block">Facebook</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-warning-400"></span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face5.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Richard Vango</span>
<span class="text-size-small text-muted display-block">Microsoft</span>
</div>
<div class="media-right media-middle">
<span class="status-mark bg-grey-300"></span>
</div>
</a>
</li>
</ul>
</div>
</div>
<!-- /online users -->
<!-- Latest messages -->
<div class="sidebar-category">
<div class="category-title">
<span>Latest messages</span>
<ul class="icons-list">
<li><a href="#" data-action="collapse"></a></li>
</ul>
</div>
<div class="category-content no-padding">
<ul class="media-list media-list-linked">
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Will Samuel</span>
<span class="text-muted">And he looked over at the alarm clock, ticking..</span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face11.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Margo Baker</span>
<span class="text-muted">However hard he threw himself onto..</span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face12.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Monica Smith</span>
<span class="text-muted">Yes, but was it spanossible to quietly sleep through..</span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face13.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">Jordana Mills</span>
<span class="text-muted">What should he do now? The next train went at..</span>
</div>
</a>
</li>
<li class="media">
<a href="#" class="media-link">
<div class="media-left"><img src="assets/images/demo/users/face14.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<span class="media-heading text-semibold">John Craving</span>
<span class="text-muted">Gregor then turned to look out the window..</span>
</div>
</a>
</li>
</ul>
</div>
</div>
<!-- /latest messages -->
</div>
</div>
<!-- /secondary sidebar -->
<!-- Main content -->
<div class="content-wrapper">
<!-- Basic layout -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Default layout</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-list content-group">
<li class="media date-step">
<span>Monday, Feb 10</span>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Below mounted advantageous spread yikes bat stubbornly crud a and a excepting</div>
<span class="media-annotation display-block mt-10">Mon, 9:54 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Far squid and that hello fidgeted and when. As this oh darn but slapped casually husky sheared that cardinal hugely one and some unnecessary factiously hedgehog a feeling one rudely much but one owing sympathetic regardless more astonishing evasive tasteful much.</div>
<span class="media-annotation display-block mt-10">Mon, 10:24 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Darn over sour then cynically less roadrunner up some cast buoyant. Macaw krill when and upon less contrary warthog jeez some koala less since therefore minimal.</div>
<span class="media-annotation display-block mt-10">Mon, 10:56 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Some upset impious a and submissive when far crane the belched coquettishly. More the puerile dove wherever</div>
<span class="media-annotation display-block mt-10">Mon, 11:29 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media date-step">
<span>Yesterday</span>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Regardless equitably hello heron glum cassowary jocosely before reliably a jeepers wholehearted shuddered more that some where far by koala.</div>
<span class="media-annotation display-block mt-10">Tue, 6:40 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Crud reran and while much withdrew ardent much crab hugely met dizzily that more jeez gent equivalent unsafely far one hesitant so therefore.</div>
<span class="media-annotation display-block mt-10">Tue, 10:28 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Thus superb the tapir the wallaby blank frog execrably much since dalmatian by in hot. Uninspiringly arose mounted stared one curt safe</div>
<span class="media-annotation display-block mt-10">Tue, 8:12 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media date-step">
<span>Today</span>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Tolerantly some understood this stubbornly after snarlingly frog far added insect into snorted more auspiciously heedless drunkenly jeez foolhardy oh.</div>
<span class="media-annotation display-block mt-10">Wed, 4:20 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Satisfactorily strenuously while sleazily dear frustratingly insect menially some shook far sardonic badger telepathic much jeepers immature much hey.</div>
<span class="media-annotation display-block mt-10">2 hours ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Grunted smirked and grew less but rewound much despite and impressive via alongside out and gosh easy manatee dear ineffective yikes.</div>
<span class="media-annotation display-block mt-10">13 minutes ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content"><i class="icon-menu display-block"></i></div>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /basic layout -->
<!-- Inverse colors -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Inverse colors</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-list chat-list-inverse content-group">
<li class="media date-step">
<span>Monday, Feb 10</span>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Crud reran and while much withdrew ardent much crab hugely met dizzily that more jeez gent equivalent unsafely far one hesitant so therefore.</div>
<span class="media-annotation display-block mt-10">Tue, 10:28 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Thus superb the tapir the wallaby blank frog execrably much since dalmatian by in hot. Uninspiringly arose mounted stared one curt safe</div>
<span class="media-annotation display-block mt-10">Tue, 8:12 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media date-step">
<span>Today</span>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Satisfactorily strenuously while sleazily dear frustratingly insect menially some shook far sardonic badger telepathic much jeepers immature much hey.</div>
<span class="media-annotation display-block mt-10">2 hours ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Grunted smirked and grew less but rewound much despite and impressive via alongside out and gosh easy manatee dear ineffective yikes.</div>
<span class="media-annotation display-block mt-10">13 minutes ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content"><i class="icon-menu display-block"></i></div>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /inverse colors -->
<!-- Line content divider -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Line content divider</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-list content-group">
<li class="media date-step content-divider">
<span>Monday, Feb 10</span>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Crud reran and while much withdrew ardent much crab hugely met dizzily that more jeez gent equivalent unsafely far one hesitant so therefore.</div>
<span class="media-annotation display-block mt-10">Tue, 10:28 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Thus superb the tapir the wallaby blank frog execrably much since dalmatian by in hot. Uninspiringly arose mounted stared one curt safe</div>
<span class="media-annotation display-block mt-10">Tue, 8:12 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media date-step content-divider">
<span>Today</span>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content">Satisfactorily strenuously while sleazily dear frustratingly insect menially some shook far sardonic badger telepathic much jeepers immature much hey.</div>
<span class="media-annotation display-block mt-10">2 hours ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
<li class="media">
<div class="media-left">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face11.jpg" class="img-circle" alt="">
</a>
</div>
<div class="media-body">
<div class="media-content">Grunted smirked and grew less but rewound much despite and impressive via alongside out and gosh easy manatee dear ineffective yikes.</div>
<span class="media-annotation display-block mt-10">13 minutes ago <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
</li>
<li class="media reversed">
<div class="media-body">
<div class="media-content"><i class="icon-menu display-block"></i></div>
</div>
<div class="media-right">
<a href="assets/images/demo/images/3.png">
<img src="assets/images/demo/users/face1.jpg" class="img-circle" alt="">
</a>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /line content divider -->
<!-- Default stacked layout -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Default stacked layout</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-stacked content-group">
<li class="media date-step text-muted">
<span>Saturday, Feb 12</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">12:16 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Goldfish indisputable vexed hello on held some gosh :-)
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">4:13 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Wickedly darn before or after impeccably jeepers ouch misunderstood yikes much hello talkatively ineffectively hiccupped beyond usefully the alas prior shrugged instantaneously heroically
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">02:53 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Less insincerely hello far ungraceful near poured warthog hurt apart ouch wow that banal far made grew collective coasted inside
</div>
</li>
<li class="media date-step text-muted">
<span>Yesterday</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">7:50 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Less a hello hey less saw vexedly pleasantly this much flamingo alas returned frighteningly some beneath jeez oh that overpaid oh within forlorn suddenly
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">2:03 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Heard where and affecting dear hyena excluding hey confused the one
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">5:14 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Messily changed much yet much this forbidding that so hey
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">1:30 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
And hello exotic staunch bee goodness expectant much combed fox placed far this at oh less opposite much factually
</div>
</li>
<li class="media date-step text-muted">
<span>Today</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">2:29 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Besides lax yikes and a much deservedly much that constructively flexibly darn a one and and whooped without the and darn contemplated jokingly some ordered oh domestic possessive far
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">8:20 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
So because one badger a over more impotent pending frustratingly gosh when
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">9:00 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Fantastic close echidna crud fatuously much extensively alas beat up far consoled manfully that far one owing one perversely jeepers some
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body media-middle">
<i class="icon-menu"></i>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /default stacked layout -->
<!-- Left annotation position -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Left annotation position</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-stacked content-group">
<li class="media date-step text-muted">
<span>Saturday, Feb 12</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation dotted">2:03 pm</span>
</div>
Heard where and affecting dear hyena excluding hey confused the one
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation dotted">5:14 pm</span>
</div>
Messily changed much yet much this forbidding that so hey
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation dotted">1:30 pm</span>
</div>
And hello exotic staunch bee goodness expectant much combed fox placed far this at oh less opposite much factually
</div>
</li>
<li class="media date-step text-muted">
<span>Today</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation dotted">2:29 am</span>
</div>
Besides lax yikes and a much deservedly much that constructively flexibly darn a one and and whooped without the and darn contemplated jokingly some ordered oh domestic possessive far
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation dotted">8:20 am</span>
</div>
So because one badger a over more impotent pending frustratingly gosh when
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation dotted">9:00 am</span>
</div>
Fantastic close echidna crud fatuously much extensively alas beat up far consoled manfully that far one owing one perversely jeepers some
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body media-middle">
<i class="icon-menu"></i>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /left annotation position-->
<!-- Line content divider -->
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Line content divider</h6>
<div class="heading-elements">
<ul class="icons-list">
<li><a data-action="collapse"></a></li>
<li><a data-action="reload"></a></li>
<li><a data-action="close"></a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="media-list chat-stacked content-group">
<li class="media date-step content-divider text-muted">
<span>Saturday, Feb 12</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">2:03 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Heard where and affecting dear hyena excluding hey confused the one
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">5:14 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Messily changed much yet much this forbidding that so hey
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">1:30 pm <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
And hello exotic staunch bee goodness expectant much combed fox placed far this at oh less opposite much factually
</div>
</li>
<li class="media date-step content-divider text-muted">
<span>New messages</span>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">2:29 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Besides lax yikes and a much deservedly much that constructively flexibly darn a one and and whooped without the and darn contemplated jokingly some ordered oh domestic possessive far
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Margo Baker</a>
<span class="media-annotation pull-right">8:20 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
So because one badger a over more impotent pending frustratingly gosh when
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face10.jpg" class="img-circle" alt=""></div>
<div class="media-body">
<div class="media-heading">
<a href="#" class="text-semibold">Will Grace</a>
<span class="media-annotation pull-right">9:00 am <a href="#"><i class="icon-pin-alt position-right text-muted"></i></a></span>
</div>
Fantastic close echidna crud fatuously much extensively alas beat up far consoled manfully that far one owing one perversely jeepers some
</div>
</li>
<li class="media">
<div class="media-left"><img src="assets/images/demo/users/face3.jpg" class="img-circle" alt=""></div>
<div class="media-body media-middle">
<i class="icon-menu"></i>
</div>
</li>
</ul>
<textarea name="enter-message" class="form-control content-group" rows="3" cols="1" placeholder="Enter your message..."></textarea>
<div class="row">
<div class="col-xs-6">
<ul class="icons-list icons-list-extended mt-10">
<li><a href="#" data-popup="tooltip" title="Send photo" data-container="body"><i class="icon-file-picture"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send video" data-container="body"><i class="icon-file-video"></i></a></li>
<li><a href="#" data-popup="tooltip" title="Send file" data-container="body"><i class="icon-file-plus"></i></a></li>
</ul>
</div>
<div class="col-xs-6 text-right">
<button type="button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send</button>
</div>
</div>
</div>
</div>
<!-- /line content divider -->
</div>
<!-- /main content -->
</div>
<!-- /page content -->
<!-- Footer -->
<div class="footer text-muted">
© 2015. <a href="#">Limitless Web App Kit</a> by <a href="http://themeforest.net/user/Kopyov" target="_blank">Eugene Kopyov</a>
</div>
<!-- /footer -->
</div>
<!-- /page container -->
</body>
</html>
| {
"pile_set_name": "Github"
} |
<html ⚡>
<head></head>
<body>
<amp-audio></amp-audio>
</body>
</html>
| {
"pile_set_name": "Github"
} |
namespace distribution_explorer.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}
| {
"pile_set_name": "Github"
} |
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_DEREF_IMPL_07162005_0137)
#define FUSION_DEREF_IMPL_07162005_0137
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/detail/adapt_deref_traits.hpp>
namespace boost { namespace fusion
{
struct joint_view_iterator_tag;
namespace extension
{
template <typename Tag>
struct deref_impl;
template <>
struct deref_impl<joint_view_iterator_tag>
: detail::adapt_deref_traits {};
}
}}
#endif
| {
"pile_set_name": "Github"
} |
package org.enso.interpreter.test.semantic
import org.enso.interpreter.test.{
InterpreterTest,
InterpreterContext,
InterpreterException
}
class NamedArgumentsTest extends InterpreterTest {
override def subject: String = "Named and Default Arguments"
override def specify(
implicit interpreterContext: InterpreterContext
): Unit = {
"be used in function bodies" in {
val code =
"""
|Unit.a = 10
|Unit.addTen = b -> a Unit + b
|
|main = addTen Unit (b = 10)
""".stripMargin
eval(code) shouldEqual 20
}
"be passed when given out of order" in {
val code =
"""
|Unit.subtract = a -> b -> a - b
|
|main = subtract Unit (b = 10) (a = 5)
""".stripMargin
eval(code) shouldEqual -5
}
"be passed with values from the scope" in {
val code =
"""
|main =
| a = 10
| addTen = num -> num + a
| res = addTen (num = a)
| res
""".stripMargin
eval(code) shouldEqual 20
}
"be definable" in {
val code =
"""
|Unit.addNum = a -> (num = 10) -> a + num
|
|main = addNum Unit 5
""".stripMargin
eval(code) shouldEqual 15
}
"be able to default to complex expressions" in {
val code =
"""
|Unit.add = a -> b -> a + b
|Unit.doThing = a -> (b = add Unit 1 2) -> a + b
|
|main = doThing Unit 10
|""".stripMargin
eval(code) shouldEqual 13
}
"be able to close over their outer scope" in {
val code =
"""
|main =
| id = x -> x
| apply = val -> (fn = id) -> fn val
| res = apply (val = 1)
| res
|""".stripMargin
eval(code) shouldEqual 1
}
"be used in functions when no arguments are supplied" in {
val code =
"""
|Unit.addTogether = (a = 5) -> (b = 6) -> a + b
|
|main = addTogether Unit
""".stripMargin
eval(code) shouldEqual 11
}
"be overridable by name" in {
val code =
"""
|Unit.addNum = a -> (num = 10) -> a + num
|
|main = addNum Unit 1 (num = 1)
""".stripMargin
eval(code) shouldEqual 2
}
"overridable by position" in {
val code =
"""
|Unit.addNum = a -> (num = 10) -> a + num
|
|main = addNum Unit 1 2
|""".stripMargin
eval(code) shouldEqual 3
}
"work in a recursive context" in {
val code =
"""
|Unit.summer = sumTo ->
| summator = (acc = 0) -> current ->
| ifZero current acc (summator (current = current - 1) (acc = acc + current))
| res = summator (current = sumTo)
| res
|
|main = summer Unit 100
""".stripMargin
eval(code) shouldEqual 5050
}
"only be scoped to their definitions" in {
val code =
"""
|main =
| foo = x -> y -> x - y
| bar = y -> x -> x - y
| baz = f -> f (x=10) (y=11)
| a = baz foo
| b = baz bar
| a - b
|""".stripMargin
eval(code) shouldEqual 0
}
"be applied in a sequence compatible with Eta-expansions" in {
val code =
"""
|Unit.foo = a -> b -> c -> a -> a
|main = foo Unit 20 (a = 10) 0 0
|""".stripMargin
eval(code) shouldEqual 10
}
"be able to depend on prior arguments" in {
val code =
"""
|Unit.doubleOrAdd = a -> (b = a) -> a + b
|
|main = doubleOrAdd Unit 5
|""".stripMargin
eval(code) shouldEqual 10
}
"not be able to depend on later arguments" in {
val code =
"""
|Unit.badArgFn = a -> (b = c) -> (c = a) -> a + b + c
|
|main = badArgFn Unit 3
|""".stripMargin
an[InterpreterException] should be thrownBy eval(code)
}
"be usable with constructors" in {
val code =
"""
|type Cons2 head rest
|type Nil2
|
|main =
| genList = i -> ifZero i Nil2 (Cons2 (rest = genList i-1) head=i)
|
| sum = list -> case list of
| Cons2 h t -> h + t.sum
| Nil2 -> 0
|
| 10.genList.sum
""".stripMargin
eval(code) shouldEqual 55
}
"be usable and overridable in constructors" in {
val code =
"""
|type Nil2
|type Cons2 head (rest = Nil2)
|
|main =
| genList = i -> ifZero i Nil2 (Cons2 (rest = genList i-1) head=i)
|
| sum = list -> case list of
| Cons2 h t -> h + t.sum
| Nil2 -> 0
|
| 5.genList.sum
""".stripMargin
eval(code) shouldEqual 15
}
"be resolved dynamically in constructors" in {
val code =
"""
|type Cons2 head (rest = Nil2)
|type Nil2
|
|main = Cons2 5
|""".stripMargin
eval(code).toString shouldEqual "Cons2 5 Nil2"
}
"work with constructors" in {
val code =
"""
|type Cons2 head (rest = Nil2)
|type Nil2
|
|Unit.sumList = list -> case list of
| Cons2 h t -> h + Unit.sumList t
| Nil2 -> 0
|
|main = Unit.sumList (Cons2 10)
""".stripMargin
eval(code) shouldEqual 10
}
"be assignable from Vectors" in {
val code =
"""
|main =
| lam = (x=[1,3]) -> y -> y + Polyglot.get_array_element x 0 + Polyglot.get_array_element x 1
| lam y=10
|""".stripMargin
eval(code) shouldEqual 14
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright ©2015 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package vg
import (
"strconv"
"strings"
)
// A Length is a unit-independent representation of length.
// Internally, the length is stored in postscript points.
type Length float64
// Points returns a length for the given number of points.
func Points(pt float64) Length {
return Length(pt)
}
// Common lengths.
const (
Inch Length = 72
Centimeter = Inch / 2.54
Millimeter = Centimeter / 10
)
// Dots returns the length in dots for the given resolution.
func (l Length) Dots(dpi float64) float64 {
return float64(l) / Inch.Points() * dpi
}
// Points returns the length in postscript points.
func (l Length) Points() float64 {
return float64(l)
}
// ParseLength parses a Length string.
// A Length string is a possible signed floating number with a unit.
// e.g. "42cm" "2.4in" "66pt"
// If no unit was given, ParseLength assumes it was (postscript) points.
// Currently valid units are:
// mm (millimeter)
// cm (centimeter)
// in (inch)
// pt (point)
func ParseLength(value string) (Length, error) {
var unit Length = 1
switch {
case strings.HasSuffix(value, "in"):
value = value[:len(value)-len("in")]
unit = Inch
case strings.HasSuffix(value, "cm"):
value = value[:len(value)-len("cm")]
unit = Centimeter
case strings.HasSuffix(value, "mm"):
value = value[:len(value)-len("mm")]
unit = Millimeter
case strings.HasSuffix(value, "pt"):
value = value[:len(value)-len("pt")]
unit = 1
}
v, err := strconv.ParseFloat(value, 64)
if err != nil {
return 0, err
}
return Length(v) * unit, nil
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.