text
stringlengths 2
100k
| meta
dict |
---|---|
// ----------------------------------------------------------------
// From Game Programming in C++ by Sanjay Madhav
// Copyright (C) 2017 Sanjay Madhav. All rights reserved.
//
// Released under the BSD License
// See LICENSE in root directory for full details.
// ----------------------------------------------------------------
#include "TargetActor.h"
#include "Game.h"
#include "Renderer.h"
#include "MeshComponent.h"
#include "BoxComponent.h"
#include "Mesh.h"
#include "TargetComponent.h"
TargetActor::TargetActor(Game* game)
:Actor(game)
{
//SetScale(10.0f);
SetRotation(Quaternion(Vector3::UnitZ, Math::Pi));
MeshComponent* mc = new MeshComponent(this);
Mesh* mesh = GetGame()->GetRenderer()->GetMesh("Assets/Target.gpmesh");
mc->SetMesh(mesh);
// Add collision box
BoxComponent* bc = new BoxComponent(this);
bc->SetObjectBox(mesh->GetBox());
new TargetComponent(this);
}
| {
"pile_set_name": "Github"
} |
var createFlow = require('./_createFlow');
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
module.exports = flowRight;
| {
"pile_set_name": "Github"
} |
// Copyright 2014 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 ipv4
func (f *sysICMPFilter) accept(typ ICMPType) {
f.Data &^= 1 << (uint32(typ) & 31)
}
func (f *sysICMPFilter) block(typ ICMPType) {
f.Data |= 1 << (uint32(typ) & 31)
}
func (f *sysICMPFilter) setAll(block bool) {
if block {
f.Data = 1<<32 - 1
} else {
f.Data = 0
}
}
func (f *sysICMPFilter) willBlock(typ ICMPType) bool {
return f.Data&(1<<(uint32(typ)&31)) != 0
}
| {
"pile_set_name": "Github"
} |
// Copyright 2019 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 cpu
func doinit() {
ARM.HasSWP = isSet(hwCap, hwcap_SWP)
ARM.HasHALF = isSet(hwCap, hwcap_HALF)
ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB)
ARM.Has26BIT = isSet(hwCap, hwcap_26BIT)
ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT)
ARM.HasFPA = isSet(hwCap, hwcap_FPA)
ARM.HasVFP = isSet(hwCap, hwcap_VFP)
ARM.HasEDSP = isSet(hwCap, hwcap_EDSP)
ARM.HasJAVA = isSet(hwCap, hwcap_JAVA)
ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT)
ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH)
ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE)
ARM.HasNEON = isSet(hwCap, hwcap_NEON)
ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3)
ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16)
ARM.HasTLS = isSet(hwCap, hwcap_TLS)
ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4)
ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA)
ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT)
ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32)
ARM.HasLPAE = isSet(hwCap, hwcap_LPAE)
ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
ARM.HasAES = isSet(hwCap2, hwcap2_AES)
ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL)
ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1)
ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2)
ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32)
}
func isSet(hwc uint, value uint) bool {
return hwc&value != 0
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
package workload
import (
gosql "database/sql"
"database/sql/driver"
"strings"
"sync/atomic"
"github.com/lib/pq"
)
// cockroachDriver is a wrapper around lib/pq which provides for round-robin
// load balancing amongst a list of URLs. The name passed to Open() is a space
// separated list of "postgres" URLs to connect to.
//
// Note that the round-robin load balancing can lead to imbalances in
// connections across the cluster. This is currently only suitable for
// simplistic setups where nodes in the cluster are stable and do not go up and
// down.
type cockroachDriver struct {
idx uint32
}
func (d *cockroachDriver) Open(name string) (driver.Conn, error) {
urls := strings.Split(name, " ")
i := atomic.AddUint32(&d.idx, 1) - 1
return pq.Open(urls[i%uint32(len(urls))])
}
func init() {
gosql.Register("cockroach", &cockroachDriver{})
}
| {
"pile_set_name": "Github"
} |
Copyright 2012 Matt T. Proud ([email protected])
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.lirc.internal.discovery;
import java.util.HashMap;
import java.util.Map;
import org.openhab.binding.lirc.internal.LIRCBindingConstants;
import org.openhab.binding.lirc.internal.LIRCMessageListener;
import org.openhab.binding.lirc.internal.handler.LIRCBridgeHandler;
import org.openhab.binding.lirc.internal.messages.LIRCButtonEvent;
import org.openhab.binding.lirc.internal.messages.LIRCResponse;
import org.openhab.core.config.discovery.AbstractDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Andrew Nagle - Initial contribution
*/
public class LIRCRemoteDiscoveryService extends AbstractDiscoveryService implements LIRCMessageListener {
private final Logger logger = LoggerFactory.getLogger(LIRCRemoteDiscoveryService.class);
private LIRCBridgeHandler bridgeHandler;
public LIRCRemoteDiscoveryService(LIRCBridgeHandler lircBridgeHandler) {
super(LIRCBindingConstants.SUPPORTED_DEVICE_TYPES, LIRCBindingConstants.DISCOVERY_TIMOUT, true);
this.bridgeHandler = lircBridgeHandler;
bridgeHandler.registerMessageListener(this);
}
@Override
protected void startScan() {
logger.debug("Discovery service scan started");
bridgeHandler.startDeviceDiscovery();
}
@Override
public void onButtonPressed(ThingUID bridge, LIRCButtonEvent buttonEvent) {
addRemote(bridge, buttonEvent.getRemote());
}
@Override
public void onMessageReceived(ThingUID bridge, LIRCResponse message) {
LIRCResponse response = message;
String command = response.getCommand();
if ("LIST".equals(command) && response.isSuccess()) {
for (String remoteID : response.getData()) {
addRemote(bridge, remoteID);
}
}
}
private void addRemote(ThingUID bridge, String remote) {
ThingTypeUID uid = LIRCBindingConstants.THING_TYPE_REMOTE;
ThingUID thingUID = new ThingUID(uid, bridge, remote);
logger.trace("Remote {}: Discovered new remote.", remote);
Map<String, Object> properties = new HashMap<>(1);
properties.put(LIRCBindingConstants.PROPERTY_REMOTE, remote);
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withLabel(remote).withBridge(bridge)
.withProperties(properties).build();
thingDiscovered(discoveryResult);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2020 Google Inc. 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.
#import <Foundation/Foundation.h>
#import "TFLDelegate.h"
NS_ASSUME_NONNULL_BEGIN
/**
* @enum TFLMetalDelegateThreadWaitType
* This enum specifies wait type for Metal delegate.
*/
typedef NS_ENUM(NSUInteger, TFLMetalDelegateThreadWaitType) {
/**
* The thread does not wait for the work to complete. Useful when the output of the work is used
* with the GPU pipeline.
*/
TFLMetalDelegateThreadWaitTypeDoNotWait,
/** The thread waits until the work is complete. */
TFLMetalDelegateThreadWaitTypePassive,
/**
* The thread waits for the work to complete with minimal latency, which may require additional
* CPU resources.
*/
TFLMetalDelegateThreadWaitTypeActive,
/** The thread waits for the work while trying to prevent the GPU from going into sleep mode. */
TFLMetalDelegateThreadWaitTypeAggressive,
};
/** Custom configuration options for a Metal delegate. */
@interface TFLMetalDelegateOptions : NSObject
/**
* Indicates whether the GPU delegate allows precision loss, such as allowing `Float16` precision
* for a `Float32` computation. The default is `false`.
*/
@property(nonatomic, getter=isPrecisionLossAllowed) BOOL precisionLossAllowed;
/**
* Indicates how the current thread should wait for work on the GPU to complete. The default
* is `TFLMetalDelegateThreadWaitTypePassive`.
*/
@property(nonatomic) TFLMetalDelegateThreadWaitType waitType;
/**
* Indicates whether the GPU delegate allows execution of an 8-bit quantized model. The default is
* `false`.
*/
@property(nonatomic, getter=isQuantizationEnabled) BOOL quantizationEnabled;
@end
/**
* A delegate that uses the `Metal` framework for performing TensorFlow Lite graph operations with
* GPU acceleration.
*/
@interface TFLMetalDelegate : TFLDelegate
/**
* Initializes a new GPU delegate with default options.
*
* @return A new GPU delegate with default options. `nil` when the GPU delegate creation fails.
*/
- (nullable instancetype)init;
/**
* Initializes a new GPU delegate with the given options.
*
* @param options GPU delegate options.
*
* @return A new GPU delegate with default options. `nil` when the GPU delegate creation fails.
*/
- (nullable instancetype)initWithOptions:(TFLMetalDelegateOptions *)options
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
| {
"pile_set_name": "Github"
} |
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team
All rights reserved.
Redistribution and use of this software 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 the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
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.
----------------------------------------------------------------------
*/
/// \file X3DImporter_Light.cpp
/// \brief Parsing data from nodes of "Lighting" set of X3D.
/// \date 2015-2016
/// \author [email protected]
#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER
#include "X3DImporter.hpp"
#include "X3DImporter_Macro.hpp"
#include "StringUtils.h"
namespace Assimp {
// <DirectionalLight
// DEF="" ID
// USE="" IDREF
// ambientIntensity="0" SFFloat [inputOutput]
// color="1 1 1" SFColor [inputOutput]
// direction="0 0 -1" SFVec3f [inputOutput]
// global="false" SFBool [inputOutput]
// intensity="1" SFFloat [inputOutput]
// on="true" SFBool [inputOutput]
// />
void X3DImporter::ParseNode_Lighting_DirectionalLight()
{
std::string def, use;
float ambientIntensity = 0;
aiColor3D color(1, 1, 1);
aiVector3D direction(0, 0, -1);
bool global = false;
float intensity = 1;
bool on = true;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f);
MACRO_ATTRREAD_CHECK_REF("direction", direction, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_LOOPEND;
// if "USE" defined then find already defined element.
if(!use.empty())
{
MACRO_USE_CHECKANDAPPLY(def, use, ENET_DirectionalLight, ne);
}
else
{
if(on)
{
// create and if needed - define new geometry object.
ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_DirectionalLight, NodeElement_Cur);
if(!def.empty())
ne->ID = def;
else
ne->ID = "DirectionalLight_" + to_string((size_t)ne);// make random name
((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity;
((CX3DImporter_NodeElement_Light*)ne)->Color = color;
((CX3DImporter_NodeElement_Light*)ne)->Direction = direction;
((CX3DImporter_NodeElement_Light*)ne)->Global = global;
((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity;
// Assimp want a node with name similar to a light. "Why? I don't no." )
ParseHelper_Group_Begin(false);
NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element.
ParseHelper_Node_Exit();
// check for child nodes
if(!mReader->isEmptyElement())
ParseNode_Metadata(ne, "DirectionalLight");
else
NodeElement_Cur->Child.push_back(ne);// add made object as child to current element
NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph
}// if(on)
}// if(!use.empty()) else
}
// <PointLight
// DEF="" ID
// USE="" IDREF
// ambientIntensity="0" SFFloat [inputOutput]
// attenuation="1 0 0" SFVec3f [inputOutput]
// color="1 1 1" SFColor [inputOutput]
// global="true" SFBool [inputOutput]
// intensity="1" SFFloat [inputOutput]
// location="0 0 0" SFVec3f [inputOutput]
// on="true" SFBool [inputOutput]
// radius="100" SFFloat [inputOutput]
// />
void X3DImporter::ParseNode_Lighting_PointLight()
{
std::string def, use;
float ambientIntensity = 0;
aiVector3D attenuation( 1, 0, 0 );
aiColor3D color( 1, 1, 1 );
bool global = true;
float intensity = 1;
aiVector3D location( 0, 0, 0 );
bool on = true;
float radius = 100;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("attenuation", attenuation, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f);
MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("location", location, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_LOOPEND;
// if "USE" defined then find already defined element.
if(!use.empty())
{
MACRO_USE_CHECKANDAPPLY(def, use, ENET_PointLight, ne);
}
else
{
if(on)
{
// create and if needed - define new geometry object.
ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_PointLight, NodeElement_Cur);
if(!def.empty()) ne->ID = def;
((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity;
((CX3DImporter_NodeElement_Light*)ne)->Attenuation = attenuation;
((CX3DImporter_NodeElement_Light*)ne)->Color = color;
((CX3DImporter_NodeElement_Light*)ne)->Global = global;
((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity;
((CX3DImporter_NodeElement_Light*)ne)->Location = location;
((CX3DImporter_NodeElement_Light*)ne)->Radius = radius;
// Assimp want a node with name similar to a light. "Why? I don't no." )
ParseHelper_Group_Begin(false);
// make random name
if(ne->ID.empty()) ne->ID = "PointLight_" + to_string((size_t)ne);
NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element.
ParseHelper_Node_Exit();
// check for child nodes
if(!mReader->isEmptyElement())
ParseNode_Metadata(ne, "PointLight");
else
NodeElement_Cur->Child.push_back(ne);// add made object as child to current element
NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph
}// if(on)
}// if(!use.empty()) else
}
// <SpotLight
// DEF="" ID
// USE="" IDREF
// ambientIntensity="0" SFFloat [inputOutput]
// attenuation="1 0 0" SFVec3f [inputOutput]
// beamWidth="0.7854" SFFloat [inputOutput]
// color="1 1 1" SFColor [inputOutput]
// cutOffAngle="1.570796" SFFloat [inputOutput]
// direction="0 0 -1" SFVec3f [inputOutput]
// global="true" SFBool [inputOutput]
// intensity="1" SFFloat [inputOutput]
// location="0 0 0" SFVec3f [inputOutput]
// on="true" SFBool [inputOutput]
// radius="100" SFFloat [inputOutput]
// />
void X3DImporter::ParseNode_Lighting_SpotLight()
{
std::string def, use;
float ambientIntensity = 0;
aiVector3D attenuation( 1, 0, 0 );
float beamWidth = 0.7854f;
aiColor3D color( 1, 1, 1 );
float cutOffAngle = 1.570796f;
aiVector3D direction( 0, 0, -1 );
bool global = true;
float intensity = 1;
aiVector3D location( 0, 0, 0 );
bool on = true;
float radius = 100;
CX3DImporter_NodeElement* ne( nullptr );
MACRO_ATTRREAD_LOOPBEG;
MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use);
MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("attenuation", attenuation, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_RET("beamWidth", beamWidth, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f);
MACRO_ATTRREAD_CHECK_RET("cutOffAngle", cutOffAngle, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("direction", direction, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_CHECK_REF("location", location, XML_ReadNode_GetAttrVal_AsVec3f);
MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool);
MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat);
MACRO_ATTRREAD_LOOPEND;
// if "USE" defined then find already defined element.
if(!use.empty())
{
MACRO_USE_CHECKANDAPPLY(def, use, ENET_SpotLight, ne);
}
else
{
if(on)
{
// create and if needed - define new geometry object.
ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_SpotLight, NodeElement_Cur);
if(!def.empty()) ne->ID = def;
if(beamWidth > cutOffAngle) beamWidth = cutOffAngle;
((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity;
((CX3DImporter_NodeElement_Light*)ne)->Attenuation = attenuation;
((CX3DImporter_NodeElement_Light*)ne)->BeamWidth = beamWidth;
((CX3DImporter_NodeElement_Light*)ne)->Color = color;
((CX3DImporter_NodeElement_Light*)ne)->CutOffAngle = cutOffAngle;
((CX3DImporter_NodeElement_Light*)ne)->Direction = direction;
((CX3DImporter_NodeElement_Light*)ne)->Global = global;
((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity;
((CX3DImporter_NodeElement_Light*)ne)->Location = location;
((CX3DImporter_NodeElement_Light*)ne)->Radius = radius;
// Assimp want a node with name similar to a light. "Why? I don't no." )
ParseHelper_Group_Begin(false);
// make random name
if(ne->ID.empty()) ne->ID = "SpotLight_" + to_string((size_t)ne);
NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element.
ParseHelper_Node_Exit();
// check for child nodes
if(!mReader->isEmptyElement())
ParseNode_Metadata(ne, "SpotLight");
else
NodeElement_Cur->Child.push_back(ne);// add made object as child to current element
NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph
}// if(on)
}// if(!use.empty()) else
}
}// namespace Assimp
#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER
| {
"pile_set_name": "Github"
} |
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
I2C_MENU:=I2C support
ModuleConfVar=$(word 1,$(subst :,$(space),$(1)))
ModuleFullPath=$(LINUX_DIR)/$(word 2,$(subst :,$(space),$(1))).ko
ModuleKconfig=$(foreach mod,$(1),$(call ModuleConfVar,$(mod)))
ModuleFiles=$(foreach mod,$(1),$(call ModuleFullPath,$(mod)))
ModuleAuto=$(call AutoLoad,$(1),$(foreach mod,$(2),$(basename $(notdir $(call ModuleFullPath,$(mod))))),$(3))
define i2c_defaults
SUBMENU:=$(I2C_MENU)
KCONFIG:=$(call ModuleKconfig,$(1))
FILES:=$(call ModuleFiles,$(1))
AUTOLOAD:=$(call ModuleAuto,$(2),$(1),$(3))
endef
I2C_CORE_MODULES:= \
CONFIG_I2C:drivers/i2c/i2c-core \
CONFIG_I2C_CHARDEV:drivers/i2c/i2c-dev
ifeq ($(CONFIG_OF),y)
I2C_CORE_MODULES+=CONFIG_OF_I2C:drivers/of/[email protected]
endif
define KernelPackage/i2c-core
$(call i2c_defaults,$(I2C_CORE_MODULES),51)
TITLE:=I2C support
endef
define KernelPackage/i2c-core/description
Kernel modules for I2C support
endef
$(eval $(call KernelPackage,i2c-core))
I2C_ALGOBIT_MODULES:= \
CONFIG_I2C_ALGOBIT:drivers/i2c/algos/i2c-algo-bit
define KernelPackage/i2c-algo-bit
$(call i2c_defaults,$(I2C_ALGOBIT_MODULES),55)
TITLE:=I2C bit-banging interfaces
DEPENDS:=kmod-i2c-core
endef
define KernelPackage/i2c-algo-bit/description
Kernel modules for I2C bit-banging interfaces
endef
$(eval $(call KernelPackage,i2c-algo-bit))
I2C_ALGOPCA_MODULES:= \
CONFIG_I2C_ALGOPCA:drivers/i2c/algos/i2c-algo-pca
define KernelPackage/i2c-algo-pca
$(call i2c_defaults,$(I2C_ALGOPCA_MODULES),55)
TITLE:=I2C PCA 9564 interfaces
DEPENDS:=kmod-i2c-core
endef
define KernelPackage/i2c-algo-pca/description
Kernel modules for I2C PCA 9564 interfaces
endef
$(eval $(call KernelPackage,i2c-algo-pca))
I2C_ALGOPCF_MODULES:= \
CONFIG_I2C_ALGOPCF:drivers/i2c/algos/i2c-algo-pcf
define KernelPackage/i2c-algo-pcf
$(call i2c_defaults,$(I2C_ALGOPCF_MODULES),55)
TITLE:=I2C PCF 8584 interfaces
DEPENDS:=kmod-i2c-core
endef
define KernelPackage/i2c-algo-pcf/description
Kernel modules for I2C PCF 8584 interfaces
endef
$(eval $(call KernelPackage,i2c-algo-pcf))
I2C_GPIO_MODULES:= \
CONFIG_I2C_GPIO:drivers/i2c/busses/i2c-gpio
define KernelPackage/i2c-gpio
$(call i2c_defaults,$(I2C_GPIO_MODULES),59)
TITLE:=GPIO-based bitbanging I2C
DEPENDS:=@GPIO_SUPPORT +kmod-i2c-algo-bit
endef
define KernelPackage/i2c-gpio/description
Kernel modules for a very simple bitbanging I2C driver utilizing the
arch-neutral GPIO API to control the SCL and SDA lines.
endef
$(eval $(call KernelPackage,i2c-gpio))
I2C_MPC_MODULES:=\
CONFIG_I2C_MPC:drivers/i2c/busses/i2c-mpc
define KernelPackage/i2c-mpc
$(call i2c_defaults,$(I2C_MPC_MODULES),59)
TITLE:=MPC I2C accessors
DEPENDS:=@TARGET_mpc52xx||TARGET_mpc83xx||TARGET_mpc85xx +kmod-i2c-core
endef
define KernelPackage/i2c-mpc/description
Kernel module for Freescale MPC52xx MPC83xx MPC85xx I2C accessors
endef
$(eval $(call KernelPackage,i2c-mpc))
I2C_IBM_IIC_MODULES:=\
CONFIG_I2C_IBM_IIC:drivers/i2c/busses/i2c-ibm_iic
define KernelPackage/i2c-ibm-iic
$(call i2c_defaults,$(OF_I2C_MODULES),59)
TITLE:=IBM PPC 4xx on-chip I2C interface support
DEPENDS:=@TARGET_ppc40x||TARGET_ppc4xx +kmod-i2c-core
endef
define KernelPackage/i2c-ibm-iic/description
Kernel module for IIC peripheral found on embedded IBM PPC4xx based systems
endef
$(eval $(call KernelPackage,i2c-ibm-iic))
I2C_MV64XXX_MODULES:=\
CONFIG_I2C_MV64XXX:drivers/i2c/busses/i2c-mv64xxx
define KernelPackage/i2c-mv64xxx
$(call i2c_defaults,$(I2C_MV64XXX_MODULES),59)
TITLE:=Orion Platform I2C interface support
DEPENDS:=@TARGET_kirkwood||TARGET_orion||TARGET_mvebu +kmod-i2c-core
endef
define KernelPackage/i2c-mv64xxx/description
Kernel module for I2C interface on the Kirkwood, Orion and Armada XP/370
family processors
endef
$(eval $(call KernelPackage,i2c-mv64xxx))
I2C_TINY_USB_MODULES:= \
CONFIG_I2C_TINY_USB:drivers/i2c/busses/i2c-tiny-usb
define KernelPackage/i2c-tiny-usb
$(call i2c_defaults,$(I2C_TINY_USB_MODULES),59)
TITLE:=I2C Tiny USB adaptor
DEPENDS:=@USB_SUPPORT kmod-i2c-core +kmod-usb-core
endef
define KernelPackage/i2c-tiny-usb/description
Kernel module for the I2C Tiny USB adaptor developed
by Till Harbaum (http://www.harbaum.org/till/i2c_tiny_usb)
endef
$(eval $(call KernelPackage,i2c-tiny-usb))
I2C_PIIX4_MODULES:= \
CONFIG_I2C_PIIX4:drivers/i2c/busses/i2c-piix4
define KernelPackage/i2c-piix4
$(call i2c_defaults,$(I2C_PIIX4_MODULES),59)
TITLE:=Intel PIIX4 and compatible I2C interfaces
DEPENDS:=@PCI_SUPPORT @(x86||x86_64) kmod-i2c-core
endef
define KernelPackage/i2c-piix4/description
Support for the Intel PIIX4 family of mainboard I2C interfaces,
specifically Intel PIIX4, Intel 440MX, ATI IXP200, ATI IXP300,
ATI IXP400, ATI SB600, ATI SB700/SP5100, ATI SB800, AMD Hudson-2,
AMD ML, AMD CZ, Serverworks OSB4, Serverworks CSB5,
Serverworks CSB6, Serverworks HT-1000, Serverworks HT-1100 and
SMSC Victory66.
endef
$(eval $(call KernelPackage,i2c-piix4))
I2C_MUX_MODULES:= \
CONFIG_I2C_MUX:drivers/i2c/i2c-mux
define KernelPackage/i2c-mux
$(call i2c_defaults,$(I2C_MUX_MODULES),51)
TITLE:=I2C bus multiplexing support
DEPENDS:=kmod-i2c-core
endef
define KernelPackage/i2c-mux/description
Kernel modules for I2C bus multiplexing support
endef
$(eval $(call KernelPackage,i2c-mux))
I2C_MUX_GPIO_MODULES:= \
CONFIG_I2C_MUX_GPIO:drivers/i2c/muxes/i2c-mux-gpio
define KernelPackage/i2c-mux-gpio
$(call i2c_defaults,$(I2C_MUX_GPIO_MODULES),51)
TITLE:=GPIO-based I2C mux/switches
DEPENDS:=kmod-i2c-mux
endef
define KernelPackage/i2c-mux-gpio/description
Kernel modules for GENERIC_GPIO I2C bus mux/switching devices
endef
$(eval $(call KernelPackage,i2c-mux-gpio))
I2C_MUX_PCA954x_MODULES:= \
CONFIG_I2C_MUX_PCA954x:drivers/i2c/muxes/i2c-mux-pca954x
define KernelPackage/i2c-mux-pca954x
$(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51)
TITLE:=Philips PCA954x I2C mux/switches
DEPENDS:=kmod-i2c-mux
endef
define KernelPackage/i2c-mux-pca954x/description
Kernel modules for PCA954x I2C bus mux/switching devices
endef
$(eval $(call KernelPackage,i2c-mux-pca954x))
I2C_MUX_PCA9541_MODULES:= \
CONFIG_I2C_MUX_PCA9541:drivers/i2c/muxes/i2c-mux-pca9541
define KernelPackage/i2c-mux-pca9541
$(call i2c_defaults,$(I2C_MUX_PCA9541_MODULES),51)
TITLE:=Philips PCA9541 I2C mux/switches
DEPENDS:=kmod-i2c-mux
endef
define KernelPackage/i2c-mux-pca9541/description
Kernel modules for PCA9541 I2C bus mux/switching devices
endef
$(eval $(call KernelPackage,i2c-mux-pca9541))
| {
"pile_set_name": "Github"
} |
[
{
"id": "dev_3213TGOhu0ea",
"status": "confirmed",
"type": "pn",
"name": "Nexus 5X",
"phone_number": null,
"identifier": "f491f858432059",
"enrolled_at": "2017-01-18T17:45:08.328Z",
"auth_method": "",
"last_auth": ""
},
{
"id": "dev_3213TGOhu0ea",
"status": "confirmed",
"type": "pn",
"name": "Nexus 5X",
"phone_number": null,
"identifier": "f491f858432059",
"enrolled_at": "2017-01-18T17:45:08.328Z",
"auth_method": "",
"last_auth": ""
}
] | {
"pile_set_name": "Github"
} |
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>../../../../key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Update="identityserver_testing.cer">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="identityserver_testing.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\IdentityServer4.csproj" />
</ItemGroup>
</Project> | {
"pile_set_name": "Github"
} |
{
"word": "Yulan",
"definitions": [
"A Chinese magnolia with showy white flowers."
],
"parts-of-speech": "Noun"
} | {
"pile_set_name": "Github"
} |
# LedgerActionOutput
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**transaction_id** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
| {
"pile_set_name": "Github"
} |
'use strict';
var processFn = function (fn, P, opts) {
return function () {
var that = this;
var args = new Array(arguments.length);
for (var i = 0; i < arguments.length; i++) {
args[i] = arguments[i];
}
return new P(function (resolve, reject) {
args.push(function (err, result) {
if (err) {
reject(err);
} else if (opts.multiArgs) {
var results = new Array(arguments.length - 1);
for (var i = 1; i < arguments.length; i++) {
results[i - 1] = arguments[i];
}
resolve(results);
} else {
resolve(result);
}
});
fn.apply(that, args);
});
};
};
var pify = module.exports = function (obj, P, opts) {
if (typeof P !== 'function') {
opts = P;
P = Promise;
}
opts = opts || {};
opts.exclude = opts.exclude || [/.+Sync$/];
var filter = function (key) {
var match = function (pattern) {
return typeof pattern === 'string' ? key === pattern : pattern.test(key);
};
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
};
var ret = typeof obj === 'function' ? function () {
if (opts.excludeMain) {
return obj.apply(this, arguments);
}
return processFn(obj, P, opts).apply(this, arguments);
} : {};
return Object.keys(obj).reduce(function (ret, key) {
var x = obj[key];
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
return ret;
}, ret);
};
pify.all = pify;
| {
"pile_set_name": "Github"
} |
1: 3.0
2: 9.0
3: 1.0
4: 6.0
5: 2.0
6: 5.0
7: 0.0
8: 0.0
9: 6.0
10: 5.0
11: 4.0
12: 7.0
13: 6.0
14: 1.0
15: 6.0
16: 3.0
17: 9.0
18: 5.0
19: 8.0
20: 4.0
| {
"pile_set_name": "Github"
} |
op {
name: "TensorArrayCloseV3"
input_arg {
name: "handle"
type: DT_RESOURCE
}
is_stateful: true
}
| {
"pile_set_name": "Github"
} |
@import "variables";
@import "mixins";
.shipping-address {
list-style-type: none;
line-height: 1.3em;
}
.order-lines {
.is-cancelled td {
text-decoration: line-through;
background-color: $color-grey-200;
}
.sub-total td {
border-top: 1px dashed $color-grey-300;
}
.total td {
font-weight: bold;
border-top: 1px dashed $color-grey-300;
}
}
.custom-field-header-button {
background: none;
margin: 0;
padding: 0;
border: none;
cursor: pointer;
color: $color-primary-600;
}
.order-line-custom-field {
background-color: $color-grey-100;
.custom-field-ellipsis {
color: $color-grey-300;
}
}
.net-price {
font-size: 11px;
color: $color-grey-400;
}
.promotions-label {
text-decoration: underline dotted $color-grey-300;
font-size: 11px;
margin-top: 6px;
cursor: pointer;
text-transform: lowercase;
}
.line-promotion {
display: flex;
justify-content: space-between;
padding: 6px 12px;
.promotion-amount {
margin-left: 12px;
}
}
.order-cards {
h6 {
margin-top: 6px;
color: $color-grey-500;
}
}
.fulfillment-detail:not(:last-of-type) {
border-bottom: 1px dashed $color-grey-300;
margin-bottom: 12px;
}
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
// rdar://problem/9246208
// Basic test.
namespace test0 {
struct A {
A();
int x;
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test04testEs(i16 signext
// CHECK: [[N:%.*]] = sext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[N]], i32 4)
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T3]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(short s) {
return new elt[s];
}
}
// test0 with a nested array.
namespace test1 {
struct A {
A();
int x;
};
typedef A elt[100];
// CHECK: define [100 x [[A:%.*]]]* @_ZN5test14testEs(i16 signext
// CHECK: [[N:%.*]] = sext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[N]], i32 400)
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = mul i32 [[N]], 100
// CHECK-NEXT: [[T4:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T4]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(short s) {
return new elt[s];
}
}
// test1 with an array cookie.
namespace test2 {
struct A {
A();
~A();
int x;
};
typedef A elt[100];
// CHECK: define [100 x [[A:%.*]]]* @_ZN5test24testEs(i16 signext
// CHECK: [[N:%.*]] = sext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[N]], i32 400)
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = mul i32 [[N]], 100
// CHECK-NEXT: [[T4:%.*]] = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 [[T2]], i32 4)
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T4]], 1
// CHECK-NEXT: [[T6:%.*]] = or i1 [[T1]], [[T5]]
// CHECK-NEXT: [[T7:%.*]] = extractvalue { i32, i1 } [[T4]], 0
// CHECK-NEXT: [[T8:%.*]] = select i1 [[T6]], i32 -1, i32 [[T7]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T8]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(short s) {
return new elt[s];
}
}
// test0 with a 1-byte element.
namespace test4 {
struct A {
A();
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test44testEs(i16 signext
// CHECK: [[N:%.*]] = sext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[N]], 0
// CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i32 -1, i32 [[N]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T1]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(short s) {
return new elt[s];
}
}
// test4 with no sext required.
namespace test5 {
struct A {
A();
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test54testEi(i32
// CHECK: [[N:%.*]] = load i32*
// CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[N]], 0
// CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i32 -1, i32 [[N]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T1]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(int s) {
return new elt[s];
}
}
// test0 with an unsigned size.
namespace test6 {
struct A {
A();
int x;
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test64testEt(i16 zeroext
// CHECK: [[N:%.*]] = zext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[N]], i32 4)
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T3]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(unsigned short s) {
return new elt[s];
}
}
// test1 with an unsigned size.
namespace test7 {
struct A {
A();
int x;
};
typedef A elt[100];
// CHECK: define [100 x [[A:%.*]]]* @_ZN5test74testEt(i16 zeroext
// CHECK: [[N:%.*]] = zext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[N]], i32 400)
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = mul i32 [[N]], 100
// CHECK-NEXT: [[T4:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T4]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(unsigned short s) {
return new elt[s];
}
}
// test0 with a signed type larger than size_t.
namespace test8 {
struct A {
A();
int x;
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test84testEx(i64
// CHECK: [[N:%.*]] = load i64*
// CHECK-NEXT: [[T0:%.*]] = icmp uge i64 [[N]], 4294967296
// CHECK-NEXT: [[T1:%.*]] = trunc i64 [[N]] to i32
// CHECK-NEXT: [[T2:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[T1]], i32 4)
// CHECK-NEXT: [[T3:%.*]] = extractvalue { i32, i1 } [[T2]], 1
// CHECK-NEXT: [[T4:%.*]] = or i1 [[T0]], [[T3]]
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T6:%.*]] = select i1 [[T4]], i32 -1, i32 [[T5]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T6]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T1]]
elt *test(long long s) {
return new elt[s];
}
}
// test8 with an unsigned type.
namespace test9 {
struct A {
A();
int x;
};
typedef A elt;
// CHECK: define [[A:%.*]]* @_ZN5test94testEy(i64
// CHECK: [[N:%.*]] = load i64*
// CHECK-NEXT: [[T0:%.*]] = icmp uge i64 [[N]], 4294967296
// CHECK-NEXT: [[T1:%.*]] = trunc i64 [[N]] to i32
// CHECK-NEXT: [[T2:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 [[T1]], i32 4)
// CHECK-NEXT: [[T3:%.*]] = extractvalue { i32, i1 } [[T2]], 1
// CHECK-NEXT: [[T4:%.*]] = or i1 [[T0]], [[T3]]
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T6:%.*]] = select i1 [[T4]], i32 -1, i32 [[T5]]
// CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T6]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T1]]
elt *test(unsigned long long s) {
return new elt[s];
}
}
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2012 Samsung Electronics
*/
#ifndef _S3C24X0_I2C_H
#define _S3C24X0_I2C_H
struct s3c24x0_i2c {
u32 iiccon;
u32 iicstat;
u32 iicadd;
u32 iicds;
u32 iiclc;
};
struct exynos5_hsi2c {
u32 usi_ctl;
u32 usi_fifo_ctl;
u32 usi_trailing_ctl;
u32 usi_clk_ctl;
u32 usi_clk_slot;
u32 spi_ctl;
u32 uart_ctl;
u32 res1;
u32 usi_int_en;
u32 usi_int_stat;
u32 usi_modem_stat;
u32 usi_error_stat;
u32 usi_fifo_stat;
u32 usi_txdata;
u32 usi_rxdata;
u32 res2;
u32 usi_conf;
u32 usi_auto_conf;
u32 usi_timeout;
u32 usi_manual_cmd;
u32 usi_trans_status;
u32 usi_timing_hs1;
u32 usi_timing_hs2;
u32 usi_timing_hs3;
u32 usi_timing_fs1;
u32 usi_timing_fs2;
u32 usi_timing_fs3;
u32 usi_timing_sla;
u32 i2c_addr;
};
struct s3c24x0_i2c_bus {
bool active; /* port is active and available */
int node; /* device tree node */
int bus_num; /* i2c bus number */
struct s3c24x0_i2c *regs;
struct exynos5_hsi2c *hsregs;
int is_highspeed; /* High speed type, rather than I2C */
unsigned clock_frequency;
int id;
unsigned clk_cycle;
unsigned clk_div;
};
#define I2C_WRITE 0
#define I2C_READ 1
#define I2C_OK 0
#define I2C_NOK 1
#define I2C_NACK 2
#define I2C_NOK_LA 3 /* Lost arbitration */
#define I2C_NOK_TOUT 4 /* time out */
/* S3C I2C Controller bits */
#define I2CSTAT_BSY 0x20 /* Busy bit */
#define I2CSTAT_NACK 0x01 /* Nack bit */
#define I2CCON_ACKGEN 0x80 /* Acknowledge generation */
#define I2CCON_IRPND 0x10 /* Interrupt pending bit */
#define I2C_MODE_MT 0xC0 /* Master Transmit Mode */
#define I2C_MODE_MR 0x80 /* Master Receive Mode */
#define I2C_START_STOP 0x20 /* START / STOP */
#define I2C_TXRX_ENA 0x10 /* I2C Tx/Rx enable */
#define I2C_TIMEOUT_MS 10 /* 10 ms */
#endif /* _S3C24X0_I2C_H */
| {
"pile_set_name": "Github"
} |
#!/bin/sh
# I use
# - autoconf (GNU Autoconf) 2.64
# - automake (GNU automake) 1.11
# - libtool (GNU libtool) 2.2.6
set -e
set -x
if test -f Makefile; then
make distclean
fi
rm -rf *.cache *.m4 config.guess config.log \
config.status config.sub depcomp ltmain.sh
#(cat m4/*.m4 > acinclude.m4 2> /dev/null)
autoreconf --verbose --install
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.19" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.5.0.qualifier Build <@BUILD@></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<styles>
<style name="report" id="4">
<property name="fontFamily">"Verdana"</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab-cell" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="CustomerStyle" id="8">
<property name="color">#FF0000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</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>
<label id="7">
<property name="style">CustomerStyle</property>
<property name="textLineThrough">line-through</property>
<text-property name="text">aaaa</text-property>
</label>
</body>
</report>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Impact++ / Source: core/hierarchy.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="scripts/html5shiv.js"> </script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles/main.css">
</head>
<body data-spy="scroll" data-target="#navdoc">
<section>
<article>
<pre class="prettyprint source"><code>ig.module(
'plusplus.core.hierarchy'
)
.requires(
'plusplus.helpers.utils'
)
.defines(function() {
"use strict";
var _ut = ig.utils;
var count = 0;
/**
* Hierarchy structure using ancestor/descendant instead of child/parent.
* <br>- child/parent is avoided due to Impact's class using parent to reference prototype functions.
* @class
* @extends ig.Class
* @memberof ig
* @author Collin Hover - collinhover.com
**/
ig.Hierarchy = ig.Class.extend( /**@lends ig.Hierarchy.prototype */ {
/**
* Unique instance id.
* @type String
*/
id: count++,
/**
* Unique instance name.
* <br>- usually names are used to map instances for faster searching.
* @type String
*/
name: '',
/**
* List of descendants.
* @type Array
*/
descendants: [],
/**
* Map of descendants.
* @type Object
*/
descendantsMap: {},
/**
* Ancestor hierarchy.
* @type Object
* @default
*/
ancestor: null,
/**
* Method to sort descendants by.
* <br>- set during init
* @type Function
* @default
*/
sortBy: null,
/**
* Initializes hierarchy.
* @param {Object} [settings] settings object.
**/
init: function(settings) {
this.id = count++;
this.sortBy = ig.Hierarchy.SORT.PRIORITY;
ig.merge(this, settings);
},
/**
* Sets the ancestor of this.
* @param {ig.Hierarchy} ancestor hierarchy object.
**/
setAncestor: function(ancestor) {
this.ancestor = ancestor;
},
/**
* Sets the name of this and remaps this within ancestor for quick by-name lookups.
* @param {String} name name of this.
**/
setName: function(name) {
if (this.name !== name) {
if (this.ancestor instanceof ig.Hierarchy) {
this.ancestor.unmapDescendant(this);
}
this.name = name;
if (this.ancestor instanceof ig.Hierarchy) {
this.ancestor.mapDescendant(this);
}
}
},
/**
* Sets the fallback hierarchy of this for when a lookup by name is done and nothing found.
* @param {ig.Hierarchy} [fallback] hierarchy object.
**/
setFallback: function(fallback) {
this.fallback = fallback;
},
/**
* Adds one or more descendants.
* @param {ig.Hierarchy|Array} adding object or array of objects.
**/
addDescendants: function(adding) {
adding = _ut.toArray(adding);
for (var i = 0, il = adding.length; i < il; i++) {
this.addDescendant(adding[i]);
}
},
/**
* Adds a descendant.
* @param {*} adding descendant object.
**/
addDescendant: function(adding) {
// handle hierarchy objects specially
if (adding instanceof ig.Hierarchy) {
// don't allow circular hierarchy
if (this.isAncestor(adding) === true) {
return;
}
// remove from previous hierarchy
if (adding.ancestor !== undefined) {
adding.ancestor.removeDescendant(adding);
}
adding.setAncestor(this);
}
this.mapDescendant(adding);
this.descendants.push(adding);
this.sortDescendants();
},
/**
* Removes one or more descendants.
* @param {*|Array} removing descendant object or array of objects.
**/
removeDescendants: function(removing) {
removing = _ut.toArray(removing);
for (var i = 0, il = removing.length; i < il; i++) {
this.removeDescendant(removing[i]);
}
},
/**
* Removes a descendant.
* @param {*} removing descendant object.
**/
removeDescendant: function(removing) {
var index = _ut.indexOfValue(this.descendants, removing);
if (index !== -1) {
// handle hierarchy objects specially
if (removing instanceof ig.Hierarchy) {
removing.setAncestor();
}
this.descendants.splice(index, 1);
this.unmapDescendant(removing);
} else {
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i]
if (descendant instanceof ig.Hierarchy) {
descendant.removeDescendant(removing);
}
}
}
},
/**
* Removes all descendants.
**/
clearDescendants: function() {
for (var i = this.descendants.length - 1; i >= 0; i--) {
var descendant = this.descendants[i];
if (descendant instanceof ig.Hierarchy) {
descendant.setAncestor();
}
this.descendants.length--;
this.unmapDescendant(descendant);
}
},
/**
* Sort descendants.
*/
sortDescendants: function() {
this.descendants.sort(this.sortBy);
},
/**
* Maps a descendant by name for faster lookups.
* @param {*} descendant descendant object.
**/
mapDescendant: function(descendant) {
if (descendant.name) {
var existing = this.descendantsMap[descendant.name];
if (existing instanceof ig.Hierarchy) {
existing.ancestor.removeDescendant(existing);
}
this.descendantsMap[descendant.name] = descendant;
}
},
/**
* Unmaps a descendant by name.
* @param {*} descendant descendant object.
**/
unmapDescendant: function(descendant) {
if (descendant.name) {
var mapped = this.descendantsMap[descendant.name];
if (descendant === mapped) {
delete this.descendantsMap[descendant.name];
}
}
},
/**
* Searches for a descendant by name and, optionally, searches recursively.
* @param {String} name name of descendant.
* @param {Boolean} [recursive] search recursively.
* @returns {*} descendant if found.
**/
getDescendantByName: function(name, recursive) {
var named = this._getDescendantByName(name, recursive);
if (!named && this.fallback) {
named = this.fallback._getDescendantByName(name, recursive);
}
return named;
},
/**
* Internal search by name method.
* @param {String} name name of descendant.
* @param {Boolean} [recursive] search recursively.
* @returns {*} descendant if found.
* @private
**/
_getDescendantByName: function(name, recursive) {
var named = this.descendantsMap[name];
if (recursive === true && !named) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
if (descendant instanceof ig.Hierarchy) {
named = descendant.getDescendantByName(name, recursive);
if (named) {
break;
}
}
}
}
return named;
},
/**
* Searches for descendants by type and, optionally, searches recursively.
* @param {Number} type type of descendant.
* @param {Boolean} [recursive] search recursively.
* @returns {Array} descendants if found.
**/
getDescendantsByType: function(type, recursive) {
var matching = this._getDescendantsByType(type, recursive, []);
if (!matching.length && this.fallback) {
matching = this.fallback._getDescendantsByType(type, recursive, matching);
}
return matching;
},
/**
* Internal search by type method.
* @param {Number} type type of descendant.
* @param {Boolean} [recursive] search recursively.
* @param {Array} matching list of matching descendants, passed automatically by getDescendantByType.
* @returns {Array} descendants if found.
* @private
**/
_getDescendantsByType: function(type, recursive, matching) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
// descendant matches type
if (descendant.type & type) {
matching.push(descendant);
}
// search recursively
if (recursive === true && descendant instanceof ig.Hierarchy) {
descendant._getDescendantsByType(name, recursive, matching);
}
}
return matching;
},
/**
* Gets all descendants from here to last descendant.
* @param {String} [array] list of descendants already found.
* @returns {Array} array of all descendants.
**/
getDescendants: function(array) {
array = _ut.toArray(array).concat(this.descendants);
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
if (descendant instanceof ig.Hierarchy) {
array = descendant.getDescendants(array);
}
}
return array;
},
/**
* Gets root ancestor.
* @returns {ig.Hierarchy} root if found.
**/
getRoot: function() {
var ancestor = this;
var root;
while (ancestor) {
root = ancestor;
ancestor = ancestor.ancestor;
}
return root;
},
/**
* Gets if a target is an ancestor.
* @param {ig.Hierarchy} target hierarchy object.
* @returns {Boolean} true if ancestors, false if not.
**/
isAncestor: function(target) {
var ancestor = this.ancestor;
while (ancestor) {
if (ancestor === target) {
return true;
}
ancestor = ancestor.ancestor;
}
return false;
},
/**
* Executes a function in the context of self and each descendant.
* @param {Function} callback function.
**/
forAll: function(callback) {
var args = Array.prototype.slice.call(arguments, 1);
callback.apply(this, args);
this.forAllDescendants.apply(this, arguments);
},
/**
* Executes a function in the context of ONLY descendants.
* @param {Function} callback function.
**/
forAllDescendants: function(callback) {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
callback.apply(descendant, args);
if (descendant instanceof ig.Hierarchy) {
descendant.forAllDescendants.apply(descendant, arguments);
}
}
},
/**
* Executes a function in the context of this and each descendant that has a function with a matching name.
* @param {String} callbackName callback function name.
**/
forAllWithCallback: function(callbackName) {
var callback = this[callbackName];
if (typeof callback === 'function') {
var args = Array.prototype.slice.call(arguments, 1);
callback.apply(this, args);
}
this.forAllDescendantsWithCallback.apply(this, arguments);
},
/**
* Executes a function in the context of each descendant that has a function with a matching name.
* @param {String} callbackName callback function name.
**/
forAllDescendantsWithCallback: function(callbackName) {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
var callback = descendant[callbackName];
if (typeof callback === 'function') {
callback.apply(descendant, args);
}
if (descendant instanceof ig.Hierarchy) {
descendant.forAllWithCallback.apply(descendant, arguments);
}
}
},
/**
* Executes a function in the context of each immediate descendant.
* @param {Function} callback callback function.
**/
forImmediate: function(callback) {
var args = Array.prototype.slice.call(arguments, 1);
callback.apply(this, args);
for (var i = 0, il = this.descendants.length; i < il; i++) {
callback.apply(this.descendants[i], args);
}
},
/**
* Executes a function in the context of each immediate descendant that has a function with a matching name.
* @param {String} callbackName callback function name.
**/
forImmediateWithCallback: function(callbackName) {
var callback = this[callbackName];
if (typeof callback === 'function') {
var args = Array.prototype.slice.call(arguments, 1);
callback.apply(this, args);
}
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
callback = descendant[callbackName];
if (typeof callback === 'function') {
callback.apply(descendant, args);
}
}
},
/**
* Activate all descendants with blocking check and cleans up descendants that are blocked.
* @returns {Boolean} whether at least one ability was successfully activated.
**/
activate: function() {
var activated = false;
var blocked = false;
var method = "activate";
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
descendant[method].apply(descendant, arguments);
// check if descendant is activated or in use
if (!blocked && (descendant.activated || descendant.getUsing())) {
activated = true;
// when blocking, cleanup all lower priority
if (descendant.blocking) {
blocked = true;
method = "cleanup";
}
}
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
activated = this.fallback[method].apply(descendant, arguments) || activated;
}
return activated;
},
/**
* Deactivate all descendants.
**/
deactivate: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].deactivate();
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.deactivate();
}
},
/**
* Update all descendants.
**/
update: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].update();
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.update();
}
},
/**
* Cleanup all descendants.
**/
cleanup: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].cleanup();
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.cleanup();
}
},
/**
* Set entity of all descendants.
**/
setEntity: function(entity) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].setEntity(entity);
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.setEntity(entity);
}
},
/**
* Set entity target of all descendants.
**/
setEntityTarget: function(entity) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].setEntityTarget(entity);
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.setEntityTarget(entity);
}
},
/**
* Set entity target of all descendants from a list of targets.
**/
setEntityTargetFirst: function(entities) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].setEntityTargetFirst(entities);
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.setEntityTargetFirst(entities);
}
},
/**
* Set entity options of all descendants.
**/
setEntityOptions: function(entity) {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].setEntityOptions(entity);
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.setEntityOptions(entity);
}
},
/**
* Check if any descendants are in use and should not be disturbed.
**/
getUsing: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
if (this.descendants[i].getUsing()) {
return true;
}
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
return this.fallback.getUsing();
}
return false;
},
/**
* Pauses all descendants.
**/
pause: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].pause();
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.pause();
}
},
/**
* Unpauses all descendants.
**/
unpause: function() {
for (var i = 0, il = this.descendants.length; i < il; i++) {
this.descendants[i].unpause();
}
// also check fallback as it is possible that fallback descendants are being used
if (this.fallback) {
this.fallback.unpause();
}
},
/**
* Clones this hierarchy object.
* @param {ig.Hierarchy} [c] hierarchy object to clone into.
* @returns {ig.Hierarchy} copy of this.
**/
clone: function(c) {
if (c instanceof ig.Hierarchy !== true) {
c = new ig.Hierarchy();
}
c.name = this.name;
for (var i = 0, il = this.descendants.length; i < il; i++) {
var descendant = this.descendants[i];
if (typeof descendant.clone === 'function') {
c.addDescendant(descendant.clone());
}
}
return c;
}
});
/**
* Sorting methods for hierarchy descendants.
* @static
* @memberof ig.Hierarchy
*/
ig.Hierarchy.SORT = {
PRIORITY: function(a, b) {
return b.priority - a.priority;
},
Z_INDEX: function(a, b) {
return b.zIndex - a.zIndex;
}
};
});
</code></pre>
</article>
</section>
<script src="scripts/linenumber.js"> </script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="scripts/jquery-1.9.1.min.js"><\/script>')</script>
<script src="scripts/bootstrap.min.js"> </script>
<script src="scripts/main.js"> </script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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.
*/
#pragma once
#include <wtf/Ref.h>
namespace WebCore {
class BasicShape;
class BasicShapeCenterCoordinate;
class CSSBasicShape;
class CSSToLengthConversionData;
class CSSPrimitiveValue;
class RenderStyle;
Ref<CSSPrimitiveValue> valueForBasicShape(const RenderStyle&, const BasicShape&);
Ref<BasicShape> basicShapeForValue(const CSSToLengthConversionData&, const CSSBasicShape&);
float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float);
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 209e83764932d974287e82cda5febaf7
DefaultImporter:
userData:
| {
"pile_set_name": "Github"
} |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package cloudwatchlogsiface provides an interface to enable mocking the Amazon CloudWatch Logs service client
// for testing your code.
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters.
package cloudwatchlogsiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)
// CloudWatchLogsAPI provides an interface to enable mocking the
// cloudwatchlogs.CloudWatchLogs service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon CloudWatch Logs.
// func myFunc(svc cloudwatchlogsiface.CloudWatchLogsAPI) bool {
// // Make svc.AssociateKmsKey request
// }
//
// func main() {
// sess := session.New()
// svc := cloudwatchlogs.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockCloudWatchLogsClient struct {
// cloudwatchlogsiface.CloudWatchLogsAPI
// }
// func (m *mockCloudWatchLogsClient) AssociateKmsKey(input *cloudwatchlogs.AssociateKmsKeyInput) (*cloudwatchlogs.AssociateKmsKeyOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockCloudWatchLogsClient{}
//
// myfunc(mockSvc)
//
// // Verify myFunc's functionality
// }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type CloudWatchLogsAPI interface {
AssociateKmsKey(*cloudwatchlogs.AssociateKmsKeyInput) (*cloudwatchlogs.AssociateKmsKeyOutput, error)
AssociateKmsKeyWithContext(aws.Context, *cloudwatchlogs.AssociateKmsKeyInput, ...request.Option) (*cloudwatchlogs.AssociateKmsKeyOutput, error)
AssociateKmsKeyRequest(*cloudwatchlogs.AssociateKmsKeyInput) (*request.Request, *cloudwatchlogs.AssociateKmsKeyOutput)
CancelExportTask(*cloudwatchlogs.CancelExportTaskInput) (*cloudwatchlogs.CancelExportTaskOutput, error)
CancelExportTaskWithContext(aws.Context, *cloudwatchlogs.CancelExportTaskInput, ...request.Option) (*cloudwatchlogs.CancelExportTaskOutput, error)
CancelExportTaskRequest(*cloudwatchlogs.CancelExportTaskInput) (*request.Request, *cloudwatchlogs.CancelExportTaskOutput)
CreateExportTask(*cloudwatchlogs.CreateExportTaskInput) (*cloudwatchlogs.CreateExportTaskOutput, error)
CreateExportTaskWithContext(aws.Context, *cloudwatchlogs.CreateExportTaskInput, ...request.Option) (*cloudwatchlogs.CreateExportTaskOutput, error)
CreateExportTaskRequest(*cloudwatchlogs.CreateExportTaskInput) (*request.Request, *cloudwatchlogs.CreateExportTaskOutput)
CreateLogGroup(*cloudwatchlogs.CreateLogGroupInput) (*cloudwatchlogs.CreateLogGroupOutput, error)
CreateLogGroupWithContext(aws.Context, *cloudwatchlogs.CreateLogGroupInput, ...request.Option) (*cloudwatchlogs.CreateLogGroupOutput, error)
CreateLogGroupRequest(*cloudwatchlogs.CreateLogGroupInput) (*request.Request, *cloudwatchlogs.CreateLogGroupOutput)
CreateLogStream(*cloudwatchlogs.CreateLogStreamInput) (*cloudwatchlogs.CreateLogStreamOutput, error)
CreateLogStreamWithContext(aws.Context, *cloudwatchlogs.CreateLogStreamInput, ...request.Option) (*cloudwatchlogs.CreateLogStreamOutput, error)
CreateLogStreamRequest(*cloudwatchlogs.CreateLogStreamInput) (*request.Request, *cloudwatchlogs.CreateLogStreamOutput)
DeleteDestination(*cloudwatchlogs.DeleteDestinationInput) (*cloudwatchlogs.DeleteDestinationOutput, error)
DeleteDestinationWithContext(aws.Context, *cloudwatchlogs.DeleteDestinationInput, ...request.Option) (*cloudwatchlogs.DeleteDestinationOutput, error)
DeleteDestinationRequest(*cloudwatchlogs.DeleteDestinationInput) (*request.Request, *cloudwatchlogs.DeleteDestinationOutput)
DeleteLogGroup(*cloudwatchlogs.DeleteLogGroupInput) (*cloudwatchlogs.DeleteLogGroupOutput, error)
DeleteLogGroupWithContext(aws.Context, *cloudwatchlogs.DeleteLogGroupInput, ...request.Option) (*cloudwatchlogs.DeleteLogGroupOutput, error)
DeleteLogGroupRequest(*cloudwatchlogs.DeleteLogGroupInput) (*request.Request, *cloudwatchlogs.DeleteLogGroupOutput)
DeleteLogStream(*cloudwatchlogs.DeleteLogStreamInput) (*cloudwatchlogs.DeleteLogStreamOutput, error)
DeleteLogStreamWithContext(aws.Context, *cloudwatchlogs.DeleteLogStreamInput, ...request.Option) (*cloudwatchlogs.DeleteLogStreamOutput, error)
DeleteLogStreamRequest(*cloudwatchlogs.DeleteLogStreamInput) (*request.Request, *cloudwatchlogs.DeleteLogStreamOutput)
DeleteMetricFilter(*cloudwatchlogs.DeleteMetricFilterInput) (*cloudwatchlogs.DeleteMetricFilterOutput, error)
DeleteMetricFilterWithContext(aws.Context, *cloudwatchlogs.DeleteMetricFilterInput, ...request.Option) (*cloudwatchlogs.DeleteMetricFilterOutput, error)
DeleteMetricFilterRequest(*cloudwatchlogs.DeleteMetricFilterInput) (*request.Request, *cloudwatchlogs.DeleteMetricFilterOutput)
DeleteResourcePolicy(*cloudwatchlogs.DeleteResourcePolicyInput) (*cloudwatchlogs.DeleteResourcePolicyOutput, error)
DeleteResourcePolicyWithContext(aws.Context, *cloudwatchlogs.DeleteResourcePolicyInput, ...request.Option) (*cloudwatchlogs.DeleteResourcePolicyOutput, error)
DeleteResourcePolicyRequest(*cloudwatchlogs.DeleteResourcePolicyInput) (*request.Request, *cloudwatchlogs.DeleteResourcePolicyOutput)
DeleteRetentionPolicy(*cloudwatchlogs.DeleteRetentionPolicyInput) (*cloudwatchlogs.DeleteRetentionPolicyOutput, error)
DeleteRetentionPolicyWithContext(aws.Context, *cloudwatchlogs.DeleteRetentionPolicyInput, ...request.Option) (*cloudwatchlogs.DeleteRetentionPolicyOutput, error)
DeleteRetentionPolicyRequest(*cloudwatchlogs.DeleteRetentionPolicyInput) (*request.Request, *cloudwatchlogs.DeleteRetentionPolicyOutput)
DeleteSubscriptionFilter(*cloudwatchlogs.DeleteSubscriptionFilterInput) (*cloudwatchlogs.DeleteSubscriptionFilterOutput, error)
DeleteSubscriptionFilterWithContext(aws.Context, *cloudwatchlogs.DeleteSubscriptionFilterInput, ...request.Option) (*cloudwatchlogs.DeleteSubscriptionFilterOutput, error)
DeleteSubscriptionFilterRequest(*cloudwatchlogs.DeleteSubscriptionFilterInput) (*request.Request, *cloudwatchlogs.DeleteSubscriptionFilterOutput)
DescribeDestinations(*cloudwatchlogs.DescribeDestinationsInput) (*cloudwatchlogs.DescribeDestinationsOutput, error)
DescribeDestinationsWithContext(aws.Context, *cloudwatchlogs.DescribeDestinationsInput, ...request.Option) (*cloudwatchlogs.DescribeDestinationsOutput, error)
DescribeDestinationsRequest(*cloudwatchlogs.DescribeDestinationsInput) (*request.Request, *cloudwatchlogs.DescribeDestinationsOutput)
DescribeDestinationsPages(*cloudwatchlogs.DescribeDestinationsInput, func(*cloudwatchlogs.DescribeDestinationsOutput, bool) bool) error
DescribeDestinationsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeDestinationsInput, func(*cloudwatchlogs.DescribeDestinationsOutput, bool) bool, ...request.Option) error
DescribeExportTasks(*cloudwatchlogs.DescribeExportTasksInput) (*cloudwatchlogs.DescribeExportTasksOutput, error)
DescribeExportTasksWithContext(aws.Context, *cloudwatchlogs.DescribeExportTasksInput, ...request.Option) (*cloudwatchlogs.DescribeExportTasksOutput, error)
DescribeExportTasksRequest(*cloudwatchlogs.DescribeExportTasksInput) (*request.Request, *cloudwatchlogs.DescribeExportTasksOutput)
DescribeLogGroups(*cloudwatchlogs.DescribeLogGroupsInput) (*cloudwatchlogs.DescribeLogGroupsOutput, error)
DescribeLogGroupsWithContext(aws.Context, *cloudwatchlogs.DescribeLogGroupsInput, ...request.Option) (*cloudwatchlogs.DescribeLogGroupsOutput, error)
DescribeLogGroupsRequest(*cloudwatchlogs.DescribeLogGroupsInput) (*request.Request, *cloudwatchlogs.DescribeLogGroupsOutput)
DescribeLogGroupsPages(*cloudwatchlogs.DescribeLogGroupsInput, func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool) error
DescribeLogGroupsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeLogGroupsInput, func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool, ...request.Option) error
DescribeLogStreams(*cloudwatchlogs.DescribeLogStreamsInput) (*cloudwatchlogs.DescribeLogStreamsOutput, error)
DescribeLogStreamsWithContext(aws.Context, *cloudwatchlogs.DescribeLogStreamsInput, ...request.Option) (*cloudwatchlogs.DescribeLogStreamsOutput, error)
DescribeLogStreamsRequest(*cloudwatchlogs.DescribeLogStreamsInput) (*request.Request, *cloudwatchlogs.DescribeLogStreamsOutput)
DescribeLogStreamsPages(*cloudwatchlogs.DescribeLogStreamsInput, func(*cloudwatchlogs.DescribeLogStreamsOutput, bool) bool) error
DescribeLogStreamsPagesWithContext(aws.Context, *cloudwatchlogs.DescribeLogStreamsInput, func(*cloudwatchlogs.DescribeLogStreamsOutput, bool) bool, ...request.Option) error
DescribeMetricFilters(*cloudwatchlogs.DescribeMetricFiltersInput) (*cloudwatchlogs.DescribeMetricFiltersOutput, error)
DescribeMetricFiltersWithContext(aws.Context, *cloudwatchlogs.DescribeMetricFiltersInput, ...request.Option) (*cloudwatchlogs.DescribeMetricFiltersOutput, error)
DescribeMetricFiltersRequest(*cloudwatchlogs.DescribeMetricFiltersInput) (*request.Request, *cloudwatchlogs.DescribeMetricFiltersOutput)
DescribeMetricFiltersPages(*cloudwatchlogs.DescribeMetricFiltersInput, func(*cloudwatchlogs.DescribeMetricFiltersOutput, bool) bool) error
DescribeMetricFiltersPagesWithContext(aws.Context, *cloudwatchlogs.DescribeMetricFiltersInput, func(*cloudwatchlogs.DescribeMetricFiltersOutput, bool) bool, ...request.Option) error
DescribeResourcePolicies(*cloudwatchlogs.DescribeResourcePoliciesInput) (*cloudwatchlogs.DescribeResourcePoliciesOutput, error)
DescribeResourcePoliciesWithContext(aws.Context, *cloudwatchlogs.DescribeResourcePoliciesInput, ...request.Option) (*cloudwatchlogs.DescribeResourcePoliciesOutput, error)
DescribeResourcePoliciesRequest(*cloudwatchlogs.DescribeResourcePoliciesInput) (*request.Request, *cloudwatchlogs.DescribeResourcePoliciesOutput)
DescribeSubscriptionFilters(*cloudwatchlogs.DescribeSubscriptionFiltersInput) (*cloudwatchlogs.DescribeSubscriptionFiltersOutput, error)
DescribeSubscriptionFiltersWithContext(aws.Context, *cloudwatchlogs.DescribeSubscriptionFiltersInput, ...request.Option) (*cloudwatchlogs.DescribeSubscriptionFiltersOutput, error)
DescribeSubscriptionFiltersRequest(*cloudwatchlogs.DescribeSubscriptionFiltersInput) (*request.Request, *cloudwatchlogs.DescribeSubscriptionFiltersOutput)
DescribeSubscriptionFiltersPages(*cloudwatchlogs.DescribeSubscriptionFiltersInput, func(*cloudwatchlogs.DescribeSubscriptionFiltersOutput, bool) bool) error
DescribeSubscriptionFiltersPagesWithContext(aws.Context, *cloudwatchlogs.DescribeSubscriptionFiltersInput, func(*cloudwatchlogs.DescribeSubscriptionFiltersOutput, bool) bool, ...request.Option) error
DisassociateKmsKey(*cloudwatchlogs.DisassociateKmsKeyInput) (*cloudwatchlogs.DisassociateKmsKeyOutput, error)
DisassociateKmsKeyWithContext(aws.Context, *cloudwatchlogs.DisassociateKmsKeyInput, ...request.Option) (*cloudwatchlogs.DisassociateKmsKeyOutput, error)
DisassociateKmsKeyRequest(*cloudwatchlogs.DisassociateKmsKeyInput) (*request.Request, *cloudwatchlogs.DisassociateKmsKeyOutput)
FilterLogEvents(*cloudwatchlogs.FilterLogEventsInput) (*cloudwatchlogs.FilterLogEventsOutput, error)
FilterLogEventsWithContext(aws.Context, *cloudwatchlogs.FilterLogEventsInput, ...request.Option) (*cloudwatchlogs.FilterLogEventsOutput, error)
FilterLogEventsRequest(*cloudwatchlogs.FilterLogEventsInput) (*request.Request, *cloudwatchlogs.FilterLogEventsOutput)
FilterLogEventsPages(*cloudwatchlogs.FilterLogEventsInput, func(*cloudwatchlogs.FilterLogEventsOutput, bool) bool) error
FilterLogEventsPagesWithContext(aws.Context, *cloudwatchlogs.FilterLogEventsInput, func(*cloudwatchlogs.FilterLogEventsOutput, bool) bool, ...request.Option) error
GetLogEvents(*cloudwatchlogs.GetLogEventsInput) (*cloudwatchlogs.GetLogEventsOutput, error)
GetLogEventsWithContext(aws.Context, *cloudwatchlogs.GetLogEventsInput, ...request.Option) (*cloudwatchlogs.GetLogEventsOutput, error)
GetLogEventsRequest(*cloudwatchlogs.GetLogEventsInput) (*request.Request, *cloudwatchlogs.GetLogEventsOutput)
GetLogEventsPages(*cloudwatchlogs.GetLogEventsInput, func(*cloudwatchlogs.GetLogEventsOutput, bool) bool) error
GetLogEventsPagesWithContext(aws.Context, *cloudwatchlogs.GetLogEventsInput, func(*cloudwatchlogs.GetLogEventsOutput, bool) bool, ...request.Option) error
ListTagsLogGroup(*cloudwatchlogs.ListTagsLogGroupInput) (*cloudwatchlogs.ListTagsLogGroupOutput, error)
ListTagsLogGroupWithContext(aws.Context, *cloudwatchlogs.ListTagsLogGroupInput, ...request.Option) (*cloudwatchlogs.ListTagsLogGroupOutput, error)
ListTagsLogGroupRequest(*cloudwatchlogs.ListTagsLogGroupInput) (*request.Request, *cloudwatchlogs.ListTagsLogGroupOutput)
PutDestination(*cloudwatchlogs.PutDestinationInput) (*cloudwatchlogs.PutDestinationOutput, error)
PutDestinationWithContext(aws.Context, *cloudwatchlogs.PutDestinationInput, ...request.Option) (*cloudwatchlogs.PutDestinationOutput, error)
PutDestinationRequest(*cloudwatchlogs.PutDestinationInput) (*request.Request, *cloudwatchlogs.PutDestinationOutput)
PutDestinationPolicy(*cloudwatchlogs.PutDestinationPolicyInput) (*cloudwatchlogs.PutDestinationPolicyOutput, error)
PutDestinationPolicyWithContext(aws.Context, *cloudwatchlogs.PutDestinationPolicyInput, ...request.Option) (*cloudwatchlogs.PutDestinationPolicyOutput, error)
PutDestinationPolicyRequest(*cloudwatchlogs.PutDestinationPolicyInput) (*request.Request, *cloudwatchlogs.PutDestinationPolicyOutput)
PutLogEvents(*cloudwatchlogs.PutLogEventsInput) (*cloudwatchlogs.PutLogEventsOutput, error)
PutLogEventsWithContext(aws.Context, *cloudwatchlogs.PutLogEventsInput, ...request.Option) (*cloudwatchlogs.PutLogEventsOutput, error)
PutLogEventsRequest(*cloudwatchlogs.PutLogEventsInput) (*request.Request, *cloudwatchlogs.PutLogEventsOutput)
PutMetricFilter(*cloudwatchlogs.PutMetricFilterInput) (*cloudwatchlogs.PutMetricFilterOutput, error)
PutMetricFilterWithContext(aws.Context, *cloudwatchlogs.PutMetricFilterInput, ...request.Option) (*cloudwatchlogs.PutMetricFilterOutput, error)
PutMetricFilterRequest(*cloudwatchlogs.PutMetricFilterInput) (*request.Request, *cloudwatchlogs.PutMetricFilterOutput)
PutResourcePolicy(*cloudwatchlogs.PutResourcePolicyInput) (*cloudwatchlogs.PutResourcePolicyOutput, error)
PutResourcePolicyWithContext(aws.Context, *cloudwatchlogs.PutResourcePolicyInput, ...request.Option) (*cloudwatchlogs.PutResourcePolicyOutput, error)
PutResourcePolicyRequest(*cloudwatchlogs.PutResourcePolicyInput) (*request.Request, *cloudwatchlogs.PutResourcePolicyOutput)
PutRetentionPolicy(*cloudwatchlogs.PutRetentionPolicyInput) (*cloudwatchlogs.PutRetentionPolicyOutput, error)
PutRetentionPolicyWithContext(aws.Context, *cloudwatchlogs.PutRetentionPolicyInput, ...request.Option) (*cloudwatchlogs.PutRetentionPolicyOutput, error)
PutRetentionPolicyRequest(*cloudwatchlogs.PutRetentionPolicyInput) (*request.Request, *cloudwatchlogs.PutRetentionPolicyOutput)
PutSubscriptionFilter(*cloudwatchlogs.PutSubscriptionFilterInput) (*cloudwatchlogs.PutSubscriptionFilterOutput, error)
PutSubscriptionFilterWithContext(aws.Context, *cloudwatchlogs.PutSubscriptionFilterInput, ...request.Option) (*cloudwatchlogs.PutSubscriptionFilterOutput, error)
PutSubscriptionFilterRequest(*cloudwatchlogs.PutSubscriptionFilterInput) (*request.Request, *cloudwatchlogs.PutSubscriptionFilterOutput)
TagLogGroup(*cloudwatchlogs.TagLogGroupInput) (*cloudwatchlogs.TagLogGroupOutput, error)
TagLogGroupWithContext(aws.Context, *cloudwatchlogs.TagLogGroupInput, ...request.Option) (*cloudwatchlogs.TagLogGroupOutput, error)
TagLogGroupRequest(*cloudwatchlogs.TagLogGroupInput) (*request.Request, *cloudwatchlogs.TagLogGroupOutput)
TestMetricFilter(*cloudwatchlogs.TestMetricFilterInput) (*cloudwatchlogs.TestMetricFilterOutput, error)
TestMetricFilterWithContext(aws.Context, *cloudwatchlogs.TestMetricFilterInput, ...request.Option) (*cloudwatchlogs.TestMetricFilterOutput, error)
TestMetricFilterRequest(*cloudwatchlogs.TestMetricFilterInput) (*request.Request, *cloudwatchlogs.TestMetricFilterOutput)
UntagLogGroup(*cloudwatchlogs.UntagLogGroupInput) (*cloudwatchlogs.UntagLogGroupOutput, error)
UntagLogGroupWithContext(aws.Context, *cloudwatchlogs.UntagLogGroupInput, ...request.Option) (*cloudwatchlogs.UntagLogGroupOutput, error)
UntagLogGroupRequest(*cloudwatchlogs.UntagLogGroupInput) (*request.Request, *cloudwatchlogs.UntagLogGroupOutput)
}
var _ CloudWatchLogsAPI = (*cloudwatchlogs.CloudWatchLogs)(nil)
| {
"pile_set_name": "Github"
} |
// Opacity
.opacity(@opacity) {
opacity: @opacity;
// IE8 filter
@opacity-ie: (@opacity * 100);
filter: ~"alpha(opacity=@{opacity-ie})";
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using SixLabors.ImageSharp.ColorSpaces;
using Xunit;
namespace SixLabors.ImageSharp.Tests.Colorspaces
{
/// <summary>
/// Tests the <see cref="LinearRgb"/> struct.
/// </summary>
public class LinearRgbTests
{
[Fact]
public void LinearRgbConstructorAssignsFields()
{
const float r = .75F;
const float g = .64F;
const float b = .87F;
var rgb = new LinearRgb(r, g, b);
Assert.Equal(r, rgb.R);
Assert.Equal(g, rgb.G);
Assert.Equal(b, rgb.B);
}
[Fact]
public void LinearRgbEquality()
{
var x = default(LinearRgb);
var y = new LinearRgb(Vector3.One);
Assert.True(default(LinearRgb) == default(LinearRgb));
Assert.False(default(LinearRgb) != default(LinearRgb));
Assert.Equal(default(LinearRgb), default(LinearRgb));
Assert.Equal(new LinearRgb(1, 0, 1), new LinearRgb(1, 0, 1));
Assert.Equal(new LinearRgb(Vector3.One), new LinearRgb(Vector3.One));
Assert.False(x.Equals(y));
Assert.False(x.Equals((object)y));
Assert.False(x.GetHashCode().Equals(y.GetHashCode()));
}
}
} | {
"pile_set_name": "Github"
} |
package digitalocean
import (
"context"
"fmt"
"io"
"time"
"github.com/digitalocean/godo"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/supergiant/control/pkg/clouds/digitaloceansdk"
"github.com/supergiant/control/pkg/util"
"github.com/supergiant/control/pkg/workflows/steps"
)
type CreateLoadBalancerStep struct {
Timeout time.Duration
Attempts int
getServices func(string) LoadBalancerService
}
func NewCreateLoadBalancerStep() *CreateLoadBalancerStep {
return &CreateLoadBalancerStep{
Timeout: time.Second * 10,
Attempts: 6,
getServices: func(accessToken string) LoadBalancerService {
client := digitaloceansdk.New(accessToken).GetClient()
return client.LoadBalancers
},
}
}
func (s *CreateLoadBalancerStep) Run(ctx context.Context, output io.Writer, config *steps.Config) error {
lbSvc := s.getServices(config.DigitalOceanConfig.AccessToken)
req := &godo.LoadBalancerRequest{
Name: util.CreateLBName(config.Kube.ID, true),
Region: config.DigitalOceanConfig.Region,
ForwardingRules: []godo.ForwardingRule{
{
EntryPort: int(config.Kube.APIServerPort),
EntryProtocol: "TCP",
TargetPort: int(config.Kube.APIServerPort),
TargetProtocol: "TCP",
},
{
EntryPort: 2379,
EntryProtocol: "TCP",
TargetPort: 2379,
TargetProtocol: "TCP",
},
{
EntryPort: 2380,
EntryProtocol: "TCP",
TargetPort: 2380,
TargetProtocol: "TCP",
},
},
HealthCheck: &godo.HealthCheck{
Protocol: "TCP",
Port: int(config.Kube.APIServerPort),
CheckIntervalSeconds: 10,
UnhealthyThreshold: 3,
HealthyThreshold: 3,
ResponseTimeoutSeconds: 10,
},
Tag: fmt.Sprintf("master-%s", config.Kube.ID),
}
externalLoadBalancer, _, err := lbSvc.Create(ctx, req)
if err != nil {
logrus.Errorf("Error while creating external load balancer %v", err)
return errors.Wrapf(err, "Error while creating external load balancer")
}
config.DigitalOceanConfig.ExternalLoadBalancerID = externalLoadBalancer.ID
timeout := s.Timeout
logrus.Infof("Wait until External load balancer %s become active", externalLoadBalancer.ID)
for i := 0; i < s.Attempts; i++ {
externalLoadBalancer, _, err = lbSvc.Get(ctx, config.DigitalOceanConfig.ExternalLoadBalancerID)
if err == nil {
logrus.Debugf("External Load balancer %s status %s",
config.DigitalOceanConfig.ExternalLoadBalancerID, externalLoadBalancer.Status)
}
if err == nil && externalLoadBalancer.Status == StatusActive {
break
}
time.Sleep(timeout)
timeout = timeout * 2
}
if err != nil {
logrus.Errorf("Error while getting external load balancer %v", err)
return errors.Wrapf(err, "Error while getting external load balancer")
}
if externalLoadBalancer.IP == "" {
logrus.Errorf("External Load balancer IP must not be empty")
return errors.New("External Load balancer IP must not be empty")
}
config.Kube.ExternalDNSName = externalLoadBalancer.IP
req = &godo.LoadBalancerRequest{
Name: util.CreateLBName(config.Kube.ID, false),
Region: config.DigitalOceanConfig.Region,
ForwardingRules: []godo.ForwardingRule{
{
EntryPort: int(config.Kube.APIServerPort),
EntryProtocol: "TCP",
TargetPort: int(config.Kube.APIServerPort),
TargetProtocol: "TCP",
},
{
EntryPort: 2379,
EntryProtocol: "TCP",
TargetPort: 2379,
TargetProtocol: "TCP",
},
{
EntryPort: 2380,
EntryProtocol: "TCP",
TargetPort: 2380,
TargetProtocol: "TCP",
},
},
HealthCheck: &godo.HealthCheck{
Protocol: "TCP",
Port: int(config.Kube.APIServerPort),
CheckIntervalSeconds: 10,
UnhealthyThreshold: 3,
HealthyThreshold: 3,
ResponseTimeoutSeconds: 10,
},
Tag: fmt.Sprintf("master-%s", config.Kube.ID),
}
internalLoadBalancer, _, err := lbSvc.Create(ctx, req)
if err != nil {
logrus.Errorf("Error while creating internal load balancer %v", err)
return errors.Wrapf(err, "Error while creating internal load balancer")
}
config.DigitalOceanConfig.InternalLoadBalancerID = internalLoadBalancer.ID
logrus.Infof("Wait until Internal load balancer %s become active", internalLoadBalancer.ID)
timeout = s.Timeout
for i := 0; i < s.Attempts; i++ {
internalLoadBalancer, _, err = lbSvc.Get(ctx, config.DigitalOceanConfig.InternalLoadBalancerID)
if err == nil {
logrus.Debugf("Internal Load balancer %s status %s",
config.DigitalOceanConfig.InternalLoadBalancerID, internalLoadBalancer.Status)
}
if err == nil && internalLoadBalancer.Status == StatusActive {
break
}
time.Sleep(timeout)
timeout = timeout * 2
}
if err != nil {
logrus.Errorf("Error while getting internal load balancer %v", err)
return errors.Wrapf(err, "Error while getting internal load balancer")
}
if internalLoadBalancer.IP == "" {
logrus.Errorf("Internal Load balancer IP must not be empty")
return errors.New("Internal Load balancer IP must not be empty")
}
config.Kube.InternalDNSName = internalLoadBalancer.IP
return nil
}
func (s *CreateLoadBalancerStep) Rollback(context.Context, io.Writer, *steps.Config) error {
return nil
}
func (s *CreateLoadBalancerStep) Name() string {
return CreateLoadBalancerStepName
}
func (s *CreateLoadBalancerStep) Depends() []string {
return nil
}
func (s *CreateLoadBalancerStep) Description() string {
return "Create load balancer in Digital Ocean"
}
| {
"pile_set_name": "Github"
} |
/*
* The driver for the EMU10K1 (SB Live!) based soundcards
* Copyright (c) by Jaroslav Kysela <[email protected]>
*
* Copyright (c) by James Courtier-Dutton <[email protected]>
* Added support for Audigy 2 Value.
*
*
* 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/init.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#include <sound/initval.h>
MODULE_AUTHOR("Jaroslav Kysela <[email protected]>");
MODULE_DESCRIPTION("EMU10K1");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS},"
"{Creative Labs,SB Audigy}}");
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
#define ENABLE_SYNTH
#include <sound/emu10k1_synth.h>
#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int extin[SNDRV_CARDS];
static int extout[SNDRV_CARDS];
static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};
static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
static bool enable_ir[SNDRV_CARDS];
static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */
static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for the EMU10K1 soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable the EMU10K1 soundcard.");
module_param_array(extin, int, NULL, 0444);
MODULE_PARM_DESC(extin, "Available external inputs for FX8010. Zero=default.");
module_param_array(extout, int, NULL, 0444);
MODULE_PARM_DESC(extout, "Available external outputs for FX8010. Zero=default.");
module_param_array(seq_ports, int, NULL, 0444);
MODULE_PARM_DESC(seq_ports, "Allocated sequencer ports for internal synthesizer.");
module_param_array(max_synth_voices, int, NULL, 0444);
MODULE_PARM_DESC(max_synth_voices, "Maximum number of voices for WaveTable.");
module_param_array(max_buffer_size, int, NULL, 0444);
MODULE_PARM_DESC(max_buffer_size, "Maximum sample buffer size in MB.");
module_param_array(enable_ir, bool, NULL, 0444);
MODULE_PARM_DESC(enable_ir, "Enable IR.");
module_param_array(subsystem, uint, NULL, 0444);
MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
module_param_array(delay_pcm_irq, uint, NULL, 0444);
MODULE_PARM_DESC(delay_pcm_irq, "Delay PCM interrupt by specified number of samples (default 0).");
/*
* Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
*/
static const struct pci_device_id snd_emu10k1_ids[] = {
{ PCI_VDEVICE(CREATIVE, 0x0002), 0 }, /* EMU10K1 */
{ PCI_VDEVICE(CREATIVE, 0x0004), 1 }, /* Audigy */
{ PCI_VDEVICE(CREATIVE, 0x0008), 1 }, /* Audigy 2 Value SB0400 */
{ 0, }
};
/*
* Audigy 2 Value notes:
* A_IOCFG Input (GPIO)
* 0x400 = Front analog jack plugged in. (Green socket)
* 0x1000 = Read analog jack plugged in. (Black socket)
* 0x2000 = Center/LFE analog jack plugged in. (Orange socket)
* A_IOCFG Output (GPIO)
* 0x60 = Sound out of front Left.
* Win sets it to 0xXX61
*/
MODULE_DEVICE_TABLE(pci, snd_emu10k1_ids);
static int snd_card_emu10k1_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
static int dev;
struct snd_card *card;
struct snd_emu10k1 *emu;
#ifdef ENABLE_SYNTH
struct snd_seq_device *wave = NULL;
#endif
int err;
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
dev++;
return -ENOENT;
}
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
if (max_buffer_size[dev] < 32)
max_buffer_size[dev] = 32;
else if (max_buffer_size[dev] > 1024)
max_buffer_size[dev] = 1024;
if ((err = snd_emu10k1_create(card, pci, extin[dev], extout[dev],
(long)max_buffer_size[dev] * 1024 * 1024,
enable_ir[dev], subsystem[dev],
&emu)) < 0)
goto error;
card->private_data = emu;
emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f;
if ((err = snd_emu10k1_pcm(emu, 0)) < 0)
goto error;
if ((err = snd_emu10k1_pcm_mic(emu, 1)) < 0)
goto error;
if ((err = snd_emu10k1_pcm_efx(emu, 2)) < 0)
goto error;
/* This stores the periods table. */
if (emu->card_capabilities->ca0151_chip) { /* P16V */
if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
1024, &emu->p16v_buffer)) < 0)
goto error;
}
if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0)
goto error;
if ((err = snd_emu10k1_timer(emu, 0)) < 0)
goto error;
if ((err = snd_emu10k1_pcm_multi(emu, 3)) < 0)
goto error;
if (emu->card_capabilities->ca0151_chip) { /* P16V */
if ((err = snd_p16v_pcm(emu, 4)) < 0)
goto error;
}
if (emu->audigy) {
if ((err = snd_emu10k1_audigy_midi(emu)) < 0)
goto error;
} else {
if ((err = snd_emu10k1_midi(emu)) < 0)
goto error;
}
if ((err = snd_emu10k1_fx8010_new(emu, 0)) < 0)
goto error;
#ifdef ENABLE_SYNTH
if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,
sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 ||
wave == NULL) {
dev_warn(emu->card->dev,
"can't initialize Emu10k1 wavetable synth\n");
} else {
struct snd_emu10k1_synth_arg *arg;
arg = SNDRV_SEQ_DEVICE_ARGPTR(wave);
strcpy(wave->name, "Emu-10k1 Synth");
arg->hwptr = emu;
arg->index = 1;
arg->seq_ports = seq_ports[dev];
arg->max_voices = max_synth_voices[dev];
}
#endif
strlcpy(card->driver, emu->card_capabilities->driver,
sizeof(card->driver));
strlcpy(card->shortname, emu->card_capabilities->name,
sizeof(card->shortname));
snprintf(card->longname, sizeof(card->longname),
"%s (rev.%d, serial:0x%x) at 0x%lx, irq %i",
card->shortname, emu->revision, emu->serial, emu->port, emu->irq);
if ((err = snd_card_register(card)) < 0)
goto error;
if (emu->card_capabilities->emu_model)
schedule_delayed_work(&emu->emu1010.firmware_work, 0);
pci_set_drvdata(pci, card);
dev++;
return 0;
error:
snd_card_free(card);
return err;
}
static void snd_card_emu10k1_remove(struct pci_dev *pci)
{
snd_card_free(pci_get_drvdata(pci));
}
#ifdef CONFIG_PM_SLEEP
static int snd_emu10k1_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct snd_emu10k1 *emu = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
emu->suspend = 1;
cancel_delayed_work_sync(&emu->emu1010.firmware_work);
snd_pcm_suspend_all(emu->pcm);
snd_pcm_suspend_all(emu->pcm_mic);
snd_pcm_suspend_all(emu->pcm_efx);
snd_pcm_suspend_all(emu->pcm_multi);
snd_pcm_suspend_all(emu->pcm_p16v);
snd_ac97_suspend(emu->ac97);
snd_emu10k1_efx_suspend(emu);
snd_emu10k1_suspend_regs(emu);
if (emu->card_capabilities->ca0151_chip)
snd_p16v_suspend(emu);
snd_emu10k1_done(emu);
return 0;
}
static int snd_emu10k1_resume(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct snd_emu10k1 *emu = card->private_data;
snd_emu10k1_resume_init(emu);
snd_emu10k1_efx_resume(emu);
snd_ac97_resume(emu->ac97);
snd_emu10k1_resume_regs(emu);
if (emu->card_capabilities->ca0151_chip)
snd_p16v_resume(emu);
emu->suspend = 0;
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
if (emu->card_capabilities->emu_model)
schedule_delayed_work(&emu->emu1010.firmware_work, 0);
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_emu10k1_pm, snd_emu10k1_suspend, snd_emu10k1_resume);
#define SND_EMU10K1_PM_OPS &snd_emu10k1_pm
#else
#define SND_EMU10K1_PM_OPS NULL
#endif /* CONFIG_PM_SLEEP */
static struct pci_driver emu10k1_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_emu10k1_ids,
.probe = snd_card_emu10k1_probe,
.remove = snd_card_emu10k1_remove,
.driver = {
.pm = SND_EMU10K1_PM_OPS,
},
};
module_pci_driver(emu10k1_driver);
| {
"pile_set_name": "Github"
} |
// vim:tw=110:ts=4:
#ifndef MDD_H
#define MDD_H 1
/*************************************************************************************************************
*
* FILE : mdd.h
*
* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.6 $
* Original : 2004/05/25 05:59:37 Revision: 1.57 Tag: hcf7_t20040602_01
* Original : 2004/05/13 15:31:45 Revision: 1.54 Tag: hcf7_t7_20040513_01
* Original : 2004/04/15 09:24:41 Revision: 1.47 Tag: hcf7_t7_20040415_01
* Original : 2004/04/13 14:22:45 Revision: 1.46 Tag: t7_20040413_01
* Original : 2004/04/01 15:32:55 Revision: 1.42 Tag: t7_20040401_01
* Original : 2004/03/10 15:39:28 Revision: 1.38 Tag: t20040310_01
* Original : 2004/03/04 11:03:37 Revision: 1.36 Tag: t20040304_01
* Original : 2004/03/02 09:27:11 Revision: 1.34 Tag: t20040302_03
* Original : 2004/02/24 13:00:27 Revision: 1.29 Tag: t20040224_01
* Original : 2004/02/18 17:13:57 Revision: 1.26 Tag: t20040219_01
*
* AUTHOR : Nico Valster
*
* DESC : Definitions and Prototypes for HCF, DHF, MMD and MSF
*
***************************************************************************************************************
*
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, 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 as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . 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 Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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.
*
*
************************************************************************************************************/
/************************************************************************************************************
*
* The macros Xn(...) and XXn(...) are used to define the LTV's (short for Length Type Value[ ]) ,
* aka RIDs, processed by the Hermes.
* The n in Xn and XXn reflects the number of "Value" fields in these RIDs.
*
* Xn(...) : Macros used for RIDs which use only type hcf_16 for the "V" fields of the LTV.
* Xn takes as parameters a RID name and "n" name(s), one for each of the "V" fields of the LTV.
*
* XXn(...) : Macros used for RIDs which use at least one other type then hcf_16 for a "V" field
* of the LTV.
* XXn(..) takes as parameters a RID name and "n" pair(s) of type and name, one for each "V" field
* of the LTV
****************************************** e x a m p l e s ***********************************************
* X1(RID_NAME, parameters...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* hcf_16 par1;
* } RID_NAME_STRCT;
* X2(RID_NAME, parameters...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* hcf_16 par1;
* hcf_16 par2;
* } RID_NAME_STRCT;
* XX1(RID_NAME, par1type, par1name, ...) : expands to :
* typedef struct RID_NAME_STRCT {
* hcf_16 len;
* hcf_16 typ;
* par1type par1name;
* } RID_NAME_STRCT;
************************************************************************************************************/
/******************************* XX Sub-macro definitions **************************************************/
#define XX1( name, type1, par1 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
} name##_STRCT;
#define XX2( name, type1, par1, type2, par2 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
} name##_STRCT;
#define XX3( name, type1, par1, type2, par2, type3, par3 ) \
typedef struct name##_STRCT { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
type3 par3; \
} name##_STRCT;
#define XX4( name, type1, par1, type2, par2, type3, par3, type4, par4 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
type1 par1; \
type2 par2; \
type3 par3; \
type4 par4; \
} name##_STRCT;
#define X1( name, par1 ) \
typedef struct name##_STRCT { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
} name##_STRCT;
#define X2( name, par1, par2 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
} name##_STRCT;
#define X3( name, par1, par2, par3 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
} name##_STRCT;
#define X4( name, par1, par2, par3, par4 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
} name##_STRCT;
#define X5( name, par1, par2, par3, par4, par5 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
} name##_STRCT;
#define X6( name, par1, par2, par3, par4, par5, par6 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
} name##_STRCT;
#define X8( name, par1, par2, par3, par4, par5, par6, par7, par8 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
hcf_16 par7; \
hcf_16 par8; \
} name##_STRCT;
#define X11( name, par1, par2, par3, par4, par5, par6, par7, par8, par9, par10, par11 ) \
typedef struct { \
hcf_16 len; \
hcf_16 typ; \
hcf_16 par1; \
hcf_16 par2; \
hcf_16 par3; \
hcf_16 par4; \
hcf_16 par5; \
hcf_16 par6; \
hcf_16 par7; \
hcf_16 par8; \
hcf_16 par9; \
hcf_16 par10; \
hcf_16 par11; \
} name##_STRCT;
/******************************* Substructure definitions **************************************************/
//apparently not needed (CFG_CNF_COUNTRY)
typedef struct CHANNEL_SET { //channel set structure used in the CFG_CNF_COUNTRY LTV
hcf_16 first_channel;
hcf_16 number_of_channels;
hcf_16 max_tx_output_level;
} CHANNEL_SET;
typedef struct KEY_STRCT { // key structure used in the CFG_DEFAULT_KEYS LTV
hcf_16 len; //length of key
hcf_8 key[14]; //encryption key
} KEY_STRCT;
typedef struct SCAN_RS_STRCT { // Scan Result structure used in the CFG_SCAN LTV
hcf_16 channel_id;
hcf_16 noise_level;
hcf_16 signal_level;
hcf_8 bssid[6];
hcf_16 beacon_interval_time;
hcf_16 capability;
hcf_16 ssid_len;
hcf_8 ssid_val[32];
} SCAN_RS_STRCT;
typedef struct CFG_RANGE_SPEC_STRCT { // range specification structure used in CFG_RANGES, CFG_RANGE1 etc
hcf_16 variant;
hcf_16 bottom;
hcf_16 top;
} CFG_RANGE_SPEC_STRCT;
typedef struct CFG_RANGE_SPEC_BYTE_STRCT { // byte oriented range specification structure used in CFG_RANGE_B LTV
hcf_8 variant[2];
hcf_8 bottom[2];
hcf_8 top[2];
} CFG_RANGE_SPEC_BYTE_STRCT;
//used to set up "T" functionality for Info frames, i.e. log info frames in MSF supplied buffer and MailBox
XX1( RID_LOG, unsigned short FAR*, bufp )
typedef RID_LOG_STRCT FAR *RID_LOGP;
XX1( CFG_RID_LOG, RID_LOGP, recordp )
X1( LTV, val[1] ) /*minimum LTV proto typ */
X1( LTV_MAX, val[HCF_MAX_LTV] ) /*maximum LTV proto typ */
XX2( CFG_REG_MB, hcf_16* , mb_addr, hcf_16, mb_size )
typedef struct CFG_MB_INFO_FRAG { // specification of buffer fragment
unsigned short FAR* frag_addr;
hcf_16 frag_len;
} CFG_MB_INFO_FRAG;
/* Mail Box Info Block structures,
* the base form: CFG_MB_INFO_STRCT
* and the derived forms: CFG_MB_INFO_RANGE<n>_STRCT with n is 1, 2, 3 or 20
* predefined for a payload of 1, and up to 2, 3 and 20 CFG_MB_INFO_FRAG elements */
XX3( CFG_MB_INFO, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
XX3( CFG_MB_INFO_RANGE1, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
XX3( CFG_MB_INFO_RANGE2, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 2] )
XX3( CFG_MB_INFO_RANGE3, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 3] )
XX3( CFG_MB_INFO_RANGE20, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[20] )
XX3( CFG_MB_ASSERT, hcf_16, line, hcf_16, trace, hcf_32, qualifier ) /*MBInfoBlock for asserts */
#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
typedef void (MSF_ASSERT_RTN)( unsigned int , hcf_16, hcf_32 );
typedef MSF_ASSERT_RTN /*can't link FAR*/ * MSF_ASSERT_RTNP;
/* CFG_REG_ASSERT_RTNP (0x0832) (de-)register MSF Callback routines
* lvl: Assert level filtering (not yet implemented)
* rtnp: address of MSF_ASSERT_RTN (native Endian format) */
XX2( CFG_REG_ASSERT_RTNP, hcf_16, lvl, MSF_ASSERT_RTNP, rtnp )
#endif // HCF_ASSERT_LNK_MSF_RTN / HCF_ASSERT_RT_MSF_RTN
X1( CFG_HCF_OPT, val[20] ) /*(Compile time) options */
X3( CFG_CMD_HCF, cmd, mode, add_info ) /*HCF Engineering command */
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_16 mode; // PROG_STOP/VOLATILE [FLASH/SEEPROM/SEEPROM_READBACK]
hcf_16 segment_size; // size of the segment in bytes
hcf_32 nic_addr; // destination address (in NIC memory)
hcf_16 flags; // 0x0001 : CRC Yes/No
// hcf_32 flags; // 0x0001 : CRC Yes/No
/* ;? still not the whole story
* flags is extended from 16 to 32 bits to force that compiling FW.C produces the same structures
* in memory as FUPU4 BIN files.
* Note that the problem arises from the violation of the constraint to use packing at byte boundaries
* as was stipulated in the WCI-specification
* The Pack pragma can't resolve this issue, because that impacts all members of the structure with
* disregard of their actual size, so aligning host_addr under MSVC 1.5 at 4 bytes, also aligns
* len, typ etc on 4 bytes
* */
// hcf_16 pad; //!! be careful alignment problems for Bin download versus C download
hcf_8 FAR *host_addr; // source address (in Host memory)
} CFG_PROG_STRCT; // segment_descp;
// a structure used for transporting debug-related information from firmware
// via the HCF, into the MSF
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_16 msg_id, msg_par, msg_tstamp;
} CFG_FW_PRINTF_STRCT;
// a structure used to define the location and size of a certain debug-related
// buffer in nic-ram.
typedef struct {
hcf_16 len;
hcf_16 typ;
hcf_32 DbMsgCount, // ds (nicram) address of a counter
DbMsgBuffer, // ds (nicram) address of the buffer
DbMsgSize, // number of entries (each 3 word in size) in this buffer
DbMsgIntrvl; // ds (nicram) address of interval for generating InfDrop event
} CFG_FW_PRINTF_BUFFER_LOCATION_STRCT;
XX3( CFG_RANGES, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
XX3( CFG_RANGE1, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
XX3( CFG_RANGE2, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 2] ) /*Actor range ( 2 variants) */
XX3( CFG_RANGE3, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 3] ) /*Actor range ( 3 variants) */
XX3( CFG_RANGE4, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 4] ) /*Actor range ( 4 variants) */
XX3( CFG_RANGE5, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 5] ) /*Actor range ( 5 variants) */
XX3( CFG_RANGE6, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 6] ) /*Actor range ( 6 variants) */
XX3( CFG_RANGE7, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 7] ) /*Actor range ( 7 variants) */
XX3( CFG_RANGE20, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[20] ) /*Actor range (20 variants) */
/*Frames */
X3( CFG_ASSOC_STAT, assoc_stat, station_addr[3], val[46] ) /*Association status, basic */
X2( CFG_ASSOC_STAT3, assoc_stat, station_addr[3] ) /*assoc_stat:3 */
X3( CFG_ASSOC_STAT1, assoc_stat, station_addr[3], frame_body[43] ) /*assoc_stat:1 */
X4( CFG_ASSOC_STAT2, assoc_stat, station_addr[3], old_ap_addr[3], frame_body[43] ) /*assoc_stat:2 */
/*Static Configurations */
X1( CFG_CNF_PORT_TYPE, port_type ) /*[STA] Connection control characteristics */
X1( CFG_MAC_ADDR, mac_addr[3] ) /*general: FC01,FC08,FC11,FC12,FC13,FC14,FC15,FC16 */
X1( CFG_CNF_OWN_MAC_ADDR, mac_addr[3] )
X1( CFG_ID, ssid[17] ) /*0xFC02, 0xFC04, 0xFC0E */
/* X1( CFG_DESIRED_SSID, ssid[17] ) see Dynamic Configurations */
X1( CFG_CNF_OWN_CHANNEL, channel ) /*Communication channel for BSS creation */
X1( CFG_CNF_OWN_SSID, ssid[17] )
X1( CFG_CNF_OWN_ATIM_WINDOW, atim_window )
X1( CFG_CNF_SYSTEM_SCALE, system_scale )
X1( CFG_CNF_MAX_DATA_LEN, max_data_len )
X1( CFG_CNF_WDS_ADDR, mac_addr[3] ) /*[STA] MAC Address of corresponding WDS Link node */
X1( CFG_CNF_PM_ENABLED, pm_enabled ) /*[STA] Switch for ESS Power Management (PM) On/Off */
X1( CFG_CNF_PM_EPS, pm_eps ) /*[STA] Switch for ESS PM EPS/PS Mode */
X1( CFG_CNF_MCAST_RX, mcast_rx ) /*[STA] Switch for ESS PM Multicast reception On/Off */
X1( CFG_CNF_MAX_SLEEP_DURATION, duration ) /*[STA] Maximum sleep time for ESS PM */
X1( CFG_CNF_PM_HOLDOVER_DURATION, duration ) /*[STA] Holdover time for ESS PM */
X1( CFG_CNF_OWN_NAME, ssid[17] ) /*Identification text for diagnostic purposes */
X1( CFG_CNF_OWN_DTIM_PERIOD, period ) /*[AP] Beacon intervals between successive DTIMs */
X1( CFG_CNF_WDS_ADDR1, mac_addr[3] ) /*[AP] Port 1 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR2, mac_addr[3] ) /*[AP] Port 2 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR3, mac_addr[3] ) /*[AP] Port 3 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR4, mac_addr[3] ) /*[AP] Port 4 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR5, mac_addr[3] ) /*[AP] Port 5 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_WDS_ADDR6, mac_addr[3] ) /*[AP] Port 6 MAC Adrs of corresponding WDS Link node */
X1( CFG_CNF_MCAST_PM_BUF, mcast_pm_buf ) /*[AP] Switch for PM buffering of Multicast Messages */
X1( CFG_CNF_REJECT_ANY, reject_any ) /*[AP] Switch for PM buffering of Multicast Messages */
//X1( CFG_CNF_ENCRYPTION_ENABLED, encryption ) /*specify encryption type of Tx/Rx messages */
X1( CFG_CNF_ENCRYPTION, encryption ) /*specify encryption type of Tx/Rx messages */
X1( CFG_CNF_AUTHENTICATION, authentication ) /*selects Authentication algorithm */
X1( CFG_CNF_EXCL_UNENCRYPTED, exclude_unencrypted ) /*[AP] Switch for 'clear-text' rx message acceptance */
X1( CFG_CNF_MCAST_RATE, mcast_rate ) /*Transmit Data rate for Multicast frames */
X1( CFG_CNF_INTRA_BSS_RELAY, intra_bss_relay ) /*[AP] Switch for IntraBBS relay */
X1( CFG_CNF_MICRO_WAVE, micro_wave ) /*MicroWave (Robustness) */
X1( CFG_CNF_LOAD_BALANCING, load_balancing ) /*Load Balancing (Boolean, 0=OFF, 1=ON, default=1) */
X1( CFG_CNF_MEDIUM_DISTRIBUTION, medium_distribution ) /*Medium Distribution (Boolean, 0=OFF, 1=ON, default=1) */
X1( CFG_CNF_GROUP_ADDR_FILTER, group_addr_filter ) /*Group Address Filter */
X1( CFG_CNF_TX_POW_LVL, tx_pow_lvl ) /*Tx Power Level */
XX4( CFG_CNF_COUNTRY_INFO, \
hcf_16, n_channel_sets, hcf_16, country_code[2], \
hcf_16, environment, CHANNEL_SET, channel_set[1] ) /*Current Country Info */
XX4( CFG_CNF_COUNTRY_INFO_MAX, \
hcf_16, n_channel_sets, hcf_16, country_code[2], \
hcf_16, environment, CHANNEL_SET, channel_set[14]) /*Current Country Info */
/*Dynamic Configurations */
X1( CFG_DESIRED_SSID, ssid[17] ) /*[STA] Service Set identification for connection */
#define GROUP_ADDR_SIZE (32 * 6) //32 6-byte MAC-addresses
X1( CFG_GROUP_ADDR, mac_addr[GROUP_ADDR_SIZE/2] ) /*[STA] Multicast MAC Addresses for Rx-message */
X1( CFG_CREATE_IBSS, create_ibss ) /*[STA] Switch for IBSS creation On/Off */
X1( CFG_RTS_THRH, rts_thrh ) /*[STA] Frame length used for RTS/CTS handshake */
X1( CFG_TX_RATE_CNTL, tx_rate_cntl ) /*[STA] Data rate control for message transmission */
X1( CFG_PROMISCUOUS_MODE, promiscuous_mode ) /*[STA] Switch for Promiscuous mode reception On/Of */
X1( CFG_WOL, wake_on_lan ) /*[STA] Switch for Wake-On-LAN mode */
X1( CFG_RTS_THRH0, rts_thrh ) /*[AP] Port 0 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH1, rts_thrh ) /*[AP] Port 1 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH2, rts_thrh ) /*[AP] Port 2 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH3, rts_thrh ) /*[AP] Port 3 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH4, rts_thrh ) /*[AP] Port 4 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH5, rts_thrh ) /*[AP] Port 5 frame length for RTS/CTS handshake */
X1( CFG_RTS_THRH6, rts_thrh ) /*[AP] Port 6 frame length for RTS/CTS handshake */
X1( CFG_TX_RATE_CNTL0, rate_cntl ) /*[AP] Port 0 data rate control for transmission */
X1( CFG_TX_RATE_CNTL1, rate_cntl ) /*[AP] Port 1 data rate control for transmission */
X1( CFG_TX_RATE_CNTL2, rate_cntl ) /*[AP] Port 2 data rate control for transmission */
X1( CFG_TX_RATE_CNTL3, rate_cntl ) /*[AP] Port 3 data rate control for transmission */
X1( CFG_TX_RATE_CNTL4, rate_cntl ) /*[AP] Port 4 data rate control for transmission */
X1( CFG_TX_RATE_CNTL5, rate_cntl ) /*[AP] Port 5 data rate control for transmission */
X1( CFG_TX_RATE_CNTL6, rate_cntl ) /*[AP] Port 6 data rate control for transmission */
XX1( CFG_DEFAULT_KEYS, KEY_STRCT, key[4] ) /*defines set of encryption keys */
X1( CFG_TX_KEY_ID, tx_key_id ) /*select key for encryption of Tx messages */
X1( CFG_SCAN_SSID, ssid[17] ) /*identification for connection */
X5( CFG_ADD_TKIP_DEFAULT_KEY, \
tkip_key_id_info, tkip_key_iv_info[4], tkip_key[8], \
tx_mic_key[4], rx_mic_key[4] ) /* */
X6( CFG_ADD_TKIP_MAPPED_KEY, bssid[3], tkip_key[8], \
tsc[4], rsc[4], tx_mic_key[4], rx_mic_key[4] ) /* */
X1( CFG_SET_SSN_AUTHENTICATION_SUITE, \
ssn_authentication_suite ) /* */
X1( CFG_REMOVE_TKIP_DEFAULT_KEY,tkip_key_id ) /* */
X1( CFG_TICK_TIME, tick_time ) /*Auxiliary Timer tick interval */
X1( CFG_DDS_TICK_TIME, tick_time ) /*Disconnected DeepSleep Timer tick interval */
/**********************************************************************
* Added for Pattern-matching WakeOnLan. (See firmware design note WMDN281C)
**********************************************************************/
#define WOL_PATTERNS 5 // maximum of 5 patterns in firmware
#define WOL_PATTERN_LEN 124 // maximum 124 bytes pattern length per pattern in firmware
#define WOL_MASK_LEN 30 // maximum 30 bytes mask length per pattern in firmware
#define WOL_BUF_SIZE (WOL_PATTERNS * (WOL_PATTERN_LEN + WOL_MASK_LEN + 6) / 2)
X2( CFG_WOL_PATTERNS, nPatterns, buffer[WOL_BUF_SIZE] ) /*[STA] WakeOnLan pattern match, room for 5 patterns*/
X5( CFG_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
/* NIC Information */
X4( CFG_IDENTITY, comp_id, variant, version_major, version_minor ) /*identification Prototype */
#define CFG_DRV_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_PRI_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_NIC_IDENTITY_STRCT CFG_IDENTITY_STRCT
#define CFG_FW_IDENTITY_STRCT CFG_IDENTITY_STRCT
X1( CFG_RID_INF_MIN, y ) /*lowest value representing an Information RID */
X1( CFG_MAX_LOAD_TIME, max_load_time ) /*[PRI] Max response time of the Download command */
X3( CFG_DL_BUF, buf_page, buf_offset, buf_len ) /*[PRI] Download buffer location and size */
// X5( CFG_PRI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
X5( CFG_CFI_ACT_RANGES_PRI,role, id, variant, bottom, top ) /*[PRI] Controller Actor compatibility ranges */
// X5( CFG_NIC_HSI_SUP_RANGE, role, id, variant, bottom, top ) /*H/W - S/W I/F supplier range */
X1( CFG_NIC_SERIAL_NUMBER, serial_number[17] ) /*[PRI] Network I/F Card serial number */
X5( CFG_NIC_MFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Modem I/F Supplier compatibility range */
X5( CFG_NIC_CFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Controller I/F Supplier compatibility range*/
//H-I X1( CFG_CHANNEL_LIST, channel_list ) /*Allowed communication channels */
//H-I XX2( CFG_REG_DOMAINS, hcf_16, num_domain, hcf_8, reg_domains[10] ) /*List of intended regulatory domains */
X1( CFG_NIC_TEMP_TYPE, temp_type ) /*Hardware temperature range code */
//H-I X1( CFG_CIS, cis[240] ) /*PC Card Standard Card Information Structure */
X5( CFG_NIC_PROFILE, \
profile_code, capability_options, allowed_data_rates, val4, val5 ) /*Card Profile */
// X5( CFG_FW_SUP_RANGE, role, id, variant, bottom, top ) /*[STA] Station I/F Supplier compatibility range */
X5( CFG_MFI_ACT_RANGES, role, id, variant, bottom, top ) /*[STA] Modem I/F Actor compatibility ranges */
X5( CFG_CFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
X5( CFG_MFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
X1( CFG_NIC_BUS_TYPE, nic_bus_type ) /*NIC bustype derived from BUSSEL host I/F signals */
/* MAC INFORMATION */
X1( CFG_PORT_STAT, port_stat ) /*[STA] Actual MAC Port connection control status */
X1( CFG_CUR_SSID, ssid[17] ) /*[STA] Identification of the actually connected SS */
X1( CFG_CUR_BSSID, mac_addr[3] ) /*[STA] Identification of the actually connected BSS */
X3( CFG_COMMS_QUALITY, coms_qual, signal_lvl, noise_lvl ) /*[STA] Quality of the Basic Service Set connection */
X1( CFG_CUR_TX_RATE, rate ) /*[STA] Actual transmit data rate */
X1( CFG_CUR_BEACON_INTERVAL, interval ) /*Beacon transmit interval time for BSS creation */
#if (HCF_TYPE) & HCF_TYPE_WARP
X11( CFG_CUR_SCALE_THRH, \
carrier_detect_thrh_cck, carrier_detect_thrh_ofdm, defer_thrh, \
energy_detect_thrh, rssi_on_thrh_deviation, \
rssi_off_thrh_deviation, cck_drop_thrh, ofdm_drop_thrh, \
cell_search_thrh, out_of_range_thrh, delta_snr )
#else
X6( CFG_CUR_SCALE_THRH, \
energy_detect_thrh, carrier_detect_thrh, defer_thrh, \
cell_search_thrh, out_of_range_thrh, delta_snr ) /*Actual System Scale thresholds settings */
#endif // HCF_TYPE_WARP
X1( CFG_PROTOCOL_RSP_TIME, time ) /*Max time to await a response to a request message */
X1( CFG_CUR_SHORT_RETRY_LIMIT, limit ) /*Max number of transmit attempts for short frames */
X1( CFG_CUR_LONG_RETRY_LIMIT, limit ) /*Max number of transmit attempts for long frames */
X1( CFG_MAX_TX_LIFETIME, time ) /*Max transmit frame handling duration */
X1( CFG_MAX_RX_LIFETIME, time ) /*Max received frame handling duration */
X1( CFG_CF_POLLABLE, cf_pollable ) /*[STA] Contention Free pollable capability indication */
X2( CFG_AUTHENTICATION_ALGORITHMS,authentication_type, type_enabled ) /*Authentication Algorithm */
X1( CFG_PRIVACY_OPT_IMPLEMENTED,privacy_opt_implemented ) /*WEP Option availability indication */
X1( CFG_CUR_REMOTE_RATES, rates ) /*CurrentRemoteRates */
X1( CFG_CUR_USED_RATES, rates ) /*CurrentUsedRates */
X1( CFG_CUR_SYSTEM_SCALE, current_system_scale ) /*CurrentUsedRates */
X1( CFG_CUR_TX_RATE1, rate ) /*[AP] Actual Port 1 transmit data rate */
X1( CFG_CUR_TX_RATE2, rate ) /*[AP] Actual Port 2 transmit data rate */
X1( CFG_CUR_TX_RATE3, rate ) /*[AP] Actual Port 3 transmit data rate */
X1( CFG_CUR_TX_RATE4, rate ) /*[AP] Actual Port 4 transmit data rate */
X1( CFG_CUR_TX_RATE5, rate ) /*[AP] Actual Port 5 transmit data rate */
X1( CFG_CUR_TX_RATE6, rate ) /*[AP] Actual Port 6 transmit data rate */
X1( CFG_OWN_MAC_ADDR, mac_addr[3] ) /*[AP] Unique local node MAC Address */
X3( CFG_PCF_INFO, medium_occupancy_limit, \
cfp_period, cfp_max_duration ) /*[AP] Point Coordination Function capability info */
X1( CFG_CUR_SSN_INFO_ELEMENT, ssn_info_element[1] ) /* */
X4( CFG_CUR_TKIP_IV_INFO, \
tkip_seq_cnt0[4], tkip_seq_cnt1[4], \
tkip_seq_cnt2[4], tkip_seq_cnt3[4] ) /* */
X2( CFG_CUR_ASSOC_REQ_INFO, frame_type, frame_body[1] ) /* 0xFD8C */
X2( CFG_CUR_ASSOC_RESP_INFO, frame_type, frame_body[1] ) /* 0xFD8D */
/* Modem INFORMATION */
X1( CFG_PHY_TYPE, phy_type ) /*Physical layer type indication */
X1( CFG_CUR_CHANNEL, current_channel ) /*Actual frequency channel used for transmission */
X1( CFG_CUR_POWER_STATE, current_power_state ) /*Actual power consumption status */
X1( CFG_CCAMODE, cca_mode ) /*Clear channel assessment mode indication */
X1( CFG_SUPPORTED_DATA_RATES, rates[5] ) /*Data rates capability information */
/* FRAMES */
XX1( CFG_SCAN, SCAN_RS_STRCT, scan_result[32] ) /*Scan results */
//--------------------------------------------------------------------------------------
// UIL management function to be passed to WaveLAN/IEEE Drivers in DUI_STRCT field fun
//--------------------------------------------------------------------------------------
// HCF and UIL Common
#define MDD_ACT_SCAN 0x06 // Hermes Inquire Scan (F101) command
#define MDD_ACT_PRS_SCAN 0x07 // Hermes Probe Response Scan (F102) command
// UIL Specific
#define UIL_FUN_CONNECT 0x00 // Perform connect command
#define UIL_FUN_DISCONNECT 0x01 // Perform disconnect command
#define UIL_FUN_ACTION 0x02 // Perform UIL Action command.
#define UIL_FUN_SEND_DIAG_MSG 0x03 // Send a diagnostic message.
#define UIL_FUN_GET_INFO 0x04 // Retrieve information from NIC.
#define UIL_FUN_PUT_INFO 0x05 // Put information on NIC.
/* UIL_ACT_TALLIES 0x05 * this should not be exported to the USF
* it is solely intended as a strategic choice for the MSF to either
* - use HCF_ACT_TALLIES and direct IFB access
* - use CFG_TALLIES
*/
#define UIL_ACT_SCAN MDD_ACT_SCAN
#define UIL_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
#define UIL_ACT_BLOCK 0x0B
#define UIL_ACT_UNBLOCK 0x0C
#define UIL_ACT_RESET 0x80
#define UIL_ACT_REBIND 0x81
#define UIL_ACT_APPLY 0x82
#define UIL_ACT_DISCONNECT 0x83 //;?040108 possibly obsolete //Special for WINCE
// HCF Specific
/* Note that UIL_ACT-codes must match HCF_ACT-codes across a run-time bound I/F
* The initial matching is achieved by "#define HCF_ACT_xxx HCF_UIL_ACT_xxx" where appropriate
* In other words, these codes should never, ever change to minimize migration problems between
* combinations of old drivers and new utilities and vice versa
*/
#define HCF_DISCONNECT 0x01 //disconnect request for hcf_connect (invalid as IO Address)
#define HCF_ACT_TALLIES 0x05 // ! UIL_ACT_TALLIES does not exist ! Hermes Inquire Tallies (F100) cmd
#if ( (HCF_TYPE) & HCF_TYPE_WARP ) == 0
#define HCF_ACT_SCAN MDD_ACT_SCAN
#endif // HCF_TYPE_WARP
#define HCF_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
#if HCF_INT_ON
#define HCF_ACT_INT_OFF 0x0D // Disable Interrupt generation
#define HCF_ACT_INT_ON 0x0E // Enable Interrupt generation
#define HCF_ACT_INT_FORCE_ON 0x0F // Enforce Enable Interrupt generation
#endif // HCF_INT_ON
#define HCF_ACT_RX_ACK 0x15 // Receiever ACK (optimization)
#if (HCF_TYPE) & HCF_TYPE_CCX
#define HCF_ACT_CCX_ON 0x1A // enable CKIP
#define HCF_ACT_CCX_OFF 0x1B // disable CKIP
#endif // HCF_TYPE_CCX
#if (HCF_SLEEP) & HCF_DDS
#define HCF_ACT_SLEEP 0x1C // DDS Sleep request
//#define HCF_ACT_WAKEUP 0x1D // DDS Wakeup request
#endif // HCF_DDS
/* HCF_ACT_MAX // xxxx: start value for UIL-range, NOT to be passed to HCF
* Too bad, there was originally no spare room created to use
* HCF_ACT_MAX as an equivalent of HCF_ERR_MAX. Since creating
* this room in retrospect would create a backward incompatibility
* we will just have to live with the haphazard sequence of
* UIL- and HCF specific codes. Theoretically this could be
* corrected when and if there will ever be an overall
* incompatibility introduced for another reason
*/
/*============================================================= HERMES RECORDS ============================*/
#define CFG_RID_FW_MIN 0xFA00 //lowest value representing a Hermes-II based RID
// #define CFG_PDA_BEGIN 0xFA //
// #define CFG_PDA_END 0xFA //
// #define CFG_PDA_NIC_TOP_LVL_ASSEMBLY_NUMBER 0xFA //
// #define CFG_PDA_PCB_TRACER_NUMBER 0xFA //
// #define CFG_PDA_RMM_TRACER_NUMBER 0xFA //
// #define CFG_PDA_RMM_COMP_ID 0xFA //
// #define CFG_PDA_ 0xFA //
/*============================================================= CONFIGURATION RECORDS =====================*/
/*============================================================= mask 0xFCxx =====================*/
#define CFG_RID_CFG_MIN 0xFC00 //lowest value representing a Hermes configuration RID
// NETWORK PARAMETERS, STATIC CONFIGURATION ENTITIES
//FC05, FC0B, FC0C, FC0D: SEE W2DN149
#define CFG_CNF_PORT_TYPE 0xFC00 //[STA] Connection control characteristics
#define CFG_CNF_OWN_MAC_ADDR 0xFC01 //[STA] MAC Address of this node
// 0xFC02 see DYNAMIC CONFIGURATION ENTITIES
#define CFG_CNF_OWN_CHANNEL 0xFC03 //Communication channel for BSS creation
#define CFG_CNF_OWN_SSID 0xFC04 //IBSS creation (STA) or ESS (AP) Service Set Ident
#define CFG_CNF_OWN_ATIM_WINDOW 0xFC05 //[STA] ATIM Window time for IBSS creation
#define CFG_CNF_SYSTEM_SCALE 0xFC06 //System Scale that specifies the AP density
#define CFG_CNF_MAX_DATA_LEN 0xFC07 //Maximum length of MAC Frame Body data
#define CFG_CNF_PM_ENABLED 0xFC09 //[STA] Switch for ESS Power Management (PM)
#define CFG_CNF_MCAST_RX 0xFC0B //[STA] Switch for ESS PM Multicast reception On/Off
#define CFG_CNF_MAX_SLEEP_DURATION 0xFC0C //[STA] Maximum sleep time for ESS PM
#define CFG_CNF_HOLDOVER_DURATION 0xFC0D //[STA] Holdover time for ESS PM
#define CFG_CNF_OWN_NAME 0xFC0E //Identification text for diagnostic purposes
#define CFG_CNF_OWN_DTIM_PERIOD 0xFC10 //[AP] Beacon intervals between successive DTIMs
#define CFG_CNF_WDS_ADDR1 0xFC11 //[AP] Port 1 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR2 0xFC12 //[AP] Port 2 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR3 0xFC13 //[AP] Port 3 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR4 0xFC14 //[AP] Port 4 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR5 0xFC15 //[AP] Port 5 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_WDS_ADDR6 0xFC16 //[AP] Port 6 MAC Adrs of corresponding WDS Link node
#define CFG_CNF_PM_MCAST_BUF 0xFC17 //[AP] Switch for PM buffereing of Multicast Messages
#define CFG_CNF_MCAST_PM_BUF CFG_CNF_PM_MCAST_BUF //name does not match H-II spec
#define CFG_CNF_REJECT_ANY 0xFC18 //[AP] Switch for PM buffereing of Multicast Messages
#define CFG_CNF_ENCRYPTION 0xFC20 //select en/de-cryption of Tx/Rx messages
#define CFG_CNF_AUTHENTICATION 0xFC21 //[STA] selects Authentication algorithm
#define CFG_CNF_EXCL_UNENCRYPTED 0xFC22 //[AP] Switch for 'clear-text' rx message acceptance
#define CFG_CNF_MCAST_RATE 0xFC23 //Transmit Data rate for Multicast frames
#define CFG_CNF_INTRA_BSS_RELAY 0xFC24 //[AP] Switch for IntraBBS relay
#define CFG_CNF_MICRO_WAVE 0xFC25 //MicroWave (Robustness)
#define CFG_CNF_LOAD_BALANCING 0xFC26 //Load Balancing (Boolean, 0=OFF, 1=ON, default=1)
#define CFG_CNF_MEDIUM_DISTRIBUTION 0xFC27 //Medium Distribution (Boolean, 0=OFF, 1=ON, default=1)
#define CFG_CNF_RX_ALL_GROUP_ADDR 0xFC28 //[STA] Group Address Filter
#define CFG_CNF_COUNTRY_INFO 0xFC29 //Country Info
#if (HCF_TYPE) & HCF_TYPE_WARP
#define CFG_CNF_TX_POW_LVL 0xFC2A //TxPower Level
#define CFG_CNF_CONNECTION_CNTL 0xFC30 //[STA] Connection Control
#define CFG_CNF_OWN_BEACON_INTERVAL 0xFC31 //[AP]
#define CFG_CNF_SHORT_RETRY_LIMIT 0xFC32 //
#define CFG_CNF_LONG_RETRY_LIMIT 0xFC33 //
#define CFG_CNF_TX_EVENT_MODE 0xFC34 //
#define CFG_CNF_WIFI_COMPATIBLE 0xFC35 //[STA] Wifi compatible
#endif // HCF_TYPE_WARP
#if (HCF_TYPE) & HCF_TYPE_BEAGLE_HII5
#define CFG_VOICE_RETRY_LIMIT 0xFC36 /* Voice frame retry limit. Range: 1-15, default: 4 */
#define CFG_VOICE_CONTENTION_WINDOW 0xFC37 /* Contention window for voice frames. */
#endif // BEAGLE_HII5
// NETWORK PARAMETERS, DYNAMIC CONFIGURATION ENTITIES
#define CFG_DESIRED_SSID 0xFC02 //[STA] Service Set identification for connection and scan
#define CFG_GROUP_ADDR 0xFC80 //[STA] Multicast MAC Addresses for Rx-message
#define CFG_CREATE_IBSS 0xFC81 //[STA] Switch for IBSS creation On/Off
#define CFG_RTS_THRH 0xFC83 //Frame length used for RTS/CTS handshake
#define CFG_TX_RATE_CNTL 0xFC84 //[STA] Data rate control for message transmission
#define CFG_PROMISCUOUS_MODE 0xFC85 //[STA] Switch for Promiscuous mode reception On/Off
#define CFG_WOL 0xFC86 //[STA] Switch for Wake-On-LAN mode
#define CFG_WOL_PATTERNS 0xFC87 //[STA] Patterns for Wake-On-LAN
#define CFG_SUPPORTED_RATE_SET_CNTL 0xFC88 //
#define CFG_BASIC_RATE_SET_CNTL 0xFC89 //
#define CFG_SOFTWARE_ACK_MODE 0xFC90 //
#define CFG_RTS_THRH0 0xFC97 //[AP] Port 0 frame length for RTS/CTS handshake
#define CFG_RTS_THRH1 0xFC98 //[AP] Port 1 frame length for RTS/CTS handshake
#define CFG_RTS_THRH2 0xFC99 //[AP] Port 2 frame length for RTS/CTS handshake
#define CFG_RTS_THRH3 0xFC9A //[AP] Port 3 frame length for RTS/CTS handshake
#define CFG_RTS_THRH4 0xFC9B //[AP] Port 4 frame length for RTS/CTS handshake
#define CFG_RTS_THRH5 0xFC9C //[AP] Port 5 frame length for RTS/CTS handshake
#define CFG_RTS_THRH6 0xFC9D //[AP] Port 6 frame length for RTS/CTS handshake
#define CFG_TX_RATE_CNTL0 0xFC9E //[AP] Port 0 data rate control for transmission
#define CFG_TX_RATE_CNTL1 0xFC9F //[AP] Port 1 data rate control for transmission
#define CFG_TX_RATE_CNTL2 0xFCA0 //[AP] Port 2 data rate control for transmission
#define CFG_TX_RATE_CNTL3 0xFCA1 //[AP] Port 3 data rate control for transmission
#define CFG_TX_RATE_CNTL4 0xFCA2 //[AP] Port 4 data rate control for transmission
#define CFG_TX_RATE_CNTL5 0xFCA3 //[AP] Port 5 data rate control for transmission
#define CFG_TX_RATE_CNTL6 0xFCA4 //[AP] Port 6 data rate control for transmission
#define CFG_DEFAULT_KEYS 0xFCB0 //defines set of encryption keys
#define CFG_TX_KEY_ID 0xFCB1 //select key for encryption of Tx messages
#define CFG_SCAN_SSID 0xFCB2 //Scan SSID
#define CFG_ADD_TKIP_DEFAULT_KEY 0xFCB4 //set KeyID and TxKey indication
#define KEY_ID 0x0003 //KeyID mask for tkip_key_id_info field
#define TX_KEY 0x8000 //Default Tx Key flag of tkip_key_id_info field
#define CFG_SET_WPA_AUTH_KEY_MGMT_SUITE 0xFCB5 //Authenticated Key Management Suite
#define CFG_REMOVE_TKIP_DEFAULT_KEY 0xFCB6 //invalidate KeyID and TxKey indication
#define CFG_ADD_TKIP_MAPPED_KEY 0xFCB7 //set MAC address pairwise station
#define CFG_REMOVE_TKIP_MAPPED_KEY 0xFCB8 //invalidate MAC address pairwise station
#define CFG_SET_WPA_CAPABILITIES_INFO 0xFCB9 //WPA Capabilities
#define CFG_CACHED_PMK_ADDR 0xFCBA //set MAC address of pre-authenticated AP
#define CFG_REMOVE_CACHED_PMK_ADDR 0xFCBB //invalidate MAC address of pre-authenticated AP
#define CFG_FCBC 0xFCBC //FW codes ahead of available documentation, so ???????
#define CFG_FCBD 0xFCBD //FW codes ahead of available documentation, so ???????
#define CFG_FCBE 0xFCBE //FW codes ahead of available documentation, so ???????
#define CFG_FCBF 0xFCBF //FW codes ahead of available documentation, so ???????
#define CFG_HANDOVER_ADDR 0xFCC0 //[AP] Station MAC Adrress re-associated with other AP
#define CFG_SCAN_CHANNEL 0xFCC2 //Channel set for host requested scan
//;?#define CFG_SCAN_CHANNEL_MASK 0xFCC2 // contains
#define CFG_DISASSOCIATE_ADDR 0xFCC4 //[AP] Station MAC Adrress to be disassociated
#define CFG_PROBE_DATA_RATE 0xFCC5 //WARP connection control
#define CFG_FRAME_BURST_LIMIT 0xFCC6 //
#define CFG_COEXISTENSE_BEHAVIOUR 0xFCC7 //[AP]
#define CFG_DEAUTHENTICATE_ADDR 0xFCC8 //MAC address of Station to be deauthenticated
// BEHAVIOR PARAMETERS
#define CFG_TICK_TIME 0xFCE0 //Auxiliary Timer tick interval
#define CFG_DDS_TICK_TIME 0xFCE1 //Disconnected DeepSleep Timer tick interval
//#define CFG_CNF_COUNTRY 0xFCFE apparently not needed ;?
#define CFG_RID_CFG_MAX 0xFCFF //highest value representing an Configuration RID
/*============================================================= INFORMATION RECORDS =====================*/
/*============================================================= mask 0xFDxx =====================*/
// NIC INFORMATION
#define CFG_RID_INF_MIN 0xFD00 //lowest value representing an Information RID
#define CFG_MAX_LOAD_TIME 0xFD00 //[INT] Maximum response time of the Download command.
#define CFG_DL_BUF 0xFD01 //[INT] Download buffer location and size.
#define CFG_PRI_IDENTITY 0xFD02 //[PRI] Primary Functions firmware identification.
#define CFG_PRI_SUP_RANGE 0xFD03 //[PRI] Primary Functions I/F Supplier compatibility range.
#define CFG_NIC_HSI_SUP_RANGE 0xFD09 //H/W - S/W I/F supplier range
#define CFG_NIC_SERIAL_NUMBER 0xFD0A //[PRI] Network Interface Card serial number.
#define CFG_NIC_IDENTITY 0xFD0B //[PRI] Network Interface Card identification.
#define CFG_NIC_MFI_SUP_RANGE 0xFD0C //[PRI] Modem I/F Supplier compatibility range.
#define CFG_NIC_CFI_SUP_RANGE 0xFD0D //[PRI] Controller I/F Supplier compatibility range.
#define CFG_CHANNEL_LIST 0xFD10 //Allowed communication channels.
#define CFG_NIC_TEMP_TYPE 0xFD12 //Hardware temperature range code.
#define CFG_CIS 0xFD13 //PC Card Standard Card Information Structure
#define CFG_NIC_PROFILE 0xFD14 //Card Profile
#define CFG_FW_IDENTITY 0xFD20 //firmware identification.
#define CFG_FW_SUP_RANGE 0xFD21 //firmware Supplier compatibility range.
#define CFG_MFI_ACT_RANGES_STA 0xFD22 //[STA] Modem I/F Actor compatibility ranges.
#define CFG_CFI_ACT_RANGES_STA 0xFD23 //[STA] Controller I/F Actor compatibility ranges.
#define CFG_NIC_BUS_TYPE 0xFD24 //Card Bustype
#define CFG_NIC_BUS_TYPE_PCCARD_CF 0x0000 //16 bit PC Card or Compact Flash
#define CFG_NIC_BUS_TYPE_USB 0x0001 //USB
#define CFG_NIC_BUS_TYPE_CARDBUS 0x0002 //CardBus
#define CFG_NIC_BUS_TYPE_PCI 0x0003 //(mini)PCI
#define CFG_DOMAIN_CODE 0xFD25
// MAC INFORMATION
#define CFG_PORT_STAT 0xFD40 //Actual MAC Port connection control status
#define CFG_CUR_SSID 0xFD41 //[STA] Identification of the actually connected SS
#define CFG_CUR_BSSID 0xFD42 //[STA] Identification of the actually connected BSS
#define CFG_COMMS_QUALITY 0xFD43 //[STA] Quality of the Basic Service Set connection
#define CFG_CUR_TX_RATE 0xFD44 //[STA] Actual transmit data rate
#define CFG_CUR_BEACON_INTERVAL 0xFD45 //Beacon transmit interval time for BSS creation
#define CFG_CUR_SCALE_THRH 0xFD46 //Actual System Scale thresholds settings
#define CFG_PROTOCOL_RSP_TIME 0xFD47 //Max time to await a response to a request message
#define CFG_CUR_SHORT_RETRY_LIMIT 0xFD48 //Max number of transmit attempts for short frames
#define CFG_CUR_LONG_RETRY_LIMIT 0xFD49 //Max number of transmit attempts for long frames
#define CFG_MAX_TX_LIFETIME 0xFD4A //Max transmit frame handling duration
#define CFG_MAX_RX_LIFETIME 0xFD4B //Max received frame handling duration
#define CFG_CF_POLLABLE 0xFD4C //[STA] Contention Free pollable capability indication
#define CFG_AUTHENTICATION_ALGORITHMS 0xFD4D //Available Authentication Algorithms indication
#define CFG_PRIVACY_OPT_IMPLEMENTED 0xFD4F //WEP Option availability indication
#define CFG_CUR_REMOTE_RATES 0xFD50 //[STA] CurrentRemoteRates
#define CFG_CUR_USED_RATES 0xFD51 //[STA] CurrentUsedRates
#define CFG_CUR_SYSTEM_SCALE 0xFD52 //[STA] CurrentSystemScale
#define CFG_CUR_TX_RATE1 0xFD80 //[AP] Actual Port 1 transmit data rate
#define CFG_CUR_TX_RATE2 0xFD81 //[AP] Actual Port 2 transmit data rate
#define CFG_CUR_TX_RATE3 0xFD82 //[AP] Actual Port 3 transmit data rate
#define CFG_CUR_TX_RATE4 0xFD83 //[AP] Actual Port 4 transmit data rate
#define CFG_CUR_TX_RATE5 0xFD84 //[AP] Actual Port 5 transmit data rate
#define CFG_CUR_TX_RATE6 0xFD85 //[AP] Actual Port 6 transmit data rate
#define CFG_NIC_MAC_ADDR 0xFD86 //Unique local node MAC Address
#define CFG_PCF_INFO 0xFD87 //[AP] Point Coordination Function capability info
//*RESERVED* #define CFG_HIGHEST_BASIC_RATE 0xFD88 //
#define CFG_CUR_COUNTRY_INFO 0xFD89 //
#define CFG_CUR_SSN_INFO_ELEMENT 0xFD8A //
#define CFG_CUR_TKIP_IV_INFO 0xFD8B //
#define CFG_CUR_ASSOC_REQ_INFO 0xFD8C //
#define CFG_CUR_ASSOC_RESP_INFO 0xFD8D //
#define CFG_CUR_LOAD 0xFD8E //[AP] current load on AP's channel
#define CFG_SECURITY_CAPABILITIES 0xFD90 //Combined capabilities information
// MODEM INFORMATION
#define CFG_PHY_TYPE 0xFDC0 //Physical layer type indication
#define CFG_CUR_CHANNEL 0xFDC1 //Actual frequency channel used for transmission
#define CFG_CUR_POWER_STATE 0xFDC2 //Actual power consumption status
#define CFG_CCA_MODE 0xFDC3 //Clear channel assessment mode indication
#define CFG_SUPPORTED_DATA_RATES 0xFDC6 //Data rates capability information
#define CFG_RID_INF_MAX 0xFDFF //highest value representing an Information RID
// ENGINEERING INFORMATION
#define CFG_RID_ENG_MIN 0xFFE0 //lowest value representing a Hermes engineering RID
/****************************** General define *************************************************************/
//IFB field related
// IFB_CardStat
#define CARD_STAT_INCOMP_PRI 0x2000U // no compatible HSI / primary F/W
#define CARD_STAT_INCOMP_FW 0x1000U // no compatible station / tertiary F/W
#define CARD_STAT_DEFUNCT 0x0100U // HCF is in Defunct mode
// IFB_RxStat
#define RX_STAT_PRIO 0x00E0U //Priority subfield
#define RX_STAT_ERR 0x000FU //Error mask
#define RX_STAT_UNDECR 0x0002U //Non-decryptable encrypted message
#define RX_STAT_FCS_ERR 0x0001U //FCS error
// SNAP header for E-II Encapsulation
#define ENC_NONE 0xFF
#define ENC_1042 0x00
#define ENC_TUNNEL 0xF8
/****************************** Xxxxxxxx *******************************************************************/
#define HCF_SUCCESS 0x00 // OK
#define HCF_ERR_TIME_OUT 0x04 // Expected Hermes event did not occure in expected time
#define HCF_ERR_NO_NIC 0x05 /* card not found (usually yanked away during hcfio_in_string
* Also: card is either absent or disabled while it should be neither */
#define HCF_ERR_LEN 0x08 /* buffer size insufficient
* - IFB_ConfigTable too small
* - hcf_get_info buffer has a size of 0 or 1 or less than needed
* to accomodate all data
* - hcf_put_info: CFG_DLNV_DATA exceeds intermediate
* buffer size */
#define HCF_ERR_INCOMP_PRI 0x09 // primary functions are not compatible
#define HCF_ERR_INCOMP_FW 0x0A // station functions are compatible
#define HCF_ERR_MIC 0x0D // MIC check fails
#define HCF_ERR_SLEEP 0x0E // NIC in sleep mode
#define HCF_ERR_MAX 0x3F /* end of HCF range
*** ** *** ****** *** *************** */
#define HCF_ERR_DEFUNCT 0x80 // BIT, reflecting that the HCF is in defunct mode (bits 0x7F reflect cause)
#define HCF_ERR_DEFUNCT_AUX 0x82 // Timeout on acknowledgement on en/disabling AUX registers
#define HCF_ERR_DEFUNCT_TIMER 0x83 // Timeout on timer calibration during initialization process
#define HCF_ERR_DEFUNCT_TIME_OUT 0x84 // Timeout on Busy bit drop during BAP setup
#define HCF_ERR_DEFUNCT_CMD_SEQ 0x86 // Hermes and HCF are out of sync in issuing/processing commands
#define HCF_INT_PENDING 0x01 // return status of hcf_act( HCF_ACT_INT_OFF )
#define HCF_PORT_0 0x0000 // Station supports only single MAC Port
#define HCF_PORT_1 0x0100 // HCF_PORT_1 through HCF_PORT_6 are only supported by AP F/W
#define HCF_PORT_2 0x0200
#define HCF_PORT_3 0x0300
#define HCF_PORT_4 0x0400
#define HCF_PORT_5 0x0500
#define HCF_PORT_6 0x0600
#define HCF_CNTL_ENABLE 0x01
#define HCF_CNTL_DISABLE 0x02
#define HCF_CNTL_CONNECT 0x03
#define HCF_CNTL_DISCONNECT 0x05
#define HCF_CNTL_CONTINUE 0x07
#define USE_DMA 0x0001
#define USE_16BIT 0x0002
#define DMA_ENABLED 0x8000 //weak name, it really means: F/W enabled and DMA selected
//#define HCF_DMA_FD_CNT (2*29) //size in bytes of one Tx/RxFS minus DA/SA
//;?the MSF ( H2PCI.C uses the next 2 mnemonics )
#define HCF_DMA_RX_BUF1_SIZE (HFS_ADDR_DEST + 8) //extra bytes for LEN/SNAP if decapsulation
#define HCF_DMA_TX_BUF1_SIZE (HFS_ADDR_DEST + 2*6 + 8) //extra bytes for DA/SA/LEN/SNAP if encapsulation
//HFS_TX_CNTL
/* Note that the HCF_.... System Constants influence the HFS_.... values below
* H-I H-I | H-II H-II H-II.5
* WPA | WPA
* HFS_TX_CNTL_TX_OK 0002 0002 | 0002 0002 N/A <<<<<<<<deprecated
* HFS_TX_CNTL_TX_EX 0004 0004 | 0004 0004 N/A
* HFS_TX_CNTL_MIC N/A 0010 | N/A 0010 N/A
* HFS_TX_CNTL_TID N/A N/A | N/A N/A 000F
* HFS_TX_CNTL_SERVICE_CLASS N/A N/A | N/A N/A 00C0
* HFS_TX_CNTL_PORT 0700 0700 | 0700 0700 0700
* HFS_TX_CNTL_MIC_KEY_ID 1800 1800 | 0000 1800 N/A
* HFS_TX_CNTL_CKIP 0000 0000 | 0000 2000 2000
* HFS_TX_CNTL_TX_DELAY 4000 4000 | 4000 4000 N/A
* HFS_TX_CNTL_ACTION N/A N/A | N/A N/A 4000
* ==== ==== | ==== ==== ====
* 5F06 5F16 | 4706 7F06 67CF
*
* HCF_TX_CNTL_MASK specifies the bits allowed on the Host I/F
* note: bit 0x4000 has different meaning for H-II and H-II.5
* note: [] indicate bits which are possibly added by the HCF to TxControl at the Host I/F
* note: () indicate bits which are supposedly never ever used in a WCI environment
* note: ? denote bits which seem not to be documented in the documents I have available
*/
//H-I: HCF_TX_CNTL_MASK 0x47FE //TX_DELAY, MACPort, Priority, (StrucType), TxEx, TxOK
//H-I WPA: HCF_TX_CNTL_MASK 0x5FE6 //TX_DELAY, MICKey, MACPort, Priority, (StrucType), TxEx, TxOK
#if (HCF_TYPE) & HCF_TYPE_WARP
#define HCF_TX_CNTL_MASK 0x27E7 //no TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
//#elif (HCF_TYPE) & HCF_TYPE_WPA
//#define HCF_TX_CNTL_MASK 0x7F06 //TX_DELAY, CKIP?, MICKeyID, MACPort, [MIC],TxEx, TxOK (TAR419D7)
#else
#define HCF_TX_CNTL_MASK 0x67E7 //TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
#endif // HCF_TYPE_WARP
#define HFS_TX_CNTL_TX_EX 0x0004U
#if (HCF_TYPE) & HCF_TYPE_WPA
#define HFS_TX_CNTL_MIC 0x0010U //802.3 format with TKIP ;?changes to 0x0008 for H-II
#define HFS_TX_CNTL_MIC_KEY_ID 0x1800U //MIC Key ID subfield
#endif // HCF_TYPE_WPA
#define HFS_TX_CNTL_PORT 0x0700U //Port subfield of TxControl field of Transmit Frame Structure
#if (HCF_TYPE) & HCF_TYPE_CCX
#define HFS_TX_CNTL_CKIP 0x2000U //CKIP encrypted flag
#endif // HCF_TYPE_CCX
#if (HCF_TYPE) & HCF_TYPE_TX_DELAY
#define HFS_TX_CNTL_TX_DELAY 0x4000U //decouple "put data" and send
#endif // HCF_TYPE_TX_DELAY
#define HFS_TX_CNTL_TX_CONT 0x4000u //engineering: continuous transmit
/*============================================================= HCF Defined RECORDS =========================*/
#define CFG_PROD_DATA 0x0800 //Plug Data (Engineering Test purposes only)
#define CFG_DL_EEPROM 0x0806 //Up/Download I2PROM for USB
#define CFG_PDA 0x0002 //Download PDA
#define CFG_MEM_I2PROM 0x0004 //Up/Download EEPROM
#define CFG_MEM_READ 0x0000
#define CFG_MEM_WRITE 0x0001
#define CFG_NULL 0x0820 //Empty Mail Box Info Block
#define CFG_MB_INFO 0x0820 //Mail Box Info Block
#define CFG_WMP 0x0822 //WaveLAN Management Protocol
#if defined MSF_COMPONENT_ID
#define CFG_DRV_INFO 0x0825 //Driver Information structure (see CFG_DRV_INFO_STRCT for details)
#define CFG_DRV_IDENTITY 0x0826 //driver identity (see CFG_DRV_IDENTITY_STRCT for details)
#define CFG_DRV_SUP_RANGE 0x0827 //Supplier range of driver - utility I/F
#define CFG_DRV_ACT_RANGES_PRI 0x0828 //(Acceptable) Actor range for Primary Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_STA 0x0829 //(Acceptable) Actor range for Station Firmware - driver I/F
#define CFG_DRV_ACT_RANGES_HSI 0x082A //(Acceptable) Actor range for H/W - driver I/F
#define CFG_DRV_ACT_RANGES_APF 0x082B //(Acceptable) Actor range for AP Firmware - driver I/F
#define CFG_HCF_OPT 0x082C //HCF (Compile time) options
#endif // MSF_COMPONENT_ID
#define CFG_REG_MB 0x0830 //Register Mail Box
#define CFG_MB_ASSERT 0x0831 //Assert information
#define CFG_REG_ASSERT_RTNP 0x0832 //(de-)register MSF Assert Callback routine
#if (HCF_EXT) & HCF_EXT_INFO_LOG
#define CFG_REG_INFO_LOG 0x0839 //(de-)register Info frames to Log
#endif // HCF_INFO_LOG
#define CFG_CNTL_OPT 0x083A //Control options
#define CFG_PROG 0x0857 //Program NIC memory
#define CFG_PROG_STOP 0x0000
#define CFG_PROG_VOLATILE 0x0100
//#define CFG_PROG_FLASH 0x0300 //restore if H-II non-volatile is introduced
//#define CFG_PROG_SEEPROM 0x1300 //restore if H-II non-volatile is introduced
#define CFG_PROG_SEEPROM_READBACK 0x0400
#define CFG_FW_PRINTF 0x0858 //Related to firmware debug printf functionality
#define CFG_FW_PRINTF_BUFFER_LOCATION 0x0859 //Also related to firmware debug printf functionality
#define CFG_CMD_NIC 0x0860 //Hermes Engineering command
#define CFG_CMD_HCF 0x0863 //HCF Engineering command
#define CFG_CMD_HCF_REG_ACCESS 0x0000 //Direct register access
#define CFG_CMD_HCF_RX_MON 0x0001 //Rx-monitor
/*============================================================= MSF Defined RECORDS ========================*/
#define CFG_ENCRYPT_STRING 0x0900 //transfer encryption info from CPL to MSF
#define CFG_AP_MODE 0x0901 //control mode of STAP driver from CPL
#define CFG_DRIVER_ENABLE 0x0902 //extend&export En-/Disable facility to Utility
#define CFG_PCI_COMMAND 0x0903 //PCI adapter (Ooievaar) structure
#define CFG_WOLAS_ENABLE 0x0904 //extend&export En-/Disable WOLAS facility to Utility
#define CFG_COUNTRY_STRING 0x0905 //transfer CountryInfo info from CPL to MSF
#define CFG_FW_DUMP 0x0906 //transfer nic memory to utility
#define CFG_POWER_MODE 0x0907 //controls the PM mode of the card
#define CFG_CONNECTION_MODE 0x0908 //controls the mode of the FW (ESS/AP/IBSS/ADHOC)
#define CFG_IFB 0x0909 //byte wise copy of IFB
#define CFG_MSF_TALLIES 0x090A //MSF tallies (int's, rx and tx)
#define CFG_CURRENT_LINK_STATUS 0x090B //Latest link status got trough 0xF200 LinkEvent
/*============================================================ INFORMATION FRAMES =========================*/
#define CFG_INFO_FRAME_MIN 0xF000 //lowest value representing an Informatio Frame
#define CFG_TALLIES 0xF100 //Communications Tallies
#define CFG_SCAN 0xF101 //Scan results
#define CFG_PRS_SCAN 0xF102 //Probe Response Scan results
#define CFG_LINK_STAT 0xF200 //Link Status
/* 1 through 5 are F/W defined values, produced by CFG_LINK_STAT frame
* 1 through 5 are shared by CFG_LINK_STAT, IFB_LinkStat and IFB_DSLinkStat
* 1 plays a double role as CFG_LINK_STAT_CONNECTED and as bit reflecting:
* - connected: ON
* - disconnected: OFF
*/
#define CFG_LINK_STAT_CONNECTED 0x0001
#define CFG_LINK_STAT_DISCONNECTED 0x0002
#define CFG_LINK_STAT_AP_CHANGE 0x0003
#define CFG_LINK_STAT_AP_OOR 0x0004
#define CFG_LINK_STAT_AP_IR 0x0005
#define CFG_LINK_STAT_FW 0x000F //mask to isolate F/W defined bits
//#define CFG_LINK_STAT_TIMER 0x0FF0 //mask to isolate OOR timer
//#define CFG_LINK_STAT_DS_OOR 0x2000 //2000 and up are IFB_LinkStat specific
//#define CFG_LINK_STAT_DS_IR 0x4000
#define CFG_LINK_STAT_CHANGE 0x8000
#define CFG_ASSOC_STAT 0xF201 //Association Status
#define CFG_SECURITY_STAT 0xF202 //Security Status
#define CFG_UPDATED_INFO_RECORD 0xF204 //Updated Info Record
/*============================================================ CONFIGURATION RECORDS ======================*/
/***********************************************************************************************************/
/****************************** S T R U C T U R E D E F I N I T I O N S **********************************/
//Quick&Dirty to get download for DOS ODI Hermes-II running typedef LTV_STRCT FAR * LTVP;
typedef LTV_STRCT FAR * LTVP; // i.s.o #define LTVP LTV_STRCT FAR *
#if defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a little while longer (4aug2003)
typedef struct DUI_STRCT { /* "legacy", still used by WVLAN42/43, NDIS drivers use WLAPI */
void FAR *ifbp; /* Pointer to IFB
* returned from MSF to USF by uil_connect
* passed from USF to MSF as a "magic cookie" by all other UIL function calls
*/
hcf_16 stat; // status returned from MSF to USF
hcf_16 fun; // command code from USF to MSF
LTV_STRCT ltv; /* LTV structure
*** during uil_put_info:
* the L, T and V-fields carry information from USF to MSF
*** during uil_get_info:
* the L and T fields carry information from USF to MSF
* the L and V-fields carry information from MSF to USF
*/
} DUI_STRCT;
typedef DUI_STRCT FAR * DUIP;
#endif //defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a liitle while longer (4aug2003)
typedef struct CFG_CMD_NIC_STRCT { // CFG_CMD_NIC (0x0860) Hermes Engineering command
hcf_16 len; //default length of RID
hcf_16 typ; //RID identification as defined by Hermes
hcf_16 cmd; //Command code (0x003F) and control bits (0xFFC0)
hcf_16 parm0; //parameters for Hermes Param0 register
hcf_16 parm1; //parameters for Hermes Param1 register
hcf_16 parm2; //parameters for Hermes Param2 register
hcf_16 stat; //result code from Hermes Status register
hcf_16 resp0; //responses from Hermes Resp0 register
hcf_16 resp1; //responses from Hermes Resp1 register
hcf_16 resp2; //responses from Hermes Resp2 register
hcf_16 hcf_stat; //result code from cmd_exe routine
hcf_16 ifb_err_cmd; //IFB_ErrCmd
hcf_16 ifb_err_qualifier; //IFB_ErrQualifier
} CFG_CMD_NIC_STRCT;
typedef struct CFG_DRV_INFO_STRCT { //CFG_DRV_INFO (0x0825) driver information
hcf_16 len; //default length of RID
hcf_16 typ; //RID identification as defined by Hermes
hcf_8 driver_name[8]; //Driver name, 8 bytes, right zero padded
hcf_16 driver_version; //BCD 2 digit major and 2 digit minor driver version
hcf_16 HCF_version; //BCD 2 digit major and 2 digit minor HCF version
hcf_16 driver_stat; //
hcf_16 IO_address; //base IO address used by NIC
hcf_16 IO_range; //range of IO addresses used by NIC
hcf_16 IRQ_number; //Interrupt used by NIC
hcf_16 card_stat; /*NIC status
@* 0x8000 Card present
@* 0x4000 Card Enabled
@* 0x2000 Driver incompatible with NIC Primary Functions
@* 0x1000 Driver incompatible with NIC Station Functions */
hcf_16 frame_type; /*Frame type
@* 0x000 802.3
@* 0x008 802.11 */
hcf_32 drv_info; /*driver specific info
* CE: virtual I/O base */
}CFG_DRV_INFO_STRCT;
#define COMP_ID_FW_PRI 21 //Primary Functions Firmware
#define COMP_ID_FW_INTERMEDIATE 22 //Intermediate Functions Firmware
#define COMP_ID_FW_STA 31 //Station Functions Firmware
#define COMP_ID_FW_AP 32 //AP Functions Firmware
#define COMP_ID_FW_AP_FAKE 331 //AP Functions Firmware
#define COMP_ID_MINIPORT_NDIS_31 41 //Windows 9x/NT Miniport NDIS 3.1
#define COMP_ID_PACKET 42 //Packet
#define COMP_ID_ODI_16 43 //DOS ODI
#define COMP_ID_ODI_32 44 //32-bits ODI
#define COMP_ID_MAC_OS 45 //Macintosh OS
#define COMP_ID_WIN_CE 46 //Windows CE Miniport
//#define COMP_ID_LINUX_PD 47 //Linux, HCF-light based, MSF source code in Public Domain
#define COMP_ID_MINIPORT_NDIS_50 48 //Windows 9x/NT Miniport NDIS 5.0
#define COMP_ID_LINUX 49 /*Linux, GPL'ed HCF based, full source code in Public Domain
*thanks to Andreas Neuhaus */
#define COMP_ID_QNX 50 //QNX
#define COMP_ID_MINIPORT_NDIS_50_USB 51 //Windows 9x/NT Miniport NDIS 4.0
#define COMP_ID_MINIPORT_NDIS_40 52 //Windows 9x/NT Miniport NDIS 4.0
#define COMP_ID_VX_WORKS_ENDSTA 53 // VxWorks END Station driver
#define COMP_ID_VX_WORKS_ENDAP 54 // VxWorks END Access Point driver
//;?#define COMP_ID_MAC_OS_???? 55 //;?check with HM
#define COMP_ID_VX_WORKS_END 56 // VxWorks END Station/Access Point driver
// 57 //NucleusOS@ARM Driver.
#define COMP_ID_WSU 63 /* WaveLAN Station Firmware Update utility
* variant 1: Windows
* variant 2: DOS
*/
#define COMP_ID_AP1 81 //WaveLAN/IEEE AP
#define COMP_ID_EC 83 //WaveLAN/IEEE Ethernet Converter
#define COMP_ID_UBL 87 //USB Boot Loader
#define COMP_ROLE_SUPL 0x00 //supplier
#define COMP_ROLE_ACT 0x01 //actor
//Supplier - actor
#define COMP_ID_MFI 0x01 //Modem - Firmware I/F
#define COMP_ID_CFI 0x02 //Controller - Firmware I/F
#define COMP_ID_PRI 0x03 //Primary Firmware - Driver I/F
#define COMP_ID_STA 0x04 //Station Firmware - Driver I/F
#define COMP_ID_DUI 0x05 //Driver - Utility I/F
#define COMP_ID_HSI 0x06 //H/W - Driver I/F
#define COMP_ID_DAI 0x07 //API - Driver I/F
#define COMP_ID_APF 0x08 //H/W - Driver I/F
#define COMP_ID_INT 0x09 //Intermediate FW - Driver I/F
#ifdef HCF_LEGACY
#define HCF_ACT_ACS_SCAN HCF_ACT_PRS_SCAN
#define UIL_ACT_ACS_SCAN UIL_ACT_PRS_SCAN
#define MDD_ACT_ACS_SCAN MDD_ACT_PRS_SCAN
#define CFG_ACS_SCAN CFG_PRS_SCAN
#endif // HCF_LEGACY
#endif // MDD_H
| {
"pile_set_name": "Github"
} |
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2013, Christian Muehlhaeuser <[email protected]>
* Copyright 2013, Teo Mrnjavac <[email protected]>
* Copyright 2013, Uwe L. Korn <[email protected]>
*
* Tomahawk 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 3 of the License, or
* (at your option) any later version.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef TRACK_P_H
#define TRACK_P_H
#include "Track.h"
namespace Tomahawk {
class TrackPrivate
{
public:
TrackPrivate( Track* q, const QString& _album, const QString& _albumArtist, int _duration, const QString& _composer, unsigned int _albumpos, unsigned int _discnumber )
: q_ptr( q )
, composer( _composer )
, album( _album )
, albumArtist( _albumArtist )
, duration( _duration )
, albumpos( _albumpos )
, discnumber( _discnumber )
{
}
Track* q_ptr;
Q_DECLARE_PUBLIC( Track )
private:
QString composer;
QString album;
QString albumArtist;
QString composerSortname;
QString albumSortname;
int duration;
uint albumpos;
uint discnumber;
mutable Tomahawk::artist_ptr artistPtr;
mutable Tomahawk::artist_ptr albumArtistPtr;
mutable Tomahawk::album_ptr albumPtr;
mutable Tomahawk::artist_ptr composerPtr;
mutable trackdata_ptr trackData;
query_wptr query;
QWeakPointer< Tomahawk::Track > ownRef;
};
} // namespace Tomahawk
#endif // TRACK_P_H
| {
"pile_set_name": "Github"
} |
/**********************************************************************
*These solidity codes have been obtained from Etherscan for extracting
*the smartcontract related info.
*The data will be used by MATRIX AI team as the reference basis for
*MATRIX model analysis,extraction of contract semantics,
*as well as AI based data analysis, etc.
**********************************************************************/
pragma solidity ^0.4.18;
/*
Copyright 2017, Jordi Baylina
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 3 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, see <http://www.gnu.org/licenses/>.
*/
/// @title MyEtherWallet Campaign Contract
/// @author Jordi Baylina and Arthur Lunn
/// @dev This contract controls the issuance of tokens for the MiniMe Token
/// Contract. This version specifically acts as a Campaign manager for raising
/// funds for non-profit causes, but it can be customized for any variety of
/// purposes.
/// @dev Basic contract to indivate whether another contract is controlled
contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { require(msg.sender == controller); _; }
address public controller;
function Controlled() public { controller = msg.sender;}
/// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract
function changeController(address _newController) public onlyController {
controller = _newController;
}
}
/// @dev The token controller contract must implement these functions
contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) public payable returns(bool);
/// @notice Notifies the controller about a token transfer allowing the
/// controller to react if desired
/// @param _from The origin of the transfer
/// @param _to The destination of the transfer
/// @param _amount The amount of the transfer
/// @return False if the controller does not authorize the transfer
function onTransfer(address _from, address _to, uint _amount) public returns(bool);
/// @notice Notifies the controller about an approval allowing the
/// controller to react if desired
/// @param _owner The address that calls `approve()`
/// @param _spender The spender in the `approve()` call
/// @param _amount The amount in the `approve()` call
/// @return False if the controller does not authorize the approval
function onApprove(address _owner, address _spender, uint _amount) public
returns(bool);
}
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 _amount,
address _token,
bytes _data
) public;
}
/// @dev The actual token contract, the default controller is the msg.sender
/// that deploys the contract, so usually this token will be deployed by a
/// token controller contract, which Giveth will call a "Campaign"
contract MiniMeToken is Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
string public version = 'MMT_0.2'; //An arbitrary versioning scheme
/// @dev `Checkpoint` is the structure that attaches a block number to a
/// given value, the block number attached is the one that last changed the
/// value
struct Checkpoint {
// `fromBlock` is the block number that the value was generated from
uint128 fromBlock;
// `value` is the amount of tokens at a specific block number
uint128 value;
}
// `parentToken` is the Token address that was cloned to produce this token;
// it will be 0x0 for a token that was not cloned
MiniMeToken public parentToken;
// `parentSnapShotBlock` is the block number from the Parent Token that was
// used to determine the initial distribution of the Clone Token
uint public parentSnapShotBlock;
// `creationBlock` is the block number that the Clone Token was created
uint public creationBlock;
// `balances` is the map that tracks the balance of each address, in this
// contract when the balance changes the block number that the change
// occurred is also included in the map
mapping (address => Checkpoint[]) balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) allowed;
// Tracks the history of the `totalSupply` of the token
Checkpoint[] totalSupplyHistory;
// Flag that determines if the token is transferable or not.
bool public transfersEnabled;
// The factory used to create new clone tokens
MiniMeTokenFactory public tokenFactory;
////////////////
// Constructor
////////////////
/// @notice Constructor to create a MiniMeToken
/// @param _tokenFactory The address of the MiniMeTokenFactory contract that
/// will create the Clone token contracts, the token factory needs to be
/// deployed first
/// @param _parentToken Address of the parent token, set to 0x0 if it is a
/// new token
/// @param _parentSnapShotBlock Block of the parent token that will
/// determine the initial distribution of the clone token, set to 0 if it
/// is a new token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
function MiniMeToken(
address _tokenFactory,
address _parentToken,
uint _parentSnapShotBlock,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol,
bool _transfersEnabled
) public {
tokenFactory = MiniMeTokenFactory(_tokenFactory);
name = _tokenName; // Set the name
decimals = _decimalUnits; // Set the decimals
symbol = _tokenSymbol; // Set the symbol
parentToken = MiniMeToken(_parentToken);
parentSnapShotBlock = _parentSnapShotBlock;
transfersEnabled = _transfersEnabled;
creationBlock = block.number;
}
///////////////////
// ERC20 Methods
///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(transfersEnabled);
return doTransfer(msg.sender, _to, _amount);
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount
) public returns (bool success) {
// The controller of this contract can move tokens around at will,
// this is important to recognize! Confirm that you trust the
// controller of this contract, which in most situations should be
// another open source smart contract or 0x0
if (msg.sender != controller) {
require(transfersEnabled);
// The standard ERC 20 transferFrom functionality
if (allowed[_from][msg.sender] < _amount) return false;
allowed[_from][msg.sender] -= _amount;
}
return doTransfer(_from, _to, _amount);
}
/// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount
) internal returns(bool) {
if (_amount == 0) {
return true;
}
require(parentSnapShotBlock < block.number);
// Do not allow transfer to 0x0 or the token contract itself
require((_to != 0) && (_to != address(this)));
// If the amount being transfered is more than the balance of the
// account the transfer returns false
var previousBalanceFrom = balanceOfAt(_from, block.number);
if (previousBalanceFrom < _amount) {
return false;
}
// Alerts the token controller of the transfer
if (isContract(controller)) {
require(TokenController(controller).onTransfer(_from, _to, _amount));
}
// First update the balance array with the new value for the address
// sending the tokens
updateValueAtNow(balances[_from], previousBalanceFrom - _amount);
// Then update the balance array with the new value for the address
// receiving the tokens
var previousBalanceTo = balanceOfAt(_to, block.number);
require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
updateValueAtNow(balances[_to], previousBalanceTo + _amount);
// An event to make the transfer easy to find on the blockchain
Transfer(_from, _to, _amount);
return true;
}
/// @param _owner The address that's balance is being requested
/// @return The balance of `_owner` at the current block
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balanceOfAt(_owner, block.number);
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) public returns (bool success) {
require(transfersEnabled);
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
// Alerts the token controller of the approve function call
if (isContract(controller)) {
require(TokenController(controller).onApprove(msg.sender, _spender, _amount));
}
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
/// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend
function allowance(address _owner, address _spender
) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of the contract able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the function call was successful
function approveAndCall(address _spender, uint256 _amount, bytes _extraData
) public returns (bool success) {
require(approve(_spender, _amount));
ApproveAndCallFallBack(_spender).receiveApproval(
msg.sender,
_amount,
this,
_extraData
);
return true;
}
/// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens
function totalSupply() public constant returns (uint) {
return totalSupplyAt(block.number);
}
////////////////
// Query balance and totalSupply in History
////////////////
/// @dev Queries the balance of `_owner` at a specific `_blockNumber`
/// @param _owner The address from which the balance will be retrieved
/// @param _blockNumber The block number when the balance is queried
/// @return The balance at `_blockNumber`
function balanceOfAt(address _owner, uint _blockNumber) public constant
returns (uint) {
// These next few lines are used when the balance of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.balanceOfAt` be queried at the
// genesis block for that token as this contains initial balance of
// this token
if ((balances[_owner].length == 0)
|| (balances[_owner][0].fromBlock > _blockNumber)) {
if (address(parentToken) != 0) {
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock));
} else {
// Has no parent
return 0;
}
// This will return the expected balance during normal situations
} else {
return getValueAt(balances[_owner], _blockNumber);
}
}
/// @notice Total amount of tokens at a specific `_blockNumber`.
/// @param _blockNumber The block number when the totalSupply is queried
/// @return The total amount of tokens at `_blockNumber`
function totalSupplyAt(uint _blockNumber) public constant returns(uint) {
// These next few lines are used when the totalSupply of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.totalSupplyAt` be queried at the
// genesis block for this token as that contains totalSupply of this
// token at this block number.
if ((totalSupplyHistory.length == 0)
|| (totalSupplyHistory[0].fromBlock > _blockNumber)) {
if (address(parentToken) != 0) {
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock));
} else {
return 0;
}
// This will return the expected totalSupply during normal situations
} else {
return getValueAt(totalSupplyHistory, _blockNumber);
}
}
////////////////
// Clone Token Method
////////////////
/// @notice Creates a new clone token with the initial distribution being
/// this token at `_snapshotBlock`
/// @param _cloneTokenName Name of the clone token
/// @param _cloneDecimalUnits Number of decimals of the smallest unit
/// @param _cloneTokenSymbol Symbol of the clone token
/// @param _snapshotBlock Block when the distribution of the parent token is
/// copied to set the initial distribution of the new clone token;
/// if the block is zero than the actual block, the current block is used
/// @param _transfersEnabled True if transfers are allowed in the clone
/// @return The address of the new MiniMeToken Contract
function createCloneToken(
string _cloneTokenName,
uint8 _cloneDecimalUnits,
string _cloneTokenSymbol,
uint _snapshotBlock,
bool _transfersEnabled
) public returns(address) {
if (_snapshotBlock == 0) _snapshotBlock = block.number;
MiniMeToken cloneToken = tokenFactory.createCloneToken(
this,
_snapshotBlock,
_cloneTokenName,
_cloneDecimalUnits,
_cloneTokenSymbol,
_transfersEnabled
);
cloneToken.changeController(msg.sender);
// An event to make the token easy to find on the blockchain
NewCloneToken(address(cloneToken), _snapshotBlock);
return address(cloneToken);
}
////////////////
// Generate and destroy tokens
////////////////
/// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _owner The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly
function generateTokens(address _owner, uint _amount
) public onlyController returns (bool) {
uint curTotalSupply = totalSupply();
require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
uint previousBalanceTo = balanceOf(_owner);
require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
updateValueAtNow(balances[_owner], previousBalanceTo + _amount);
Transfer(0, _owner, _amount);
return true;
}
/// @notice Burns `_amount` tokens from `_owner`
/// @param _owner The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly
function destroyTokens(address _owner, uint _amount
) onlyController public returns (bool) {
uint curTotalSupply = totalSupply();
require(curTotalSupply >= _amount);
uint previousBalanceFrom = balanceOf(_owner);
require(previousBalanceFrom >= _amount);
updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
updateValueAtNow(balances[_owner], previousBalanceFrom - _amount);
Transfer(_owner, 0, _amount);
return true;
}
////////////////
// Enable tokens transfers
////////////////
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone
function enableTransfers(bool _transfersEnabled) public onlyController {
transfersEnabled = _transfersEnabled;
}
////////////////
// Internal helper functions to query and set a value in a snapshot array
////////////////
/// @dev `getValueAt` retrieves the number of tokens at a given block number
/// @param checkpoints The history of values being queried
/// @param _block The block number to retrieve the value at
/// @return The number of tokens being queried
function getValueAt(Checkpoint[] storage checkpoints, uint _block
) constant internal returns (uint) {
if (checkpoints.length == 0) return 0;
// Shortcut for the actual value
if (_block >= checkpoints[checkpoints.length-1].fromBlock)
return checkpoints[checkpoints.length-1].value;
if (_block < checkpoints[0].fromBlock) return 0;
// Binary search of the value in the array
uint min = 0;
uint max = checkpoints.length-1;
while (max > min) {
uint mid = (max + min + 1)/ 2;
if (checkpoints[mid].fromBlock<=_block) {
min = mid;
} else {
max = mid-1;
}
}
return checkpoints[min].value;
}
/// @dev `updateValueAtNow` used to update the `balances` map and the
/// `totalSupplyHistory`
/// @param checkpoints The history of data being updated
/// @param _value The new number of tokens
function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value
) internal {
if ((checkpoints.length == 0)
|| (checkpoints[checkpoints.length -1].fromBlock < block.number)) {
Checkpoint storage newCheckPoint = checkpoints[ checkpoints.length++ ];
newCheckPoint.fromBlock = uint128(block.number);
newCheckPoint.value = uint128(_value);
} else {
Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length-1];
oldCheckPoint.value = uint128(_value);
}
}
/// @dev Internal function to determine if an address is a contract
/// @param _addr The address being queried
/// @return True if `_addr` is a contract
function isContract(address _addr) constant internal returns(bool) {
uint size;
if (_addr == 0) return false;
assembly {
size := extcodesize(_addr)
}
return size>0;
}
/// @dev Helper function to return a min betwen the two uints
function min(uint a, uint b) pure internal returns (uint) {
return a < b ? a : b;
}
/// @notice The fallback function: If the contract's controller has not been
/// set to 0, then the `proxyPayment` method is called which relays the
/// ether and creates tokens as described in the token controller contract
function () public payable {
require(isContract(controller));
require(TokenController(controller).proxyPayment.value(msg.value)(msg.sender));
}
//////////
// Safety Methods
//////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(address _token) public onlyController {
if (_token == 0x0) {
controller.transfer(this.balance);
return;
}
MiniMeToken token = MiniMeToken(_token);
uint balance = token.balanceOf(this);
token.transfer(controller, balance);
ClaimedTokens(_token, controller, balance);
}
////////////////
// Events
////////////////
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount
);
}
////////////////
// MiniMeTokenFactory
////////////////
/// @dev This contract is used to generate clone contracts from a contract.
/// In solidity this is the way to create a contract from a contract of the
/// same class
contract MiniMeTokenFactory {
/// @notice Update the DApp by creating a new token with new functionalities
/// the msg.sender becomes the controller of this clone token
/// @param _parentToken Address of the token being cloned
/// @param _snapshotBlock Block of the parent token that will
/// determine the initial distribution of the clone token
/// @param _tokenName Name of the new token
/// @param _decimalUnits Number of decimals of the new token
/// @param _tokenSymbol Token Symbol for the new token
/// @param _transfersEnabled If true, tokens will be able to be transferred
/// @return The address of the new token contract
function createCloneToken(
address _parentToken,
uint _snapshotBlock,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol,
bool _transfersEnabled
) public returns (MiniMeToken) {
MiniMeToken newToken = new MiniMeToken(
this,
_parentToken,
_snapshotBlock,
_tokenName,
_decimalUnits,
_tokenSymbol,
_transfersEnabled
);
newToken.changeController(msg.sender);
return newToken;
}
}
/// @title Owned
/// @author Adrià Massanet < | {
"pile_set_name": "Github"
} |
// Copyright 2011 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 template
// Tests for multiple-template parsing and execution.
import (
"bytes"
"fmt"
"testing"
"text/template/parse"
)
const (
noError = true
hasError = false
)
type multiParseTest struct {
name string
input string
ok bool
names []string
results []string
}
var multiParseTests = []multiParseTest{
{"empty", "", noError,
nil,
nil},
{"one", `{{define "foo"}} FOO {{end}}`, noError,
[]string{"foo"},
[]string{" FOO "}},
{"two", `{{define "foo"}} FOO {{end}}{{define "bar"}} BAR {{end}}`, noError,
[]string{"foo", "bar"},
[]string{" FOO ", " BAR "}},
// errors
{"missing end", `{{define "foo"}} FOO `, hasError,
nil,
nil},
{"malformed name", `{{define "foo}} FOO `, hasError,
nil,
nil},
}
func TestMultiParse(t *testing.T) {
for _, test := range multiParseTests {
template, err := New("root").Parse(test.input)
switch {
case err == nil && !test.ok:
t.Errorf("%q: expected error; got none", test.name)
continue
case err != nil && test.ok:
t.Errorf("%q: unexpected error: %v", test.name, err)
continue
case err != nil && !test.ok:
// expected error, got one
if *debug {
fmt.Printf("%s: %s\n\t%s\n", test.name, test.input, err)
}
continue
}
if template == nil {
continue
}
if len(template.tmpl) != len(test.names)+1 { // +1 for root
t.Errorf("%s: wrong number of templates; wanted %d got %d", test.name, len(test.names), len(template.tmpl))
continue
}
for i, name := range test.names {
tmpl, ok := template.tmpl[name]
if !ok {
t.Errorf("%s: can't find template %q", test.name, name)
continue
}
result := tmpl.Root.String()
if result != test.results[i] {
t.Errorf("%s=(%q): got\n\t%v\nexpected\n\t%v", test.name, test.input, result, test.results[i])
}
}
}
}
var multiExecTests = []execTest{
{"empty", "", "", nil, true},
{"text", "some text", "some text", nil, true},
{"invoke x", `{{template "x" .SI}}`, "TEXT", tVal, true},
{"invoke x no args", `{{template "x"}}`, "TEXT", tVal, true},
{"invoke dot int", `{{template "dot" .I}}`, "17", tVal, true},
{"invoke dot []int", `{{template "dot" .SI}}`, "[3 4 5]", tVal, true},
{"invoke dotV", `{{template "dotV" .U}}`, "v", tVal, true},
{"invoke nested int", `{{template "nested" .I}}`, "17", tVal, true},
{"variable declared by template", `{{template "nested" $x:=.SI}},{{index $x 1}}`, "[3 4 5],4", tVal, true},
// User-defined function: test argument evaluator.
{"testFunc literal", `{{oneArg "joe"}}`, "oneArg=joe", tVal, true},
{"testFunc .", `{{oneArg .}}`, "oneArg=joe", "joe", true},
}
// These strings are also in testdata/*.
const multiText1 = `
{{define "x"}}TEXT{{end}}
{{define "dotV"}}{{.V}}{{end}}
`
const multiText2 = `
{{define "dot"}}{{.}}{{end}}
{{define "nested"}}{{template "dot" .}}{{end}}
`
func TestMultiExecute(t *testing.T) {
// Declare a couple of templates first.
template, err := New("root").Parse(multiText1)
if err != nil {
t.Fatalf("parse error for 1: %s", err)
}
_, err = template.Parse(multiText2)
if err != nil {
t.Fatalf("parse error for 2: %s", err)
}
testExecute(multiExecTests, template, t)
}
func TestParseFiles(t *testing.T) {
_, err := ParseFiles("DOES NOT EXIST")
if err == nil {
t.Error("expected error for non-existent file; got none")
}
template := New("root")
_, err = template.ParseFiles("testdata/file1.tmpl", "testdata/file2.tmpl")
if err != nil {
t.Fatalf("error parsing files: %v", err)
}
testExecute(multiExecTests, template, t)
}
func TestParseGlob(t *testing.T) {
_, err := ParseGlob("DOES NOT EXIST")
if err == nil {
t.Error("expected error for non-existent file; got none")
}
_, err = New("error").ParseGlob("[x")
if err == nil {
t.Error("expected error for bad pattern; got none")
}
template := New("root")
_, err = template.ParseGlob("testdata/file*.tmpl")
if err != nil {
t.Fatalf("error parsing files: %v", err)
}
testExecute(multiExecTests, template, t)
}
// In these tests, actual content (not just template definitions) comes from the parsed files.
var templateFileExecTests = []execTest{
{"test", `{{template "tmpl1.tmpl"}}{{template "tmpl2.tmpl"}}`, "template1\n\ny\ntemplate2\n\nx\n", 0, true},
}
func TestParseFilesWithData(t *testing.T) {
template, err := New("root").ParseFiles("testdata/tmpl1.tmpl", "testdata/tmpl2.tmpl")
if err != nil {
t.Fatalf("error parsing files: %v", err)
}
testExecute(templateFileExecTests, template, t)
}
func TestParseGlobWithData(t *testing.T) {
template, err := New("root").ParseGlob("testdata/tmpl*.tmpl")
if err != nil {
t.Fatalf("error parsing files: %v", err)
}
testExecute(templateFileExecTests, template, t)
}
const (
cloneText1 = `{{define "a"}}{{template "b"}}{{template "c"}}{{end}}`
cloneText2 = `{{define "b"}}b{{end}}`
cloneText3 = `{{define "c"}}root{{end}}`
cloneText4 = `{{define "c"}}clone{{end}}`
)
func TestClone(t *testing.T) {
// Create some templates and clone the root.
root, err := New("root").Parse(cloneText1)
if err != nil {
t.Fatal(err)
}
_, err = root.Parse(cloneText2)
if err != nil {
t.Fatal(err)
}
clone := Must(root.Clone())
// Add variants to both.
_, err = root.Parse(cloneText3)
if err != nil {
t.Fatal(err)
}
_, err = clone.Parse(cloneText4)
if err != nil {
t.Fatal(err)
}
// Verify that the clone is self-consistent.
for k, v := range clone.tmpl {
if k == clone.name && v.tmpl[k] != clone {
t.Error("clone does not contain root")
}
if v != v.tmpl[v.name] {
t.Errorf("clone does not contain self for %q", k)
}
}
// Execute root.
var b bytes.Buffer
err = root.ExecuteTemplate(&b, "a", 0)
if err != nil {
t.Fatal(err)
}
if b.String() != "broot" {
t.Errorf("expected %q got %q", "broot", b.String())
}
// Execute copy.
b.Reset()
err = clone.ExecuteTemplate(&b, "a", 0)
if err != nil {
t.Fatal(err)
}
if b.String() != "bclone" {
t.Errorf("expected %q got %q", "bclone", b.String())
}
}
func TestAddParseTree(t *testing.T) {
// Create some templates.
root, err := New("root").Parse(cloneText1)
if err != nil {
t.Fatal(err)
}
_, err = root.Parse(cloneText2)
if err != nil {
t.Fatal(err)
}
// Add a new parse tree.
tree, err := parse.Parse("cloneText3", cloneText3, "", "", nil, builtins)
if err != nil {
t.Fatal(err)
}
added, err := root.AddParseTree("c", tree["c"])
// Execute.
var b bytes.Buffer
err = added.ExecuteTemplate(&b, "a", 0)
if err != nil {
t.Fatal(err)
}
if b.String() != "broot" {
t.Errorf("expected %q got %q", "broot", b.String())
}
}
// Issue 7032
func TestAddParseTreeToUnparsedTemplate(t *testing.T) {
master := "{{define \"master\"}}{{end}}"
tmpl := New("master")
tree, err := parse.Parse("master", master, "", "", nil)
if err != nil {
t.Fatalf("unexpected parse err: %v", err)
}
masterTree := tree["master"]
tmpl.AddParseTree("master", masterTree) // used to panic
}
func TestRedefinition(t *testing.T) {
var tmpl *Template
var err error
if tmpl, err = New("tmpl1").Parse(`{{define "test"}}foo{{end}}`); err != nil {
t.Fatalf("parse 1: %v", err)
}
if _, err = tmpl.Parse(`{{define "test"}}bar{{end}}`); err != nil {
t.Fatalf("got error %v, expected nil", err)
}
if _, err = tmpl.New("tmpl2").Parse(`{{define "test"}}bar{{end}}`); err != nil {
t.Fatalf("got error %v, expected nil", err)
}
}
// Issue 10879
func TestEmptyTemplateCloneCrash(t *testing.T) {
t1 := New("base")
t1.Clone() // used to panic
}
// Issue 10910, 10926
func TestTemplateLookUp(t *testing.T) {
t1 := New("foo")
if t1.Lookup("foo") != nil {
t.Error("Lookup returned non-nil value for undefined template foo")
}
t1.New("bar")
if t1.Lookup("bar") != nil {
t.Error("Lookup returned non-nil value for undefined template bar")
}
t1.Parse(`{{define "foo"}}test{{end}}`)
if t1.Lookup("foo") == nil {
t.Error("Lookup returned nil value for defined template")
}
}
func TestNew(t *testing.T) {
// template with same name already exists
t1, _ := New("test").Parse(`{{define "test"}}foo{{end}}`)
t2 := t1.New("test")
if t1.common != t2.common {
t.Errorf("t1 & t2 didn't share common struct; got %v != %v", t1.common, t2.common)
}
if t1.Tree == nil {
t.Error("defined template got nil Tree")
}
if t2.Tree != nil {
t.Error("undefined template got non-nil Tree")
}
containsT1 := false
for _, tmpl := range t1.Templates() {
if tmpl == t2 {
t.Error("Templates included undefined template")
}
if tmpl == t1 {
containsT1 = true
}
}
if !containsT1 {
t.Error("Templates didn't include defined template")
}
}
func TestParse(t *testing.T) {
// In multiple calls to Parse with the same receiver template, only one call
// can contain text other than space, comments, and template definitions
t1 := New("test")
if _, err := t1.Parse(`{{define "test"}}{{end}}`); err != nil {
t.Fatalf("parsing test: %s", err)
}
if _, err := t1.Parse(`{{define "test"}}{{/* this is a comment */}}{{end}}`); err != nil {
t.Fatalf("parsing test: %s", err)
}
if _, err := t1.Parse(`{{define "test"}}foo{{end}}`); err != nil {
t.Fatalf("parsing test: %s", err)
}
}
func TestEmptyTemplate(t *testing.T) {
cases := []struct {
defn []string
in string
want string
}{
{[]string{""}, "once", ""},
{[]string{"", ""}, "twice", ""},
{[]string{"{{.}}", "{{.}}"}, "twice", "twice"},
{[]string{"{{/* a comment */}}", "{{/* a comment */}}"}, "comment", ""},
{[]string{"{{.}}", ""}, "twice", ""},
}
for _, c := range cases {
root := New("root")
var (
m *Template
err error
)
for _, d := range c.defn {
m, err = root.New(c.in).Parse(d)
if err != nil {
t.Fatal(err)
}
}
buf := &bytes.Buffer{}
if err := m.Execute(buf, c.in); err != nil {
t.Fatal(err)
}
if buf.String() != c.want {
t.Errorf("expected string %q: got %q", c.want, buf.String())
}
}
}
| {
"pile_set_name": "Github"
} |
FROM balenalib/armv7hf-ubuntu:disco-build
LABEL io.balena.device-type="npe-x500-m3"
RUN apt-get update && apt-get install -y --no-install-recommends \
less \
kmod \
nano \
net-tools \
ifupdown \
iputils-ping \
i2c-tools \
usbutils \
&& rm -rf /var/lib/apt/lists/*
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu disco \nVariant: build variant \nDefault variable(s): UDEV=off \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"pile_set_name": "Github"
} |
/*
* HCS API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 2.1
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package hcsschema
type EnhancedModeVideo struct {
ConnectionOptions *RdpConnectionOptions `json:"ConnectionOptions,omitempty"`
}
| {
"pile_set_name": "Github"
} |
ABOUTBOX DIALOG DISCARDABLE 22, 17, 176, 73
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION SZABOUT
BEGIN
DEFPUSHBUTTON "OK", IDOK, 136, 2, 32, 14, WS_GROUP
ICON SZAPPNAME, -1, 3, 2, 18, 20
LTEXT SZRCOMPANYNAME, IDD_VERFIRST, 30, 2, 100, 8
LTEXT SZRDESCRIPTION, IDD_VERFIRST+1, 30, 11, 100, 8
LTEXT SZRVERSION, IDD_VERFIRST+2, 30, 20, 137, 8
LTEXT SZRCOPYRIGHT, IDD_VERFIRST+3, 30, 29, 137, 8
LTEXT SZRTRADEMARK, IDD_VERLAST, 30, 47, 140, 27
CONTROL "", 501, "Static", SS_BLACKRECT, 29, 43, 142, 1
END
| {
"pile_set_name": "Github"
} |
// Copyright 2011 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 windows
type WSAData struct {
Version uint16
HighVersion uint16
Description [WSADESCRIPTION_LEN + 1]byte
SystemStatus [WSASYS_STATUS_LEN + 1]byte
MaxSockets uint16
MaxUdpDg uint16
VendorInfo *byte
}
type Servent struct {
Name *byte
Aliases **byte
Port uint16
Proto *byte
}
| {
"pile_set_name": "Github"
} |
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. 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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/6/93";
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
#include "ios_error.h"
/*
* bytes -- read bytes to an offset from the end and display.
*
* This is the function that reads to a byte offset from the end of the input,
* storing the data in a wrap-around buffer which is then displayed. If the
* rflag is set, the data is displayed in lines in reverse order, and this
* routine has the usual nastiness of trying to find the newlines. Otherwise,
* it is displayed from the character closest to the beginning of the input to
* the end.
*/
int
bytes(FILE *fp, off_t off)
{
int ch, len, tlen;
char *ep, *p, *t;
int wrap;
char *sp;
if ((sp = p = malloc(off)) == NULL)
err(1, "malloc");
for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) {
*p = ch;
if (++p == ep) {
wrap = 1;
p = sp;
}
}
if (ferror(fp)) {
ierr();
free(sp);
return 1;
}
if (rflag) {
for (t = p - 1, len = 0; t >= sp; --t, ++len)
if (*t == '\n' && len) {
WR(t + 1, len);
len = 0;
}
if (wrap) {
tlen = len;
for (t = ep - 1, len = 0; t >= p; --t, ++len)
if (*t == '\n') {
if (len) {
WR(t + 1, len);
len = 0;
}
if (tlen) {
WR(sp, tlen);
tlen = 0;
}
}
if (len)
WR(t + 1, len);
if (tlen)
WR(sp, tlen);
}
} else {
if (wrap && (len = ep - p))
WR(p, len);
len = p - sp;
if (len)
WR(sp, len);
}
free(sp);
return 0;
}
/*
* lines -- read lines to an offset from the end and display.
*
* This is the function that reads to a line offset from the end of the input,
* storing the data in an array of buffers which is then displayed. If the
* rflag is set, the data is displayed in lines in reverse order, and this
* routine has the usual nastiness of trying to find the newlines. Otherwise,
* it is displayed from the line closest to the beginning of the input to
* the end.
*/
int
lines(FILE *fp, off_t off)
{
struct {
int blen;
u_int len;
char *l;
} *llines;
int ch, rc;
char *p, *sp;
int blen, cnt, recno, wrap;
if ((llines = malloc(off * sizeof(*llines))) == NULL)
err(1, "malloc");
bzero(llines, off * sizeof(*llines));
sp = NULL;
blen = cnt = recno = wrap = 0;
rc = 0;
while ((ch = getc(fp)) != EOF) {
if (++cnt > blen) {
if ((sp = realloc(sp, blen += 1024)) == NULL)
err(1, "realloc");
p = sp + cnt - 1;
}
*p++ = ch;
if (ch == '\n') {
if ((int)llines[recno].blen < cnt) {
llines[recno].blen = cnt + 256;
if ((llines[recno].l = realloc(llines[recno].l,
llines[recno].blen)) == NULL)
err(1, "realloc");
}
bcopy(sp, llines[recno].l, llines[recno].len = cnt);
cnt = 0;
p = sp;
if (++recno == off) {
wrap = 1;
recno = 0;
}
}
}
if (ferror(fp)) {
ierr();
rc = 1;
goto done;
}
if (cnt) {
llines[recno].l = sp;
sp = NULL;
llines[recno].len = cnt;
if (++recno == off) {
wrap = 1;
recno = 0;
}
}
if (rflag) {
for (cnt = recno - 1; cnt >= 0; --cnt)
WR(llines[cnt].l, llines[cnt].len);
if (wrap)
for (cnt = off - 1; cnt >= recno; --cnt)
WR(llines[cnt].l, llines[cnt].len);
} else {
if (wrap)
for (cnt = recno; cnt < off; ++cnt)
WR(llines[cnt].l, llines[cnt].len);
for (cnt = 0; cnt < recno; ++cnt)
WR(llines[cnt].l, llines[cnt].len);
}
done:
for (cnt = 0; cnt < off; cnt++)
free(llines[cnt].l);
free(sp);
free(llines);
return (rc);
}
| {
"pile_set_name": "Github"
} |
#include "tommath_private.h"
#ifdef BN_MP_CNT_LSB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
* LibTomMath is a library that provides multiple-precision
* integer arithmetic as well as number theoretic functionality.
*
* The library was designed directly after the MPI library by
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*/
static const int lnz[16] = {
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};
/* Counts the number of lsbs which are zero before the first zero bit */
int mp_cnt_lsb(const mp_int *a)
{
int x;
mp_digit q, qq;
/* easy out */
if (mp_iszero(a) == MP_YES) {
return 0;
}
/* scan lower digits until non-zero */
for (x = 0; (x < a->used) && (a->dp[x] == 0u); x++) {}
q = a->dp[x];
x *= DIGIT_BIT;
/* now scan this digit until a 1 is found */
if ((q & 1u) == 0u) {
do {
qq = q & 15u;
x += lnz[qq];
q >>= 4;
} while (qq == 0u);
}
return x;
}
#endif
/* ref: HEAD -> develop */
/* git commit: 8b9f98baa16b21e1612ac6746273febb74150a6f */
/* commit time: 2018-09-23 21:37:58 +0200 */
| {
"pile_set_name": "Github"
} |
<span ng-if="!property.noValue">{{'PROPERTY.TASKLISTENERS.VALUE' | translate:property.value.taskListeners}}</span>
<span ng-if="property.noValue" translate>PROPERTY.TASKLISTENERS.EMPTY</span> | {
"pile_set_name": "Github"
} |
<p>Tricky combinaisons:</p>
<p>backslash with \-- two dashes</p>
<p>backslash with \> greater than</p>
<p>\[test](not a link)</p>
<p>\*no emphasis*</p>
| {
"pile_set_name": "Github"
} |
; REQUIRES: object-emission
; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s
; Radar 7833483
; Do not emit a separate out-of-line definition DIE for the function-local 'foo'
; function (member of the function local 'A' type)
; CHECK: DW_TAG_class_type
; CHECK: DW_TAG_class_type
; CHECK-NEXT: DW_AT_name {{.*}} "A"
; Check that the subprogram inside the class definition has low_pc, only
; attached to the definition.
; CHECK: [[FOO_INL:0x........]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_low_pc
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "foo"
; And just double check that there's no out of line definition that references
; this subprogram.
; CHECK-NOT: DW_AT_specification {{.*}} {[[FOO_INL]]}
%class.A = type { i8 }
%class.B = type { i8 }
define i32 @main() ssp !dbg !2 {
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=3]
%b = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
store i32 0, i32* %retval
call void @llvm.dbg.declare(metadata %class.A* %b, metadata !0, metadata !DIExpression()), !dbg !14
%call = call i32 @_ZN1B2fnEv(%class.A* %b), !dbg !15 ; <i32> [#uses=1]
store i32 %call, i32* %retval, !dbg !15
%0 = load i32, i32* %retval, !dbg !16 ; <i32> [#uses=1]
ret i32 %0, !dbg !16
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 !dbg !10 {
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=2]
%this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
%a = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
%i = alloca i32, align 4 ; <i32*> [#uses=2]
store %class.A* %this, %class.A** %this.addr
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
%this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !DIExpression()), !dbg !27
call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !DIExpression()), !dbg !29
%call = call i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %a), !dbg !30 ; <i32> [#uses=1]
store i32 %call, i32* %i, !dbg !30
%tmp = load i32, i32* %i, !dbg !31 ; <i32> [#uses=1]
store i32 %tmp, i32* %retval, !dbg !31
%0 = load i32, i32* %retval, !dbg !32 ; <i32> [#uses=1]
ret i32 %0, !dbg !32
}
define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 !dbg !23 {
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=2]
%this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
store %class.A* %this, %class.A** %this.addr
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression(DW_OP_deref)), !dbg !34
%this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
store i32 42, i32* %retval, !dbg !35
%0 = load i32, i32* %retval, !dbg !35 ; <i32> [#uses=1]
ret i32 %0, !dbg !35
}
!llvm.dbg.cu = !{!4}
!llvm.module.flags = !{!40}
!37 = !{!2, !10, !23}
!0 = !DILocalVariable(name: "b", line: 16, scope: !1, file: !3, type: !8)
!1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2)
!2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, scopeLine: 15, file: !38, scope: !3, type: !5)
!3 = !DIFile(filename: "one.cc", directory: "/tmp")
!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: FullDebug, file: !38, enums: !39, retainedTypes: !39, imports: null)
!5 = !DISubroutineType(types: !6)
!6 = !{!7}
!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 2, size: 8, align: 8, file: !38, scope: !3, elements: !9)
!9 = !{!10}
!10 = distinct !DISubprogram(name: "fn", linkageName: "_ZN1B2fnEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, scopeLine: 4, file: !38, scope: !8, type: !11)
!11 = !DISubroutineType(types: !12)
!12 = !{!7, !13}
!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !8)
!14 = !DILocation(line: 16, column: 5, scope: !1)
!15 = !DILocation(line: 17, column: 3, scope: !1)
!16 = !DILocation(line: 18, column: 1, scope: !2)
; Manually modified to avoid pointers (thus dependence on pointer size) in Generic test
!17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !8)
!18 = !DILocation(line: 4, column: 7, scope: !10)
!19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21)
!20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10)
!21 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !38, scope: !10, elements: !22)
!22 = !{!23}
!23 = distinct !DISubprogram(name: "foo", linkageName: "_ZZN1B2fnEvEN1A3fooEv", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, scopeLine: 7, file: !38, scope: !21, type: !24)
!24 = !DISubroutineType(types: !25)
!25 = !{!7, !26}
!26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !21)
!27 = !DILocation(line: 9, column: 7, scope: !20)
!28 = !DILocalVariable(name: "i", line: 10, scope: !20, file: !3, type: !7)
!29 = !DILocation(line: 10, column: 9, scope: !20)
!30 = !DILocation(line: 10, column: 5, scope: !20)
!31 = !DILocation(line: 11, column: 5, scope: !20)
!32 = !DILocation(line: 12, column: 3, scope: !10)
; Manually modified like !17 above
!33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !21)
!34 = !DILocation(line: 7, column: 11, scope: !23)
!35 = !DILocation(line: 7, column: 19, scope: !36)
!36 = distinct !DILexicalBlock(line: 7, column: 17, file: !38, scope: !23)
!38 = !DIFile(filename: "one.cc", directory: "/tmp")
!39 = !{}
!40 = !{i32 1, !"Debug Info Version", i32 3}
| {
"pile_set_name": "Github"
} |
// Copyright Louis Dionne 2013-2016
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
#include <boost/hana/product.hpp>
#include <boost/hana/tuple.hpp>
int main() {
constexpr auto tuple = boost::hana::make_tuple(
<%= (1..input_size).to_a.map{ |n| "#{n}ull" }.join(', ') %>
);
constexpr auto result = boost::hana::product<unsigned long long>(tuple);
(void)result;
}
| {
"pile_set_name": "Github"
} |
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
| {
"pile_set_name": "Github"
} |
'use strict';
const {Transform} = require('stream');
const decompressResponse = require('decompress-response');
const is = require('@sindresorhus/is');
const mimicResponse = require('mimic-response');
module.exports = (response, options, emitter, redirects) => {
const downloadBodySize = Number(response.headers['content-length']) || null;
let downloaded = 0;
const progressStream = new Transform({
transform(chunk, encoding, callback) {
downloaded += chunk.length;
const percent = downloadBodySize ? downloaded / downloadBodySize : 0;
// Let `flush()` be responsible for emitting the last event
if (percent < 1) {
emitter.emit('downloadProgress', {
percent,
transferred: downloaded,
total: downloadBodySize
});
}
callback(null, chunk);
},
flush(callback) {
emitter.emit('downloadProgress', {
percent: 1,
transferred: downloaded,
total: downloadBodySize
});
callback();
}
});
mimicResponse(response, progressStream);
progressStream.redirectUrls = redirects;
const newResponse = options.decompress === true &&
is.function(decompressResponse) &&
options.method !== 'HEAD' ? decompressResponse(progressStream) : progressStream;
if (!options.decompress && ['gzip', 'deflate'].includes(response.headers['content-encoding'])) {
options.encoding = null;
}
emitter.emit('response', newResponse);
emitter.emit('downloadProgress', {
percent: 0,
transferred: 0,
total: downloadBodySize
});
response.pipe(progressStream);
};
| {
"pile_set_name": "Github"
} |
// Copyright 2013 the V8 project authors. 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.
Debug = debug.Debug;
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
exec_state.prepareStep(Debug.StepAction.StepNext);
}
};
Debug.setListener(listener);
var statement = "";
for (var i = 0; i < 1024; i++) statement += "z";
statement = 'with(0)' + statement + '=function foo(){}';
debugger;
eval(statement);
| {
"pile_set_name": "Github"
} |
'use strict';
describe('babrahams:transactions', function () {
it('is available to the app via a variable called tx', function () {
expect(Package["babrahams:transactions"].tx).toBeDefined();
expect(tx).toBeDefined();
})
}); | {
"pile_set_name": "Github"
} |
-module(html_macros).
-export([dp/1]).
dp([{raw,[H|T]}]) ->
"<P><B><I><FONT COLOR=\"#COCO\"><FONT SIZE=+2>" ++ [H] ++
"</FONT>" ++ T ++ "</FONT></I></B>".
| {
"pile_set_name": "Github"
} |
#!/usr/bin/expect -f
#
# Copyright (c) 2020, The OpenThread Authors.
# 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.
#
source "tests/scripts/expect/_common.exp"
source "tests/scripts/expect/_multinode.exp"
setup_nodes
set spawn_id $spawn_1
send "ipmaddr add ff0e::1\n"
expect "Done"
send "ipmaddr\n"
expect "ff0e:0:0:0:0:0:0:1"
expect "Done"
send "ipaddr mleid\n"
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr $expect_out(1,string)
set spawn_id $spawn_2
send "ping ff0e::1\n"
expect "Done"
expect "16 bytes from $addr: icmp_seq=1"
set spawn_id $spawn_1
send "ipmaddr del ff0e::1\n"
expect "Done"
send "ipmaddr del ff0e::1\n"
expect "Error 23: NotFound"
send "ipmaddr promiscuous enable\n"
expect "Done"
send "ipmaddr promiscuous\n"
expect "Enabled"
expect "Done"
send "ipmaddr promiscuous disable\n"
expect "Done"
send "ipmaddr promiscuous\n"
expect "Disabled"
expect "Done"
send "ipmaddr something_invalid\n"
expect "Error 35: InvalidCommand"
dispose_nodes
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using UELib.Types;
namespace UELib
{
public static class UnrealConfig
{
#region Config
public static bool SuppressComments;
public static bool SuppressSignature;
public static string PreBeginBracket = UnrealSyntax.NewLine + "{0}";
public static string PreEndBracket = UnrealSyntax.NewLine + "{0}";
public static string Indention = "\t";
public enum CookedPlatform
{
PC,
Console
}
public static CookedPlatform Platform;
public static Dictionary<string, Tuple<string, PropertyType>> VariableTypes;
#endregion
public static string PrintBeginBracket()
{
return String.Format( PreBeginBracket, UDecompilingState.Tabs ) + UnrealSyntax.BeginBracket;
}
public static string PrintEndBracket()
{
return String.Format( PreEndBracket, UDecompilingState.Tabs ) + UnrealSyntax.EndBracket;
}
public static string ToUFloat( this float value )
{
return value.ToString( "0.0000000000" ).TrimEnd( '0' ).Replace( ',', '.' ) + '0';
}
}
} | {
"pile_set_name": "Github"
} |
/*
* Copyright 2013 ThirdMotion, Inc.
*
* 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.
*/
/// GameCompleteCommand
/// ============================
/// This Command captures the GameComplete event from Game and starts some social stuff going
using System;
using System.Collections;
using UnityEngine;
using strange.extensions.context.api;
using strange.extensions.command.impl;
using strange.extensions.dispatcher.eventdispatcher.api;
namespace strange.examples.multiplecontexts.social
{
public class GameCompleteCommand : EventCommand
{
[Inject(ContextKeys.CONTEXT_VIEW)]
public GameObject contextView{get;set;}
[Inject]
public ISocialService social{get;set;}
//Remember back in StartCommand when I said we'd need the userVO again?
[Inject]
public UserVO userVO{get;set;}
public override void Execute()
{
Retain ();
int score = (int)evt.data;
//Set the current score
userVO.currentScore = score;
Debug.Log ("Social SCENE KNOWS THAT GAME IS OVER. Your score is: " + score);
social.dispatcher.AddListener(SocialEvent.FULFILL_FRIENDS_REQUEST, onResponse);
social.FetchScoresForFriends();
}
private void onResponse(IEvent evt)
{
social.dispatcher.RemoveListener(SocialEvent.FULFILL_FRIENDS_REQUEST, onResponse);
ArrayList list = evt.data as ArrayList;
//Save the list as the data for the next item in the sequence
data = list;
Release();
}
}
}
| {
"pile_set_name": "Github"
} |
using System;
using Uno;
using Uno.Collections;
using System.IO;
using Uno.Net;
using Uno.Net.Sockets;
namespace Outracks.Simulator
{
public class FailedToConnectToProxy : Exception
{
public readonly ImmutableList<Exception> InnerExceptions;
public FailedToConnectToProxy(IEnumerable<Exception> innerExceptions)
: base("Failed to connect to proxy:\n" + innerExceptions.ToIndentedLines()) // TODO: move this view logic away from here
{
InnerExceptions = innerExceptions.ToImmutableList();
}
}
public class DesignerNotRunning : Exception
{
}
public class ProxyClient
{
public static Task<IPEndPoint[]> GetSimulatorEndpoint(IEnumerable<IPEndPoint> proxyEndpoints, string project, IEnumerable<string> defines)
{
var tasks = new List<Task<IPEndPoint[]>>();
foreach (var endpoint in proxyEndpoints)
tasks.Add(
Tasks.Run<IPEndPoint[]>(
new GetSimulatorEndpoint(endpoint, project, defines.ToArray()).Execute));
return Tasks.WaitForFirstResult<IPEndPoint[]>(tasks, OnNoResult);
}
static IPEndPoint[] OnNoResult(IEnumerable<Exception> exceptions)
{
foreach (var exception in exceptions)
{
if (exception is DesignerNotRunning)
{
throw new DesignerNotRunning();
}
}
throw new FailedToConnectToProxy(exceptions);
}
}
class GetSimulatorEndpoint
{
readonly IPEndPoint proxy;
readonly string project;
readonly string[] defines;
public GetSimulatorEndpoint(IPEndPoint proxy, string project, string[] defines)
{
this.proxy = proxy;
this.project = project;
this.defines = defines;
}
public IPEndPoint[] Execute()
{
try
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(proxy);
using (var stream = new NetworkStream(socket))
using (var writer = new BinaryWriter(stream))
using (var reader = new BinaryReader(stream))
{
writer.Write(project);
writer.Write(string.Join(" ", defines));
var initialState = reader.ReadString();
if ("DESIGNER_NOT_RUNNING".Equals(initialState))
throw new DesignerNotRunning();
if ("SUCCESS".Equals(initialState) == false)
throw new Exception("Failed to request host.");
var endpointCount = reader.ReadInt32();
var endpoints = new IPEndPoint[endpointCount];
for (int i = 0; i < endpoints.Length; i++)
{
var simulatorAddress = reader.ReadString();
var simulatorPort = reader.ReadInt32();
endpoints[i] = new IPEndPoint(IPAddress.Parse(simulatorAddress), simulatorPort);
}
try
{
socket.Shutdown(SocketShutdown.Both);
}
catch (Exception e)
{
// We may already be connected
}
return endpoints;
}
// UnoBug: this code is unreachable, but uno disagrees
throw new Exception("Call Tom Curise");
}
catch (DesignerNotRunning)
{
throw;
}
catch (Exception e)
{
throw new FailedToConnectToEndPoint(proxy, e);
}
}
}
} | {
"pile_set_name": "Github"
} |
/****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0/
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License 2.0 are satisfied: GNU General Public License, version 2
// or later which is available at
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file NBLoadedSUMOTLDef.h
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mar 2011
///
// A complete traffic light logic loaded from a sumo-net. (opted to reimplement
// since NBLoadedTLDef is quite vissim specific)
/****************************************************************************/
#pragma once
#include <config.h>
#include <vector>
#include <string>
#include <set>
#include "NBNode.h"
#include "NBEdgeCont.h"
#include "NBTrafficLightDefinition.h"
#include "NBTrafficLightLogic.h"
#include <utils/common/SUMOTime.h>
// ===========================================================================
// class definitions
// ===========================================================================
/**
* @class NBLoadedSUMOTLDef
* @brief A loaded (complete) traffic light logic
*/
class NBLoadedSUMOTLDef : public NBTrafficLightDefinition {
public:
/** @brief Constructor
* @param[in] id The id of the tls
* @param[in] programID The programID for the computed logic
* @param[in] offset The offset for the computed logic
* @param[in] type The algorithm type for the computed logic
*/
NBLoadedSUMOTLDef(const std::string& id, const std::string& programID, SUMOTime offset, TrafficLightType type);
/** @brief Constructor that copies from an existing definition and its computed logic (used by NETEDIT)
* @param[in] def The definition to copy
* @param[in] logic The computed logic of the given def
*/
NBLoadedSUMOTLDef(const NBTrafficLightDefinition& def, const NBTrafficLightLogic& logic);
/// @brief Destructor
~NBLoadedSUMOTLDef();
/** @brief Sets the programID
* @param[in] programID The new ID of the program (subID)
*/
void setProgramID(const std::string& programID);
/** @brief Informs edges about being controlled by a tls
*/
void setTLControllingInformation() const;
/** @brief Replaces occurences of the removed edge in incoming/outgoing edges of all definitions
* @param[in] removed The removed edge
* @param[in] incoming The edges to use instead if an incoming edge was removed
* @param[in] outgoing The edges to use instead if an outgoing edge was removed
*/
void remapRemoved(NBEdge* removed,
const EdgeVector& incoming, const EdgeVector& outgoing);
/** @brief Replaces a removed edge/lane
* @param[in] removed The edge to replace
* @param[in] removedLane The lane of this edge to replace
* @param[in] by The edge to insert instead
* @param[in] byLane This edge's lane to insert instead
*/
void replaceRemoved(NBEdge* removed, int removedLane,
NBEdge* by, int byLane, bool incoming);
/** @brief patches signal plans by modifying lane indices
* with the given offset, only indices with a value above threshold are modified
*/
void shiftTLConnectionLaneIndex(NBEdge* edge, int offset, int threshold = -1);
/** @brief Adds a phase to the logic
* the new phase is inserted at the end of the list of already added phases
* @param[in] duration The duration of the phase to add
* @param[in] state The state definition of a tls phase
* @param[in] minDur The minimum duration of the phase to add
* @param[in] maxDur The maximum duration of the phase to add
*/
void addPhase(SUMOTime duration, const std::string& state, SUMOTime minDur, SUMOTime maxDur, const std::vector<int>& next, const std::string& name);
/// @brief mark phases as load
void phasesLoaded() {
myPhasesLoaded = true;
}
/** @brief Adds a connection and immediately informs the edges
*/
void addConnection(NBEdge* from, NBEdge* to, int fromLane, int toLane, int linkIndex, int linkIndex2, bool reconstruct = true);
/** @brief removes the given connection from the traffic light
* if recontruct=true, reconstructs the logic and informs the edges for immediate use in NETEDIT
* @note: tlIndex is not necessarily unique. we need the whole connection data here
*/
void removeConnection(const NBConnection& conn, bool reconstruct = true);
/// @brief register changes that necessitate recomputation
void registerModifications(bool addedConnections, bool removedConnections);
/** @brief Returns the internal logic
*/
NBTrafficLightLogic* getLogic() {
return myTLLogic;
}
/** @brief Sets the offset of this tls
* @param[in] offset The offset of this cycle
*/
void setOffset(SUMOTime offset);
/** @brief Sets the algorithm type of this tls
* @param[in] offset The algorithm type of this tls
*/
void setType(TrafficLightType type);
/// @brief whether the given index must yield to the foeIndex while turing right on a red light
bool rightOnRedConflict(int index, int foeIndex) const;
/* @brief shortens phase states to remove states that are not referenced by
* any controlled link and returns whether states were shortened
*/
bool cleanupStates();
/// @brief whether this definition uses signal group (multiple connections with the same link index)
bool usingSignalGroups() const;
/// @brief join nodes and states from the given logic (append red state)
void joinLogic(NBTrafficLightDefinition* def);
/// @brief heuristically add minDur and maxDur when switching from tlType fixed to actuated
void guessMinMaxDuration();
/// @brief let connections with the same state use the same link index
void groupSignals();
/// @brief let all connections use a distinct link index
void ungroupSignals();
/// @brief copy the assignment of link indices to connections from the given definition and rebuilt the states to match
// Note: Issues a warning when the grouping of def is incompatible with the current states
void copyIndices(NBTrafficLightDefinition* def);
protected:
/** @brief Collects the links participating in this traffic light
* (only if not previously loaded)
*/
void collectLinks();
/** @brief Build the list of participating edges
*/
void collectEdges();
/** @brief Computes the traffic light logic finally in dependence to the type
* @param[in] brakingTime Duration a vehicle needs for braking in front of the tls in seconds
* @return The computed logic
*/
NBTrafficLightLogic* myCompute(int brakingTimeSeconds);
bool amInvalid() const;
/* initialize myNeedsContRelation and set myNeedsContRelationReady to true */
void initNeedsContRelation() const;
/// @brief return the highest known tls link index used by any controlled connection or crossing
int getMaxIndex();
///@brief Returns the maximum index controlled by this traffic light
int getMaxValidIndex();
/// @brief get all states for the given link index
std::string getStates(int index);
/// @brief return whether the given link index is used by any connectons
bool isUsed(int index);
/// @brief replace the given link index in all connections
void replaceIndex(int oldIndex, int newIndex);
/// brief retrieve all edges with connections that use the given traffic light index
std::set<const NBEdge*> getEdgesUsingIndex(int index) const;
private:
/** @brief phases are added directly to myTLLogic which is then returned in myCompute() */
NBTrafficLightLogic* myTLLogic;
/// @brief repair the plan if controlled nodes received pedestrian crossings
void patchIfCrossingsAdded();
/// @brief set of edges with shifted lane indices (to avoid shifting twice)
std::set<NBEdge*> myShifted;
/// @brief whether the logic must be reconstructed
bool myReconstructAddedConnections;
bool myReconstructRemovedConnections;
bool myPhasesLoaded;
/** @brief Collects the edges for each tlIndex
* @param[out] fromEdges The from-edge for each controlled tlIndex
* @param[out] toEdges The to-edge for each controlled tlIndex
* @param[out] fromLanes The from-lanes for each controlled tlIndex
*/
void collectEdgeVectors(EdgeVector& fromEdges, EdgeVector& toEdges, std::vector<int>& fromLanes) const;
/// @brief adapt to removal or addition of connections
void reconstructLogic();
/// @brief return whether all tls link indices are valid
bool hasValidIndices() const;
private:
/// @brief class for identifying connections
class connection_equal {
public:
/// constructor
connection_equal(const NBConnection& c) : myC(c) {}
bool operator()(const NBConnection& c) const {
return c.getFrom() == myC.getFrom() && c.getTo() == myC.getTo() &&
c.getFromLane() == myC.getFromLane() && c.getToLane() == myC.getToLane();
}
private:
const NBConnection& myC;
private:
/// @brief invalidated assignment operator
connection_equal& operator=(const connection_equal& s);
};
};
| {
"pile_set_name": "Github"
} |
/***************************************************************************
* Copyright (C) 2009 by Borko Bošković *
* [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 3 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <iostream>
#include <cstring>
#include <climits>
#include "movelist.h"
void MoveList::sort(){
Move m;
int e, i, j;
eval[size] = -INT_MAX;
for (i = size-2; i >= 0; i--) {
m = move[i];
e = eval[i];
for (j = i; e < eval[j+1]; j++) {
move[j] = move[j+1];
eval[j] = eval[j+1];
}
move[j] = m;
eval[j] = e;
}
}
void MoveList::sort_s(){
std::string ms[MAX_LIST_SIZE], stmp;
Move mtmp;
for(int i=0; i<size; i++)
ms[i] = move_to_string(move[i]);
bool swapped;
do{
swapped = false;
for(int i = 0; i< size-1; i++){
if(strcmp(ms[i].c_str(),ms[i+1].c_str())>0){
stmp = ms[i];
ms[i] = ms[i+1];
ms[i+1] = stmp;
mtmp = move[i];
move[i] = move[i+1];
move[i+1] = mtmp;
swapped = true;
}
}
}while(swapped);
}
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2012-2014
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <asm/io.h>
#include <div64.h>
#include <bootstage.h>
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_HZ_CLOCK
static inline u32 read_cntfrq(void)
{
u32 frq;
asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (frq));
return frq;
}
#endif
int timer_init(void)
{
gd->arch.tbl = 0;
gd->arch.tbu = 0;
#ifdef CONFIG_SYS_HZ_CLOCK
gd->arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK;
#else
gd->arch.timer_rate_hz = read_cntfrq();
#endif
return 0;
}
unsigned long long get_ticks(void)
{
ulong nowl, nowu;
asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (nowl), "=r" (nowu));
gd->arch.tbl = nowl;
gd->arch.tbu = nowu;
return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl;
}
ulong timer_get_boot_us(void)
{
return lldiv(get_ticks(), gd->arch.timer_rate_hz / 1000000);
}
ulong get_tbclk(void)
{
return gd->arch.timer_rate_hz;
}
| {
"pile_set_name": "Github"
} |
set(CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1" CACHE STRING "Flags used by the C compiler during DEBUG builds." FORCE)
set(CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /DNDEBUG" CACHE STRING "Flags used by the C compiler during MINSIZEREL builds." FORCE)
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG" CACHE STRING "Flags used by the C compiler during RELEASE builds." FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /DNDEBUG" CACHE STRING "Flags used by the C compiler during RELWITHDEBINFO builds." FORCE)
| {
"pile_set_name": "Github"
} |
#include <3ds/types.h>
#include <3ds/result.h>
#include <3ds/services/apt.h>
#include <3ds/util/utf.h>
#include <3ds/applets/miiselector.h>
#include <string.h> // for memcpy
void miiSelectorInit(MiiSelectorConf *conf)
{
memset(conf, 0, sizeof(*conf));
for (int i = 0; i < MIISELECTOR_GUESTMII_SLOTS; i ++)
conf->mii_guest_whitelist[i] = 1;
for (int i = 0; i < MIISELECTOR_USERMII_SLOTS; i ++)
conf->mii_whitelist[i] = 1;
}
void miiSelectorLaunch(const MiiSelectorConf *conf, MiiSelectorReturn *returnbuf)
{
union {
MiiSelectorConf config;
MiiSelectorReturn ret;
} ctx;
memcpy(&ctx.config, conf, sizeof(MiiSelectorConf));
ctx.config.magic = MIISELECTOR_MAGIC;
aptLaunchLibraryApplet(APPID_APPLETED, &ctx.config, sizeof(MiiSelectorConf), 0);
if(returnbuf)
memcpy(returnbuf, &ctx.ret, sizeof(MiiSelectorReturn));
}
static void miiSelectorConvertToUTF8(char* out, const u16* in, int max)
{
if (!in || !*in)
{
out[0] = 0;
return;
}
ssize_t units = utf16_to_utf8((uint8_t*)out, in, max);
if (units < 0)
{
out[0] = 0;
return;
}
out[units] = 0;
}
static void miiSelectorConvertToUTF16(u16* out, const char* in, int max)
{
if (!in || !*in)
{
out[0] = 0;
return;
}
ssize_t units = utf8_to_utf16(out, (const uint8_t*)in, max);
if (units < 0)
{
out[0] = 0;
return;
}
out[units] = 0;
}
void miiSelectorSetTitle(MiiSelectorConf *conf, const char* text)
{
miiSelectorConvertToUTF16(conf->title, text, MIISELECTOR_TITLE_LEN);
}
void miiSelectorSetOptions(MiiSelectorConf *conf, u32 options)
{
static const u8 miiSelectorOptions[] =
{
offsetof(MiiSelectorConf, enable_cancel_button),
offsetof(MiiSelectorConf, enable_selecting_guests),
offsetof(MiiSelectorConf, show_on_top_screen),
offsetof(MiiSelectorConf, show_guest_page),
};
for (int i = 0; i < sizeof(miiSelectorOptions); i ++)
*((u8*)conf + miiSelectorOptions[i]) = (options & BIT(i)) ? 1 : 0;
}
void miiSelectorWhitelistGuestMii(MiiSelectorConf *conf, u32 index)
{
if (index < MIISELECTOR_GUESTMII_SLOTS)
conf->mii_guest_whitelist[index] = 1;
else if (index == MIISELECTOR_GUESTMII_SLOTS)
for (int i = 0; i < MIISELECTOR_GUESTMII_SLOTS; i ++)
conf->mii_guest_whitelist[i] = 1;
}
void miiSelectorBlacklistGuestMii(MiiSelectorConf *conf, u32 index)
{
if (index < MIISELECTOR_GUESTMII_SLOTS)
conf->mii_guest_whitelist[index] = 0;
else if (index == MIISELECTOR_GUESTMII_SLOTS)
for (int i = 0; i < MIISELECTOR_GUESTMII_SLOTS; i ++)
conf->mii_guest_whitelist[i] = 0;
}
void miiSelectorWhitelistUserMii(MiiSelectorConf *conf, u32 index)
{
if (index < MIISELECTOR_USERMII_SLOTS)
conf->mii_whitelist[index] = 1;
else if (index == MIISELECTOR_USERMII_SLOTS)
for (int i = 0; i < MIISELECTOR_USERMII_SLOTS; i ++)
conf->mii_whitelist[i] = 1;
}
void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index)
{
if (index < MIISELECTOR_USERMII_SLOTS)
conf->mii_whitelist[index] = 0;
else if (index == MIISELECTOR_USERMII_SLOTS)
for (int i = 0; i < MIISELECTOR_USERMII_SLOTS; i ++)
conf->mii_whitelist[i] = 0;
}
void miiSelectorReturnGetName(const MiiSelectorReturn *returnbuf, char* out, size_t max_size)
{
if (!out)
return;
if (returnbuf->guest_mii_was_selected)
miiSelectorConvertToUTF8(out, returnbuf->guest_mii_name, max_size);
else
{
u16 temp[10];
memcpy(temp, returnbuf->mii.mii_name, sizeof(temp));
miiSelectorConvertToUTF8(out, temp, max_size);
}
}
void miiSelectorReturnGetAuthor(const MiiSelectorReturn *returnbuf, char* out, size_t max_size)
{
if (!out)
return;
u16 temp[10];
memcpy(temp, returnbuf->mii.author_name, sizeof(temp));
miiSelectorConvertToUTF8(out, temp, max_size);
}
static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val)
{
if (!buf)
return -1;
u8 const *cbuf = buf;
u32 crc = starting_val;
static const u16 POLY = 0x1021;
for (size_t i = 0; i < len; i++)
{
for (int bit = 7; bit >= 0; bit--)
crc = ((crc << 1) | ((cbuf[i] >> bit) & 0x1)) ^ (crc & 0x8000 ? POLY : 0);
}
for (int _ = 0; _ < 16; _++)
crc = (crc << 1) ^ (crc & 0x8000 ? POLY : 0);
return (u16)(crc & 0xffff);
}
bool miiSelectorChecksumIsValid(const MiiSelectorReturn *returnbuf)
{
u16 computed =
crc16_ccitt(&returnbuf->mii, sizeof(returnbuf->mii) + sizeof(returnbuf->_pad0x68), 0x0000);
u16 chk_little_endian = __builtin_bswap16(returnbuf->checksum);
return computed == chk_little_endian;
}
| {
"pile_set_name": "Github"
} |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Studio\Totem\Database\TotemMigration;
class CreateFrequencyParametersTable extends TotemMigration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection(TOTEM_DATABASE_CONNECTION)
->create(TOTEM_TABLE_PREFIX.'frequency_parameters', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('frequency_id');
$table->string('name');
$table->string('value');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection(TOTEM_DATABASE_CONNECTION)
->dropIfExists(TOTEM_TABLE_PREFIX.'frequency_parameters');
}
}
| {
"pile_set_name": "Github"
} |
/* This file is generated by gen_zigzag32.m */
/* clang-format off */
#include "odintrin.h"
OD_EXTERN const unsigned char OD_ZIGZAG32_DCT_DCT[768][2] = {
{ 16, 0 }, { 17, 0 }, { 18, 0 }, { 19, 0 },
{ 16, 1 }, { 17, 1 }, { 20, 0 }, { 16, 2 },
{ 18, 1 }, { 21, 0 }, { 17, 2 }, { 16, 3 },
{ 19, 1 }, { 22, 0 }, { 18, 2 }, { 17, 3 },
{ 20, 1 }, { 16, 4 }, { 23, 0 }, { 19, 2 },
{ 24, 0 }, { 16, 5 }, { 21, 1 }, { 17, 4 },
{ 18, 3 }, { 20, 2 }, { 17, 5 }, { 16, 6 },
{ 19, 3 }, { 18, 4 }, { 25, 0 }, { 22, 1 },
{ 16, 7 }, { 21, 2 }, { 17, 6 }, { 20, 3 },
{ 26, 0 }, { 18, 5 }, { 19, 4 }, { 17, 7 },
{ 23, 1 }, { 22, 2 }, { 18, 6 }, { 27, 0 },
{ 19, 5 }, { 24, 1 }, { 21, 3 }, { 28, 0 },
{ 20, 4 }, { 18, 7 }, { 19, 6 }, { 23, 2 },
{ 29, 0 }, { 25, 1 }, { 21, 4 }, { 30, 0 },
{ 20, 5 }, { 22, 3 }, { 31, 0 }, { 19, 7 },
{ 24, 2 }, { 26, 1 }, { 20, 6 }, { 21, 5 },
{ 22, 4 }, { 23, 3 }, { 27, 1 }, { 25, 2 },
{ 20, 7 }, { 28, 1 }, { 24, 3 }, { 21, 6 },
{ 22, 5 }, { 23, 4 }, { 26, 2 }, { 21, 7 },
{ 29, 1 }, { 25, 3 }, { 30, 1 }, { 27, 2 },
{ 22, 6 }, { 23, 5 }, { 31, 1 }, { 24, 4 },
{ 26, 3 }, { 28, 2 }, { 22, 7 }, { 23, 6 },
{ 25, 4 }, { 24, 5 }, { 29, 2 }, { 30, 2 },
{ 27, 3 }, { 23, 7 }, { 31, 2 }, { 24, 6 },
{ 26, 4 }, { 25, 5 }, { 28, 3 }, { 24, 7 },
{ 27, 4 }, { 29, 3 }, { 25, 6 }, { 26, 5 },
{ 30, 3 }, { 31, 3 }, { 28, 4 }, { 27, 5 },
{ 25, 7 }, { 29, 4 }, { 26, 6 }, { 28, 5 },
{ 30, 4 }, { 26, 7 }, { 27, 6 }, { 31, 4 },
{ 29, 5 }, { 27, 7 }, { 30, 5 }, { 28, 6 },
{ 31, 5 }, { 29, 6 }, { 28, 7 }, { 30, 6 },
{ 31, 6 }, { 29, 7 }, { 30, 7 }, { 31, 7 },
{ 0, 16 }, { 0, 17 }, { 1, 16 }, { 0, 18 },
{ 1, 17 }, { 0, 19 }, { 2, 16 }, { 1, 18 },
{ 0, 20 }, { 2, 17 }, { 3, 16 }, { 1, 19 },
{ 2, 18 }, { 0, 21 }, { 3, 17 }, { 4, 16 },
{ 1, 20 }, { 2, 19 }, { 0, 22 }, { 3, 18 },
{ 4, 17 }, { 5, 16 }, { 0, 23 }, { 3, 19 },
{ 2, 20 }, { 1, 21 }, { 4, 18 }, { 6, 16 },
{ 5, 17 }, { 3, 20 }, { 2, 21 }, { 1, 22 },
{ 0, 24 }, { 0, 25 }, { 4, 19 }, { 7, 16 },
{ 6, 17 }, { 5, 18 }, { 0, 26 }, { 3, 21 },
{ 2, 22 }, { 1, 23 }, { 4, 20 }, { 5, 19 },
{ 6, 18 }, { 1, 24 }, { 7, 17 }, { 0, 27 },
{ 2, 23 }, { 3, 22 }, { 4, 21 }, { 1, 25 },
{ 5, 20 }, { 7, 18 }, { 0, 28 }, { 6, 19 },
{ 2, 24 }, { 1, 26 }, { 0, 29 }, { 4, 22 },
{ 3, 23 }, { 2, 25 }, { 5, 21 }, { 0, 31 },
{ 7, 19 }, { 6, 20 }, { 0, 30 }, { 1, 27 },
{ 3, 24 }, { 2, 26 }, { 4, 23 }, { 5, 22 },
{ 7, 20 }, { 1, 28 }, { 6, 21 }, { 3, 25 },
{ 2, 27 }, { 1, 29 }, { 4, 24 }, { 2, 28 },
{ 1, 30 }, { 7, 21 }, { 5, 23 }, { 3, 26 },
{ 6, 22 }, { 1, 31 }, { 4, 25 }, { 7, 22 },
{ 3, 27 }, { 2, 29 }, { 2, 30 }, { 5, 24 },
{ 2, 31 }, { 6, 23 }, { 4, 26 }, { 3, 28 },
{ 5, 25 }, { 3, 29 }, { 6, 24 }, { 7, 23 },
{ 3, 30 }, { 4, 27 }, { 3, 31 }, { 5, 26 },
{ 6, 25 }, { 4, 28 }, { 7, 24 }, { 4, 29 },
{ 5, 27 }, { 4, 30 }, { 4, 31 }, { 6, 26 },
{ 5, 28 }, { 7, 25 }, { 6, 27 }, { 5, 29 },
{ 7, 26 }, { 5, 30 }, { 5, 31 }, { 6, 28 },
{ 7, 27 }, { 6, 29 }, { 6, 30 }, { 7, 28 },
{ 6, 31 }, { 7, 29 }, { 7, 30 }, { 7, 31 },
{ 8, 16 }, { 9, 16 }, { 8, 17 }, { 10, 16 },
{ 9, 17 }, { 16, 8 }, { 8, 18 }, { 16, 9 },
{ 10, 17 }, { 11, 16 }, { 17, 8 }, { 9, 18 },
{ 8, 19 }, { 16, 10 }, { 11, 17 }, { 12, 16 },
{ 10, 18 }, { 17, 9 }, { 9, 19 }, { 16, 11 },
{ 8, 20 }, { 18, 8 }, { 17, 10 }, { 10, 19 },
{ 12, 17 }, { 11, 18 }, { 9, 20 }, { 16, 12 },
{ 18, 9 }, { 8, 21 }, { 13, 16 }, { 17, 11 },
{ 19, 8 }, { 18, 10 }, { 13, 17 }, { 16, 13 },
{ 11, 19 }, { 12, 18 }, { 10, 20 }, { 17, 12 },
{ 9, 21 }, { 19, 9 }, { 8, 22 }, { 14, 16 },
{ 18, 11 }, { 11, 20 }, { 10, 21 }, { 20, 8 },
{ 13, 18 }, { 16, 14 }, { 12, 19 }, { 17, 13 },
{ 19, 10 }, { 14, 17 }, { 9, 22 }, { 18, 12 },
{ 8, 23 }, { 17, 14 }, { 20, 9 }, { 15, 16 },
{ 16, 15 }, { 13, 19 }, { 10, 22 }, { 19, 11 },
{ 11, 21 }, { 14, 18 }, { 12, 20 }, { 18, 13 },
{ 20, 10 }, { 21, 8 }, { 15, 17 }, { 9, 23 },
{ 19, 12 }, { 11, 22 }, { 8, 24 }, { 21, 9 },
{ 17, 15 }, { 16, 16 }, { 14, 19 }, { 18, 14 },
{ 12, 21 }, { 13, 20 }, { 20, 11 }, { 10, 23 },
{ 19, 13 }, { 15, 18 }, { 16, 17 }, { 21, 10 },
{ 22, 8 }, { 9, 24 }, { 8, 25 }, { 20, 12 },
{ 15, 19 }, { 11, 23 }, { 17, 16 }, { 18, 15 },
{ 14, 20 }, { 12, 22 }, { 10, 24 }, { 22, 9 },
{ 21, 11 }, { 19, 14 }, { 13, 21 }, { 16, 18 },
{ 9, 25 }, { 17, 17 }, { 8, 26 }, { 20, 13 },
{ 23, 8 }, { 12, 23 }, { 13, 22 }, { 22, 10 },
{ 19, 15 }, { 15, 20 }, { 16, 19 }, { 21, 12 },
{ 11, 24 }, { 14, 21 }, { 8, 27 }, { 18, 16 },
{ 10, 25 }, { 9, 26 }, { 22, 11 }, { 20, 14 },
{ 23, 9 }, { 18, 17 }, { 17, 18 }, { 17, 19 },
{ 19, 16 }, { 21, 13 }, { 10, 26 }, { 12, 24 },
{ 23, 10 }, { 24, 8 }, { 8, 28 }, { 16, 20 },
{ 9, 27 }, { 15, 21 }, { 22, 12 }, { 14, 22 },
{ 13, 23 }, { 20, 15 }, { 11, 25 }, { 24, 9 },
{ 18, 18 }, { 19, 17 }, { 23, 11 }, { 10, 27 },
{ 8, 29 }, { 12, 25 }, { 9, 28 }, { 8, 30 },
{ 21, 14 }, { 13, 24 }, { 11, 26 }, { 25, 8 },
{ 24, 10 }, { 20, 16 }, { 19, 18 }, { 14, 23 },
{ 22, 13 }, { 8, 31 }, { 17, 20 }, { 9, 29 },
{ 23, 12 }, { 15, 22 }, { 25, 9 }, { 11, 27 },
{ 10, 28 }, { 20, 17 }, { 21, 15 }, { 18, 19 },
{ 16, 21 }, { 24, 11 }, { 9, 30 }, { 12, 26 },
{ 10, 29 }, { 22, 14 }, { 14, 24 }, { 9, 31 },
{ 26, 8 }, { 13, 25 }, { 25, 10 }, { 18, 20 },
{ 19, 19 }, { 11, 28 }, { 15, 23 }, { 20, 18 },
{ 10, 30 }, { 12, 27 }, { 17, 21 }, { 23, 13 },
{ 24, 12 }, { 21, 16 }, { 16, 22 }, { 26, 9 },
{ 27, 8 }, { 13, 26 }, { 22, 15 }, { 10, 31 },
{ 14, 25 }, { 12, 28 }, { 25, 11 }, { 21, 17 },
{ 26, 10 }, { 20, 19 }, { 11, 29 }, { 15, 24 },
{ 23, 14 }, { 27, 9 }, { 11, 30 }, { 13, 27 },
{ 19, 20 }, { 24, 13 }, { 28, 8 }, { 11, 31 },
{ 22, 16 }, { 17, 22 }, { 16, 23 }, { 25, 12 },
{ 18, 21 }, { 12, 29 }, { 21, 18 }, { 28, 9 },
{ 27, 10 }, { 26, 11 }, { 29, 8 }, { 14, 26 },
{ 15, 25 }, { 13, 28 }, { 12, 30 }, { 23, 15 },
{ 30, 8 }, { 16, 24 }, { 13, 29 }, { 25, 13 },
{ 24, 14 }, { 20, 20 }, { 31, 8 }, { 12, 31 },
{ 14, 27 }, { 28, 10 }, { 26, 12 }, { 22, 17 },
{ 21, 19 }, { 17, 23 }, { 18, 22 }, { 29, 9 },
{ 27, 11 }, { 19, 21 }, { 27, 12 }, { 30, 9 },
{ 31, 9 }, { 13, 30 }, { 24, 15 }, { 23, 16 },
{ 15, 26 }, { 14, 28 }, { 29, 10 }, { 28, 11 },
{ 26, 13 }, { 17, 24 }, { 13, 31 }, { 25, 14 },
{ 22, 18 }, { 16, 25 }, { 30, 10 }, { 14, 29 },
{ 15, 27 }, { 19, 22 }, { 21, 20 }, { 20, 21 },
{ 27, 13 }, { 29, 11 }, { 18, 23 }, { 23, 17 },
{ 16, 26 }, { 31, 10 }, { 24, 16 }, { 14, 30 },
{ 22, 19 }, { 14, 31 }, { 28, 12 }, { 26, 14 },
{ 30, 11 }, { 15, 28 }, { 25, 15 }, { 17, 25 },
{ 23, 18 }, { 18, 24 }, { 15, 30 }, { 29, 12 },
{ 31, 11 }, { 16, 27 }, { 24, 17 }, { 28, 13 },
{ 19, 23 }, { 15, 29 }, { 25, 16 }, { 17, 26 },
{ 27, 14 }, { 22, 20 }, { 15, 31 }, { 20, 22 },
{ 21, 21 }, { 16, 28 }, { 17, 27 }, { 30, 12 },
{ 26, 15 }, { 19, 24 }, { 18, 25 }, { 23, 19 },
{ 29, 13 }, { 31, 12 }, { 24, 18 }, { 26, 16 },
{ 25, 17 }, { 16, 29 }, { 28, 14 }, { 20, 23 },
{ 18, 26 }, { 21, 22 }, { 19, 25 }, { 22, 21 },
{ 27, 15 }, { 17, 28 }, { 16, 30 }, { 26, 17 },
{ 23, 20 }, { 16, 31 }, { 25, 18 }, { 27, 16 },
{ 20, 24 }, { 24, 19 }, { 31, 13 }, { 30, 13 },
{ 29, 14 }, { 18, 27 }, { 28, 15 }, { 17, 29 },
{ 19, 26 }, { 17, 30 }, { 21, 23 }, { 22, 22 },
{ 30, 14 }, { 20, 25 }, { 23, 21 }, { 17, 31 },
{ 18, 28 }, { 25, 19 }, { 24, 20 }, { 28, 16 },
{ 31, 14 }, { 26, 18 }, { 19, 27 }, { 29, 15 },
{ 27, 17 }, { 30, 15 }, { 21, 24 }, { 22, 23 },
{ 26, 19 }, { 23, 22 }, { 28, 17 }, { 29, 16 },
{ 18, 30 }, { 24, 21 }, { 25, 20 }, { 18, 31 },
{ 18, 29 }, { 20, 26 }, { 19, 28 }, { 27, 18 },
{ 31, 15 }, { 20, 27 }, { 30, 16 }, { 19, 29 },
{ 29, 17 }, { 31, 16 }, { 27, 19 }, { 21, 25 },
{ 28, 18 }, { 26, 20 }, { 22, 24 }, { 25, 21 },
{ 19, 30 }, { 24, 22 }, { 30, 17 }, { 21, 26 },
{ 23, 23 }, { 19, 31 }, { 20, 28 }, { 31, 17 },
{ 28, 19 }, { 27, 20 }, { 21, 27 }, { 29, 18 },
{ 30, 18 }, { 25, 22 }, { 26, 21 }, { 20, 29 },
{ 22, 25 }, { 24, 23 }, { 29, 19 }, { 23, 24 },
{ 20, 31 }, { 20, 30 }, { 28, 20 }, { 21, 28 },
{ 22, 26 }, { 31, 18 }, { 27, 21 }, { 30, 19 },
{ 22, 27 }, { 29, 20 }, { 23, 25 }, { 24, 24 },
{ 26, 22 }, { 21, 29 }, { 25, 23 }, { 31, 19 },
{ 21, 30 }, { 23, 26 }, { 28, 21 }, { 21, 31 },
{ 22, 28 }, { 30, 20 }, { 25, 24 }, { 27, 22 },
{ 29, 21 }, { 26, 23 }, { 24, 25 }, { 31, 20 },
{ 23, 27 }, { 22, 29 }, { 30, 21 }, { 28, 22 },
{ 24, 26 }, { 25, 25 }, { 27, 23 }, { 22, 30 },
{ 23, 28 }, { 22, 31 }, { 26, 24 }, { 31, 21 },
{ 24, 27 }, { 29, 22 }, { 27, 24 }, { 30, 22 },
{ 25, 26 }, { 28, 23 }, { 23, 30 }, { 23, 29 },
{ 24, 28 }, { 25, 27 }, { 31, 22 }, { 23, 31 },
{ 26, 25 }, { 28, 24 }, { 29, 23 }, { 24, 29 },
{ 24, 30 }, { 27, 25 }, { 25, 28 }, { 26, 26 },
{ 30, 23 }, { 26, 27 }, { 31, 23 }, { 28, 25 },
{ 27, 26 }, { 25, 29 }, { 24, 31 }, { 29, 24 },
{ 30, 24 }, { 27, 27 }, { 29, 25 }, { 26, 28 },
{ 31, 24 }, { 25, 30 }, { 25, 31 }, { 28, 26 },
{ 27, 28 }, { 26, 29 }, { 30, 25 }, { 29, 26 },
{ 28, 27 }, { 26, 30 }, { 31, 25 }, { 27, 29 },
{ 26, 31 }, { 30, 26 }, { 28, 28 }, { 31, 26 },
{ 29, 27 }, { 27, 30 }, { 28, 29 }, { 27, 31 },
{ 30, 27 }, { 31, 27 }, { 28, 30 }, { 29, 28 },
{ 30, 28 }, { 29, 29 }, { 30, 29 }, { 31, 28 },
{ 28, 31 }, { 29, 30 }, { 29, 31 }, { 31, 29 },
{ 30, 30 }, { 30, 31 }, { 31, 30 }, { 31, 31 }
};
| {
"pile_set_name": "Github"
} |
require 'rails_helper'
RSpec.describe WideStudentsExporter do
context 'with generated students' do
let!(:pals) { TestPals.create! }
let!(:school) { School.find_by_name('Arthur D Healey') }
let!(:educator) { FactoryBot.create(:educator, :admin, school: school) }
let!(:homeroom) { Homeroom.create(name: 'HEA 300', grade: '3', school: school) }
before do
# the test data is not deterministic (setting a seed in srand only worked on
# a single-file test run), so we only test for the output shape
3.times { FakeStudent.create!(school, homeroom) }
Student.update_recent_student_assessments!
end
describe '#csv_string' do
it 'generates a CSV with the expected number of lines' do
csv_string = WideStudentsExporter.new(pals.uri).csv_string(school.students)
expect(csv_string.split("\n").size).to eq(1 + school.students.size)
end
end
describe '#flat_row_hash' do
it 'creates expected fields with all options' do
exporter = WideStudentsExporter.new(pals.uri, {
include_additional_fields: true,
include_services: true,
include_event_notes: true
})
flat_row_hash = exporter.send(:flat_row_hash, school.students.first)
expect(flat_row_hash.keys).to contain_exactly(*[
'id',
'grade',
'free_reduced_lunch',
'homeroom_id',
'first_name',
'last_name',
'state_id',
'home_language',
'school_id',
'registration_date',
'local_id',
'counselor',
'hispanic_latino',
'house',
'race',
'sped_liaison',
'student_address',
'program_assigned',
'sped_placement',
'disability',
'sped_level_of_need',
'plan_504',
'limited_english_proficiency',
'ell_entry_date',
'ell_transition_date',
'most_recent_mcas_math_growth',
'most_recent_mcas_ela_growth',
'most_recent_mcas_math_performance',
'most_recent_mcas_ela_performance',
'most_recent_mcas_math_scaled',
'most_recent_mcas_ela_scaled',
'most_recent_star_reading_percentile',
'most_recent_star_math_percentile',
'enrollment_status',
'missing_from_last_export',
'date_of_birth',
'gender',
'primary_email',
'primary_phone',
'homeroom_name',
'discipline_incidents_count',
'absences_count',
'tardies_count',
'Attendance Officer (active_service_date_started)',
'Attendance Contract (active_service_date_started)',
'Behavior Contract (active_service_date_started)',
'Community Schools (active_service_date_started)',
'Counseling, in-house (active_service_date_started)',
'Counseling, outside (active_service_date_started)',
'Reading intervention (active_service_date_started)',
'Math intervention (active_service_date_started)',
'Afterschool Tutoring (active_service_date_started)',
'SomerSession (active_service_date_started)',
'Summer Program for English Language Learners (active_service_date_started)',
'Freedom School (active_service_date_started)',
'Boston Breakthrough (active_service_date_started)',
'Calculus Project (active_service_date_started)',
'Focused Math Intervention (active_service_date_started)',
'Summer Explore (active_service_date_started)',
'BBST Meeting (last_event_note_recorded_at)',
'SST Meeting (last_event_note_recorded_at)',
'MTSS Meeting (last_event_note_recorded_at)',
'9th Grade Experience (last_event_note_recorded_at)',
'Parent conversation (last_event_note_recorded_at)',
'Something else (last_event_note_recorded_at)',
'X-Block (active_service_date_started)',
'10th Grade Experience (last_event_note_recorded_at)',
'NEST (last_event_note_recorded_at)',
'Counselor Meeting (last_event_note_recorded_at)',
'STAT Meeting (last_event_note_recorded_at)',
'CAT Meeting (last_event_note_recorded_at)',
'504 Meeting (last_event_note_recorded_at)',
'SPED Meeting (last_event_note_recorded_at)',
'Title 1 Math intervention (active_service_date_started)',
'Formal Behavior Plan (active_service_date_started)',
'Individual Counseling (active_service_date_started)',
'Soc.emo check in (active_service_date_started)',
'Social Group (active_service_date_started)',
'LLI Reading Instruction (active_service_date_started)',
'Lunch bunch (active_service_date_started)',
'Reading intervention, with specialist (active_service_date_started)',
'Math Intervention, small group (active_service_date_started)',
'SPS Heggerty, week 1 (active_service_date_started)',
'SPS Heggerty, week 5 (active_service_date_started)',
'SPS Heggerty, week 9 (active_service_date_started)',
'SPS Heggerty, week 13 (active_service_date_started)'
].sort
)
end
it 'limits default fields' do
exporter = WideStudentsExporter.new(pals.uri)
flat_row_hash = exporter.send(:flat_row_hash, school.students.first)
expect(flat_row_hash.keys).to contain_exactly(*[
'id',
'grade',
'free_reduced_lunch',
'homeroom_id',
'first_name',
'last_name',
'state_id',
'home_language',
'school_id',
'registration_date',
'local_id',
'counselor',
'hispanic_latino',
'house',
'race',
'sped_liaison',
'student_address',
'program_assigned',
'sped_placement',
'disability',
'sped_level_of_need',
'plan_504',
'limited_english_proficiency',
'ell_entry_date',
'ell_transition_date',
'most_recent_mcas_math_growth',
'most_recent_mcas_ela_growth',
'most_recent_mcas_math_performance',
'most_recent_mcas_ela_performance',
'most_recent_mcas_math_scaled',
'most_recent_mcas_ela_scaled',
'most_recent_star_reading_percentile',
'most_recent_star_math_percentile',
'enrollment_status',
'missing_from_last_export',
'date_of_birth',
'gender',
'primary_email',
'primary_phone'
])
end
end
end
end
| {
"pile_set_name": "Github"
} |
<?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
//Ensure has proper line ending before outputing a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output->writeln('Lorem ipsum dolor sit amet');
$output->listing(array(
'Lorem ipsum dolor sit amet',
'consectetur adipiscing elit',
));
//Even using write:
$output->write('Lorem ipsum dolor sit amet');
$output->listing(array(
'Lorem ipsum dolor sit amet',
'consectetur adipiscing elit',
));
$output->write('Lorem ipsum dolor sit amet');
$output->text(array(
'Lorem ipsum dolor sit amet',
'consectetur adipiscing elit',
));
$output->newLine();
$output->write('Lorem ipsum dolor sit amet');
$output->comment(array(
'Lorem ipsum dolor sit amet',
'consectetur adipiscing elit',
));
};
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2012 Sascha Hauer <[email protected]>
*/
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <soc/imx/revision.h>
#include <soc/imx/timer.h>
#include <asm/irq.h>
#include "clk.h"
#define MX31_CCM_BASE_ADDR 0x53f80000
#define MX31_GPT1_BASE_ADDR 0x53f90000
#define MX31_INT_GPT (NR_IRQS_LEGACY + 29)
#define MXC_CCM_CCMR 0x00
#define MXC_CCM_PDR0 0x04
#define MXC_CCM_PDR1 0x08
#define MXC_CCM_MPCTL 0x10
#define MXC_CCM_UPCTL 0x14
#define MXC_CCM_SRPCTL 0x18
#define MXC_CCM_CGR0 0x20
#define MXC_CCM_CGR1 0x24
#define MXC_CCM_CGR2 0x28
#define MXC_CCM_PMCR0 0x5c
static const char *mcu_main_sel[] = { "spll", "mpll", };
static const char *per_sel[] = { "per_div", "ipg", };
static const char *csi_sel[] = { "upll", "spll", };
static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
enum mx31_clks {
dummy, ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg,
per_div, per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
mstick1_gate, mstick2_gate, csi_gate, rtc_gate, wdog_gate, pwm_gate,
sim_gate, ect_gate, usb_gate, kpp_gate, ipu_gate, uart3_gate,
uart4_gate, uart5_gate, owire_gate, ssi2_gate, cspi1_gate, cspi2_gate,
gacc_gate, emi_gate, rtic_gate, firi_gate, clk_max
};
static struct clk *clk[clk_max];
static struct clk_onecell_data clk_data;
static struct clk ** const uart_clks[] __initconst = {
&clk[ipg],
&clk[uart1_gate],
&clk[uart2_gate],
&clk[uart3_gate],
&clk[uart4_gate],
&clk[uart5_gate],
NULL
};
static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
{
clk[dummy] = imx_clk_fixed("dummy", 0);
clk[ckih] = imx_clk_fixed("ckih", fref);
clk[ckil] = imx_clk_fixed("ckil", 32768);
clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "mpll", "ckih", base + MXC_CCM_MPCTL);
clk[spll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "spll", "ckih", base + MXC_CCM_SRPCTL);
clk[upll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "upll", "ckih", base + MXC_CCM_UPCTL);
clk[mcu_main] = imx_clk_mux("mcu_main", base + MXC_CCM_PMCR0, 31, 1, mcu_main_sel, ARRAY_SIZE(mcu_main_sel));
clk[hsp] = imx_clk_divider("hsp", "mcu_main", base + MXC_CCM_PDR0, 11, 3);
clk[ahb] = imx_clk_divider("ahb", "mcu_main", base + MXC_CCM_PDR0, 3, 3);
clk[nfc] = imx_clk_divider("nfc", "ahb", base + MXC_CCM_PDR0, 8, 3);
clk[ipg] = imx_clk_divider("ipg", "ahb", base + MXC_CCM_PDR0, 6, 2);
clk[per_div] = imx_clk_divider("per_div", "upll", base + MXC_CCM_PDR0, 16, 5);
clk[per] = imx_clk_mux("per", base + MXC_CCM_CCMR, 24, 1, per_sel, ARRAY_SIZE(per_sel));
clk[csi] = imx_clk_mux("csi_sel", base + MXC_CCM_CCMR, 25, 1, csi_sel, ARRAY_SIZE(csi_sel));
clk[fir] = imx_clk_mux("fir_sel", base + MXC_CCM_CCMR, 11, 2, fir_sel, ARRAY_SIZE(fir_sel));
clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MXC_CCM_PDR0, 23, 9);
clk[usb_div_pre] = imx_clk_divider("usb_div_pre", "upll", base + MXC_CCM_PDR1, 30, 2);
clk[usb_div_post] = imx_clk_divider("usb_div_post", "usb_div_pre", base + MXC_CCM_PDR1, 27, 3);
clk[fir_div_pre] = imx_clk_divider("fir_div_pre", "fir_sel", base + MXC_CCM_PDR1, 24, 3);
clk[fir_div_post] = imx_clk_divider("fir_div_post", "fir_div_pre", base + MXC_CCM_PDR1, 23, 6);
clk[sdhc1_gate] = imx_clk_gate2("sdhc1_gate", "per", base + MXC_CCM_CGR0, 0);
clk[sdhc2_gate] = imx_clk_gate2("sdhc2_gate", "per", base + MXC_CCM_CGR0, 2);
clk[gpt_gate] = imx_clk_gate2("gpt_gate", "per", base + MXC_CCM_CGR0, 4);
clk[epit1_gate] = imx_clk_gate2("epit1_gate", "per", base + MXC_CCM_CGR0, 6);
clk[epit2_gate] = imx_clk_gate2("epit2_gate", "per", base + MXC_CCM_CGR0, 8);
clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MXC_CCM_CGR0, 10);
clk[ata_gate] = imx_clk_gate2("ata_gate", "ipg", base + MXC_CCM_CGR0, 12);
clk[sdma_gate] = imx_clk_gate2("sdma_gate", "ahb", base + MXC_CCM_CGR0, 14);
clk[cspi3_gate] = imx_clk_gate2("cspi3_gate", "ipg", base + MXC_CCM_CGR0, 16);
clk[rng_gate] = imx_clk_gate2("rng_gate", "ipg", base + MXC_CCM_CGR0, 18);
clk[uart1_gate] = imx_clk_gate2("uart1_gate", "per", base + MXC_CCM_CGR0, 20);
clk[uart2_gate] = imx_clk_gate2("uart2_gate", "per", base + MXC_CCM_CGR0, 22);
clk[ssi1_gate] = imx_clk_gate2("ssi1_gate", "spll", base + MXC_CCM_CGR0, 24);
clk[i2c1_gate] = imx_clk_gate2("i2c1_gate", "per", base + MXC_CCM_CGR0, 26);
clk[i2c2_gate] = imx_clk_gate2("i2c2_gate", "per", base + MXC_CCM_CGR0, 28);
clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per", base + MXC_CCM_CGR0, 30);
clk[hantro_gate] = imx_clk_gate2("hantro_gate", "per", base + MXC_CCM_CGR1, 0);
clk[mstick1_gate] = imx_clk_gate2("mstick1_gate", "per", base + MXC_CCM_CGR1, 2);
clk[mstick2_gate] = imx_clk_gate2("mstick2_gate", "per", base + MXC_CCM_CGR1, 4);
clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MXC_CCM_CGR1, 6);
clk[rtc_gate] = imx_clk_gate2("rtc_gate", "ipg", base + MXC_CCM_CGR1, 8);
clk[wdog_gate] = imx_clk_gate2("wdog_gate", "ipg", base + MXC_CCM_CGR1, 10);
clk[pwm_gate] = imx_clk_gate2("pwm_gate", "per", base + MXC_CCM_CGR1, 12);
clk[sim_gate] = imx_clk_gate2("sim_gate", "per", base + MXC_CCM_CGR1, 14);
clk[ect_gate] = imx_clk_gate2("ect_gate", "per", base + MXC_CCM_CGR1, 16);
clk[usb_gate] = imx_clk_gate2("usb_gate", "ahb", base + MXC_CCM_CGR1, 18);
clk[kpp_gate] = imx_clk_gate2("kpp_gate", "ipg", base + MXC_CCM_CGR1, 20);
clk[ipu_gate] = imx_clk_gate2("ipu_gate", "hsp", base + MXC_CCM_CGR1, 22);
clk[uart3_gate] = imx_clk_gate2("uart3_gate", "per", base + MXC_CCM_CGR1, 24);
clk[uart4_gate] = imx_clk_gate2("uart4_gate", "per", base + MXC_CCM_CGR1, 26);
clk[uart5_gate] = imx_clk_gate2("uart5_gate", "per", base + MXC_CCM_CGR1, 28);
clk[owire_gate] = imx_clk_gate2("owire_gate", "per", base + MXC_CCM_CGR1, 30);
clk[ssi2_gate] = imx_clk_gate2("ssi2_gate", "spll", base + MXC_CCM_CGR2, 0);
clk[cspi1_gate] = imx_clk_gate2("cspi1_gate", "ipg", base + MXC_CCM_CGR2, 2);
clk[cspi2_gate] = imx_clk_gate2("cspi2_gate", "ipg", base + MXC_CCM_CGR2, 4);
clk[gacc_gate] = imx_clk_gate2("gacc_gate", "per", base + MXC_CCM_CGR2, 6);
clk[emi_gate] = imx_clk_gate2("emi_gate", "ahb", base + MXC_CCM_CGR2, 8);
clk[rtic_gate] = imx_clk_gate2("rtic_gate", "ahb", base + MXC_CCM_CGR2, 10);
clk[firi_gate] = imx_clk_gate2("firi_gate", "upll", base+MXC_CCM_CGR2, 12);
imx_check_clocks(clk, ARRAY_SIZE(clk));
clk_set_parent(clk[csi], clk[upll]);
clk_prepare_enable(clk[emi_gate]);
clk_prepare_enable(clk[iim_gate]);
mx31_revision();
clk_disable_unprepare(clk[iim_gate]);
}
int __init mx31_clocks_init(unsigned long fref)
{
void __iomem *base;
base = ioremap(MX31_CCM_BASE_ADDR, SZ_4K);
if (!base)
panic("%s: failed to map registers\n", __func__);
_mx31_clocks_init(base, fref);
clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
clk_register_clkdev(clk[cspi2_gate], NULL, "imx31-cspi.1");
clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
clk_register_clkdev(clk[ckil], "ref", "imx21-rtc");
clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.0");
clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.0");
clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.1");
clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.1");
clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.2");
clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.2");
clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
clk_register_clkdev(clk[usb_div_post], "per", "imx-udc-mx27");
clk_register_clkdev(clk[usb_gate], "ahb", "imx-udc-mx27");
clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
/* i.mx31 has the i.mx21 type uart */
clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
clk_register_clkdev(clk[uart4_gate], "per", "imx21-uart.3");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
clk_register_clkdev(clk[firi_gate], "firi", NULL);
clk_register_clkdev(clk[ata_gate], NULL, "pata_imx");
clk_register_clkdev(clk[rtic_gate], "rtic", NULL);
clk_register_clkdev(clk[rng_gate], NULL, "mxc_rnga");
clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma");
clk_register_clkdev(clk[iim_gate], "iim", NULL);
imx_register_uart_clocks(uart_clks);
mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT, GPT_TYPE_IMX31);
return 0;
}
static void __init mx31_clocks_init_dt(struct device_node *np)
{
struct device_node *osc_np;
u32 fref = 26000000; /* default */
void __iomem *ccm;
for_each_compatible_node(osc_np, NULL, "fixed-clock") {
if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m"))
continue;
if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) {
of_node_put(osc_np);
break;
}
}
ccm = of_iomap(np, 0);
if (!ccm)
panic("%s: failed to map registers\n", __func__);
_mx31_clocks_init(ccm, fref);
clk_data.clks = clk;
clk_data.clk_num = ARRAY_SIZE(clk);
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
}
CLK_OF_DECLARE(imx31_ccm, "fsl,imx31-ccm", mx31_clocks_init_dt);
| {
"pile_set_name": "Github"
} |
set(LLVM_LINK_COMPONENTS
Core
Support
)
if(NOT CLANG_BUILT_STANDALONE)
set(tablegen_deps intrinsics_gen)
endif()
add_clang_tool(clang-import-test
clang-import-test.cpp
DEPENDS
${tablegen_deps}
)
set(CLANG_IMPORT_TEST_LIB_DEPS
clangAST
clangBasic
clangCodeGen
clangDriver
clangFrontend
clangLex
clangParse
)
target_link_libraries(clang-import-test
PRIVATE
${CLANG_IMPORT_TEST_LIB_DEPS}
)
| {
"pile_set_name": "Github"
} |
// Copyright 2018 Google LLC
//
// 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 com.google.api.ads.adwords.jaxws.v201809.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Returns a list of conversion trackers that match the query.
*
* @param query The SQL-like AWQL query string.
* @return A list of conversion trackers.
* @throws ApiException if problems occur while parsing the query or fetching conversion trackers.
*
*
* <p>Java class for query element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="query">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="query" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"query"
})
@XmlRootElement(name = "query")
public class ConversionTrackerServiceInterfacequery {
protected String query;
/**
* Gets the value of the query property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getQuery() {
return query;
}
/**
* Sets the value of the query property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setQuery(String value) {
this.query = value;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" spacing="10.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="se.llbit.chunky.ui.SceneChooserController">
<children>
<Label text="Select scene to load:" />
<TableView fx:id="sceneTbl" maxHeight="1.7976931348623157E308" prefHeight="293.0" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="nameCol" prefWidth="120.0" text="Name" />
<TableColumn fx:id="chunkCountCol" prefWidth="88.0" text="Chunks" />
<TableColumn fx:id="sizeCol" prefWidth="104.0" text="Size" />
<TableColumn fx:id="sppCol" prefWidth="134.0" text="Current SPP" />
<TableColumn fx:id="renderTimeCol" prefWidth="133.0" text="Render time" />
</columns>
</TableView>
<HBox alignment="TOP_RIGHT" spacing="10.0">
<children>
<Button fx:id="deleteBtn" mnemonicParsing="false" text="Delete" />
<Button fx:id="exportBtn" mnemonicParsing="false" text="Export" />
<Button fx:id="cancelBtn" cancelButton="true" mnemonicParsing="false" text="Cancel" />
<Button fx:id="loadSceneBtn" defaultButton="true" mnemonicParsing="false" text="Load selected scene" />
</children>
</HBox>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
| {
"pile_set_name": "Github"
} |
### Code examples related to big jobs/simultations
[`chunk_ref.Rmd`](chunk_ref.Rmd) is a short R Markdown file illustrating
chunk references.
[`chunk_dep.Rmd`](chunk_dep.Rmd) is a short R Markdown file illustrating
chunk dependencies, in regard to chunk caching.
[`Makefile`](Makefile) is a Makefile for compiling `chunk_ref.Rmd` and `chunk_dep.Rmd`.
[`create_Rsub.pl`](create_Rsub.pl) is my Perl script for turning a
template R script into a set of R input files.
| {
"pile_set_name": "Github"
} |
# If there are no hosts configured, disable this environment.
if CONFIG['influxdb_hosts'].blank?
InfluxDB::Rails.configure do |config|
config.ignored_environments << Rails.env
end
return
end
InfluxDB::Rails.configure do |config|
config.client.database = CONFIG['influxdb_database'] || 'performance'
config.client.username = CONFIG['influxdb_username'] || 'root'
config.client.password = CONFIG['influxdb_password'] || 'root'
config.client.hosts = CONFIG['influxdb_hosts']
config.client.port = CONFIG['influxdb_port'] || '8086'
config.client.retry = CONFIG['influxdb_retry'] || false
config.client.use_ssl = CONFIG['influxdb_ssl'] || false
config.client.time_precision = CONFIG['influxdb_time_precision'] || 's'
end
| {
"pile_set_name": "Github"
} |
SECTION code_clib
SECTION code_l
PUBLIC l_lsr_dehldehl
INCLUDE "config_private.inc"
; logical shift right 64-bit unsigned long
;
; enter : dehl'dehl = 64-bit number
; a = shift amount
;
; exit : dehl'dehl = dehl'dehl >> a
;
; uses : af, b, de, hl, de', hl'
IF __CLIB_OPT_IMATH_SELECT & $02
EXTERN l_fast_lsr_dehldehl
defc l_lsr_dehldehl = l_fast_lsr_dehldehl
ELSE
EXTERN l_small_lsr_dehldehl
defc l_lsr_dehldehl = l_small_lsr_dehldehl
ENDIF
| {
"pile_set_name": "Github"
} |
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <RWStepVisual_RWOverRidingStyledItem.ixx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepVisual_OverRidingStyledItem.hxx>
RWStepVisual_RWOverRidingStyledItem::RWStepVisual_RWOverRidingStyledItem () {}
void RWStepVisual_RWOverRidingStyledItem::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_OverRidingStyledItem)& ent) const
{
// --- Number of Parameter Control ---
if (!data->CheckNbParams(num,4,ach,"over_riding_styled_item")) return;
// --- inherited field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- inherited field : styles ---
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
Handle(StepVisual_PresentationStyleAssignment) anent2;
Standard_Integer nsub2;
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
Standard_Integer nb2 = data->NbParams(nsub2);
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
aStyles->SetValue(i2, anent2);
}
}
// --- inherited field : item ---
Handle(StepRepr_RepresentationItem) aItem;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 3,"item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
// --- own field : overRiddenStyle ---
Handle(StepVisual_StyledItem) aOverRiddenStyle;
//szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
data->ReadEntity(num, 4,"over_ridden_style", ach, STANDARD_TYPE(StepVisual_StyledItem), aOverRiddenStyle);
//--- Initialisation of the read entity ---
ent->Init(aName, aStyles, aItem, aOverRiddenStyle);
}
void RWStepVisual_RWOverRidingStyledItem::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_OverRidingStyledItem)& ent) const
{
// --- inherited field name ---
SW.Send(ent->Name());
// --- inherited field styles ---
SW.OpenSub();
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
SW.Send(ent->StylesValue(i2));
}
SW.CloseSub();
// --- inherited field item ---
SW.Send(ent->Item());
// --- own field : overRiddenStyle ---
SW.Send(ent->OverRiddenStyle());
}
void RWStepVisual_RWOverRidingStyledItem::Share(const Handle(StepVisual_OverRidingStyledItem)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer nbElem1 = ent->NbStyles();
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
iter.GetOneItem(ent->StylesValue(is1));
}
iter.GetOneItem(ent->Item());
iter.GetOneItem(ent->OverRiddenStyle());
}
| {
"pile_set_name": "Github"
} |
// docs/delete-by-query.asciidoc:456
[source, php]
----
$response = $client->indices()->refresh();
$params = [
'index' => 'twitter',
'body' => [
'query' => [
'range' => [
'likes' => [
'lt' => 10,
],
],
],
],
];
$response = $client->search($params);
----
| {
"pile_set_name": "Github"
} |
/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/
package org.netbeans.modules.php.drupal.drush.ui;
import java.util.EventObject;
/**
*
* @author Jamie Holly <[email protected]>
*/
public class CommandProcessorEvent extends EventObject {
public CommandProcessorEvent(Object source) {
super(source);
}
}
| {
"pile_set_name": "Github"
} |
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
class Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor extends Google_Model
{
public $metricType;
public $valueType;
public function setMetricType($metricType)
{
$this->metricType = $metricType;
}
public function getMetricType()
{
return $this->metricType;
}
public function setValueType($valueType)
{
$this->valueType = $valueType;
}
public function getValueType()
{
return $this->valueType;
}
}
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* Copyright 2012-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file.
* This file 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.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.Comprehend;
using Amazon.Comprehend.Model;
namespace Amazon.PowerShell.Cmdlets.COMP
{
/// <summary>
/// Gets a list of the document classifiers that you have created.<br/><br/>This cmdlet automatically pages all available results to the pipeline - parameters related to iteration are only needed if you want to manually control the paginated output. To disable autopagination, use -NoAutoIteration.
/// </summary>
[Cmdlet("Get", "COMPDocumentClassifierList")]
[OutputType("Amazon.Comprehend.Model.DocumentClassifierProperties")]
[AWSCmdlet("Calls the Amazon Comprehend ListDocumentClassifiers API operation.", Operation = new[] {"ListDocumentClassifiers"}, SelectReturnType = typeof(Amazon.Comprehend.Model.ListDocumentClassifiersResponse))]
[AWSCmdletOutput("Amazon.Comprehend.Model.DocumentClassifierProperties or Amazon.Comprehend.Model.ListDocumentClassifiersResponse",
"This cmdlet returns a collection of Amazon.Comprehend.Model.DocumentClassifierProperties objects.",
"The service call response (type Amazon.Comprehend.Model.ListDocumentClassifiersResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class GetCOMPDocumentClassifierListCmdlet : AmazonComprehendClientCmdlet, IExecutor
{
#region Parameter Filter_Status
/// <summary>
/// <para>
/// <para>Filters the list of classifiers based on status. </para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.Comprehend.ModelStatus")]
public Amazon.Comprehend.ModelStatus Filter_Status { get; set; }
#endregion
#region Parameter Filter_SubmitTimeAfter
/// <summary>
/// <para>
/// <para>Filters the list of classifiers based on the time that the classifier was submitted
/// for processing. Returns only classifiers submitted after the specified time. Classifiers
/// are returned in descending order, newest to oldest.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.DateTime? Filter_SubmitTimeAfter { get; set; }
#endregion
#region Parameter Filter_SubmitTimeBefore
/// <summary>
/// <para>
/// <para>Filters the list of classifiers based on the time that the classifier was submitted
/// for processing. Returns only classifiers submitted before the specified time. Classifiers
/// are returned in ascending order, oldest to newest.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.DateTime? Filter_SubmitTimeBefore { get; set; }
#endregion
#region Parameter MaxResult
/// <summary>
/// <para>
/// <para>The maximum number of results to return in each page. The default is 100.</para>
/// </para>
/// <para>
/// <br/><b>Note:</b> In AWSPowerShell and AWSPowerShell.NetCore this parameter is used to limit the total number of items returned by the cmdlet.
/// <br/>In AWS.Tools this parameter is simply passed to the service to specify how many items should be returned by each service call.
/// <br/>Pipe the output of this cmdlet into Select-Object -First to terminate retrieving data pages early and control the number of items returned.
/// </para>
/// <para>If a value for this parameter is not specified the cmdlet will use a default value of '<b>500</b>'.</para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("MaxItems","MaxResults")]
public int? MaxResult { get; set; }
#endregion
#region Parameter NextToken
/// <summary>
/// <para>
/// <para>Identifies the next page of results to return.</para>
/// </para>
/// <para>
/// <br/><b>Note:</b> This parameter is only used if you are manually controlling output pagination of the service API call.
/// <br/>In order to manually control output pagination, use '-NextToken $null' for the first call and '-NextToken $AWSHistory.LastServiceResponse.NextToken' for subsequent calls.
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String NextToken { get; set; }
#endregion
#region Parameter Select
/// <summary>
/// Use the -Select parameter to control the cmdlet output. The default value is 'DocumentClassifierPropertiesList'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Comprehend.Model.ListDocumentClassifiersResponse).
/// Specifying the name of a property of type Amazon.Comprehend.Model.ListDocumentClassifiersResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "DocumentClassifierPropertiesList";
#endregion
#region Parameter NoAutoIteration
/// <summary>
/// By default the cmdlet will auto-iterate and retrieve all results to the pipeline by performing multiple
/// service calls. If set, the cmdlet will retrieve only the next 'page' of results using the value of NextToken
/// as the start point.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter NoAutoIteration { get; set; }
#endregion
protected override void ProcessRecord()
{
base.ProcessRecord();
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate<Amazon.Comprehend.Model.ListDocumentClassifiersResponse, GetCOMPDocumentClassifierListCmdlet>(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
}
context.Filter_Status = this.Filter_Status;
context.Filter_SubmitTimeAfter = this.Filter_SubmitTimeAfter;
context.Filter_SubmitTimeBefore = this.Filter_SubmitTimeBefore;
context.MaxResult = this.MaxResult;
#if MODULAR
if (!ParameterWasBound(nameof(this.MaxResult)))
{
WriteVerbose("MaxResult parameter unset, using default value of '500'");
context.MaxResult = 500;
}
#endif
#if !MODULAR
if (ParameterWasBound(nameof(this.MaxResult)) && this.MaxResult.HasValue)
{
WriteWarning("AWSPowerShell and AWSPowerShell.NetCore use the MaxResult parameter to limit the total number of items returned by the cmdlet." +
" This behavior is obsolete and will be removed in a future version of these modules. Pipe the output of this cmdlet into Select-Object -First to terminate" +
" retrieving data pages early and control the number of items returned. AWS.Tools already implements the new behavior of simply passing MaxResult" +
" to the service to specify how many items should be returned by each service call.");
}
#endif
context.NextToken = this.NextToken;
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
#if MODULAR
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
var useParameterSelect = this.Select.StartsWith("^");
// create request and set iteration invariants
var request = new Amazon.Comprehend.Model.ListDocumentClassifiersRequest();
// populate Filter
var requestFilterIsNull = true;
request.Filter = new Amazon.Comprehend.Model.DocumentClassifierFilter();
Amazon.Comprehend.ModelStatus requestFilter_filter_Status = null;
if (cmdletContext.Filter_Status != null)
{
requestFilter_filter_Status = cmdletContext.Filter_Status;
}
if (requestFilter_filter_Status != null)
{
request.Filter.Status = requestFilter_filter_Status;
requestFilterIsNull = false;
}
System.DateTime? requestFilter_filter_SubmitTimeAfter = null;
if (cmdletContext.Filter_SubmitTimeAfter != null)
{
requestFilter_filter_SubmitTimeAfter = cmdletContext.Filter_SubmitTimeAfter.Value;
}
if (requestFilter_filter_SubmitTimeAfter != null)
{
request.Filter.SubmitTimeAfter = requestFilter_filter_SubmitTimeAfter.Value;
requestFilterIsNull = false;
}
System.DateTime? requestFilter_filter_SubmitTimeBefore = null;
if (cmdletContext.Filter_SubmitTimeBefore != null)
{
requestFilter_filter_SubmitTimeBefore = cmdletContext.Filter_SubmitTimeBefore.Value;
}
if (requestFilter_filter_SubmitTimeBefore != null)
{
request.Filter.SubmitTimeBefore = requestFilter_filter_SubmitTimeBefore.Value;
requestFilterIsNull = false;
}
// determine if request.Filter should be set to null
if (requestFilterIsNull)
{
request.Filter = null;
}
if (cmdletContext.MaxResult != null)
{
request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value);
}
// Initialize loop variant and commence piping
var _nextToken = cmdletContext.NextToken;
var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
do
{
request.NextToken = _nextToken;
CmdletOutput output;
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
if (!useParameterSelect)
{
pipelineOutput = cmdletContext.Select(response, this);
}
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
_nextToken = response.NextToken;
}
catch (Exception e)
{
output = new CmdletOutput { ErrorResponse = e };
}
ProcessOutput(output);
} while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));
if (useParameterSelect)
{
WriteObject(cmdletContext.Select(null, this));
}
return null;
}
#else
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
var useParameterSelect = this.Select.StartsWith("^");
// create request and set iteration invariants
var request = new Amazon.Comprehend.Model.ListDocumentClassifiersRequest();
// populate Filter
var requestFilterIsNull = true;
request.Filter = new Amazon.Comprehend.Model.DocumentClassifierFilter();
Amazon.Comprehend.ModelStatus requestFilter_filter_Status = null;
if (cmdletContext.Filter_Status != null)
{
requestFilter_filter_Status = cmdletContext.Filter_Status;
}
if (requestFilter_filter_Status != null)
{
request.Filter.Status = requestFilter_filter_Status;
requestFilterIsNull = false;
}
System.DateTime? requestFilter_filter_SubmitTimeAfter = null;
if (cmdletContext.Filter_SubmitTimeAfter != null)
{
requestFilter_filter_SubmitTimeAfter = cmdletContext.Filter_SubmitTimeAfter.Value;
}
if (requestFilter_filter_SubmitTimeAfter != null)
{
request.Filter.SubmitTimeAfter = requestFilter_filter_SubmitTimeAfter.Value;
requestFilterIsNull = false;
}
System.DateTime? requestFilter_filter_SubmitTimeBefore = null;
if (cmdletContext.Filter_SubmitTimeBefore != null)
{
requestFilter_filter_SubmitTimeBefore = cmdletContext.Filter_SubmitTimeBefore.Value;
}
if (requestFilter_filter_SubmitTimeBefore != null)
{
request.Filter.SubmitTimeBefore = requestFilter_filter_SubmitTimeBefore.Value;
requestFilterIsNull = false;
}
// determine if request.Filter should be set to null
if (requestFilterIsNull)
{
request.Filter = null;
}
// Initialize loop variants and commence piping
System.String _nextToken = null;
int? _emitLimit = null;
int _retrievedSoFar = 0;
if (AutoIterationHelpers.HasValue(cmdletContext.NextToken))
{
_nextToken = cmdletContext.NextToken;
}
if (cmdletContext.MaxResult.HasValue)
{
// The service has a maximum page size of 500. If the user has
// asked for more items than page max, and there is no page size
// configured, we rely on the service ignoring the set maximum
// and giving us 500 items back. If a page size is set, that will
// be used to configure the pagination.
// We'll make further calls to satisfy the user's request.
_emitLimit = cmdletContext.MaxResult;
}
var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
do
{
request.NextToken = _nextToken;
if (_emitLimit.HasValue)
{
int correctPageSize = Math.Min(500, _emitLimit.Value);
request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize);
}
else if (!ParameterWasBound(nameof(this.MaxResult)))
{
request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(500);
}
CmdletOutput output;
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
if (!useParameterSelect)
{
pipelineOutput = cmdletContext.Select(response, this);
}
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
int _receivedThisCall = response.DocumentClassifierPropertiesList.Count;
_nextToken = response.NextToken;
_retrievedSoFar += _receivedThisCall;
if (_emitLimit.HasValue)
{
_emitLimit -= _receivedThisCall;
}
}
catch (Exception e)
{
if (_retrievedSoFar == 0 || !_emitLimit.HasValue)
{
output = new CmdletOutput { ErrorResponse = e };
}
else
{
break;
}
}
ProcessOutput(output);
} while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1));
if (useParameterSelect)
{
WriteObject(cmdletContext.Select(null, this));
}
return null;
}
#endif
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.Comprehend.Model.ListDocumentClassifiersResponse CallAWSServiceOperation(IAmazonComprehend client, Amazon.Comprehend.Model.ListDocumentClassifiersRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Comprehend", "ListDocumentClassifiers");
try
{
#if DESKTOP
return client.ListDocumentClassifiers(request);
#elif CORECLR
return client.ListDocumentClassifiersAsync(request).GetAwaiter().GetResult();
#else
#error "Unknown build edition"
#endif
}
catch (AmazonServiceException exc)
{
var webException = exc.InnerException as System.Net.WebException;
if (webException != null)
{
throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
}
throw;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public Amazon.Comprehend.ModelStatus Filter_Status { get; set; }
public System.DateTime? Filter_SubmitTimeAfter { get; set; }
public System.DateTime? Filter_SubmitTimeBefore { get; set; }
public int? MaxResult { get; set; }
public System.String NextToken { get; set; }
public System.Func<Amazon.Comprehend.Model.ListDocumentClassifiersResponse, GetCOMPDocumentClassifierListCmdlet, object> Select { get; set; } =
(response, cmdlet) => response.DocumentClassifierPropertiesList;
}
}
}
| {
"pile_set_name": "Github"
} |
Open Distro for Elasticsearch JDBC
Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>org.python.pydev.parser.tests</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<parent>
<groupId>org.python.pydev</groupId>
<artifactId>tests</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
</project>
| {
"pile_set_name": "Github"
} |
/*
* Exchange Web Services Managed API
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
* MIT License
*
* 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.
*/
namespace Microsoft.Exchange.WebServices.Data
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Represents the abstraction of an item Id.
/// </summary>
internal abstract class AbstractItemIdWrapper
{
/// <summary>
/// Initializes a new instance of the <see cref="AbstractItemIdWrapper"/> class.
/// </summary>
internal AbstractItemIdWrapper()
{
}
/// <summary>
/// Obtains the ItemBase object associated with the wrapper.
/// </summary>
/// <returns>The ItemBase object associated with the wrapper.</returns>
public virtual Item GetItem()
{
return null;
}
/// <summary>
/// Writes the Id encapsulated in the wrapper to XML.
/// </summary>
/// <param name="writer">The writer to write the Id to.</param>
internal abstract void WriteToXml(EwsServiceXmlWriter writer);
}
} | {
"pile_set_name": "Github"
} |
% This is the groff hyphenation pattern file `hyphen.cs' for Czech.
%
% It is based on the TeX pattern file `czhyphen.tex', version 3 (1995),
% prepared by Pavel ©eveèek <[email protected]>.
%
% Here is the copyright message:
%
% This 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 file 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
%
% Please check the original file for more details.
%
% It has been made suitable for groff by expanding all macros to real
% characters in latin-2 encoding.
%
\patterns{
.a2
.a4da
.a4de
.a4di
.a4do
.a4dé
.a4kl
.a4ko
.a4kr
.a4ku
.ale3x
.a4ra
.a4re
.a4ri
.a4ro
.a4ry
.a4rá
.a4sa
.a4se
.a4so
.as3t3
.a4sy
.a4ta
.a4te
.at3l
.a4to
.a4tr
.a4ty
.a4ve
.b2
.c2
.ch2
.cyk3
.d2
.dez3
.d4na
.dne4
.dne¹4k
.d4ny
.dos4
.d4ve
.d4vì
.d4ví
.e2
.e4ch
.e4ko
.es3k
.es3t
.e4ve
.f4ri
.g2
.h2
.h4le
.h4ne
.i2
.i4na
.i4ni
.i4no
.is3l
.j2
.j4ak
.je4dl
.j4se
.j4zd
.jád4
.k2
.k4li
.k4ly
.køí3d
.l2
.le4gr
.li3kv
.m2
.mi3st4
.moud3
.na3è4
.ne3c
.neè4
.ne3¹
.ni2t
.no4s3t
.n4vp
.ná1
.náø4k
.o2
.o4bé
.ode3
.od3l
.od3rá
.o4ka
.o4ko
.o4na
.o4ne
.o4ni
.o4no
.o4nu
.o4ny
.o4nì
.o4ní
.o4pe
.o4po
.o4se
.o4sl
.os4to
.os3t3r
.os4tì
.ot3rá
.ot3v
.o4tí
.o4tø
.ovì4t
.o4za
.oz3do
.o4zi
.o4zo
.o4zu
.o4¹k
.o4¹l
.o4¾i
.p2
.pa4re
.pa3tø
.polk4l
.po3è4
.p4ro
.p4rý
.p4se
.pu3b
.r2
.rej4
.re3s
.ro4k
.roze3
.roz3r
.ru4dl
.s2
.s4ch
.s4ci
.sem4
.se3pn
.s4ke
.sk4l
.s4ká
.s4le
.s4na
.s4ny
.s4pe
.s4po
.st2
.s4tá
.s4¾i
.t2
.u2
.u4ba
.u4be
.u4bi
.u4bo
.u4de
.u4di
.u4do
.u4du
.u4dí
.uh4n
.uj4m
.u4ko
.u4ku
.ul4h
.u4ma
.u4me
.u4mi
.u4mu
.u4ne
.u4ni
.u4pa
.u4pe
.u4pi
.up4n
.u4po
.u4pu
.u4pá
.u4pì
.u4pí
.u4ra
.u4ro
.u4rá
.us2
.u4so
.u4st
.u4sy
.u4sí
.ut2
.u4vi
.u4ze
.u4èe
.u4èi
.u4èí
.u4¹e
.u4¹i
.u4¹k
.u¹4t
.u4¹í
.u4¾i
.u¾4n
.u4¾o
.u4¾í
.v2
.va4dl
.v4po
.vy3
.v4zá
.vý1
.v4¾i
.y4or
.y4ve
.z2
.za3
.zao3s
.zar2
.zaè2
.zd2
.z4di
.z4dr
.z4ky
.z4mn
.z4no
.z4nu
.z4nì
.z4ní
.z4pe
.z4po
.z4tø
.z4ve
.z4vi
.è2
.è4te
.é2
.í2
.ó2
.¹2
.¹e3t
.¹4ka
.¹4ke
.¹4ky
.¹4»o
.¹4»á
.ú2
.ú4dù
.¾2
a1
2a.
aa3t2
ab3lon
ab4lý
ab3ri
ab4sb
ab2st
ac4ci
a2d
a3da
a3de
a3di
ad2la
a4dli
a4dlá
a4dlé
ad4me
ad4mu
a3do
ado4s
a3d3ra
ad3ri
a3dr¾
a3du
a4du¾
3a3dva
ad3vo
a3dy
a3dá
a3dé
a3dì
a3dí
ad4úz
ad4úø
a3dù
a3dý
ae4vi
afi2a
a2g
a3ga
ag4fa
a3go
ag3ro
a3gu
a3gá
ah4li
ah3v
a2i
a3in
ai4re
a3iv
a2jd
a2jm
aj4me
aj2o
a2k
a3ke
a3ki
a3kl
ak4ni
a3ko
a3kr
a3ku
a3ky
a3ká
a3ké
a3kó
a3kù
a3ký
al4fb
al4kl
al4tz
al3¾í
am4bd
am4kl
am4nu
amo3s
am4¾i
a4nae
a4name
an4dt
ane4sk
aneu4
an4sc
an4sg
an4sl
an4sm
an2sp
an4sv
an4tè
an4¾h
ao4ed
ao4hm
ao4stø
ao4tè
ap4r.
a4pso
ap3t
a4pø.
a2r
a3ra
ar4dw
a3re
a4rer
ar4gl
a3ri
ar4kh
a3ro
a4rox
ar3st
a3ru
ar2va
a3ry
a3rá
a3ró
ar3¹2
ar4¹r
a3rù
arùs3
a3rý
a2s
a3sa
a3se
a3sh
a3sin
as3ná
a3so
as3pi
as4tat
a4stk
as4tm
a4stru.
as3tv
a3su
a3sv
a3sy
a3sá
a3sé
a3sí
a3sù
a2t
a3ta
at4ch
a3te
a3ti
a4tio
at4kl
at3lo
a3to
a3tr
at3re
at3ron
at3rov
a4tru
at4rá
at4th
a3tu
a3tv
a3ty
a3tá
a3té
a3tì
a3tí
a3tó
at1ø
a4tøí.
a3tù
a3tý
a2u
au4gs
a3uj
auj4m
aus3t
a3uè
2av
av3d
av4d.
av3lo
a4vlu
a4vlí
av3t
av4ti
2ay
ay4on
az3k
az3la
az4lé
az3ni
a3zp
a2è
a3èa
a3èe
a3èi
a3èl
aè4má
a3èo
a3èu
a3èá
a3èí
a3èù
a2ò
a3òo
a3òu
aøe4k
a3øí
a4¹pl
a4¹py
a2»
aú3t
2b.
3ba.
ba4br
ba4chr
ba3ka
ba4se
2b1c
b1d
be4ef
be4et
bej4m
be3p
beu4r
be2z3
beze3
b1h
1bi
bi2b3
bis3
bist4
bi4tr
b1j
2bk
3bl.
bl4bl
b2lem
b2les
3blk
b4lán
b2lém
b1m
2bn
1bo
bo4et
bo4jm
bo4ok
bo4tr
bou3s
bo4¹k
b2ral
b2ran
2bri
b4rodit
b4rou
broz4
b2ru
b3ru.
b3rub
b2rán
2b1s2
bs3tr
2b1t
btáh4
bu2c
bu4en
3by.
bys3
by4sm
by4tè
by4zn
b2z
1bá
2b1è
bé4rc
1bì.
bì3ta
1bí
3bín
bí4rc
2bò
b3øa
b3øe.
bøe4s
b1øí
2b¹2
2c.
1ca
cad4l
ca4es
2cc
1ce
cech4
ced4l
celo3
ce4ns
ce4ov
ce4ps
cer4v
ce2u
2ch.
1cha
4chalg
3che
4che.
2chl
ch4ly
ch4mb
2ch3n
2cht
4chte
1chu
ch4u.
1chy
1chá
2chø
1ci
cien4c
cik4l
2ck2
c4ket
ckte4rý
2cl
c3la
c3lé
2cn
1co
co4at
co4mm
co4¾p
c2p
2ct
c2ti
ctis4
ct4la
ct2n
c3tv
c2tì
cuk1
1c2v
cy2
1cá
1cí
cí4pl
2cò
1cù
2d.
1da
da3d
da4j¹
da4kl
da4tr
d1b
d2ba
4dbat.
d2bá
2d1c
dch4l
3dch4n
d1d
dd4ha
1de
de4bre
de3hn
de3jd
dej4mo
de3kl
de3kv
de2na
de2oz
de3sl
de4sm
de4so
de2sp
des4t
de3str
de1x
de4xt
de2z
de3zn
dez3o
de3èt
de4¾p
2d1h
1di
di4gg
4dind
dis3k
di4so
d1j
dj4us
2dk
d3kv
3dl.
d1la
d4lab
d4lak
d3li
1dln
d2lou
d3lou.
d2lu
d3luè
d4lá¾
d1lé
2d1lí
d2lù
d1m
1dmd
dmý¹4
2dn
1do
4dobl
4doboj
dob4rat
do3by
do3bì
do3bý
do1d
4do4dd
4do4dj
dod4n
do3h
doj4m
4dokn
4doly
do3mn
domoh4
do3p
do4pc
dop4n
dor2v
do1s
dos4p
dos4tiv
do3t
do3uk
do3uè
do3z2
doz4n
do3è
4do4èn
doè4t
do4¾p
4dran
d4rap
d1re
d4ren
3drobn
d3ros
d3rou
d3ro¹
dr4sc
d3ru¹
d3ré
d3rý
d4rýv
2d1s2
ds4kù
ds4po
d1t
d3tl
d3tø
1du
dum3ø
du3na
du3p
du4pn
2dur
du3si
du4í.
d2v
d4vac
d3ve
d3vl
d3vr
d3vy
d3vá
d3vì
d3ví
1dy
dy4su
d3zb
d3zd
d3zn
1dá
2d1è
1dé
1dì
3dìj
1dí
2dò
d1øa
døe4k
d4øep
døe4pn
d4øev
d1øí
d2øít
2d¹2
d3¹k
d3¹t
1dù
3dù.
dù3s
1dý
d2¾2
2e.
e1a
ea3dr
e2ar
e1b
eb4er
ebez2
eb4li
e2bø
e4ch.
e3chl.
e4chm
e3cho
e2chr
e3chv
e4ch»
ed4be
ed4kv
ed1l
ed2ma
e3dmn
ed3v
ed4øí
e1e
ee4th
ee3xi
eg4gi
e1ha
e1he
ehno4
eh4nì
e1ho
e1hr
e1hu
e1hy
e1há
e1hý
e1i
eilus3
ej3ag
e3jas
e1je
e3jed
ej3ele
e3jez
ej3in
e3jis
ej1m
ej3mo
e3jmu
ej1o
ej1u
eju3st
ej3v
e2k
e3ka
e3ke
e4kly
e3ko
e3kr
e3ku
e3ky
e3ká
e3ké
e3kó
e3kø
e3kù
e1la
e4lau
el4dv
e1le
e1lo
e1lu
e1ly
el4ze
e1lá
e1lé
e1lí
e1ml
e4mlí
emo3k
e1mr
e1my
e3má
e1mì
e1mí
e3mø
e3mù
e1mý
em3¾e
en4dv
enitos4
en4sc
en4si
ent3r
e1o
eo3by
eoch3r
eod3l
eo4du
e4ole
eo1s
eo2st
eo4tø
eo3z
eo4zb
eo4zd
eo¹e3
epa3t
e2pl
e4pni
ep2no
e4pný
epoè3t
epro4zø
ep4tl
ep4tm
ep4tn
e4ptu
epy3
2er
e1ra
er4a.
e1re
e1ri
e1ro
er3s
er4s.
er4sn
e1ru
e1ry
e1rá
e1ré
e1rù
e1rý
e1s
e4sag
e2sce
e4sin
esi4s
e2sk
es4k.
e4s4kn
es3ku.
es3ky
es3ké
e2sl
e4s3li
e4sly
es2m
e4sp.
es4pe
e2st
e4st.
e4ste
es3ti¾
es4tol
e4strou
es3tán
e1t
e4tki
e4tkr
e4tli
e4tly
et3ri
et3ro
et3rù
et1ø
et4ún
e1u
eu3b
eu3ct
eu3d
eu3k
eu3m
eu4m.
eu3n
eu3p
eu3r
eu4r.
e4ura
eu4ras
eu4rg
eu3s2
eu3t
e4u4t.
eu4tra
eu4ts
eu3v
eu3z
eu3¾
e3vd
eve4¹
e3v2k
e4vsk
evy3
evyjad4
evypá4t
evy4èk
evì4tr
ex4ta
e3xu
ey4or
ey4ov
ezaos3
ez4ap
ez4bo
ez3de
ez3dov
ez3du
ez4dì
e3ze
ez4ed2
ez4ej
ez4el
ez4er
ez4es
ez4ez
ez4e¹
ezis4
ez4it
ez4le
ez4ná
ez4nì
ez4py
ez2t
ez4ác
ez4áh
ez4èe
e3zí
e3zø
ez4øe
e1á
eè4kat
e1èt
eè4te
e4èti
e4ètí
e2ò
e3òo
e3òu
e3òá
e3ón
e1ø
eøe4k
eø4ku
e3øí
e2¹
e3¹e
e3¹i
e4¹ka
e3¹l
e¹4lá
e3¹o
e¹4to
e¹tíh4
e3¹í
eú1
eúmy4
eú3n
eú3p
eú3t
eú3è
e¾í¹4
1f
2f.
fe4in
fene4
fe4ue
fi4em
fi4fl
f2l
f3lí
fló4r
fm4no
2fn
2fr
f4ran
f4ras
3frek
f1ri
2fs
fs4te
2ft
fu4ch
2fé
f2ú
1g
2g.
ga4uè
ge2s
ghou4
3gic
3gin
gi4ím
g4lom
2g1m
2gn
g4noi
g4nos
go1
go4hm
3graf
gu4el
gu4it
gu3m
gu4m.
gus4t
gu3v
2h.
ha4ag
ha4ar
ha4bl
ha4br
ha3dl
ha4dla
ha4ke
has3t
hatos4
ha4yd
h2b
h2c
2hd
he4br
he4id
hej4s
he2s
he2u
he3x
hi4an
hi3er
hi4gh
hi4re
2hk
4hla.
h4led
h3len
2hli
4h3lo.
h3lob
h3lop
h3lov
h3luj
2h1ly
4hlá.
h4lás
h3lí.
4hlík
2hlý
h2m
2h2n
h3ne
h4ned
h3niv
h4noj
3hnìd
3hodin
ho3str
hos4tì
4hove
4hovna
4hovny
4hovná
4hovnì
h2r
hra4p
2h1t
h4tin
h2tì
h4tít
hu4ch
hu3mo
hu4tò
2h2v
hyd1
hy4do
hy4ps
hys3
hy2t3r
hy4zd
h1è
2hò
hø2
hø4by
hý4bl
h2¾
2i.
i1a
ia3d
ia3g2
i4al.
ias4t
ia4tr
i1b
ib2l
i2b1r
i1ch
i4ch¾
i1d
id4ge
id2l
id4lo.
i4dlý
i1em
i1en
i1et
if1r
ig4ne
i1h
i2hl
i3hl.
i4hli
ih3n
ih4na
i3im
i1j
ijed4
ij4me
ij4mi
i2kl
ik3le
ik3lo.
ik3m
ik4ry
i4kve
ik4úø
i1l
il4ba
iliè4n
i4lnu
ilu3
i1m
i4mla
i4mly
i4mun
i2n
i3na
ina3d
in4cm
in4dl
i3ne
3infe
in4gh
in4gp
in4gs
in4gt
i3ni
i3no
i3nu
i3ny
i3ná
i3né
i3nì
i3ní
in4¹p
i3nù
i3ný
i1o
io4sk
i2ps
i1r
iro4s
i1sa
is3c
is4ch
is4k.
is3ka
is3ke
is3ko.
is3kr
is3ku
is3kv
is3ky
i3slav
is3lo
is3lé
is3pl
is3po
is1t
is4tal
is4tat
is4th
ist3v
is3tí
i1sy
i3sá
i1t
it1r
it4rh
it4rp
it4se
it4su
i2tv
i1um
iv3d
i1x
ix4td
i3zp
iz1r
i1á
i1èl
iè3t
iè4tl
iè4to
i2ï
i1é
ié4re.
i1íc
i1ím
i1ó
i1ø
iø4kl
iø4èe
i2¹
i3¹e
i3¹i
i¹3k
i¹4kr
i¹4kv
i3¹o
i¹4to
i3¹u
i3¹á
i3¹í
i2¾
i3¾a
i3¾e
i3¾i
i3¾o
i3¾u
i3¾á
2j.
ja2b2
jac4k
ja4cq
ja3d
ja3g
j3akt
j1b2
jbyst3
2j1c
j2d
j3dob
j3dok
j3dos
j3dr
j3dá
jd4øí
j3dù
jech4
j3ef
j3ex
jez3dí
jg4ra
2j1h
1ji
ji4ch
jih3l
ji4m¾
j4ina
jis3k
jit4ro
ji2zv
j1j
2jk
j3kv
2j1l
j2m
j3ma
j3mi
jmou3d
2jmí
2jn
jne3
j1ob
j1od
jod2ø
j1oh
j1op
j4ora
j1os
jo3sv
j2ov
j3ovl
j1o3z2
2jp
jpor4
jpo4zv
jpøíz4
2j1r
2j1s2
j4sem
j4si.
j4sk.
js4ko
js4ká
j4s4kù
j4s4me
j3sn
j4sou.
j4souc
js4po
j4s4te
2j1t
j3tl
ju4an
ju3na
ju3p
j1us
ju3sp
ju3t
ju4t.
ju3v
ju4xt
ju3z
j1u¾
ju3¾i
2jv2
j3vd
j3vn
2jz
j3zb
j3zd
j3zk
j3zn
j3zp
jád2r
2j1è
2jï
1jí
j3¹t
j¹4ti
j3¹»
2jú1
jú3n
jú3è
jú3¾
2j¾
1k
2k.
ka4bl
ka4ch
ka3dl
3kaj
ka3ka
3kami
3kanì
ka2p3l
ka2p3r
ka2ps
ka4pv
ka2pø
kas3t
kast3r
3kat
ka4uè
3kav
3kaè
3kaø
ka¹3l
ka4¹p
2k1c
k2d
k2e
ke4bl
ke3jo
ke4pr
ke4ps
3ket
2kf
2kk
k2l
3kl.
4k3la.
k3lej
4k3li.
k4lib
k3lic
4klièka
4klo.
k3los
2k3ly
k3lá.
k3lé
k3ló
k3lý
2k2m
k3mì
2kn
kna4s
ko3by
3kof
ko4jm
ko2pø
ko4sk
ko2t3v
kous3k
3kov
ko3zá
4kroa
k3rob
k3rof
kr2s
kr4ú.
2ks
2k1t
kt2r
kuch4
ku4fø
ku4hr
3kuj
ku3se
ku3si
ku3su
ku4th
ku3v
2k2v
k4vrò
3kyn
ky2pr
kyp3ø
ky4zn
3kác
ká4pl
3kár
3káø
2kè
k2ò
k2ø2
k3øej
k¹4ti
3kù.
2l.
1la.
la4br
lab4s
la3ka
la4nq
la4ps
4la3si
la4v¹
la4y.
la2zm
2l1b
2l1c
2l1d
ld4ne
le4ad
le4au
lech3t
leh3n
le2i
1lej
le3jo
4lej¹k
1lel
4lench
lepa3d
lepo4s
le4pr
le4ps
le4sc
le4sm
le4sv
let4li
let3m
le2tr
le4tè
le4uk
le4vh
le4vk
le3xi
lez3n
2lf
2lg
2lh
3lhan
1li
li4az
li4bl
li4bv
li4dm
lind4
3lio
li4tò
li4vr
2li¾
2lj
2lk
l4kat
l2kl
lk4nu
2ll
2l1m
2ln
l4nul
lo3br
lo4id
lo4is
1los
lo3sp
lo3stø
lo3sv
lo2tr
lo4tø
lo4u.
lo3z
loz4d
lo4¹k
2lp
l2pì
2l1s2
l4sla
ls3n
lst4n
l4stí
2l1t
lt4ra
lt4ru
lt4ry
lu4id
lu4j.
lu4k.
lu4lk
lu4m.
lu4mn
lu3pr
lu3va
lu3vl
lu3vy
lu3ví
2lv
2lz
1lá.
lá4j¹
lá4v¹
2l1è
1lé.
1lík
lí4pl
lí4zn
1líø
2lò
2l¹2
l3¹t
l4¹tý
1lù
1lý
lý2t
2l2¾
2m.
1ma
maj4s
ma4kl
ma4kr
4mald
mas3k
mat3r
ma4tra
ma4v¹
maz3l
2m1b
2m1c
2m1d2
m2dl
1me
3me.
me4go
me4is
met3re
me3x
mezi3s
2mf
mh4le
1mi
mid3l
mik3r
mi4xt
2mk2
3m2kl
mk4la
mk4li
m2l
4mla.
2mle
ml3h
ml4h.
2mli
ml4sc
ml4sk
4mlu.
2mn
m3na
mna4s
m4noh
m3nos
m4noz
3mno¾
m3ná
m3né
m4néz
m3nìj
m3ný
1mo
mod3r
mo2hl
mo2k
mo2s
mo4s.
mot3ø
4mout
moza4
mo3zø
moú3
2mp
m4plo
mpo4s
m2ps
mp4se
mp2t
mr2s
2m1s2
m4stl
2m1t
1mu
mu4fl
mu3n
mu4n.
mu4nd
mu4nn
mu4ns
mu4n¹
2mu¹
2mv
mys3lo
my4¹k
2mz
3má.
málo3
má2s
2mè
m2èe
mí1c
mí4rò
2m2¹
m¹4èi
m¹3»
m¹4»an.
3mù.
3mý.
m2¾
1n
2n.
3na.
na3ch
na4do
na4em
na3h
na4h.
na3jd
na3ka
nam4ne
na3p2
na3s2
na4s.
nat2
na3tl
na3tø
na3z
naz4k
na4z¹
na4è.
na3¹
na¾4n
2nb
2n1c
n4chc
2n1d
nd4hi
ndo4t
nd2re
nd4ri
nd4øí
ne1d
ne4gl
ne1h
ne3h4n
ne2j
nej3t
nej3u
ne3kl
ne4kro
ne3kv
ne4m.
ne3p
ne3s2
ne4s.
nes4le
ne4ss
4nesti
ne3tl
net4r
ne3ud
ne3v2
ne4v.
ne3z
nez4n
ne3¹k
ne3¹»
2nf
n3fr
2ng
ng1l
ng4la
ng4le
ng4lí
n4gro
ng4vi
nik4t
ni4mr
ni4m¾
3nio
3nisk
2nitø
n1j
2nk
2n1l
2nn
no3b2
no4bs
no3hn
no4hs
no4ir
no4m¾
no4sky
no3sm
no3str
not4r
no3z
no4zd
no4¹k
2no¾
2n1s2
n2sa
ns3ak
ns4ko
n4soc
ns3po
nst4ra
2n1t
nte4r3a
nt4lem
nt4r.
nt3ru
nt3rá
2nub
nu4gg
3ny.
2nz
3nák
ná3s2
ná4s.
2n1è
2nï
2nív
2ní¾
2nó
2n¹2
n3¹t
n¹4»o
nù2
2n¾
2o.
o1a
oang4
o1ba
o1be
obe3j
obe3s
obe3z
ob1l
ob1r
ob4rò
o1bu
obys4
ob3z
o3bé
ob3øez
o1c
o4chl
o2chr
oc4ke
oc4ko
o4ct.
oct3n
ocy3
oc4ún
od3b
odej4m
ode3p
ode3s
od1l
o4doc
odos4
odo4tk
od3ra
od4ran
od3rù
o3dr¾
od3v
od1ø
o1e2
oe3g
oe3ti
o2fl
ofrek4
og2
o3gn
o1h
oh4ne
o1i
oi4ce
o4int
o1j
o4jar
oje4dl
o4jmi
o4jmov
o4jmu
o4jmù
oj2o
o4juz
2oka
ok2te
o1l
ol4gl
ol4to
o1m
om4kl
om2n
o2n
o3na
ona4s
o3ne
o3ni
o3no
ont4ra
o3nu
o3ny
o3ná
onáø4ka
o3nì
o3ní
o3nù
o3ný
o1o
oo4hø
oote2
opoè3t
opro4s
o2ps
o4ptu
opá4t
o4pø.
opøej4
opøe4jm
o1ra
o4rae
or4dm
o1re
o1ri
o1ro
or3st
o1ru
or4vá
o1ry
o1rá
o3ré
o1rù
orùs3
o3rý
o1sa
o4sai
ose4s
osi4d
o1sk
o4s3ke
o4sku
osk3v
o4ská
o4ský
o1sl
os4la
os4li
os4lý
os3mo
os4mu
o4st.
o4stg
o4stm
os4tor
os3trù
o4sté
o4st¹
o4stý
o1sy
o1t
ot4kl
o4tlý
oto3s
ot3ro
ot3ví
o3tí
o3tø
ot3øi
o2u
ou3bì
ou3dì
ou4fl
ou4il
ou4is
ou4k.
ou3ka
o4ukl
ou3kr
ou3ká
ou3m
oup3n
oupo4
ou4s.
ou3sa
ou3se
ou4sk
ou3sm
ou4tv
ou3v
ou4vl
ou4vn
ouz3d
o4uèk
ou3¾i
ovi4dla
o4vsk
ovy2p
o2v¹t
o1x
o2z
o3za
oz1b
oz4d.
oz3dá
oz3dì
oz3dí
o3ze
oze3d2
ozer4
oz1h
o3zi
oz3j
oz3k
oz4ko
oz1l
oz3m
o4zn.
o3zo
oz3p
oz4py
oz4pì
oz4pí
oz3ro
oz3ru
oz3rù
oz3t
o3zu
o4zut
oz3vr
oz3vá
o3zí
o3zù
ozù4s
o1è
oè2k
oè4ka
o2ò
o3òa
o3òo
o1ø
oøi2s
o3¹k
o4¹ku
o4¹ky
o3¹l
o¹4lá
o¹4mo
o¹4ti
o¹4»u
o3¾l
o¾4mo
1p
2p.
pa4ed
pa4es
pa4kl
pa3si
pa4t.
pat4ri
2p1c
pe4al
pede4
pe4ig
pe4np
peri3
pes3t3
pe4tra
3peè
pi4kr
pi4pl
2pk
p2kl
p2l
3pl.
4p3la.
pl3h
pl4h.
4p3li.
4plo.
2pn
p2nu
po1b2
po3c2
3pod
podbì4h
pod4nes
po3dru
po3drá
po3h
poly3
po3m2
po4mp
po4ol
po3p
po4p.
po4pm
po1s2
pos4p
post4r
po3t2
po4t.
po4tn
po3uk
po3uè
po3u¾
3po3v
po3z2
po4zd
poè2
po3èk
poè3te
po3øí
po4¹v
2pp
4pra.
pra3st
pr2c
pro1
prob2
pro3p
pro3t4
pro3z
pr2s
4prán
prù3
pse4s
2p1sk
p4sut
2pt
p4tej
p4ter
p4tev
pt4ri
p3tu
p4tá.
pu4dl
pu4tr
pyt3l
pá1
pá2c
pád3l
pá4nv
pá4sl
2pè
pé4rh
2pø.
pøe3h
pøe3j
pøe3t4
pøe3z
pøe3è2
pøi3
pøih4
2p¹
p¹4ti
2p»
qu2
2r.
1ra.
ra4br
ra4em
ra4es
ra4ff
ra4hl
ra4hm
ra4jg
ra4j¹
2rak
ra4nh
ra3si
rast4r
ra4vv
ra4wl
ra4y.
ra4yo
ra4ïm
4ra¾i
r1b
r2bl
r1c
rca3
r3cha
r3cho
rc4ki
r1d
r4dla
rdo2s
re4ad
re4au
red4r
re4et
re3kl
re3kvi
re4mr
re2sb
res3l
retis4
ret4r
re4um
r1ha
r3hl.
rh3n
r1ho
r3hu
r1há
ri4bb
1ric
ric4ku
ri4dg
ri4dr
ri4fl
ri4gh
ri4zm
2rk
r2kl
r1l
2r1m
r4mio
2rn
rna4v¹
rn4dr
ro4ad
ro3by
rod2l
ro3d4r
3rofy
ro3h
ro4h.
ro4jb
ro4k¹
rom3n
romy4s
ropát4
ro2sb
ro4skv
ro4sky
ro3sv
ro3ti
ro3tl
ro4tè
ro3vd
rovì4t
3rový
roz3d
roz3n
ro4zo
roz3v
ro3zá
ro4èp
rpa3d
2rr
rr4ha
rr4ho
2r1s
r2st
r4stu
rs3tvì
rs3tvý
2r1t
r2th
r4trá
rt4sm
rtu3
r2t3v
rt4zu
1ru.
ru3se
ru3si
rus3k
ru3¾i
3rvaní
r1x
1ry.
rych3
ryd2
rys3ky
rys3t
ry4zk
ry4zn
ry4í.
ry4¹k
2rz
rz3d
rz3l
rád4l
rá4d¾
1rák
rá3ri
1ráø
r1è
4rèitý.
rè3t
3ré.
2ró
2r¹
r¹4ní
rù4m.
rùs3ta
rù4v.
3rý.
rý4zn
2s.
sa4pf
sa4pr
sas3k
s2b2
s2c
s3ca
s3ce.
sch2
sch4l
sch4n
3schop
s3ci
sci4e
s3cí
s2d
1se
se4au
se3h
se4ig
se4il
sej4m
se4ku
3sel
se3lh
3sem
ser4va
se3s2
ses4k
se4ss
se4stra
se4stru
se4stø
set2
se3tk
se3tø
se4ur
se3z
se3èt
2sf
s3fo
3sfé
s3fú
1si
3sic
3sif
si4fl
sig4no
3sik
si3ste
3sit
s2j
s3ju
s2k
4skac
s4kak
4skam
s4kok
2skon
skos4
4skot
sk4ra
sk4ru
sk4ry
4skve
sk4vo
s3kán
s3kù
3sl.
4s3la.
s4lav
s3le.
s4led
s3lem
s3len
s3let
s4lib
s4lièi
3sln
4s3lo.
s2ly
s3ly.
s1lí
s2ma
s4mek
s2mo
2sn
s2na
s3nat
s2ne
s3ne.
sn4tl
s2ná
s3ná.
s4níd
1so
sob4l
so3br
so4sk
so4tv
sou3h
sou3s
souz4
so4¹k
s2p
s4pol
spro4s
1sr
2ss
ss4sr
2st.
4sta.
s3taj
s2tan
st4at
4stec
s4tep
st4er
s4tero
s4tich
2stil
s4tink
4stit.
4stiè
st3lo
2stn
4sto.
s4tona
4stou.
4str.
4stram
s4trik
4strn
4strác
4stupni
s2tv
st4ve
3ství
4sty.
s4tyl
3sty¹
s2tá
4stá.
s3táø
4stì.
s4tìd
3stìh
s2tìr
s2tì¾
s1tí
2stí.
s3tøej
1su
su4ba
su4bo
suma4
su3ve
s2v
sy3c
sych3r
sy4nes
sá2d
3sáh
sá2kl
2s2è
s3èi
1sé
1sí
2sò
2s»
s3»o
1sù
s2¾
2t.
1ta.
ta2bl
tac4tvo
t2a3d
1taj
ta4jf
ta4jg
4talt
4tand
3tanì
t1ao
2tark
tast4
ta3str
ta4èk
2t1b
2t1c
1te
3te.
te4ak
te4fl
te4in
4teném
teob4
tep3l
ters4
tes3ta
te4tr
te4uc
te4ur
te4ut
2tf
2tg
1ti
ti4gr
2tih
ti3kl
tin4g
ti4pl
ti3sl
tis4tr
ti4tr
2titu
tiz4r
4tizí
tiú3
2ti¾
2tk2
t4kal
4t2kan
t4kat
t2kl
tk4la
tk4li
4tknì
t2ká
2tl
3tl.
4tla.
t1le
tles3
3tlm
t3lo.
t4lou
tlu3
tlu4s
t1ly
t1lé
2tm
t2ma
2tn
t3ní
1to
to4as
to3b
tob4l
to3dr
to4hm
to4ir
2toj
tol4s
to4ol
4top.
4topt
4topu
2torn
2toup
2tp
t3rant
t4rea
t4ref
tre4t
4tric.
trip4
t4rit
t4rog
t3rol
tro4sk
t4rou
4trouh
4troò.
4trun
t4rus
4t4ru¾
t3ráln
4trá¹
2trè
t3rùm
t3rùv
2trý
2t1s
ts4ko
ts2t
2t1t
tt4ch
tt4ri
1tu.
tu4ff
1tuj
tu4lk
2tup
tu4r.
tu3ry
tu4s.
tu4».
tu3¾i
t2v
2tve
2t3vi
t4vinn
t4vi¹
t4výc
1ty.
ty4gø
ty2la
ty4øe
ty4øh
ty4øj
ty4øo
ty4ør
ty4øú
3tá.
tá4fl
t2è
t3èi
2tèí
1té
té2bl
3tém
1tì
tì3d4l
2tìh
2tìnn
2tìp
1tíc
4tíc.
4tíce
1tím
2tín
2tír
2tø
t4øeb
tøeh3n
t2øel
t2øic
t3øil
tø4ti
t1øu
t2øá
3tøáb
tøí4s
2t¹
t3¹t
t¹4ti
1tù
1tý.
1tým
1týø
3tý¹
u1
2u.
u2at
u2b
u3ba
u3be
u3bi
u3bo
ubs4t
u3bu
u3bá
u3bí.
u3bù
uc4tí
2u2d
u3de
u3di
u3do
u3dru
u3du
u3dy
u3dí
ue4fa
2uf
u2hl
uh3lá
uh3no
u2in
u2jm
u2k
u3ka.
uk4aj
uk4al
uk4at
u3ke
uk3la
uk3le
u3ko
u3ku
u3ky
uk4á.
u3kù
ul4fa
ul1h
ul4pí
u2m
u3ma
u3me
u3mi
um4pl
um4ru
u3mu
u3má
3umø
u2n
un4dl
u3ne
u3no
u3nu
u3nì
u3ní
u3nù
un4¾r
u2p
u3pa
u3pe
upe2r3
u3pi
u3pln
u3pu
u3py
u3pá
u3pì
u3pí
u3pù
u2r
u3ra
u3re
u3ri
2u3ro
u3ru
u3ry.
u3rá
1urè
u3rù
u2s
us3ky
us3ká
us3ké
us3ký
us1l
us2lo
u3so
u4ste
u4sty
u4sté
u4stì
u3stø
u4st¹
u4stý
u3su.
u3sy
u3sá
u3sí
u3sù
u4tro
u4trá
u2v
u3vi
u3vu
u2z
u3ze
u3zi
uz1l
u3zo
u3zu
u3zí
u2è
u3èa
u3èe
u3èi
u3èo
uè3t
u3èu
u3èá
u3èí
u2ï
u2ò
u2¹
u3¹e
u3¹i
u¹4kl
u3¹o
u¹3tí
u3¹u
u3¹á
u3¹í
u2¾
u3¾e
u3¾o
u3¾u
u3¾á
u3¾í
1v
2v.
va3dl
va4j»
va4kl
2v1b
2v1c
v2ch
2v2d
v4dal
v3di
v4dìk
v4dìè
ve3dle
ve3jd
3ven
ve2p
ve3ps
vep3ø
ves3l
ve4sm
ves4p
ve3sta
ve3t4ø
ve2z3m
vi4ch
vide2
vi4dr
vi4et
vi4kr
vi2tr
2vk
v2kr
v2l
2v3la.
4vle.
4vlem
2vlo
2vm
2vn
v4nad
vo3b
vo4ic
vo4ja
vo4jb
vo4jd
vo4jj
vo4jm
vo4jø
vo2s
vo4tø
vou3
vous2
v2p
vr2c
vr2dl
4vrny
v1ro
vr4st
vrst3v
vrs4tvì
2vs2
v1sk
v3stv
2v2t
vy3c
vy3d2
vy4dra
vyp2
vy3s2
vy4sn
vys4t
vy3t
vy3è
vyè4k
vy¹2
vy4¹.
vy4¹m
vy4¹¹
vy4¾l
v2z2
vz4no
vz4né
vz4nì
vz4ní
vá3ri
2v2è
v3èá
v3èí
v4èír
vì4cm
vì3t4a
více3
ví4hat
3vín
2vò
2vøí
v3øín
v2¹2
v¹e3s
v3¹tí.
3výs
vý3t
3vý3z
v2¾2
wa4fd
3war
wa4re
we2
2x.
xand4
2xf
xisk4
2xn
3xov
x1t
xt4ra
xy4sm
y1
y2a
y2bl
yb3ri
y2ch
y4chr
y2d1l
yd4lá
y2dr
yd4y.
y2e
y2gr
y3hn
yh4ne
yj4ma
yj4me
y2kl
yk3la
y3klop
yk4ly
ymané4
ym4kl
yna4s
y3ni
ype4r
yp4si
yp4tá
y2pø
yr2v
y2s
y3sa
y3se
y3si
ys3lu
y3sm
y3so
y3sp
ys2t
ys3te
yst4r
y3su
y3sv
y3sy
y3sá
y3sé
y3sí
yt4me
yu3¾
y3vs
yvì4t
y3zb
y3zd
y3zk
y3zn
yz4nì
yz4ní
y3zp
yz4po
yè2k
y2ò
yø3b
yøk4n
yø4èe
y3øí
y2¹
y3¹e
y3¹i
y3¹k
y¹1l
y3¹o
y3¹p
y3¹u
y3¹í
y¾2
y3¾d
1z
2z.
zab2l
za4bs
za4dk
za3dl
za4dn
za3h
za3i
za3j
za4jk
za3k
za4kt
zal4k
zam4n
za3p2
za3s2
zat2
za3tl
zat4r
za4ut
za3z
zaz4n
za4z¹
za4è.
za3¹
za¹4k
za4¹s
2zb
zban4
z2by
zbys4
2z1c
2z2d
z3di
zdnì4ní
z4doba
z4dobný
zd4re
zd4ví
z2e
ze3h
ze3p2
4zerot
ze3s2
zes4p
zet2
zev2
ze3vn
ze3z
ze4z.
2z2f
z1há
z4ine
z2j
z3jí
2z2k
z3ka.
z3ky
z3ké
z3kù
z3ký
2zl
3zl.
zlhos4
zlik3
z3ly.
z2m2
2zme
z3mn
z3my
z4mìn
2z2n
3znak
z4nal
z3ne.
z3nic
z3no
z3nu
z3ny
z3né
z3nì
z4nìl
z3ní
z4nít
z4nív
z3ný
zo4tr
zo4¹k
2z2p
z3pt
z4pát
3zrak
2z1s2
2zt
ztros3
z4trá
z3tø
3zu.
zu3mo
zu3mì
zu3mí
zu3¹
z2v
zva4d
z3vaø
z3vi
zvik4
zv4nì
z3vod
z3voj
z4von
zv4ro
z4ván
z4vìs
z3víj
3zy.
2zz
zá1
záh2
zá4kl.
3záp
zá3s2
zá3z
zá¹2
2zè
z3èl
2zò
z2ø
zøej3
z3øez
z3øe¹
2z¹2
z3¹k
z¹4ka
z3¹t
2z2ú1
zú3è
zú3¾
zù3s
á1b
á2bl
áb4ry
á4bø.
á3cho
ác3ti3
á1d
á2dl
ádo4s
ádos4ti
ád1ø
á1ha
á3he
áh1l
á3hl.
áh3n
á1ho
á1hr
á1há
á1j
á4jmu
áj4mù
á4kli
ák4ni
á1la
á1le
á1lo
á1lu
á1ly
á3lé
á1lí
á3my
á3mé
á1mì
á3mí
á3mý
áne4v
á1ra
á1re
ár2m
á1ro
á1ru
á3rù
á1s
á2sc
á2s3k
ás4k.
ás4kl
ás4kn
á2sla
ás4ly
á2sm
ás4po
á2st
át3k
át1r
á1tu
á1ty
á1tí
á3tý
áv4si
áv4sí
áz3k
áz3ni
ázni4c
áz4vi
á2ò
á1ø
áø4ke
áø4kù
á2¹
á3¹e
á3¹í
2è.
1èa
èa4br
2èb
2è1c
1èe
3èe.
èe1c
èes3k
1èi
2èk
è3ka.
è3ko
è3ku
è3ky
2è1m
2èn
è2ne
1èo
è2p
2ès
è1sk
ès4la
ès4sr
2è2t
è4tené.
è4tený
èt4la
è4tový.
3ètv
4ètìn
è3tí
1èu
1èá
1èí
èís3l
1èù
2ï.
1ïa
1ïo
ïs4te
2ï1t
3ïuj
é1
é2d
é3di
é3do
é2f
é3fo
éf1r
é2kl
é2l
é2m
é3ma
é3me
é3mi
é3mo
é3mu
é3mù
4ére.
é2s
é2t
é3ta
é3to
é3tá
é2¹
é2¾
ì1c
ìd3r
ì3ha
ì3he
ì3hl.
ìh3lo
ìh3n
ì1ho
ì3hu
ì3hù
ì3ja
ì1je
ì1jo
ì3jù
ì4klé
ì3k2t
ì1l
ì1ra
ìra3d
ì1re
ì1ro
ìr3s
ìrs4t
ì1ru
ì1ry
ì1rù
ìs3k
ìs3n
ìt1a3
ìt4ac
ìt1l
ì1tr
ìt3ra
ì4traj
ìt3v
ì1tí
ìt3øí
ì2v
ì3va
ì3ve
ì3vl
ì3vo
ì3vu
ì3vá
ìv3è
ì2z
ì3ze
ì3zi
ìz3n
ì3zo
ì3zí
ì1ø
ì2¹
ì3¹e
ì3¹i
ì3¹o
ì3¹u
ì3¹á
ì3¹í
ì¹3»
ì¹4»s
ì2»
ì3»o
ì2¾
ì3¾e
ì3¾i
ì3¾o
ì3¾u
ì3¾í
í1b
íb3ø
í3cho
ích4t
íd1l
í1h
í2hl
íh3n
í1j
íjed4
íj4mù
í2kr
í1l
í1má
í3mé
í1mì
í1r
í1sa
í2s3k
ís4kl
ís4kn
ís4l.
ís3le
ís4ln
ísáh2
í1t
ít3k
í3t3øe
íz3da
íz3de
íz3k
í3zna
í3z3ni
í3znìn
í2ò
í1ø
í2¹
í3¹e
í3¹i
í3¹o
í3¹í
1ò
2ò.
2òa
òa3d
2òk
2òm
3òov
ò1s
2ò1t
ó1
ó2z
ó3za
ó3zi
ó3zo
ó3zy
2ø.
øa4pl
øa4ïm
2ø2b
2øc
2ød
øe3ch
øe4dob
øe1h
øe3jd
øe3kl
øe3kv
øe4køí
øeo4r
øe3p2
øe4p.
øe4pk
øe4pè
øer4v
2øes
øe3ska
øe3sko
øe2sp
øes3po
øe4sr
øe3sta
øe3stu
øe3stá
øe3stø
øe3tl
øet4ø
øe3zd
øe3zk
4øezl
øe3èt
øi1
øia3
øi3h
øi4h.
øi4hn
øi4jï
øi4l.
øi4lb
øil2n
4øine
øis2
3øi4t.
øi4v.
øi4vk
øi4vn
øi3z
øiè4t
øi3ø
øi4¹.
2øk
ø2kl
øk4la
øk4li
øk4ly
øk4no
2ø1l
2ø1m
2øn
1øo
2øou
2ø2p
2ø1s
øs4to
2ø1t
ø2v
2øz
øá4pl
øá2sl
2ø1è
2øíd
øí4kø
øí1s
2ø¹
ø3¹t
ø¹4ti
1¹
2¹.
¹ab3
¹a4vl
2¹1c
¹ej4d
¹ep3t
¹i4mr
2¹2k
¹3ka
¹3ke
¹3k3li
4¹3kou
4¹kov
3¹kr
¹k4ro
¹3ku.
¹3ky
2¹l
¹2la
¹2li
¹3liv
¹2lo
¹lá2
¹2lé
¹2lý
2¹1m
¹mi4d
2¹n
¹2p
2¹1s
2¹t
¹4tip
¹t4ka
¹t4kl
¹4tìk
¹2tìs
¹4tìv
¹4típ
¹2v
¹í3d
¹2ò
¹3¹í
2¹2»
¹3»o
¹3»u
¹3»á
1»
2».
3»al
2»k
2»m
2»t
»áè4k
1ú
ú2c2
ú2d
új4ma
ú2k
ú2l
ú2n
ú2p
ú2t
út4ko
ú2v
ú2z
úz3k
ú2è
3úèe
úøe4z
ú¹4ti
ú2¾
ù1b
ù1c
ù1hl
ù3jd
ù4jmový
ù1le
ù1my
ù1mì
ù1ra
ùr4va
ùr4vy
ù1s2
ù2st
ùs3te
ùs3tán
ùt2
ù3tkl
ù2v
ù3va
ù3vo
ù3vì
ù2z
ù3zo
ù2¾
ù3¾e
ù3¾i
ù3¾o
ý1b
ý3cho
ý1d
ýd4la
ý1h
ý1j
ý1l
ý1ml
ý1mì
ý2n
ý3no
ýpo3è4
ý1r
ý1s2
ý2sk
ý1t
ýt4ku
ýt4ky
ý1u
ý4vli
ý3zk
ý3zn
ý4zvu
ýè4nì
ý1ø
ý¹3l
1¾
2¾.
¾a3d
¾a4tv
3¾aè
2¾1b
2¾1c
2¾1d
¾e2b3
¾eh3n
¾e4ml
¾e4zg
¾i4dl
¾i4jm
3¾il
¾i2vl
2¾k
¾k4ni
2¾l
¾4lic
3¾lo
2¾1m
2¾n
¾on2
2¾1s2
2¾1t
¾2v
¾á4br
¾á4nr
2¾ï
¾í4zn
2¾ò
2¾¹
¾¹4ti
¾¹4tì
}
% Local Variables:
% coding: latin-2
% End:
%
% End of file `hyphen.cs'.
| {
"pile_set_name": "Github"
} |
;; -*- no-byte-compile: t; -*-
;;; lang/sh/packages.el
(when (featurep! :completion company)
(package! company-shell :pin "52f3bf26b74adc30a275f5f4290a1fc72a6876ff"))
(when (featurep! +fish)
(package! fish-mode :pin "db257db81058b0b12f788c324c264cc59b9a5bf4"))
| {
"pile_set_name": "Github"
} |
import React, { Component } from "react";
import GoogleAnalytics from "../../../../../../renderer/components/google-analytics/GoogleAnalytics"
const VALIDATIONS = {
"workspace.postgresPort": {
allowedChars: /^\d*$/,
min: 1024,
max: 65536
}
};
class AdvancedScreen extends Component {
constructor(props) {
super(props);
this.state = {
postgresPort: props.config.settings.workspace.postgresPort,
};
}
validateChange = e => {
this.props.validateChange(e, VALIDATIONS);
}
render() {
return (
<div>
<h2>Database</h2>
<section>
<h4><label htmlFor="postgresPort">Postgres Port</label></h4>
<div className="Row">
<div className="RowItem">
<input
id="postgresPort"
type="number"
min={VALIDATIONS["workspace.postgresPort"].min}
max={VALIDATIONS["workspace.postgresPort"].max}
name="workspace.postgresPort"
value={this.props.config.settings.workspace.postgresPort}
onChange={this.validateChange}
/>
{this.props.validationErrors["workspace.postgresPort"] && (
<p className="ValidationError">
Must be a valid number that is at least {VALIDATIONS["workspace.postgresPort"].min} and at most {VALIDATIONS["workspace.postgresPort"].max}
</p>
)}
</div>
<div className="RowItem">
<p>What port should postgres use?</p>
</div>
</div>
</section>
<GoogleAnalytics googleAnalyticsTracking={this.props.config.settings.global.googleAnalyticsTracking} handleInputChange={this.props.handleInputChange} />
</div>
);
}
}
export default AdvancedScreen;
| {
"pile_set_name": "Github"
} |
6
4
4
8
4
0
4
2
0
4
0
0
2
0
2
0
4
0
0
0
2
6
0
0
6
6
0
4
4
0
4
8
0
2
2
0
2
0
6
2
6
4
2
4
2
6
0
2
2
8
0
2
2
6
4
8
4
6
6
4
0
0
6
4
2
2
0
2
0
4
0
0
4
0
4
4
4
6
0
2
0
4
8
4
2
6
2
4
6
2
6
2
0
8
6
4
4
2
2
6
4
0
2
2
6
4
6
2
0
0
2
6
6
6
0
0
2
2
4
4
0
0
2
4
2
6
2
4
0
6
2
6
6
2
4
2
2
2
2
0
4
6
0
2
2
4
6
2
4
2
2
6
4
6
0
0
2
0
4
0
0
0
0
4
6
6
2
0
0
4
0
0
6
2
0
2
4
0
0
0
2
0
6
2
0
0
2
0
4
0
4
2
4
0
4
2
4
6
0
0
8
0
0
2
2
0
4
2
6
4
2
4
6
4
2
0
0
4
4
2
2
0
2
4
2
2
0
4
4
0
4
6
6
4
8
2
4
4
0
2
4
0
4
2
2
4
0
4
2
2
4
6
0
0
0
2
4
8
6
4
0
0
2
0
6
4
4
6
6
0
4
6
2
8
8
0
4
2
4
8
4
4
6
0
6
6
2
0
| {
"pile_set_name": "Github"
} |
# NUID
[](https://www.apache.org/licenses/LICENSE-2.0)
[](http://goreportcard.com/report/nats-io/nuid)
[](http://travis-ci.org/nats-io/nuid)
[](https://github.com/nats-io/nuid/releases/tag/v1.0.0)
[](http://godoc.org/github.com/nats-io/nuid)
[](https://coveralls.io/github/nats-io/nuid?branch=master)
A highly performant unique identifier generator.
## Installation
Use the `go` command:
$ go get github.com/nats-io/nuid
## Basic Usage
```go
// Utilize the global locked instance
nuid := nuid.Next()
// Create an instance, these are not locked.
n := nuid.New()
nuid = n.Next()
// Generate a new crypto/rand seeded prefix.
// Generally not needed, happens automatically.
n.RandomizePrefix()
```
## Performance
NUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly.
NUID uses 12 bytes of crypto generated data (entropy draining), and 10 bytes of pseudo-random
sequential data that increments with a pseudo-random increment.
Total length of a NUID string is 22 bytes of base 62 ascii text, so 62^22 or
2707803647802660400290261537185326956544 possibilities.
NUID can generate identifiers as fast as 60ns, or ~16 million per second. There is an associated
benchmark you can use to test performance on your own hardware.
## License
Unless otherwise noted, the NATS source files are distributed
under the Apache Version 2.0 license found in the LICENSE file.
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2016 The Android Open Source Project
*
* 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 com.priyankvasa.android.cameraviewex
import android.annotation.TargetApi
import android.content.Context
import android.hardware.camera2.CameraCharacteristics
import android.hardware.camera2.params.StreamConfigurationMap
import android.os.Build
import android.util.SparseIntArray
import kotlinx.coroutines.Job
@TargetApi(Build.VERSION_CODES.M)
internal open class Camera2Api23(
listener: CameraInterface.Listener,
preview: PreviewImpl,
config: CameraConfiguration,
job: Job,
context: Context
) : Camera2(listener, preview, config, job, context) {
override val internalFacings: SparseIntArray = super.internalFacings
.apply { put(Modes.Facing.FACING_EXTERNAL, CameraCharacteristics.LENS_FACING_EXTERNAL) }
override fun collectPictureSizes(sizes: SizeMap, map: StreamConfigurationMap) {
// Try to get hi-res output sizes
map.getHighResolutionOutputSizes(internalOutputFormat)
?.forEach { sizes.add(it.width, it.height) }
if (sizes.isEmpty) super.collectPictureSizes(sizes, map)
}
} | {
"pile_set_name": "Github"
} |
; Test that the strcpy library call simplifier works correctly.
; RUN: opt < %s -instcombine -S | FileCheck %s
;
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
@hello = constant [6 x i8] c"hello\00"
@a = common global [32 x i8] zeroinitializer, align 1
declare i16* @strcpy(i8*, i8*)
define void @test_no_simplify1() {
; CHECK-LABEL: @test_no_simplify1(
%dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0
%src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0
call i16* @strcpy(i8* %dst, i8* %src)
; CHECK: call i16* @strcpy
ret void
}
| {
"pile_set_name": "Github"
} |
Name: Recipes
AntiForgery: enabled
Author: The Coevery Team
Website: http://coeveryproject.net
Version: 1.7.1
CoeveryVersion: 1.7.1
Description: Provides Coevery Recipes.
FeatureDescription: Implementation of Coevery recipes.
Category: Core
| {
"pile_set_name": "Github"
} |
#include "pch.h"
#include "Components/Transform.h"
namespace Fling
{
bool Transform::operator==(const Transform &other) const
{
return m_Pos == other.m_Pos && m_Rotation == other.m_Rotation && m_Scale == other.m_Scale;
}
bool Transform::operator!=(const Transform &other) const
{
return !(*this == other);
}
std::ostream& operator<< (std::ostream& t_OutStream, const Fling::Transform& t_Transform)
{
t_OutStream << "Pos (" << t_Transform.m_Pos.x << "," << t_Transform.m_Pos.y << "," << t_Transform.m_Pos.z << ")";
t_OutStream << ", Scale (" << t_Transform.m_Scale.x << "," << t_Transform.m_Scale.y << "," << t_Transform.m_Scale.z << ")";
t_OutStream << ", Rot (" << t_Transform.m_Rotation.x << "," << t_Transform.m_Rotation.y << "," << t_Transform.m_Rotation.z << ")";
return t_OutStream;
}
glm::mat4 Transform::GetWorldMatrix() const
{
// World = Scale * rot * pos
glm::mat4 worldMat = glm::identity<glm::mat4>();
worldMat = glm::translate( worldMat, m_Pos );
worldMat = worldMat * glm::yawPitchRoll(glm::radians(m_Rotation.y), glm::radians(m_Rotation.x), glm::radians(m_Rotation.z) );
worldMat = glm::scale( worldMat, m_Scale );
return worldMat;
}
void Transform::CalculateWorldMatrix(Transform& t_Trans)
{
//assert(t_OutMat);
//*t_OutMat = glm::translate(glm::mat4(1.0f), t_Trans.m_Pos);
//*t_OutMat = *t_OutMat * glm::yawPitchRoll(glm::radians(t_Trans.m_Rotation.y), glm::radians(t_Trans.m_Rotation.x), glm::radians(t_Trans.m_Rotation.z));
//*t_OutMat = glm::scale(*t_OutMat, t_Trans.m_Scale);
t_Trans.m_worldMat = glm::translate(glm::mat4(1.0f), t_Trans.m_Pos);;
t_Trans.m_worldMat= t_Trans.m_worldMat * glm::yawPitchRoll(glm::radians(t_Trans.m_Rotation.y), glm::radians(t_Trans.m_Rotation.x), glm::radians(t_Trans.m_Rotation.z));
t_Trans.m_worldMat = glm::scale(t_Trans.m_worldMat, t_Trans.m_Scale);
}
void Transform::SetPos(const glm::vec3& t_Pos)
{
m_Pos = t_Pos;
}
void Transform::SetScale(const glm::vec3& t_Scale)
{
m_Scale = t_Scale;
}
void Transform::SetRotation(const glm::vec3& t_Rot)
{
m_Rotation = t_Rot;
}
} // namespace Fling | {
"pile_set_name": "Github"
} |
/* Shutter In Vertical */
@mixin shutter-in-vertical {
@include hacks();
position: relative;
background: $activeColor;
@include prefixed(transition-property, color);
@include prefixed(transition-duration, $mediumDuration);
&:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: $primaryColor;
@include prefixed(transform, scaleY(1));
@include prefixed(transform-origin, 50%);
@include prefixed(transition-property, transform);
@include prefixed(transition-duration, $mediumDuration);
@include prefixed(transition-timing-function, ease-out);
}
&:hover,
&:focus,
&:active {
color: white;
&:before {
@include prefixed(transform, scaleY(0));
}
}
}
| {
"pile_set_name": "Github"
} |
using Audit.Core.ConfigurationApi;
using Audit.Udp.Configuration;
using Audit.Udp.Providers;
using System;
using System.Net;
namespace Audit.Core
{
public static class UdpProviderConfiguratorExtensions
{
/// <summary>
/// Send the events over a network as UDP packets.
/// </summary>
/// <param name="configurator">The Audit.NET Configurator</param>
/// <param name="remoteAddress">The address of the remote host or multicast group to which the underlying UdpClient should send the audit events.</param>
/// <param name="remotePort">The port number of the remote host or multicast group to which the underlying UdpClient should send the audit events.</param>
/// <param name="multicastMode">The multicast mode.</param>
/// <param name="customSerializer">A custom serialization method, or NULL to use the json/UTF-8 default</param>
/// <param name="customDeserializer">A custom deserialization method, or NULL to use the json/UTF-8 default</param>
/// <returns></returns>
public static ICreationPolicyConfigurator UseUdp(this IConfigurator configurator, IPAddress remoteAddress, int remotePort,
MulticastMode multicastMode = MulticastMode.Auto, Func<AuditEvent, byte[]> customSerializer = null, Func<byte[], AuditEvent> customDeserializer = null)
{
Configuration.DataProvider = new UdpDataProvider()
{
RemoteAddress = remoteAddress,
RemotePort = remotePort,
MulticastMode = multicastMode,
CustomSerializer = customSerializer,
CustomDeserializer = customDeserializer
};
return new CreationPolicyConfigurator();
}
/// <summary>
/// Send the events over a network as UDP packets.
/// </summary>
/// <param name="configurator">The Audit.NET Configurator</param>
/// <param name="config">The UDP provider configuration.</param>
public static ICreationPolicyConfigurator UseUdp(this IConfigurator configurator, Action<IUdpProviderConfigurator> config)
{
var udpConfig = new UdpProviderConfigurator();
config.Invoke(udpConfig);
return UseUdp(configurator, udpConfig._remoteAddress, udpConfig._remotePort, udpConfig._multicastMode,
udpConfig._customSerializer, udpConfig._customDeserializer);
}
}
} | {
"pile_set_name": "Github"
} |
<% provide(:title, @title) %>
<div class="row">
<aside class="col-md-4">
<section class="user_info">
<%= gravatar_for @user %>
<h1><%= @user.name %></h1>
<span><%= link_to "view my profile", @user %></span>
<span><b>Microposts:</b> <%= @user.microposts.count %></span>
</section>
<section class="stats">
<%= render 'shared/stats' %>
<% if @users.any? %>
<div class="user_avatars">
<% @users.each do |user| %>
<%= link_to gravatar_for(user, size: 30), user %>
<% end %>
</div>
<% end %>
</section>
</aside>
<div class="col-md-8">
<h3><%= @title %></h3>
<% if @users.any? %>
<ul class="users follow">
<%= render @users %>
</ul>
<%= will_paginate %>
<% end %>
</div>
</div> | {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s
// rdar://10073896
@interface I
{
__weak id wObject;
}
@property (readwrite, weak) id representedObject;
@property (readwrite, weak) id wObject;
@property (readwrite, weak) __weak id wRandom;
@property (readwrite, assign) __weak id wAnother;
@end
@implementation I
@synthesize representedObject;
@synthesize wObject;
@synthesize wRandom;
@synthesize wAnother;
@end
// CHECK: call i8* @objc_read_weak
// CHECK: call i8* @objc_assign_weak
// CHECK: call i8* @objc_read_weak
// CHECK: call i8* @objc_assign_weak
// CHECK: call i8* @objc_read_weak
// CHECK: call i8* @objc_assign_weak
// CHECK: call i8* @objc_read_weak
// CHECK: call i8* @objc_assign_weak
| {
"pile_set_name": "Github"
} |
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Cirilo Bernardo <[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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <iostream>
#include <sstream>
#include <wx/log.h>
#include <wx/xml/xml.h>
#include "x3d_ops.h"
#include "x3d_appearance.h"
#include "plugins/3dapi/ifsg_all.h"
X3DAPP::X3DAPP() : X3DNODE()
{
m_Type = X3D_APPEARANCE;
init();
return;
}
X3DAPP::X3DAPP( X3DNODE* aParent ) : X3DNODE()
{
m_Type = X3D_APPEARANCE;
init();
if( NULL != aParent )
{
X3DNODES ptype = aParent->GetNodeType();
if( X3D_SHAPE == ptype )
m_Parent = aParent;
}
if( NULL != m_Parent )
m_Parent->AddChildNode( this );
return;
}
X3DAPP::~X3DAPP()
{
#if defined( DEBUG_X3D ) && ( DEBUG_X3D > 2 )
wxLogTrace( MASK_VRML, " * [INFO] Destroying Appearance\n" );
#endif
if( !m_MatName.empty() && m_Dict )
m_Dict->DelName( m_MatName, this );
return;
}
void X3DAPP::init()
{
// default material values as per VRML2 spec
diffuseColor.x = 0.8f;
diffuseColor.y = 0.8f;
diffuseColor.z = 0.8f;
emissiveColor.x = 0.0f;
emissiveColor.y = 0.0f;
emissiveColor.z = 0.0f;
specularColor = emissiveColor;
ambientIntensity = 0.2f;
shininess = 0.2f;
transparency = 0.0f;
return;
}
void X3DAPP::readFields( wxXmlNode* aNode )
{
// DEF
// diffuseColor
// emissiveColor
// specularColor
// ambientIntensity
// shininess
// transparency
wxXmlAttribute* prop;
for( prop = aNode->GetAttributes();
prop != NULL;
prop = prop->GetNext() )
{
const wxString& pname = prop->GetName();
if( pname == "DEF" )
{
m_MatName = prop->GetValue();
m_Dict->AddName( m_MatName, this );
}
else if( pname == "USE" )
{
X3DNODE* np = m_Dict->FindName( prop->GetValue() );
if( NULL != np && np->GetNodeType() == X3D_APPEARANCE )
{
X3DAPP* ap = (X3DAPP*) np;
diffuseColor = ap->diffuseColor;
emissiveColor = ap->emissiveColor;
specularColor = ap->specularColor;
ambientIntensity = ap->ambientIntensity;
shininess = ap->shininess;
transparency = ap->transparency;
}
}
else if( pname == "diffuseColor" )
X3D::ParseSFVec3( prop->GetValue(), diffuseColor );
else if( pname == "emissiveColor" )
X3D::ParseSFVec3( prop->GetValue(), emissiveColor );
else if( pname == "specularColor" )
X3D::ParseSFVec3( prop->GetValue(), specularColor );
else if( pname == "ambientIntensity" )
X3D::ParseSFFloat( prop->GetValue(), ambientIntensity );
else if( pname == "shininess" )
X3D::ParseSFFloat( prop->GetValue(), shininess );
else if( pname == "transparency" )
X3D::ParseSFFloat( prop->GetValue(), transparency );
}
return;
}
bool X3DAPP::Read( wxXmlNode* aNode, X3DNODE* aTopNode, X3D_DICT& aDict )
{
if( NULL == aTopNode || NULL == aNode )
return false;
m_Dict = &aDict;
wxXmlAttribute* prop;
for( prop = aNode->GetAttributes();
prop != NULL;
prop = prop->GetNext() )
{
const wxString& pname = prop->GetName();
if( pname == "DEF" )
{
m_Name = prop->GetValue();
m_Dict->AddName( m_Name, this );
}
}
wxXmlNode* pmat = NULL;
for( wxXmlNode* child = aNode->GetChildren();
child != NULL;
child = child->GetNext() )
{
if( child->GetName() == "Material" )
pmat = child;
}
if( NULL == pmat )
return false;
readFields( pmat );
if( !SetParent( aTopNode ) )
return false;
return true;
}
bool X3DAPP::SetParent( X3DNODE* aParent, bool doUnlink )
{
if( aParent == m_Parent )
return true;
if( NULL != aParent )
{
X3DNODES nt = aParent->GetNodeType();
if( nt != X3D_SHAPE )
return false;
}
if( NULL != m_Parent && doUnlink )
m_Parent->unlinkChildNode( this );
m_Parent = aParent;
if( NULL != m_Parent )
m_Parent->AddChildNode( this );
return true;
}
bool X3DAPP::AddChildNode( X3DNODE* aNode )
{
return false;
}
bool X3DAPP::AddRefNode( X3DNODE* aNode )
{
return false;
}
SGNODE* X3DAPP::TranslateToSG( SGNODE* aParent )
{
S3D::SGTYPES ptype = S3D::GetSGNodeType( aParent );
if( NULL != aParent && ptype != S3D::SGTYPE_SHAPE )
{
#ifdef DEBUG_X3D
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] Appearance does not have a Shape parent (parent ID: ";
ostr << ptype << ")";
wxLogTrace( MASK_VRML, "%s\n", ostr.str().c_str() );
#endif
return NULL;
}
#if defined( DEBUG_X3D ) && ( DEBUG_X3D > 2 )
do {
std::ostringstream ostr;
ostr << " * [INFO] Translating Appearance with " << m_Children.size();
ostr << " children, " << m_Refs.size() << " references and ";
ostr << m_BackPointers.size() << " backpointers";
wxLogTrace( MASK_VRML, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
if( m_sgNode )
{
if( NULL != aParent )
{
if( NULL == S3D::GetSGNodeParent( m_sgNode )
&& !S3D::AddSGNodeChild( aParent, m_sgNode ) )
{
return NULL;
}
else if( aParent != S3D::GetSGNodeParent( m_sgNode )
&& !S3D::AddSGNodeRef( aParent, m_sgNode ) )
{
return NULL;
}
}
return m_sgNode;
}
IFSG_APPEARANCE matNode( aParent );
matNode.SetEmissive( emissiveColor.x, emissiveColor.y, emissiveColor.z );
matNode.SetSpecular( specularColor.x, specularColor.y, specularColor.z );
matNode.SetDiffuse( diffuseColor.x, diffuseColor.y, diffuseColor.z );
float ambr = ambientIntensity * diffuseColor.x;
float ambg = ambientIntensity * diffuseColor.y;
float ambb = ambientIntensity * diffuseColor.z;
matNode.SetAmbient( ambr, ambg, ambb );
matNode.SetShininess( shininess );
matNode.SetTransparency( transparency );
m_sgNode = matNode.GetRawPtr();
return m_sgNode;
}
| {
"pile_set_name": "Github"
} |
<!-- GFM-TOC -->
* [一、概览](#一概览)
* [二、磁盘操作](#二磁盘操作)
* [三、字节操作](#三字节操作)
* [实现文件复制](#实现文件复制)
* [装饰者模式](#装饰者模式)
* [四、字符操作](#四字符操作)
* [编码与解码](#编码与解码)
* [String 的编码方式](#string-的编码方式)
* [Reader 与 Writer](#reader-与-writer)
* [实现逐行输出文本文件的内容](#实现逐行输出文本文件的内容)
* [五、对象操作](#五对象操作)
* [序列化](#序列化)
* [Serializable](#serializable)
* [transient](#transient)
* [六、网络操作](#六网络操作)
* [InetAddress](#inetaddress)
* [URL](#url)
* [Sockets](#sockets)
* [Datagram](#datagram)
* [七、NIO](#七nio)
* [流与块](#流与块)
* [通道与缓冲区](#通道与缓冲区)
* [缓冲区状态变量](#缓冲区状态变量)
* [文件 NIO 实例](#文件-nio-实例)
* [选择器](#选择器)
* [套接字 NIO 实例](#套接字-nio-实例)
* [内存映射文件](#内存映射文件)
* [对比](#对比)
* [八、参考资料](#八参考资料)
<!-- GFM-TOC -->
# 一、概览
Java 的 I/O 大概可以分成以下几类:
- 磁盘操作:File
- 字节操作:InputStream 和 OutputStream
- 字符操作:Reader 和 Writer
- 对象操作:Serializable
- 网络操作:Socket
- 新的输入/输出:NIO
# 二、磁盘操作
File 类可以用于表示文件和目录的信息,但是它不表示文件的内容。
递归地列出一个目录下所有文件:
```java
public static void listAllFiles(File dir) {
if (dir == null || !dir.exists()) {
return;
}
if (dir.isFile()) {
System.out.println(dir.getName());
return;
}
for (File file : dir.listFiles()) {
listAllFiles(file);
}
}
```
# 三、字节操作
## 实现文件复制
```java
public static void copyFile(String src, String dist) throws IOException {
FileInputStream in = new FileInputStream(src);
FileOutputStream out = new FileOutputStream(dist);
byte[] buffer = new byte[20 * 1024];
int cnt;
// read() 最多读取 buffer.length 个字节
// 返回的是实际读取的个数
// 返回 -1 的时候表示读到 eof,即文件尾
while ((cnt = in.read(buffer, 0, buffer.length)) != -1) {
out.write(buffer, 0, cnt);
}
in.close();
out.close();
}
```
## 装饰者模式
Java I/O 使用了装饰者模式来实现。以 InputStream 为例,
- InputStream 是抽象组件;
- FileInputStream 是 InputStream 的子类,属于具体组件,提供了字节流的输入操作;
- FilterInputStream 属于抽象装饰者,装饰者用于装饰组件,为组件提供额外的功能。例如 BufferedInputStream 为 FileInputStream 提供缓存的功能。
<div align="center"> <img src="../pics//DP-Decorator-java.io.png" width="500"/> </div><br>
实例化一个具有缓存功能的字节流对象时,只需要在 FileInputStream 对象上再套一层 BufferedInputStream 对象即可。
```java
FileInputStream fileInputStream = new FileInputStream(filePath);
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
```
DataInputStream 装饰者提供了对更多数据类型进行输入的操作,比如 int、double 等基本类型。
# 四、字符操作
## 编码与解码
编码就是把字符转换为字节,而解码是把字节重新组合成字符。
如果编码和解码过程使用不同的编码方式那么就出现了乱码。
- GBK 编码中,中文字符占 2 个字节,英文字符占 1 个字节;
- UTF-8 编码中,中文字符占 3 个字节,英文字符占 1 个字节;
- UTF-16be 编码中,中文字符和英文字符都占 2 个字节。
UTF-16be 中的 be 指的是 Big Endian,也就是大端。相应地也有 UTF-16le,le 指的是 Little Endian,也就是小端。
Java 使用双字节编码 UTF-16be,这不是指 Java 只支持这一种编码方式,而是说 char 这种类型使用 UTF-16be 进行编码。char 类型占 16 位,也就是两个字节,Java 使用这种双字节编码是为了让一个中文或者一个英文都能使用一个 char 来存储。
## String 的编码方式
String 可以看成一个字符序列,可以指定一个编码方式将它编码为字节序列,也可以指定一个编码方式将一个字节序列解码为 String。
```java
String str1 = "中文";
byte[] bytes = str1.getBytes("UTF-8");
String str2 = new String(bytes, "UTF-8");
System.out.println(str2);
```
在调用无参数 getBytes() 方法时,默认的编码方式不是 UTF-16be。双字节编码的好处是可以使用一个 char 存储中文和英文,而将 String 转为 bytes[] 字节数组就不再需要这个好处,因此也就不再需要双字节编码。getBytes() 的默认编码方式与平台有关,一般为 UTF-8。
```java
byte[] bytes = str1.getBytes();
```
## Reader 与 Writer
不管是磁盘还是网络传输,最小的存储单元都是字节,而不是字符。但是在程序中操作的通常是字符形式的数据,因此需要提供对字符进行操作的方法。
- InputStreamReader 实现从字节流解码成字符流;
- OutputStreamWriter 实现字符流编码成为字节流。
## 实现逐行输出文本文件的内容
```java
public static void readFileContent(String filePath) throws IOException {
FileReader fileReader = new FileReader(filePath);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String line;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);
}
// 装饰者模式使得 BufferedReader 组合了一个 Reader 对象
// 在调用 BufferedReader 的 close() 方法时会去调用 Reader 的 close() 方法
// 因此只要一个 close() 调用即可
bufferedReader.close();
}
```
# 五、对象操作
## 序列化
序列化就是将一个对象转换成字节序列,方便存储和传输。
- 序列化:ObjectOutputStream.writeObject()
- 反序列化:ObjectInputStream.readObject()
不会对静态变量进行序列化,因为序列化只是保存对象的状态,静态变量属于类的状态。
## Serializable
序列化的类需要实现 Serializable 接口,它只是一个标准,没有任何方法需要实现,但是如果不去实现它的话而进行序列化,会抛出异常。
```java
public static void main(String[] args) throws IOException, ClassNotFoundException {
A a1 = new A(123, "abc");
String objectFile = "file/a1";
ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(objectFile));
objectOutputStream.writeObject(a1);
objectOutputStream.close();
ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream(objectFile));
A a2 = (A) objectInputStream.readObject();
objectInputStream.close();
System.out.println(a2);
}
private static class A implements Serializable {
private int x;
private String y;
A(int x, String y) {
this.x = x;
this.y = y;
}
@Override
public String toString() {
return "x = " + x + " " + "y = " + y;
}
}
```
## transient
transient 关键字可以使一些属性不会被序列化。
ArrayList 中存储数据的数组 elementData 是用 transient 修饰的,因为这个数组是动态扩展的,并不是所有的空间都被使用,因此就不需要所有的内容都被序列化。通过重写序列化和反序列化方法,使得可以只序列化数组中有内容的那部分数据。
```java
private transient Object[] elementData;
```
# 六、网络操作
Java 中的网络支持:
- InetAddress:用于表示网络上的硬件资源,即 IP 地址;
- URL:统一资源定位符;
- Sockets:使用 TCP 协议实现网络通信;
- Datagram:使用 UDP 协议实现网络通信。
## InetAddress
没有公有的构造函数,只能通过静态方法来创建实例。
```java
InetAddress.getByName(String host);
InetAddress.getByAddress(byte[] address);
```
## URL
可以直接从 URL 中读取字节流数据。
```java
public static void main(String[] args) throws IOException {
URL url = new URL("http://www.baidu.com");
/* 字节流 */
InputStream is = url.openStream();
/* 字符流 */
InputStreamReader isr = new InputStreamReader(is, "utf-8");
/* 提供缓存功能 */
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
}
```
## Sockets
- ServerSocket:服务器端类
- Socket:客户端类
- 服务器和客户端通过 InputStream 和 OutputStream 进行输入输出。
<div align="center"> <img src="../pics//ClienteServidorSockets1521731145260.jpg"/> </div><br>
## Datagram
- DatagramSocket:通信类
- DatagramPacket:数据包类
# 七、NIO
新的输入/输出 (NIO) 库是在 JDK 1.4 中引入的,弥补了原来的 I/O 的不足,提供了高速的、面向块的 I/O。
## 流与块
I/O 与 NIO 最重要的区别是数据打包和传输的方式,I/O 以流的方式处理数据,而 NIO 以块的方式处理数据。
面向流的 I/O 一次处理一个字节数据:一个输入流产生一个字节数据,一个输出流消费一个字节数据。为流式数据创建过滤器非常容易,链接几个过滤器,以便每个过滤器只负责复杂处理机制的一部分。不利的一面是,面向流的 I/O 通常相当慢。
面向块的 I/O 一次处理一个数据块,按块处理数据比按流处理数据要快得多。但是面向块的 I/O 缺少一些面向流的 I/O 所具有的优雅性和简单性。
I/O 包和 NIO 已经很好地集成了,java.io.\* 已经以 NIO 为基础重新实现了,所以现在它可以利用 NIO 的一些特性。例如,java.io.\* 包中的一些类包含以块的形式读写数据的方法,这使得即使在面向流的系统中,处理速度也会更快。
## 通道与缓冲区
### 1. 通道
通道 Channel 是对原 I/O 包中的流的模拟,可以通过它读取和写入数据。
通道与流的不同之处在于,流只能在一个方向上移动(一个流必须是 InputStream 或者 OutputStream 的子类),而通道是双向的,可以用于读、写或者同时用于读写。
通道包括以下类型:
- FileChannel:从文件中读写数据;
- DatagramChannel:通过 UDP 读写网络中数据;
- SocketChannel:通过 TCP 读写网络中数据;
- ServerSocketChannel:可以监听新进来的 TCP 连接,对每一个新进来的连接都会创建一个 SocketChannel。
### 2. 缓冲区
发送给一个通道的所有数据都必须首先放到缓冲区中,同样地,从通道中读取的任何数据都要先读到缓冲区中。也就是说,不会直接对通道进行读写数据,而是要先经过缓冲区。
缓冲区实质上是一个数组,但它不仅仅是一个数组。缓冲区提供了对数据的结构化访问,而且还可以跟踪系统的读/写进程。
缓冲区包括以下类型:
- ByteBuffer
- CharBuffer
- ShortBuffer
- IntBuffer
- LongBuffer
- FloatBuffer
- DoubleBuffer
## 缓冲区状态变量
- capacity:最大容量;
- position:当前已经读写的字节数;
- limit:还可以读写的字节数。
状态变量的改变过程举例:
① 新建一个大小为 8 个字节的缓冲区,此时 position 为 0,而 limit = capacity = 8。capacity 变量不会改变,下面的讨论会忽略它。
<div align="center"> <img src="../pics//1bea398f-17a7-4f67-a90b-9e2d243eaa9a.png"/> </div><br>
② 从输入通道中读取 5 个字节数据写入缓冲区中,此时 position 为 5,limit 保持不变。
<div align="center"> <img src="../pics//80804f52-8815-4096-b506-48eef3eed5c6.png"/> </div><br>
③ 在将缓冲区的数据写到输出通道之前,需要先调用 flip() 方法,这个方法将 limit 设置为当前 position,并将 position 设置为 0。
<div align="center"> <img src="../pics//952e06bd-5a65-4cab-82e4-dd1536462f38.png"/> </div><br>
④ 从缓冲区中取 4 个字节到输出缓冲中,此时 position 设为 4。
<div align="center"> <img src="../pics//b5bdcbe2-b958-4aef-9151-6ad963cb28b4.png"/> </div><br>
⑤ 最后需要调用 clear() 方法来清空缓冲区,此时 position 和 limit 都被设置为最初位置。
<div align="center"> <img src="../pics//67bf5487-c45d-49b6-b9c0-a058d8c68902.png"/> </div><br>
## 文件 NIO 实例
以下展示了使用 NIO 快速复制文件的实例:
```java
public static void fastCopy(String src, String dist) throws IOException {
/* 获得源文件的输入字节流 */
FileInputStream fin = new FileInputStream(src);
/* 获取输入字节流的文件通道 */
FileChannel fcin = fin.getChannel();
/* 获取目标文件的输出字节流 */
FileOutputStream fout = new FileOutputStream(dist);
/* 获取输出字节流的文件通道 */
FileChannel fcout = fout.getChannel();
/* 为缓冲区分配 1024 个字节 */
ByteBuffer buffer = ByteBuffer.allocateDirect(1024);
while (true) {
/* 从输入通道中读取数据到缓冲区中 */
int r = fcin.read(buffer);
/* read() 返回 -1 表示 EOF */
if (r == -1) {
break;
}
/* 切换读写 */
buffer.flip();
/* 把缓冲区的内容写入输出文件中 */
fcout.write(buffer);
/* 清空缓冲区 */
buffer.clear();
}
}
```
## 选择器
NIO 常常被叫做非阻塞 IO,主要是因为 NIO 在网络通信中的非阻塞特性被广泛使用。
NIO 实现了 IO 多路复用中的 Reactor 模型,一个线程 Thread 使用一个选择器 Selector 通过轮询的方式去监听多个通道 Channel 上的事件,从而让一个线程就可以处理多个事件。
通过配置监听的通道 Channel 为非阻塞,那么当 Channel 上的 IO 事件还未到达时,就不会进入阻塞状态一直等待,而是继续轮询其它 Channel,找到 IO 事件已经到达的 Channel 执行。
因为创建和切换线程的开销很大,因此使用一个线程来处理多个事件而不是一个线程处理一个事件,对于 IO 密集型的应用具有很好地性能。
应该注意的是,只有套接字 Channel 才能配置为非阻塞,而 FileChannel 不能,为 FileChannel 配置非阻塞也没有意义。
<div align="center"> <img src="../pics//4d930e22-f493-49ae-8dff-ea21cd6895dc.png"/> </div><br>
### 1. 创建选择器
```java
Selector selector = Selector.open();
```
### 2. 将通道注册到选择器上
```java
ServerSocketChannel ssChannel = ServerSocketChannel.open();
ssChannel.configureBlocking(false);
ssChannel.register(selector, SelectionKey.OP_ACCEPT);
```
通道必须配置为非阻塞模式,否则使用选择器就没有任何意义了,因为如果通道在某个事件上被阻塞,那么服务器就不能响应其它事件,必须等待这个事件处理完毕才能去处理其它事件,显然这和选择器的作用背道而驰。
在将通道注册到选择器上时,还需要指定要注册的具体事件,主要有以下几类:
- SelectionKey.OP_CONNECT
- SelectionKey.OP_ACCEPT
- SelectionKey.OP_READ
- SelectionKey.OP_WRITE
它们在 SelectionKey 的定义如下:
```java
public static final int OP_READ = 1 << 0;
public static final int OP_WRITE = 1 << 2;
public static final int OP_CONNECT = 1 << 3;
public static final int OP_ACCEPT = 1 << 4;
```
可以看出每个事件可以被当成一个位域,从而组成事件集整数。例如:
```java
int interestSet = SelectionKey.OP_READ | SelectionKey.OP_WRITE;
```
### 3. 监听事件
```java
int num = selector.select();
```
使用 select() 来监听到达的事件,它会一直阻塞直到有至少一个事件到达。
### 4. 获取到达的事件
```java
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> keyIterator = keys.iterator();
while (keyIterator.hasNext()) {
SelectionKey key = keyIterator.next();
if (key.isAcceptable()) {
// ...
} else if (key.isReadable()) {
// ...
}
keyIterator.remove();
}
```
### 5. 事件循环
因为一次 select() 调用不能处理完所有的事件,并且服务器端有可能需要一直监听事件,因此服务器端处理事件的代码一般会放在一个死循环内。
```java
while (true) {
int num = selector.select();
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> keyIterator = keys.iterator();
while (keyIterator.hasNext()) {
SelectionKey key = keyIterator.next();
if (key.isAcceptable()) {
// ...
} else if (key.isReadable()) {
// ...
}
keyIterator.remove();
}
}
```
## 套接字 NIO 实例
```java
public class NIOServer {
public static void main(String[] args) throws IOException {
Selector selector = Selector.open();
ServerSocketChannel ssChannel = ServerSocketChannel.open();
ssChannel.configureBlocking(false);
ssChannel.register(selector, SelectionKey.OP_ACCEPT);
ServerSocket serverSocket = ssChannel.socket();
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 8888);
serverSocket.bind(address);
while (true) {
selector.select();
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> keyIterator = keys.iterator();
while (keyIterator.hasNext()) {
SelectionKey key = keyIterator.next();
if (key.isAcceptable()) {
ServerSocketChannel ssChannel1 = (ServerSocketChannel) key.channel();
// 服务器会为每个新连接创建一个 SocketChannel
SocketChannel sChannel = ssChannel1.accept();
sChannel.configureBlocking(false);
// 这个新连接主要用于从客户端读取数据
sChannel.register(selector, SelectionKey.OP_READ);
} else if (key.isReadable()) {
SocketChannel sChannel = (SocketChannel) key.channel();
System.out.println(readDataFromSocketChannel(sChannel));
sChannel.close();
}
keyIterator.remove();
}
}
}
private static String readDataFromSocketChannel(SocketChannel sChannel) throws IOException {
ByteBuffer buffer = ByteBuffer.allocate(1024);
StringBuilder data = new StringBuilder();
while (true) {
buffer.clear();
int n = sChannel.read(buffer);
if (n == -1) {
break;
}
buffer.flip();
int limit = buffer.limit();
char[] dst = new char[limit];
for (int i = 0; i < limit; i++) {
dst[i] = (char) buffer.get(i);
}
data.append(dst);
buffer.clear();
}
return data.toString();
}
}
```
```java
public class NIOClient {
public static void main(String[] args) throws IOException {
Socket socket = new Socket("127.0.0.1", 8888);
OutputStream out = socket.getOutputStream();
String s = "hello world";
out.write(s.getBytes());
out.close();
}
}
```
## 内存映射文件
内存映射文件 I/O 是一种读和写文件数据的方法,它可以比常规的基于流或者基于通道的 I/O 快得多。
向内存映射文件写入可能是危险的,只是改变数组的单个元素这样的简单操作,就可能会直接修改磁盘上的文件。修改数据与将数据保存到磁盘是没有分开的。
下面代码行将文件的前 1024 个字节映射到内存中,map() 方法返回一个 MappedByteBuffer,它是 ByteBuffer 的子类。因此,可以像使用其他任何 ByteBuffer 一样使用新映射的缓冲区,操作系统会在需要时负责执行映射。
```java
MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, 1024);
```
## 对比
NIO 与普通 I/O 的区别主要有以下两点:
- NIO 是非阻塞的;
- NIO 面向块,I/O 面向流。
# 八、参考资料
- Eckel B, 埃克尔, 昊鹏, 等. Java 编程思想 [M]. 机械工业出版社, 2002.
- [IBM: NIO 入门](https://www.ibm.com/developerworks/cn/education/java/j-nio/j-nio.html)
- [Java NIO Tutorial](http://tutorials.jenkov.com/java-nio/index.html)
- [Java NIO 浅析](https://tech.meituan.com/nio.html)
- [IBM: 深入分析 Java I/O 的工作机制](https://www.ibm.com/developerworks/cn/java/j-lo-javaio/index.html)
- [IBM: 深入分析 Java 中的中文编码问题](https://www.ibm.com/developerworks/cn/java/j-lo-chinesecoding/index.htm)
- [IBM: Java 序列化的高级认识](https://www.ibm.com/developerworks/cn/java/j-lo-serial/index.html)
- [NIO 与传统 IO 的区别](http://blog.csdn.net/shimiso/article/details/24990499)
- [Decorator Design Pattern](http://stg-tud.github.io/sedc/Lecture/ws13-14/5.3-Decorator.html#mode=document)
- [Socket Multicast](http://labojava.blogspot.com/2012/12/socket-multicast.html)
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_SERIALIZATION_STACK_HPP
#define BOOST_SERIALIZATION_STACK_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// stack.hpp
// (C) Copyright 2014 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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 for updates, documentation, and revision history.
#include <stack>
#include <boost/config.hpp>
// function specializations must be defined in the appropriate
// namespace - boost::serialization
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
#define STD _STLP_STD
#else
#define STD std
#endif
namespace boost {
namespace serialization {
namespace detail{
template <typename U, typename C>
struct stack_save : public STD::stack<U, C> {
template<class Archive>
void operator()(Archive & ar, const unsigned int file_version) const {
save(ar, STD::stack<U, C>::c, file_version);
}
};
template <typename U, typename C>
struct stack_load : public STD::stack<U, C> {
template<class Archive>
void operator()(Archive & ar, const unsigned int file_version) {
load(ar, STD::stack<U, C>::c, file_version);
}
};
} // detail
template<class Archive, class T, class C>
inline void serialize(
Archive & ar,
std::stack< T, C> & t,
const unsigned int file_version
){
typedef typename mpl::eval_if<
typename Archive::is_saving,
mpl::identity<detail::stack_save<T, C> >,
mpl::identity<detail::stack_load<T, C> >
>::type typex;
static_cast<typex &>(t)(ar, file_version);
}
} // namespace serialization
} // namespace boost
#include <boost/serialization/collection_traits.hpp>
BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::stack)
#undef STD
#endif // BOOST_SERIALIZATION_DEQUE_HPP
| {
"pile_set_name": "Github"
} |
{% extends "pages/richtextpage.html" %}
{% block main %}
<!--
This template is provided as a custom template for the homepage, for
when it is configured as an editable page in the navigation tree. Feel
free to modify it.
-->
{{ block.super }}
{% endblock %}
| {
"pile_set_name": "Github"
} |
<%--
Created by IntelliJ IDEA.
User: DuanJiaNing
Date: 2018/2/13
Time: 10:00
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<%@ include file="/views/dialog/login_dialog.jsp" %>
<html>
<head>
<link rel="stylesheet" href="/css/nav/nav.css">
<script type="application/javascript" src="/js/nav/nav.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-static-top"
style="background-color: white;padding-top: 8px;padding-bottom: 8px">
<div class="container" style="height: 50px;width: 82%">
<table style="height: 100%;width: 100%">
<tr style="height: 100%">
<td valign="middle">
<%--<b class="navbar-brand BLOG ">BLOG</b>--%>
<img class="img58px website-logo" src="/images/logo/logo.png" onclick="gotoRegister()">
</td>
<td class="text-right" style="vertical-align: middle">
<c:choose>
<c:when test="${empty bloggerLoginSignal}">
<a class="operation " href="/register">注册</a>
<button class="button-success" data-toggle="modal"
data-target="#loginDialog">登录
</button>
</c:when>
<c:otherwise>
<a class="operation"
href="/${sessionScope['bloggerName']}/archives">主页</a>
<c:choose>
<c:when test="${type eq 'like'}">
<a class="operation" href="/${sessionScope["bloggerName"]}/blog/favourite/collect">收藏
<%--<span class="count">(${loginBgStat.collectCount})</span>--%>
</a>
<c:choose>
<c:when test="${pageOwnerBloggerId eq sessionScope.bloggerId}">
<a class="operation" style="color: #00CBBA;"
href="/${sessionScope["bloggerName"]}/blog/favourite/like">喜欢</a>
</c:when>
<c:otherwise>
<a class="operation"
href="/${sessionScope["bloggerName"]}/blog/favourite/like">喜欢</a>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${pageOwnerBloggerId eq sessionScope.bloggerId}">
<a class="operation" style="color: #00CBBA;"
href="/${sessionScope["bloggerName"]}/blog/favourite/collect">收藏</a>
</c:when>
<c:otherwise>
<a class="operation"
href="/${sessionScope["bloggerName"]}/blog/favourite/collect">收藏</a>
</c:otherwise>
</c:choose>
<a class="operation"
href="/${sessionScope["bloggerName"]}/blog/favourite/like">喜欢
<%--<span class="count">(${loginBgStat.likedCount})</span>--%>
</a>
</c:otherwise>
</c:choose>
<a class="line-sperate">|</a>
<a class="operation" href="/${sessionScope["bloggerName"]}/setting">设置</a>
<button class="button-success"
onclick="window.open('/edit_blog?bid=${sessionScope['bloggerId']}') ">写博文
</button>
<button onclick="logout(${sessionScope['bloggerId']},'${sessionScope['bloggerName']}')" class="quit">退出
</button>
</c:otherwise>
</c:choose>
</td>
</tr>
</table>
</div><!-- /.container-fluid -->
</nav>
</body>
</html>
| {
"pile_set_name": "Github"
} |
---
layout: post
title: 第35天:pathlib 模块
category: python
copyright: python
---
> by 吴刀钓鱼
pathlib 模块提供了表示文件系统路径的类,可适用于不同的操作系统。使用 pathlib 模块,相比于 os 模块可以写出更简洁,易读的代码。pathlib 模块中的 Path 类继承自 PurePath,对 PurePath 中的部分方法进行了重载,相比于 os.path 有更高的抽象级别。本文将带你学习如何使用 pathlib 模块中的 Path 类读写文件、操纵文件路径和基础文件系统,统计目录下的文件类型以及查找匹配目录下某一类型文件等。下面就开始进入我们的学习时刻。
<!--more-->
## 1 获取目录
- Path.cwd(),返回文件当前所在目录。
- Path.home(),返回用户的主目录。
应用示例:
```
from pathlib import Path
currentPath = Path.cwd()
homePath = Path.home()
print("文件当前所在目录:%s\n用户主目录:%s" %(currentPath, homePath))
```
## 2 目录拼接
斜杠 / 操作符用于拼接路径,比如创建子路径。
应用示例:
```
from pathlib import Path
currentPath = Path.cwd()
newPath = currentPath / 'python-100'
print("新目录为:%s" %(newPath))
```
## 3 创建、删除目录
- Path.mkdir(),创建给定路径的目录。
- Path.rmdir(),删除该目录,目录文件夹必须为空。
应用示例:
```
from pathlib import Path
currentPath = Path.cwd()
makePath = currentPath / 'python-100'
makePath.mkdir()
print("创建的目录为:%s" %(nmakePath))
```
```
from pathlib import Path
currentPath = Path.cwd()
delPath = currentPath / 'python-100'
delPath.rmdir()
print("删除的目录为:%s" %(delPath))
```
## 4 读写文件
- Path.open(mode='r'),以 "r" 格式打开 Path 路径下的文件,若文件不存在即创建后打开。
- Path.read_bytes(),打开 Path 路径下的文件,以字节流格式读取文件内容,等同 open 操作文件的 "rb" 格式。
- Path.read_text(),打开 Path 路径下的文件,以 str 格式读取文件内容,等同 open 操作文件的 "r" 格式。
- Path.write_bytes(),对 Path 路径下的文件进行写操作,等同 open 操作文件的 "wb" 格式。
- Path.write_text(),对 Path 路径下的文件进行写操作,等同 open 操作文件的 "w" 格式。
应用示例:
```
from pathlib import Path
currentPath = Path.cwd()
mkPath = currentPath / 'python-100.txt'
with mkPath.open('w') as f: # 创建并以 "w" 格式打开 python-100.txt 文件。
f.write('python-100') # 写入 python-100 字符串。
f = open(mkPath, 'r')
print("读取的文件内容为:%s" % f.read())
f.close()
```
```
from pathlib import Path
currentPath = Path.cwd()
mkPathText = currentPath / 'python-100-text.txt'
mkPathText.write_text('python-100')
print("读取的文件内容为:%s" % mkPathText.read_text())
str2byte = bytes('python-100', encoding = 'utf-8')
mkPathByte = currentPath / 'python-100-byte.txt'
mkPathByte.write_bytes(str2byte)
print("读取的文件内容为:%s" % mkPathByte.read_bytes())
```
## 5 获取文件所在目录的不同部分字段
- Path.resolve(),通过传入文件名,返回文件的完整路径。
- Path.name,可以获取文件的名字,包含后缀名。
- Path.parent,返回文件所在文件夹的名字。
- Path.stem,获取文件名不包含后缀名。
- Path.suffix,获取文件的后缀名。
- Path.anchor,获取文件所在的盘符。
```
from pathlib import Path
txtPath = Path('python-100.txt')
nowPath = txtPath.resolve()
print("文件的完整路径为:%s" % nowPath)
print("文件完整名称为(文件名+后缀名):%s" % nowPath.name)
print("文件名为:%s" % nowPath.stem)
print("文件后缀名为:%s" % nowPath.suffix)
print("文件所在的文件夹名为:%s" % nowPath.parent)
print("文件所在的盘符为:%s" % nowPath.anchor)
```
## 6 文件、路径是否存在判断
- Path.exists(),判断 Path 路径是否指向一个已存在的文件或目录,返回 True 或 False。
- Path.is_dir(),判断 Path 是否是一个路径,返回 True 或 False。
- Path.is_file(),判断 Path 是否指向一个文件,返回 True 或 False。
```
from pathlib import Path
currentPath = Path.cwd() / 'python'
print(currentPath.exists()) # 判断是否存在 python 文件夹,此时返回 False。
print(currentPath.is_dir()) # 判断是否存在 python 文件夹,此时返回 False。
currentPath.mkdir() # 创建 python 文件夹。
print(currentPath.exists()) # 判断是否存在 python 文件夹,此时返回 True。
print(currentPath.is_dir()) # 判断是否存在 python 文件夹,此时返回 True。
currentPath = Path.cwd() / 'python-100.txt'
print(currentPath.exists()) # 判断是否存在 python-100.txt 文件,此时文件未创建返回 False。
print(currentPath.is_file()) # 判断是否存在 python-100.txt 文件,此时文件未创建返回 False。
f = open(currentPath,'w') # 创建 python-100.txt 文件。
f.close()
print(currentPath.exists()) # 判断是否存在 python-100.txt 文件,此时返回 True。
print(currentPath.is_file()) # 判断是否存在 python-100.txt 文件,此时返回 True。
```
## 7 文件统计以及匹配查找
- Path.iterdir(),返回 Path 目录文件夹下的所有文件,返回的是一个生成器类型。
- Path.glob(pattern),返回 Path 目录文件夹下所有与 pattern 匹配的文件,返回的是一个生成器类型。
- Path.rglob(pattern),返回 Path 路径下所有子文件夹中与 pattern 匹配的文件,返回的是一个生成器类型。
```
# 使用 Path.iterdir() 获取当前文件下的所有文件,并根据后缀名统计其个数。
import pathlib
from collections import Counter
currentPath = pathlib.Path.cwd()
gen = (i.suffix for i in currentPath.iterdir())
print(Counter(gen))
```
```
import pathlib
from collections import Counter
currentPath = pathlib.Path.cwd()
gen = (i.suffix for i in currentPath.glob('*.txt')) # 获取当前文件下的所有 txt 文件,并统计其个数。
print(Counter(gen))
gen = (i.suffix for i in currentPath.rglob('*.txt')) # 获取目录中子文件夹下的所有 txt 文件,并统计其个数。
print(Counter(gen))
```
## 8 总结
本文给大家介绍了 Python 的 pathlib 模块,为 Python 工程师对该模块的使用提供了支撑,让大家了解如何使用 pathlib 模块读写文件、操纵文件路径和基础文件系统,统计目录下的文件类型以及查找匹配目录下某一类型文件等。
## 参考资料
[1] https://realpython.com/python-pathlib/
[2] https://docs.python.org/zh-cn/3/library/pathlib.html
> 示例代码:[Python-100-days-day035](https://github.com/JustDoPython/python-100-day)
| {
"pile_set_name": "Github"
} |
; RUN: %opt -load %pass -souper -S -o - %s | %FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind readnone uwtable
define i32 @func(i32 %x) local_unnamed_addr #0 {
entry:
%b = call i1 @branch(i32 %x)
%call = call i32 @a(i32 %x)
br i1 %b, label %bb1, label %bb2
bb1:
%call_bb1 = add i32 0, %call
br label %jmp
bb2:
%call_bb2 = add i32 1, %call
br label %jmp
jmp:
%c = phi i32 [%call_bb1, %bb1], [%call_bb2, %bb2]
%d = add i32 0, %c
; CHECK: ret i32 %c
ret i32 %d
}
; Function Attrs: nounwind readnone
declare i32 @a(i32) local_unnamed_addr #1
declare i1 @branch(i32) local_unnamed_addr #1
| {
"pile_set_name": "Github"
} |
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2008 Steven Watanabe
//
// 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)
#ifndef BOOST_UNITS_CGS_POWER_HPP
#define BOOST_UNITS_CGS_POWER_HPP
#include <boost/units/systems/cgs/base.hpp>
#include <boost/units/physical_dimensions/power.hpp>
namespace boost {
namespace units {
namespace cgs {
typedef unit<power_dimension,cgs::system> power;
} // namespace cgs
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_CGS_POWER_HPP
| {
"pile_set_name": "Github"
} |
package msgpack
import (
"fmt"
"math"
"reflect"
"github.com/vmihailenco/msgpack/codes"
)
func (d *Decoder) skipN(n int) error {
_, err := d.readN(n)
return err
}
func (d *Decoder) uint8() (uint8, error) {
c, err := d.readCode()
if err != nil {
return 0, err
}
return uint8(c), nil
}
func (d *Decoder) int8() (int8, error) {
n, err := d.uint8()
return int8(n), err
}
func (d *Decoder) uint16() (uint16, error) {
b, err := d.readN(2)
if err != nil {
return 0, err
}
return (uint16(b[0]) << 8) | uint16(b[1]), nil
}
func (d *Decoder) int16() (int16, error) {
n, err := d.uint16()
return int16(n), err
}
func (d *Decoder) uint32() (uint32, error) {
b, err := d.readN(4)
if err != nil {
return 0, err
}
n := (uint32(b[0]) << 24) |
(uint32(b[1]) << 16) |
(uint32(b[2]) << 8) |
uint32(b[3])
return n, nil
}
func (d *Decoder) int32() (int32, error) {
n, err := d.uint32()
return int32(n), err
}
func (d *Decoder) uint64() (uint64, error) {
b, err := d.readN(8)
if err != nil {
return 0, err
}
n := (uint64(b[0]) << 56) |
(uint64(b[1]) << 48) |
(uint64(b[2]) << 40) |
(uint64(b[3]) << 32) |
(uint64(b[4]) << 24) |
(uint64(b[5]) << 16) |
(uint64(b[6]) << 8) |
uint64(b[7])
return n, nil
}
func (d *Decoder) int64() (int64, error) {
n, err := d.uint64()
return int64(n), err
}
// DecodeUint64 decodes msgpack int8/16/32/64 and uint8/16/32/64
// into Go uint64.
func (d *Decoder) DecodeUint64() (uint64, error) {
c, err := d.readCode()
if err != nil {
return 0, err
}
return d.uint(c)
}
func (d *Decoder) uint(c codes.Code) (uint64, error) {
if c == codes.Nil {
return 0, nil
}
if codes.IsFixedNum(c) {
return uint64(int8(c)), nil
}
switch c {
case codes.Uint8:
n, err := d.uint8()
return uint64(n), err
case codes.Int8:
n, err := d.int8()
return uint64(n), err
case codes.Uint16:
n, err := d.uint16()
return uint64(n), err
case codes.Int16:
n, err := d.int16()
return uint64(n), err
case codes.Uint32:
n, err := d.uint32()
return uint64(n), err
case codes.Int32:
n, err := d.int32()
return uint64(n), err
case codes.Uint64, codes.Int64:
return d.uint64()
}
return 0, fmt.Errorf("msgpack: invalid code=%x decoding uint64", c)
}
// DecodeInt64 decodes msgpack int8/16/32/64 and uint8/16/32/64
// into Go int64.
func (d *Decoder) DecodeInt64() (int64, error) {
c, err := d.readCode()
if err != nil {
return 0, err
}
return d.int(c)
}
func (d *Decoder) int(c codes.Code) (int64, error) {
if c == codes.Nil {
return 0, nil
}
if codes.IsFixedNum(c) {
return int64(int8(c)), nil
}
switch c {
case codes.Uint8:
n, err := d.uint8()
return int64(n), err
case codes.Int8:
n, err := d.uint8()
return int64(int8(n)), err
case codes.Uint16:
n, err := d.uint16()
return int64(n), err
case codes.Int16:
n, err := d.uint16()
return int64(int16(n)), err
case codes.Uint32:
n, err := d.uint32()
return int64(n), err
case codes.Int32:
n, err := d.uint32()
return int64(int32(n)), err
case codes.Uint64, codes.Int64:
n, err := d.uint64()
return int64(n), err
}
return 0, fmt.Errorf("msgpack: invalid code=%x decoding int64", c)
}
func (d *Decoder) DecodeFloat32() (float32, error) {
c, err := d.readCode()
if err != nil {
return 0, err
}
return d.float32(c)
}
func (d *Decoder) float32(c codes.Code) (float32, error) {
if c == codes.Float {
n, err := d.uint32()
if err != nil {
return 0, err
}
return math.Float32frombits(n), nil
}
n, err := d.int(c)
if err != nil {
return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c)
}
return float32(n), nil
}
// DecodeFloat64 decodes msgpack float32/64 into Go float64.
func (d *Decoder) DecodeFloat64() (float64, error) {
c, err := d.readCode()
if err != nil {
return 0, err
}
return d.float64(c)
}
func (d *Decoder) float64(c codes.Code) (float64, error) {
switch c {
case codes.Float:
n, err := d.float32(c)
if err != nil {
return 0, err
}
return float64(n), nil
case codes.Double:
n, err := d.uint64()
if err != nil {
return 0, err
}
return math.Float64frombits(n), nil
}
n, err := d.int(c)
if err != nil {
return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c)
}
return float64(n), nil
}
func (d *Decoder) DecodeUint() (uint, error) {
n, err := d.DecodeUint64()
return uint(n), err
}
func (d *Decoder) DecodeUint8() (uint8, error) {
n, err := d.DecodeUint64()
return uint8(n), err
}
func (d *Decoder) DecodeUint16() (uint16, error) {
n, err := d.DecodeUint64()
return uint16(n), err
}
func (d *Decoder) DecodeUint32() (uint32, error) {
n, err := d.DecodeUint64()
return uint32(n), err
}
func (d *Decoder) DecodeInt() (int, error) {
n, err := d.DecodeInt64()
return int(n), err
}
func (d *Decoder) DecodeInt8() (int8, error) {
n, err := d.DecodeInt64()
return int8(n), err
}
func (d *Decoder) DecodeInt16() (int16, error) {
n, err := d.DecodeInt64()
return int16(n), err
}
func (d *Decoder) DecodeInt32() (int32, error) {
n, err := d.DecodeInt64()
return int32(n), err
}
func decodeFloat32Value(d *Decoder, v reflect.Value) error {
f, err := d.DecodeFloat32()
if err != nil {
return err
}
if err = mustSet(v); err != nil {
return err
}
v.SetFloat(float64(f))
return nil
}
func decodeFloat64Value(d *Decoder, v reflect.Value) error {
f, err := d.DecodeFloat64()
if err != nil {
return err
}
if err = mustSet(v); err != nil {
return err
}
v.SetFloat(f)
return nil
}
func decodeInt64Value(d *Decoder, v reflect.Value) error {
n, err := d.DecodeInt64()
if err != nil {
return err
}
if err = mustSet(v); err != nil {
return err
}
v.SetInt(n)
return nil
}
func decodeUint64Value(d *Decoder, v reflect.Value) error {
n, err := d.DecodeUint64()
if err != nil {
return err
}
if err = mustSet(v); err != nil {
return err
}
v.SetUint(n)
return nil
}
| {
"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 httpstream
import (
"fmt"
"io"
"net/http"
"strings"
"time"
)
const (
HeaderConnection = "Connection"
HeaderUpgrade = "Upgrade"
HeaderProtocolVersion = "X-Stream-Protocol-Version"
HeaderAcceptedProtocolVersions = "X-Accepted-Stream-Protocol-Versions"
)
// NewStreamHandler defines a function that is called when a new Stream is
// received. If no error is returned, the Stream is accepted; otherwise,
// the stream is rejected. After the reply frame has been sent, replySent is closed.
type NewStreamHandler func(stream Stream, replySent <-chan struct{}) error
// NoOpNewStreamHandler is a stream handler that accepts a new stream and
// performs no other logic.
func NoOpNewStreamHandler(stream Stream, replySent <-chan struct{}) error { return nil }
// Dialer knows how to open a streaming connection to a server.
type Dialer interface {
// Dial opens a streaming connection to a server using one of the protocols
// specified (in order of most preferred to least preferred).
Dial(protocols ...string) (Connection, string, error)
}
// UpgradeRoundTripper is a type of http.RoundTripper that is able to upgrade
// HTTP requests to support multiplexed bidirectional streams. After RoundTrip()
// is invoked, if the upgrade is successful, clients may retrieve the upgraded
// connection by calling UpgradeRoundTripper.Connection().
type UpgradeRoundTripper interface {
http.RoundTripper
// NewConnection validates the response and creates a new Connection.
NewConnection(resp *http.Response) (Connection, error)
}
// ResponseUpgrader knows how to upgrade HTTP requests and responses to
// add streaming support to them.
type ResponseUpgrader interface {
// UpgradeResponse upgrades an HTTP response to one that supports multiplexed
// streams. newStreamHandler will be called asynchronously whenever the
// other end of the upgraded connection creates a new stream.
UpgradeResponse(w http.ResponseWriter, req *http.Request, newStreamHandler NewStreamHandler) Connection
}
// Connection represents an upgraded HTTP connection.
type Connection interface {
// CreateStream creates a new Stream with the supplied headers.
CreateStream(headers http.Header) (Stream, error)
// Close resets all streams and closes the connection.
Close() error
// CloseChan returns a channel that is closed when the underlying connection is closed.
CloseChan() <-chan bool
// SetIdleTimeout sets the amount of time the connection may remain idle before
// it is automatically closed.
SetIdleTimeout(timeout time.Duration)
}
// Stream represents a bidirectional communications channel that is part of an
// upgraded connection.
type Stream interface {
io.ReadWriteCloser
// Reset closes both directions of the stream, indicating that neither client
// or server can use it any more.
Reset() error
// Headers returns the headers used to create the stream.
Headers() http.Header
// Identifier returns the stream's ID.
Identifier() uint32
}
// IsUpgradeRequest returns true if the given request is a connection upgrade request
func IsUpgradeRequest(req *http.Request) bool {
for _, h := range req.Header[http.CanonicalHeaderKey(HeaderConnection)] {
if strings.Contains(strings.ToLower(h), strings.ToLower(HeaderUpgrade)) {
return true
}
}
return false
}
func negotiateProtocol(clientProtocols, serverProtocols []string) string {
for i := range clientProtocols {
for j := range serverProtocols {
if clientProtocols[i] == serverProtocols[j] {
return clientProtocols[i]
}
}
}
return ""
}
// Handshake performs a subprotocol negotiation. If the client did request a
// subprotocol, Handshake will select the first common value found in
// serverProtocols. If a match is found, Handshake adds a response header
// indicating the chosen subprotocol. If no match is found, HTTP forbidden is
// returned, along with a response header containing the list of protocols the
// server can accept.
func Handshake(req *http.Request, w http.ResponseWriter, serverProtocols []string) (string, error) {
clientProtocols := req.Header[http.CanonicalHeaderKey(HeaderProtocolVersion)]
if len(clientProtocols) == 0 {
// Kube 1.0 clients didn't support subprotocol negotiation.
// TODO require clientProtocols once Kube 1.0 is no longer supported
return "", nil
}
if len(serverProtocols) == 0 {
// Kube 1.0 servers didn't support subprotocol negotiation. This is mainly for testing.
// TODO require serverProtocols once Kube 1.0 is no longer supported
return "", nil
}
negotiatedProtocol := negotiateProtocol(clientProtocols, serverProtocols)
if len(negotiatedProtocol) == 0 {
for i := range serverProtocols {
w.Header().Add(HeaderAcceptedProtocolVersions, serverProtocols[i])
}
err := fmt.Errorf("unable to upgrade: unable to negotiate protocol: client supports %v, server accepts %v", clientProtocols, serverProtocols)
http.Error(w, err.Error(), http.StatusForbidden)
return "", err
}
w.Header().Add(HeaderProtocolVersion, negotiatedProtocol)
return negotiatedProtocol, 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.