this.count = count / 1000
							var _this = this;
							this.inter = window.setInterval(function() {
								_this.count = _this.count - 1;
								if (_this.count < 0) {
									window.clearInterval(_this.inter);
									layer.msg("活动已结束", {
										time: 2000,
										icon: 5
									})
								}
							}, 1000);
						}
					},

                    					// 下载文件
					downFile(url) {
						var download = $("#download");
						download.append(
							"下载该文件");
						console.log(download);
						$("#down")[0].click();
					},
					// 跨表
					onAcrossTap(acrossTable){
						localStorage.setItem('crossTable',`discussshangpinxinxi`);
						localStorage.setItem('crossObj', JSON.stringify(this.detail));
						jump(`../${acrossTable}/add.html?corss=true`);
					},

				}
			})

			layui.use(['layer', 'form', 'element', 'carousel', 'http', 'jquery', 'laypage'], function() {
				var layer = layui.layer;
				var element = layui.element;
				var form = layui.form;
				var carousel = layui.carousel;
				var http = layui.http;
				var jquery = layui.jquery;
				var laypage = layui.laypage;

				var limit = 10;

				// 数据ID
				var id = http.getParam('id');
				vue.detail.id = id;

				// 商品信息
				http.request(`${vue.detailTable}/detail/` + id, 'get', {}, function(res) {
					// 详情信息
					vue.detail = res.data
																																																		// var swiperItemHtml = '';
					// for (let item of vue.swiperList) {
					// 	swiperItemHtml +=
					// 		'
' +
					// 		'' +
					// 		'
';
					// }
					// jquery('#swiper-item').html(swiperItemHtml);
					// 轮播图
					vue.$nextTick(() => {
					  carousel.render({
					  	elem: '#swiper',
						width: '500px',
					  	height: '400px',
					  	arrow: 'hover',
					  	anim: 'default',
					  	autoplay: 'true',
					  	interval: '3000',
					  	indicator: 'inside'
					  });

					})
					// carousel.render({
					// 	elem: '#swiper',
					// 	width: swiper.width,height:swiper.height,
					// 	arrow: swiper.arrow,
					// 	anim: swiper.anim,
					// 	interval: swiper.interval,
					// 	indicator: swiper.indicator
					// });

				});

								// 获取评论
				http.request(`discuss${vue.detailTable}/list`, 'get', {
					page: 1,
					limit: limit,
					refid : vue.detail.id
				}, function(res) {
					vue.dataList = res.data.list
					// 分页
					laypage.render({
						elem: 'pager',
						count: res.data.total,
						limit: limit,
						jump: function(obj, first) {
							//首次不执行
							if (!first) {
								htt


1.toFixed(1)+" "+e.x2.toFixed(1)+" "+e.y2.toFixed(1)+" "+e.x3.toFixed(1)+" "+e.y3.toFixed(1)+'"/>\n',
Oa(g,"slur");break;case n.SPACE:case n.STBRK:break;case n.CUSTOS:Qa(d);dc(d,0);break;case n.BLOCK:case n.PART:case n.REMARK:case n.STAVES:case n.TEMPO:break;default:v(2,d,"draw_symbols - Cannot draw symbol "+d.type)}}Qa(a.sym)};var Ya=[],zd={},vd={serif:1,serifBold:1,"sans-serif":1,"sans-serifBold":1,Palatino:1.1,monospace:1.35},Fe={},r={"abc-version":"1",annotationfont:{name:"sans-serif",size:12},aligncomposer:1,beamslope:.4,bardef:{"[":"","[]":"","|:":"[|:","|::":"[|::","|:::":"[|:::",":|":":|]",
"::|":"::|]",":::|":":::|]","::":":][:"},breaklimit:.7,breakoneoln:!0,cancelkey:!0,composerfont:{name:"serif",style:"italic",size:14},composerspace:6,decoerr:!0,dynalign:!0,footerfont:{name:"serif",size:16},fullsvg:"",gchordfont:{name:"sans-serif",size:12},gracespace:new Float32Array([4,8,11]),graceslurs:!0,headerfont:{name:"serif",size:16},historyfont:{name:"serif",size:16},hyphencont:!0,indent:0,infofont:{name:"serif",style:"italic",size:14},infoname:'R "Rhythm: "\nB "Book: "\nS "Source: "\nD "Discography: "\nN "Notes: "\nZ "Transcription: "\nH "History: "',
infospace:0,keywarn:!0,leftmargin:1.4*37.8,lineskipfac:1.1,linewarn:!0,maxshrink:.65,maxstaffsep:2E3,maxsysstaffsep:2E3,measrepnb:1,measurefont:{name:"serif",style:"italic",size:10},measurenb:-1,musicfont:{name:"music",src:'url("data:application/octet-stream;base64,AAEAAAAOAIAAAwBgRkZUTYTd79wAAFggAAAAHEdERUYAFQAUAABYBAAAABxPUy8yWLxdCwAAAWgAAABWY21hcFxKS5kAAAQIAAADemN2dCAAIgKIAAAHhAAAAARnYXNw//8AAwAAV/wAAAAIZ2x5Zp276QgAAAiwAABGeGhlYWQPFh8MAAAA7AAAADZoaGVhCWn/GwAAASQAAAAkaG10eNzF+scAAAHAAAACSGxvY2GpopfcAAAHiAAAASZtYXhwANkBPQAAAUgAAAAgbmFtZbni4sIAAE8oAAADG3Bvc3Qtfw6AAABSRAAABbUAAQAAAAEAAI87udRfDzz1AAsEAAAAAADRlyIXAAAAANncuoH/OPzvBUsEiAAAAAgAAgAAAAAAAAABAAAEiPzvAFwEJf84/XQFSwAB


List<T> res;
//        try {
//            this.pt = pt;
//            res = translate(trees);
//        } finally {
//            this.pt = prevPt;
//        }
//        DEBUG.P(0,this,"translate(List<T> trees, Type pt)");
//        return res;
//    }
//
//    public void visitClassDef(JCClassDecl tree) {
//    	DEBUG.P(this,"visitClassDef(JCClassDecl tree)");
//        translateClass(tree.sym);
//        result = tree;
//        DEBUG.P(0,this,"visitClassDef(JCClassDecl tree)");
//    }
//
//    JCMethodDecl currentMethod = null;
//    public void visitMethodDef(JCMethodDecl tree) {
//    	try {//我加上的
//    	DEBUG.P(this,"visitMethodDef(JCMethodDecl tree)");
//    	DEBUG.P("tree.sym="+tree.sym);
//
//        JCMethodDecl previousMethod = currentMethod;
//        try {
//            currentMethod = tree;
//            tree.restype = translate(tree.restype, null);
//            tree.typarams = List.nil();//注意:这里已将type parameter去除
//            tree.params = translateVarDefs(tree.params);
//            tree.thrown = translate(tree.thrown, null);
//            tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType());
//            DEBUG.P("tree.type1="+tree.type);
//            tree.type = erasure(tree.type);
//            DEBUG.P("tree.type2="+tree.type);
//            result = tree;
//        } finally {
//            currentMethod = previousMethod;
//        }
//
//        DEBUG.P("tree.name="+tree.name);
//        DEBUG.P("tree.sym="+tree.sym);
//        DEBUG.P("tree.sym.owner="+tree.sym.owner);
//        DEBUG.P("tree.sym.owner.members()="+tree.sym.owner.members());
//        //Scope.Entry e2 = tree.sym.owner.members().lookup(tree.name);
//        //DEBUG.P("e2.sym="+e2.sym);
//        // Check that we do not introduce a name clash by erasing types.
//        for (Scope.Entry e = tree.sym.owner.members().lookup(tree.name);
//             e.sym != null;
//             e = e.next()) {
//            if (e.sym != tree.sym &&
//                types.isSameType(erasure(e.sym.type), tree.type)) {
//                //名称冲突
//                log.error(tree.pos(),
//                          "name.clash.same.erasure", tree.sym,
//                          e.sym);
//                return;
//            }
//        }
//
//        }finally{//我加上的
//		DEBUG.P(0,this,"visitMethodDef(JCMethodDecl tree)");
//		}
//    }
//
//    public void visitVarDef(JCVariableDecl tree) {
//    	DEBUG.P(this,"visitVarDef(JCVariableDecl tree)");
//    	DEBUG.P("tree="+tree);
//    	DEBUG.P("tree.type1="+tree.type);
//        tree.vartype = translate(tree.vartype, null);
//        tree.init = translate(tree.init, tree.sym.erasure(types));
//        tree.type = erasure(tree.type);
//        result = tree;
//        DEBUG.P("tree.type2="+tree.type);
//        DEBUG.P(0,this,"visitVarDef(JCVariableDecl tree)");
//    }
//
//    public void visitDoLoop(JCDoWhileLoop tree) {
//        tree.body = translate(tree.body);
//        tree.cond = translate(tree.cond, syms.booleanType);
//        result = tree;
//    }
//
//    public void visitWhileLoop(JCWhileLoop tree) {
//


Success(source, mode, true)
            return
        }
        if (source.world.gameRules().getBoolean(GameRuleKeys.SEND_COMMAND_FEEDBACK)) {
            source.sendSystemMessage(Component.translatable("gameMode.changed", Component.translatable(mode)))
        }
        CommandMessages.GAME_MODE_OTHER.sendSuccess(source, player.displayName, mode, true)
    }
}
/*
 * This file is part of the Krypton project, licensed under the Apache License v2.0
 *
 * Copyright (C) 2021-2023 KryptonMC and the contributors of the Krypton project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kryptonmc.krypton.util

import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor

fun interface TaskChainer {

    fun append(task: DelayedTask)

    fun interface DelayedTask {

        fun submit(executor: Executor): CompletableFuture<*>
    }

    companion object {

        @JvmField
        val LOGGER: Logger = LogManager.getLogger()

        @JvmStatic
        fun immediate(executor: Executor): TaskChainer = TaskChainer { task ->
            task.submit(executor).exceptionally {
                LOGGER.error("Task failed", it)
                null
            }
        }
    }
}
/*
 * This file is part of the Krypton project, licensed under the Apache License v2.0
 *
 * Copyright (C) 2021-2023 KryptonMC and the contributors of the Krypton project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kryptonmc.krypton.util

import net.kyori.adventure.key.InvalidKeyException
import net.kyori.adventure.key.Key
import org.kryptonmc.serialization.Codec
import org.kryptonmc.serialization.DataResult

object Keys {

    @JvmField
    val CODEC: Codec<Key> = Codec.STRING.comapFlatMap({ read(it) }, { it.asString() }).stable()

    @JvmStatic
    fun isValidCharacter(char: Char): Boolean = Key.allowedInValue(char) || char == ':'

    @JvmStatic
    fun create(namespace: String, path: String): Key? {
        return try {
            Key.key(namespace, path)
        } catch (_: InvalidKeyException) {
            null
        }
    }

    @JvmStatic
    fun create(input: String): Key? {
        return try {
            Key.key(input)
        } catch (_: InvalidKeyException) {
            null
        }
    }

    @JvmStatic
    fun read(value: String): DataResult<Key> {
        return try {
            DataResult.success(Key.key(value))
        } catch (exception: InvalidKeyException) {
            DataResult.error("$value is not a valid resource location! ${exception.message}")
        }
    }


on fs_a, see a standby take up the role
        fs_a.set_max_mds(2)
        self.wait_until_equal(lambda: len(fs_a.get_active_names()), 2, 30,
                              reject_fn=lambda v: v > 2 or v < 1)

        # Shrink fs_b back to 1, see a daemon go back to standby
        fs_b.set_max_mds(1)
        self.wait_until_equal(lambda: len(fs_b.get_active_names()), 1, 30,
                              reject_fn=lambda v: v > 2 or v < 1)

        # Grow fs_a up to 3, see the former fs_b daemon join it.
        fs_a.set_max_mds(3)
        self.wait_until_equal(lambda: len(fs_a.get_active_names()), 3, 60,
                              reject_fn=lambda v: v > 3 or v < 2)


lighted {
  @apply bg-zinc-700/50;
}

[data-rehype-pretty-code-fragment] .line-highlighted span {
  @apply relative;
}

[data-rehype-pretty-code-fragment] .word--highlighted {
  @apply rounded-md border-zinc-700/70 bg-zinc-700/50 p-1;
}

.dark [data-rehype-pretty-code-fragment] .word--highlighted {
  @apply bg-zinc-900;
}

[data-rehype-pretty-code-title] {
  @apply mt-2 px-4 pt-6 text-sm font-medium;
}

[data-rehype-pretty-code-title] + pre {
  @apply mt-2;
}

.mdx > .steps:first-child > h3:first-child {
  @apply mt-0;
}
.app-container {
    width: 550px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#quiz-box #header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-list {
    padding: 18px 10px;
}

.option-list .option{
    border: 1px solid #151D3B;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 16px;
    margin-bottom: 10px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-list .option:hover{
    color: #112B2C;
    background: #FFD33D;
}

.option-list .option.correct {
    color: #155724;
    background: #d4edda;
}

.option-list .option.incorrect {
    color: #721c24;
    background: #f8d7da;
}

.option-list .option.disabled {
    pointer-events: none;
}

.summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* score box */
#score-box {
    text-align: center;
    padding: 30px;
}

#score-box i {
    font-size: 90px;
    color: #007bff;
    margin-bottom: 10px;
}

#score-box .score-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

#button-box {
    text-align: center;
}

#button-box, #quiz-box, #score-box {
    display: none;
}

#button-box.active, #quiz-box.active, #score-box.active {
    display: block;
}

/* kalan süre */
.time {
    display: flex;
    align-items: center;
    background: #155724;
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    font-size: 15px;
}

.time .time-text {
    font-size: 14px;
}
.time .time-second {
    background: #FFD33D;
    border-radius: 3px;
    padding: 3px;
    margin-left: 3px;
    width: 25px;
    text-align: center;
}

.btn-next {
    display: none;
}

.btn-next.show {
    display: block;
}.app-container {
    width: 550px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#


= 2
	stopMovement = false
	tumbleStarted = false
	boosterOn = false
	beam = false
	shieldHealth = 30 + 80 -- 50 = 5 secs, roughly
	shockwaveHealth = 0

	RK = 0
	GK = 0
	BK = 0
	OK = 0
	SK = 0
	roundKills = 0
	shieldMiser = true
	fierceComp = false
	shotsFired = 0
	shotsHit = 0
	sniperHits = 0
	pointBlankHits = 0
	chainLength = 0
	chainCounter = 0
	SurfTime = 12

	-------------------------
	-- gaudy racer
	-------------------------
	CheckForNewRound()

	-- Handle Starting Stage of Game
	if (gameOver == false) and (gameBegun == false) then
		gameBegun = true
		roundNumber = 0 -- 0
		firstClan = GetHogClan(CurrentHedgehog)
	end

	if gameOver == true then
		gameBegun = false
		stopMovement = true
		tumbleStarted = false
		SetMyCircles(false)
	end

	-------
	-- tumbler
	----

	wepAmmo[0] = 5
	wepAmmo[1] = 2
	wepAmmo[2] = 5000
	wepIndex = 2
	ChangeWeapon()

	HideTags()

	---------------
	---------------
	--AddCaption("num g: " .. numGears() )
	--WriteLnToConsole("onNewTurn, I just set a bunch of variables to their necessary states. This was done at:")
	--WriteLnToConsole("The above occured at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)

end

function ThingsToBeRunOnGears(gear)

	HandleLifeSpan(gear)
	DeleteFarFlungBarrel(gear)

	if CirclesAreGo == true then
		CheckVarious(gear)
		ProjectileTrack(gear)
	end

end

function onGameTick20()

	--WriteLnToConsole("Start of GameTick")

	HandleCircles()

	-- derp
	--if shockwaveHealth > 0 then
	--	shockwaveHealth = shockwaveHealth - 1
	--	shockwaveRad = shockwaveRad + 5
	--end

	if GameTime%100 == 0 then

		if beam == true then
			shieldHealth = shieldHealth - 1
			if shieldHealth < 80 then -- <= 80
				shieldHealth = 80
				beam = false
				AddCaption(loc("Shield Depleted"),0xff0000ff,capgrpMessage)
				PlaySound(sndMineTick)
				PlaySound(sndSwitchHog)
			end
		end

		--nw WriteLnToConsole("Starting ThingsToBeRunOnGears()")

		runOnGears(ThingsToBeRunOnGears)

		--nw WriteLnToConsole("Finished ThingsToBeRunOnGears()")

		--runOnGears(HandleLifeSpan)
		--runOnGears(DeleteFarFlungBarrel)

		if CirclesAreGo == true and CurrentHedgehog ~= nil then
			CheckDistances()
			--runOnGears(CheckVarious)	-- used to be in handletracking for some bizarre reason
			--runOnGears(ProjectileTrack)
		end

		-- white smoke trail as player falls from the sky
		if (TimeLeft <= 0) and (stopMovement == true) and (CurrentHedgehog ~= nil) then
			j,k = GetGearVelocity(CurrentHedgehog)
			if (j ~= 0) and (k ~= 0) then
				AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, true)
			end
		end

		--nw WriteLnToConsole("Finished 100Timer")

	end

	-- start the player tumbling with a boom once their turn has actually begun
	if (tumbleStarted == false) and (gameOver == false) then
		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
			--AddCaption(LOC_NOT("Good to go!"))
			tumbleStarted = true
			TimeLeft = d


ile(program2, returnAll: true);
  Expect.isTrue(generated3.contains("UniqueLongNameForTesting_A"));
  // This extra check is to make sure that we don't include HTMLAudioElement
  // just because of the is-check. It is optimized away in this case because
  // we believe it was never instantiated.
  Expect.isFalse(generated3.contains("HTMLAudioElement"));
}

main() {
  runTests() async {
    await testUnreachableCrash();
    await testTreeShakingJsInteropTypes();
    await testTreeShakingNativeTypes();
  }

  asyncTest(() async {
    print('--test from kernel------------------------------------------------');
    await runTests();
  });
}
// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library jsinterop.world_test;

import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import 'package:compiler/src/common/elements.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart' show ClassEntity;
import 'package:compiler/src/elements/names.dart';
import 'package:compiler/src/universe/class_hierarchy.dart';
import 'package:compiler/src/universe/selector.dart';
import 'package:compiler/src/js_model/js_world.dart' show JClosedWorld;
import '../helpers/element_lookup.dart';
import 'package:compiler/src/util/memory_compiler.dart';

void main() {
  asyncTest(() async {
    await testClasses();
  });
}

testClasses() async {
  test(String mainSource,
      {List<String> directlyInstantiated = const <String>[],
      List<String> abstractlyInstantiated = const <String>[],
      List<String> indirectlyInstantiated = const <String>[]}) async {
    CompilationResult result = await runCompiler(memorySourceFiles: {
      'main.dart': """
import 'package:js/js.dart';

@JS()
class A {
  external get foo;

  external A(var foo);
}

@JS('BClass')
class B {
  external get foo;

  external B(var foo);
}

@JS()
@anonymous
class C {
  external get foo;

  external factory C({foo});
}

@JS()
@anonymous
class D {
  external get foo;

  external factory D({foo});
}

class E {
  final foo;

  E(this.foo);
}

class F {
  final foo;

  F(this.foo);
}

newA() => A(0);
newB() => B(1);
newC() => C(foo: 2);
newD() => D(foo: 3);
newE() => E(4);
newF() => F(5);

$mainSource
"""
    });
    Compiler compiler = result.compiler;
    Map<String, ClassEntity> classEnvironment = <String, ClassEntity>{};

    ClassEntity registerClass(ClassEntity cls) {
      classEnvironment[cls.name] = cls;
      return cls;
    }

    JClosedWorld world = compiler.backendClosedWorldForTesting!;
    ElementEnvironment elementEnvironment = world.elementEnvironment;
    ClassEntity Object_ = registerClass(world.commonElements.objectClass);
    ClassEntity Interceptor =
        registerClass(world.commonElements.jsInterceptorClass);
    ClassEntity JavaScriptObject =
        registerClass(world.commonElements.jsJavaScriptObjectClass);
    ClassEntity LegacyJavaScriptObject =
        registerClass(world.commonElements.jsLegacyJavaScriptObjectClass);
    ClassEntity A = registerClass(findClass(world, 'A'));
    ClassEntity B = registerClass(findClass(world, 'B'));
    ClassEntity C = registerClass(findClass(world, 'C'));
    ClassEntity D = registerClass(findClass(world, 'D'));
    ClassEntity E = registerClass(findClass(world, 'E'));
    ClassEntity F = registerClass(findClass(world


System(cell, uLb, thetaBar,missingIndices, knownIndices, rho, PiNeq, qNeq, massConserving);

    T rhoBar = Descriptor<T>::rhoBar(rho);

    Array<T,Descriptor<T>::d> j;
    for (plint iDim = 0; iDim < Descriptor<T>::d; ++iDim) {
        j[iDim] = rho * uLb[iDim];
    }
    T jSqr = VectorTemplate<T,Descriptor>::normSqr(j);

    // TODO not elegant. Regularize functions should be made more generic
    typedef Descriptor<T> L;
    Array<T,Descriptor<T>::q> f, feq;
    for (plint iPop=0; iPop < L::q; ++iPop) {
        cell[iPop] = this->computeEquilibrium(iPop, rhoBar, j, jSqr, thetaBar);
        cell[iPop] += offEquilibriumTemplates<T,Descriptor>::fromPiAndQtoFneq(iPop, PiNeq, qNeq);
    }
}

/* *************** Class GeneralizedNextToWallBoundaryDynamics ************* */

template<typename T, template<typename U> class Descriptor>
int GeneralizedNextToBoundaryDynamics<T,Descriptor>::id =
    meta::registerGeneralDynamics<T,Descriptor,GeneralizedNextToBoundaryDynamics<T,Descriptor> >
        ("Boundary_GeneralizedNextToBoundaryDynamics");

template<typename T, template<typename U> class Descriptor>
GeneralizedNextToBoundaryDynamics<T,Descriptor>::
    GeneralizedNextToBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
                                        std::vector<plint> missingIndices_,
                                        bool automaticPrepareCollision)
        : BoundaryCompositeDynamics<T,Descriptor>(baseDynamics_,automaticPrepareCollision),
            missingIndices(missingIndices_)
{
    knownIndices = indexTemplates::remainingIndexes<Descriptor<T> >(missingIndices);

    rho = (T)1;
    thetaBar = T();
    u.resetToZero();
    PiNeq.resetToZero();
    Qneq.resetToZero();
}

template<typename T, template<typename U> class Descriptor>
GeneralizedNextToBoundaryDynamics<T,Descriptor>::
    GeneralizedNextToBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
                                      std::vector<plint> missingIndices_,
                                      std::vector<plint> knownIndices_,
                                      bool automaticPrepareCollision)
        : BoundaryCompositeDynamics<T,Descriptor>(baseDynamics_,automaticPrepareCollision),
            missingIndices(missingIndices_), knownIndices(knownIndices_)
{  }

template<typename T, template<typename U> class Descriptor>
GeneralizedNextToBoundaryDynamics<T,Descriptor>::
    GeneralizedNextToBoundaryDynamics(HierarchicUnserializer& unserializer)
        : BoundaryCompositeDynamics<T,Descriptor>(0, false)
{
    this->unserialize(unserializer);
}

template<typename T, template<typename U> class Descriptor>
GeneralizedNextToBoundaryDynamics<T,Descriptor>*
    GeneralizedNextToBoundaryDynamics<T,Descriptor>::clone() const
{
    return new GeneralizedNextToBoundaryDynamics<T,Descriptor>(*this);
}

template<typename T, template<typename U> class Descriptor>
int GeneralizedNextToBoundaryDynamics<T,Descriptor>::getId() const {
    return id;
}

template<typename T, template<typename U> class Descriptor>
void GeneralizedNextToBoundaryDynamics<T,Descriptor>::serialize(HierarchicSerializer& serializer) const
{
    BoundaryCompositeDynamics<T,Descriptor>::serialize(serializer);
    serializer.addValue((int)(missingIndices.s


/*							asinh.c
 *
 *	Inverse hyperbolic sine
 *
 *
 *
 * SYNOPSIS:
 *
 * float x, y, asinh();
 *
 * y = asinh( x );
 *
 *
 *
 * DESCRIPTION:
 *
 * Returns inverse hyperbolic sine of argument.
 *
 * If |x| < 0.5, the function is approximated by a rational
 * form  x + x**3 P(x)/Q(x).  Otherwise,
 *
 *     asinh(x) = log( x + sqrt(1 + x*x) ).
 *
 *
 *
 * ACCURACY:
 *
 *                      Relative error:
 * arithmetic   domain     # trials      peak         rms
 *    IEEE     -3,3        100000       2.4e-7      4.1e-8
 *
 */

/*						asinh.c	*/

/*
Cephes Math Library Release 2.2:  June, 1992
Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
*/

/* Single precision inverse hyperbolic sine
 * test interval: [-0.5, +0.5]
 * trials: 10000
 * peak relative error: 8.8e-8
 * rms relative error: 3.2e-8
 */
#include "mconf.h"
extern float LOGE2F;

#ifdef ANSIC
float log( float );
float sqrt( float );

float asinh( float xx )
#else
float log(), sqrt();

float asinh(xx)
double xx;
#endif
{
float x, z;

if( xx < 0 )
	x = -xx;
else
	x = xx;

if( x > 1500.0f )
	{
	z = log(x) + LOGE2F;
	goto done;
	}
z = x * x;
if( x < 0.5f )
	{
	z =
	((( 2.0122003309E-2f * z
	  - 4.2699340972E-2f) * z
	  + 7.4847586088E-2f) * z
	  - 1.6666288134E-1f) * z * x
	  + x;
	}
else
	{
	z = sqrt( z + 1.0f );
	z = log( x + z );
	}
done:
if( xx < 0 )
	z = -z;
return( z );
}


#pragma once

#include <array>
#include <memory>
#include <string>
#include <string_view>

#include "gui_file_browser.h"
#include "gui_window.h"
#include "sentools/senpatcher_dll_loader.h"
#include "util/file.h"
#include "window_id_management.h"

namespace SenTools::GUI {
struct SenPatcherPatchCS2Window : public SenTools::GUI::Window {
    SenPatcherPatchCS2Window(GuiState& state,
                             std::string gamePath,
                             std::string patchDllPath,
                             HyoutaUtils::IO::File patchDllFile,
                             SenPatcherDllIdentificationResult patchDllInfo);
    SenPatcherPatchCS2Window(const SenPatcherPatchCS2Window& other) = delete;
    SenPatcherPatchCS2Window(SenPatcherPatchCS2Window&& other) = delete;
    SenPatcherPatchCS2Window& operator=(const SenPatcherPatchCS2Window& other) = delete;
    SenPatcherPatchCS2Window& operator=(SenPatcherPatchCS2Window&& other) = delete;
    ~SenPatcherPatchCS2Window();

    bool RenderFrame(GuiState& state) override;
    void Cleanup(GuiState& state) override;
    void UpdateInstalledDllInfo();

    struct Settings {
        bool CheckBoxAssetPatches = true;
        bool CheckBoxBattleAutoSkip = true;
        bool CheckBoxTurboToggle = false;
        bool CheckBoxFixVoiceFileLang = true;
        bool CheckBoxBgmEnqueueingLogic = true;
        bool CheckBoxPatchAudioThread = true;
        bool CheckBoxControllerMapping = true;
        bool CheckBoxArtsSupport = true;
        bool CheckBoxForce0Kerning = false;
        bool CheckBoxDisableMouseCam = false;
        bool CheckBoxShowMouseCursor = false;
        bool CheckBoxDisablePauseOnFocusLoss = false;
        bool CheckBoxForceXInput = false;
        bool CheckBoxFixBattleScopeCrash = true;
    };

private:
    static constexpr char WindowTitle[] = "Patch Trails of Cold Steel II";
    std::array<char, GetWindowIdBufferLength(sizeof(WindowTitle))> WindowIdString;
    size_t WindowId;

    Settings GameSettings;
    std::string GamePath;
    std::string PatchDllPath;
    HyoutaUtils::IO::File PatchDllFile;
    SenPatcherDllIdentificationResult PatchDllInfo;
    SenPatcherDllIdentificationResult InstalledDllInfo;

    std::string StatusMessage;

    struct WorkThreadState;
    std::unique_ptr<WorkThreadState> WorkThread;
};
} // namespace SenTools::GUI


5f5f5;
    font-weight: bold;
}

/* Code Blocks */
.html-viewer-content pre {
    background-color: #282c34;
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

.html-viewer-content code {
    font-family: 'Courier New', monospace;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Blockquotes */
.html-viewer-content blockquote {
    border-left: 5px solid #ddd;
    padding-left: 15px;
    font-style: italic;
    color: #555;
}

/* Links */
.html-viewer-content a {
    color: #007bff;
    text-decoration: none;
}

.html-viewer-content a:hover {
    text-decoration: underline;
}.excel-viewer-app-container {
    display: grid;
    height: 100%;
    width: 100%;
    background-color: var(--excel-viewer-body-background);
    color: var(--excel-viewer-body-foreground);
    transition: all 0.3s ease;
    /* animation: popUp 0.2s ease-out; */
}
.excel-viewer-loading-container {
    display: grid;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
.excel-viewer-progress-container {
    width: 300px;
    height: 30%;
}
.excel-viewer-loading-text {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
    user-select: none;
}
.excel-viewer-loading-subtext {
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
    margin-top: 10px;
    color: gray;
    user-select: none;
}
.excel-viewer-loading-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--excel-viewer-border);
    border-radius: 4px;
    overflow: hidden;
}
.excel-viewer-loading-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--excel-viewer-loading-progress, 0%);
    background: #0078d4;
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}
.excel-viewer-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 80%;
    width: 100%;
    user-select: none;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
.excel-viewer-toolbar {
    display: grid;
    gap: 1rem;
    align-items: center;
    padding: 0 0.5rem;
    background-color: var(--excel-viewer-surface);
    min-height: 55px;
    overflow: hidden;
}

.excel-viewer-toolbar-options {
    width: "100%";
    height: 80px;
    animation: popUp 0.2s ease-in-out;
}

.excel-viewer-toolbar-selected-range-details-container {
    grid-template-columns: max-content 1fr;
}

.excel


5-63.8-48.4-63.8-13.9 0-22.9 6.6-27.8 11.1l-1.8-8.8h-31.3V360l35.5-7.5.1-40.2c5.1 3.7 12.7 9 25.1 9 25.4-.1 48.6-20.5 48.6-65.6zm112.2 1.2c0-36.4-17.6-65.1-51.3-65.1-33.8 0-54.3 28.7-54.3 64.9 0 42.8 24.2 64.5 58.8 64.5 17 0 29.7-3.9 39.4-9.2v-28.6c-9.7 4.9-20.8 7.9-34.9 7.9-13.8 0-26-4.9-27.6-21.5h69.5c.1-2 .4-9.4.4-12.9zm-51.6-36.1c-8.9 0-18.7 6.7-18.7 22.7h36.7c0-16-9.3-22.7-18-22.7z"],"cc-visa":[576,512,[],"f1f0","M470.1 231.3s7.6 37.2 9.3 45H446c3.3-8.9 16-43.5 16-43.5-.2.3 3.3-9.1 5.3-14.9l2.8 13.4zM576 80v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h480c26.5 0 48 21.5 48 48zM152.5 331.2L215.7 176h-42.5l-39.3 106-4.3-21.5-14-71.4c-2.3-9.9-9.4-12.7-18.2-13.1H32.7l-.7 3.1c15.8 4 29.9 9.8 42.2 17.1l35.8 135h42.5zm94.4.2L272.1 176h-40.2l-25.1 155.4h40.1zm139.9-50.8c.2-17.7-10.6-31.2-33.7-42.3-14.1-7.1-22.7-11.9-22.7-19.2.2-6.6 7.3-13.4 23.1-13.4 13.1-.3 22.7 2.8 29.9 5.9l3.6 1.7 5.5-33.6c-7.9-3.1-20.5-6.6-36-6.6-39.7 0-67.6 21.2-67.8 51.4-.3 22.3 20 34.7 35.2 42.2 15.5 7.6 20.8 12.6 20.8 19.3-.2 10.4-12.6 15.2-24.1 15.2-16 0-24.6-2.5-37.7-8.3l-5.3-2.5-5.6 34.9c9.4 4.3 26.8 8.1 44.8 8.3 42.2.1 69.7-20.8 70-53zM528 331.4L495.6 176h-31.1c-9.6 0-16.9 2.8-21 12.9l-59.7 142.5H426s6.9-19.2 8.4-23.3H486c1.2 5.5 4.8 23.3 4.8 23.3H528z"],centercode:[512,512,[],"f380","M329.2 268.6c-3.8 35.2-35.4 60.6-70.6 56.8-35.2-3.8-60.6-35.4-56.8-70.6 3.8-35.2 35.4-60.6 70.6-56.8 35.1 3.8 60.6 35.4 56.8 70.6zm-85.8 235.1C96.7 496-8.2 365.5 10.1 224.3c11.2-86.6 65.8-156.9 139.1-1


//
//  Copyright (c) 2024, Google Llc. All rights reserved.
//
//  SPDX-License-Identifier: BSD-2-Clause-Patent
//
//

#include <AsmMacroLib.h>

/** Monitor call.

  An HyperVisor Call (HVC) or System Monitor Call (SMC) will be issued
  depending on the default conduit. PcdMonitorConduitHvc determines the type
  of the call: if true, do an HVC.

  @param [in,out]  Args    Arguments for the HVC/SMC.
**/
ASM_FUNC(ArmMonitorCall)
  // Create a stack frame
  stp   x29, x30, [sp, #-16]!
  mov   x29, sp

  // Preserve X0 for later use
  mov   x30, x0

  // Load the SMCCC arguments values into the appropriate registers
  ldp   x0, x1, [x30, #0]
  ldp   x2, x3, [x30, #16]
  ldp   x4, x5, [x30, #32]
  ldp   x6, x7, [x30, #48]
  ldp   x8, x9, [x30, #64]
  ldp   x10, x11, [x30, #80]
  ldp   x12, x13, [x30, #96]
  ldp   x14, x15, [x30, #112]
  ldp   x16, x17, [x30, #1


# -*- coding: utf-8 -*-

# Hello World Producer
# 发布者代码需要完成如下任务
# 1. 连接到RabbitMQ
# 2. 获取信道
# 3. 声明交换器
# 4. 声明队列
# 5. 把队列和交换器绑定起来
# 6. 消费消息
# 7. 关闭信道
# 8. 关闭连接
# Requires: pika >= 0.10.0
# Author: knitmesh

import pika

credentials = pika.PlainCredentials("guest", "guest")
conn_params = pika.ConnectionParameters("localhost",
                                        credentials=credentials)

# 1. 建立倒代理服务器的连接
conn_broker = pika.BlockingConnection(conn_params)

# 2. 获取信道
channel = conn_broker.channel()

# 3. 声明交换器, exchange_declare方法语义为如果不存在该交换器就创建
channel.exchange_declare(exchange="hello-exchange",
                         type="direct",
                         passive=False,
                         durable=True,
                         auto_delete=False)

# 4. 声明队列
channel.queue_declare(queue="hello-queue")

# 5. 通过键"hola"将队列和交换器绑定起来
channel.queue_bind(queue="hello-queue",
                   exchange="hello-exchange",
                   routing_key="hola")

# 6. 处理消息的回调函数函数
def msg_consumer(channel, method, header, body):
    # 7. 确认消息
    channel.basic_ack(delivery_tag=method.delivery_tag)

    if body == "quit":
        # 8. 停止消费并退出,
        channel.basic_cancel(consumer_tag="hello-consumer")
        # 9. 关闭信道和连接
        channel.stop_consuming()
    else:
        print body

    return

# 10. 消费者订阅队列
channel.basic_consume(msg_consumer,
                      queue="hello-queue",
                      consumer_tag="hello-consumer")
# 11. 开始消费
channel.start_consuming()


percent - 0.25f) * p;
			r = (percent < 0.25f) ? 0.0f :  1.0f - ( x - 1.0f) * ( x - 1.0f);
		}break;

        case CUBIC_EASE_IN: r = percent * percent * percent; break;

		case CUBIC_EASE_OUT:{
			const float iPct = (1.0f - percent);
            r = 1.0f - ( iPct * iPct * iPct ); break;
		}

        case QUARTIC_EASE_IN: r = percent * percent * percent * percent; break;

		case QUARTIC_EASE_OUT:{
			const float iPct = (1.0f - percent);
            r = 1.0f - (iPct * iPct * iPct * iPct);
		}break;

        case QUINTIC_EASE_IN: r = percent * percent * percent * percent * percent; break;

		case QUINTIC_EASE_OUT:{
			const float iPct = (1.0f - percent);
            r = 1.0f - (iPct * iPct * iPct * iPct * iPct);
		}break;

		case BOUNCY:{
			const float k = 0.5f;
			r = 0.5f - 0.51f * cosf( M_PI * percent + k * percent - k * 0.5f );
		}break;

		case QUADRATIC_BEZIER_PARAM: r = quadraticBezier(percent, p1, p2); break;
		case EXPONENTIAL_SIGMOID_PARAM: r = doubleExponentialSigmoid(percent, p1); break;
		case CUBIC_BEZIER_PARAM: r = cubicBezier(percent, p1, p2, p3, p4); break;
		case CUBIC_BEZIER2_PARAM: r = cubicBezierNearlyThroughTwoPoints(percent, p1, p2, p3, p4); break;
		case CUBIC_BEZIER_CAMEL_LIKE: r = cubicBezierNearlyThroughTwoPoints(percent, p1, p2, p3, p4, 1.0f, 0.0f); break; //target point is [1,0] instead of the classic [1,1]

		case SWIFT_GOOGLE:{
			r = cubicBezier(percent, 0.444f, 0.013f, 0.188f, 0.956f); break;
		}

		case OBJECT_DROP:{
			if ( percent < 0.75f ){
				r = cosf( (2.0f * M_PI / 3.0f) * percent );
			}else{
				float range = 0.125f;
				float diffRange = 0.125f;
				float amp = p1;
				float freq = 8.0f;

				if ( percent < 0.75f + range ){
					r = amp * sinf( freq * M_PI * percent );
				}else{
					diffRange *= 0.5f; range += diffRange; amp *= 0.5f; freq *= 2.0f;
					if ( percent < 0.75f + range ){
						r = amp * sinf( freq * M_PI * percent );
					}else{
						diffRange *= 0.5f; range += diffRange; amp *= 0.5f; freq *= 2.0f;
						if ( percent < 0.75f + range ){
							r = amp * sinf( freq * M_PI * percent );
						}else{
							diffRange *= 0.5f; range += diffRange; amp *= 0.5f; freq *= 2.0f;
							if (


女なのか？

东方红魔乡　～ the Embodiment of Scarlet Devil.

06	歩兵行軍盤上を馳せ	03:33

	编曲	ニシム監督

	原曲
小さな小さな賢将

东方星莲船　～ Undefined Fantastic Object.

07	黒い森の人形工房	03:52

	编曲	<a href="/index.php?title=%E3%83%8B%E3%82%B7%E3%83%


ACK: rgba(255, 255, 255, .5)}body:not(.pages_skin_pc) :root{--appmsgPageGap: 20px;--appmsgPageBottomGap: 40px}body:not(.pages_skin_pc) .wx-root,body:not(.pages_skin_pc) body{--appmsgExtra-BG: #F7F7F7}body:not(.pages_skin_pc) .wx-root[data-weui-theme=dark],body:not(.pages_skin_pc) body[data-weui-theme=dark]{--appmsgExtra-BG: #121212}body:not(.pages_skin_pc)body:not(.pages_skin_pc){background:var(--weui-BG-2)}body:not(.pages_skin_pc)body:not(.pages_skin_pc).mm_appmsg .rich_media_area_extra{background-color:transparent}body:not(.pages_skin_pc)body:not(.pages_skin_pc).mm_appmsg .rich_media_extra_discuss{background:transparent}body:not(.pages_skin_pc) .rich_media_global_msg_inner,body:not(.pages_skin_pc) .rich_media_area_primary_inner,body:not(.pages_skin_pc) .rich_media_area_extra_inner{margin-left:auto;margin-right:auto}body:not(.pages_skin_pc) .rich_media_global_msg_inner,body:not(.pages_skin_pc) .rich_media_area_primary_inner{max-width:677px}body:not(.pages_skin_pc) .rich_media_area_extra_inner{max-width:calc(677px + var(--appmsgPageGap) * 2)}body:not(.pages_skin_pc) .rich_media_extra_discuss{-webkit-user-select:initial;-ms-user-select:initial;user-select:initial;margin-top:0;padding-top:16px}body:not(.pages_skin_pc) .discuss_mod{margin:0}body:not(.pages_skin_pc) .discuss_container_wrp{background-color:#fff}body:not(.pages_skin_pc) .discuss_container.access{width:677px;margin-left:auto;margin-right:auto}body:not(.pages_skin_pc) .discuss_container.editing .frm_textarea_box{margin:0}body:not(.pages_skin_pc) .frm_textarea_box{position:relative}body:not(.pages_skin_pc) .frm_textarea_box:before{content:" ";position:absolute;left:0;top:0;width:1px;height:100%;border-left:1px solid #E7E6E4;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}body:not(.pages_skin_pc) .frm_textarea_box:after{content:" ";position:absolute;top:0;width:1px;height:100%;border-left:1px solid #E7E6E4;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5);left:auto;right:-2px}body:not(.pages_skin_pc) .related


pkg/config"
	"github.com/fatalclarine/go-mysql-starrocks/pkg/metrics"
	"github.com/fatalclarine/go-mysql-starrocks/pkg/utils"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"github.com/sevlyar/go-daemon"
	"github.com/siddontang/go-log/log"
	"net/http"
	_ "net/http/pprof"
	"os"
	"os/signal"
	"syscall"
	"time"
)

func main() {
	// 输入参数处理
	help := utils.HelpInit()
	// 日志初始化
	// _ = utils.LogInit(help)
	// 目前使用daemon的 log
	log.SetLevelByName(*help.LogLevel)
	// daemon模式启动
	if *help.Daemon {
		cntxt := &daemon.Context{
			PidFileName: utils.GetExecPath() + "/go_mysql_sr.pid",
			PidFilePerm: 0644,
			LogFileName: *help.LogFile,
			LogFilePerm: 0640,
			WorkDir:     "./",
			Umask:       027,
		}
		d, err := cntxt.Reborn()
		if err != nil {
			log.Fatal("Unable to run: ", err)
		}

		if d != nil {
			return
		}
		defer func(cntxt *daemon.Context) {
			err := cntxt.Release()
			if err != nil {
				log.Fatal("daemon release error: ", err)
			}
		}(cntxt)
	}

	// 进程信号处理
	sc := make(chan os.Signal, 1)
	signal.Notify(sc,
		os.Kill,
		os.Interrupt,
		syscall.SIGHUP,
		syscall.SIGINT,
		syscall.SIGTERM,
		syscall.SIGQUIT)

	// Start prometheus http monitor
	go func() {
		metrics.OpsStartTime.Set(float64(time.Now().Unix()))
		log.Infof("starting http on port %d.", *help.HttpPort)
		http.Handle("/metrics", promhttp.Handler())
		httpPortAddr := fmt.Sprintf(":%d", *help.HttpPort)
		err := http.ListenAndServe(httpPortAddr, nil)
		if err != nil {
			log.Fatalf("starting http monitor error: %v", err)
		}
	}()

	// 初始化配置
	baseConfig := config.NewBaseConfig(help.ConfigFile)

	s, err := app.NewServer(baseConfig)
	if err != nil {
		log.Fatalf("%v", err.Error())
	}

	err = s.Start()
	if err != nil {
		log.Fatalf("%v", err.Error())
	}

	// api handle
	http.HandleFunc("/api/getConfig", api.GetConfigHandle(baseConfig, s.Output))
	http.HandleFunc("/api/addRule", api.AddRuleHandle(s.Input, s.Output, s.InputSchema))
	http.HandleFunc("/api/delRule", api.DelRuleHandle(s.Input, s.Output, s.InputSchema))
	http.HandleFunc("/api/getRule", api.GetRuleHandle(s.Outp


const val TYPE_WAIT = 1
            const val TYPE_PERCENT = 2
            const val TYPE_SUCCEED = 3
            const val TYPE_FAILED = 4
        }
    }

    companion object {
        private const val MAX_CACHE_SIZE = 512 * 1024 * 1024
        private const val MIN_CACHE_SIZE = 256 * 1024 * 1024
    }
}
package com.hippo.ehviewer.ui

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.webkit.WebView
import android.webkit.WebViewClient
import com.hippo.ehviewer.client.EhCookieStore
import com.hippo.ehviewer.util.setDefaultSettings

class WebViewActivity : EhActivity() {
    private var webView: WebView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val url = intent.extras?.getString(KEY_URL) ?: return
        webView = WebView(applicationContext).apply {
            setDefaultSettings()
            webViewClient = object : WebViewClient() {
                override fun onPageFinished(view: WebView, url: String) {
                    val cloudflareBypassed = EhCookieStore.saveFromWebView(url) {
                        it.name == EhCookieStore.KEY_CLOUDFLARE
                    }
                    if (cloudflareBypassed) {
                        finish()
                    }
                }
            }
        }
        setContentView(webView)
        EhCookieStore.loadForWebView(url) {
            it.name != EhCookieStore.KEY_CLOUDFLARE
        }
        webView!!.loadUrl(url)
    }

    override fun onDestroy() {
        super.onDestroy()
        webView?.destroy()
        webView = null
    }

    companion object {
        const val KEY_URL = "url"

        fun newIntent(context: Context, url: String): Intent = Intent(context, WebViewActivity::class.java).apply {
            putExtra(KEY_URL, url)
        }
    }
}
package com.hippo.ehviewer.util

import android.graphics.Typeface
import android.text.Spanned
import android.text.style.CharacterStyle
import android.text.style.ImageSpan
import android.text.style.StrikethroughSpan
import android.text.style.StyleSpan
import android.text.style.URLSpan
import android.text.style.UnderlineSpan

fun Spanned.toBBCode(): String {
    val text = this
    tailrec fun StringBuilder.processOneSpanTransition(cur: Int = 0) {
        val next = nextSpanTransition(cur, text.length, CharacterStyle::class.java)
        getSpans(cur, next, CharacterStyle::class.java).forEach {
            when (it) {
                is StyleSpan -> {
                    val s = it.style
                    if (s and Typeface.BOLD != 0) {
                        append("[b]")
                    }
                    if (s and Typeface.ITALIC != 0) {
                        append("[i]")
                    }
                }

                is UnderlineSpan -> append("[u]")
                is StrikethroughSpan -> append("[s]")
                is URLSpan -> {
                    append("[url=")
                    append(it.url)
                    append("]")
                }

                is ImageSpan -> {
                    append("[img]")
                    append(it.source)
                    append("[/img]")
                }
            }
        }
        append(text.subSequence(cur, next))
        getSpans(cur, next, CharacterStyle::class.java).reversed().forEach {
            when (it) {
                is StyleSpan -> {
                    val s = it.style
                    if (s and Typeface.BOLD != 0) {
                        append("[/b]")
                    }


M4 15h22M4 23h22'/></svg>
        <input id="togglestate" type="checkbox" aria-hidden="true" tabindex="-1">

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-in-left" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M10 3.5a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 1 1 0v2A1.5 1.5 0 0 1 9.5 14h-8A1.5 1.5 0 0 1 0 12.5v-9A1.5 1.5 0 0 1 1.5 2h8A1.5 1.5 0 0 1 11 3.5v2a.5.5 0 0 1-1 0v-2z"/>
  <path fill-rule="evenodd" d="M4.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H14.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3z"/>
</svg>                 corems.molecular_id.factory

            <input type="search" placeholder="Search..." role="searchbox" aria-label="search"
                   pattern=".+" required>

API Documentation

                    profiled

                    insert_database_worker

                    MolecularCombinations

                                MolecularCombinations

                                cProfile_worker

                                check_database_get_class_list

                                get_carbonsHydrogens

                                add_carbonsHydrogens

                                runworker

                                get_classes_in_order

                                sort_classes

                                get_fixed_


ODS.food_expires(context) then
			if to_big(card.ability.sell_val) > to_big(0) then
				return {
					message = localize('k_val_down'),
					colour = G.C.MONEY,
					card = card
				}
			else
				check_for_unlock({ type = "expire_fantabulous" })
				G.E_MANAGER:add_event(Event({
					func = function()
						play_sound('tarot1')
						card.T.r = -0.2
						card:juice_up(0.3, 0.4)
						card.states.drag.is = true
						card.children.center.pinch.x = true
						G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
							 func = function()
								 G.jokers:remove_card(card)
								 card:remove()
								 card = nil
								 return true
							 end
						}))
						return true
					end
				}))
				return {
					message = localize('k_worthless_ex'),
					colour = G.C.MONEY
				}
			end
		end

	end
end

return jokerInfo


d);
        quit(2);
    }

    /* Let the audio run */
    SDL_PauseAudioDevice(device, SDL_FALSE);
}

static void
reopen_audio()
{
    close_audio();
    open_audio();
}

void SDLCALL
fillerup(void *unused, Uint8 *stream, int len)
{
    Uint8 *waveptr;
    int waveleft;

    /* Set up the pointers */
    waveptr = wave.sound + wave.soundpos;
    waveleft = wave.soundlen - wave.soundpos;

    /* Go! */
    while (waveleft <= len) {
        SDL_memcpy(stream, waveptr, waveleft);
        stream += waveleft;
        len -= waveleft;
        waveptr = wave.sound;
        waveleft = wave.soundlen;
        wave.soundpos = 0;
    }
    SDL_memcpy(stream, waveptr, len);
    wave.soundpos += len;
}

void
UserLoggedIn(XUserHandle user)
{
    HRESULT hr;
    char gamertag[128];
    hr = XUserGetGamertag(user, XUserGamertagComponent::UniqueModern, sizeof(gamertag), gamertag, NULL);

    if (SUCCEEDED(hr)) {
        SDL_Log("User logged in: %s", gamertag);
    } else {
        SDL_Log("[GDK] UserLoggedIn -- XUserGetGamertag failed: 0x%08x.", hr);
    }

    XUserCloseHandle(user);
}

void
AddUserUICallback(XAsyncBlock *asyncBlock)
{
    HRESULT hr;
    XUserHandle user = NULL;

    hr = XUserAddResult(asyncBlock, &user);
    if (SUCCEEDED(hr)) {
        uint64_t userId;

        hr = XUserGetId(user, &userId);
        if (FAILED(hr)) {
            /* If unable to get the user ID, it means the account is banned, etc. */
            SDL_Log("[GDK] AddUserSilentCallback -- XUserGetId failed: 0x%08x.", hr);
            XUserCloseHandle(user);

            /* Per the docs, likely should call XUserResolveIssueWithUiAsync here. */
        } else {
            UserLoggedIn(user);
        }
    } else {
        SDL_Log("[GDK] AddUserUICallback -- XUserAddAsync failed: 0x%08x.", hr);
    }

    delete asyncBlock;
}

void
AddUserUI()
{
    HRESULT hr;
    XAsyncBlock *asyncBlock = new XAsyncBlock;

    asyncBlock->context = NULL;
    asyncBlock->queue = NULL; /* A null queue will use the global process task queue */
    asyncBlock->callback = &AddUserUICallback;

    hr = XUserAddAsync(XUserAddOptions::None, asyncBlock);

    if (FAILED(hr)) {
        delete asyncBlock;
        SDL_Log("[GDK] AddUserSilent -- failed: 0x%08x", hr);
    }
}

void
AddUserSilentCallback(XAsyncBlock *asyncBlock)
{
    HRESULT hr;
    XUserHandle user = NULL;

    hr = XUserAddResult(asyncBlock, &user);
    if (SUCCEEDED(hr)) {
        uint64_t userId;

        hr = XUserGetId(user, &userId);
        if (FAILED(hr)) {
            /* If unable to get the user ID, it means the account is banned, etc. */
            SDL_Log("[GDK] AddUserSilentCallback -- XUserGetId failed: 0x%08x. Trying with UI.", hr);
            XUserCloseHandle(user);
            AddUserUI();
        } else {
            UserLoggedIn(user);
        }
    } else {
        SDL_Log("[GDK] AddUserSilentCallback -- XUserAddAsync failed: 0x%08x. Trying with UI.", hr);
        AddUserUI();
    }

    delete asyncBlock;
}

void
AddUserSilent()
{
    HRESULT hr;
    XAsyncBlock *asyncBlock = new XAsyncBlock;


3455, -63.692448125, 2, 6,
"BOL 800.XX", -10.970976, -66.093857250, 2, 6,
"BOL 900.XX", -10.782976, -65.396057250, 2, 6,
"BOL B00.XX", -18.406876, -66.612826625, 3, 5,
"BOL C00.XX", -22.055476, -65.642343500, 2, 6,
"BOL D00.XX", -19.990976, -63.567778125, 2, 4,
"BOL F00.XX", -22.693376, -64.379969250, 2, 6,
"BOL G00.XX", -21.399276, -65.763617750, 2, 4,
"BOL H00.XX", -10.979976, -68.796157250, 2, 9,
"BOL J00.XX", -16.335276, -61.009174125, 2, 6,
"BOL K00.XX", -17.482576, -63.204900875, 3, 5,
"BOL L00.XX", -14.819576, -66.785735500, 3, 5,
"BOL M00.XX", -21.259325, -63.505658750, 2, 4,
"BOL N00.XX", -18.249276, -66.882713750, 3, 5,
"BOL P00.XX", -17.395455, -63.910114375, 3, 5,
"BOL Q00.XX", -17.526595, -65.901093375, 3, 5,
"BOL R00.XX", -17.076076, -63.271388000, 3, 5,
"BOL S00.XX", -13.698876, -65.466109750, 2, 6,
"BOL T00.XX", -15.851376, -63.227061250, 2, 4,
"BOL V00.XX", -15.795876, -67.601461250, 3, 5,
"BOL W00.XX", -17.960376, -63.433713750, 3, 5,
"BOL X00.XX", -18.936276, -57.843539500, 2, 6,
"BOL Y00.XX", -17.319276, -63.442600875, 3, 5,
"BOL Z00.XX", -20.419276, -66.873278125, 2, 4,
"BOL 123.XXX", -17.0444545, -65.034557500, 2, 4,
"BOL 12.XXXX", -17.236508, -67.766496000, 2, 4,
"BOL 1234.XX", -14.488357, -68.651827000, 2, 4,
"BOL 1234.XXX", -10.5897175, -69.218650000, 1, 8,
"ETH 12.XX", 9.0646175, 38.701477000, 4, 5,
"ETH 12.XXX", 9.132015, 38.613611500, 3, 4,
"ETH 000.XX", 9.616545, 41.776128125, 2, 4,
"ETH 100.XX", 13.548924, 39.438990250, 3, 4,
"ETH 200.XX", 8.586024, 39.231068500, 3, 4,
"ETH 300.XX", 11.633824, 37.345929875, 3, 6,
"ETH 400.XX", 12.631724, 37.411616000, 3, 6,
"ETH 500.XX", 11.172424, 39.603229875, 3, 4,
"ETH 600.XX", 7.091845, 38.455621875, 3, 4,
"ETH 700.XX", 7.713024, 36.799781375, 2, 3,
"ETH 800.XX", 9.350424


.8.10").unwrap();
    /// ```
    pub fn mocked(settings: &MockProjectSettings, version: impl AsRef<str>) -> Result<Self> {
        let mut tmp = Self::dapptools()?;
        let gen = MockProjectGenerator::new(settings);
        tmp.mock(&gen, version)?;
        let remappings = gen.remappings_at(tmp.root());
        tmp.paths_mut().remappings.extend(remappings);
        Ok(tmp)
    }

    /// Create a new temporary project and populate it with a random layout
    ///
    /// ```no_run
    /// use ethers_solc::project_util::TempProject;
    /// let tmp = TempProject::mocked_random("^0.8.10").unwrap();
    /// ```
    ///
    /// This is a convenience function for:
    ///
    /// ```no_run
    /// use ethers_solc::project_util::mock::MockProjectSettings;
    /// use ethers_solc::project_util::TempProject;
    /// let tmp = TempProject::mocked(&MockProjectSettings::random(), "^0.8.10").unwrap();
    /// ```
    pub fn mocked_random(version: impl AsRef<str>) -> Result<Self> {
        Self::mocked(&MockProjectSettings::random(), version)
    }
}

impl<T: ArtifactOutput> AsRef<Project<T>> for TempProject<T> {
    fn as_ref(&self) -> &Project<T> {
        self.project()
    }
}

/// The cache file and all the artifacts it references
#[derive(Debug, Clone)]
pub struct ArtifactsSnapshot<T> {
    pub cache: SolFilesCache,
    pub artifacts: Artifacts<T>,
}

impl ArtifactsSnapshot<ConfigurableContractArtifact> {
    /// Ensures that all artifacts have abi, bytecode, deployedbytecode
    pub fn assert_artifacts_essentials_present(&self) {
        for artifact in self.artifacts.artifact_files() {
            let c = artifact.artifact.clone().into_compact_contract();
            assert!(c.abi.is_some());
            assert!(c.bin.is_some());
            assert!(c.bin_runtime.is_some());
        }
    }
}

/// commonly used options for copying entire folders
fn dir_copy_options() -> dir::CopyOptions {
    dir::CopyOptions {
        overwrite: true,
        skip_exist: false,
        buffer_size: 64000, //64kb
        copy_inside: true,
        content_only: true,
        depth: 0,
    }
}

/// commonly used options for copying files
fn file_copy_options() -> file::CopyOptions {
    file::CopyOptions {
        overwrite: true,
        skip_exist: false,
        buffer_size: 64000, //64kb
    }
}

/// Copies a single file into the given dir
pub fn copy_file(source: impl AsRef<Path>, target_dir: impl AsRef<Path>) -> Result<()> {
    let source = source.as_ref();
    let target = target_dir.as_ref().join(
        source
            .file_name()
            .ok_or_else(|| SolcError::msg(format!("No file name for {}", source.display())))?,
    );

    fs_extra::file::copy(source, target, &file_copy_options())?;
    Ok(())
}

/// Copies all content of the source dir into the target dir
pub fn copy_dir(source: impl AsRef<Path>, target_dir: impl AsRef<Path>) -> Result<()> {
    fs_extra::dir::copy(source, target_dir, &dir_copy_options())?;
    Ok(())
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn can_mock_project() {
        let _prj = TempProject::mocked(&Default::default(), "^0.8.11").unwrap();
        let _prj = TempProjec


具有高中毕业或相当于高中毕业的文化水平（在校的高中学生，成绩特别优良，可自己申请，由学校介绍，参加报考）；

   3、身体健康。

   二、招生办法

   为了保证招收新生的质量，在各级党委领导下，贯彻群众路线，根据德、智、体全面衡量，择优录取的原则，实行自愿报名，统一考试，地市初选，学校录取，省、市、自治区批准的办法。

   1、自愿报名。各级领导要积极支持和鼓励优秀青年报名。符合招生条件者，均可向自己所在的单位报名，按学校和学科类别填写二至三个报考志愿。由公社、厂矿、机关、学校等单位按招生条件进行审核，符合条件者，报县（区）招生委员会批准后，参加统一考试。

   2、统一考试。考试的目的主要是了解掌握基础知识的状况和分析问题、解决问题的能力。今年的考试分文理两类。文科考试科目：政治、语文、数学、史地。理科考试科目：政治、语文、数学、理化。报考外语专业的加试外语。由省、市、自治区拟题，县（区）统一组织考试。

   3、地市初选。地（市）招生委员会组织评卷，根据考试成绩提出参加政审、体检的名单，并征求所在单位群众的意见。

   由公社或厂矿、机关、学校的党组织负责政审。主要看本人的政治表现。

   按照现行体检标准，由县（区）统一组织，到指定医院进行体检。

   地（市）招生委员会根据政审、考试和体检的情况提出初选名单（全省的初选总数应为录取总数的二倍或稍多于二倍），并汇总全部材料报省、市、自治区招生委员会。

   4、学校录取，省、市、自治区批准。在省、市、自治区招生委员会领导下，组织招生院校对地（市）上报的初选名单及全部材料进行认真审查，参考本人志愿，德、智、体全


eturn NOTIFY_DONE;
		}
		if (is_hold_key_hold()) {
			if (is_key_matched_for_current_step(code)) {
				increase_count();
			} else {
				reset_count();
				reset_step();
			}
			if (is_reaching_count_for_next_step())
				increase_step();
		}

	} else {
		set_key_state_up(code);
		if (is_hold_key(code)) {
			set_hold_key_hold(KEY_STATE_UP);
			reset_step();
			reset_count();
		}
	}
	return NOTIFY_OK;
}

#ifndef CONFIG_SEC_KEY_NOTIFIER
static struct notifier_block nb_gpio_keys = {
	.notifier_call = check_tsp_crash_keys
};
#else
static struct notifier_block seccmn_tsp_crash_key_notifier = {
	.notifier_call = check_tsp_crash_keys
};
#endif

static int __init sec_tsp_dumpkey_init(void)
{
	/* only work for debug level is low */
//	if (!sec_debug_enter_upload())
#ifndef CONFIG_SEC_KEY_NOTIFIER
	register_gpio_keys_notifier(&nb_gpio_keys);
#else
	sec_kn_register_notifier(&seccmn_tsp_crash_key_notifier,
			__tsp_dump_keys, ARRAY_SIZE(__tsp_dump_keys));
#endif
	return 0;
}

late_initcall(sec_tsp_dumpkey_init);


                                                   const Protobuf::FieldDescriptor& field,
                                                        const Protobuf::Reflection* reflection,
                                                        const validate::FieldRules& rules,
                                                        bool force) {

  if (field.is_repeated()) {
    const validate::RepeatedRules& repeated_rules = rules.repeated();
    std::uint64_t repeat_total64 = static_cast<std::uint64_t>(reflection->FieldSize(msg, &field));
    const bool ignore_empty = repeated_rules.has_ignore_empty() && repeated_rules.ignore_empty();
    if (ignore_empty && repeat_total64 == 0) {
      return;
    }
    if (repeated_rules.has_min_items() && repeated_rules.min_items() > repeat_total64) {
      for (; repeated_rules.min_items() > repeat_total64; ++repeat_total64) {
        const T value{};
        (*reflection.*FIELDADDER)(&msg, &field, value);
      }
    }
    if (repeated_rules.has_max_items() && repeated_rules.max_items() <= repeat_total64) {
      for (; repeat_total64 > repeated_rules.max_items(); --repeat_total64) {
        reflection->RemoveLast(&msg, &field);
      }
    }
    if (repeated_rules.has_unique()) {
      ENVOY_LOG_MISC(debug,
                     "repeated protobuf validation rule 'unique' found, but not supported yet");
    }
    if (repeated_rules.has_items()) {
      const int repeat_total = reflection->FieldSize(msg, &field);
      for (int repeat_cnt = 0; repeat_cnt < repeat_total; ++repeat_cnt) {
        T value = (*reflection.*REPGETTER)(msg, &field, repeat_cnt);
        TYPEHANDLER(value, (repeated_rules.items().*RULEGETTER)());
        (*reflection.*REPSETTER)(&msg, &field, repeat_cnt, value);
      }
    }
  } else {
    if (force || reflection->HasField(msg, &field) ||
        (rules.message().has_required() && rules.message().required()) ||
        ((rules.*RULEGETTER)().IsInitialized())) {
      // Enforce that the msg for the given field follows the validation rules, if
      // - the member is set already, or
      // - needs to be set, but is not, or
      // - there are rules to apply.
      T value = (*reflection.*FIELDGETTER)(msg, &field);
      TYPEHANDLER(value, (rules.*RULEGETTER)());
      (*reflection.*FIELDSETTER)(&msg, &field, value);
    }
  }
}

void ValidatedInputGenerator::onField(Protobuf::Message& msg,
                                      const Protobuf::FieldDescriptor& field,
                                      const absl::Span<const Protobuf::Message* const> parents) {
  onField(msg, field, parents, false, false);
}

void ValidatedInputGenerator::onField(Protobuf::Message& msg,
                                      const Protobuf::FieldDescriptor& field,
                                      const absl::Span<const Protobuf::Message* const> parents,
                                      bool force_create, bool cut_off) {
  const Protobuf::Reflection* reflection = msg.GetReflection();

  if (!field.options().HasExtension(validate::rules) && !force_create) {
    return;
  }
  const validate::FieldRules& rules = field.options().GetExtension(validate::rules);
  if (rules.message().has_skip() && rules.message().skip()) {
    return;
  }

  switch (field.cpp_type()) {
  case Protobuf::FieldDescriptor::CPPTYPE_INT32: {
    handleIntrinsicTypedField<
        std::int32_t, &Protobuf::Reflection::GetInt32, &Protobuf::Reflection::SetInt32,
        &Protobuf::Reflection::GetRepeatedInt32,


/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */

#ifndef __LIMA_GEM_H__
#define __LIMA_GEM_H__

#include <drm/drm_gem_shmem_helper.h>

struct lima_submit;
struct lima_vm;

struct lima_bo {
	struct drm_gem_shmem_object base;

	struct mutex lock;
	struct list_head va;

	size_t heap_size;
};

static inline struct lima_bo *
to_lima_bo(struct drm_gem_object *obj)
{
	return container_of(to_drm_gem_shmem_obj(obj), struct lima_bo, base);
}

static inline size_t lima_bo_size(struct lima_bo *bo)
{
	return bo->base.base.size;
}

static inline struct dma_resv *lima_bo_resv(struct lima_bo *bo)
{
	return bo->base.base.resv;
}

int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm);
struct drm_gem_object *lima_gem_create_object(struct drm_device *dev, size_t size);
int lima_gem_create_handle(struct drm_device *dev, struct drm_file *file,
			   u32 size, u32 flags, u32 *handle);
int lima_gem_get_info(struct drm_file *file, u32 handle, u32 *va, u64 *offset);
int lima_gem_submit(struct drm_file *file, struct lima_submit *submit);
int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns);

void lima_set_vma_flags(struct vm_area_struct *vma);

#endif


/*
 * DAWN OF LIGHT - The first free open source DAoC server emulator
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */

using System;
using System.Collections.Generic;
using DOL.Database;
using DOL.Events;
using DOL.GS.Spells;

namespace DOL.GS.Effects
{

    public class BoilingCauldronEffect : TimedEffect
    {
        // Parameters
        private const int cauldronModel = 2947; 		// Model to use for cauldron
        private const int cauldronLevel = 50;			// Cauldron level
        private const string cauldronName = "Cauldron";	// Name of cauldron
        private const int spellDamage = 650;			// Damage inflicted
        private const ushort spellRadius = 350;			// Spell radius

        // Objects
        private GamePlayer EffectOwner;				// Effect owner
        private GameStaticItem Cauldron;					// The cauldron

        public BoilingCauldronEffect()
            : base(RealmAbilities.BoilingCauldronAbility.DURATION)
        { }

        public override void Start(GameLiving target)
        {
            base.Start(target);
            if (target is GamePlayer)
            {
                EffectOwner = target as GamePlayer;
                foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    p.Out.SendSpellEffectAnimation(EffectOwner, EffectOwner, 7086, 0, false, 1);
                }
                SummonCauldron();
                GameEventMgr.AddHandler(EffectOwner, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
            }
        }
        public override void Stop()


s: Vector3, angle: number): Matrix {
        var s = Math.sin(-angle);
        var c = Math.cos(-angle);
        var c1 = 1 - c;
        axis.normalize();
        var result = Matrix.Zero();
        result.m[0] = (axis.x * axis.x) * c1 + c;
        result.m[1] = (axis.x * axis.y) * c1 - (axis.z * s);
        result.m[2] = (axis.x * axis.z) * c1 + (axis.y * s);
        result.m[3] = 0.0;
        result.m[4] = (axis.y * axis.x) * c1 + (axis.z * s);
        result.m[5] = (axis.y * axis.y) * c1 + c;
        result.m[6] = (axis.y * axis.z) * c1 - (axis.x * s);
        result.m[7] = 0.0;
        result.m[8] = (axis.z * axis.x) * c1 - (axis.y * s);
        result.m[9] = (axis.z * axis.y) * c1 + (axis.x * s);
        result.m[10] = (axis.z * axis.z) * c1 + c;
        result.m[11] = 0.0;
        result.m[15] = 1.0;
        return result;
    }
    static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix {
        return Matrix.RotationZ(roll).multiply(Matrix.RotationX(pitch)).multiply(Matrix.RotationY(yaw));
    }
    static Scaling(x: number, y: number, z: number): Matrix {
        return new Matrix([
            x, 0, 0, 0,
            0, y, 0, 0,
            0, 0, z, 0,
            0, 0, 0, 1
        ]);
    }
    static Translation(x: number, y: number, z: number): Matrix {
        return new Matrix([
            1, 0, 0, 0,
            0, 1, 0, 0,
            0, 0, 1, 0,
            x, y, z, 1
        ]);
    }
    static MultiplyInPlace(dst: Matrix, a: Matrix, b: Matrix): void {
        dst.m[ 0] = a.m[ 0] * b.m[0] + a.m[ 1] * b.m[4] + a.m[ 2] * b.m[ 8] + a.m[ 3] * b.m[12];
        dst.m[ 1] = a.m[ 0] * b.m[1] + a.m[ 1] * b.m[5] + a.m[ 2] * b.m[ 9] + a.m[ 3] * b.m[13];
        dst.m[ 2] = a.m[ 0] * b.m[2] + a.m[ 1] * b.m[6] + a.m[ 2] * b.m[10] + a.m[ 3] * b.m[14];
        dst.m[ 3] = a.m[ 0] * b.m[3] + a.m[ 1] * b.m[7] + a.m[ 2] * b.m[11] + a.m[ 3] * b.m[15];
        dst.m[ 4] = a.m[ 4] * b.m[0] + a.m[ 5] * b.m[4] + a.m[ 6] * b.m[ 8] + a.m[ 7] * b.m[12];
        dst.m[ 5] = a.m[ 4] * b.m[1] + a.m[ 5] * b.m[5] + a.m[ 6] * b.m[ 9] + a.m[ 7] * b.m[13];
        dst.m[ 6] = a.m[ 4] * b.m[2] + a.m[ 5] * b.m[6] + a.m[ 6] * b.m[10] + a.m[ 7] * b.m[14];
        dst.m[ 7] = a.m[ 4] * b.m[3] + a.m[ 5] * b.m[7] + a.m[ 6] *


AllowUnexported(SMAsteriskEvent{})); diff != "" {
		t.Errorf("handleChannelDestroyed modified SMAsteriskEvent unexpectedly (-want +got): \n%s", diff)
	}
}

func TestAstAgentV1WarnDisconnect(t *testing.T) {
	tAsteriskAgent := &AsteriskAgent{}
	tMap := map[string]any{}
	tString := ""
	err := tAsteriskAgent.V1WarnDisconnect(nil, tMap, &tString)
	if err != utils.ErrNotImplemented {
		t.Errorf("Expected error: %v, got: %v", utils.ErrNotImplemented, err)
	}
}

func TestAsteriskAgentV1DisconnectPeer(t *testing.T) {
	tAsteriskAgent := &AsteriskAgent{}
	tDPRArgs := &utils.DPRArgs{}
	tString := ""
	err := tAsteriskAgent.V1DisconnectPeer(nil, tDPRArgs, &tString)
	if err != utils.ErrNotImplemented {
		t.Errorf("Expected error: %v, got: %v", utils.ErrNotImplemented, err)
	}
}

func TestAsteriskAgentV1AlterSession(t *testing.T) {
	tAsteriskAgent := &AsteriskAgent{}
	tCGREvent := utils.CGREvent{}
	tString := ""
	err := tAsteriskAgent.V1AlterSession(nil, tCGREvent, &tString)
	if err != utils.ErrNotImplemented {
		t.Errorf("Expected error: %v, got: %v", utils.ErrNotImplemented, err)
	}
}

func TestHandleChannelDestroyedCases(t *testing.T) {
	cfg := config.NewDefaultCGRConfig()
	internalSessionSChan := make(chan birpc.ClientConnector, 1)
	cM := engine.NewConnManager(cfg, map[string]chan context.ClientConnector{
		utils.ConcatenatedKey(rpcclient.BiRPCInternal, utils.MetaSessionS): internalSessionSChan,
	})
	sma, err := NewAsteriskAgent(cfg, 1, cM)
	if err != nil {
		t.Error(err)
	}

	utils.Logger.SetLogLevel(4)
	utils.Logger.SetSyslog(nil)

	t.Cleanup(func() {
		utils.Logger.SetLogLevel(0)
		log.SetOutput(os.Stderr)
	})

	testCases := []struct {
		name   string
		ariEv  map[string]any
		expLog string
	}{
		{
			name:   "Missing Channel",
			ariEv:  map[string]any{},
			expLog: "<AsteriskAgent> missing or invalid 'channel' field in event: {}",
		},
		{
			name:   "Invalid Channel",
			ariEv:  map[string]any{"channel": "invalid"},
			expLog: `<AsteriskAgent> missing or invalid 'channel' field in event: {"channel":"invalid"}`,
		},
		{
			name:   "Missing ChannelVars",
			ariEv:  map[string]any{"channel": map[string]any{"channel": "1"}},
			expLog: `<AsteriskAgent> missing or invalid 'channelvars' field in 'channel': {"channel":"1"}`,
		},
		{
			name:   "Invalid ChannelVars",
			ariEv:  map[string]any{"channel": map[string]any{"channelvars": "invalid"}},
			expLog: `<AsteriskAgent> missing or invalid 'channelvars' field in 'channel': {"channelvars":"invalid"}`,
		},
		{
			name:   "Valid ChannelVars",
			ariEv:  map[string]any{"channel": map[string]any{"channelvars": map[string]any{utils.CGRReqType: "test type"}}},
			expLog: "",
		},
	}
	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			buf := &bytes.Buffer{}
			log.SetOutput(buf)
			ev := NewSMAste


return kt->cpus;

	STRUCT_SIZE_INIT(ppc64_paca, "paca_struct");
	data_offset = MEMBER_OFFSET("paca_struct", "data_offset");

	cpu_paca_buf = GETBUF(SIZE(ppc64_paca));

	if (!(nr_paca = get_array_length("paca", NULL, 0)))
		nr_paca = (kt->kernel_NR_CPUS ? kt->kernel_NR_CPUS : NR_CPUS);

	if (nr_paca > NR_CPUS) {
		error(WARNING,
			"PPC64: Number of paca entries (%d) greater than NR_CPUS (%d)\n",
			nr_paca, NR_CPUS);
		error(FATAL, "Recompile crash with larger NR_CPUS\n");
	}

	for (i = cpus = 0; i < nr_paca; i++) {
		/*
		 * CPU present or online or can exist in the system(possible)?
		 */
		if (!in_cpu_map(map, i))
			continue;

		readmem(paca + (i * SIZE(ppc64_paca)),
             		KVADDR, cpu_paca_buf, SIZE(ppc64_paca),
			"paca entry", FAULT_ON_ERROR);

		kt->__per_cpu_offset[i] = ULONG(cpu_paca_buf + data_offset);
		kt->flags |= PER_CPU_OFF;
		cpus++;
	}
	return cpus;
}

static int
ppc64_get_cpu_map(void)
{
	int map;

	if (cpu_map_addr("possible"))
		map = POSSIBLE_MAP;
	else if (cpu_map_addr("present"))
		map = PRESENT_MAP;
	else if (cpu_map_addr("online"))
		map = ONLINE_MAP;
	else if (cpu_map_addr("active"))
		map = ACTIVE_MAP;
	else {
		map = 0;
		error(FATAL,
			"PPC64: cannot find 'cpu_possible_map', "
			"'cpu_present_map', 'cpu_online_map' or 'cpu_active_map' symbols\n");
	}
	return map;
}

/*
 *  Updating any smp-related items that were possibly bypassed
 *  or improperly initialized in kernel_init().
 */
static void
ppc64_init_cpu_info(void)
{
	int i, map, cpus, nr_cpus;

	map = ppc64_get_cpu_map();
	/*
	 * starting from v2.6.36 we can not rely on paca structure to get
	 * per cpu data_offset. The upstream commit fc53b420 overwrites
	 * the paca pointer variable to point to static paca that contains
	 * valid data_offset only for crashing cpu.
	 *
	 * But the kernel v2.6.36 ppc64 introduces __per_cpu_offset symbol
	 * which was removed post v2.6.15 ppc64 and now we get the per cpu
	 * data_offset from __per_cpu_offset symbol during kernel_init()
	 * call. Hence for backward (pre-2.6.36) compatibility, call
	 * ppc64_paca_percpu_offset_init() only if symbol __per_cpu_offset
	 * does not exist.
	 */
	if (!symbol_exists("__per_cpu_offset"))
		cpus = ppc64_paca_percpu_offset_init(map);
	else {
		if (!(nr_cpus = get_array_length("__per_cpu_offset", NULL, 0)))
			nr_cpus = (kt->kernel_NR_CPUS ? kt->kernel_NR_CPUS :
							NR_CPUS);
		for (i = cpus = 0; i < nr_cpus; i++) {
			if (!in_cpu_map(map, i))
				continue;
			cpus++;
		}
	}
	switch (map)
	{
	case POSSIBLE_MAP:
		if (cpus > kt->cpus) {
			i = get_highest_cpu_online() + 1;
			if (i > kt->cpus)
				kt->cpus = i;
		}
		break;
	case ONLINE_MAP:
	case PRESENT_MAP:
		kt->cpus = cpus;
		break;
	}
	if (kt->cpus > 1)
		kt->flags |= SMP;
}

void
ppc64_clear_machdep_cache(void)
{
	if (machdep->last_pgd_read != vt->kernel_pgd[0])
		machdep->last_pgd_read = 0;
}

static int
ppc64_get_kvaddr_ranges(struct vaddr_range *vrp)
{
	int cnt;
	physaddr_t phys1, phys2;
	ulong pp1, pp2;

	cnt = 0;

	vrp[cnt].type = KVADDR_UNITY_MAP;
	vrp[cnt].start = machdep->kvbase;
	vrp[cnt++].end = vt->high_memory;

	vrp[cnt].type = KVADDR_VMALLOC;
	vrp[cnt].start = first_vmalloc_address();
	vrp[cnt++].end = last_vmalloc_address();

	if (machdep->flags & VMEMMAP) {
 		phys1 = (physaddr_t)(0);
		phys2 = (physaddr_t)VTOP((vt->high_memory - PAGESIZE()));
		if (phys_to_page(phys1, &pp1) &&
	    	    phys_to_page(phys2, &pp2)) {
			vrp[cnt].type = KVADDR_VMEMMAP;
			vrp[cnt].start = pp1;
			vrp[cnt++].end = pp2;
		}
	}

	return cnt;
}
#endif /* PPC64 */


/* Copyright (c) 2015-2024, EPFL/Blue Brain Project
 * All rights reserved. Do not distribute without permission.
 *
 * Responsible Author: adrien.fleury@epfl.ch
 *
 * This file is part of Brayns <https://github.com/BlueBrain/Brayns>
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License version 3.0 as published
 * by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#pragma once

#include "ISocketListener.h"

namespace brayns
{
/**
 * @brief Helper class to manage exchange through a websocket.
 *
 */
class SocketManager
{
public:
    /**
     * @brief Construct a manager with given listener.
     *
     * @param listener Listener to call on network events.
     */
    explicit SocketManager(std::unique_ptr<ISocketListener> listener);

    /**
     * @brief Receive and send messages until connection is closed.
     *
     * Events are buffered and will be passed to listener when poll() is called.
     *
     * @param client Client ref.
     */
    void run(const ClientRef &client);

private:
    std::unique_ptr<ISocketListener> _listener;
};
} // namespace brayns


输出目录，用于保存截图和分析结果
        sample_interval: 采样间隔（帧数），默认每30帧采样一次

    返回:
        包含时间戳和人脸数量的字典列表
    """
    # 确保输出目录存在
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    # 初始化视频捕获
    cap = cv2.VideoCapture(video_path)
    if not cap.isOpened():
        print(f"无法打开视频: {video_path}")
        return []

    # 获取视频信息
    fps = cap.get(cv2.CAP_PROP_FPS)
    frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
    duration = frame_count / fps if fps > 0 else 0

    print(f"视频信息: {frame_count} 帧, {fps:.2f} FPS, 时长 {duration:.2f} 秒")

    # 加载人脸检测器
    face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')

    # 初始化结果列表
    results = []
    frame_idx = 0

    # 创建进度条
    pbar = tqdm(total=frame_count)

    while cap.isOpened():
        ret, frame = cap.read()
        if not ret:
            break

        frame_idx += 1
        pbar.update(1)

        # 按指定间隔采样
        if frame_idx % sample_interval != 0:
            continue

        # 计算当前时间点
        time_sec = frame_idx / fps if fps > 0 else 0
        time_str = str(datetime.timedelta(seconds=int(time_sec)))

        # 转换为灰度图
        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

        # 检测人脸
        faces = face_cascade.detectMultiScale(gray, 1.3, 5)
        face_count = len(faces)

        # 记录结果
        result = {
            "frame": frame_idx,
            "time": time_str,
            "time_seconds": time_sec,
            "face_count": face_count
        }
        results.append(result)

        # 在画面上标记人脸
        for (x, y, w, h) in faces:
            cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)

        # 添加时间和人脸数量信息
        # cv2.putText(frame, f"时间: {time_str}", (10, 30),
        #             cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
        cv2.putText(frame, f"Reco {face_count} Faces", (10, 60),
                    cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)

        # 每检测到人脸时保存截图
        if face_count > 0:
            filename = os.path.join(output_dir, f"frame_{frame_idx}_faces_{face_count}.jpg")
            cv2.imwrite(filename, frame)
            print(f"[{time_str}] 检测到 {face_count} 个人脸，已保存到 {filename}")

    # 关闭进度条
    pbar.close()

    # 释放资源
    cap.release()

    # 输出统计信息
    if results:
        max_faces = max(results, key=lambda x: x["face_count"])
        print(f"分析完成! 视频中最多同时出现 {max_faces['face_count']} 个人脸，出现在 {max_faces['time']}")

        # 计算平均人脸数
        total_faces = sum(r["face_count"] for r in results)
        avg_faces = total_faces / len(results) if results else 0
        print(f"平均每帧检测到 {avg_faces:.2f} 个人脸")
    else:
        print("未检测到任何人脸")

    print(f"视频分析完成，结果保存在 {output_dir} 目录")
    return results

def detect_persons_in_images(input_dir, output_dir="detected_persons_images"):
    """
    检测多张图片中的人体并标注

    参数:
        input_dir: 输入图片目录或图片路径列表
        output_dir: 输出标注后图片的目录

    返回:
        标注后的图片保存路径列表
    """
    # 确保输出目录存在
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    # 加载HOG人体检测器
    hog = cv2.HOGDescriptor()
    hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())

    # 处理输入路径
    if isinstance(input_dir, str):
        if os.path.isdir(input_dir):
            image_paths = glob.glob(os.path.join(input_dir, "*.jpg")) + \
                         glob.glob(os.path.join(input_dir, "*.jpeg")) + \
                         glob.glob(os.path.join(input_dir, "*.png"))
        else:
            image_paths = [input_dir]
    else:
        image_paths = input_dir

    output_paths = []

    print(f"开始处理 {len(image_paths)} 张图片...")

    # 遍历处理每张图片
    for img_path in tqdm(image_paths):
        # 读取图片
        img = cv2.imread(img_path)
        if img is None:
            print(f"无法读取图片: {img_path}")
            continue

        # 调整图像大小以提高检测速度和准确性
        height, width = img.shape[:2]
        if width > 800:
            scale = 800 / width
            img = cv2.resize(img, (int(width * scale), int(height * scale)))

        # 检测人体
        # 使用HOG检测器检测人体
        # winStride - 步长，padding - 填充，scale - 缩放比例
        boxes, weights = hog.detectMultiScale(img, winStride=(8, 8), padding=(4, 4), scale=1.05)

        # 在图片上标记人体
        for (x, y, w, h) in boxes:
            cv2.rectangle(img, (x, y), (x+w, y+h), (0, 255, 0), 2)


dth:100%}body.yui-skin-sam.masked .yui-panel-container.yui-dialog.yui-simple-dialog.shadow[id="container_pbss_date_start_trigger_c"]{z-index:103200}body.yui-skin-sam.masked .yui-panel-container.yui-dialog.yui-simple-dialog.shadow[id="container_pbss_date_end_trigger_c"]{z-index:103200}body.yui-skin-sam.masked .yui-panel-container.yui-dialog.yui-simple-dialog.shadow[id="container_mypbss_date_start_trigger_c"]{z-index:103200}body.yui-skin-sam.masked .yui-panel-container.yui-dialog.yui-simple-dialog.shadow[id="container_mypbss_date_end_trigger_c"]{z-index:103200}@media (max-width:750px){#EditView table.dcQuickEdit{display:block;float:left}#EditView table.dcQuickEdit tr{display:block;float:left}#EditView table.dcQuickEdit tr td{display:block;float:left}#EditView table.dcQuickEdit tr td[align="right"] table{display:block;float:left}#EditView table.dcQuickEdit tr td[align="right"] table tr{display:block;float:left}#EditView table.dcQuickEdit tr td[align="right"] table tr td.paginationWrapper{display:block;float:left}#EditView table.dcQuickEdit tr td[align="right"] table tr td.paginationWrapper span.pagination{float:right}}div.content div.pagecontent form#EditView div.edit.view table tbody tr td{padding-top:5px;padding-bottom:5px}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span{display:block;float:none}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="text"]{width:90%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[name="filter_domain"]{width:90%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[name="email_num_autoreplies_24_hours"]{width:90%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="text"][name="mailbox"]#mailbox{width:70%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="text"][name="trashFolder"]#trashFolder{width:70%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="text"][name="sentFolder"]#sentFolder{width:70%}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="button"]#subscribeFolderButton.button{width:18%;min-width:71px}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="button"]#trashFolderButton.button{width:18%;min-width:71px}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input[type="button"]#sentFolderButton.button{width:18%;min-width:71px}div.content div.pagecontent form#EditView div.edit.view table tbody tr td span input.button{color:white}div.content div.pagecontent form#Edit


<GPostsData_posts?>? posts;

  factory _$GPostsData([void Function(GPostsDataBuilder)? updates]) =>
      (GPostsDataBuilder()..update(updates))._build();

  _$GPostsData._({required this.G__typename, this.posts}) : super._();
  @override
  GPostsData rebuild(void Function(GPostsDataBuilder) updates) =>
      (toBuilder()..update(updates)).build();

  @override
  GPostsDataBuilder toBuilder() => GPostsDataBuilder()..replace(this);

  @override
  bool operator ==(Object other) {
    if (identical(other, this)) return true;
    return other is GPostsData &&
        G__typename == other.G__typename &&
        posts == other.posts;
  }

  @override
  int get hashCode {
    var _$hash = 0;
    _$hash = $jc(_$hash, G__typename.hashCode);
    _$hash = $jc(_$hash, posts.hashCode);
    _$hash = $jf(_$hash);
    return _$hash;
  }

  @override
  String toString() {
    return (newBuiltValueToStringHelper(r'GPostsData')
          ..add('G__typename', G__typename)
          ..add('posts', posts))
        .toString();
  }
}

class GPostsDataBuilder implements Builder<GPostsData, GPostsDataBuilder> {
  _$GPostsData? _$v;

  String? _G__typename;
  String? get G__typename => _$this._G__typename;
  set G__typename(String? G__typename) => _$this._G__typename = G__typename;

  ListBuilder<GPostsData_posts?>? _posts;
  ListBuilder<GPostsData_posts?> get posts =>
      _$this._posts ??= ListBuilder<GPostsData_posts?>();
  set posts(ListBuilder<GPostsData_posts?>? posts) => _$this._posts = posts;

  GPostsDataBuilder() {
    GPostsData._initializeBuilder(this);
  }

  GPostsDataBuilder get _$this {
    final $v = _$v;
    if ($v != null) {
      _G__typename = $v.G__typename;
      _posts = $v.posts?.toBuilder();
      _$v = null;
    }
    return this;
  }

  @override
  void replace(GPostsData other) {
    _$v = other as _$GPostsData;
  }

  @override
  void update(void Function(GPostsDataBuilder)? updates) {
    if (updates != null) updates(this);
  }

  @override
  GPostsData build() => _build();

  _$GPostsData _build() {
    _$GPostsData _$result;
    try {
      _$result = _$v ??
          _$GPostsData._(
            G__typename: BuiltValueNullFieldError.checkNotNull(
                G__typename, r'GPostsData', 'G__typename'),
            posts: _posts?.build(),
          );
    } catch (_) {
      late String _$failedField;
      try {
        _$failedField = 'posts';
        _posts?.build();
      } catch (e) {
        throw BuiltValueNestedFieldError(
            r'GPostsData', _$failedField, e.toString());
      }
      rethrow;
    }
    replace(_$result);
    return _$result;
  }
}

class _$GPostsData_posts extends GPostsData_posts {
  @override
  final String G__typename;
  @override
  final String id;
  @override
  final GPostsData_posts_isFavorited? isFavorited;
  @override
  final GPostsData_posts_isLiked? isLiked;

  factory _$GPostsData_posts(
          [void Function(GPostsData_postsB


"""
Write a function to remove tuples from the given tuple.
assert remove_nested((1, 5, 7, (4, 6), 10)) == (1, 5, 7, 10)
"""

def remove_nested(tup):
    """
    >>> remove_nested((1, 5, 7, (4, 6), 10))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5, 7, (4, 6), 10, (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2, 3)))
    (1, 5, 7, 10)
    >>> remove_nested((1, 5,


                    *tree);

int X509_policy_level_node_count(X509_POLICY_LEVEL *level);

X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level,
                                              int i);

const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);

STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
                                                           X509_POLICY_NODE
                                                           *node);
const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
                                                     *node);

#ifdef  __cplusplus
}
#endif
#endif


      ok, err = sock:setoption("tcp-nodelay", true)
        if not ok then
            nlog(warn_fmt("failed to set tcp-nodelay for t1k server %s: %s", server, err))
        end
    end

    return true, nil, sock, server
end

local function do_socket(opts, header, body, extra)
    local ok, err
    local t, sock, server

    ok, err, sock, server = get_socket(opts)
    if not ok then
        err = fmt("failed to get socket: %s", err)
        return ok, err, nil
    end

    ok, err = do_send(sock, { char(TAG_HEAD_WITH_MASK_FIRST), utils.int_to_char_length(header:len()), header })
    if not ok then
        sock:close()
        err = fmt("failed to send header data to t1k server %s: %s", server, err)
        return ok, err, nil
    end

    if body ~= nil then
        ok, err = do_send(sock, { char(consts.TAG_BODY), utils.int_to_char_length(body:len()), body })
        if not ok then
            sock:close()
            err = fmt("failed to send body data to t1k server %s: %s", server, err)
            return ok, err, nil
        end
    end

    ok, err = do_send(sock, { T1K_PROTO_DATA, char(TAG_EXTRA_WITH_MASK_LAST), utils.int_to_char_length(extra:len()), extra })
    if not ok then
        sock:close()
        err = fmt("failed to send extra data to t1k server %s: %s", server, err)
        return ok, err, nil
    end

    ok, err, t = receive_data(sock, server)
    if not ok then
        return ok, err, nil
    end

    ok, err = sock:setkeepalive(opts.keepalive_timeout, opts.keepalive_size)
    if not ok then
        nlog(warn_fmt("failed to set keepalive: %s", err))
        sock:close()
    end

    return true, nil, t
end

function _M.do_request(opts)
    local ok, err
    local header, body, extra, t

    ok, err, header = build_header(opts)
    if not ok then
        return ok, err, nil
    end

    ok, err, body = build_body(opts)
    if not ok then
        return ok, err, nil
    end

    ok, err, extra = build_extra(opts)
    if not ok then
        return ok, err, nil
    end

    ok, err, t = do_socket(opts, header, body, extra)
    if not ok then
        return ok, err, nil
    end

    if opts.mode == consts.MODE_BLOCK then
        local extra_header = t[consts.TAG_EXTRA_HEADER]
        if extra_header then
            ngx.ctx.t1k_extra_header = extra_header
        end
    end

    local result = {
        action = t[consts.TAG_HEAD],
        status = t[consts.TAG_BODY],
        event_id = utils.get_event_id(t[consts.TAG_EXTRA_BODY]),
    }

    return true, nil, result
end

return _M


ation result.
type commitResult struct {
	index      uint64
	result     interface{}
	err        error
	storageErr error
	rpc        *rpcTracker
}

type commitFuture struct {
	ch chan *commitResult
}

func newCommitFuture() *commitFuture {
	return &commitFuture{
		ch: make(chan *commitResult, 1),
	}
}

func (f *commitFuture) Get(ctx context.Context) (cr *commitResult, err error) {
	if f == nil || f.ch == nil {
		err = errors.Wrap(ctx.Err(), "enqueue commit timeout")
		return
	}

	select {
	case <-ctx.Done():
		err = errors.Wrap(ctx.Err(), "get commit result timeout")
		return
	case cr = <-f.ch:
		return
	}
}

func (f *commitFuture) Set(cr *commitResult) {
	select {
	case f.ch <- cr:
	default:
	}
}

// NewRuntime creates new kayak Runtime.
func NewRuntime(cfg *kt.RuntimeConfig) (rt *Runtime, err error) {
	if cfg == nil {
		err = errors.Wrap(kt.ErrInvalidConfig, "nil config")
		return
	}

	peers := cfg.Peers

	if peers == nil {
		err = errors.Wrap(kt.ErrInvalidConfig, "nil peers")
		return
	}

	// verify peers
	if err = peers.Verify(); err != nil {
		err = errors.Wrap(err, "verify peers during kayak init failed")
		return
	}

	followers := make([]proto.NodeID, 0, len(peers.Servers))
	exists := false
	var role proto.ServerRole

	for _, v := range peers.Servers {
		if !v.IsEqual(&peers.Leader) {
			followers = append(followers, v)
		}

		if v.IsEqual(&cfg.NodeID) {
			exists = true
			if v.IsEqual(&peers.Leader) {
				role = proto.Leader
			} else {
				role = proto.Follower
			}
		}
	}

	if !exists {
		err = errors.Wrapf(kt.ErrNotInPeer, "node %v not in peers %v", cfg.NodeID, peers)
		return
	}

	// calculate fan-out count according to threshold and peers info
	minPreparedFollowers := int(math.Max(math.Ceil(cfg.PrepareThreshold*float64(len(peers.Servers))), 1) - 1)
	minCommitFollowers := int(math.Max(math.Ceil(cfg.CommitThreshold*float64(len(peers.Servers))), 1) - 1)

	rt = &Runtime{
		// indexes
		pendingPrepares: make(map[uint64]bool, commitWindow*2),

		// handler and logs
		sh:         cfg.Handler,
		wal:        cfg.Wal,
		instanceID: cfg.InstanceID,

		// peers
		peers:                cfg.Peers,
		nodeID:               cfg.NodeID,
		followers:            followers,
		role:                 role,
		minPreparedFollowers: minPreparedFollowers,
		minCommitFollowers:   minCommitFollowers,

		// rpc related
		TrackerNewCallerFunc: defaultNewCallerFunc,
		WaiterNewCallerFunc:  defaultNewCallerFunc,
		serviceName:          cfg.ServiceName,
		applyRPCMethod:       cfg.ServiceName + "." + cfg.ApplyMethodName,
		fetchRPCMethod:       cfg.ServiceName + "." + cfg.FetchMethodName,

		// commits related
		prepareThreshold: cfg.PrepareThreshold,
		prepareTimeout:   cfg.PrepareTimeout,
		commitThreshold:  cfg.CommitThreshold,
		commitTimeout:    cfg.CommitTimeout,
		logWaitTimeout:   cfg.LogWaitTimeout,
		commitCh:         make(chan *commitReq, commitWindow),

		// stop coordinator
		stopCh: make(chan struct{}),
	}

	// read from pool to rebuild uncommitted log map
	if err = rt.readLogs(); err != nil {
		return
	}

	return
}

// Start starts the Runtime.
func (r *Runtime) Start() (err error) {
	if !atomic.CompareAndSwapUint32(&r.started, 0, 1) {
		return


53,
		1,
	},
	[1.25] = {
		0.959663,
		-0.202888,
		-0.194638,
		0,
		-0.269617,
		-0.46782,
		-0.841695,
		0,
		0.079714,
		0.860222,
		-0.503651,
		0,
		-0.19741,
		-0.041781,
		-0.681417,
		1,
	},
	[1.2]


==========================//
//            P U B L I C   F U N C T I O N S                                 //
//============================================================================//

//------------------------------------------------------------------------------
/**
\brief  Initialize GPIO module

The function initializes the GPIO module.

\ingroup module_app_common
*/
//------------------------------------------------------------------------------
void gpio_init(void)
{

}

//------------------------------------------------------------------------------
/**
\brief  Shutdown GPIO module

The function shuts down the GPIO module.

\ingroup module_app_common
*/
//------------------------------------------------------------------------------
void gpio_exit(void)
{

}

//------------------------------------------------------------------------------
/**
\brief  Gets the node switch value

The function returns the node ID set by the node switches.

\return Returns the set node ID

\ingroup module_app_common
*/
//------------------------------------------------------------------------------
UINT8 gpio_getNodeid(void)
{
    UINT8   nodeid;

#if defined(NODE_SWITCH_BASE)
    nodeid = XGpio_ReadReg(NODE_SWITCH_BASE, 0);
#else
    nodeid = 0;
#endif

    return nodeid;
}

//------------------------------------------------------------------------------
/**
\brief  Gets the application input

The function returns application inputs.

\return Returns the application inputs.

\ingroup module_app_common
*/
//------------------------------------------------------------------------------
UINT32 gpio_getAppInput(void)
{
    UINT32  input;

#if defined(GPIO_INPUTS_BASE)
    input = XGpio_ReadReg(GPIO_INPUTS_BASE, 0);
#else
    input = 0;
#endif

    return input;
}

//------------------------------------------------------------------------------
/**
\brief  Sets the application output

The function sets the application outputs.

\param[in]      val_p               Determines the value to be set to the output

\ingroup module_app_common
*/
//------------------------------------------------------------------------------
void gpio_setAppOutputs(UINT32 val_p)
{
#if defined(GPIO_OUTPUTS_BASE)
    XGpio_WriteReg(GPIO_OUTPUTS_BASE, XGPIO_DATA_OFFSET, val_p);
#else
    UNUSED_PARAMETER(val_p);
#endif
}

//============================================================================//
//            P R I V A T E   F U N C T I O N S                               //
//============================================================================//
/// \name Private Functions
/// \{

/// \}


MeshBuilder = {
    DEFAULT_OPTIMIZE_ISLANDS = false,
    DEFAULT_RENDER_HALF_PIXELS = false
}
local MeshBuilder_mt = Class(MeshBuilder)

function MeshBuilder.new(worldSize, optimizeIslands, renderHalfPixels)
    local DEFAULT_DENSITYMAP_SIZE = g_currentMission.terrainSize * g_densityMapHeightManager.worldToDensityMap
	local self = {
        DEFAULT_DENSITYMAP_SIZE = DEFAULT_DENSITYMAP_SIZE,
        worldSize = worldSize or DEFAULT_DENSITYMAP_SIZE,
        optimizeIslands = optimizeIslands or MeshBuilder.DEFAULT_OPTIMIZE_ISLANDS,
        renderHalfPixels = renderHalfPixels or MeshBuilder.DEFAULT_RENDER_HALF_PIXELS,
    }
    setmetatable(self, MeshBuilder_mt)

    if self.optimizeIslands then
        Log:warning("MeshBuilder: optimizeIslands is not yet fully implemented")
    end

    Log:debug("MeshBuilder initialized")
    Log:var("worldSize", self.worldSize)
    Log:var("optimizeIslands", self.optimizeIslands)
    Log:var("renderHalfPixels", self.renderHalfPixels)

    Log:var("g_currentMission.terrainSize", g_currentMission.terrainSize)
    Log:var("densityMapSize", getDensityMapSize(g_currentMission.terrainDetailId))

    Log:var("g_densityMapHeightManager.worldToDensityMap", g_densityMapHeightManager.worldToDensityMap)
    Log:var("g_densityMapHeightManager.densityToWorldMap", g_densityMapHeightManager.densityToWorldMap)

    self:clearMesh()

    return self
end

function MeshBuilder:clearMesh()
    self.currentMesh = {
        vertices = {},
        triangles = {},
        verticePositionToIndex = {},
        touchedPixels = {},
        processedVertices = 0,
        duplicateVertices = 0,
        skippedPixels = 0,
        boundingBox = {}
    }
end

function MeshBuilder:getBoundingBox()
    return self.currentMesh.boundingBox
end

-- function fieldFinder_callback(worldX, worldZ, value)
--     if value == 2 then
--         local v1 = newVertex(worldX, 0, worldZ)
--         local v2 = newVertex(worldX + 1, 0, worldZ)
--         local v3 = newVertex(worldX + 1, 0, worldZ + 1)
--         local v4 = newVertex(worldX, 0, worldZ + 1)
--         -- table.insert(triangles, { v3, v2, v1 })
--         table.insert(triangles, { v1, v2, v3 })
--         -- table.insert(triangles, { v1, v3, v4 })

--     end
--     outData[worldZ] = outData[worldZ] or {}
--     outData[worldZ][worldX] = value
-- end

function MeshBuilder:getPositionIndex(x, z)
    return (z * self.worldSize) + x --y * boundingBoxWidth) + x
end

function MeshBuilder:getCoordinatesFromPosition(pos)
    local x = pos % self.worldSize
    local z = (pos - x) / self.worldSize
    return { x, z }
end

function MeshBuilder:addVertice(x, y, z)
    local current = self.currentMesh

    --TODO: add support for Y axis as well!!

    current.processedVertices = current.processedVertices + 1

    local vertices = current.vertices
    local verticePositionToIndex = current.verticePositionToIndex
    local boundingBox = current.boundingBox

    boundingBox.xMax = math.max(boundingBox.xMax or x, x)
    boundingBox.xMin = math.min(boundingBox.xMin or x, x)
    boundingBox.zMax = math.max(boundingBox.zMax or z, z)
    boundingBox.zMin = math.min(boundingBox.zMin or z, z)

    --BUG: reuse known vertices doesn't really work..
    local posIndex = self:g


/*******************************************************************************
 * Copyright 2009-2016 Jörg Müller
 *
 * 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.
 ******************************************************************************/

#pragma once

/**
 * @file Superpose.h
 * @ingroup sequence
 * The Superpose class.
 */

#include "ISound.h"

AUD_NAMESPACE_BEGIN

/**
 * This sound mixes two other factories, playing them the same time.
 * \note Readers from the underlying factories must have the same sample rate
 *       and channel count.
 */
class AUD_API Superpose : public ISound
{
private:
	/**
	 * First played sound.
	 */
	std::shared_ptr<ISound> m_sound1;

	/**
	 * Second played sound.
	 */
	std::shared_ptr<ISound> m_sound2;

	// delete copy constructor and operator=
	Superpose(const Superpose&) = delete;
	Superpose& operator=(const Superpose&) = delete;

public:
	/**
	 * Creates a new superpose sound.
	 * \param sound1 The first input sound.
	 * \param sound2 The second input sound.
	 */
	Superpose(std::shared_ptr<ISound> sound1, std::shared_ptr<ISound> sound2);

	virtual std::shared_ptr<IReader> createReader();
};

AUD_NAMESPACE_END