/*
    SevTech: Ages Over loaded Recipe Script

    This script handles the recipes for Over loaded.

    Note: These scripts are created and for the usage in SevTech: Ages and other
    modpacks curated by DarkPacks. You can use these scripts for reference and for
    learning but not for copying and pasting and claiming as your own.
*/
import crafttweaker.item.IItemStack;
import crafttweaker.item.IIngredient;

import mods.zenstages.Utils;

import scripts.crafttweaker.utils;
import scripts.crafttweaker.stages.stageZero;
import scripts.crafttweaker.stages.stageOne;
import scripts.crafttweaker.stages.stageTwo;
import scripts.crafttweaker.stages.stageThree;
import scripts.crafttweaker.stages.stageFour;
import scripts.crafttweaker.stages.stageFive;

/*
    Shaped Recipes
*/
static shapedRecipes as IIngredient[][][][IItemStack] = {
	<overloaded:infinite_water_source:0>: [
		[
			[<actuallyadditions:block_crystal_empowered:1>, <bloodmagic:sigil_water:0>, <actuallyadditions:block_crystal_empowered:1>],
			[<mekanism:machineblock:12>, <mysticalagriculture:crafting:48>, <mekanism:machineblock:12>],
			[<actuallyadditions:block_crystal_empowered:1>, <immersiveengineering:metal_device0:5>, <actuallyadditions:block_crystal_empowered:1>]
		]
	],
	<overloaded:infinite_barrel:0>: [
		[
			[<quantumstorage:quantum_storage_unit:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <quantumstorage:quantum_storage_unit:0>],
			[<minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <industrialforegoing:black_hole_unit:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench})],
			[<quantumstorage:quantum_storage_unit:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <quantumstorage:quantum_storage_unit:0>]
		]
	],
	<overloaded:infinite_tank:0>: [
		[
			[<quantumstorage:quantum_tank:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <quantumstorage:quantum_tank:0>],
			[<minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <industrialforegoing:black_hole_tank:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench})],
			[<quantumstorage:quantum_tank:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <quantumstorage:quantum_tank:0>]
		]
	],
	<overloaded:infinite_capacitor:0>: [
		[
			[<extraplanets:ultimate_battery:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <actuallyadditions:item_battery_quintuple:0>],
			[<minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <integrateddynamics:energy_battery:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench})],
			[<actuallyadditions:item_battery_quintuple:0>, <minecraft:enchanted_book:0>.withTag({StoredEnchantments: utils.makeJeidTag(<enchantment:minecraft:infinity>.makeEnchantment(1)).ench}), <extraplanets:ultimate_battery:0>]
		]
	],
	<overloaded:hyper_item_receiver:0>: [
		[
			[<mekanism:transmitter:3>, <mekanism:transmitter:3>, <mekanism:transmitter:3>],
			[<mekanism:transmitter:3>, <enderstorage:ender_storage:0>, <mekanism:transmitter:3>],
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:2>, <mekanism:teleportationcore:0>]
		]
	],
	<overloaded:hyper_item_sender:0>: [
		[
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:3>, <mekanism:teleportationcore:0>],
			[<mekanism:transmitter:3>, <enderstorage:ender_storage:0>, <mekanism:transmitter:3>],
			[<mekanism:transmitter:3>, <mekanism:transmitter:3>, <mekanism:transmitter:3>]
		]
	],
	<overloaded:hyper_fluid_receiver:0>: [
		[
			[<mekanism:transmitter:1>, <mekanism:transmitter:1>, <mekanism:transmitter:1>],
			[<mekanism:transmitter:1>, <enderstorage:ender_storage:1>, <mekanism:transmitter:1>],
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:2>, <mekanism:teleportationcore:0>]
		]
	],
	<overloaded:hyper_fluid_sender:0>: [
		[
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:2>, <mekanism:teleportationcore:0>],
			[<mekanism:transmitter:1>, <enderstorage:ender_storage:1>, <mekanism:transmitter:1>],
			[<mekanism:transmitter:1>, <mekanism:transmitter:1>, <mekanism:transmitter:1>]
		]
	],
	<overloaded:hyper_energy_receiver:0>: [
		[
			[<ore:universalCable>, <ore:universalCable>, <ore:universalCable>],
			[<ore:universalCable>, <rftools:powercell_advanced:0>, <ore:universalCable>],
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:2>, <mekanism:teleportationcore:0>]
		]
	],
	<overloaded:hyper_energy_sender:0>: [
		[
			[<mekanism:teleportationcore:0>, <bloodmagic:teleposition_focus:2>, <mekanism:teleportationcore:0>],
			[<ore:universalCable>, <rftools:powercell_advanced:0>, <ore:universalCable>],
			[<ore:universalCable>, <ore:universalCable>, <ore:universalCable>]
		]
	],
	<overloaded:linking_card:0>: [
		[
			[<appliedenergistics2:nether_quartz_wrench:0>, <rftools:powercell_card:0>, <enderutilities:linkcrystal:1>],
			[<mekanism:teleportationcore:0>, <astralsorcery:itemlinkingtool:0>, <mekanism:teleportationcore:0>],
			[<enderutilities:linkcrystal:0>, <rftools:powercell_card:0>, <integrateddynamics:wrench:0>]
		]
	],
	<overloaded:energy_extractor:0>: [
		[
			[<refinedstorage:interface:0>, null, <appliedenergistics2:interface:0>],
			[<ore:universalCable>, <ore:universalCable>, <ore:universalCable>],
			[<appliedenergistics2:interface:0>, null, <refinedstorage:interface:0>]
		]
	],
	<overloaded:multi_tool:0>: [
		[
			[<actuallyadditions:block_placer:0>, <mysticalagriculture:supremium_shovel:0>, <betterwithmods:buddy_block:0>],
			[<actuallyadditions:item_battery_quintuple:0>, <mysticalagriculture:supremium_axe:0>, <actuallyadditions:item_battery_quintuple:0>],
			[<betterwithmods:buddy_block:0>, <mysticalagriculture:supremium_pickaxe:0>, <actuallyadditions:block_placer:0>]
		]
	],
	<overloaded:player_interface:0>: [
		[
			[<appliedenergistics2:interface:0>],
			[<modularrouters:module:13>],
			[<refinedstorage:interface:0>]
		]
	],
	<overloaded:item_interface:0>: [
		[
			[<appliedenergistics2:interface:0>],
			[<actuallyadditions:block_item_viewer:0>],
			[<refinedstorage:interface:0>]
		]
	]
};

static namedShapedRecipes as IIngredient[][][][string][IItemStack] = {
};

/*
    Mirrored Recipes
*/
static mirroredRecipes as IIngredient[][][][IItemStack] = {
};

static namedMirroredRecipes as IIngredient[][][][string][IItemStack] = {
};

/*
    Shapeless Recipes
*/
static shapelessRecipes as IIngredient[][][IItemStack] = {
};

static namedShapelessRecipes as IIngredient[][][string][IItemStack] = {
};

/*
    Recipe Removals
*/
static removeRecipes as IItemStack[] = [];

function init() {
	// Un-named recipes
	recipeUtil.process(shapedRecipes, false);
    recipeUtil.process(mirroredRecipes, true);
    recipeUtil.process(shapelessRecipes);

	// Named recipes
	recipeUtil.processNamed(namedShapedRecipes, false);
    recipeUtil.processNamed(namedMirroredRecipes, true);
    recipeUtil.processNamed(namedShapelessRecipes);

	recipeUtil.removeRecipes(removeRecipes);
}

{'repo_name': 'DarkPacks/SevTech-Ages', 'stars': '185', 'repo_language': 'ZenScript', 'file_name': 'left_click_block.txt', 'mime_type': 'text/plain', 'hash': -6009946112850158443, 'source_dataset': 'data'}


/*************************************************************
 *
 *  MathJax/localization/diq/HTML-CSS.js
 *
 *  Copyright (c) 2009-2016 The MathJax Consortium
 *
 *  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.
 *
 */
MathJax.Localization.addTranslation("diq","HTML-CSS",{
        version: "2.7.2",
        isLoaded: true,
        strings: {
          LoadWebFont: "Web font %1 bar beno",
          CantLoadWebFont: "Font\u00EA web\u00EA %1'i bar n\u00EAb\u0131"
        }
});

MathJax.Ajax.loadComplete("[MathJax]/localization/diq/HTML-CSS.js");

{'repo_name': 'MarkUsProject/Markus', 'stars': '210', 'repo_language': 'Ruby', 'file_name': 'robots.txt', 'mime_type': 'text/plain', 'hash': -9075231649593745450, 'source_dataset': 'data'}


used-before-assignment:11:Well.<lambda>:Using variable 'revattr' before assignment
undefined-variable:13:Well.<lambda>:Undefined variable 'get_attr_bad'
undefined-variable:19:Well.Sub:Undefined variable 'Data'
undefined-variable:22:Well.func:Undefined variable 'Sub'

{'repo_name': 'ruchee/vimrc', 'stars': '372', 'repo_language': 'Vim script', 'file_name': 'jsx.snippets', 'mime_type': 'text/plain', 'hash': 4576795744074306148, 'source_dataset': 'data'}


<!DOCTYPE html>

    <title>CSS Transforms Test: SVG presentation attribute and translate with translation-value and negative unit less arguments in scientific notation</title>
    <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-transform">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-transform-value">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-number">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#two-d-transform-functions">
		<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#funcdef-transform-translate">
    <link rel="match" href="reference/svg-translate-ref.html">
    <meta name="flags" content="svg">
    <meta name="assert" content="The translate transform function must support negative unit less arguments in scientific numbers for translation-value. The rect in the test should be moved 50 pixels in the X direction and 50 pixels in the Y direction">

The test passes if there is a green square and no red.

    <svg>
        <rect x="51" y="51" width="98" height="98" fill="red"/>
        <rect x="100" y="100" width="100" height="100" fill="green" transform="translate(-5.0e1 -5.0e1)"/>
    </svg>

{'repo_name': 'web-platform-tests/wpt', 'stars': '2923', 'repo_language': 'HTML', 'file_name': 'newtarget.html', 'mime_type': 'text/html', 'hash': 5667779946581856284, 'source_dataset': 'data'}


// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: k8s.io/apimachinery/pkg/runtime/generated.proto

/*
	Package runtime is a generated protocol buffer package.

	It is generated from these files:
		k8s.io/apimachinery/pkg/runtime/generated.proto

	It has these top-level messages:
		RawExtension
		TypeMeta
		Unknown
*/
package runtime

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/ericchiang/k8s/util/intstr"

import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// RawExtension is used to hold extensions in external versions.
//
// To use this, make a field which has RawExtension as its type in your external, versioned
// struct, and Object in your internal struct. You also need to register your
// various plugin types.
//
// // Internal package:
// type MyAPIObject struct {
// 	runtime.TypeMeta `json:",inline"`
// 	MyPlugin runtime.Object `json:"myPlugin"`
// }
// type PluginA struct {
// 	AOption string `json:"aOption"`
// }
//
// // External package:
// type MyAPIObject struct {
// 	runtime.TypeMeta `json:",inline"`
// 	MyPlugin runtime.RawExtension `json:"myPlugin"`
// }
// type PluginA struct {
// 	AOption string `json:"aOption"`
// }
//
// // On the wire, the JSON will look something like this:
// {
// 	"kind":"MyAPIObject",
// 	"apiVersion":"v1",
// 	"myPlugin": {
// 		"kind":"PluginA",
// 		"aOption":"foo",
// 	},
// }
//
// So what happens? Decode first uses json or yaml to unmarshal the serialized data into
// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
// The next step is to copy (using pkg/conversion) into the internal struct. The runtime
// package's DefaultScheme has conversion functions installed which will unpack the
// JSON stored in RawExtension, turning it into the correct object type, and storing it
// in the Object. (TODO: In the case where the object is of an unknown type, a
// runtime.Unknown object will be created and stored.)
//
// +k8s:deepcopy-gen=true
// +protobuf=true
// +k8s:openapi-gen=true
type RawExtension struct {
	// Raw is the underlying serialization of this object.
	//
	// TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
	Raw              []byte `protobuf:"bytes,1,opt,name=raw" json:"raw,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (m *RawExtension) Reset()                    { *m = RawExtension{} }
func (m *RawExtension) String() string            { return proto.CompactTextString(m) }
func (*RawExtension) ProtoMessage()               {}
func (*RawExtension) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }

func (m *RawExtension) GetRaw() []byte {
	if m != nil {
		return m.Raw
	}
	return nil
}

// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
// like this:
// type MyAwesomeAPIObject struct {
//      runtime.TypeMeta    `json:",inline"`
//      ... // other fields
// }
// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
//
// TypeMeta is provided here for convenience. You may use it directly from this package or define
// your own with the same fields.
//
// +k8s:deepcopy-gen=false
// +protobuf=true
// +k8s:openapi-gen=true
type TypeMeta struct {
	// +optional
	ApiVersion *string `protobuf:"bytes,1,opt,name=apiVersion" json:"apiVersion,omitempty"`
	// +optional
	Kind             *string `protobuf:"bytes,2,opt,name=kind" json:"kind,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *TypeMeta) Reset()                    { *m = TypeMeta{} }
func (m *TypeMeta) String() string            { return proto.CompactTextString(m) }
func (*TypeMeta) ProtoMessage()               {}
func (*TypeMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }

func (m *TypeMeta) GetApiVersion() string {
	if m != nil && m.ApiVersion != nil {
		return *m.ApiVersion
	}
	return ""
}

func (m *TypeMeta) GetKind() string {
	if m != nil && m.Kind != nil {
		return *m.Kind
	}
	return ""
}

// Unknown allows api objects with unknown types to be passed-through. This can be used
// to deal with the API objects from a plug-in. Unknown objects still have functioning
// TypeMeta features-- kind, version, etc.
// TODO: Make this object have easy access to field based accessors and settors for
// metadata and field mutatation.
//
// +k8s:deepcopy-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +protobuf=true
// +k8s:openapi-gen=true
type Unknown struct {
	TypeMeta *TypeMeta `protobuf:"bytes,1,opt,name=typeMeta" json:"typeMeta,omitempty"`
	// Raw will hold the complete serialized object which couldn't be matched
	// with a registered type. Most likely, nothing should be done with this
	// except for passing it through the system.
	Raw []byte `protobuf:"bytes,2,opt,name=raw" json:"raw,omitempty"`
	// ContentEncoding is encoding used to encode 'Raw' data.
	// Unspecified means no encoding.
	ContentEncoding *string `protobuf:"bytes,3,opt,name=contentEncoding" json:"contentEncoding,omitempty"`
	// ContentType  is serialization method used to serialize 'Raw'.
	// Unspecified means ContentTypeJSON.
	ContentType      *string `protobuf:"bytes,4,opt,name=contentType" json:"contentType,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *Unknown) Reset()                    { *m = Unknown{} }
func (m *Unknown) String() string            { return proto.CompactTextString(m) }
func (*Unknown) ProtoMessage()               {}
func (*Unknown) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }

func (m *Unknown) GetTypeMeta() *TypeMeta {
	if m != nil {
		return m.TypeMeta
	}
	return nil
}

func (m *Unknown) GetRaw() []byte {
	if m != nil {
		return m.Raw
	}
	return nil
}

func (m *Unknown) GetContentEncoding() string {
	if m != nil && m.ContentEncoding != nil {
		return *m.ContentEncoding
	}
	return ""
}

func (m *Unknown) GetContentType() string {
	if m != nil && m.ContentType != nil {
		return *m.ContentType
	}
	return ""
}

func init() {
	proto.RegisterType((*RawExtension)(nil), "k8s.io.apimachinery.pkg.runtime.RawExtension")
	proto.RegisterType((*TypeMeta)(nil), "k8s.io.apimachinery.pkg.runtime.TypeMeta")
	proto.RegisterType((*Unknown)(nil), "k8s.io.apimachinery.pkg.runtime.Unknown")
}
func (m *RawExtension) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *RawExtension) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Raw != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(m.Raw)))
		i += copy(dAtA[i:], m.Raw)
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *TypeMeta) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *TypeMeta) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.ApiVersion != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ApiVersion)))
		i += copy(dAtA[i:], *m.ApiVersion)
	}
	if m.Kind != nil {
		dAtA[i] = 0x12
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Kind)))
		i += copy(dAtA[i:], *m.Kind)
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *Unknown) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Unknown) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.TypeMeta != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(m.TypeMeta.Size()))
		n1, err := m.TypeMeta.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if m.Raw != nil {
		dAtA[i] = 0x12
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(m.Raw)))
		i += copy(dAtA[i:], m.Raw)
	}
	if m.ContentEncoding != nil {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ContentEncoding)))
		i += copy(dAtA[i:], *m.ContentEncoding)
	}
	if m.ContentType != nil {
		dAtA[i] = 0x22
		i++
		i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ContentType)))
		i += copy(dAtA[i:], *m.ContentType)
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return offset + 1
}
func (m *RawExtension) Size() (n int) {
	var l int
	_ = l
	if m.Raw != nil {
		l = len(m.Raw)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *TypeMeta) Size() (n int) {
	var l int
	_ = l
	if m.ApiVersion != nil {
		l = len(*m.ApiVersion)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.Kind != nil {
		l = len(*m.Kind)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *Unknown) Size() (n int) {
	var l int
	_ = l
	if m.TypeMeta != nil {
		l = m.TypeMeta.Size()
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.Raw != nil {
		l = len(m.Raw)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.ContentEncoding != nil {
		l = len(*m.ContentEncoding)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.ContentType != nil {
		l = len(*m.ContentType)
		n += 1 + l + sovGenerated(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func sovGenerated(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozGenerated(x uint64) (n int) {
	return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *RawExtension) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowGenerated
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: RawExtension: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: RawExtension: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...)
			if m.Raw == nil {
				m.Raw = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipGenerated(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthGenerated
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *TypeMeta) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowGenerated
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: TypeMeta: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TypeMeta: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ApiVersion", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(dAtA[iNdEx:postIndex])
			m.ApiVersion = &s
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(dAtA[iNdEx:postIndex])
			m.Kind = &s
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipGenerated(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthGenerated
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Unknown) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowGenerated
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Unknown: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Unknown: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field TypeMeta", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.TypeMeta == nil {
				m.TypeMeta = &TypeMeta{}
			}
			if err := m.TypeMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...)
			if m.Raw == nil {
				m.Raw = []byte{}
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContentEncoding", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(dAtA[iNdEx:postIndex])
			m.ContentEncoding = &s
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContentType", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthGenerated
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(dAtA[iNdEx:postIndex])
			m.ContentType = &s
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipGenerated(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthGenerated
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipGenerated(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowGenerated
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
			return iNdEx, nil
		case 1:
			iNdEx += 8
			return iNdEx, nil
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowGenerated
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			iNdEx += length
			if length < 0 {
				return 0, ErrInvalidLengthGenerated
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowGenerated
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipGenerated(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
			}
			return iNdEx, nil
		case 4:
			return iNdEx, nil
		case 5:
			iNdEx += 4
			return iNdEx, nil
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
	}
	panic("unreachable")
}

var (
	ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenerated   = fmt.Errorf("proto: integer overflow")
)

func init() {
	proto.RegisterFile("k8s.io/apimachinery/pkg/runtime/generated.proto", fileDescriptorGenerated)
}

var fileDescriptorGenerated = []byte{
	// 278 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0xb1, 0x4e, 0xf3, 0x30,
	0x14, 0x85, 0x7f, 0xb7, 0x95, 0xda, 0xff, 0xb6, 0x12, 0xc8, 0x53, 0x60, 0x08, 0x55, 0xa6, 0xb2,
	0xd8, 0x12, 0x2c, 0x4c, 0x0c, 0x48, 0x19, 0x59, 0x22, 0x60, 0x60, 0xb3, 0x12, 0x2b, 0x58, 0xa1,
	0xd7, 0x96, 0x73, 0xab, 0xd0, 0x37, 0xe1, 0x29, 0x78, 0x0e, 0x46, 0x1e, 0x01, 0x85, 0x17, 0x41,
	0x31, 0x69, 0x15, 0x55, 0x42, 0x6c, 0x47, 0xc7, 0xe7, 0x3b, 0x3e, 0x17, 0x64, 0x75, 0x55, 0x0b,
	0x63, 0xa5, 0x72, 0x66, 0xad, 0xf2, 0x27, 0x83, 0xda, 0x6f, 0xa5, 0xab, 0x4a, 0xe9, 0x37, 0x48,
	0x66, 0xad, 0x65, 0xa9, 0x51, 0x7b, 0x45, 0xba, 0x10, 0xce, 0x5b, 0xb2, 0xfc, 0xec, 0x07, 0x10,
	0x43, 0x40, 0xb8, 0xaa, 0x14, 0x3d, 0x70, 0x7a, 0xf9, 0x5b, 0xe3, 0x86, 0xcc, 0xb3, 0x34, 0x48,
	0x35, 0xf9, 0xc3, 0xd6, 0x64, 0x09, 0x8b, 0x4c, 0x35, 0xe9, 0x0b, 0x69, 0xac, 0x8d, 0x45, 0x7e,
	0x0c, 0x63, 0xaf, 0x9a, 0x88, 0x2d, 0xd9, 0x6a, 0x91, 0x75, 0x32, 0xb9, 0x86, 0xd9, 0xdd, 0xd6,
	0xe9, 0x5b, 0x4d, 0x8a, 0xc7, 0x00, 0xca, 0x99, 0x07, 0xed, 0xbb, 0x6c, 0x08, 0xfd, 0xcf, 0x06,
	0x0e, 0xe7, 0x30, 0xa9, 0x0c, 0x16, 0xd1, 0x28, 0xbc, 0x04, 0x9d, 0xbc, 0x31, 0x98, 0xde, 0x63,
	0x85, 0xb6, 0x41, 0x9e, 0xc2, 0x8c, 0xfa, 0xae, 0x40, 0xcf, 0x2f, 0xce, 0xc5, 0x1f, 0x67, 0x89,
	0xdd, 0xe7, 0xd9, 0x1e, 0xdd, 0x8d, 0x1c, 0xed, 0x47, 0xf2, 0x15, 0x1c, 0xe5, 0x16, 0x49, 0x23,
	0xa5, 0x98, 0xdb, 0xc2, 0x60, 0x19, 0x8d, 0xc3, 0x86, 0x43, 0x9b, 0x2f, 0x61, 0xde, 0x5b, 0x5d,
	0x71, 0x34, 0x09, 0xa9, 0xa1, 0x75, 0x73, 0xf2, 0xde, 0xc6, 0xec, 0xa3, 0x8d, 0xd9, 0x67, 0x1b,
	0xb3, 0xd7, 0xaf, 0xf8, 0xdf, 0xe3, 0xb4, 0xdf, 0xf2, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x60, 0x1f,
	0x94, 0x77, 0xb5, 0x01, 0x00, 0x00,
}

{'repo_name': 'kelseyhightower/certificate-init-container', 'stars': '131', 'repo_language': 'Go', 'file_name': 'tls-app.yaml', 'mime_type': 'text/plain', 'hash': 5297026792451206082, 'source_dataset': 'data'}


<docs>

<docgroup lang="en" index="index.html">
<doc name="html_gcode" title="G Code quick reference">

<doc name="common_emc2-intro" title="Overleaf Image"/>
<doc name="common_overleaf" title="Overleaf Text"/>
<doc name="common_System_Requirements" title="System Requirements"/>
<doc name="common_Getting_EMC" title="Getting EMC2"/>
<doc name="common_Updating_EMC" title="Updating EMC2"/>
<doc name="quickstart_stepper_quickstart" title="Stepper Quickstart"/>
<doc name="config_stepconf" title="Configuration Wizard for Stepper-Based Machines"/>
<doc name="config_pncconf" title="Point and Click Configuration Wizard (for Machines using Mesa)"/>
<doc name="config_copy_and_run" title="Copy and Run"/>
<doc name="common_Linux_FAQ" title="Linux FAQ"/>
<doc name="common_GPLD_Copyright" title="Copyright and Documentation License"/>

<doc name="common_overleaf" title="Overleaf Text"/>
<doc name="common_user-foreword" title="Foreword"/>
<doc name="common_user-intro" title="Introduction"/>
<doc name="common_user-concepts" title="Important User Concepts"/>
<doc name="gui_axis" title="GUI: Axis"/>
<doc name="gui_touchy" title="GUI: Touchy"/>
<doc name="gui_ngcgui" title="GUI: NGCGUI"/>
<doc name="gui_tklinuxcnc" title="GUI: TkLinuxCNC"/>
<doc name="gui_mini" title="GUI: Mini"/>
<doc name="common_machining_center" title="Machining Center Info"/>
<doc name="gcode_overview" title="Gcode Overview"/>
<doc name="gcode_coordinates" title="Gcode Coordinates"/>
<doc name="gcode_tool-compensation" title="Gcode Tool Compensation"/>
<doc name="gcode_main" title="The EMC2 Gcode Language"/>
<doc name="gcode_mill_canned" title="Gcode Mill Canned Cycle Examples"/>
<doc name="lathe_lathe-user" title="Lathe User Information"/>
<doc name="plasma_plasmac-user-guide" title="PlasmaC User Guide"/>
<doc name="plasma_plasma-cnc-primer" title="Plasma CNC Primer"/>
<doc name="gcode_rs274ngc" title="RS-274/NGC Gcode"/>
<doc name="examples_gcode" title="Gcode Examples"/>
<doc name="gui_image-to-gcode" title="Image to Gcode"/>
<doc name="common_glossary" title="Glossary"/>
<doc name="common_GPLD_Copyright" title="Copyright and Documentation License"/>

<doc name="common_overleaf" title="Overleaf Text"/>
<doc name="hal_intro" title="Introduction"/>
<doc name="hal_tutorial" title="HAL Advanced Tutorial"/>
<doc name="hal_general-ref" title="General Reference"/>
<doc name="hal_tools" title="HAL Tools"/>
<doc name="hal_basic-hal" title="Basic HAL Info"/>
<doc name="hal_halshow" title="Halshow"/>
<doc name="hal_components" title="HAL Components"/>
<doc name="hal_parallel_port" title="Parallel Port Drivers"/>
<doc name="gui_halui" title="HAL User Interface"/>
<doc name="hal_hal-examples" title="HAL Examples"/>
<doc name="hal_comp" title="Comp: a tool for creating HAL components"/>
<doc name="hal_halmodule" title="Creating Userspace Python Components with the 'hal' module"/>
<doc name="drivers_ax5214h" title="AX5214H Driver"/>
<doc name="drivers_gs2" title="GS2 Driver"/>
<doc name="drivers_hostmot2" title="HostMot2 Driver"/>
<doc name="drivers_motenc" title="Motenc Driver"/>
<doc name="drivers_opto22" title="Opto22 Driver"/>
<doc name="drivers_pico-ppmc" title="Pico PPMC Driver"/>
<doc name="drivers_pluto-p" title="Pluto-P Driver"/>
<doc name="drivers_servo-to-go" title="Servo-To-Go Driver"/>
<doc name="drivers_gm" title="General Mechatronics GM6-PCI Driver"/>
<doc name="common_gpld-copyright" title="Copyright and Documentation License"/>

<doc name="common_overleaf" title="Overleaf Text"/>
<doc name="common_integrator-concepts" title="Important Integrator Concepts"/>
<doc name="install_Latency_Test" title="Latency Test"/>
<doc name="config_ini-config" title="Basic Configuration"/>
<doc name="config_ini-homing" title="Homing Configuration"/>
<doc name="config_lathe-config" title="Lathe Configuration"/>
<doc name="config_core-components" title="EMC2 interface to HAL"/>
<doc name="config_stepper" title="Stepper Configuration"/>
<doc name="hal_pyvcp" title="Python Virtual Control Panels (pyVCP)"/>
<doc name="hal_pyvcp-examples" title="pyVCP Examples"/>
<doc name="gui_gladevcp" title="Glade Virtual Control Panel"/>
<doc name="gui_gscreen" title="Gscreen"/>
<doc name="motion_kinematics" title="Kinematics"/>
<doc name="motion_tweaking_steppers" title="Tweaking Steppers"/>
<doc name="motion_pid_theory" title="PID theory"/>
<doc name="ladder_ladder_intro" title="Ladder Introduction"/>
<doc name="ladder_classic_ladder" title="ClassicLadder"/>
<doc name="ladder_ladder_examples" title="ClassicLadder Examples"/>
<doc name="examples_pci-parallel-port" title="PCI Parallel Port"/>
<doc name="examples_spindle" title="Spindle Example"/>
<doc name="examples_mpg" title="MPG Example"/>
<doc name="examples_gs2-example" title="GS2 Example"/>
<doc name="common_stepper-diagnostics" title="Stepper Quickstart"/>
<doc name="common_Linux_FAQ" title="Linux FAQ"/>
<doc name="common_glossary" title="Glossary"/>
<doc name="common_gpld-copyright" title="Copyright and Documentation License"/>

<doc name="common_overleaf" title="Overleaf Text"/>
<doc name="code_code-notes" title="Code Notes"/>
<doc name="code_nml-messages" title="NML Messages"/>
<doc name="code_style-guide" title="Style Guide"/>
<doc name="common_Glossary" title="Glossary"/>
<doc name="common_gpld-copyright" title="Copyright and Documentation License"/>

<doc name="xref" title="Cross Reference Index"/>
</docgroup>

<docgroup lang="es" index="index_es.html">
<doc name="html_gcode_es" title="Référence G Code, aide rapide"/>

<doc name="common/overleaf.html" title="Texte de la page couverture (en anglais)"/>
<doc name="common/System_Requirements_es.html" title="Configuration requise"/>
<doc name="common/Getting_EMC_es.html" title="Où trouver EMC2"/>
<doc name="common/Updating_EMC_es.html" title="Mise à jour d'EMC2"/>
<doc name="quickstart/stepper_quickstart_es.html" title="Démarrage rapide"/>
<doc name="config/stepconf_es.html" title="L'assistant de configuration StepConf"/>
<doc name="config/pncconf_es.html" title="L'assistant de configuration PncConf (pour les machines utilisant Mesa)"/>
<doc name="config/copy_and_run_es.html" title="Copier et exécuter"/>
<doc name="common/Linux_FAQ_es.html" title="Petite FAQ Linux"/>
<doc name="common/gpld-copyright.html" title="Copyright et Licence de la documentation (en anglais)"/>

<doc name="common/overleaf.html" title="Texte de la page couverture (en anglais)"/>
<doc name="common/userforeword_es.html" title="Avant-propos"/>
<doc name="common/user_intro_es.html" title="Introduction"/>
<doc name="common/User_Concepts_es.html" title="Concepts importantes pour l'utilisateur"/>
<doc name="gui/axis_es.html" title="GUI: Axis"/>
<doc name="gui/touchy_es.html" title="GUI: Touchy"/>
<doc name="gui/ngcgui_es.html" title="GUI: NGCGUI"/>
<doc name="gui/tklinuxcnc_es.html" title="GUI: TkLinuxCNC"/>
<doc name="gui/mini_es.html" title="GUI: Mini"/>
<doc name="common/machining_center_es.html" title="Informations Centre d'usinage"/>
<doc name="gcode/overview_es.html" title="Aperçu gcode"/>
<doc name="gcode/coordinates_es.html" title="Les systèmes de coordonnées"/>
<doc name="gcode/tool_compensation_es.html" title="Les compensations d'outil"/>
<doc name="gcode/main_es.html" title="Le langage Gcode EMC2"/>
<doc name="gcode/mill_canned_es.html" title="Les cycles préprogrammés"/>
<doc name="lathe/lathe-user_es.html" title="Informations spécifiques aux tours"/>
<doc name="gcode/rs274ngc_es.html" title="Le language G-code RS274/NGC"/>
<doc name="examples/gcode_es.html" title="Exemples en G-code"/>
<doc name="gui/image-to-gcode_es.html" title="Les fonctionnalités d'Image-to-gcode"/>
<doc name="common/Glossary_es.html" title="Glossaire"/>
<doc name="common/GPLD_Copyright.html" title="Copyright et Licence de la documentation (en anglais)"/>

<doc name="common/overleaf.html" title="Texte de la page couverture (en anglais)"/>
<doc name="hal/intro_es.html" title="Introduction à HAL"/>
<doc name="hal/tutorial_es.html" title="Le tutoriel de HAL"/>
<doc name="hal/general_ref_es.html" title="Documentation générale de HAL"/>
<doc name="hal/tools_es.html" title="Outils et utilitaires pour HAL"/>
<doc name="hal/basic_hal_es.html" title="Les bases de HAL"/>
<doc name="hal/halshow_es.html" title="Les fonctionnalités de Halshow"/>
<doc name="hal/components_es.html" title="Exemples pour HAL"/>
<doc name="hal/rtcomps_es.html" title="Les composants temps réel"/>
<doc name="hal/parallel_port_es.html" title="Pilotes de port parallèle"/>
<doc name="gui/halui_es.html" title="halui"/>
<doc name="hal/hal-examples_es.html" title="Exemples pour HAL"/>
<doc name="hal/comp_es.html" title="Comp: un outil de création de composants HAL"/>
<doc name="hal/halmodule_es.html" title="Créer un espace utilisateur en Python avec le module 'hal'"/>
<doc name="drivers/AX5214H_es.html" title="Pilote AX5214H"/>
<doc name="drivers/GS2_es.html" title="Pilote GS2"/>
<doc name="drivers/hostmot2_es.html" title="Pilote HostMot2"/>
<doc name="drivers/m5i20_es.html" title="Pilote Mesa 5i20 (obsolète, l'utilisation du pilote HostMot2)"/>
<doc name="drivers/motenc_es.html" title="Pilote Motenc Driver"/>
<doc name="drivers/opto22_es.html" title="Pilote Opto22 Driver"/>
<doc name="drivers/pico_ppmc_es.html" title="Pilote Pico PPMC Driver"/>
<doc name="drivers/pluto_p_es.html" title="Pilote Pluto-P Driver"/>
<doc name="drivers/servo_to_go_es.html" title="Pilote Servo-To-Go Driver"/>
<doc name="common/GPLD_Copyright.html" title="Copyright et Licence de la documentation (en anglais)"/>

<doc name="common/overleaf.html" title="Texte de la page couverture (en anglais)"/>
<doc name="common/Integrator_Concepts_es.html" title="Concepts intégrateurs importants"/>
<doc name="install/Latency_Test_es.html" title="Test de latence"/>
<doc name="config/ini_config_es.html" title="La configuration en détail"/>
<doc name="config/ini_homing_es.html" title="Configuration des prises d'origine"/>
<doc name="config/lathe_config_es.html" title="Tour de configuration"/>
<doc name="config/emc2hal_es.html" title="Interface entre LinuxCNC et HAL"/>
<doc name="config/stepper_es.html" title="Configuration pas à pas"/>
<doc name="hal/pyvcp_es.html" title="Panneaux de commande virtuel Python (pyVCP)"/>
<doc name="hal/pyvcp_examples_es.html" title="exemples pyVCP"/>
<doc name="gui/gladevcp_es.html" title="Panneaux de commande virtuel Glade"/>
<doc name="motion/kinematics_es.html" title="Notions de cinématique"/>
<doc name="motion/tweaking_steppers_es.html" title="Réglage des moteurs pas à pas"/>
<doc name="motion/pid_theory_es.html" title="Théorie du PID"/>
<doc name="ladder/ladder_intro_es.html" title="Introduction au langage Ladder"/>
<doc name="ladder/classic_ladder_es.html" title="ClassicLadder"/>
<doc name="ladder/ladder_examples_es.html" title="Exemples ClassicLadder"/>
<doc name="examples/pci_parallel_port_es.html" title="Exemple Ajouter un port parallèle PCI"/>
<doc name="examples/spindle_es.html" title="Exemple contrôler la vitesse de la broche"/>
<doc name="examples/mpg_es.html" title="Exemple Utiliser une manivelle électronique"/>
<doc name="examples/gs2_example_es.html" title="Exemple GS2"/>
<doc name="common/Stepper_Diagnostics_es.html" title="Pas à pas de diagnostic"/>
<doc name="common/Linux_FAQ_es.html" title="Petite FAQ Linux"/>
<doc name="common/Glossary_es.html" title="Glossaire"/>
<doc name="common/GPLD_Copyright.html" title="Copyright et Licence de la documentation (en anglais)"/>

<doc name="common/overleaf.html" title="Texte de la page couverture (en anglais)"/>
<doc name="code/code-notes.html" title="Notes sur le code (en anglais)"/>
<doc name="code/nml-messages.html" title="Messages LNM (en anglais)"/>
<doc name="code/style-guide.html" title="Guide de style (en anglais)"/>
<doc name="common/Glossary.html" title="Glossaire (en anglais)"/>
<doc name="common/GPLD_Copyright.html" title="Copyright et Licence de la documentation (en anglais)"/>

<doc name="./xref_es.html" title="Indice de référence croisée"/>
</docgroup>

<docgroup lang="fr" index="index_fr.html">
<doc name="html_gcode_fr" title="Référence du G Code, aide rapide"/>

<doc name="common/overleaf_fr.html" title="Texte de la couverture"/>
<doc name="common/System_Requirements_fr.html" title="Configuration requise"/>
<doc name="common/Getting_linuxcnc_fr.html" title="Se procurer et installer LinuxCNC"/>
<doc name="quickstart/stepper_quickstart_fr.html" title="Informations pr&eacte;alables à configuration"/>
<doc name="config/stepconf_fr.html" title="L'assistant graphique de configuration StepConf"/>
<doc name="config/pncconf_fr.html" title="L'assistant graphique de configuration PncConf (Mesa)"/>
<doc name="common/Linux_FAQ_fr.html" title="Petite FAQ Linux"/>

<doc name="common/userforeword_fr.html" title="Avant-propos"/>
<doc name="common/user_intro_fr.html" title="Introduction"/>
<doc name="common/User_Concepts_fr.html" title="Concepts importantes pour l'utilisateur"/>
<doc name="gui/axis_fr.html" title="L'interface graphique Axis"/>
<doc name="gui/touchy_fr.html" title="L'interface graphique Touchy"/>
<doc name="gui/ngcgui_fr.html" title="L'interface graphique NGCGUI"/>
<doc name="gui/tklinuxcnc_fr.html" title="L'interface graphique TkLinuxCNC"/>
<doc name="gui/mini_fr.html" title="L'interface graphique Mini"/>
<doc name="gcode/machining_center_fr.html" title="Aperçu global d'une machine CNC"/>
<doc name="gcode/overview_fr.html" title="Vue générale du G-code"/>
<doc name="gcode/gcode_fr.html" title="Le G-code"/>
<doc name="gcode/coordinates_fr.html" title="Les systèmes de coordonnées"/>
<doc name="gcode/tool_compensation_fr.html" title="Les compensations d'outil"/>
<doc name="lathe/lathe-user_fr.html" title="Informations spécifiques aux tours"/>
<doc name="examples/gcode_fr.html" title="Exemple de programmes en G-code"/>
<doc name="gui/image-to-gcode_fr.html" title="Les fonctionnalités d'Image-to-gcode"/>

<doc name="hal/intro_fr.html" title="Introduction à HAL"/>
<doc name="hal/general_ref_fr.html" title="Conventons générales"/>
<doc name="hal/basic_hal_fr.html" title="Commandes et composants de base"/>
<doc name="hal/tutorial_fr.html" title="Le tutoriel de HAL"/>
<doc name="hal/halshow_fr.html" title="Les fonctionnalités de Halshow"/>
<doc name="hal/components_fr.html" title="Liste des composants de HAL"/>
<doc name="hal/rtcomps_fr.html" title="Les composants temps réel"/>
<doc name="hal/halui_fr.html" title="L'interface halui"/>
<doc name="hal/hal-examples_fr.html" title="Exemples pour HAL"/>
<doc name="hal/comp_fr.html" title="Comp: un outil de création de composants HAL"/>
<doc name="hal/halmodule_fr.html" title="Créer des composants de HAL pour l'espace utilisateur"/>

<doc name="common/Integrator_Concepts_fr.html" title="Concepts importants pour l'intégrateur"/>
<doc name="install/Latency_Test_fr.html" title="Test de latence"/>
<doc name="config/ini_config_fr.html" title="La configuration en détail"/>
<doc name="config/ini_homing_fr.html" title="Configuration des prises d'origine"/>
<doc name="config/lathe_config_fr.html" title="Configuration des tours"/>
<doc name="hal/haltcl_fr.html" title="Fichiers TCL pour HAL"/>
<doc name="config/linuxcnc2hal_fr.html" title="Interface entre LinuxCNC et HAL"/>
<doc name="config/stepper_fr.html" title="Configuration des moteurs pas à pas"/>
<doc name="hal/pyvcp_fr.html" title="Panneaux de commande virtuels PyVCP"/>
<doc name="hal/pyvcp_examples_fr.html" title="Exemples avec PyVCP"/>
<doc name="gui/gladevcp_fr.html" title="Outil de création d'interfaces graphiques GladeVCP"/>
<doc name="hal/parallel_port_fr.html" title="Pilote de port parallèle"/>
<doc name="drivers/AX5214H_fr.html" title="Pilote AX5214H"/>
<doc name="drivers/GS2_fr.html" title="Pilote GS2"/>
<doc name="drivers/hostmot2_fr.html" title="Pilote HostMot2"/>
<doc name="drivers/motenc_fr.html" title="Pilote Motenc Driver"/>
<doc name="drivers/opto22_fr.html" title="Pilote Opto22 Driver"/>
<doc name="drivers/pico_ppmc_fr.html" title="Pilote Pico PPMC Driver"/>
<doc name="drivers/pluto_p_fr.html" title="Pilote Pluto-P Driver"/>
<doc name="motion/kinematics_fr.html" title="Notions de cinématique"/>
<doc name="motion/tweaking_steppers_fr.html" title="Réglage des moteurs pas à pas"/>
<doc name="motion/pid_theory_fr.html" title="Théorie du PID"/>
<doc name="ladder/ladder_intro_fr.html" title="Introduction au langage Ladder"/>
<doc name="ladder/classic_ladder_fr.html" title="ClassicLadder"/>
<doc name="ladder/ladder_examples_fr.html" title="Exemples avec ClassicLadder"/>
<doc name="examples/pci_parallel_port_fr.html" title="Exemple: Ajouterer un port parallèle PCI"/>
<doc name="examples/spindle_fr.html" title="Exemple: Contrôler la vitesse de la broche"/>
<doc name="examples/mpg_fr.html" title="Exemple: Utiliser une manivelle électronique"/>
<doc name="examples/gs2_example_fr.html" title="Exemple: Utiliser un GS2"/>
<doc name="common/Stepper_Diagnostics_fr.html" title="Diagnostic des moteurs pas à pas"/>
<doc name="common/Updating_linuxcnc_fr.html" title="Mises à jour de LinuxCNC"/>

<doc name="code/code-notes.html" title="Notes sur le code (en anglais)"/>
<doc name="code/nml-messages.html" title="Messages LNM (en anglais)"/>
<doc name="code/style-guide.html" title="Guide de style (en anglais)"/>
<doc name="common/glossary.html" title="Glossaire (en anglais)"/>
<doc name="common/GPLD_Copyright_fr.html" title="Copyright et Licence de la documentation"/>

<doc name="./xref_fr.html" title="Index"/>
</docgroup>

</docs>

{'repo_name': 'LinuxCNC/linuxcnc', 'stars': '804', 'repo_language': 'Python', 'file_name': 'CNC.menu', 'mime_type': 'text/plain', 'hash': 338814575482075140, 'source_dataset': 'data'}


/* ----------------------------------------------------------------------------
 *         SAM Software Package License
 * ----------------------------------------------------------------------------
 * Copyright (c) 2012, Atmel Corporation
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following condition is met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the disclaimer below.
 *
 * Atmel's name may not be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * ----------------------------------------------------------------------------
 */

#ifndef _SAM3S8_WDT_INSTANCE_
#define _SAM3S8_WDT_INSTANCE_

/* ========== Register definition for WDT peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_WDT_CR          (0x400E1450U) /**< \brief (WDT) Control Register */
#define REG_WDT_MR          (0x400E1454U) /**< \brief (WDT) Mode Register */
#define REG_WDT_SR          (0x400E1458U) /**< \brief (WDT) Status Register */
#else
#define REG_WDT_CR (*(WoReg*)0x400E1450U) /**< \brief (WDT) Control Register */
#define REG_WDT_MR (*(RwReg*)0x400E1454U) /**< \brief (WDT) Mode Register */
#define REG_WDT_SR (*(RoReg*)0x400E1458U) /**< \brief (WDT) Status Register */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */

#endif /* _SAM3S8_WDT_INSTANCE_ */

{'repo_name': 'digistump/DigistumpArduino', 'stars': '484', 'repo_language': 'C', 'file_name': 'TinySoftwareSPI.cpp', 'mime_type': 'text/x-c', 'hash': 7430069299736934400, 'source_dataset': 'data'}


using System;
using System.Collections.Generic;
using System.Linq;
using Trady.Analysis.Infrastructure;
using Trady.Core.Infrastructure;

namespace Trady.Analysis.Indicator
{
    public class RelativeMomentumIndex<TInput, TOutput> : NumericAnalyzableBase<TInput, decimal?, TOutput>
    {
        public int RmiPeriod { get; }
        public int MtmPeriod { get; }

        private readonly RelativeMomentumByTuple _rm;

        public RelativeMomentumIndex(IEnumerable<TInput> inputs, Func<TInput, decimal?> inputMapper, int rmiPeriod, int mtmPeriod) : base(inputs, inputMapper)
        {
            _rm = new RelativeMomentumByTuple(inputs.Select(inputMapper), rmiPeriod, mtmPeriod);

            MtmPeriod = mtmPeriod;
            RmiPeriod = rmiPeriod;
        }

        protected override decimal? ComputeByIndexImpl(IReadOnlyList<decimal?> mappedInputs, int index)
        {
            var currentRm = _rm[index];
            return currentRm == 0 ? default : 100 * currentRm / (1 + currentRm);
        }
    }

    public class RelativeMomentumIndexByTuple : RelativeMomentumIndex<decimal?, decimal?>
    {
        public RelativeMomentumIndexByTuple(IEnumerable<decimal?> inputs, int rmiPeriod, int mtmPeriod)
            : base(inputs, i => i, rmiPeriod, mtmPeriod)
        {
        }
    }

    public class RelativeMomentumIndex : RelativeMomentumIndex<IOhlcv, AnalyzableTick<decimal?>>
    {
        public RelativeMomentumIndex(IEnumerable<IOhlcv> inputs, int rmiPeriod, int mtmPeriod)
            : base(inputs, i => i.Close, rmiPeriod, mtmPeriod)
        {
        }
    }
}

{'repo_name': 'lppkarl/Trady', 'stars': '360', 'repo_language': 'C#', 'file_name': 'launch.json', 'mime_type': 'text/plain', 'hash': -1237249429585423234, 'source_dataset': 'data'}


package com.thinkgem.jeesite.modules.act.utils;

import java.util.LinkedHashSet;
import java.util.Set;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.impl.RepositoryServiceImpl;
import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.engine.impl.el.FixedValue;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.impl.task.TaskDefinition;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.log4j.Logger;

/**
 * 流程定义相关操作的封装
 * @author bluejoe2008@gmail.com
 */
public abstract class ProcessDefUtils {

	public static ActivityImpl getActivity(ProcessEngine processEngine, String processDefId, String activityId) {
		ProcessDefinitionEntity pde = getProcessDefinition(processEngine, processDefId);
		return (ActivityImpl) pde.findActivity(activityId);
	}

	public static ProcessDefinitionEntity getProcessDefinition(ProcessEngine processEngine, String processDefId) {
		return (ProcessDefinitionEntity) ((RepositoryServiceImpl) processEngine.getRepositoryService()).getDeployedProcessDefinition(processDefId);
	}

	public static void grantPermission(ActivityImpl activity, String assigneeExpression, String candidateGroupIdExpressions,
			String candidateUserIdExpressions) throws Exception {
		TaskDefinition taskDefinition = ((UserTaskActivityBehavior) activity.getActivityBehavior()).getTaskDefinition();
		taskDefinition.setAssigneeExpression(assigneeExpression == null ? null : new FixedValue(assigneeExpression));
		FieldUtils.writeField(taskDefinition, "candidateUserIdExpressions", ExpressionUtils.stringToExpressionSet(candidateUserIdExpressions), true);
		FieldUtils
				.writeField(taskDefinition, "candidateGroupIdExpressions", ExpressionUtils.stringToExpressionSet(candidateGroupIdExpressions), true);

		Logger.getLogger(ProcessDefUtils.class).info(
				String.format("granting previledges for [%s, %s, %s] on [%s, %s]", assigneeExpression, candidateGroupIdExpressions,
						candidateUserIdExpressions, activity.getProcessDefinition().getKey(), activity.getProperty("name")));
	}

	/**
	 * 实现常见类型的expression的包装和转换
	 *
	 * @author bluejoe2008@gmail.com
	 *
	 */
	public static class ExpressionUtils {
		public static Expression stringToExpression(ProcessEngineConfigurationImpl conf, String expr) {
			return conf.getExpressionManager().createExpression(expr);
		}

		public static Expression stringToExpression(String expr) {
			return new FixedValue(expr);
		}

		public static Set<Expression> stringToExpressionSet(String exprs) {
			Set<Expression> set = new LinkedHashSet<Expression>();
			for (String expr : exprs.split(";")) {
				set.add(stringToExpression(expr));
			}

			return set;
		}
	}
}

{'repo_name': 'thinkgem/jeesite', 'stars': '7433', 'repo_language': 'JavaScript', 'file_name': 'activiti.oracle.create.engine.sql', 'mime_type': 'text/plain', 'hash': 3956941378279100215, 'source_dataset': 'data'}


project(libhwui)

set(REPO_PATH ${ANDROID_FRAMEWORKS_BASE}/libs/hwui)

set(hwui_SRCS
    ${REPO_PATH}/utils/Blur.cpp
    ${REPO_PATH}/utils/SortedListImpl.cpp
    ${REPO_PATH}/thread/TaskManager.cpp
    ${REPO_PATH}/font/CacheTexture.cpp
    ${REPO_PATH}/font/Font.cpp
    ${REPO_PATH}/AssetAtlas.cpp
    ${REPO_PATH}/FontRenderer.cpp
    ${REPO_PATH}/GammaFontRenderer.cpp
    ${REPO_PATH}/Caches.cpp
    ${REPO_PATH}/DisplayList.cpp
    ${REPO_PATH}/DeferredDisplayList.cpp
    ${REPO_PATH}/DisplayListLogBuffer.cpp
    ${REPO_PATH}/DisplayListRenderer.cpp
    ${REPO_PATH}/Dither.cpp
    ${REPO_PATH}/Extensions.cpp
    ${REPO_PATH}/FboCache.cpp
    ${REPO_PATH}/GradientCache.cpp
    ${REPO_PATH}/Image.cpp
    ${REPO_PATH}/Layer.cpp
    ${REPO_PATH}/LayerCache.cpp
    ${REPO_PATH}/LayerRenderer.cpp
    ${REPO_PATH}/Matrix.cpp
    ${REPO_PATH}/OpenGLRenderer.cpp
    ${REPO_PATH}/Patch.cpp
    ${REPO_PATH}/PatchCache.cpp
    ${REPO_PATH}/PathCache.cpp
    ${REPO_PATH}/PathTessellator.cpp
    ${REPO_PATH}/PixelBuffer.cpp
    ${REPO_PATH}/Program.cpp
    ${REPO_PATH}/ProgramCache.cpp
    ${REPO_PATH}/RenderBufferCache.cpp
    ${REPO_PATH}/ResourceCache.cpp
    ${REPO_PATH}/SkiaColorFilter.cpp
    ${REPO_PATH}/SkiaShader.cpp
    ${REPO_PATH}/Snapshot.cpp
    ${REPO_PATH}/Stencil.cpp
    ${REPO_PATH}/Texture.cpp
    ${REPO_PATH}/TextureCache.cpp
    ${REPO_PATH}/TextDropShadowCache.cpp
)

add_definitions(-fpermissive)
add_library(hwui SHARED ${hwui_SRCS})
if(FORCE_32BIT_BUILD)
    set_target_properties(hwui PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif(FORCE_32BIT_BUILD)
target_compile_definitions(hwui
    PRIVATE
    -DSK_BUILD_FOR_ANDROID # lololo skia internals
    -DNDEBUG
    PUBLIC
    -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
)
target_include_directories(hwui
    PUBLIC
    ${ANDROID_FRAMEWORKS_BASE}/include/private
    PRIVATE
    ${LIBLOG_INCLUDES}
    ${SKIA_INCLUDES}
    ${SKIA_PATH}/src/core
    ${REPO_PATH}
    ${LIBHARDWARE_INCLUDES}
)
target_link_libraries(hwui
    log
    cutils
    utils
    EGL
    GL
    GLESv2
    epoxy
    skia
    ui
    androidfw
)
install(TARGETS hwui DESTINATION ${ANDROID_LIB_DIR})

{'repo_name': 'shashlik/old-shashlik', 'stars': '317', 'repo_language': 'CMake', 'file_name': 'FindLLVM.cmake', 'mime_type': 'text/plain', 'hash': -5619222297830077141, 'source_dataset': 'data'}


# Fabric.js介绍 第二部分

在本系列的第一部分，我们只开始熟悉Fabric.js。我们研究了Fabric在其对象模型和对象层次结构中使用Fabric的各种实例：简单的形状，图像和复杂的路径。我们还学习了如何使用画布上的Fabric对象执行简单的操作。

既然基础知识都差不多了，让我们开始学习一些有趣的东西吧！

## 动画（animate）

没有听说过哪一个强大的canvas库是没有动画功能的，当然Fabric也不例外。既然有这样一个强大的对象模型和图形功能，那么没有内置动画简直就是一种耻辱。

住改变任何对象的属性是多么容易？我们调用```set```方法，传递相应的值：

```js
rect.set('angle', 45);
```

那么，动画对象就像一样简单。每个Fabric对象都有```animate```方法，它可以让对象执行动画。

```js
rect.animate('angle', 45, {
  onChange: canvas.renderAll.bind(canvas)
});
```

第一个参数是动画的属性，第二个参数是动画的最终位置，如果矩形为-15°角，我们传递45，这个矩形将从-15°到45°进行动画。第三个参数是一个可选的对象，指定动画的细节：持续时间，回调，动效等。

```animate```的一个方便之处在于它还支持相对值。例如，如果要将对象向左移动100px，则可以这样做：

```js
rect.animate('left', '+=100', { onChange: canvas.renderAll.bind(canvas) });
```

同样的，逆时针旋转5度，可以像这样完成：

```js
rect.animate('angle', '-=5', { onChange: canvas.renderAll.bind(canvas) });
```

你可能会想知道为什么我们总是在那里指定“onChange”回调。不是说第三个参数是可选的吗？是为了每个动画帧的渲染都能让我们看到实际的动画效果！您可以看到，当我们调用```animate```方法时，它只会随着时间的推移赋予属性值，遵循特定的算法(例如动效)。所以```rect.animate（'angle'，45）```会改变对象的角度，但不会在每次角度变化后重新渲染画布屏幕。我们显然需要这种重新渲染才能看到实际的动画。

记住，在画布的下面有整个对象模型。对象有自己的属性和关系，而canvas只负责将它们的存在投射到外部世界。

每次更改之后，```animate```不会自动重新绘制画布的原因是由于性能。毕竟，我们可以在画布上有数以千计的动画对象，如果每个对象都尝试重新渲染屏幕，这是非常不妥的。在许多对象的情况下，您可以使用像```requestAnimationFrame```（或其他基于定时器的）循环来独立地渲染画布，而不需要为每个对象调用```renderAll```。但大多数情况下，您可能需要将```canvas.renderAll```显式指定为“onChange”的回调。

那么我们可以通过哪些其他选项来动画？

- **from** 允许指定动画属性的起始值（如果我们不希望使用当前值）。
- **duration** 默认为500ms。可以用来改变动画的持续时间。
- **onComplete** 动画结束之后的回调。
- **easing** 动效函数。

除了easing，所有这些选择都应该是不言而喻的。我们来看看吧。

默认情况下，动画使用“easeInSine”动效执行。如果这不是你需要的，那么在```fabric.util.ease```下有一大堆动效的选项。例如，如果我们想以一种有弹性的方式将对象移到左边：

```js
rect.animate('left', 500, {
  onChange: canvas.renderAll.bind(canvas),
  duration: 1000,
  easing: fabric.util.ease.easeOutBounce
});
```

注意使用了```fabric.util.ease.easeOutBounce```作为easing的值，其他值得注意的还包括```easeInCubic```，```easeOutCubic```，```easeInElastic```，```easeOutElastic```，```easeInBounce```和```easeOutExpo```。

所以这覆盖了Fabric的动画部分。只是给你一些可能的想法：使对象的angle改变来形成旋转动画，使对象的top/left改变来形成移动的动画，使对象的width/height改变来形成大小缩放的动画，等等。

## 图像滤镜（filters）

在第一节中我们学习了在Fabric中如何使用图像：```fabric.Image```构造函数，它接受图像元素。还有```fabric.Image.fromURL```方法，可以创建URL字符串的图像实例。并且这些图像可以像其他对象一样投射到canvas画布上。

但是，像图像这种有趣的东西，对他们应用图像滤镜更加酷！

Fabric在默认情况下提供了很少的滤镜，对于支持或不支持WEBGL的浏览器都可以使用，也很容易去定义。一些你可能非常熟悉的内置的滤镜：去除白色背景、灰度滤镜、反色或亮度调色。其他的则可能不太受欢迎： colormatrix，sepia，noise。

那么我们怎么在Fabric中使用滤镜呢？```fabric.Image```的每个实例都有“filters”属性，它是一个简单的滤镜数组。该数组中的每个滤镜都是一个Fabric滤镜的一个实例，或您自己的自定义滤镜的一个实例。

让我们创建一个灰度（Grayscale）图像：

```js
fabric.Image.fromURL('pug.jpg', function(img) {
  // 添加滤镜
  img.filters.push(new fabric.Image.filters.Grayscale());
  // 图片加载完成之后，应用滤镜效果
  img.applyFilters();
  // 将处理后的图片添加到canvas画布上
  canvas.add(img);
});
```

![ ](http://fabricjs.com/article_assets/2_1.png)

图像的色偏（Sepia）版本怎么样？

```js
fabric.Image.fromURL('pug.jpg', function(img) {
  img.filters.push(new fabric.Image.filters.Sepia());
  img.applyFilters();
  canvas.add(img);
});
```

![ ](http://fabricjs.com/article_assets/2_2.png)

由于“filters”属性是一个数组，我们可以用数组方法执行任何所需的操作：移除滤镜（pop，splice，shift），添加滤镜（push，unshift，splice），甚至可以组合多个滤镜。当我们调用```applyFilters```时，“filters”数组中存在的任何滤镜将逐个应用，所以让我们尝试创建一个既色偏又明亮（Brightness）的图像。

```js
fabric.Image.fromURL('pug.jpg', function(img) {
  img.filters.push(
    new fabric.Image.filters.Sepia(),
    new fabric.Image.filters.Brightness({ brightness: 100 }));

  img.applyFilters();
  canvas.add(img);
});
```

![ ](http://fabricjs.com/article_assets/2_3.png)

请注意，我们还将```{brightness：100}```对象传递给Brightness滤镜。这是因为有些滤镜不可配置，例如，灰度，反转，棕褐色（e.g. grayscale, invert, sepia），而其他过滤器可以配置。对于Brightness滤镜，能够配置亮度级别（-1 - 1 即： 全黑色 - 全白色）。对于噪声（noise）滤镜，能配置的是噪声值（0-1000）。对于“删除颜色”滤镜，能配置的是阈值和距离值。等等。

那么现在，您已经熟悉了Fabric滤镜，现在是时候开箱并创建自己的滤镜了！

```js
fabric.Image.filters.Redify = fabric.util.createClass({

  type: 'Redify',

  /**
   * 用于编程的片段源码
   */
  fragmentSource: 'precision highp float;\n' +
    'uniform sampler2D uTexture;\n' +
    'varying vec2 vTexCoord;\n' +
    'void main() {\n' +
      'vec4 color = texture2D(uTexture, vTexCoord);\n' +
      'color.g = 0;\n' +
      'color.b = 0;\n' +
      'gl_FragColor = color;\n' +
    '}',

  applyTo2d: function(options) {
    var imageData = options.imageData,
        data = imageData.data, i, len = data.length;

    for (i = 0; i < len; i += 4) {
      data[i + 1] = 0;
      data[i + 2] = 0;
    }

  }
});

fabric.Image.filters.Brightness.fromObject = fabric.Image.filters.BaseFilter.fromObject;
```

![ ](http://fabricjs.com/article_assets/2_4.png)

深入研究这段代码，主要的操作是在循环中进行。我们把绿色(data[i+1])和蓝色(data[i+2])替换为0，本质上是移除它们。标准rgb三元色的红色组件保持不变，基本上使整个图像变成红色。如您所见，```applyTo```方法传递一个选项对象，该对象包含滤镜管道的该阶段的图像的数据```imageData```。从这里，我们可以遍历其像素（getImageData（）.data），以任何我们想要的方式修改它们。如果要浏览器WEBGL启用的滤镜能够在GPU上运行，要做到这一点，你必须提供一个片段着色器来描述在像素上执行的操作。在Fabric中定义了许多滤镜，您可以在其中看到如何编写片段或着色器的示例。

## 颜色（Colors）

无论您是否使用十六进制，RGB或RGBA颜色，Fabric都能提供一个完整的颜色基础，以帮助您最自然地表达自己。以下是在Fabric中定义颜色的一些方法：

```js
new fabric.Color('#f55');
new fabric.Color('#123123');
new fabric.Color('356735');
new fabric.Color('rgb(100,0,100)');
new fabric.Color('rgba(10, 20, 30, 0.5)');
```

转换也很简单。 ```toHex（）```将颜色实例转换为十六进制表示。 ```toRgb（）```可以转换为RGB，```toRgba（）```转换为带Alpha通道的RGB。

```js
new fabric.Color('#f55').toRgb(); // "rgb(255,85,85)"
new fabric.Color('rgb(100,100,100)').toHex(); // "646464"
new fabric.Color('fff').toHex(); // "FFFFFF"
```

转换不仅仅可以使单一的颜色。您也可以用另一种颜色叠加，或将其转换为灰度版本。

```js
var redish = new fabric.Color('#f55');
var greenish = new fabric.Color('#5f5');

redish.overlayWith(greenish).toHex(); // "AAAA55"
redish.toGrayscale().toHex(); // "A1A1A1"
```

## 渐变（Gradients）

更加表现出色的方式是通过渐变。渐变让我们将一种颜色混合到另一种颜色中，创造出一些令人惊叹的图形效果。

Fabric通过```setGradient```方法支持渐变，在所有对象上定义。调用```setGradient('fill', { ... })```就像设置一个对象的“fill”值一样，只不过我们用渐变而不是单色来填充对象。

```js
var circle = new fabric.Circle({
  left: 100,
  top: 100,
  radius: 50
});

circle.setGradient('fill', {
  x1: 0,
  y1: 0,
  x2: 0,
  y2: circle.height,
  colorStops: {
    0: '#000',
    1: '#fff'
  }
});
```

![ ](http://fabricjs.com/article_assets/2_15.png)

在上面的例子中，我们在100,100的位置创建一个圆圈，半径为50px。然后，我们将其填充设置为跨越整个圆形高度的渐变，从黑色到白色。

传递给一个方法的参数是一个options对象，它需要2个坐标对（x1，y1和x2，y2）以及“colorStops”对象。坐标指出了渐变开始和结束的位置，```colorStops```指出了渐变的颜色，只要它们的范围从0到1（例如0,0.1,0.3,0.5,0.75,1），您可以根据需要定义多少个```colorStops```。0表示渐变的开始，1表示结束。

坐标相对于物体左上角，因此圆的最高点为0，最低点为```circle.height```。 ```setGradient```以相同的方式计算宽度坐标（x1，x2）。

这是一个从左到右的红蓝渐变：

```js
circle.setGradient('fill', {
  x1: 0,
  y1: 0,
  x2: circle.width,
  y2: 0,
  colorStops: {
    0: "red",
    1: "blue"
  }
});
```

![ ](http://fabricjs.com/article_assets/2_16.png)

这是一个彩虹🌈渐变，颜色跨度20%：

```js
circle.setGradient('fill', {
  x1: 0,
  y1: 0,
  x2: circle.width,
  y2: 0,
  colorStops: {
    0: "red",
    0.2: "orange",
    0.4: "yellow",
    0.6: "green",
    0.8: "blue",
    1: "purple"
  }
});
```

![ ](http://fabricjs.com/article_assets/2_17.png)

你还能想到哪些炫酷的版本？

## 文本（Text）

如果你想不仅在画布上显示图像和矢量形状，还要显示文本，该怎么办？Fabric也为您准备好了！认识```fabric.Text```对象。

我们提供文本的原因有两个，首先是允许以面向对象的方式处理文本。原生canvas方法，只允许在非常低的级别上填充或描边文本。通过实例化```fabric.Text```实例，我们可以使用文本，就像我们将使用任何其他Fabric对象：移动它，缩放它，更改其属性等。

第二个原因是提供比canvas给我们更丰富的功能，包括：

- **支持多行Multiline support** 不幸的是，原生文本方法忽略了新建一行。
- **文本对齐Text alignment** 左，中，右。使用多行文本时很有用。
- **文本背景Text background** 背景也支持文本对齐。
- **文字装饰Text decoration** 下划线，上划线，贯穿线。
- **行高Line Height** 在使用多行文本时有用。
- **字符间距Char spacing** 使文本更紧凑或更间隔。
- **子范围Subranges** 将颜色和属性应用到文本对象的子对象中。
- **多字节Multibyte** 支持表情符号。
- **交互式画布编辑On canvas editing** 可以直接在画布上键入文本。

做一个hello world的例子：

```js
var text = new fabric.Text('hello world', { left: 100, top: 100 });
canvas.add(text);
```

那就对了！在画布上显示文本就像在所需位置添加```fabric.Text```实例一样简单。您可以看到，唯一必需的第一个参数是实际的文本字符串。第二个参数是通常的选项对象，它可以具有通常的left，top，填fill，opacity等属性。

当然，文本对象也有自己独有的与文本相关的属性。我们来看看其中的一些：

### 字体（fontFamily）

默认设置为“Times New Roman”，此属性允许我们更改用于呈现文本对象的字体系列。更改它将立即使文本以新字体呈现。

```js
var comicSansText = new fabric.Text("I'm in Comic Sans", {
  fontFamily: 'Comic Sans'
});
```

![ ](http://fabricjs.com/article_assets/2_5.png)

### 字体大小（fontSize）

字体大小控制渲染文本的大小。请注意，与Fabric中的其他对象不同，您不能直接更改文本的width / height属性。相反，您需要更改“fontSize”值才能使文本对象更大或更小。或者，您可以随时使用scaleX / scaleY属性。

```js
var text40 = new fabric.Text("I'm at fontSize 40", {
  fontSize: 40
});
var text20 = new fabric.Text("I'm at fontSize 20", {
  fontSize: 20
});
```

![ ](http://fabricjs.com/article_assets/2_6.png)

### 粗体（fontWeight）

```fontWeight```允许使文本更粗或更薄。就像CSS一样，您可以使用关键字（“normal”，“bold”）或数字（100,200,400,600,800）。请注意，您是否可以使用某些值取决于所选字体的粗体的可用性。如果您使用远程字体，则需要确保提供正常和粗体字体定义。

```js
var normalText = new fabric.Text("I'm a normal text", {
  fontWeight: 'normal'
});
var boldText = new fabric.Text("I'm at bold text", {
  fontWeight: 'bold'
});
```

![ ](http://fabricjs.com/article_assets/2_7.png)

### 文本修饰（textDecoration）

文本修饰允许添加下划线，上划线或贯穿线到文本。这与CSS类似，但是Fabric进一步，并允许使用上述的任何组合。所以你可以有一个文本，既有下划线又有上划线，还有贯穿线。等等。

```js
var underlineText = new fabric.Text("I'm an underlined text", {
  underline; true
});
var strokeThroughText = new fabric.Text("I'm a stroke-through text", {
  linethrough: true
});
var overlineText = new fabric.Text("I'm an overline text", {
  overline: true
});
```

![ ](http://fabricjs.com/article_assets/2_8.png)

### 阴影

此属性在版本1.3.0之前被称为“textShadow”

文本阴影由4个组件组成：颜色，水平偏移，垂直偏移和模糊大小。如果您在CSS中使用阴影，这可能看起来很熟悉。通过更改这些值可以实现许多组合。

```js
var shadowText1 = new fabric.Text("I'm a text with shadow", {
  shadow: 'rgba(0,0,0,0.3) 5px 5px 5px'
});
var shadowText2 = new fabric.Text("And another shadow", {
  shadow: 'rgba(0,0,0,0.2) 0 0 5px'
});
var shadowText3 = new fabric.Text("Lorem ipsum dolor sit", {
  shadow: 'green -5px -5px 3px'
});
```

![ ](http://fabricjs.com/article_assets/2_9.png)

### 字体风格（fontStyle）

字体样式可以是2个值之一：normal（正常）或italic（斜体）。这类似于同名的CSS属性。

```js
var italicText = new fabric.Text("A very fancy italic text", {
  fontStyle: 'italic',
  fontFamily: 'Delicious'
});
var anotherItalicText = new fabric.Text("another italic text", {
  fontStyle: 'italic',
  fontFamily: 'Hoefler Text'
});
```

![ ](http://fabricjs.com/article_assets/2_10.png)

### 描边的颜色和宽度（stroke and strokeWidth）

通过结合stroke和strokeWidth，你可以在你的文字上获得一些有趣的效果。这里有几个例子:

```js
var textWithStroke = new fabric.Text("Text with a stroke", {
  stroke: '#ff1318',
  strokeWidth: 1
});
var loremIpsumDolor = new fabric.Text("Lorem ipsum dolor", {
  fontFamily: 'Impact',
  stroke: '#c3bfbf',
  strokeWidth: 3
});
```

![ ](http://fabricjs.com/article_assets/2_11.png)

### 文本对齐（textAlign）

使用多行文本时，文本对齐很有用。使用单行文本，边界框的宽度总是与该行的宽度完全匹配，因此没有任何对齐方式。

允许的值为“left”，“center”和“right”。

```js
var text = 'this is\na multiline\ntext\naligned right!';
var alignedRightText = new fabric.Text(text, {
  textAlign: 'right'
});
```

![ ](http://fabricjs.com/article_assets/2_12.png)

### 行高（lineHeight）

CSS中可能熟悉的另一个属性是lineHeight。它允许我们改变多行文本中文本行之间的垂直间距，只是值的规格和css中的不太一样，在以下示例中，第一个文本块的lineHeight为3，第二个为1。

```js
var lineHeight3 = new fabric.Text('Lorem ipsum ...', {
  lineHeight: 3
});
var lineHeight1 = new fabric.Text('Lorem ipsum ...', {
  lineHeight: 1
});
```

![ ](http://fabricjs.com/article_assets/2_13.png)

### 文本背景颜色（textBackgroundColor）

最后，textBackgroundColor允许给文本一个背景。请注意，背景仅填充文本字符占用的空间，而不是整个边框。这意味着文本对齐改变了文本背景渲染的方式。一行的高度也是如此，因为背景是由lineHeight创建的线之间的垂直空间。

```js
var text = 'this is\na multiline\ntext\nwith\ncustom lineheight\n&background';
var textWithBackground = new fabric.Text(text, {
  textBackgroundColor: 'rgb(0,200,0)'
});
```

![ ](http://fabricjs.com/article_assets/2_14.png)

## 事件（Events）

事件驱动架构是框架内一些惊人的功能和灵活性的基础。Fabric也不例外，并提供广泛的事件系统，从低级“鼠标”事件开始到高级对象。

这些事件可以让我们在画布上发生的事件的同时，做一些事情。想知道什么时候鼠标被按下？只需要监听“mouse:down”事件，想知道什么时候对象被添加到canvas？ 监听“object:add”事件，如果想知道画布什么时候渲染完成呢？只需监听“after:render”。

事件API非常简单，类似于jQuery，Underscore.js或其他流行的JS库。有一个```on```方法来初始化事件监听器，```off```用来删除它。

让我们来看个例子：

```js
var canvas = new fabric.Canvas('...');
canvas.on('mouse:down', function(options) {
  console.log(options.e.clientX, options.e.clientY);
});
```

我们将事件“mouse:down”事件侦听器添加到画布上，并给它一个事件处理程序，用于记录事件起始位置的坐标。换句话说，它会记录鼠标按下的位置。事件处理程序接收一个选项对象，它有两个属性```e```：事件源，以及```target```：在画布上点击的对象，它有时不存在。但是这个事件在任何时候都是存在的，但是只有当你在画布上点击某个对象时，```target```才会存在。```target```也只传递给有意义的事件处理程序。例如，会传递给“mouse:down”，而不会传递给“after:render”(表示整个画布被重新绘制)。

```js
canvas.on('mouse:down', function(options) {
  if (options.target) {
    console.log('有对象被点击咯! ', options.target.type);
  }
});
```

上面的例子将记录“有对象被点击咯！”如果您单击一个对象。它还将显示点击的对象的类型。

那么Fabric中有哪些其他的事件呢？那么，从鼠标级别可以看到“mouse:down”，“mouse:move”和“mouse:up”。从通用方面看，有“after:render”。然后有选择相关的事件：“before:selection:cleared”, “selection:created”, “selection:cleared”，最后，对象的事件：“object:modified”，“object:selected”，“object:moving”，“object:scaling”，“object:rotate”，“object:added”和“object:removed”。

请注意，每当一个对象被移动（或缩放）甚至一个像素时，诸如“object:moving”（或“object:scaling”）的事件被连续地触发。另一方面，诸如“object:modified”或“selection:created”之类的事件仅在操作结束时被触发（对象修改或选择创建）。

注意我们如何将事件附加到画布上（```canvas.on（'mouse：down'，...）```）。可以想象，这意味着事件都被限定为canvas实例。如果您在页面上有多个canvas，您可以将不同的事件侦听器附加到每个canvas上。他们都是独立的，只处理分配给他们自己的事件。

为方便起见，Fabric将进一步提升事件系统，并允许您将侦听器直接附加到canvas画布中的对象上。让我们来看看：

```js
var rect = new fabric.Rect({ width: 100, height: 50, fill: 'green' });
rect.on('selected', function() {
  console.log('selected a rectangle');
});

var circle = new fabric.Circle({ radius: 75, fill: 'blue' });
circle.on('selected', function() {
  console.log('selected a circle');
});
```

我们将事件侦听器直接附加到矩形和圆形实例。使用"selected"来代替"object:selected"。同样的，使用“modified”代替“object:modified”，使用“rotating”来代替“object:rotating”。等等。。

查看此事件[演示](http://fabricjs.com/events)，以更广泛地探索Fabric的事件系统

{'repo_name': 'Rookie-Birds/Fabric-Tutorial_zh-CN', 'stars': '211', 'repo_language': 'None', 'file_name': 'part-5.md', 'mime_type': 'text/plain', 'hash': 3119339950694020038, 'source_dataset': 'data'}


$NetBSD: distinfo,v 1.2 2015/11/03 20:45:20 agc Exp $

SHA1 (tex-uhc-16791/uhc.tar.xz) = ab0d5f433732908a7272c0c974ec6f04646ace42
RMD160 (tex-uhc-16791/uhc.tar.xz) = e3f995fbb639b03a752cb16a27abe7da95c3b640
SHA512 (tex-uhc-16791/uhc.tar.xz) = 6a807bf80ebe2154a6d43fb415929717883fc9b422f66fe1bce676a642051aba00cd4acb74e20d7746376733c6bd4a1652a5e15036867a9fa3cba8ba78d6b823
Size (tex-uhc-16791/uhc.tar.xz) = 3599360 bytes

{'repo_name': 'jsonn/pkgsrc', 'stars': '122', 'repo_language': 'Makefile', 'file_name': 'patch-ad', 'mime_type': 'text/x-diff', 'hash': -4414281113420040285, 'source_dataset': 'data'}


---
order: 1
zh-CN:
	title: 基础用法
	content: 通知提示文案
	link: 文字链接
en-US:
	title: Basic Usage
	content: Info Alert Text
	link: Text Link
---

```jsx
import { Alert } from 'zent';

ReactDOM.render(
	<div className="zent-alert-example">
		<Alert>
			<span>{i18n.content}</span>
			<a href="javascript:;" className="zent-alert-demo-text">
				{i18n.link}
			</a>
		</Alert>
		<Alert title="{i18n.title}" description="{i18n.content}" />
	</div>,
	mountNode
);
```

<style>
.zent-alert-demo-text {
	margin-left: 8px;
}
</style>

{'repo_name': 'youzan/zent', 'stars': '1894', 'repo_language': 'TypeScript', 'file_name': 'npm-sync.sh', 'mime_type': 'text/x-shellscript', 'hash': -4342933832709821462, 'source_dataset': 'data'}


require 'test_helper'

class <%= class_name %>Test < ActiveSupport::TestCase
  # Replace this with your real tests.
  test "the truth" do
    assert true
  end
end

{'repo_name': 'potionfactory/potionstore', 'stars': '332', 'repo_language': 'Ruby', 'file_name': 'dragdrop.js', 'mime_type': 'text/plain', 'hash': 6353247637776267836, 'source_dataset': 'data'}


<?php

/**
 * Price enter mode: netto
 * Price view mode:  netto
 * Product count: count of used products
 * VAT info: 19%
 * Currency rate: 1
 * Discounts: -
 * Vouchers: -
 * Wrapping: -;
 * Gift cart:  -;
 * Costs VAT caclulation rule: max
 * Costs:
 *  1. Payment +
 *  2. Delivery +
 *  3. TS -
 * Short description:
 * Neto-Neto mode. Additiona products Neto-Neto.
 */

$aData = array(
    'articles' => array(
        0 => array(
            'oxid'                     => 9001,
            'oxprice'                  => 10,
            'oxvat'                    => 19,
            'amount'                   => 510,
        ),

    ),
    'costs' => array(

        'delivery' => array(
            0 => array(
                'oxtitle' => '6_abs_del',
                'oxactive' => 1,
                'oxaddsum' => 10,
                'oxaddsumtype' => 'abs',
                'oxdeltype' => 'p',
                'oxfinalize' => 1,
                'oxparamend' => 99999
            ),
        ),
        'payment' => array(
            0 => array(
                'oxtitle' => '1 abs payment',
                'oxaddsum' => 10,
                'oxaddsumtype' => 'abs',
                'oxfromamount' => 0,
                'oxtoamount' => 1000000,
                'oxchecked' => 1,
            ),
        ),
    ),
    'expected' => array(
        'articles' => array(
             9001 => array( '10,00', '5.100,00' ),
        ),
        'totals' => array(
            'totalBrutto' => '6.069,00',
            'totalNetto'  => '5.100,00',
            'vats' => array(
                19 => '969,00'
            ),
            'delivery' => array(
                'brutto' => '11,90',
                'netto' => '10,00',
                'vat' => '1,90'
            ),
            'payment' => array(
                'brutto' => '11,90',
                'netto' => '10,00',
                'vat' => '1,90'
            ),
            'grandTotal'  => '6.092,80'
        ),
    ),
    'options' => array(
        // Configs (real named)
        'config' => array(
            'blEnterNetPrice' => true,
            'blShowNetPrice' => true,
            'blShowVATForDelivery' => true,
            'blShowVATForPayCharge' => true,
            'blShowVATForWrapping' => true,
            'sAdditionalServVATCalcMethod' => 'biggest_net',
            'blDeliveryVatOnTop' => true,
            'blPaymentVatOnTop' => true,
            'blWrappingVatOnTop' => true,
        ),
        // Other options
        'activeCurrencyRate' => 1,
    ),
);

{'repo_name': 'OXID-eSales/oxideshop_ce', 'stars': '182', 'repo_language': 'PHP', 'file_name': 'SetupControllerExitExceptionTest.php', 'mime_type': 'text/x-php', 'hash': 8786699514068793151, 'source_dataset': 'data'}


package client

import (
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"net/url"
	"testing"
	"time"

	"github.com/bearded-web/bearded/pkg/utils"
	"github.com/stretchr/testify/require"
	"golang.org/x/net/context"
)

func TestFilesDownload(t *testing.T) {
	bg := context.Background()
	handlerMock := func(res http.ResponseWriter, req *http.Request) {
		switch req.URL.String() {
		case "/v1/files/1/download":
			res.Header().Add("Content-Type", "octet/stream")
			res.Write([]byte("data 1"))
		case "/v1/files/2/download":
			http.NotFound(res, req)
		}
	}
	s := httptest.NewServer(http.HandlerFunc(handlerMock))
	defer s.Close()
	baseUrl, _ := url.Parse(s.URL)

	client := &Client{
		BaseURL: baseUrl,
		client:  http.DefaultClient,
		Debug:   true,
	}
	f := &FilesService{client: client}

	{
		buf, err := f.Download(utils.JustTimeout(bg, time.Millisecond*100), "1")
		require.NoError(t, err)
		require.NotNil(t, buf)
		data, err := ioutil.ReadAll(buf)
		require.NoError(t, err)
		require.Equal(t, "data 1", string(data))
	}
	{
		_, err := f.Download(utils.JustTimeout(bg, time.Millisecond*100), "2")
		require.Error(t, err)
	}

}

{'repo_name': 'bearded-web/bearded', 'stars': '136', 'repo_language': 'Go', 'file_name': 'plans.json', 'mime_type': 'text/plain', 'hash': -6418509961599530010, 'source_dataset': 'data'}


@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Clang.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Clang.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

:end

{'repo_name': 'epiqc/ScaffCC', 'stars': '118', 'repo_language': 'C++', 'file_name': 'boolean_formula.x2y2.scaffold', 'mime_type': 'text/x-c', 'hash': 8961988118407395564, 'source_dataset': 'data'}


<!DOCTYPE html>
<html>
    <head>
        <title>Test123</title>
        {% static 'app.js' %}
    </head>
    <body>
        {% url 'home' %}
        {% for x in [1, 2, 3, 4] %}
            {{ x }}
        {% endfor %}
        {% block content %}{% endblock %}
    </body>
</html>

{'repo_name': 'vibora-io/vibora', 'stars': '5616', 'repo_language': 'Python', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -5775471261897384542, 'source_dataset': 'data'}


<template>
  <header>
    <nav
      class="navbar has-background-dark is-dark"
      role="navigation"
      aria-label="main navigation"
    >
      <HeaderBarBrand></HeaderBarBrand>
      <HeaderBarLinks></HeaderBarLinks>
    </nav>
  </header>
</template>

<script>
import HeaderBarBrand from '@/components/header-bar-brand';
import HeaderBarLinks from '@/components/header-bar-links';

export default {
  name: 'HeaderBar',
  components: { HeaderBarBrand, HeaderBarLinks },
};
</script>

{'repo_name': 'johnpapa/vue-getting-started', 'stars': '107', 'repo_language': 'Vue', 'file_name': 'index.html', 'mime_type': 'text/html', 'hash': 6175342533108075014, 'source_dataset': 'data'}


/*
 *
 * (C) COPYRIGHT 2010-2011 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
 *
 * A copy of the licence is included with the program, and can also be obtained from Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */

/**
 * @file mali_kbase_device.c
 * Base kernel device APIs
 */

#include <kbase/src/common/mali_kbase.h>
#include <kbase/src/common/mali_kbase_defs.h>

#define GPU_NUM_ADDRESS_SPACES 4
#define GPU_NUM_JOB_SLOTS 3

/* This array is referenced at compile time, it cannot be made static... */
const kbase_device_info kbase_dev_info[] = {
	{
		KBASE_MALI_T6XM,
		(KBASE_FEATURE_HAS_MODEL_PMU),
	},
	{
		KBASE_MALI_T6F1,
		(KBASE_FEATURE_NEEDS_REG_DELAY |
		 KBASE_FEATURE_DELAYED_PERF_WRITE_STATUS |
		 KBASE_FEATURE_HAS_16BIT_PC),
	},
	{
		KBASE_MALI_T601,
	},
	{
		KBASE_MALI_T604,
	},
	{
		KBASE_MALI_T608,
	},
};

void kbasep_as_do_poke(osk_workq_work * work);
void kbasep_reset_timer_callback(void *data);
void kbasep_reset_timeout_worker(osk_workq_work *data);

kbase_device *kbase_device_create(const kbase_device_info *dev_info)
{
	kbase_device *kbdev;
	osk_error osk_err;
	int i; /* i used after the for loop, don't reuse ! */

	kbdev = osk_calloc(sizeof(*kbdev));
	if (!kbdev)
	{
		goto fail;
	}

	kbdev->dev_info = dev_info;

	/* NOTE: Add Property Query here */
	kbdev->nr_address_spaces = GPU_NUM_ADDRESS_SPACES;
	kbdev->nr_job_slots = GPU_NUM_JOB_SLOTS;
	kbdev->job_slot_features[0] =
		  KBASE_JSn_FEATURE_NULL_JOB
		| KBASE_JSn_FEATURE_SET_VALUE_JOB
		| KBASE_JSn_FEATURE_CACHE_FLUSH_JOB
		| KBASE_JSn_FEATURE_FRAGMENT_JOB;
	kbdev->job_slot_features[1] =
		  KBASE_JSn_FEATURE_NULL_JOB
		| KBASE_JSn_FEATURE_SET_VALUE_JOB
		| KBASE_JSn_FEATURE_CACHE_FLUSH_JOB
		| KBASE_JSn_FEATURE_COMPUTE_JOB
		| KBASE_JSn_FEATURE_VERTEX_JOB
		| KBASE_JSn_FEATURE_GEOMETRY_JOB
		| KBASE_JSn_FEATURE_TILER_JOB
		| KBASE_JSn_FEATURE_FUSED_JOB;
	kbdev->job_slot_features[2] =
		  KBASE_JSn_FEATURE_NULL_JOB
		| KBASE_JSn_FEATURE_SET_VALUE_JOB
		| KBASE_JSn_FEATURE_CACHE_FLUSH_JOB
		| KBASE_JSn_FEATURE_COMPUTE_JOB
		| KBASE_JSn_FEATURE_VERTEX_JOB
		| KBASE_JSn_FEATURE_GEOMETRY_JOB;

	osk_err = osk_spinlock_irq_init(&kbdev->mmu_mask_change, OSK_LOCK_ORDER_MMU_MASK);
	if (OSK_ERR_NONE != osk_err)
	{
		goto free_dev;
	}

	for (i = 0; i < kbdev->nr_address_spaces; i++)
	{
		const char format[] = "mali_mmu%d";
		char name[sizeof(format)];
#if BASE_HW_ISSUE_8316
		const char poke_format[] = "mali_mmu%d_poker";
		char poke_name[sizeof(poke_format)];
		if (0 > cutils_cstr_snprintf(poke_name, sizeof(poke_name), poke_format, i))
		{
			goto free_workqs;
		}
#endif /* BASE_HW_ISSUE_8316 */

		if (0 > cutils_cstr_snprintf(name, sizeof(name), format, i))
		{
			goto free_workqs;
		}

		kbdev->as[i].number = i;
		kbdev->as[i].fault_addr = 0ULL;
		osk_err = osk_workq_init(&kbdev->as[i].pf_wq, name, 0);
		if (OSK_ERR_NONE != osk_err)
		{
			goto free_workqs;
		}
		osk_err = osk_mutex_init(&kbdev->as[i].transaction_mutex, OSK_LOCK_ORDER_AS);
		if (OSK_ERR_NONE != osk_err)
		{
			osk_workq_term(&kbdev->as[i].pf_wq);
			goto free_workqs;
		}
#if BASE_HW_ISSUE_8316
		osk_err = osk_workq_init(&kbdev->as[i].poke_wq, poke_name, 0);
		if (OSK_ERR_NONE != osk_err)
		{
			osk_workq_term(&kbdev->as[i].pf_wq);
			osk_mutex_term(&kbdev->as[i].transaction_mutex);
			goto free_workqs;
		}
		osk_workq_work_init(&kbdev->as[i].poke_work, kbasep_as_do_poke);
		osk_err = osk_timer_init(&kbdev->as[i].poke_timer);
		if (OSK_ERR_NONE != osk_err)
		{
			osk_workq_term(&kbdev->as[i].poke_wq);
			osk_workq_term(&kbdev->as[i].pf_wq);
			osk_mutex_term(&kbdev->as[i].transaction_mutex);
			goto free_workqs;
		}
		osk_timer_callback_set(&kbdev->as[i].poke_timer, kbasep_as_poke_timer_callback , &kbdev->as[i]);
		osk_atomic_set(&kbdev->as[i].poke_refcount, 0);
#endif /* BASE_HW_ISSUE_8316 */
	}
	/* don't change i after this point */

	osk_err = osk_spinlock_init(&kbdev->hwcnt_lock, OSK_LOCK_ORDER_HWCNT);
	if (OSK_ERR_NONE != osk_err)
	{
		goto free_workqs;
	}

	kbdev->hwcnt_in_progress = MALI_FALSE;
	kbdev->hwcnt_is_setup = MALI_FALSE;
	kbdev->hwcnt_state = KBASE_INSTR_STATE_DISABLED;
	osk_err = osk_waitq_init(&kbdev->hwcnt_waitqueue);
	if (OSK_ERR_NONE != osk_err)
	{
		goto free_hwcnt_lock;
	}

	if (OSK_ERR_NONE != osk_workq_init(&kbdev->reset_workq, "Mali reset workqueue", 0))
	{
		goto free_hwcnt_waitq;
	}

	osk_workq_work_init(&kbdev->reset_work, kbasep_reset_timeout_worker);

	osk_err = osk_waitq_init(&kbdev->reset_waitq);
	if (OSK_ERR_NONE != osk_err)
	{
		goto free_reset_workq;
	}

	osk_err = osk_timer_init(&kbdev->reset_timer);
	if (OSK_ERR_NONE != osk_err)
	{
		goto free_reset_waitq;
	}
	osk_timer_callback_set(&kbdev->reset_timer, kbasep_reset_timer_callback, kbdev);

	return kbdev;

free_reset_waitq:
	osk_waitq_term(&kbdev->reset_waitq);
free_reset_workq:
	osk_workq_term(&kbdev->reset_workq);
free_hwcnt_waitq:
	osk_waitq_term(&kbdev->hwcnt_waitqueue);
free_hwcnt_lock:
	osk_spinlock_term(&kbdev->hwcnt_lock);
free_workqs:
	while (i > 0)
	{
		i--;
		osk_mutex_term(&kbdev->as[i].transaction_mutex);
		osk_workq_term(&kbdev->as[i].pf_wq);
#if BASE_HW_ISSUE_8316
		osk_workq_term(&kbdev->as[i].poke_wq);
		osk_timer_term(&kbdev->as[i].poke_timer);
#endif /* BASE_HW_ISSUE_8316 */
	}
	osk_spinlock_irq_term(&kbdev->mmu_mask_change);
free_dev:
	osk_free(kbdev);
fail:
	return NULL;
}

void kbase_device_destroy(kbase_device *kbdev)
{
	int i;

	osk_timer_term(&kbdev->reset_timer);
	osk_waitq_term(&kbdev->reset_waitq);
	osk_workq_term(&kbdev->reset_workq);

	for (i = 0; i < kbdev->nr_address_spaces; i++)
	{
		osk_mutex_term(&kbdev->as[i].transaction_mutex);
		osk_workq_term(&kbdev->as[i].pf_wq);
#if BASE_HW_ISSUE_8316
		osk_workq_term(&kbdev->as[i].poke_wq);
		osk_timer_term(&kbdev->as[i].poke_timer);
#endif /* BASE_HW_ISSUE_8316 */
	}

	osk_spinlock_term(&kbdev->hwcnt_lock);
	osk_waitq_term(&kbdev->hwcnt_waitqueue);

	osk_free(kbdev);
}

int kbase_device_has_feature(kbase_device *kbdev, u32 feature)
{
	return !!(kbdev->dev_info->features & feature);
}

kbase_midgard_type kbase_device_get_type(kbase_device *kbdev)
{
	return kbdev->dev_info->dev_type;
}
KBASE_EXPORT_TEST_API(kbase_device_get_type)

#if KBASE_REGISTER_TRACE_ENABLED

void kbase_device_trace_buffer_install(kbase_context * kctx, u32 * tb, size_t size)
{
	OSK_ASSERT(kctx);
	OSK_ASSERT(tb);

	/* set up the header */
	/* magic number in the first 4 bytes */
	tb[0] = 0x45435254;
	/* Store (write offset = 0, wrap counter = 0, transaction active = no)
	 * write offset 0 means never written.
	 * Offsets 1 to (wrap_offset - 1) used to store values when trace started
	 */
	tb[1] = 0;

	/* install trace buffer */
	osk_spinlock_irq_lock(&kctx->jctx.tb_lock);
	kctx->jctx.tb_wrap_offset = size / 8;
	kctx->jctx.tb = tb;
	osk_spinlock_irq_unlock(&kctx->jctx.tb_lock);
}

void kbase_device_trace_buffer_uninstall(kbase_context * kctx)
{
	OSK_ASSERT(kctx);
	osk_spinlock_irq_lock(&kctx->jctx.tb_lock);
	kctx->jctx.tb = NULL;
	kctx->jctx.tb_wrap_offset = 0;
	osk_spinlock_irq_unlock(&kctx->jctx.tb_lock);
}

void kbase_device_trace_register_access(kbase_context * kctx, kbase_reg_access_type type, u16 reg_offset, u32 reg_value)
{
	osk_spinlock_irq_lock(&kctx->jctx.tb_lock);
	if (kctx->jctx.tb)
	{
		u16 wrap_count;
		u16 write_offset;
		osk_atomic dummy; /* osk_atomic_set called to use memory barriers until OSK get's them */
		u32 * tb = kctx->jctx.tb;
		u32 header_word;

		header_word = tb[1];
		OSK_ASSERT(0 == (header_word & 0x1));

		wrap_count = (header_word >> 1) & 0x7FFF;
		write_offset = (header_word >> 16) & 0xFFFF;

		/* mark as transaction in progress */
		tb[1] |= 0x1;
		osk_atomic_set(&dummy, 1);

		/* calculate new offset */
		write_offset++;
		if (write_offset == kctx->jctx.tb_wrap_offset)
		{
			/* wrap */
			write_offset = 1;
			wrap_count++;
			wrap_count &= 0x7FFF; /* 15bit wrap counter */
		}

		/* store the trace entry at the selected offset */
		tb[write_offset * 2 + 0] = (reg_offset & ~0x3) | ((type == REG_WRITE) ? 0x1 : 0x0);
		tb[write_offset * 2 + 1] = reg_value;

		osk_atomic_set(&dummy, 1);

		/* new header word */
		header_word = (write_offset << 16) | (wrap_count << 1) | 0x0; /* transaction complete */
		tb[1] = header_word;
	}
	osk_spinlock_irq_unlock(&kctx->jctx.tb_lock);
}
#endif /* KBASE_REGISTER_TRACE_ENABLED */

void kbase_reg_write(kbase_device *kbdev, u16 offset, u32 value, kbase_context * kctx)
{
	OSK_PRINT_INFO(OSK_BASE_CORE, "w: reg %04x val %08x", offset, value);
	kbase_os_reg_write(kbdev, offset, value);
#if KBASE_REGISTER_TRACE_ENABLED
	if (kctx) kbase_device_trace_register_access(kctx, REG_WRITE, offset, value);
#endif /* KBASE_REGISTER_TRACE_ENABLED */
}
KBASE_EXPORT_TEST_API(kbase_reg_write)

u32 kbase_reg_read(kbase_device *kbdev, u16 offset, kbase_context * kctx)
{
	u32 val;
	val = kbase_os_reg_read(kbdev, offset);
	OSK_PRINT_INFO(OSK_BASE_CORE, "r: reg %04x val %08x", offset, val);
#if KBASE_REGISTER_TRACE_ENABLED
	if (kctx) kbase_device_trace_register_access(kctx, REG_READ, offset, val);
#endif /* KBASE_REGISTER_TRACE_ENABLED */
	return val;
}
KBASE_EXPORT_TEST_API(kbase_reg_read)

void kbase_report_gpu_fault(kbase_device *kbdev, int multiple)
{
	u32 status;
	u64 address;

	status = kbase_reg_read(kbdev, GPU_CONTROL_REG(GPU_FAULTSTATUS), NULL);
	address = (u64)kbase_reg_read(kbdev, GPU_CONTROL_REG(GPU_FAULTADDRESS_HI), NULL) << 32;
	address |= kbase_reg_read(kbdev, GPU_CONTROL_REG(GPU_FAULTADDRESS_LO), NULL);

	OSK_PRINT_WARN(OSK_BASE_CORE, "GPU Fault 0x08%x (%s) at 0x%016llx", status, kbase_exception_name(status), address);
	if (multiple)
	{
		OSK_PRINT_WARN(OSK_BASE_CORE, "There were multiple GPU faults - some have not been reported\n");
	}
}

void kbase_gpu_interrupt(kbase_device * kbdev, u32 val)
{
	if (val & GPU_FAULT)
	{
		kbase_report_gpu_fault(kbdev, val & MULTIPLE_GPU_FAULTS);
	}

	if (val & RESET_COMPLETED)
	{
		kbase_pm_reset_done(kbdev);
	}

	if (val & PRFCNT_SAMPLE_COMPLETED)
	{
		kbase_instr_hwcnt_sample_done(kbdev);
	}

	if (val & CLEAN_CACHES_COMPLETED)
	{
		kbase_clean_caches_done(kbdev);
	}

	kbase_reg_write(kbdev, GPU_CONTROL_REG(GPU_IRQ_CLEAR), val, NULL);

	/* kbase_pm_check_transitions must be called after the IRQ has been cleared. This is because it might trigger
	 * further power transitions and we don't want to miss the interrupt raised to notify us that these further
	 * transitions have finished.
	 */
	if (val & (POWER_CHANGED_ALL | POWER_CHANGED_SINGLE))
	{
		kbase_pm_check_transitions(kbdev);
	}
}

{'repo_name': 'lvchaqiu/meizu-mx-kernel', 'stars': '178', 'repo_language': 'None', 'file_name': 'arrayRCU.txt', 'mime_type': 'text/plain', 'hash': 7523648166544774231, 'source_dataset': 'data'}


#pragma once

#include "Engine/Maps/GameObject.h"

class SoundBase : public GameObject
{
public:
	virtual void play(bool repeat = false, float startDelay = 0.0f);
	virtual void unfreeze(); // careful, unpause is a cocos function
	bool isPlaying();
	virtual void freeze(); // careful, pause is a cocos function
	virtual void stop();
	virtual void stopAndFadeOut(std::function<void()> onFadeOutCallback = nullptr, bool hasPriority = false);

	void setCustomMultiplier(float customMultiplier);
	void setSoundResource(std::string soundResource);
	std::string getSoundResource();

protected:
	SoundBase(cocos2d::ValueMap& properties, std::string soundResource);
	virtual ~SoundBase();

	void onEnter() override;
	void update(float dt) override;
	virtual float getConfigVolume() = 0;
	void updateVolume();
	void setVolumeOverride(float volume);
	void clearVolumeOverride();
	float getVolume();

	int activeTrackId;

	std::string soundResource;
	float fadeMultiplier;
	float distanceMultiplier;
	float customMultiplier;
	bool enableCameraDistanceFade;
	bool hasVolumeOverride;
	bool isFading;
	bool destroyOnFadeOut;
	std::function<void()> onFadeOutCallback;

	static const int INVALID_ID;

private:
	typedef GameObject super;

	static const std::string KeyScheduleFadeOutAudio;
};

{'repo_name': 'Squalr/Squally', 'stars': '325', 'repo_language': 'C++', 'file_name': 'FindSteamWorks.cmake', 'mime_type': 'text/plain', 'hash': 385094349000929137, 'source_dataset': 'data'}