false!(
        bounds_x[1] > bounds_x[0],
        "Error: Upper bound on x must be larger than lower bound"
    );
    let bounds_y = utils::get_values_from_required_parseable_argument(arguments, "y-bounds");
    exit_on_false!(
        bounds_y[1] > bounds_y[0],
        "Error: Upper bound on y must be larger than lower bound"
    );
    let bounds_z = utils::get_values_from_required_parseable_argument(arguments, "z-bounds");
    exit_on_false!(
        bounds_z[1] > bounds_z[0],
        "Error: Upper bound on z must be larger than lower bound"
    );
    let boundary_dz_scales =
        utils::get_values_from_required_parseable_argument(arguments, "boundary-dz-scales");
    exit_on_false!(
        boundary_dz_scales[0] > 0.0 && boundary_dz_scales[1] > 0.0,
        "Error: Boundary dz scales must be larger than zero"
    );

    let interior_z: Vec<fdt> = utils::get_values_from_parseable_argument_with_custom_defaults(
        arguments,
        "interior-z",
        &|| Vec::new(),
    );

    let interior_dz_scales: Vec<fdt> =
        utils::get_values_from_parseable_argument_with_custom_defaults(
            arguments,
            "interior-dz-scales",
            &|| Vec::new(),
        );

    exit_on_false!(
        interior_z.len() == interior_dz_scales.len(),
        "Error: Number of interior control z-coordinates and dz scales must match"
    );

    exit_on_false!(
        interior_z
            .iter()
            .all(|&z| z > bounds_z[0] && z < bounds_z[1]),
        "Error: All interior control z-coordinates must be inside z-boundaries"
    );

    exit_on_false!(
        interior_dz_scales.iter().all(|&dz_scale| dz_scale > 0.0),
        "Error: All interior dz scales must be larger than zero"
    );

    let (centers_x, lower_edges_x) =
        grid::regular_coords_from_bounds(shape[0], bounds_x[0], bounds_x[1]);
    let (centers_y, lower_edges_y) =
        grid::regular_coords_from_bounds(shape[1], bounds_y[0], bounds_y[1]);

    let mut coords_and_scales: Vec<_> = interior_z
        .into_iter()
        .zip(interior_dz_scales.into_iter())
        .collect();
    coords_and_scales.sort_by(|&(a, _), &(b, _)| a.partial_cmp(&b).unwrap());
    let (mut interior_z, mut interior_dz_scales): (Vec<_>, Vec<_>) =
        coords_and_scales.into_iter().unzip();

    let mut control_z = Vec::with_capacity(2 + interior_z.len());
    control_z.push(bounds_z[0]);
    control_z.append(&mut interior_z);
    control_z.push(bounds_z[1]);

    let mut dz_scales = Vec::with_capacity(2 + interior_dz_scales.len());
    dz_scales.push(boundary_dz_scales[0]);
    dz_scales.append(&mut interior_dz_scales);
    dz_scales.push(boundary_dz_scales[1]);

    let interpolator = CubicHermiteSplineInterpolator::new(CubicHermiteSplineInterpolatorConfig {
        tangent_scheme: TangentScheme::ProximityWeightedFiniteDifference,
        boundary_tangents: BoundaryTangents::Zero,
    });

    let (centers_z, lower_edges_z) = exit_on_error!(


., 51 Franklin Street - Fifth Floor,
// Boston, MA 02110-1301, USA.

using Xunit;

namespace OpenTween
{
    public class ApplicationInstanceMutexTest
    {
        [Fact]
        public void InstanceExists_SameNameTest()
        {
            using var mutex1 = new ApplicationInstanceMutex("OpenTweenTest", ".");
            Assert.False(mutex1.InstanceExists);

            using var mutex2 = new ApplicationInstanceMutex("OpenTweenTest", ".");
            Assert.True(mutex2.InstanceExists);
        }

        [Fact]
        public void InstanceExists_NotSameNameTest()
        {
            using var mutex1 = new ApplicationInstanceMutex("OpenTweenTest", "aaa");
            Assert.False(mutex1.InstanceExists);

            using var mutex2 = new ApplicationInstanceMutex("OpenTweenTest", "bbb");
            Assert.False(mutex2.InstanceExists);
        }
    }
}


}

const (
	// CloudSchedulerSourceConditionReady has status True when CloudSchedulerSource is ready to send events.
	CloudSchedulerSourceConditionReady = apis.ConditionReady

	// JobReady has status True when CloudSchedulerSource Job has been successfully created.
	JobReady apis.ConditionType = "JobReady"
)

var schedulerCondSet = apis.NewLivingConditionSet(
	gcpduckv1.PullSubscriptionReady,
	gcpduckv1.TopicReady,
	JobReady)

// CloudSchedulerSourceStatus is the status for a CloudSchedulerSource resource
type CloudSchedulerSourceStatus struct {
	// This brings in our GCP PubSub based events importers
	// duck/v1 Status, SinkURI, ProjectID, TopicID and SubscriptionID
	gcpduckv1.PubSubStatus `json:",inline"`

	// JobName is the name of the created scheduler Job on success.
	// +optional
	JobName string `json:"jobName,omitempty"`
}

func (scheduler *CloudSchedulerSource) GetGroupVersionKind() schema.GroupVersionKind {
	return SchemeGroupVersion.WithKind("CloudSchedulerSource")
}

// Methods for identifiable interface
// IdentitySpec returns the IdentitySpec portion of the Spec.
func (s *CloudSchedulerSource) IdentitySpec() *gcpduckv1.IdentitySpec {
	return &s.Spec.IdentitySpec
}

// IdentityStatus returns the IdentityStatus portion of the Status.
func (s *CloudSchedulerSource) IdentityStatus() *gcpduckv1.IdentityStatus {
	return &s.Status.IdentityStatus
}

// ConditionSet returns the apis.ConditionSet of the embedding object.
func (s *CloudSchedulerSource) ConditionSet() *apis.ConditionSet {
	return &schedulerCondSet
}

// Methods for pubsubable interface
// PubSubSpec returns the PubSubSpec portion of the Spec.
func (s *CloudSchedulerSource) PubSubSpec() *gcpduckv1.PubSubSpec {
	return &s.Spec.PubSubSpec
}

// PubSubStatus returns the PubSubStatus portion of the Status.
func (s *CloudSchedulerSource) PubSubStatus() *gcpduckv1.PubSubStatus {
	return &s.Status.PubSubStatus
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// CloudSchedulerSourceList is a list of CloudSchedulerSource resources.
type CloudSchedulerSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []CloudSchedulerSource `json:"items"`
}

// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
func (*CloudSchedulerSource) GetConditionSet() apis.ConditionSet {
	return schedulerCondSet
}

// GetStatus retrieves the status of the CloudSchedulerSource. Implements the KRShaped interface.
func (s *CloudSchedulerSource) GetStatus() *duckv1.Status {
	return &s.Status.Status
}
/*
Copyright 2020 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
	"testing"

	gcpauthtesthelper "github.com/goog


r9, fp, ip, lr})
	UNWIND(.setfp fp, ip, #-4)
	sub	fp, ip, #4
	ldr	r5, .L369
	mov	r4, r0
	ldr	r8, .L369+4
	mov	r7, #0
	add	r6, r5, #24
.L367:
	str	r4, [r5], #4
	mov	r2, #128
	ldr	r3, [r8, #20]
	mov	r0, r4
	mov	r1, #0
	add	r4, r4, #128
	blx	r3
	ldr	r3, [r4, #-124]
	cmp	r5, r6
	mov	r2, #1
	orr	r3, r3, #4
	str	r3, [r4, #-124]
	ldr	r3, [r4, #-124]
	bfi	r3, r2, #0, #2
	str	r3, [r4, #-124]
	str	r7, [r5, #20]
	bne	.L367
	ldmfd	sp, {r4, r5, r6, r7, r8, r9, fp, sp, pc}
.L370:
	.align	2
.L369:
	.word	.LANCHOR0
	.word	g_AdspOsalFunc
	UNWIND(.fnend)
	.size	ENGINE_Init, .-ENGINE_Init
	.align	2
	.global	ENGINE_DeInit
	.type	ENGINE_DeInit, %function
ENGINE_DeInit:
	UNWIND(.fnstart)

	UNWIND(.movsp ip)
	mov	ip, sp
	stmfd	sp!, {r4, r5, r6, r7, fp, ip, lr, pc}
	UNWIND(.pad #4)
	UNWIND(.save {r4, r5, r6, r7, fp, ip, lr})
	UNWIND(.setfp fp, ip, #-4)
	sub	fp, ip, #4
	ldr	r4, .L374
	mov	r6, #0
	add	r5, r4, #24
.L372:
	ldr	r0, [r4, #4]!
	bl	ENGINEDestroyChn
	cmp	r4, r5
	str	r6, [r4]
	bne	.L372
	ldmfd	sp, {r4, r5, r6, r7, fp, sp, pc}
.L375:
	.align	2
.L374:
	.word	.LANCHOR0+20
	UNWIND(.fnend)
	.size	ENGINE_DeInit, .-ENGINE_DeInit
	.bss
	.align	2
.LANCHOR0 = . + 0
	.type	g_stEneRm, %object
	.size	g_stEneRm, 48
g_stEneRm:
	.space	48
	.ident	"GCC: (gcc-4.9.2 + glibc-2.22 (Build by czyong) Wed Mar  9 16:30:48 CST 2016) 4.9.2 20140904 (prerelease)"
	.section	.note.GNU-stack,"",%progbits


KM-LX3`: HUAWEI Y9 2019 Single SIM

`JKM-LX1` `JKM-LX2` `JKM-LX3`: HUAWEI Y9 2019 Dual SIM

**HUAWEI Y9 Prime 2019 (`Stark`):**

`STK-LX3`: HUAWEI Y9 Prime 2019 Single SIM

`STK-L21` `STK-L22` `STK-LX3`: HUAWEI Y9 Prime 2019 Dual SIM

**HUAWEI Y9a (`Franklin`):**

`FRL-L21` `FRL-L22` `FRL-L23`: HUAWEI Y9a Dual SIM

**HUAWEI Y9s (`Stark`):**

`STK-L21`: HUAWEI Y9s Single SIM

`STK-L21` `STK-L22` `STK-LX3`: HUAWEI Y9s Dual SIM

## HUAWEI Tablets

**HUAWEI MediaPad 7 Youth:**

`S7-701u`: HUAWEI MediaPad 7 Youth

**HUAWEI MediaPad 10 Link+:**

`S10-231L`: HUAWEI MediaPad 10 Link+

**HUAWEI MediaPad M3 (`Beethoven`):**

`BTV-W09`: HUAWEI MediaPad M3 Wi-Fi

`BTV-DL09`: HUAWEI MediaPad M3 LTE

**HUAWEI MediaPad M3 lite 8 (`Chopin`):**

`CPN-W09`: HUAWEI MediaPad M3 lite 8 Wi-Fi

`CPN-L09`: HUAWEI MediaPad M3 lite 8 LTE

**HUAWEI MediaPad M3 lite 10 (`Bach`):**

`BAH-W09`: HUAWEI MediaPad M3 lite 10 Wi-Fi

`BAH-L09`: HUAWEI MediaPad M3 lite 10 LTE

**HUAWEI MediaPad M5 8.4 (`Schubert`):**

`SHT-W09`: HUAWEI MediaPad M5 8.4 Wi-Fi

`SHT-AL09`: HUAWEI MediaPad M5 8.4 LTE

**HUAWEI MediaPad M5 10.8 (`Cameron`):**

`CMR-W09`: HUAWEI MediaPad M5 10.8 Wi-Fi

`CMR-AL09`: HUAWEI MediaPad M5 10.8 LTE

**HUAWEI MediaPad M5 Pro (`Cameron`):**

`CMR-W19`: HUAWEI MediaPad M5 Pro Wi-Fi

`CMR-AL19`: HUAWEI MediaPad M5 Pro LTE

**HUAWEI MediaPad M5 lite (`Bach2`):**

`BAH2-W19`: HUAWEI MediaPad M5 lite Wi-Fi

`BAH2-L09`: HUAWEI MediaPad M5 lite LTE

**HUAWEI MediaPad M6 10.8 (`Schumann`):**

`SCM-W09`: HUAWEI MediaPad M6 10.8 Wi-Fi

`SCM-AL09`: HUAWEI MediaPad M6 10.8 LTE

**HUAWEI MatePad (`Bach3`):**

`BAH3-W09`: HUAWEI MatePad 10.4 Wi-Fi

`BAH3-L09`: HUAWEI MatePad 10.4 LTE

**HUAWEI MatePad (`Bach4`):**

`BAH4-W09`: HUAWEI MatePad 10.4 2022 Wi-Fi

`BAH4-L09`: HUAWEI MatePad 10.4 2022 LTE

**HUAWEI MatePad (`Bartok`):**

`BTK-W09`: HUAWEI MatePad 11.5 Wi-Fi

`BTK-AL09`: HUAWEI MatePad 11.5 LTE

**HUAWEI MatePad 11 (`Debussy`):**

`DBY-W09`: HUAWEI MatePad 11


_ := os.ReadFile("../../../samples/unversioned/event_list_missile.html")
	attacks, _ := NewExtractor().extractAttacks(pageHTMLBytes, clockwork.NewFakeClock(), nil)
	assert.Equal(t, 1, len(attacks))
	assert.Equal(t, int64(1), attacks[0].Missiles)
	assert.Nil(t, attacks[0].Ships)
}

func TestExtractLifeformEnabled(t *testing.T) {
	pageHTML, _ := os.ReadFile("../../../samples/unversioned/overview_active.html")
	assert.False(t, NewExtractor().ExtractLifeformEnabled(pageHTML))

	pageHTML, _ = os.ReadFile("../../../samples/v9.0.2/en/overview_all_queues.html")
	assert.False(t, NewExtractor().ExtractLifeformEnabled(pageHTML))

	pageHTML, _ = os.ReadFile("../../../samples/v9.0.2/en/lifeform/overview_all_queues.html")
	assert.True(t, NewExtractor().ExtractLifeformEnabled(pageHTML))
}

func TestExtractFleetDeutSaveFactor_V6_2_2_1(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/overview_active.html")
	res := NewExtractor().ExtractFleetDeutSaveFactor(pageHTMLBytes)
	assert.Equal(t, 1.0, res)
}

func TestExtractFleetDeutSaveFactor_V6_7_4(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/overview_with_moon.html")
	res := NewExtractor().ExtractFleetDeutSaveFactor(pageHTMLBytes)
	assert.Equal(t, 0.5, res)
}

func TestExtractPlanetCoordinate(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/station.html")
	res, _ := NewExtractor().ExtractPlanetCoordinate(pageHTMLBytes)
	assert.Equal(t, ogame.Coordinate{Galaxy: 1, System: 301, Position: 5, Type: ogame.PlanetType}, res)
}

func TestExtractPlanetCoordinate_moon(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/moon_facilities.html")
	res, _ := NewExtractor().ExtractPlanetCoordinate(pageHTMLBytes)
	assert.Equal(t, ogame.Coordinate{Galaxy: 4, System: 116, Position: 12, Type: ogame.MoonType}, res)
}

func TestExtractPlanetID_planet(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/station.html")
	res, _ := NewExtractor().ExtractPlanetID(pageHTMLBytes)
	assert.Equal(t, ogame.CelestialID(33672410), res)
}

func TestExtractPlanetID_moon(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/moon_facilities.html")
	res, _ := NewExtractor().ExtractPlanetID(pageHTMLBytes)
	assert.Equal(t, ogame.CelestialID(33741598), res)
}

func TestExtractPlanetType_planet(t *testing.T) {
	pageHTMLBytes, _ := os.ReadFile("../../../samples/unversioned/station.html")
	res, _ := NewExtractor().ExtractPlanetType(pageHTMLBytes)
	assert.Equal(t, ogame.PlanetType, res)
}

func TestExtractPlanetType_moon(


gendaryActions = 3;
		}

		monster.role = this.getRole(monster);

		return monster;
	}

	private static buildTrait(rawTrait: any, type: 'trait' | 'action' | 'bonus' | 'reaction' | 'legendary' | 'mythic' | 'lair'): Trait {
		let name = '';
		let usage = '';

		const openBracket = rawTrait.name.indexOf('(');
		if (openBracket === -1) {
			name = rawTrait.name;
		} else {
			const closeBracket = rawTrait.name.indexOf(')');
			name = rawTrait.name.substring(0, openBracket - 1);
			usage = rawTrait.name.substring(openBracket + 1, closeBracket).toLowerCase();
		}

		const text: string = rawTrait.desc.replace(/•/g, '*');

		let finalType = type;
		if (name === 'Lair Actions') {
			finalType = 'lair';
		}
		if (text.indexOf('As a bonus action') === 0) {
			finalType = 'bonus';
		}

		return {
			id: Utils.guid(),
			type: finalType,
			name: name,
			usage: usage,
			text: text,
			uses: 0
		};
	}

	public static import(source: string, monster: Monster): void {
		Frankenstein.clear(monster);

		const parser = new DOMParser();
		const doc = parser.parseFromString(source, 'text/html');

		try {
			monster.name = (doc.getElementsByClassName('mon-stat-block__name')[0] as HTMLElement).innerText.trim();
			let meta = (doc.getElementsByClassName('mon-stat-block__meta')[0] as HTMLElement).innerText.toLowerCase().trim();
			const firstSpace = meta.indexOf(' ');
			monster.size = meta.substring(0, firstSpace).trim();
			meta = meta.substring(firstSpace + 1).trim();
			const comma = meta.indexOf(',');
			monster.alignment = meta.substring(comma + 1).trim();
			meta = meta.substring(0, comma).trim();
			const open = meta.indexOf('(');
			const close = meta.indexOf(')');
			if ((open !== -1) && (close !== -1)) {
				monster.tag = meta.substring(open + 1, close).trim();
				meta = meta.substring(0, open).trim();
			}
			monster.category = meta;
		} catch (ex) {
			console.error(ex);
		}

		try {
			const attrs = doc.getElementsByClassName('mon-stat-block__attribute');
			for (let attrIndex = 0; attrIndex !== attrs.length; ++attrIndex) {
				const attr = attrs[attrIndex];
				const label = (attr.getElementsByClassName('mon-stat-block__attribute-label')[0] as HTMLElement).innerText.toLowerCase().trim();
				const value = (attr.getElementsByClassName('mon-stat-block__attribute-data-value')[0] as HTMLElement).innerText.toLowerCase().trim();
				switch (label) {
					case 'armor class':
						monster.ac = Number.parseInt(value, 10);
						let info = (attr.getElementsByClassName('mon-stat-block__attribute-data-extra')[0] as HTMLElement).innerText.toLowerCase().trim();
						if (info.startsWith('(')) {
							info = info.substr(1, info.length - 2);
						}
						monster.acInfo = info;
						break;
					case 'hit points':
						const extra = (attr.getElementsByClassName('mon


impl NvEncode for &str {
    fn insert_into<S: CStrArgument>(&self, name: S, nv: &mut NvListRef) -> io::Result<()> {
        std::ffi::CString::new(*self).unwrap().insert_into(name, nv)
    }
}

impl NvEncode for NvListRef {
    fn insert_into<S: CStrArgument>(&self, name: S, nv: &mut NvListRef) -> io::Result<()> {
        let name = name.into_cstr();
        let v = unsafe {
            sys::nvlist_add_nvlist(
                nv.as_mut_ptr(),
                name.as_ref().as_ptr(),
                self.as_ptr() as *mut _,
            )
        };
        if v != 0 {
            Err(io::Error::from_raw_os_error(v))
        } else {
            Ok(())
        }
    }
}

impl NvEncode for () {
    fn insert_into<S: CStrArgument>(&self, name: S, nv: &mut NvListRef) -> io::Result<()> {
        let name = name.into_cstr();
        let v = unsafe { sys::nvlist_add_boolean(nv.as_mut_ptr(), name.as_ref().as_ptr()) };
        if v != 0 {
            Err(io::Error::from_raw_os_error(v))
        } else {
            Ok(())
        }
    }
}

impl NvEncode for str {
    fn insert_into<S: CStrArgument>(&self, name: S, nv: &mut NvListRef) -> io::Result<()> {
        ffi::CString::new(self).unwrap().insert_into(name, nv)
    }
}

#[derive(Debug)]
pub enum NvEncoding {
    Native,
    Xdr,
}

impl NvEncoding {
    fn as_raw(&self) -> c_int {
        match self {
            NvEncoding::Native => sys::NV_ENCODE_NATIVE,
            NvEncoding::Xdr => sys::NV_ENCODE_XDR,
        }
    }
}

foreign_type! {
    /// An `NvList`
    pub unsafe type NvList {
        type CType = sys::nvlist;
        fn drop = sys::nvlist_free;
    }
}

impl NvList {
    /// Try to create a new `NvList` with no options.
    ///
    /// Returns an error if memory allocation fails
    #[doc(alias = "nvlist_alloc")]
    pub fn try_new() -> io::Result<Self> {
        let mut n = ptr::null_mut();
        let v = unsafe {
            // TODO: second arg is a bitfield of NV_UNIQUE_NAME|NV_UNIQUE_NAME_TYPE
            sys::nvlist_alloc(&mut n, 0, 0)
        };
        if v != 0 {
            Err(io::Error::from_raw_os_error(v))
        } else {
            Ok(unsafe { Self::from_ptr(n) })
        }
    }

    /// Try to create a new `NvList` with the `NV_UNIQUE_NAME` constraint
    ///
    /// Returns an error if memory allocation fails
    #[doc(alias = "nvlist_alloc")]
    pub fn try_new_unique_names() -> io::Result<Self> {
        let mut n = ptr::null_mut();
        let v = unsafe { sys::nvlist_alloc(&mut n, sys::NV_UNIQUE_NAME, 0) };
        if v != 0 {
            Err(io::Error::from_raw_os_error(v))
        } else {
            Ok(unsafe { Self::from_ptr(n) })
        }
    }

    /// Create a new `NvList` with no options
    ///
    /// # Panics
    ///
    ///  - if [`try_new()`] returns an error
    #[doc(alias = "nvlist_allo


.range.startsWith(oi)||!Mp.test(e.range.slice(oi.length)))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Unreachable")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(oi.length),n=await xw(e,{cache:s.fetchOptions?.cache,project:s.project});if(!Object.hasOwn(n,"dist-tags"))throw new Yt(15,'Registry returned invalid data - missing "dist-tags" field');let c=n["dist-tags"];if(!Object.hasOwn(c,a))throw new Yt(16,`Registry failed to return tag "${a}"`);let f=c[a],p=G.makeLocator(e,`${oi}${f}`),h=n.versions[f].dist.tarball;return oh.isConventionalTarballUrl(p,h,{configuration:s.project.configuration})?[p]:[G.bindLocator(p,{__archiveUrl:h})]}async getSatisfying(e,r,s,a){let n=[];for(let c of s){if(c.identHash!==e.identHash)continue;let f=G.tryParseRange(c.reference,{requireProtocol:oi});if(!(!f||!GBe.default.valid(f.selector))){if(f.params?.__archiveUrl){let p=G.makeRange({protocol:oi,selector:f.selector,source:null,params:null}),[h]=await a.resolver.getCandidates(G.makeDescriptor(e,p),r,a);if(c.reference!==h.reference)continue}n.push(c)}}return{locators:n,sorted:!1}}async resolve(e,r){throw new Error("Unreachable")}};var w1={};Vt(w1,{getGitHead:()=>jDt,getPublishAccess:()=>Txe,getReadmeContent:()=>Fxe,makePublishBody:()=>HDt});Ve();Ve();Dt();var yV={};Vt(yV,{PackCommand:()=>_w,default:()=>kEt,packUtils:()=>yA});Ve();Ve();Ve();Dt();Wt();var yA={};Vt(yA,{genPackList:()=>RN,genPackStream:()=>mV,genPackageManifest:()=>ISe,hasPackScripts:()=>gV,prepareForPack:()=>dV});Ve();Dt();var hV=ut(Ba()),ySe=ut(hSe()),ESe=Ie("zlib"),EEt=["/package.json","/readme","/readme.*","/license","/license.*","/licence","/licence.*","/changelog","/changelog.*"],IEt=["/package.tgz",".github",".git",".hg","node_modules",".npmignore",".gitignore",".#*",".DS_Store"];async function gV(t){return!!(In.hasWorkspaceScript(t,"prepack")||In.hasWorkspaceScript(t,"postpack"))}async function dV(t,{report:e},r){await In.maybeExecuteWorkspaceLifecycleScript(t,"prepack",{report:e});try{let s=J.join(t.cwd,Ht.fileName);await ce.existsPromise(s)&&await t.manifest.loadFile(s,{baseFs:ce}),await r()}finally{await In.maybeExecuteWorkspaceLifecycleScript(t,"postpack",{report:e})}}async function mV(t,e){typeof e>"u"&&(e=await RN(t));let r=new Set;for(let n of t.manifest.publishConfig?.executableFiles??new Set)r.add(J.normalize(n));for(let n of


\u540e\u95e8\u201d\u8d2d\u4e70\u5546\u54c1\u7684\u9519\u8bef\u3002", "type": "paragraph"}, {"text": "\u6765\u6e90\uff1a\u4e2d\u5171\u957f\u6c99\u53bf\u59d4\u515a\u53f2\u8d44\u6599\u5f81\u96c6\u529e\u516c\u5ba4\u5f81\u7f16\uff1a\u300a\u5218\u5c11\u5947\u4e3b\u5e2d\u5728\u5929\u534e\u8e72\u70b9\u8c03\u67e5\u8d44\u6599\u300b\uff08\u5185\u90e8\u51fa\u7248\uff09\uff0c1988\u5e744\u6708\u3002", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   中共湖南省委转发长沙县福临公社关于商品供应“开后门”的处理情况的一个材料

   日期：1961-6-20 作者：[待确定]

   现将长沙县福临公社“关于商品供应“开后门”的处理情况”一件，印发给你们参考。出现商品供应“开后门”的问题，主要是某些商业供销部门，供应制度不严，某些商业人员没有正确执行商品供应的政策，部分干部对目前某些商品实行计划供应的意义与政策，认识模糊，在生活上搞特殊化。对这一问题，如不及时纠正，会造成群众的严重不满。因此，要求各级党委，对本地区商品供应的情况，认真地进行一次检查，通过检查，发现问题，及时解决。

   解决商品供应“开后门”的问题，必须坚持贯彻党的政策，认真向干部进行说服教育，使干部正确认识，在目前情况下，实行计划供应的必要，使干部模范地遵守商品供应的政策。同时，对已经出现的“开后门”的现象，要适当进行揭发、批判，以便教育广大干部，提高他们的觉悟。

   为了制止商品供应


		   MMC35240_REG_CTRL1);
	if (ret < 0)
		dev_err(dev, "Failed to restore control registers\n");

	regcache_cache_only(data->regmap, false);

	return 0;
}
#endif

static const struct dev_pm_ops mmc35240_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(mmc35240_suspend, mmc35240_resume)
};

static const struct of_device_id mmc35240_of_match[] = {
	{ .compatible = "memsic,mmc35240", },
	{ }
};
MODULE_DEVICE_TABLE(of, mmc35240_of_match);

static const struct acpi_device_id mmc35240_acpi_match[] = {
	{"MMC35240", 0},
	{ },
};
MODULE_DEVICE_TABLE(acpi, mmc35240_acpi_match);

static const struct i2c_device_id mmc35240_id[] = {
	{"mmc35240", 0},
	{}
};
MODULE_DEVICE_TABLE(i2c, mmc35240_id);

static struct i2c_driver mmc35240_driver = {
	.driver = {
		.name = MMC35240_DRV_NAME,
		.of_match_table = mmc35240_of_match,
		.pm = &mmc35240_pm_ops,
		.acpi_match_table = ACPI_PTR(mmc35240_acpi_match),
	},
	.probe		= mmc35240_probe,
	.id_table	= mmc35240_id,
};

module_i2c_driver(mmc35240_driver);

MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>");
MODULE_DESCRIPTION("MEMSIC MMC35240 magnetic sensor driver");
MODULE_LICENSE("GPL v2");


							audioApi = MediaStream.MODE_MEDIACODEC_API;
						}
					}
				}

				// TTL -> the client can modify the time to live of packets
				// By default ttl=64
				else if (param.getName().equalsIgnoreCase("ttl")) {
					if (param.getValue()!=null) {
						try {
							int ttl = Integer.parseInt(param.getValue());
							if (ttl<0) throw new IllegalStateException();
							builder.setTimeToLive(ttl);
						} catch (Exception e) {
							throw new IllegalStateException("The TTL must be a positive integer !");
						}
					}
				}

				// H.264
				else if (param.getName().equalsIgnoreCase("h264")) {
					VideoQuality quality = VideoQuality.parseQuality(param.getValue());
					builder.setVideoQuality(quality).setVideoEncoder(VIDEO_H264);
				}

				// H.263
				else if (param.getName().equalsIgnoreCase("h263")) {
					VideoQuality quality = VideoQuality.parseQuality(param.getValue());
					builder.setVideoQuality(quality).setVideoEncoder(VIDEO_H263);
				}

				// AMR
				else if (param.getName().equalsIgnoreCase("amrnb") || param.getName().equalsIgnoreCase("amr")) {
					AudioQuality quality = AudioQuality.parseQuality(param.getValue());
					builder.setAudioQuality(quality).setAudioEncoder(AUDIO_AMRNB);
				}

				// AAC
				else if (param.getName().equalsIgnoreCase("aac")) {
					AudioQuality quality = AudioQuality.parseQuality(param.getValue());
					builder.setAudioQuality(quality).setAudioEncoder(AUDIO_AAC);
				}

			}

		}

		if (builder.getVideoEncoder()==VIDEO_NONE && builder.getAudioEncoder()==AUDIO_NONE) {
			SessionBuilder b = SessionBuilder.getInstance();
			builder.setVideoEncoder(b.getVideoEncoder());
			builder.setAudioEncoder(b.getAudioEncoder());
		}

		Session session = builder.build();

		if (videoApi>0 && session.getVideoTrack() != null) {
			session.getVideoTrack().setStreamingMethod(videoApi);
		}

		if (audioApi>0 && session.getAudioTrack() != null) {
			session.getAudioTrack().setStreamingMethod(audioApi);
		}

		return session;

	}

}
/*
 * Copyright (C) 2011-2014 GUIGUI Simon, fyhertz@gmail.com
 *
 * This file is part of libstreaming (https://github.com/fyhertz/libstreaming)
 *
 * Spydroid is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This source code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this source code; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package net.majorkernelpanic.streaming.rtp;

import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;

import android.annotation.SuppressLint;
import android.media.MediaCodec;
import android.media.MediaCodec.BufferInfo;
import android.media.MediaFormat;
import android.util.Log;

/**
 * An InputStream that uses data from a MediaCodec.
 * The purpose of this class is to interface existing RTP packetizers of
 * libstreaming with the new MediaCodec API. This class is not thread safe !
 */
@SuppressLint("New


"silesia/xml",
    "enwik/enwik8.txt"
];

#[test]
fn test_ref_impl_level1() {
    println!("Test reference decompressor for Level 1");
    CORPORA.iter().for_each(|corpus| {
        let f = format!("{}{}", CORPORA_DIR, corpus);
        unsafe {
            test_ref_decompressor_level1(*corpus, &f);
        }
    });
    println!();
}

#[test]
fn test_ref_impl_level2() {
    println!("Test reference decompressor for Level 2");
    CORPORA.iter().for_each(|corpus| {
        let f = format!("{}{}", CORPORA_DIR, corpus);
        unsafe {
            test_ref_decompressor_level2(*corpus, &f);
        }
    });
    println!();
}

#[test]
fn test_round_trip_level1() {
    println!("Test round-trip for Level 1");
    CORPORA.iter().for_each(|corpus| {
        let f = format!("{}{}", CORPORA_DIR, corpus);
        unsafe {
            test_roundtrip_level1(*corpus, &f);
        }
    });
    println!();
}

#[test]
fn test_round_trip_level2() {
    println!("Test round-trip for Level 2");
    CORPORA.iter().for_each(|corpus| {
        let f = format!("{}{}", CORPORA_DIR, corpus);
        unsafe {
            test_roundtrip_level2(*corpus, &f);
        }
    });
    println!();
}
use proc_macro2::TokenStream;

pub fn define_config_type_on_struct(_st: &syn::ItemStruct) -> syn::Result<TokenStream> {
    unimplemented!()
}
<reponame>brson/ctrs
fn main() {
    use std::collections::BTreeSet;

    let mut set = BTreeSet::new();

    assert_eq!(set.insert(2), true);
    assert_eq!(set.insert(2), false);
    assert_eq!(set.len(), 1);
}
// Copyright © 2018 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use std::{cell::RefCell, path::PathBuf, rc::Rc};

use crate::{
    capture::{cmd_screenshot, Capture},
    trace::{cmd_trace_begin, cmd_trace_end},
};

use richter::{
    client::{
        input::Input,
        menu::Menu,
        render::{
            Extent2d, GraphicsState, RenderTarget as _, RenderTargetResolve as _, SwapChainTarget,
        },
        trace::TraceFrame,
        Client, ClientError,
    },
    common::console::{CmdRegistry, Console, CvarRegistry},
};

use chrono::Duration;
use failure::Error;
use log::info;

pub struct Game {
    #[allow(dead_code)] cvars: Rc<RefCell<CvarRegistry>>,
    cmds: Rc<RefCell<CmdRegistry>>,
    input: Rc<RefCell<Input>>,
    pub client: Client,

    // if Some(v), trace is in progress
    trace: Rc<RefC


.56 1.21413,4.546 0.32983,4.468 -6.09206,0.892 -3.00414,-1.712 0.72206,-1.054 1.45483,-2.449 0.92531,-4.131"},"37101":{"name":"Johnston, NC","path":"m 851.49864,334.03514 0.79694,0.851 0.97345,1.818 1.18918,0.191 -0.92531,4.131 -1.45483,2.449 -0.72206,1.054 -3.03937,0.85474 -1.41959,-0.70274 -3.92231,-4.072 2.52989,-3.543 2.57803,-2.87 1.89876,-1.929 1.51722,1.768"},"37183":{"name":"Wake, NC","path":"m 839.9296,328.16814 3.88131,0.451 1.05189,0.249 1.32467,0.412 2.49959,1.405 0.64361,0.537 0.60261,0.813 0.0481,0.232 -1.89876,1.929 -2.57803,2.87 -2.52989,3.543 -4.04177,-0.78 -1.58318,-0.345 0.60974,-5.577 -0.0374,-0.587 1.37994,-0.233 0.1162,-1.27507 0.92993,-0.12492 0.64938,-1.30001 0.0802,-1.06 -1.27156,-0.31559 0.12339,-0.84341"},"37077":{"name":"Granville, NC","path":"m 838.22517,317.39414 4.99917,-0.933 -0.61152,0.781 -0.0481,0.451 0.15333,1.493 0.65074,3.487 0.44929,2.147 0.2496,0.135 -0.25673,3.664 -3.88131,-0.451 -1.38921,-0.35484 -0.25816,-3.22016 -1.17313,-6.982 1.11607,-0.217"},"37181":{"name":"Vance, NC","path":"m 843.22434,316.46114 2.3944,-0.481 1.49404,6.26 -0.56199,1.02751 -0.96058,0.32999 -0.33779,1.15207 -1.18478,0.20543 -0.2496,-0.135 -0.44929,-2.147 -0.65074,-3.487 -0.15333,-1.493 0.0481,-0.451 0.61152,-0.781"},"37185":{"name":"Warren, NC","path":"m 850.61612,315.02314 2.63687,-0.523 0.19968,0.861 -0.62579,7.289 -5.7141,-0.41 -1.49404,-6.26 4.99738,-0.957"},"37069":{"name":"Franklin, NC","path":"m 852.82688,322.65014 -2.84546,9.617 -0.0481,-0.232 -0.60261,-0.813 -0.64361,-0.537 -2.49959,-1.405 -1.32467,-0.412 -1.05189,-0.249 0.25673,-3.664 1.18478,-0.20543 0.33779,-1.15207 0.96058,-0.32999 0.56199,-1.02751 5.7141,0.41"},"37127":{"name":"Nash, NC","path":"m 858.62834,322.70514 -0.0499,1.116 -0.75237,3.794 -0.30666,2.049 -6.02075,4.371 -1.51722,-1.768 2.84546,-9.617 1.45037,0.015 0.69688,0.79746 2.26


end
        end
        return ret
    end
    maxWidthLeft = leftright(0, measureRange) -- measure to left
    maxWidthRight = leftright(0, -measureRange) -- measure to right

    local function frontback(dimStart, dimEnd, includeImplements)
        local ret = self.vehicle.size.length / 2
        local selfHitCount = 0
        local minDistance = math.huge
        local diff = dimEnd - dimStart
        local step = 0.1
        if diff < 0 then
            step = -step
        end
        if includeImplements == 1 then
            self.frontImplements, self.mostFrontImplement = AutoDrive.getFrontImplements(self.vehicle)
        else
            self.frontImplements, self.mostFrontImplement = nil, nil
        end
        for distance = dimStart, dimEnd, step do
            local x,y,z = AutoDrive.localToWorld(self.vehicle, 0, self.vehicle.size.height / 2, distance)
            self.selfHits = 0
            if AutoDrive.getDebugChannelIsSet(AutoDrive.DC_SENSORINFO) then
                -- DebugUtil.drawOverlapBox(x,y,z, rx, ry, rz, measureRange, measureRange, 0.1, 1, 1, 1)
            end
            self.collisionHits = overlapBox(x,y,z, rx, ry, rz, measureRange, measureRange, 0.1, "getRealVehicleDimensions_Callback", self, self.mask, true, true, true, true)
            if self.selfHits == 0 then
                -- found no collision with vehicle itself
                if selfHitCount < 5 then
                    selfHitCount = selfHitCount + 1
                    minDistance = math.min(minDistance, math.abs(distance))
                else
                    -- if n consecutive hits are reached, take the min. distance
                    ret = minDistance
                    break
                end
            else
                -- if hit itself, reset the counting
                selfHitCount = 0
                minDistance = math.huge
            end
        end
        return ret
    end
    maxLengthFront = frontback(0, measureRange + 20, 1) -- measure to front
    maxLengthBack = frontback(0, -measureRange) -- measure to back
    self.vehicle.ad.adDimensions.maxWidthLeft = maxWidthLeft + AutoDrive.DIMENSION_ADDITION
    self.vehicle.ad.adDimensions.maxWidthRight = maxWidthRight + AutoDrive.DIMENSION_ADDITION
    self.vehicle.ad.adDimensions.maxLengthFront = maxLengthFront + AutoDrive.DIMENSION_ADDITION
    self.vehicle.ad.adDimensions.maxLengthBack


body {
  background-color: white;
  margin:10px;
}

h1 {
  color: #990000;
  font-size: x-large;
}

h2 {
  color: #990000;
  font-size: medium;
}

/* Make the text shrink to fit narrow windows, but not stretch too far in
wide windows. */
p,h1,h2,div.content div {
  max-width: 600px;
  /* Hack for IE6 */
  width: auto !important; width: 600px;
}

pre.codeinput {
  background: #EEEEEE;
  padding: 10px;
}
@media print {
  pre.codeinput {word-wrap:break-word; width:100%;}
}

span.keyword {color: #0000FF}
span.comment {color: #228B22}
span.string {color: #A020F0}
span.untermstring {color: #B20000}
span.syscmd {color: #B28C00}

pre.codeoutput {
  color: #666666;
  padding: 10px;
}

pre.error {
  color: red;
}

p.footer {
  text-align: right;
  font-size: xx-small;
  font-weight: lighter;
  font-style: italic;
  color: gray;
}

  </style>

function arsEnvelope
    x = randn([1,1000000]);
    [n, xout] = hist(x, -1.5:0.1:1.5);
    n(1) = []; xout(1) = [];
    n(end) = []; xout(end) = [];
    n = n / max(n);
    n = log(n);

    figure(1); clf; hold on;
    plot(xout, n, '-b', 'LineWidth', 3);

    x1 = -0.7;
    ind1 = find(xout == x1);
    ratio1 = (n(ind1+1) - n(ind1-1)) / (xout(ind1+1) - xout(ind1-1));
    plot([x1 - 0.5, x1 + 0.5], [n(ind1)-0.5*ratio1, n(ind1)+0.5*ratio1], '-r', 'LineWidth', 3);
    plot([x1, x1], [n(ind1),min(n)-0.1], '--r', 'LineWidth', 3);

    x2 = 0;
    ind2 = find(xout == x2);
    ratio2 = (n(ind2+1) - n(ind2-1)) / (xout(ind2+1) - xout(ind2-1));
    plot([x2 - 0.7, x2 + 0.7], [n(ind2)-0.7*ratio2, n(ind2)+0.7*ratio2], '-r', 'LineWidth', 3);
    plot([x2, x2], [n(ind2),min(n)-0.1], '--r', 'LineWidth', 3);

    x3 = 0.7;
    ind3 = find(xout == x3);
    ratio3 = (n(ind3+1) - n(ind3-1)) / (xout(ind3+1) - xout(ind3-1));
    plot([x3 - 0.5, x3 + 0.5], [n(ind3)-0.5*ratio3, n(ind3)+0.5*ratio3], '-r', 'LineWidth', 3);
    plot([x3, x3], [n(ind3),min(n)-0.1], '--r', 'LineWidth', 3);

    xlim([-1.5,1.5]);
    ylim([min(n)-0.


 DANGEROUS_GAS_COST_LOW;
                    }
                    else if ((symbol == "H2" || symbol == "CH4" || symbol == "O2") && ppm >= 500)
                    {
                        return DANGEROUS_GAS_COST_LOW;
                    }
                    else if (symbol == "CO2" && ppm >= 5_000)
                    {
                        return DANGEROUS_GAS_COST_LOW;
                    }
                }
            }

            if (totalPressure == 0.0f)
            {
                return MIN_COST;
            }

            if (speciesBreathablePressure / totalPressure > 0.3f)
            {
                return MIN_COST;
            }

            if (totalPressure > species.MaximumPressureConstraint)
            {
                return Math.Max(totalPressure / species.MaximumPressureConstraint, MIN_COST);
            }

            return NO_COST;
        }
    }
}


SEMP-URL** des *Smart Appliance Enabler* aufruft (wobei Hostnamen / IP-Adresse entsprechend anzupassen ist):

```
http://raspi:8080/semp
```

Die vom *Smart Appliance Enabler* an den *Sunny Home Manager* kommunizierte URL des SEMP-Hosts wird direkt nach dem Start in das Log geschrieben:

```bash
$ grep "SEMP UPnP" /tmp/rolling-2020-12-31.log
2020-12-31 14:36:22,744 INFO [main] d.a.s.s.d.SempDiscovery [SempDiscovery.java:57] SEMP UPnP will redirect to http://192.168.1.1:8080
```

*Webmin*: In [View Logfile](#webmin-logs) gibt man hinter `Only show lines with text` den Text `SEMP UPnP` ein und drückt Refresh.

Die Eingabe dieser URL in einen Web-Browser, ergänzt um den Pfad `/semp` (entsprechend des obigen Beispiels wäre das `http://192.168.1.1:8080/semp`), muss zur Anzeige des nachfolgend beschrieben SEMP-XML führen. Wenn das nicht funktioniert, weil diese URL nicht korrekt ist, kann der *Sunny Home Manager* nicht mit dem *Smart Appliance Enabler* kommunizieren, d.h es können keine Geräte im *Sunny Portal* hinzugefügt werden und Geräte werden nicht gemessen und geschaltet!

##  SEMP-XML

Durch Eingabe der [SEMP-URL](#url) in einen ganz normalen Web-Browser kann man sich anzeigen lassen, welche Informationen der *Smart Appliance Enabler* dem *Sunny Home Manager* übermittelt.

Die SEMP-URL liefert ein [XML](https://de.wikipedia.org/wiki/Extensible_Markup_Language) -Dokument gemäss der SEMP-Spezifikation, in der für jedes Gerät ein `DeviceInfo` und ein `DeviceStatus` enthalten ist. Optional können auch `PlanningRequest` enthalten sein.

`DeviceInfo`, `DeviceStatus` und `PlanningRequest` enthalten jeweils ein Element `DeviceId`, über das zum Ausdruck gebracht wird, für welches Gerät es gilt. Dabei ist die `DeviceId` identisch mit der `ID`, welche beim Anlegen des Gerätes im *Smart Appliance Enabler* vergeben wurde.

Bei einer Fehlersuche wird man genau den *DeviceStatus* betrachten, in dem die *DeviceId* des problematischen Gerätes enthalten ist.
# Konfigurationsdateien

## Device2EM.xml und Appliances.xml
Die Konfiguration des *Smart Appliance Enabler* befindet sich in zwei [XML](https://de.wikipedia.org/wiki/Extensible_Markup_Language)-Dateien:
* die Datei `Device2EM.xml` enthält die Gerätebeschreibungen für den Sunny Home Manager
* die Datei `Appliances.xml` enthält die Gerätekonfigurationen für den *Smart Appliance Enabler*

Die Groß-/Kleinschreibung der Dateinamen muss genau so sein, wie hier angegeben!

Die Dateien müssen sich in dem Verzeichnis befinden, auf das die Variable `SAE_HOME` verweist (normalerweise `/opt/sae`)

###  Speichern-Schaltfäche
Beim Klick auf die Speichern-Schaltfäche der Web-Oberfläche werden diese Dateien geschrieben. Dadurch wird der *Smart Appliance Enabler* intern neu gestartet, damit die geänderte Konfiguration wirksam wird. Aktuell eingeschaltete Geräte werden in diesem Moment ausgeschaltet um einen definierten Zustand zu erhalten. Auch werden bereits in Anspruch genommene Energie/Laufzeiten von Geräten zurück gesetzt und neu eingeplant. Um das zu


 Discord/Vesktop.
8. Activate Magane from Discord's **User Settings > Vencord > Plugins**.

> Due to Vencord enforcing CSP, if you need to import packs from third-party Chibisafe hosts, you have to add the domains to `native.ts` file.
> Restart your Discord/Vesktop after making any changes to it.

#### Vesktop

Follow the same steps as above, until step 6.

Then in your Vesktop, navigate to Discord's **User Settings > Vencord > Vesktop Settings > Open Developer Settings > Vencord Location**. Change its directory to the **dist** sub-directory of your local copy of Vencord git [(preview)](https://chibisafe.moe/pCX4Qa82.png). Then restart Vesktop.

You should now be able to activate Magane from Vesktop's **Plugins** settings.

### So how exactly do I use it after adding the script?

It's very easy.
After opening the sticker popup click on the little tool icon and you'll see a list of available sticker packs. Clicking on a sticker pack will subscribe you to it, making every sticker on that pack available on the main window. You can also right click any sticker in the list and add them to your favorites for easy access! To remove one, right click on it again.

Or watch [the preview](https://chibisafe.moe/owdxQF9m.mp4) again.
# cowsay

````
 __________________
< srsly dude, why? >
 ------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
````

cowsay is a configurable talking cow, originally written in Perl by [Tony Monroe](https://github.com/tnalpgge/rank-amateur-cowsay)

This project is a translation in JavaScript of the original program and an attempt to bring the same silliness to node.js.

## Install

    npm install -g cowsay

## Usage

    cowsay JavaScript FTW!

or

    cowthink node.js is cool

It acts in the same way as the original cowsay, so consult `cowsay(1)` or run `cowsay -h`

````
 ________
< indeed >
 --------
    \
     \
                                   .::!!!!!!!:.
  .!!!!!:.                        .:!!!!!!!!!!!!
  ~~~~!!!!!!.                 .:!!!!!!!!!UWWW$$$
      :$$NWX!!:           .:!!!!!!XUWW$$$$$$$$$P
      $$$$$##WX!:      .<!!!!UW$$$$"  $$$$$$$$#
      $$$$$  $$$UX   :!!UW$$$$$$$$$   4$$$$$*
      ^$$$B  $$$$\     $$$$$$$$$$$$   d$$R"
        "*$bd$$$$      '*$$$$$$$$$$$o+#"
             """"          """""""
````

## Usage as a module

cowsay can be used as any other npm dependency
```js
const cowsay = require("cowsay");

console.log(cowsay.say({
    text : "I'm a moooodule",
    e : "oO",
    T : "U "
}));

// or cowsay.think()
```
````
 _________________
( I'm a moooodule )
 -----------------
        o   ^__^
         o  (oO)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||
````

getting a list of cow names:
```js
function get_cows(error, cow_names) {
    if (error) {
        console.log(error)
    }
    else if (cow_names) {
        console.log(`Number of cows availabl


b.com/flutter/flutter/pull/132357)
* Upgrade flutter packages. by @polina-c in [132697](https://github.com/flutter/flutter/pull/132697)
* Fix bad pattern in 2D tests by @Piinks in [132709](https://github.com/flutter/flutter/pull/132709)
* Improvements to EditableText documentation by @Hixie in [132532](https://github.com/flutter/flutter/pull/132532)
* Fix lower bound of children from TwoDimensionalChildBuilderDelegate by @Piinks in [132713](https://github.com/flutter/flutter/pull/132713)
* Improve and optimize non-uniform Borders. by @bernaferrari in [124417](https://github.com/flutter/flutter/pull/124417)
* Disable test order randomization on some leak tracker tests that are failing with today's seed by @jason-simmons in [132766](https://github.com/flutter/flutter/pull/132766)
* Update `Scrollable` on `ScrollBehaviour` change. by @chinmoy12c in [131164](https://github.com/flutter/flutter/pull/131164)
* Leaks fix. by @polina-c in [132778](https://github.com/flutter/flutter/pull/132778)
* [Framework] Add Share to selection controls by @LouiseHsu in [132599](https://github.com/flutter/flutter/pull/132599)
* Allow date pickers to not have selected date by @Hixie in [132343](https://github.com/flutter/flutter/pull/132343)
* Reland root predictive back by @justinmc in [132249](https://github.com/flutter/flutter/pull/132249)
* fixes l10n for CupertinoDatePicker in monthYear mode by @AndreySuworow in [130934](https://github.com/flutter/flutter/pull/130934)
* Add a new MatrixTransition and refactor ScaleTransition and RotationT… by @gmilou in [131084](https://github.com/flutter/flutter/pull/131084)
* SelectionArea on iOS should toggle the context menu when tapping on the previous selection by @Renzo-Olivares in [132851](https://github.com/flutter/flutter/pull/132851)
* When resized network image has error, all future unrelated images using the same url will fail, even if the network becomes OK by @fzyzcjy in [127456](https://github.com/flutter/flutter/pull/127456)
* Docs on iOS's directional quote characters by @justinmc in [132869](https://github.com/flutter/flutter/pull/132869)
* Update `ExpansionPanel` example for the updated `expansionCallback` callback by @TahaTesser in [132837](https://github.com/flutter/flutter/pull/132837)
* Add deleteBackwardByDecomposingPreviousCharacter mapping for tests by @angelosilvestre in [132919](https://github.com/flutter/flutter/pull/132919)
* Fix visual overflow for SliverMainAxisGroup by @Piinks in [132989](https://github.com/flutter/flutter/pull/132989)
* Cover more tests with leak tracking. by @polina-c in [132806](https://github.com/flutter/flutter/pull/132806)
* Fix memory leak in Form by @justinmc in [132987](https://github.com/flutter/flutter/pull/132987)
* Add support for `Future<List<int>?>` to `MatchesGoldenFile` by @iinozemtsev in [132965](https://github.com/flutter/flutter/pull/132965)
* Fix `FlexibleSpaceBar.title` doesn't respect the leading widget by @TahaTesser in [132573](https://github.com/flutter/flutter/pull/132573)


e,unitColor);
	}

	/**
	 * 此建筑独有的一些参数
	 */
	public void initShpSource(SceneType sceneType) {
		super.constConfig = ConstConfig.AfAirc;
		super.height = 100;
		setCenterOffX(122);
		setCenterOffY(110);
		if(sceneType==SceneType.TEM) {
			super.constShpFilePrefix = team + temMark + basicName + "mk";
			super.aniShpPrefixLs.add("ggairc");
			super.aniShpPrefixLs.add("ggairc_c");
			super.aniShpPrefixLs.add("ggaircbb");
			super.aniShpPrefixLs.add("ggairc_b");
			super.aniShpPrefixLs.add("ggairc_a");
		}
		if(sceneType==SceneType.URBAN) {
			super.constShpFilePrefix = team + urbMark + basicName + "mk";
			super.aniShpPrefixLs.add("ggairc");
			super.aniShpPrefixLs.add("ggairc_c");
			super.aniShpPrefixLs.add("ggaircbb");
			super.aniShpPrefixLs.add("ggairc_b");
			super.aniShpPrefixLs.add("ggairc_a");
		}
		if(sceneType==SceneType.SNOW) {
			super.constShpFilePrefix = team + snoMark + basicName + "mk";
			super.aniShpPrefixLs.add("gaairc");
			super.aniShpPrefixLs.add("gaairc_c");
			super.aniShpPrefixLs.add("gaaircbb");
			super.aniShpPrefixLs.add("gaairc_b");
			super.aniShpPrefixLs.add("gaairc_a");
		}
	}

	/**
	 * 获取建筑占地中限制建筑进入的菱形中心点
	 * 只是恰好人物也进入不了建筑限制区域
	 *
	 * 实际上就是建筑占地   但是建筑占地的地方,坦克有可能能开进去
	 */
	@Override
	public List<CenterPoint> getNoConstCpList() {
		int centerX = centerOffX + super.getPositionX();
		int centerY = centerOffY + super.getPositionY();
		List<CenterPoint> result = new ArrayList<>();
		CenterPoint center = PointUtil.fetchCenterPoint(centerX, centerY);
		result.add(center);
		result.add(center.getLeftUp());
		result.add(center.getLeft());
		result.add(center.getLeftDn());
		result.add(center.getDn());
		result.add(center.getRightDn());
		return result;
	}

	/**
	 * 获取建筑占地中限制载具进入的菱形中心点
	 */
	@Override
	public List<CenterPoint> getNoVehicleCpList() {
		return getNoConstCpList();
	}

	/**
	 * 获取建筑的阴影区域
	 */
	public List<CenterPoint> getShadownCpList(){
		CenterPoint cp = PointUtil.getCenterPoint(positionX+centerOffX, positionY+centerOffY);
		List<CenterPoint> list = new ArrayList<>();
		CenterPoint cp1 = cp.getLeftUp().getLeftUp().getRightUp().getLeftUp().getRightUp().getLeftUp();
		CenterPoint cp2 = cp.getLeftUp().getLeftUp().getRightUp().getLeftUp().getRightUp();
		CenterPoint cp3 = cp.getLeftUp().getLeftUp().getRightUp().getLeftUp();
		CenterPoint cp4 = cp.getLeftUp().getLeftUp().getRightUp();
		CenterPoint cp5 = cp.getLeftUp().getLeftUp();
		CenterPoint cp6 = cp.getLeftUp().getRightUp();
		CenterPoint cp7 =


_room_infos";
    pub const STRIPPED_MEMBERS: &'static str = "stripped_members";
    pub const STRIPPED_ROOM_STATE: &'static str = "stripped_room_state";

    pub const ROOM_USER_RECEIPTS: &'static str = "room_user_receipts";
    pub const ROOM_EVENT_RECEIPTS: &'static str = "room_event_receipts";

    pub const MEDIA: &'static str = "media";

    pub const CUSTOM: &'static str = "custom";

    // static keys

    pub const STORE_KEY: &'static str = "store_key";
    pub const FILTER: &'static str = "filter";
    pub const SYNC_TOKEN: &'static str = "sync_token";
}

impl From<SerializationError> for StoreError {
    fn from(e: SerializationError) -> Self {
        match e {
            SerializationError::Json(e) => StoreError::Json(e),
            SerializationError::Encryption(e) => match e {
                store_key::Error::Random(e) => StoreError::Encryption(e.to_string()),
                store_key::Error::Serialization(e) => StoreError::Json(e),
                store_key::Error::Encryption(e) => StoreError::Encryption(e),
            },
        }
    }
}

pub struct IndexeddbStore {
    name: String,
    pub(crate) inner: IdbDatabase,
    store_key: Option<StoreKey>,
}

impl std::fmt::Debug for IndexeddbStore {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("IndexeddbStore").field("name", &self.name).finish()
    }
}

impl IndexeddbStore {
    async fn open_helper(name: String, store_key: Option<StoreKey>) -> Result<Self> {
        // Open my_db v1
        let mut db_req: OpenDbRequest = IdbDatabase::open_f64(&name, 1.0)?;
        db_req.set_on_upgrade_needed(Some(|evt: &IdbVersionChangeEvent| -> Result<(), JsValue> {
            if evt.old_version() < 1.0 {
                // migrating to version 1
                let db = evt.db();

                db.create_object_store(KEYS::SESSION)?;
                db.create_object_store(KEYS::SYNC_TOKEN)?;
                db.create_object_store(KEYS::ACCOUNT_DATA)?;

                db.create_object_store(KEYS::MEMBERS)?;
                db.create_object_store(KEYS::PROFILES)?;
                db.create_object_store(KEYS::DISPLAY_NAMES)?;
                db.create_object_store(KEYS::JOINED_USER_IDS)?;
                db.create_object_store(KEYS::INVITED_USER_IDS)?;

                db.create_object_store(KEYS::ROOM_STATE)?;
                db.create_object_store(KEYS::ROOM_INFOS)?;
                db.create_object_store(KEYS::PRESENCE)?;
                db.create_object_store(KEYS::ROOM_ACCOUNT_DATA)?;

                db.create_object_store(KEYS::STRIPPED_ROOM_INFOS)?;
                db.create_object_store(KEYS::STRIPPED_MEMBERS)?;
                db.create_object_store(KEYS::STRIPPED_ROOM_STATE)?;

                db.create_object_store(KEYS::ROOM_USER_RECEIPTS)?;
                db.create_object_store(KEYS::ROOM_EVENT_RECEIPTS)?;

                db.create_object_store(KEYS::MEDIA)?;

                db.create_object_store(KEYS::CUSTOM)?;
            }
            Ok(())
        }));

        let db: IdbDatabase = db_req.into_future().await?;


    * WHERE LocalId = ?
     */
    private static final String UPDATE_NATIVE_ID_BY_LOCAL_CONTACT_ID = "UPDATE "
        +TABLE_NAME + " SET " + Field.NATIVECONTACTID + "=? WHERE " + Field.LOCALID + "=?";

    /**
     * SELECT NativeId
     * FROM Contacts
     * WHERE LocalId = ?
     */
    private static final String QUERY_NATIVE_ID_BY_LOCAL_CONTACT_ID =
    	"SELECT " + Field.NATIVECONTACTID + " FROM " + TABLE_NAME + " WHERE " + Field.LOCALID + "=?";

    /**
     * SELECT LocalId
     * FROM Contacts
     * WHERE ServerId = ?
     */
    private static final String QUERY_LOCAL_ID_BY_SERVER_ID =
    	"SELECT " + Field.LOCALID + " FROM " + TABLE_NAME + " WHERE " + Field.SERVERID + "=?";

    /**
     * Column indices which match the query string returned by
     * {@link #getQueryStringSql(String)}.
     */
    private static final int LOCALID = 0;

    private static final int CONTACTID = 1;

    private static final int USERID = 2;

    private static final int ABOUTME = 3;

    private static final int FRIEND = 4;

    private static final int GENDER = 5;

    private static final int UPDATED = 6;

    private static final int NATIVE_CONTACTID = 7;

    private static final int SYNCTOPHONE = 8;

    /**
     * Reads a cursor at its current position to populate a Contact object
     *
     * @param c A cursor returned from a SELECT query on the projection returned
     *            by {@link #getFullQueryList()}.
     * @param contact An newly constructed Contact object that will be filled
     *            in.
     */
    private static void getQueryData(Cursor c, Contact contact) {
        if (!c.isNull(LOCALID)) {
            contact.localContactID = c.getLong(LOCALID);
        }
        if (!c.isNull(CONTACTID)) {
            contact.contactID = c.getLong(CONTACTID);
        }
        if (!c.isNull(USERID)) {
            contact.userID = c.getLong(USERID);
        }
        if (!c.isNull(ABOUTME)) {
            contact.aboutMe = c.getString(ABOUTME);
        }
        if (!c.isNull(FRIEND)) {
            contact.friendOfMine = (c.getInt(FRIEND) == 0 ? false : true);
        }
        if (!c.isNull(GENDER)) {
            contact.gender = c.getInt(GENDER);
        }
        if (!c.isNull(UPDATED)) {
            contact.updated = c.getLong(UPDATED);
        }
        if (!c.isNull(NATIVE_CONTACTID)) {
            contact.nativeContactId = c.getInt(NATIVE_CONTACTID);
        }
        if (!c.isNull(SYNCTOPHONE)) {
            contact.synctophone = (c.getInt(SYNCTOPHONE) == 0 ? false : true);
        }
    }

    /**
     * Returns a ContentValues object that can be used to insert or modify a
     * contact in the table.
     *
     * @param contact The source contact object
     * @return The ContentValues object containing the data.
     * @note NULL fields in the given contact will not be included in the
     *       ContentValues
     */
    private static ContentValues fillUpdateData(Contact contact) {
        ContentValues contactValues = new ContentValues();
        if (contact.contactID != null) {
            contactValues.put(Field.SERVERID.toString(), contact.contactID);
        }
        if (contact.userID != null) {
            contactValues.put(Field.USERID.toString(), contact.userID);
        }
        if (contact.friendOfMine != null) {
            contactValues.put(Field.FRIEND.toString(), contact.friendOfMine);
        }
        if (contact.gender != null) {
            contactValues.put(Field


(t)] += 1
                    pred['View-Dep@' + str(t)] += found
                else:
                    gt['View-Indep@' + str(t)] += 1
                    pred['View-Indep@' + str(t)] += found
                if hard:
                    gt['Hard@' + str(t)] += 1
                    pred['Hard@' + str(t)] += found
                else:
                    gt['Easy@' + str(t)] += 1
                    pred['Easy@' + str(t)] += found
                if unique:
                    gt['Unique@' + str(t)] += 1
                    pred['Unique@' + str(t)] += found
                else:
                    gt['Multi@' + str(t)] += 1
                    pred['Multi@' + str(t)] += found

                gt['Overall@' + str(t)] += 1
                pred['Overall@' + str(t)] += found

        header = ['Type']
        header.extend(object_types)
        ret_dict = {}

        for t in self.iou_thr:
            table_columns = [['results']]
            for object_type in object_types:
                metric = object_type + '@' + str(t)
                value = pred[metric] / max(gt[metric], 1)
                ret_dict[metric] = value
                table_columns.append([f'{value:.4f}'])

            table_data = [header]
            table_rows = list(zip(*table_columns))
            table_data += table_rows
            table = AsciiTable(table_data)
            table.inner_footing_row_border = True
            print_log('\n' + table.table, logger=logger)

        return ret_dict

    def compute_metrics(self, results: list) -> Dict[str, float]:
        """Compute the metrics from processed results after all batches have
        been processed.

        Args:
            results (list): The processed results of each batch.

        Returns:
            Dict[str, float]: The computed metrics. The keys are the names of
            the metrics, and the values are corresponding results.
        """
        logger: MMLogger = MMLogger.get_current_instance()  # noqa
        annotations, preds = zip(*results)
        ret_dict = {}
        if self.format_only:
            # preds is a list of dict
            results = []
            for pred in preds:
                result = dict()
                # convert the Euler boxes to the numpy array to save
                bboxes_3d = pred['bboxes_3d'].tensor
                scores_3d = pred['scores_3d']
                # Note: hard-code save top-20 predictions
                # eval top-10 predictions during the test phase by default
                box_index = scores_3d.argsort(dim=-1, descending=True)[:20]
                top_bboxes_3d = bboxes_3d[box_index]
                top_scores_3d = scores_3d[box_index]
                result['bboxes_3d'] = top_bboxes_3d.numpy()
                result['scores_3d'] = top_scores_3d.numpy()
                results.append(result)
            mmengine.dump(results,
                          os.path.join(self.result_dir, 'test_results.json'))
            return ret_dict

        ret_dict = self.ground_eval(annotations, preds)

        return ret_dict


ive"] = "Lleva la poción de Quinn a Quinn Yorick en Los Dominios de Ivar, al norte de El Sepulcro.";
		};
		[431] = {
		   ["name"] = "Velas de señalización";
		};
		[432] = {
		   ["name"] = "¡Malditos troggs!";
		   ["objective"] = "Mata a 8 aplastacráneos Comepiedras y a 8 cascahuesos Comepiedras en la Cantera de Gol'Bolar o en la mina.";
		};
		[433] = {
		   ["name"] = "El servidor público";
		   ["objective"] = "Reparte 7 runas de retorno a los mineros atrapados en la Cantera de Gol'Bolar.";
		};
		[434] = {
		   ["name"] = "El ataque";
		   ["objective"] = "Quédate en el jardín hasta que Lord Gregor Lescovar y Marzon el Filo Silencioso hayan terminado de hablar. A continuación, mátalos antes de volver a reunirte con Elling Trias en Ventormenta.";
		};
		[435] = {
		   ["name"] = "Escolta a Erland";
		   ["objective"] = "Escolta a Erland a través de los lobos, hasta llegar a Rane Yorick.";
		};
		[436] = {
		   ["name"] = "La excavación de Vetaferro";
		   ["objective"] = "Habla con el explorador Ceñimal.";
		};
		[437] = {
		   ["name"] = "El Campo Muerto";
		   ["objective"] = "Mata gnolls Putrepellejo en El Campo Muerto.$B$BCuando aparezca Latipesadilla, mátala.$B$BLleva la esencia de Latipesadilla al sumo ejecutor Hadrec en El Sepulcro.";
		};
		[438] = {
		   ["name"] = "El Viejo Embarcadero";
		   ["objective"] = "Ve a El Viejo Embarcadero.$B$BEncuentra la razón por la que la Plaga está ahí.";
		};
		[439] = {
		   ["name"] = "Pistas de Putrepellejos";
		   ["objective"] = "Lleva el anillo de Deliah al sumo ejecutor Hadrec en El Sepulcro.";
		};
		[440] = {
		   ["name"] = "El anillo grabado";
		   ["objective"] = "Lleva el anillo de Deliah al magistrado Sevren en Rémol.";
		};
		[441] = {
		   ["name"] = "Raleigh y Entrañas";
		   ["objective"] = "Lleva el anillo de Deliah a Raleigh.";
		};
		[442] = {
		   ["name"] = "Asalto a la Isla de Fenris";
		   ["objective"] = "Lleva la cabeza de Thule al sumo ejecutor Hadrec en El Sepulcro.";
		};
		[443] = {
		   ["name"] = "Icor de Putrepellejo";
		   ["objective"] = "Lleva 8 botellas de icor de Putrepellejo al boticario Renferrel en El Sepulcro.";
		};
		[444] = {
		   ["name"] = "El origen de los Putrepellejos";
		   ["objective"] = "Lleva la muestra de icor a Bethor Duroyelo en Entrañas.";
		};
		[445] = {
		   ["name"] = "Entrega a Bosque de Argénteos";
		   ["objective"] = "Llévale los descubrimientos del boticario Holland al boticario Renferrel del Bosque de Argénteos.";
		};
		[446] = {
		   ["name"] = "Thule Corvozarpa";
		   ["objective"] = "Lleva el pergamino de Bethor al boticario Renferrel en El Sepulcro de Argénteos.";
		};


bit_ceil(value), etl::bit_ceil(value));

        if (test_bit_ceil(value) != etl::bit_ceil(value))
        {
          break;
        }
      }
    }

#if ETL_USING_CPP14 && !defined(ETL_FORCE_NO_ADVANCED_CPP)
    //*************************************************************************
    TEST(test_bit_ceil_16_constexpr)
    {
      constexpr size_t Size = etl::bit_ceil(uint16_t(1));
      char temp[Size];

      CHECK_EQUAL(test_bit_ceil(uint16_t(1)), sizeof(temp));
    }
#endif

    //*************************************************************************
    TEST(test_bit_ceil_32)
    {
      etl::fnv_1a_32 hash;

      for (size_t i = 0; i < 100000; ++i)
      {
        hash.add(1);

        uint32_t value = hash.value() & 0x7FFFFFFF;

        CHECK_EQUAL(test_bit_ceil(value), etl::bit_ceil(value));

        if (test_bit_ceil(value) != etl::bit_ceil(value))
        {
          break;
        }
      }
    }

#if ETL_USING_CPP14 && !defined(ETL_FORCE_NO_ADVANCED_CPP)
    //*************************************************************************
    TEST(test_bit_ceil_32_constexpr)
    {
      constexpr size_t Size = etl::bit_ceil(uint32_t(1));
      char temp[Size];

      CHECK_EQUAL(test_bit_ceil(uint32_t(1)), sizeof(temp));
    }
#endif

    //*************************************************************************
    TEST(test_bit_ceil_64)
    {
      etl::fnv_1a_64 hash;

      for (size_t i = 0; i < 100000; ++i)
      {
        hash.add(1);

        uint64_t value = hash.value() & 0x7FFFFFFFFFFFFFFF;

        CHECK_EQUAL(test_bit_ceil(value), etl::bit_ceil(value));

        if (test_bit_ceil(value) != etl::bit_ceil(value))
        {
          break;
        }
      }
    }

#if ETL_USING_CPP14 && !defined(ETL_FORCE_NO_ADVANCED_CPP)
    //*************************************************************************
    TEST(test_bit_ceil_64_constexpr)
    {
      constexpr uint64_t Size = etl::bit_ceil(uint64_t(1));
      char temp[Size];

      CHECK_EQUAL(test_bit_ceil(uint64_t(1)), sizeof(temp));
    }
#endif

    //*************************************************************************
    TEST(test_bit_floor_8)
    {
      for (size_t i = 0; i < 256; ++i)
      {
        uint8_t value = uint8_t(i);

        CHECK_EQUAL(int(test_bit_floor(value)), int(etl::bit_floor(value)));
      }
    }

    //*************************************************************************
    TEST(test_bit_floor_16)
    {
      etl::fnv_1a_32 hash;

      for (size_t i = 0; i < 100000; ++i)
      {
        hash.add(1);

        uint16_t value = hash.value();

        CHECK_EQUAL(test_bit_floor(value), etl::bit_floor(value));

        if (test_bit_floor(value) != etl::bit_floor(value))
        {
          break;
        }
      }
    }

#if ETL_USING_CPP14 && !defined(ETL_FORCE_NO_ADVANCED_CPP)
    //*************************************************************************
    TEST(test_bit_floor_16_constexpr)
    {
      constexpr size_t Size = etl::bit_floor(uint16_t(1));
      char temp[Size];

      CHECK_EQUAL(test_bit_floor(uint16


.
 * @param i - the number to clamp
 * @param min - the maximum (inclusive) value
 * @param max - the minimum (inclusive) value
 * @public
 */
function clamp(i, min, max) {
    if (isNaN(i) || i <= min) {
        return min;
    }
    else if (i >= max) {
        return max;
    }
    return i;
}
/**
 * Scales an input to a number between 0 and 1
 * @param i - a number between min and max
 * @param min - the max value
 * @param max - the min value
 * @public
 */
function math_utilities_normalize(i, min, max) {
    if (isNaN(i) || i <= min) {
        return 0.0;
    }
    else if (i >= max) {
        return 1.0;
    }
    return i / (max - min);
}
/**
 * Scales a number between 0 and 1
 * @param i - the number to denormalize
 * @param min - the min value
 * @param max - the max value
 * @public
 */
function denormalize(i, min, max) {
    if (isNaN(i)) {
        return min;
    }
    return min + i * (max - min);
}
/**
 * Converts degrees to radians.
 * @param i - degrees
 * @public
 */
function degreesToRadians(i) {
    return i * (Math.PI / 180.0);
}
/**
 * Converts radians to degrees.
 * @param i - radians
 * @public
 */
function radiansToDegrees(i) {
    return i * (180.0 / Math.PI);
}
/**
 * Converts a number between 0 and 255 to a hex string.
 * @param i - the number to convert to a hex string
 * @public
 */
function getHexStringForByte(i) {
    const s = Math.round(clamp(i, 0.0, 255.0)).toString(16);
    if (s.length === 1) {
        return "0" + s;
    }
    return s;
}
/**
 * Linearly interpolate
 * @public
 */
function lerp(i, min, max) {
    if (isNaN(i) || i <= 0.0) {
        return min;
    }
    else if (i >= 1.0) {
        return max;
    }
    return min + i * (max - min);
}
/**
 * Linearly interpolate angles in degrees
 * @public
 */
function lerpAnglesInDegrees(i, min, max) {
    if (i <= 0.0) {
        return min % 360.0;
    }
    else if (i >= 1.0) {
        return max % 360.0;
    }
    const a = (min - max + 360.0) % 360.0;
    const b = (max - min + 360.0) % 360.0;
    if (a <= b) {
        return (min - a * i + 360.0) % 360.0;
    }
    return (min + a * i + 360.0) % 360.0;
}
const TwoPI = Math.PI * 2;
/**
 * Linearly interpolate angles in radians
 * @public
 */
function lerpAnglesInRadians(i, min, max) {
    if (isNaN(i) || i <= 0.0) {
        return min % TwoPI;
    }
    else if (i >= 1.0) {
        return max % TwoPI;
    }
    const a = (min - max + TwoPI) % TwoPI;
    const b = (max - min + TwoPI) % TwoPI;
    if (a <= b) {
        return (min - a * i + TwoPI) % TwoPI;
    }
    return (min + a * i + TwoPI) % TwoPI;
}
/**
 *
 * Will return infinity if i*10^(precision) overflows number
 * note that floating point rounding rules come into play here
 * so values that end up rounding on a .5 round to the nearest
 * even not always up so 2.5 rounds to 2
 * @param i - the number to round
 * @param precision - the precision to round to
 *


lining)]
        static byte SelectRandom(Frequency[] a, int r)
        {
            for (int i = 0; i < a.Length - 1; i++)
                if (r < a[i].p)
                    return a[i].c;

            return a[a.Length - 1].c;
        }

        static void MakeCumulative(Frequency[] a)
        {
            double cp = 0;
            for (int i = 0; i < a.Length; i++)
            {
                cp += a[i].p;
                a[i].p = cp;
            }
        }

        static string ALU =
          "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" +
          "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA" +
          "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT" +
          "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA" +
          "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG" +
          "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC" +
          "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA";

        struct Frequency
        {
            public readonly byte c;
            public double p;

            public Frequency(char c, double p)
            {
                this.c = (byte)c;
                this.p = (p * IM);
            }
        }


inal controller = TransformationController();

  var refreshUI = 0.obs;

  var file = File().obs;
  var content = "".obs;
  var path = "".obs;

  late StreamSubscription _branchSubscription;
  late StreamSubscription _updateSubscription;

  Timer? _updateTimer;

  var fontSize = 20.0.obs;
  var baseFontSize = 20.0.obs;
  var fontScale = 1.0.obs;
  var baseFontScale = 1.0.obs;

  @override
  void onReady() async {
    super.onReady();
    retrieveFile();

    _updateSubscription = spStorage.getTheme().listen((p0) {
      if (_updateTimer != null && _updateTimer!.isActive) return;
      _updateTimer = Timer.periodic(const Duration(milliseconds: 300), (timer) {
        refreshUI.value++;
        timer.cancel();
      });
    });

    _branchSubscription = repository.ref.listen((p0) {
      retrieveFile();
    });
  }

  @override
  void onClose() {
    _branchSubscription.cancel();
    _updateSubscription.cancel();
    _updateTimer?.cancel();
    super.onClose();
  }

  Future<void> retrieveFile() async {
    state.value = HttpState.loading;
    await runWithErrorHandlingWithoutState(() async {
      file.value = await apiRepository.getFile(
              repository.project.value.id ?? -1,
              repository.filePath.value,
              FileRequest(ref: repository.ref.value)) ??
          File();
      path.value = file.value.filePath!.split('/').last;
      path.value = file.value.filePath!.replaceAll(path.value, '');
      if (path.value.isNotEmpty) {
        path.value = path.value.substring(0, path.value.length - 1);
      }
      try {
        content.value = utf8.decode(base64.decode(file.value.content ?? ""));
      } catch (e) {
        CommonWidget.toast('Cannot decode this file!');
      }
    }).then((value) => handleHttpActionState(value));
  }

  onPopupSelected(CodeViewScreenPopup value, BuildContext context) async {
    switch (value) {
      case CodeViewScreenPopup.settings:
        Get.toNamed(Routes.settings);
        break;
      case CodeViewScreenPopup.share:
        try {
          var directory = await getApplicationDocumentsDirectory();
          var f = io.File('${directory.path}/${file.value.fileName}');
          await f.writeAsString(content.value);
          Share.shareXFiles([XFile(f.path)]);
        } catch (e) {
          CommonWidget.toast('Something went wrong!');
        }
        break;
      case CodeViewScreenPopup.branches:
        Get.toNamed(
          Routes.branches,
          arguments: BranchesScreenArgs(
            onRefSelected: (value) {
              repository.ref.value = value;
            },
            selectedRef: repository.ref.value,
            returnRoute: Get.currentRoute,
          ),
        );
        break;
    }
  }
}
import 'package:flutter/material.dart';
import 'package:labplus_for_gitlab/models/models.dart';
import 'package:labplus_for_gitlab/shared/shared.dart';

import 'package:get/get.dart';

import 'create_project_snippet.dart';

class SnippetVisibilityItemItem {
  final String name;
  final String value;

  SnippetVisibilityItemItem({
    required this.name,
    required this.value,
  });
}

class CreateProjectSnippetScreen
    extends GetView<CreateProjectSnippetController> {
  const CreateProjectSnippetScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return _buildWidget(context);
  }

  Widget _buildWidget


ionCall) otto.Value {
		// Initialize hash
		h := hash.Hash{}
		// If an object is passed then initialize the default values of the hash
		if len(call.ArgumentList) > 0 {
			args := call.Argument(0).Object()
			for _, key := range args.Keys() {
				value, _ := args.Get(key)
				v, _ := value.ToString()
				h[key] = hash.HashValue{Value: v}
			}
		}

		obj, _ := call.Otto.Object(`({})`)
		buildHashObject(obj, h)
		return obj.Value()
	})

	// Register set data type
	_ = vm.Set("Set", func(call otto.FunctionCall) otto.Value {
		// Initialize set
		s := set.NewSet([]string{})
		// If an array is passed add the values to the set
		if len(call.ArgumentList) > 0 {
			args := call.Argument(0).Object()
			var elems []string
			for _, key := range args.Keys() {
				value, _ := args.Get(key)
				v, _ := value.ToString()
				elems = append(elems, v)
			}
			s.Add(elems)
		}

		obj, _ := call.Otto.Object(`({})`)
		buildSetObject(obj, s)
		return obj.Value()
	})

	// Register sorted set member data type
	_ = vm.Set("ZMember", func(call otto.FunctionCall) otto.Value {
		obj, _ := call.Otto.Object(`({})`)

		m := &sorted_set.MemberParam{}
		if len(call.ArgumentList) != 1 {
			panicWithFunctionCall(call, "expected an object with score and value properties")
		}
		arg := call.Argument(0).Object()
		// Validate the object
		if err = validateMemberParamObject(arg); err != nil {
			panicWithFunctionCall(call, err.Error())
		}
		// Get the value
		value, _ := arg.Get("value")
		m.Value = sorted_set.Value(value.String())
		// Get the score
		s, _ := arg.Get("score")
		score, _ := s.ToFloat()
		m.Score = sorted_set.Score(score)
		// Build the Otto member param object
		buildMemberParamObject(obj, m)
		return obj.Value()
	})

	// Register sorted set data type
	_ = vm.Set("ZSet", func(call otto.FunctionCall) otto.Value {
		// If default args are passed when initializing sorted set, add them to the member params
		var params []sorted_set.MemberParam
		for _, arg := range call.ArgumentList {
			if !arg.IsObject() {
				panicWithFunctionCall(call, "zset constructor args must be sorted set members")
			}
			id, _ := arg.Object().Get("__id")
			o, exists := getObjectById(id.String())
			if !exists {
				panicWithFunctionCall(call, "unknown object passed to zset constructor")
			}
			p, ok := o.(*sorted_set.MemberParam)
			if !ok {
				panicWithFunctionCall(call, "unknown object passed to createZSet function")
			}
			params = append(params, *p)
		}
		ss := sorted_set.NewSortedSet(params)

		obj, _ := call.Otto.Object(`({})`)
		buildSortedSetObject(obj, ss)
		return obj.Value()
	})

	// Get the command name
	v, err := vm.Get("command")
	if err != nil {
		return nil, "", nil, "", false, "", fmt.Errorf("could not get javascript command %s: %v", path, err)
	}
	command, err := v.ToString()
	if err != nil || len(command) <= 0 {
		return nil, "", nil, "", false, "", fmt.Errorf("javascript command not found %s: %v


</c-> <c- n>t</c-><c- p>;</c->    <c- k>if</c-> <c- p>(</c-><c- n>size</c-> <c- o><=</c-> <c- mi>0</c-><c- p>)</c-> <c- k>return</c-> <c- n>empty_t</c-><c- p>{};</c->    <c- n>T</c-> <c- n>o</c-> <c- o>=</c-> <c- n>a</c-><c- p>[</c-><c- n>t</c-> <c- o>%</c-> <c- n>aSize</c-><c- p>];</c->    <c- k>if</c-> <c- p>(</c-><c- o>!</c-> <c- n>top</c-><c- p>.</c-><c- n>compare_exchange_strong</c-><c- p>(</c-><c- n>t</c-><c- p>,</c-> <c- n>t</c-><c- o>+</c-><c- mi>1</c-><c- p>))</c->        <c- k>return</c-> <c- n>abort_t</c-><c- p>{};</c->    <c- k>return</c-> <c- n>o</c-><c- p>;</c-><c- p>}</c->

If the deque contains only one element, this causes undefined behavior in C++'s
memory model, because the element accessed on line 16 may be concurrently
written by the owning thread of the deque. However, if a data race occurs, the
CAS on line 17 fails, and the result of this speculative read is never
observed. Only one thread can win the CAS race to increment top.

Of note, imposing that <c- n>T</c-> be an atomic type in this instance defeats the entire
purpose of using the work-stealing deque, as it would require the owning
"bottom" thread to use synchronized access to read from the bottom (including
potentially taking a lock of <c- n>T</c-> is large; egregious for a data structure whose
purpose is to be lock-free) in the uncontended cases, even though the
correctness of the algorithm is maintained by discarding any potentially torn
results.

3. Further Considerations

Extrapolating from the above examples, it is also useful to consider a few extra
usecases where:

Alignment of the datastructures is purposefully not natural. In contrast,
<c- n>std</c-><c- o>::</c-><c- n>atomic</c-> is specified as always being suitably aligned by the
implementation.

Padding of the datastructure isn’t the same as that mandated by
<c- n>std</c-><c- o>::</c-><c- n>atomic</c-> (although padding bits are their own bag of special
[p0528r0]).


}
}
// Copyright 2023 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui';

class AssetPaths {
  /// Images
  static const String _images = 'assets/images';

  static const String titleBgBase = '$_images/bg-base.jpg';
  static const String titleBgReceive = '$_images/bg-light-receive.png';
  static const String titleFgEmit = '$_images/fg-light-emit.png';
  static const String titleFgReceive = '$_images/fg-light-receive.png';
  static const String titleFgBase = '$_images/fg-base.png';
  static const String titleMgEmit = '$_images/mg-light-emit.png';
  static const String titleMgReceive = '$_images/mg-light-receive.png';
  static const String titleMgBase = '$_images/mg-base.png';
  static const String titleStartBtn = '$_images/button-start.png';
  static const String titleStartBtnHover = '$_images/button-start-hover.png';
  static const String titleStartArrow = '$_images/button-start-arrow.png';
  static const String titleSelectedLeft = '$_images/select-left.png';
  static const String titleSelectedRight = '$_images/select-right.png';
  static const String pulseParticle = '$_images/particle3.png';

  /// Shaders
  static const String _shaders = 'assets/shaders';
  static const String orbShader = '$_shaders/orb_shader.frag';
  static const String uiShader = '$_shaders/ui_glitch.frag';
}

typedef FragmentPrograms = ({FragmentProgram orb, FragmentProgram ui});

Future<FragmentPrograms> loadFragmentPrograms() async => (
  orb: (await _loadFragmentProgram(AssetPaths.orbShader)),
  ui: (await _loadFragmentProgram(AssetPaths.uiShader)),
);

Future<FragmentProgram> _loadFragmentProgram(String path) async {
  return (await FragmentProgram.fromAsset(path));
}
// Copyright 2023 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

class OrbShaderConfig {
  const OrbShaderConfig({
    this.zoom = 0.3,
    this.exposure = 0.4,
    this.roughness = 0.3,
    this.metalness = 0.3,
    this.materialColor = const Color.fromARGB(255, 242, 163, 138),
    this.lightRadius = 0.75,
    this.lightColor = const Color(0xFFFFFFFF),
    this.lightBrightness = 15.00,
    this.ior = 0.5,
    this.lightAttenuation = 0.5,
    this.ambientLightColor = const Color(0xFFFFFFFF),
    this.ambientLightBrightness = 0.2,
    this.ambientLightDepthFactor = 0.3,
    this.lightOffsetX = 0,
    this.lightOffsetY = 0.1,
    this.lightOffsetZ = -0.66,
  }) : assert(zoom >= 0 && zoom <= 1),
       assert(exposure >= 0),
       assert(metalness >= 0 && metalness <= 1),
       assert(lightRadius >= 0),
       assert(lightBrightness >= 1),
       assert(ior >= 0 && ior <= 2),
       assert(lightAttenuation >= 0 && lightAttenuation <= 1),
       assert(ambientLightBrightness >= 0);

  final double zoom;

  /// Camera exposure value, higher is brighter, 0 is black
  final double exposure;

  /// How rough the surface is, somewhat translates to the intensity/radius
  /// of specular highlights
  final double roughness;

  /// 0 for a dielectric material (plastic, wood, grass, water, etc...),
  /// 1 for a metal (iron, copper, aluminum, gold, etc...), a value in between
  /// blends the two materials (not really physically accurate, has minor
  /// artistic value)
  final double metalness;

  /// any color, alpha ignored, for metal materials doesn't correspond


 = {},
			effects = {
			},
		},
	}
})

lottpotion.register_potion("miruvor", "Miruvor", "lottpotion:miruvor", 240, {
	effect = "phys_override",
	types = {
		{
			type = 1,
			set = {},
			time = 60,
			effects = {
				jump = 0.3,
			},
		},
		{
			type = 2,
			set = {},
			time = 120,
			effects = {
				jump = 0.6,
			},
		},
		{
			type = 3,
			set = {},
			time = 240,
			effects = {
				jump = 1.0,
			},
		},
	}
})

lottpotion.register_potion("spiderpoison", "Spider Poison", "lottpotion:spiderpoison", 20, {
	effect = "phys_override",
	types = {
		{
			type = 1,
			set = {},
			effects = {
                    speed = -0.2,
                    jump = -0.2,
			},
		},
		{
			type = 2,
			set = {},
			effects = {
                    speed = -0.5,
                    jump = -0.5,
			},
		},
		{
			type = 3,
			set = {},
			effects = {
                    speed = -1,
                    jump = -1,
			},
		},
	}
})

lottpotion.register_potion("orcdraught", "Orc Draught", "lottpotion:orcdraught", 100, {
	effect = "fixhp",
	types = {
		{
			type = 1,
               hp = -1,
               time = 20,
			set = {},
			effects = {
			},
		},
		{
			type = 2,
               hp = -1,
               time = 50,
			set = {},
			effects = {
			},
		},
		{
			type = 3,
               hp = -1,
               time = 100,
			set = {},
			effects = {
			},
		},
	}
})

lottpotion.register_potion("entdraught", "Ent Draught", "lottpotion:entdraught", 240, {
	effect = "phys_override",
	types = {
		{
			type = 1,
			set = {},
			effects = {
                    speed = 1,
                    jump = -0.2,
			},
		},
		{
			type = 2,
			set = {},
			effects = {
                    speed = 2,
                    jump = -0.5,
			},
		},
		{
			type = 3,
			set = {},
			effects = {
                    speed = 3,
                    jump = -1,
			},
		},
	}
})

minetest.register_on_joinplayer(function(player)
	lottpotion.players[player:get_player_name()] = {
		speed = 1,
		jump = 1,
		gravity = 1,
		air = 0,
		hp = 0,
		alive = 1,
	}
end)

minetest.register_on_leaveplayer(function(player)
	lottpotion.players[player:get_player_name()] = nil
	lottpotion.deaths[player:get_player_name()] = nil
end)

minetest.register_chatcommand("effect", {
	params = "none",
	description = "get effect info",
	func = function(name, param)
		minetest.chat_send_player(name, "effects:")
		local lottpotion_e = lottpotion.players[name]
		if lottpotion_e~=nil then
			for potion_name, val in pairs(lottpotion_e) do
				if potion_name ~= "alive" then
					minet


//===- Passes.h - GPU NVVM pipeline entry points --------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_DIALECT_GPU_PIPELINES_PASSES_H_
#define MLIR_DIALECT_GPU_PIPELINES_PASSES_H_

#include "mlir/Pass/PassOptions.h"

namespace mlir {
namespace gpu {

/// Options for the gpu to nvvm pipeline.
struct GPUToNVVMPipelineOptions
    : public PassPipelineOptions<GPUToNVVMPipelineOptions> {
  PassOptions::Option<int64_t> indexBitWidth{
      *this, "index-bitwidth",
      llvm::cl::desc("Bitwidth of the index type for the host (warning this "
                     "should be 64 until the GPU layering is fixed)"),
      llvm::cl::init(64)};
  PassOptions::Option<std::string> cubinTriple{
      *this, "cubin-triple",
      llvm::cl::desc("Triple to use to serialize to cubin."),
      llvm::cl::init("nvptx64-nvidia-cuda")};
  PassOptions::Option<std::string> cubinChip{
      *this, "cubin-chip", llvm::cl::desc("Chip to use to serialize to cubin."),
      llvm::cl::init("sm_50")};
  PassOptions::Option<std::string> cubinFeatures{
      *this, "cubin-features",
      llvm::cl::desc("Features to use to serialize to cubin."),
      llvm::cl::init("+ptx60")};
  PassOptions::Option<std::string> cubinFormat{
      *this, "cubin-format",
      llvm::cl::desc("Compilation format to use to serialize to cubin."),
      llvm::cl::init("fatbin")};
  PassOptions::Option<int> optLevel{
      *this, "opt-level",
      llvm::cl::desc("Optimization level for NVVM compilation"),
      llvm::cl::init(2)};
  PassOptions::Option<bool> kernelUseBarePtrCallConv{
      *this, "kernel-bare-ptr-calling-convention",
      llvm::cl::desc(
          "Whether to use the bareptr calling convention on the kernel "
          "(warning this should be false until the GPU layering is fixed)"),
      llvm::cl::init(false)};
  PassOptions::Option<bool> hostUseBarePtrCallConv{
      *this, "host-bare-ptr-calling-convention",
      llvm::cl::desc(
          "Whether to use the bareptr calling convention on the host (warning "
          "this should be false until the GPU layering is fixed)"),
      llvm::cl::init(false)};
};

//===----------------------------------------------------------------------===//
// Building and Registering.
//===----------------------------------------------------------------------===//

/// Adds the GPU to NVVM pipeline to the given pass manager. Transforms main
/// dialects into NVVM targets. Begins with GPU code regions, then handles host
/// code.
void buildLowerToNVVMPassPipeline(OpPassManager &pm,
                                  const GPUToNVVMPipelineOptions &options);

/// Register all pipeleines for the `gpu` dialect.
void registerGPUToNVVMPipeline();

} // namespace gpu
} // namespace mlir

#endif


    /// | Value | Description   |
    /// | -----:| ------------- |
    /// |     0 | Not held
    /// |    30 | `XINPUT_GAMEPAD_TRIGGER_THRESHOLD`
    /// |   255 | Fully held
    pub right_trigger: u8,

    /// X-coordinate of the upper left thumbstick of the gamepad.
    ///
    /// | Value     | Description   |
    /// | ---------:| ------------- |
    /// |    -32768 | Fully left
    /// |     -7849 | `-XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE`
    /// |         0 | Horizontally centered
    /// |     +7849 | `+XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE`
    /// |    +32767 | Fully right
    pub left_thumb_x: i16,

    /// Y-coordinate of the upper left thumbstick of the gamepad.
    ///
    /// | Value     | Description   |
    /// | ---------:| ------------- |
    /// |    -32768 | Fully down
    /// |     -7849 | `-XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE`
    /// |         0 | Horizontally centered
    /// |     +7849 | `+XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE`
    /// |    +32767 | Fully up
    pub left_thumb_y: i16,

    /// X-coordinate of the right thumbstick of the gamepad.
    ///
    /// | Value     | Description   |
    /// | ---------:| ------------- |
    /// |    -32768 | Fully left
    /// |     -8689 | `-XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE`
    /// |         0 | Horizontally centered
    /// |     +8689 | `+XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE`
    /// |    +32767 | Fully right
    pub right_thumb_x: i16,

    /// Y-coordinate of the right thumbstick of the gamepad.
    ///
    /// | Value     | Description   |
    /// | ---------:| ------------- |
    /// |    -32768 | Fully down
    /// |     -8689 | `-XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE`
    /// |         0 | Horizontally centered
    /// |     +8689 | `+XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE`
    /// |    +32767 | Fully up
    pub right_thumb_y: i16,
}

// TODO: deadzone fns?
// TODO: pairing fns?

test_layout_only! {
    Gamepad => winapi::um::xinput::XINPUT_GAMEPAD {
        buttons         => wButtons,
        left_trigger    => bLeftTrigger,
        right_trigger   => bRightTrigger,
        left_thumb_x    => sThumbLX,
        left_thumb_y    => sThumbLY,
        right_thumb_x   => sThumbRX,
        right_thumb_y   => sThumbRY,
    }
}
extern crate bindgen;

use std::io::prelude::*;
use std::fs::File;

fn main(){
/*
    let mut bindings = bindgen::Builder::new("C:\\Program Files (x86)\\National Instruments\\Shared\\ExternalCompilerSupport\\C\\include\\NIDAQmx.h");
    bindings.link("C:\\Program Files (x86)\\National Instruments\\Shared\\ExternalCompilerSupport\\C\\lib64\\msvc\\NIDAQmx", bindgen::LinkType::Dynamic);
    bindings.convert_macros(true);
    // Generate the bindings to a string so we can wrap them
    // instead of going through the `write_to_file` API.
    let generated_bindings = bindings.generate().expect("Failed to generate bindings");
    // Now open the file we'll write the generated bindings too
    let mut file = File::create("ni_daq_mx_gen.rs").expect("Failed to open file");
    // Wrap the bindings in a `pub mod` before


i < 8; i++) {
			byteRet[i] = (byte) ((value >> 8 * i) & 0xff);
		}
		return byteRet;
	}

	/**
	 * 字节数组中解析整型数据
	 * @param bytes byte数组
	 * @param start 开始位置
	 * @param length 长度
	 * @param big 是否Big Endian
	 * @return int
	 */
	public static int byte2int(byte[] bytes, int start, int length, boolean big) {
		int value = 0;
		if (big) {// Big Endian
			for (int i = start; i < start + length; i++) {
				value = (value << 8) | (bytes[i] & 0xFF);
			}
		} else {// Little Endian
			for (int i = start + length - 1; i >= start; i--) {
				value = (value << 8) | (bytes[i] & 0xFF);
			}
		}
		return value;
	}
	public static int byte2int(byte[] bytes, int start, int length) {
		return byte2int(bytes, start, length, true);
	}
	public static int byte2int(byte[] bytes, int start) {
		return byte2int(bytes, start, min(4, bytes.length), true);
	}
	public static int byte2int(byte[] bytes, int start, boolean big) {
		return byte2int(bytes, start, min(4, bytes.length), big);
	}

	public static short byte2short(byte[] bytes, int start, int length) {
		return (short) byte2int(bytes, start, length, true);
	}
	public static short byte2short(byte[] bytes, int start) {
		return (short)byte2int(bytes, start, min(2, bytes.length), true);
	}
	public static short byte2short(byte[] bytes, int start, boolean big) {
		return (short)byte2int(bytes, start, min(2, bytes.length), big);
	}

	/**
	 * 平均值
	 * @param list 集合
	 * @param scale 小数位
	 * @param round 舍入模式 参考BigDecimal静态常量
	 *       ROUND_UP        = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字（始终对非零舍弃部分前面的数字加 1） 如:2.36 转成 2.4

	 *       ROUND_DOWN      = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1, 即截短). 如:2.36 转成 2.3

	 *       ROUND_CEILING   = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正, 则舍入行为与 ROUND_UP 相同 如果为负, 则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集

	 *       ROUND_FLOOR     = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正, 则舍入行为与 ROUND_DOWN 相同 如果为负, 则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反

	 *       ROUND_HALF_UP   = 4 四舍五入

	 *       ROUND_HALF_DOWN = 5 五舍六入

	 *       ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)

	 *         如果舍弃部分左边的数字为奇数, 则舍入行为与 ROUND_HALF_UP 相同（四舍五入）

	 *         如果为偶数, 则舍入行为与 ROUND_HALF_DOWN 相同（五舍六入）

	 *         如:1.15 转成 1.2, 因为5前面的1是奇数


 reset your score and you have to start all over. Report to me afterwards.",
			}, npc, creature)
			player:setStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine, 13)
			player:setStorageValue(Storage.Quest.U9_60.BigfootsBurden.Shooting, 0)
		elseif player:getStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine) == 13 then
			npcHandler:say("Shoot at the villain targets that will pop up. DON'T shoot innocent civilians since this will reset your score and you have to start all over. {Report} to me afterwards.", npc, creature)
		end
	elseif MsgContains(message, "report") then
		if player:getStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine) == 14 then
			npcHandler:say("You are showing some promise! Now continue with the recruitment and talk to Gnomewart to the south for your endurance test!", npc, creature)
			player:setStorageValue(Storage.Quest.U9_60.BigfootsBurden.Shooting, player:getStorageValue(Storage.Quest.U9_60.BigfootsBurden.Shooting) + 1)
			player:setStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine, 15)
		elseif player:getStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine) == 13 then
			npcHandler:say("Sorry you are not done yet.", npc, creature)
		elseif player:getStorageValue(Storage.Quest.U9_60.BigfootsBurden.QuestLine) <= 12 then
			npcHandler:say("You have nothing to report at all.", npc, creature)
		end
	end
	return true
end

npcHandler:setMessage(MESSAGE_GREET, "Hi there! Are you here for the {shooting} test or to {report} your success?")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)


*std::pow((AGL/inputWindHeight),powerLawPower);
			  return velocity;
         }
	}else if(profile_switch==monin_obukov_similarity)   //Monin-Obukov similarity profile
    {
                if(AGL==0.0)
		{
                    velocity = 0.0;
                    return velocity;
		}else
                {
		    inwindheight = (inputWindHeight + Rough_h) - (Rough_d); //height of input wind (from z=0 of log profile)

                    //If the input wind is at a height where the log profile isn't defined (can happen on output interpolation),
                    //just linearly interpolate. Use three times the roughness height to avoid issues that can arise sampling
                    //too close to where the log profile goes to 0.
                    if(inwindheight < 3.0*Roughness){
                        velocity = inputWindSpeed * (AGL/(inwindheight + Rough_d));
                        return velocity;
                    }else{ //else, just do standard profile stuff
                        if(AGL < (Rough_d + 7.0*Roughness))	//linearly interpolate, as in AERMOD, if below 7*z0
                        {
                            vel7z0 = monin_obukov(7.0*Roughness, inputWindSpeed, inwindheight, Roughness, ObukovLength);	//compute windspeeds at 7*z0 height
                            velocity = vel7z0 * (AGL/(7.0*Roughness + Rough_d));
                            return velocity;
                        }else if(AGL < (Rough_d + ABL_height))	//if below ABL top, monin-obukov similarity (log profile)
                        {
                            velocity = monin_obukov((AGL - Rough_d), inputWindSpeed, inwindheight, Roughness, ObukovLength);
                            return velocity;
                        }else{	//else we're above the ABL...
                            if(ABL_height<=0.0) //This can happen if input velocity is 0 which gives u_star=0 (typically if diurnal is off)
                                velocity = 0.0;
                            else
                                velocity = monin_obukov(ABL_height, inputWindSpeed, inwindheight, Roughness, ObukovLength);
                        return velocity;
                        }
                    }
                }
	}else
	    throw std::runtime_error("Could not identify profile switch.\n");
}

double windProfile::monin_obukov(double z, double const& U1, double const& z1, double const& z0, double const& L)
{
	double speed;
    if(z/z0<1)  //If this happens, log below will give nonsensical results, don't let it happen.
        z = z0;
    assert(z1/z0 >=1);
	if(L == 0.0)
		speed = U1*(log(z/z0))/(log(z1/z0));
	else
		speed = U1*(log(z/z0)-stability_function(z/L,L))/(log(z1/z0)-stability_function(z1/L,L));

	return speed;
}

double windProfile::stability_function(double const& z_over_L, double const& L_switch)
{	//function that computes the stability function for the vertical wind profile (similarity theory)
	//z_over_L is the height divided by the Monin-Obukov length
	//L_switch indicates the sign of the Monin-Obukov length (either positive value for stable or negative value for unstable)

	double value;

	if(L_switch >= 0.0)	//stable conditions
	{
//		value = -5.0*z_over_L;	//usual computation
		value = -17.0*(


new Font("宋体", Font.PLAIN, 18));
		price.setColumns(10);
		GroupLayout gl_panel_2 = new GroupLayout(panel_2);
		gl_panel_2.setHorizontalGroup(
			gl_panel_2.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addGap(76)
					.addComponent(lblNewLabel_3, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE)
					.addGap(112)
					.addComponent(lblNewLabel_3_1)
					.addGap(99)
					.addComponent(lblNewLabel_3_1_1)
					.addGap(115)
					.addComponent(lblNewLabel_3_1_1_2)
					.addGap(71)
					.addComponent(lblNewLabel_3_1_1_1)
					.addContainerGap(230, Short.MAX_VALUE))
				.addGroup(gl_panel_2.createSequentialGroup()
					.addGap(14)
					.addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel_2.createSequentialGroup()
							.addComponent(lblNewLabel_2, GroupLayout.PREFERRED_SIZE, 246, GroupLayout.PREFERRED_SIZE)
							.addContainerGap())
						.addGroup(gl_panel_2.createSequentialGroup()
							.addComponent(ISBN, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(name, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(author, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
							.addGap(10)
							.addComponent(publish, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(price, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
							.addComponent(confirm)
							.addGap(20))))
		);
		gl_panel_2.setVerticalGroup(
			gl_panel_2.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblNewLabel_2, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
					.addGap(10)
					.addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_3, GroupLayout.PREFERRED_SIZE, 17, Short.MAX_VALUE)
						.addComponent(lblNewLabel_3_1, 0, 0, Short.MAX_VALUE)
						.addComponent(lblNewLabel_3_1_1, GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
						.addComponent(lblNewLabel_3_1_1_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(lblNewLabel_3_1_1_2, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
					.addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE)
						.addComponent(name, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_