           try
                {
                    if (elem.ValueKind != JsonValueKind.Object) throw new InvalidDataException();
                    if (!elem.TryGetProperty("attributes", out var elemAttributes)) throw new InvalidDataException();
                    if (elemAttributes.ValueKind != JsonValueKind.Object) throw new InvalidDataException();
                    if (!elemAttributes.TryGetProperty(s_ObtainableCountryElement, out var isObtainable)) throw new InvalidDataException();
                    if (isObtainable.ValueKind != JsonValueKind.True) throw new InvalidDataException();
                    if (!elemAttributes.TryGetPropertyString("Code", out var country)) throw new InvalidDataException();
                    return country.EnumerableSingle();
                } catch { return Enumerable.Empty<string>(); }
            }).ToList();

            // Get initial set of configs
            var mainConf = await MakeRequestAsync(s_RouteMainConfig);
            var ret = ParseMainConfig(mainConf);

            // Get remaining configs
            var tasks = countriesList.Select((country) => GetAndParseCountryConfigAsync(country)).ToList();
            await Task.WhenAll(tasks);
            return tasks.SelectMany((task) => task.Result).Concat(ret);

        }
    }
}


 {
	currentCond := util.GetDeploymentCondition(d.Status, apps.DeploymentProgressing)
	// Can't estimate progress if there is no deadline in the spec or progressing condition in the current status.
	if !util.HasProgressDeadline(d) || currentCond == nil {
		return time.Duration(-1)
	}
	// No need to estimate progress if the rollout is complete or already timed out.
	if util.DeploymentComplete(d, &newStatus) || currentCond.Reason == util.TimedOutReason {
		return time.Duration(-1)
	}
	// If there is no sign of progress at this point then there is a high chance that the
	// deployment is stuck. We should resync this deployment at some point in the future[1]
	// and check whether it has timed out. We definitely need this, otherwise we depend on the
	// controller resync interval. See https://github.com/kubernetes/kubernetes/issues/34458.
	//
	// [1] ProgressingCondition.LastUpdatedTime + progressDeadlineSeconds - time.Now()
	//
	// For example, if a Deployment updated its Progressing condition 3 minutes ago and has a
	// deadline of 10 minutes, it would need to be resynced for a progress check after 7 minutes.
	//
	// lastUpdated: 			00:00:00
	// now: 					00:03:00
	// progressDeadlineSeconds: 600 (10 minutes)
	//
	// lastUpdated + progressDeadlineSeconds - now => 00:00:00 + 00:10:00 - 00:03:00 => 07:00
	after := currentCond.LastUpdateTime.Time.Add(time.Duration(*d.Spec.ProgressDeadlineSeconds) * time.Second).Sub(nowFn())
	// If the remaining time is less than a second, then requeue the deployment immediately.
	// Make it ratelimited so we stay on the safe side, eventually the Deployment should
	// transition either to a Complete or to a TimedOut condition.
	if after < time.Second {
		klog.V(4).Infof("Queueing up deployment %q for a progress check now", d.Name)
		dc.enqueueRateLimited(d)
		return time.Duration(0)
	}
	klog.V(4).Infof("Queueing up deployment %q for a progress check after %ds", d.Name, int(after.Seconds()))
	// Add a second to avoid milliseconds skew in AddAfter.
	// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
	dc.enqueueAfter(d, after+time.Second)
	return after
}
/*
Copyright 2020 Authors of Arktos.

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 controllerframework

import (
	"k8s.io/client-go/informers"
	"math"
	"sort"
	"testing"

	"github.com/stretchr/testify/assert"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	clientset "k8s.io/client-go/kubernetes"
	"k8s.io/client-go/kubernetes/fake"
	"k8s.io/klog"
)

func mockResetHander(c *ControllerBase, newLowerBound, newUpperbound int64) {
	klog.Infof("Mocked sent reset message to channel")
	return
}

func createControllerInstanceBaseAndCIM(t *testing.T, client clientset.Interface, cim *ControllerInstanceManager,
	controllerType string, stopCh chan struct{}) (*ControllerBase, *ControllerInstanceManager) {


and pg[2]>=0))then else local Jh=(pg[2]);if(not(not MJ[Jh]))then else (MJ)[Jh]={V2[Jh]};end;(pg)[1]=MJ[Jh];do pg[2]=1;end;end;end;end;end;until(Rz);return Rz,u5,A5;end;end;else if(not(Jw<44))then if(Jw==45)then if(Xw[3]==247)then uT=uT-1;e_[uT]={[3]=(Xw[1]-191)%256,[2]=142,[6]=(Xw[6]-191)%256};elseif(Xw[3]~=37)then do repeat local GJ,cJ=y_,eT;if(not(#GJ>0))then else local pm={};for N4,l4 in i,GJ do for gW,RW in i,l4 do if(RW[1]==cJ and RW[2]>=0)then local Vm=(RW[2]);if(not(not pm[Vm]))then else (pm)[Vm]={cJ[Vm]};end;do RW[1]=pm[Vm];end;(RW)[2]=1;end;end;end;end;until(Rz);end;do return;end;else uT=uT-1;e_[uT]={[2]=48,[6]=(Xw[6]-67)%256,[1]=(Xw[1]-67)%256};end;else if(not(not(eT[Xw[1]]<Xw[4])))then else uT=uT+1;end;end;else do if(Xw[3]~=153)then local Rr=(Xw[6]);for Rb=Rr,Rr+(Xw[1]-1) do do eT[Rb]=FT[c_+(Rb-Rr)+1];end;end;else uT=uT-1;do (e_)[uT]={[2]=142,[6]=(Xw[6]-207)%256,[3]=(Xw[1]-207)%256};end;end;end;end;end;end;end;end;end;else if(not(Jw>=65))then do if(Jw>=60)then if(not(Jw<62))then if(not(Jw<63))then if(Jw==64)then if(eT[Xw[1]]~=Xw[4])then else uT=uT+1;end;else (eT)[Xw[6]]=eT[Xw[1]]*eT[Xw[3]];end;else (eT)[Xw[6]]=o(eT[Xw[1]],Xw[4]);end;else if(Jw~=61)then local ps=(Xw[5]/Xw[4]);eT[Xw[6]]=ps-ps%1;else if(not(not(eT[Xw[1]]<=Xw[4])))then else uT=uT+1;end;end;end;else if(not(Jw<58))then if(Jw~=59)then eT[Xw[6]]={};else if(Xw[3]~=213)then eT[Xw[6]]=-eT[Xw[1]];else do uT=uT-1;end;do (e_)[uT]={[2]=4,[6]=(Xw[6]-203)%256,[1]=(Xw[1]-203)%256};end;end;end;else if(Jw~=57)then if(Xw[3]~=154)then eT[Xw[6]]=FT[c_+1];else uT=uT-1;(e_)[uT]={[1]=(Xw[1]-95)%256,[6]=(Xw[6]-95)%256,[2]=10};end;else eT[Xw[6]]=Xw[5]+eT[


68, 8), l(70, 36)),
                            wn = an(L(14, 31), c(180, 8));
                            continue;
                        case Q(b(2, 25), N(7, 4)):
                            var zn = ln(J(y(72, 972), g(579, 14)))
                              , An = ln(tn(l(2, 1), D(2, 1)));
                            if ((zn ^ An) + ln(k(i(8, 4), N(28, 16))) * An - ln(sn(z(0, 1), L(2, 5))) * (~zn & An) < ln(tn(M(31, 2), a(121, 5)))) {
                                window[gn(P(c(100, 3), A(2, 3))) + gn(Z(s(100, 16), b(1, 14))) + gn(_(g(82, 12), S(4, 11))) + gn(C(o(101, 3), f(29, 19))) + gn(rn(j(64, 34), L(36, 49))) + gn(U(N(198, 119), a(14, 8))) + gn(G(r(98, 16), g(5, 6))) + gn(en(T(24, 29), i(53, 7)))][gn(cn(D(46, 27), a(86, 14))) + gn(J(m(88, 207), s(186, 14))) + gn(un(m(5, 8), L(5, 87))) + gn(F(c(293, 8), I(493, 312)))] = ln(R(S(220, 600), M(467, 11)));
                                continue;
                            }
                            window[gn(sn(o(49, 7), N(108, 57))) + gn(F(r(221, 5), p(19, 102))) + gn(V(l(529, 285), I(480, 318))) + gn(tn(g(29, 5), T(20, 52))) + gn(J(S(100, 236), N(503, 282))) + gn(Q(o(79, 10), y(4, 11))) + gn(un(o(21, 10), N(208, 131))) + gn(Z(g(106, 13), j(33, 20)))][gn(H(I(313, 208), y(1, 3))) + gn(C(x(259, 150), d(16, 7))) + gn(k(f(243, 138), r(11, 6))) + gn(C(O(56, 56), s(5, 8)))] = ln(cn(A(0, 0), D(58, 38)));
                            continue;
                        case on(D(20, 13), T(2, 9)):
                            var yn = ln(J(y(5, 10), r(9, 10)))
                              , pn = ln(R(s(713, 4), I(805, 445)));
                            if (Math[['\x72\x6f\x75\x6e\x64']]((-(yn & pn) + ln(nn(T(4, 9), h(386, 248))) * (yn | pn) - (yn & ~pn) - (yn ^ pn) + ln(Y(c(8, 13), l(11, 6))) * ~pn - ~yn - ~(yn & pn)) / ln($(g(1, 9), a(7, 11)))) > -W(y(7, 28), A(7, 15))) {
                                window[gn(_(z(19, 81), b(6, 10))) + gn(on(O(4, 32), E(14, 50))) + gn(B(T(22, 60), d(6, 8))) + gn(un(L(16, 22), p(26, 37))) + gn(R(o(300, 3), c(185, 9))) + gn(C(a(79, 6), l(35, 20))) + gn(Z(x(287, 189), f(42, 27))) + gn(sn(x(19, 12), y(35, 64)))][gn(F(S(15, 207), S(22, 99))) + gn(J(u(274, 2), a(165, 14))) + gn(q(S(45, 275), L(90, 112))) + gn(an(z(1, 11), r(86, 11


ta değişecektir."
L.sb_mapchange_mode_2 = "{time} içinde harita değişecektir."
L.sb_mapchange_mode_3 = "{num} raunt sonra harita değişecektir."

L.sb_mia = "Çatışmada Kayıp"
L.sb_confirmed = "Onaylanmış Ölü"

L.sb_ping = "Gecikme"
L.sb_deaths = "Ölüm"
L.sb_score = "Puan"
L.sb_karma = "Karma"

L.sb_info_help = "Bu oyuncunun cesedinde arama yapıp sonuçları buradan inceleyebilirsiniz."

L.sb_tag_friend = "ARKADAŞ"
L.sb_tag_susp = "ŞÜPHELİ"
L.sb_tag_avoid = "KAÇIN"
L.sb_tag_kill = "ÖLDÜR"
L.sb_tag_miss = "KAYIP"

-- Equipment actions, like buying and dropping
L.buy_no_stock = "Silahı bu rauntta aldın ve stoğu tükendi."
L.buy_pending = "Zaten bekleyen bir siparişiniz var, alana kadar bekleyin."
L.buy_received = "Özel ekipmanınızı aldınız."

L.drop_no_room = "Burada silahını bırakacak yerin yok!"

L.disg_turned_on = "Kılık değiştirme etkinleştirildi!"
L.disg_turned_off = "Kılık değiştirme devre dışı."

-- Equipment item descriptions
L.item_passive = "Pasif etki öğesi"
L.item_active = "Aktif kullanım öğesi"
L.item_weapon = "Silah"

L.item_armor = "Vücut Zırhı"
L.item_armor_desc = [[
Mermi, ateş ve patlama hasarını azaltır. Zamanla tükenir.

Birden çok kez satın alınabilir. Belirli bir zırh değerine ulaştıktan sonra, zırh güçlenir.]]

L.item_radar = "Radar"
L.item_radar_desc = [[
Yaşam belirtilerini taramanızı sağlar.

Satın alır almaz otomatik taramaları başlatır. Bu menünün Radar sekmesinde yapılandırın.]]

L.item_disg = "Kılık Değiştirici"
L.item_disg_desc = [[
Açıkken kimlik bilgilerinizi gizler. Ayrıca bir mağdur tarafından en son görülen kişi olmaktan korur.

Bu menünün Kılık Değiştirme sekmesini açın veya Numpad Enter tuşuna basın.]]

-- C4
L.c4_disarm_warn = "Yerleştirdiğiniz bir C4 patlayıcı etkisiz hale getirildi."
L.c4_armed = "Bombayı başarıyla devreye aldınız."
L.c4_disarmed = "Bombayı başarıyla etkisiz hale getirdiniz."
L.c4_no_room = "Bu C4'ü taşıyamazsınız."

L.c4_desc = "Güçlü zaman ayarlı patlayıcı."

L.c4_arm = "C4 kur"
L.c4_arm_timer = "Zamanlayıcı"
L.c4_arm_seconds = "Patlamaya saniye kaldı"
L.c4_arm_attempts = "Etkisiz hale getirme girişimlerinde, 6 telden {num} tanesi kesildiğinde anında patlamaya neden olur."


<const int*> >();
	test_iter<input_iterator<const int*>, sentinel<const int*>>();

	test_range<input_iterator<const int*> >();
	test_range<input_iterator<const int*>, sentinel<const int*>>();

	// Test projections
	const S ia[] = {S{1}, S{3}, S{5}, S{2}, S{4}, S{6}};
	CHECK( stl2::is_partitioned(ia, is_odd(), &S::i) );

	return ::test_result();
}
// Range v3 library
//
//  Copyright Eric Niebler 2014
//
//  Use, modification and distribution is subject to the
//  Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3

//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <stl2/detail/algorithm/move.hpp>
#include <stl2/view/subrange.hpp>
#include <memory>
#include <algorithm>
#include "../simple_test.hpp"
#include "../test_utils.hpp"
#include "../test_iterators.hpp"

namespace ranges = __stl2;

template<typename InIter, typename OutIter, typename Sent = InIter>
void test() {
	{
		const int N = 1000;
		int ia[N];
		for(int i = 0; i < N; ++i)
			ia[i] = i;
		int ib[N] = {0};

		ranges::move_result<InIter, OutIter> r =
			ranges::move(InIter(ia), Sent(ia+N), OutIter(ib));
		CHECK(base(r.in) == ia+N);
		CHECK(base(r.out) == ib+N);
		for(int i = 0; i < N; ++i)
			CHECK(ia[i] == ib[i]);
	}

	{
		const int N = 1000;
		int ia[N];
		for(int i = 0; i < N; ++i)
			ia[i] = i;
		int ib[N] = {0};

		ranges::move_result<InIter, OutIter> r =
			ranges::move(as_lvalue(ranges::subrange(InIter(ia), Sent(ia+N))), OutIter(ib));
		CHECK(base(r.in) == ia+N);
		CHECK(base(r.out) == ib+N);
		for(int i = 0; i < N; ++i)
			CHECK(ia[i] == ib[i]);
	}
}

struct S {
	std::unique_ptr<int> p;
};

template<typename InIter, typename OutIter, typename Sent = InIter>
void test1() {
	{
		const int N = 100;
		std::unique_ptr<int> ia[N];
		for(int i = 0; i < N; ++i)
			ia[i].reset(new int(i));
		std::unique_ptr<int> ib[N];

		ranges::move_result<InIter, OutIter> r =
			ranges::move(InIter(ia), Sent(ia+N), OutIter(ib));
		CHECK(base(r.in) == ia+N);
		CHECK(base(r.out) == ib+N);
		for(int i = 0; i < N; ++i)
		{
			CHECK(ia[i].get() == nullptr);
			CHECK(*ib[i] == i);
		}
	}

	{
		const int N = 100;
		std::unique_ptr<int> ia[N];
		for(int i = 0; i < N; ++i)
			ia[i].reset(new int(i));
		std::unique_ptr<int> ib[N];

		ranges::move_result<InIter, OutIter> r =
			ra


y()) {
                canvas.drawText(notesText, lo + cew + 60.0f, to + 19 * ceh - 10.0f, Creator.textDefaultWhite)
            } else {
                canvas.drawText(notesCalsText, lo + cew + 60.0f, to + 19 * ceh - 10.0f, Creator.textDefaultWhite)
            }

            // Notes grid
            canvas.drawLine(
                lo + cew + 50.0f,
                to + 19 * ceh,
                lo + 2 * cew + 50.0f,
                to + 19 * ceh,
                Creator.lineDefaultBlack
            )
            for (i in 20..35) {
                canvas.drawLine(
                    lo + cew + 50.0f, to + i * ceh, lo + 2 * cew + 50.0f, to + i * ceh,
                    Creator.lineDefaultGrey50
                )
                if (i % 2 == 0) {
                    canvas.drawRect(
                        lo + cew + 50.0f, to + i * ceh, lo + 2 * cew + 50.0f, to + i * ceh + ceh,
                        Creator.fillGrey20
                    )
                }
            }
            canvas.drawLine(
                lo + cew + 50.0f, to + 35 * ceh, lo + 2 * cew + 50.0f, to + 35 * ceh,
                Creator.lineDefaultBlack
            )

            // Calendar events
            for (i in 0..7) {
                if (i < notesTitle.size) {
                    Creator.drawEllipsizedText(
                        canvas, notesTitle[i], Creator.textDefaultBlack,
                        lo + cew + 60.0f, to + (20 + i * 2) * ceh - 10.0f, cew
                    )
                    canvas.drawText(
                        notesLeft[i], lo + cew + 60.0f, to + (21 + i * 2) * ceh - 10.0f,
                        Creator.textSmallBlack
                    )
                    canvas.drawText(
                        notesRight[i], lo + cew + 40.0f + cew, to + (21 + i * 2) * ceh - 10.0f,
                        Creator.textSmallBlackRight
                    )
                }
            }
        }

        private fun drawEventLane(canvas: Canvas, startHour: Int, lane: MutableList<CalendarEvent>, llo: Float, lw: Float) {
            for (event in lane) {
                val startLocalDate = Instant.ofEpochMilli(event.startDate).atZone(ZoneId.systemDefault()).toLocalDateTime()
                val endLocalDate = Instant.ofEpochMilli(event.endDate).atZone(ZoneId.systemDefault()).toLocalDateTime()
                val cehs = (startLocalDate.hour * 60 + startLocalDate.minute - startHour * 60) / 30.0f * ceh + 1.0f * ceh
                val cehe = (endLocalDate.hour * 60 + endLocalDate.minute - startHour * 60) / 30.0f * ceh + 1.0f * ceh
                canvas.drawRect(lo + llo + 5.0f, to + cehs, lo + llo + lw - 5.0f, to + cehe, Creator.fillGrey10)
                canvas.drawRect(lo + llo + 5.0f, to + cehs, lo + llo + lw - 5.0f, to + cehe, Creator.lineDefaultBlack)

                Creator.drawEllipsizedText(
                    canvas, event.title, Creator.textSmallBlack,
                    lo + llo + 15.0f, to + cehs + ceh * 0.66f - 10.0f, lw - 20.0f
                )
            }
        }

        private fun checkOverlap(event: CalendarEvent, lane: MutableList<CalendarEvent>): Boolean {
            for (laneEvent in


九十一个，占百分之七十七。其余三百五十一个公社中，有的采取公 社、生产大队和生产队三级制，三级制的人民公社，一般也是以生产队为基本核算单位，少数是以生产大队为基本核算单位，个别是以公社为基本核算单位。这些形 式是四十条规定中提到了的。对于这部分人民公社是否还要调整，由各省、区根据四十条规定的原则自己去考虑。

   （三）关于畜群生产组问题，四十条 的第十三条规定：生产队下可以划分畜群生产组和其他生产组。畜群生产组是生产作业单位，应该根据畜群的大小来划分，不要形成一级。所指的畜群生产组和打 草、副业、加工业等生产每一样，是放牧和饲养管理牲畜的生产作业单位，是一个劳动组织。畜群生产组是根据分群放牧的特点和生产任务，按照实际需要的劳动力 多少来划分的。内蒙古自治区的情况是：对畜群生产组采取合同的形式，规定一定的产量和用工量，按照合同，进行生产，超产的按合同奖励，没有完成任务的按合 同受罚。畜群生产组的放牧员都按照按劳取酬的原则，根据自己的劳动工分，参加生产队的统一分配。从这次会议反映的情况来看。内蒙古自治区部分地区的有些同 志，对畜群生产组的理解上还有些概念不清的地方，将畜群和畜群生产组相互混淆起来，一个畜群生产组有两个、三个畜群的，也有一个畜群的，还有少数是四个畜 群的。各地如何具体划分畜群生产组，可以根据实际情况，具体研究规定。

   （四）自留畜问题

   自留言还是要的。自留言是社员生活所必 需，它附属于集体所有制经济和全民所有制经济，是社会主义经济的必要的补充部分，在不雇工放牧和不影响集体经济的情况下，允许其发展。允许发展，是指允许 繁殖的意思。有的牧业区，社员自留畜发展很快，所占牲畜总数的百分比，已经接近四十条规定的最高限额百分之十，今后如果继续发展，一定会影�


         writeln!(out, "Error reading MSR 3Ah: {}", FailTrace(err))?;
        } else {
            writeln!(out, "Your hardware supports Flexible Launch Control, but it's not enabled in the BIOS. Reboot your machine and try to enable FLC in your BIOS. Alternatively, try updating your BIOS to the latest version or contact your BIOS vendor.")?;

            out.verbose();
            writeln!(out, "MSR 3Ah IA32_FEATURE_CONTROL.SGX_LC = 0")?;
        }

        out.help_link("flc-cpu-configuration")
    }
}

impl DebugSupport for DeviceLoader {
    fn debug(&self, mut out: debug::Output, _items: &DetectItemMap) -> fmt::Result {
        fn len_to_mod_str(v: &[String]) -> (&str, &str) {
            match v.len() {
                1 => ("", "is"),
                _ => ("s", "are"),
            }
        }

        let inner = self.inner.as_ref().unwrap();

        let err = inner.devpath.as_ref().unwrap_err();

        if let Some(DetectError::NotAvailableInTest) = err.downcast_ref() {
            return Ok(());
        }

        let mut known_error = false;
        if let Some(ioe) = err.downcast_ref::<io::Error>() {
            if ioe.kind() == io::ErrorKind::NotFound {
                known_error = true;
                writeln!(out, "The SGX device (/dev/sgx or /dev/isgx) is not present.\n")?;

                match inner.modstatus {
                    Ok(KmodStatus { ref loaded, .. }) if !loaded.is_empty() => {
                        let (suffix, verb) = len_to_mod_str(&loaded);
                        writeln!(out, "The following module{} {} loaded: {}. Check your kernel logs to see why the device is not available.", suffix, verb, loaded.join(", "))?;
                    },
                    Ok(KmodStatus { ref available, .. }) if !available.is_empty() => {
                        let (suffix, verb) = len_to_mod_str(&available);
                        writeln!(out, "The following module{} {} available, but not loaded: {}. Would you like to load the module{} now? (N.B. you might want to configure the module to load automatically.)\n{}", suffix, verb, available.join(", "), suffix, Paint::red("(not supported yet)"))?; //TODO
                    },
                    Ok(_) => {
                        writeln!(out, "It appears you don't have the kernel module installed. Would you like to install it now?\n{}", Paint::red("(not supported yet)"))?; //TODO
                    },
                    Err(_) => {
                        writeln!(out, "It could not be detected whether you have an SGX driver installed. Please make sure the SGX driver is installed and loaded correctly.")?;
                    },
                }
            } else if ioe.kind() == io::ErrorKind::PermissionDenied {
                known_error = true;
                writeln!(out, "Permission denied while opening the SGX device (/dev/sgx or /dev/isgx). Make sure you have the necessary permissions to create SGX enclaves. If you are running in a container, make sure the device permissions are correctly set on the container.")?;
            }
        }

        if !known_error {
            writeln!(out, "The SGX device (/dev/sgx or /dev/isgx) could not be opened: {}.", err)?;
        }

        out.verbose();
        writeln!(out, "Error opening device: {}", FailTrace(err))?;
        if let Err(ref e) = inner.modstatus {
            writeln!(out, "Error checking module status: {}", FailTrace(e))?;
        }

        out.help_link("sgx-driver")


    @Test
    public void testSumPow() {
        double[] startPoint = OptimTestUtils.point(DIM,1.0);
        double[] insigma = OptimTestUtils.point(DIM,0.1);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(OptimTestUtils.point(DIM,0.0),0.0);
        doTest(TestFunction.SUM_POW.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 10, true, 0, 1e-13,
                1e-8, 1.5e-1, 100000, expected);
        doTest(TestFunction.SUM_POW.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 10, false, 0, 1e-13,
                1e-8, 2e-1, 100000, expected);
    }

    @Test
    public void testAckley() {
        double[] startPoint = OptimTestUtils.point(DIM,1.0);
        double[] insigma = OptimTestUtils.point(DIM,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(OptimTestUtils.point(DIM,0.0),0.0);
        doTest(TestFunction.ACKLEY.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 2*LAMBDA, true, 0, 1e-13,
                1e-9, 1e-5, 100000, expected);
        doTest(TestFunction.ACKLEY.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 2*LAMBDA, false, 0, 1e-13,
                1e-9, 1e-5, 100000, expected);
    }

    @Test
    public void testRastrigin() {
        double[] startPoint = OptimTestUtils.point(DIM,0.1);
        double[] insigma = OptimTestUtils.point(DIM,0.1);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(OptimTestUtils.point(DIM,0.0),0.0);
        doTest(TestFunction.RASTRIGIN.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, (int)(200*JdkMath.sqrt(DIM)), true, 0, 1e-13,
                1e-13, 1e-6, 200000, expected);
        doTest(TestFunction.RASTRIGIN.withDimension(DIM), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, (int)(200*JdkMath.sqrt(DIM)), false, 0, 1e-13,
                1e-13, 1e-6, 200000, expected);
    }

    @Test
    public void testConstrainedRosen() {
        final int dim = 12;
        double[] startPoint = OptimTestUtils.point(dim, 0.1);
        double[] insigma = OptimTestUtils.point(dim, 0.1);
        double[][] boundaries = boundaries(dim, -1, 2);
        PointValuePair expected =
            new PointValuePair(OptimTestUtils.point(dim, 1.0), 0.0);
        doTest(TestFunction.ROSENBROCK.withDimension(dim), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 2*LAMBDA, true, 0, 1e-13,
                1e-13, 1e-6, 100000, expected);
        doTest(TestFunction.ROSENBROCK.withDimension(dim), startPoint, insigma, boundaries,
                GoalType.MINIMIZE, 2*LAMBDA, false, 0, 1e-13,
                1e-13, 1e-6, 100000, expected);
    }

    @Test
    public void testDiagonalRosen() {
        final int dim = 12;
        double[]


age Atom Effect
//  *
//  * Add to `effects_UNSTABLE` to persist atom.
//  * Side-effect for Atom Manipulating
//  * @see https://recoiljs.org/docs/guides/atom-effects/
//  */
// export const persistAtomEffect = <T>(key: string): AtomEffect<T> => ({ setSelf, onSet }) => {
//   loadPersisted({ key, setSelf });

//   onSet(async (newValue) => {
//     if (newValue instanceof DefaultValue) {
//       localStorage.removeItem(key);
//     } else {
//       localStorage.setItem(key, JSON.stringify(newValue));
//     }
//   });
// };

type Headers = Record<string, string>;
export const localStorageEffect = (key: string) => ({ setSelf, onSet }: any) => {
  const savedValue = localStorage.getItem(key)
  if (savedValue != null) {
    let obj: any = JSON.parse(savedValue);
    setSelf(obj);
    if (key == 'userState') {
      if (obj.token) {
        let heads: Headers = {
          "X-ss-pid": obj.token as string, "X-ss-opt": 'perm'
        };
        OpenAPI.HEADERS = heads;
      }
    }

  }

  onSet((newValue: any) => {
    if (newValue instanceof DefaultValue) {
      localStorage.removeItem(key);
    } else {
      localStorage.setItem(key, JSON.stringify(newValue));
    }
  });
};import { Feature } from "../../features";

export enum FeatureAction {
  Activate = "feature.action.activate",
  Deactivate = "feature.action.deactivate",
}

export type FeatureState = Record<Feature, FeatureOptions>;
export type FullFeatureState = {features: FeatureState, config: FeatureConfig}

export interface ActionProps {
  action: FeatureAction;
  feature: Feature;
}

export interface FeatureConfig {
  permissive: boolean
}

export interface FeatureOptions {
  active: boolean;
  description?: string;
  dependencies: Feature[];
  isDependency?: boolean;
  disabledByDependencies?: boolean;
  configuredActive?: boolean;
}

export type FeatureTuple = [Feature, FeatureOptions];class Fridge {
  private static instance: Fridge = null;

  public static getInstance() {
    if (this.instance == null) {
      this.instance = new Fridge();
    }
    return this.instance;
  }

  public on(): void {
    console.log('fridge on');
  }

  public off(): void {
    console.log('fridge off');
  }
}

export default Fridge;
export const safeGet = (attrList: string[]) => {
    return (obj: any) => {
        attrList.map((attr: string) => {
            obj = (obj || {})[attr]
        })
        return obj
    }
}

export const promiseWrap = async<U, T=any>(promise:Promise<U>):Promise<{error:null|T, res:null|U}> => {
    try {
        const res = await promise
        return {error: null, res: res}
    } catch(e) {
        console.error(e)
        return {error: e, res: null}
    }
}

export const checkWxFuncAvailable = (func: Function) => {
    return func && typeof func === 'function'
}import * as _ from 'lodash'

import * as random from './random'

export class Schedule {
  private timeTable: { [time: number]: Routine[] } = {}

  /**
   * always sorted
   */
  private scheduledSlotList: number[] = []

  public constructor(private readonly emptyLoopPeriod: number) { }

  /**
   * Create a routine and schedule it on the time table
   */
  public schedule(routine: Routine): this {
    if (!Array.isArray(this.timeTable[routine.INDEX])) {


    所以最终表示是数是：

$$ sign(+\- 1)*2^{decoded exponent} *1.mantissa  $$

		**参见对指数位的说明，对很多特殊的编码，指数位使用了特殊的值。这里只讨论一个：0的编码，通过将指数和尾数都设置成0，由于符号位可以设置，所以会存在两个0 （+0 和-0）。**

		浮点数是一种非常聪明的表示法，它具有许多很好的属性（例如，正浮点数可以解释为整数可以直观的排序或计算最小/最大，并且整数0对应于正的浮点数0）。然而，伴随而来的是许多精度问题，这些问题并不总是最直观的。下面来谈论这些问题。

## 标准和低精度浮点数

		下面是常用的浮点数格式和编码方式。

| **Bit depth** | **Sign bit present?** | **Exponent bits** | **Mantissa bits** |
| ------------- | --------------------- | ----------------- | ----------------- |
| 32            | Yes                   | 8                 | 23                |
| 16            | Yes                   | 5                 | 10                |
| 11            | No                    | 5                 | 6                 |
| 10            | No                    | 5                 | 5                 |

		可以发现一些规律：

-   11和10位的浮点数没有符号位，主要是由于本身精确度并不高，并且通常被图形API用作保存颜色的格式，所以没有必要使用符号位。
-   **16bit的half类型和11bit、10bit有相同的指数位。但是有符号位，整数和负数有相同的范围。5位的指数位可以保证最大到64500到65500之间（见下方解释）**

## 浮点数范围解释

		**这里主要讨论16bit、11bit和10bit的浮点数上限，因为32bit的浮点数完成光照计算之后要进行Min操作，然后才能保存到RT当中，所以Min的操作数十分关键。**

		由于这三个类型的指数位都相同，所以上限依赖于**尾数位的数量**：

-   16位的float，尾数最大可以表示1.1111111111 ，十进制为1.9990234375；5位指数位，计算偏移15，那么最大可以表示11110 =15，指数部分就是32768，最大的数就是32768\*1.9990234375，约为65,504。

-   11bit的浮点数，尾数最大可以表示1.111111，十进制


2.border){
_3bb++;
}
return {resizeC:{width:_3bb,left:_3b9-1},expand:{left:0},expandP:{left:0,top:_3b8.top,width:_3b9,height:_3b8.height},collapse:{left:-_3ba,top:_3b8.top,height:_3b8.height}};
}else{
if(_3af=="north"){
var _3bc=p.panel("panel")._outerHeight();
var hh=_3b8.height;
if(!_394(_3b1.expandNorth)){
hh+=_3bc-_3b9+((_3b2.split||!_3b2.border)?1:0);
}
_3b1.east.add(_3b1.west).add(_3b1.expandEast).add(_3b1.expandWest).panel("resize",{top:_3b9-1,height:hh});
return {resizeC:{top:_3b9-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_3b9},collapse:{top:-_3bc,width:cc.width()}};
}else{
if(_3af=="south"){
var _3bc=p.panel("panel")._outerHeight();
var hh=_3b8.height;
if(!_394(_3b1.expandSouth)){
hh+=_3bc-_3b9+((_3b2.split||!_3b2.border)?1:0);
}
_3b1.east.add(_3b1.west).add(_3b1.expandEast).add(_3b1.expandWest).panel("resize",{height:hh});
return {resizeC:{height:hh},expand:{top:cc.height()-_3bc},expandP:{top:cc.height()-_3b9,left:0,width:cc.width(),height:_3b9},collapse:{top:cc.height(),width:cc.width()}};
}
}
}
}
};
};
function _3bd(_3be,_3bf){
var _3c0=$.data(_3be,"layout").panels;
var p=_3c0[_3bf];
var _3c1=p.panel("options");
if(_3c1.onBeforeExpand.call(p)==false){
return;
}
var _3c2="expand"+_3bf.substring(0,1).toUpperCase()+_3bf.substring(1);
if(_3c0[_3c2]){
_3c0[_3c2].panel("close");
p.panel("panel").stop(true,true);
p.panel("expand",false).panel("open");
var _3c3=_3c4();
p.panel("resize",_3c3.collapse);
p.panel("panel").animate(_3c3.expand,function(){
_38e(_3be);
});
}
function _3c4(){
var cc=$(_3be);
var _3c5=_3c0.center.panel("options");
if(_3bf=="east"&&_3c0.expandEast){
return {collapse:{left:cc.width(),top:_3c5.top,height:_3c5.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}};
}else{
if(_3bf=="west"&&_3c0.expandWest){
return {collapse:{left:-p.panel("panel")._outerWidth(),top:_3c5.top,height:_3c5.height},expand:{left:0}};
}else{
if(_3bf=="north"&&_3c0.expandNorth){
return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}};
}else{
if(_3bf=="south"&&_3c0.expandSouth){
return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}};
}
}
}
}
};
};
function _394


x4592_00D8,// VEX_Vpsubusb_ymm_ymm_ymmm256
	0x4492_00D8,// EVEX_Vpsubusb_xmm_k1z_xmm_xmmm128
	0x4592_00D8,// EVEX_Vpsubusb_ymm_k1z_ymm_ymmm256
	0x4692_00D8,// EVEX_Vpsubusb_zmm_k1z_zmm_zmmm512
	0x4002_00D9,// Psubusw_mm_mmm64
	0x4012_00D9,// Psubusw_xmm_xmmm128
	0x4492_00D9,// VEX_Vpsubusw_xmm_xmm_xmmm128
	0x4592_00D9,// VEX_Vpsubusw_ymm_ymm_ymmm256
	0x4492_00D9,// EVEX_Vpsubusw_xmm_k1z_xmm_xmmm128
	0x4592_00D9,// EVEX_Vpsubusw_ymm_k1z_ymm_ymmm256
	0x4692_00D9,// EVEX_Vpsubusw_zmm_k1z_zmm_zmmm512
	0x4002_00DA,// Pminub_mm_mmm64
	0x4012_00DA,// Pminub_xmm_xmmm128
	0x4492_00DA,// VEX_Vpminub_xmm_xmm_xmmm128
	0x4592_00DA,// VEX_Vpminub_ymm_ymm_ymmm256
	0x4492_00DA,// EVEX_Vpminub_xmm_k1z_xmm_xmmm128
	0x4592_00DA,// EVEX_Vpminub_ymm_k1z_ymm_ymmm256
	0x4692_00DA,// EVEX_Vpminub_zmm_k1z_zmm_zmmm512
	0x4002_00DB,// Pand_mm_mmm64
	0x4012_00DB,// Pand_xmm_xmmm128
	0x4492_00DB,// VEX_Vpand_xmm_xmm_xmmm128
	0x4592_00DB,// VEX_Vpand_ymm_ymm_ymmm256
	0x4412_00DB,// EVEX_Vpandd_xmm_k1z_xmm_xmmm128b32
	0x4512_00DB,// EVEX_Vpandd_ymm_k1z_ymm_ymmm256b32
	0x4612_00DB,// EVEX_Vpandd_zmm_k1z_zmm_zmmm512b32
	0x4452_00DB,// EVEX_Vpandq_xmm_k1z_xmm_xmmm128b64
	0x4552_00DB,// EVEX_Vpandq_ymm_k1z_ymm_ymmm256b64
	0x4652_00DB,// EVEX_Vpandq_zmm_k1z_zmm_zmmm512b64
	0x4002_00DC,// Paddusb_mm_mmm64
	0x4012_00DC,// Paddusb_xmm_xmmm128
	0x4492_00DC,// VEX_Vpaddusb_xmm_xmm_xmmm128
	0x4592_00DC,// VEX_Vpaddusb_ymm_ymm_ymmm256
	0x4492_00DC,// EVEX_Vpaddusb_xmm_k1z_xmm_xmmm128
	0x4592_00DC,// EVEX_Vpaddusb_ymm_k1z_ymm_ymmm256
	0x4692_00DC,// EVEX_Vpaddusb_zmm_k1z_zmm_zmmm512
	0x


2db0eef51d36203920b22669)
  - [ ] [纪念中国人民抗日战争暨世界反法西斯战争胜利80周年大会在京隆重举行 习近平发表重要讲话并检阅受阅部队](https://mp.weixin.qq.com/s?__biz=MzI1OTExNDY1NQ==&mid=2651621723&idx=1&sn=3a08b8aa28371eb60ddd6b7440e7e23e)
  - [ ] [美能源部宣布拨款3500万美元，推进新兴能源技术商业化](https://mp.weixin.qq.com/s?__biz=MzI1OTExNDY1NQ==&mid=2651621723&idx=2&sn=2d3e68d30d0194d05b916d7ea5f8cf0f)
  - [ ] [勒索情报通告｜worldleaks团体勒索东方日升新能源股份有限公司](https://mp.weixin.qq.com/s?__biz=Mzg2Mjc3NTMxOA==&mid=2247517443&idx=1&sn=317dd9d5333f30ae8a1f882918608dfc)
  - [ ] [AI安全智能体驱动的研发范式变革：D10 打造“开发即安全”新模式](https://mp.weixin.qq.com/s?__biz=MzI2MjY2NTM0MA==&mid=2247492813&idx=1&sn=71c1fc806f6de2f7441ba0d46bf948b2)
  - [ ] [氛围编程入门只选一本书？非它莫属](https://mp.weixin.qq.com/s?__biz=MzIzMTIzNTM0MA==&mid=2247498137&idx=1&sn=234e1e6170d99d2f02cfa93abcaa2877)
  - [ ] [紧急！买了工具的老哥看过来！](https://mp.weixin.qq.com/s?__biz=Mzk0OTY1NTI5Mw==&mid=2247494356&idx=1&sn=3d254c3a141a0e2442921954f36a86cc)
  - [ ] [家国情怀与职业使命同频共振丨天融信教育组织观礼“九三阅兵”，厚植英才家国情怀](https://mp.weixin.qq.com/s?__biz=MzU0MjEwNTM5Ng==&mid=2247520829&idx=1&sn=594ad1a99e216c93a487998f8ce9defa)
  - [ ] [天融信李雪莹受邀观礼九三阅兵：守护网络空间安全是我们共同的使命](https://mp.weixin.qq.com/s?__biz=MzA3OTMxNTcxNA==&mid=2650974084&idx=1&sn=cfe8622e23672a5ac24da98ec6250df2)
  - [ ] [西交苏州信息安全法学所招聘实习助理1-2名](https://mp.weixin.qq.com/s?__biz=Mzg5NTA5NTMzMQ==&mid=2247501815&idx=1&sn=c75


using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using MFIGamepadFeeder;
using MFIGamepadShared.Configuration;
using vGenWrapper;

namespace MFIGamepadShared
{
    public class GamepadManager
    {
        private readonly HidManager _hidManager;
        private readonly VGenWrapper _vGenWrapper;

        public GamepadManager(VGenWrapper vGenWrapper, HidManager hidManager)
        {
            _vGenWrapper = vGenWrapper;
            _hidManager = hidManager;
        }

        public Exception GamepadStartException => new Exception();
        public Exception NoXboxBusPresetException => new Exception();
        public event ErrorOccuredEventHandler ErrorOccuredEvent;

        public IObservable<uint> Start(List<GamepadConfiguration> gamepadConfigurations)
        {
            return Observable.Start(() => _vGenWrapper.vbox_isVBusExist())
                .Select(status =>
                {
                    if (status == NtStatus.Success)
                    {
                        Log("XBox bus installed");
                        return null;
                    }

                    Log($"XBox bus not installed ({status})");
                    return Observable.Throw<uint>(NoXbo


 r1, r4
	cmp r2, r1
	bgt _08010210
	adds r0, r5, #0
	adds r0, #0x26
	ldrb r0, [r0]
	lsls r0, r0, #0x18
	asrs r0, r0, #0x18
	subs r0, r0, r3
	adds r0, r2, r0
	cmp r0, r1
	bge _08010222
	cmp r2, r1
	blt _08010278
_08010210:
	mov r0, ip
	adds r0, #0x32
	ldrb r0, [r0]
	lsls r0, r0, #0x18
	asrs r0, r0, #0x18
	subs r0, r0, r4
	adds r0, r1, r0
	cmp r0, r2
	blt _08010278
_08010222:
	mov r1, sb
	asrs r0, r1, #0xd
	adds r3, r7, r0
	adds r0, r3, #0
	adds r0, #0x25
	movs r4, #0
	ldrsb r4, [r0, r4]
	mov r0, sl
	adds r2, r0, r4
	ldr r0, [r6, #0x14]
	asrs r0, r0, #8
	movs r1, #0x25
	add r1, r8
	movs r5, #0
	ldrsb r5, [r1, r5]
	adds r1, r0, r5
	cmp r2, r1
	bgt _0801025C
	adds r0, r3, #0
	adds r0, #0x27
	ldrb r0, [r0]
	lsls r0, r0, #0x18
	asrs r0, r0, #0x18
	subs r0, r0, r4
	adds r0, r2, r0
	cmp r0, r1
	bge _0801026E
	cmp r2, r1
	blt _08010278
_0801025C:
	mov r0, r8
	adds r0, #0x27
	ldrb r0, [r0]
	lsls r0, r0, #0x18
	asrs r0, r0, #0x18
	subs r0, r0, r5
	adds r0, r1, r0
	cmp r0, r2
	blt _08010278
_0801026E:
	movs r0, #1
	b _0801027A
	.align 2, 0
_08010274: .4byte gCamera
_08010278:
	movs r0, #0
_0801027A:
	pop {r3, r4, r5}
	mov r8, r3
	mov sb, r4
	mov sl, r5
	pop {r4, r5, r6, r7}
	pop {r1}
	bx r1

	thumb_func_start sub_8010288
sub_8010288: @ 0x08010288
	push {r4, r5, r6, r7, lr}
	mov r7, sl
	mov r6, sb
	mov r5, r8
	push {r5, r6, r7}
	adds r7, r0, #0
	adds r4, r1, #0
	mov sl, r2
	ldr r6, [sp, #0x20]
	lsls r3, r3, #0x10
	lsrs r3, r3, #0x10
	adds r0, r6, #0
	adds r0, #0xe0
	ldr r0, [r0]
	mov ip, r0
	movs r0, #0


}
        else if self.n1 > self.n0 {
            get1 /= get0;
            get0 = 1;
        }
        else {
            get0 = 1;
            get1 = 1;
        }

        if incn0 != 0 { incn0 = 0xFFFFFFFF/incn0; } else { incn0 = 0; };
        if incn1 != 0 { incn1 = 0xFFFFFFFF/incn1; } else { incn1 = 0; };
        print!("   [{:4},{:4},{:3},{:3},{:3},{:3},{:10?}u,{:10?}u], // {:3} ({},{})",
                get0, get1, self.s00, self.s01, self.s10, self.s11,
                incn0, incn1,
                i, self.n0, self.n1);
        println!("");
    }
}

fn main() {
    let mut m: BTreeMap<E, u32> = BTreeMap::new();
    let mut m1: BTreeMap<E, u32> = BTreeMap::new();
    m.insert(E::new(0, 0), 1);

    while m.len() != m1.len() {
        m1 = m.clone();
        for (state, _integer) in m1.iter() {
            let e: &E = state;
            m.insert( E::new(    e.n0,  dec(e.n1)), 0 );
            m.insert( E::new(inc(e.n0), dec(e.n1)), 0 );
            m.insert( E::new(dec(e.n0),     e.n1 ), 0 );
            m.insert( E::new(dec(e.n0), inc(e.n1)), 0 );
        }
    }

    let mut v: Vec<E> = Vec::new();

    for (state, _integer) in m.iter() {
        v.push(*state);
    }
    for i in 0..v.len() {
        let mut e: E = v[i];

        let mut n0 = e.n0;
        let mut n1 = dec(e.n1);
        for j in 0..v.len() {
            if v[j].n0 == n0 && v[j].n1 == n1 { e.s00 = j as u32; }
        }

        n0 = inc(n0);
        for j in 0..v.len() {
            if v[j].n0 == n0 && v[j].n1 == n1 { e.s01 = j as u32; }
        }

        n1 = e.n1;
        n0 = dec(e.n0);
        for j in 0..v.len() {
            if v[j].n0 == n0 && v[j].n1 == n1 { e.s10 = j as u32; }
        }

        n1 = inc(n1);
        for j in 0..v.len() {
            if v[j].n0 == n0 && v[j].n1 == n1 { e.s11 = j as u32; }
        }
        v[i] = e;
    }
    println!("//  get0 get1 s00 s01 s10 s11    p(s01)     p(s11)      state  n0,n1");
    println!("//  ---- ---- --- --- --- --- ----------- -----------   ------ -- --");
    for i in 0..v.len() {
        v[i].print(i as u32);
    }
}
// Copyright 2016 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

//! Monitor a process.
//!
//! This module only supports **Linux** platform.

use counter::Counter;
use desc::Desc;
use errors::{Error, Result};
use gauge::Gauge;
use libc;
/// The `pid_t` data type represents process IDs.
pub use libc::pid_t;
use metrics::{Collector, Opts};
use procinfo::pid as pid_info;
use proto;
use std::fs;
use std::io::Read;
use std::sync::Mutex;

// Six metrics per ProcessCollect


.Pointer(&raw), int32(unsafe.Sizeof(raw)), nil
	case *syscall.SockaddrInet6:
		var raw syscall.RawSockaddrInet6
		raw.Family = syscall.AF_INET6
		p := (*[2]byte)(unsafe.Pointer(&raw.Port))
		p[0] = byte(sa.Port >> 8)
		p[1] = byte(sa.Port)
		raw.Scope_id = sa.ZoneId
		for i := 0; i < len(sa.Addr); i++ {
			raw.Addr[i] = sa.Addr[i]
		}
		return unsafe.Pointer(&raw), int32(unsafe.Sizeof(raw)), nil
	default:
		return nil, 0, syscall.EWINDOWS
	}
}

// ReadMsg wraps the WSARecvMsg network call.
func (fd *FD) ReadMsg(p []byte, oob []byte) (int, int, int, syscall.Sockaddr, error) {
	if err := fd.readLock(); err != nil {
		return 0, 0, 0, nil, err
	}
	defer fd.readUnlock()

	if len(p) > maxRW {
		p = p[:maxRW]
	}

	o := &fd.rop
	o.InitMsg(p, oob)
	o.rsa = new(syscall.RawSockaddrAny)
	o.msg.Name = o.rsa
	o.msg.Namelen = int32(unsafe.Sizeof(*o.rsa))
	n, err := rsrv.ExecIO(o, func(o *operation) error {
		return windows.WSARecvMsg(o.fd.Sysfd, &o.msg, &o.qty, &o.o, nil)
	})
	err = fd.eofError(n, err)
	var sa syscall.Sockaddr
	if err == nil {
		sa, err = o.rsa.Sockaddr()
	}
	return n, int(o.msg.Control.Len), int(o.msg.Flags), sa, err
}

// WriteMsg wraps the WSASendMsg network call.
func (fd *FD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (int, int, error) {
	if len(p) > maxRW {
		return 0, 0, errors.New("packet is too large (only 1GB is allowed)")
	}

	if err := fd.writeLock(); err != nil {
		return 0, 0, err
	}
	defer fd.writeUnlock()

	o := &fd.wop
	o.InitMsg(p, oob)
	if sa != nil {
		rsa, len, err := sockaddrToRaw(sa)
		if err != nil {
			return 0, 0, err
		}
		o.msg.Name = (*syscall.RawSockaddrAny)(rsa)
		o.msg.Namelen = len
	}
	n, err := wsrv.ExecIO(o, func(o *operation) error {
		return windows.WSASendMsg(o.fd.Sysfd, &o.msg, 0, &o.qty, &o.o, nil)
	})
	return n, int(o.msg.Control.Len), err
}
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package xcoff

import (
	"reflect"
	"testing"
)

type archiveTest struct {
	file              string
	hdr               ArchiveHeader
	members           []*MemberHeader
	membersFileHeader []FileHeader
}

var archTest = []archiveTest{
	{
		"testdata/bigar-ppc64",
		ArchiveHeader{AIAMAGBIG},
		[]*MemberHeader{
			{"printbye.o", 836},
			{"printhello.o", 860},
		},
		[]FileHeader{
			{U64_TOCMAGIC},
			{U64_TOCMAGIC},
		},
	},
	{
		"testdata/bigar-empty",
		ArchiveHeader{AIAMAGBIG},
		[]*MemberHeader{},
		[]FileHeader{},
	},
}

func TestOpenArchive(t *testing.T)


",
    ["爧"] = "ctdj",
    ["掕"] = "ughh",
    ["竛"] = "ijks",
    ["輘"] = "yghh",
    ["齡"] = "ljks",
    ["燯"] = "ctjk",
    ["琌"] = "nvja",
    ["錂"] = "zghh",
    ["㖫"] = "dghh",
    ["㡵"] = "xjks",
    ["㦭"] = "htdj",
    ["㪮"] = "tddh",
    ["㬡"] = "otjk",
    ["㯪"] = "etjk",
    ["㱥"] = "gghh",
    ["㲆"] = "gcrk",
    ["㸳"] = "qjks",
    ["㻏"] = "nbch",
    ["㾉"] = "ajks",
    ["䄥"] = "ftdj",
    ["䈊"] = "rghh",
    ["䉁"] = "rqjk",
    ["䉖"] = "ryjk",
    ["䉹"] = "rtdj",
    ["䌢"] = "itjk",
    ["䍅"] = "ajks",
    ["䔖"] = "ltgh",
    ["䕘"] = "ljkw",
    ["䖅"] = "ltdj",
    ["䙥"] = "ttjk",
    ["䚖"] = "tdde",
    ["䠲"] = "zjks",
    ["䡼"] = "ytdd",
    ["䡿"] = "ytdj",
    ["䧙"] = "tvjh",
    ["䨩"] = "tfog",
    ["䯍"] = "fjks",
    ["䰱"] = "tdda",
    ["䴇"] = "tjkx",
    ["䴒"] = "tddx",
    ["䴫"] = "xtjk",
    ["刢"] = "jkpd",
    ["婈"] = "bghh",
    ["孁"] = "tddb",
    ["彾"] = "wjks",
    ["朎"] = "vjks",
    ["狑"] = "mjks",
    ["秢"] = "xjks",
    ["笭"] = "rjks",
    ["紷"] = "ijks",
    ["羐"] = "lgxi",
    ["蓤"] = "lwgh",
    ["蔆"] = "lkgh",
    ["蘦"] = "ltdd",
    ["衑"] = "pjks",
    ["袊"] = "tjks",
    ["裬"] = "tghh",
    ["詅"] = "sjks",
    ["跉"] = "pjks",
    ["閝"] = "ajks",
    ["霗"] = "tkjk",
    ["霛"] = "tbbb",
    ["駖"] = "njks",
    ["魿"] = "wjks",
    ["鯪"] = "wghh",
    ["鴒"] = "jkxn",
    ["鹷"] = "yrpk",
    ["麢"] = "xtdd",
    ["𠄖"] = "jkad",
    ["𠏡"] = "jtjk",
    ["𠟨"] = "tjkp",
    ["𠠢"] = "tddp",
    ["𠡭"] = "gphs",
    ["𠱠"] = "dddk",
    ["𠻠"] = "dqjk",
    ["𠻱"] = "dtgh",
    ["𠾥"] = "zzjk",
    ["𡈍"] = "qjjj",
    ["𡕮"] = "gkgh",
    ["𡿡"] = "vtdj",
    ["


10px}.user-profile-name{display:inline-block;margin-top:0}.user-profile-email{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.custom-link-wrapper{margin-bottom:15px}.custom-link-wrapper>a,.custom-link-wrapper>span{display:block}[cam-widget-password]{white-space:nowrap;width:100%}[cam-widget-password] .glyphicon{font-size:1.5em;margin-top:-0.2em}[cam-widget-password] .glyphicon.glyphicon-remove-circle{color:#a94442}[cam-widget-password] .glyphicon.glyphicon-ok-circle{color:#5cb85c}[cam-widget-password] .password-input{position:relative}[cam-widget-password] .password-input .glyphicon{position:absolute;padding:10px;pointer-events:none}[cam-widget-password] .right-addon .glyphicon{right:0px}[cam-widget-password] .right-addon input{padding-right:30px}/*# sourceMappingURL=./styles.css.map *//*!
 * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com)
 * Copyright 2011-2017 The Bootstrap Authors
 * Copyright 2011-2017 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 *//*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block


}
    protocols
}

pub struct Error(io::Error);

impl error::Error for Error {
    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
        error::Error::source(&self.0)
    }
}

impl fmt::Display for Error {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Display::fmt(&self.0, fmt)
    }
}

impl fmt::Debug for Error {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Debug::fmt(&self.0, fmt)
    }
}

impl From<io::Error> for Error {
    fn from(error: io::Error) -> Error {
        Error(error)
    }
}

#[derive(Clone)]
pub struct Identity {
    cert: CertContext,
}

impl Identity {
    pub fn from_pkcs12(buf: &[u8], pass: &str) -> Result<Identity, Error> {
        let store = PfxImportOptions::new().password(pass).import(buf)?;
        let mut identity = None;

        for cert in store.certs() {
            if cert
                .private_key()
                .silent(true)
                .compare_key(true)
                .acquire()
                .is_ok()
            {
                identity = Some(cert);
                break;
            }
        }

        let identity = match identity {
            Some(identity) => identity,
            None => {
                return Err(io::Error::new(
                    io::ErrorKind::InvalidInput,
                    "No identity found in PKCS #12 archive",
                ).into());
            }
        };

        Ok(Identity { cert: identity })
    }

    pub fn from_pkcs8(pem: &[u8], key: &[u8]) -> Result<Identity, Error> {
        let mut store = Memory::new()?.into_store();
        let mut cert_iter = pem::PemBlock::new(pem).into_iter();
        let leaf = cert_iter.next().expect("at least one certificate must be provided to create an identity");
        let cert = CertContext::from_pem(std::str::from_utf8(leaf).map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "leaf cert contains invalid utf8"))?)?;

        let mut options = AcquireOptions::new();
        options.container("schannel");
        let type_ = ProviderType::rsa_full();

        let mut container = match options.acquire(type_) {
            Ok(container) => container,
            Err(_) => options.new_keyset(true).acquire(type_)?,
        };
        container.import()
            .import_pkcs8_pem(&key)?;

        cert.set_key_prov_info()
            .container("schannel")
            .type_(type_)
            .keep_open(true)
            .key_spec(KeySpec::key_exchange())
            .set()?;
        let mut context = store.add_cert(&cert, CertAdd::Always)?;

        for int_cert in cert_iter {
            let certificate = Certificate::from_pem(int_cert)?;
            context = store.add_cert(&certificate.0, schannel::cert_store::CertAdd::Always)?;
        }
        Ok(Identity{cert: context})
    }
}

#[derive(Clone)]
pub struct Certificate(CertContext);

impl Certificate {
    pub fn from_der(buf: &[u8]) -> Result<Certificate, Error> {
        let cert = CertContext::new(buf)?;
        Ok(Certificate(cert))
    }

    pub fn from_pem(buf: &[u8]) -> Result<Certificate, Error> {
        match str::from_utf8(b


ac)
                {
                    socks5Transfer.UpdatePac();
                }
                Logger.Instance.Debug($"socks5已监听 socks5://127.0.0.1:{config.ListenPort}");
            }
            else
            {
                Logger.Instance.Info($"socks5未监听");
            }
            if (config.ConnectEnable)
            {
                Logger.Instance.Debug($"socks5已允许连接");
            }
            else
            {
                Logger.Instance.Info($"socks5未允许连接");
            }
            Logger.Instance.Warning(string.Empty.PadRight(Logger.Instance.PaddingWidth, '='));
        }

        public void LoadBefore(ServiceCollection services, Assembly[] assemblys)
        {
            services.AddSingleton<Socks5Transfer>();
            services.AddSingleton<common.socks5.Config>();
            services.AddSingleton<IClientSocks5ProxyPlugin, ClientSocks5ProxyPlugin>();
        }
    }

}


stHashCode = firstCommandIdentifier.GetHashCode();
                var secondHashCode = secondCommandIdentifier.GetHashCode();

                Assert.NotEqual(firstHashCode, secondHashCode);
            }
        }

        public class EqualsMethod
        {
            [Fact]
            public void Returns_True_If_GroupKey_Are_Equal_And_CommandKey_Are_Equal()
            {
                var firstCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");
                var secondCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");

                // Act
                var result = firstCommandIdentifier.Equals(secondCommandIdentifier);

                Assert.True(result);
            }

            [Fact]
            public void Returns_True_If_GroupKey_Are_Equal_And_CommandKey_Are_Equal_And_Have_Different_Casing()
            {
                var firstCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");
                var secondCommandIdentifier = new HystrixCommandIdentifier("grOUpA", "comMAndX");

                // Act
                var result = firstCommandIdentifier.Equals(secondCommandIdentifier);

                Assert.True(result);
            }

            [Fact]
            public void Returns_True_If_GroupKey_Are_Equal_And_CommandKey_Are_Not_Equal()
            {
                var firstCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");
                var secondCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandY");

                // Act
                var result = firstCommandIdentifier.Equals(secondCommandIdentifier);

                Assert.False(result);
            }

            [Fact]
            public void Returns_True_If_GroupKey_Are_Not_Equal_And_CommandKey_Are_Equal()
            {
                var firstCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");
                var secondCommandIdentifier = new HystrixCommandIdentifier("GroupB", "CommandX");

                // Act
                var result = firstCommandIdentifier.Equals(secondCommandIdentifier);

                Assert.False(result);
            }

            [Fact]
            public void Returns_True_If_GroupKey_Are_Not_Equal_And_CommandKey_Are_Not_Equal()
            {
                var firstCommandIdentifier = new HystrixCommandIdentifier("GroupA", "CommandX");
                var secondCommandIdentifier = new HystrixCommandIdentifier("GroupB", "CommandY");

                // Act
                var result = firstCommandIdentifier.Equals(secondCommandIdentifier);

                Assert.False(result);
            }
        }
    }
}


AC-312AD, U+312B3,
    U+3132E, U+31342, U+31357, U+313BC, U+313F1, U+313FF, U+31455, U+3145E, U+31587, U+3158E, U+31592, U+315E9, U+31677,
    U+316A6, U+316E5, U+3176B-3176C, U+317DB, U+3190F, U+31AC9, U+31B92, U+31B9C, U+31BB8, U+31BC4, U+31BCD, U+31C17,
    U+31C1B, U+31C3E, U+31C7F, U+31CEA, U+31D1F, U+31D31, U+31E07, U+31E25, U+31E4D, U+31EB0, U+31F00, U+31F11, U+32003,
    U+32084, U+3208D-3208E, U+32117, U+3211A, U+321F4, U+321FD, U+32217, U+32235, U+32245, U+322E4, U+3235B, U+3236D;
}
@font-face {
  font-family: 'LXGW WenKai Mono TC';
  src:
    local('LXGW WenKai Mono TC'),
    url('./6bf8fd65ba2216e4e8ba1c960f8c9450.woff2') format('woff2');
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  unicode-range:
    U+2F82C, U+2F833, U+2F83B, U+2F83F, U+2F852, U+2F862, U+2F86D, U+2F873, U+2F877-2F878, U+2F884, U+2F89A-2F89B,
    U+2F8AC, U+2F8B2, U+2F8B6, U+2F8D3, U+2F8DB-2F8DC, U+2F8E1, U+2F8EA, U+2F8ED, U+2F8FC, U+2F903, U+2F90B, U+2F90F,
    U+2F91A, U+2F920-2F921, U+2F945, U+2F947, U+2F96C, U+2F995, U+2F9D0, U+2F9DE-2F9DF, U+2F9F4, U+30001-30002,
    U+30008-30009, U+30021-30022, U+30053, U+3005C, U+30061, U+3006C, U+30072, U+30078, U+3007C, U+3008E, U+300DD,
    U+300EE, U+300F7, U+3011D, U+30149-3014A, U+30170, U+30174, U+30179, U+3018A, U+30196, U+301B3, U+301BB, U+301DB,
    U+301E0, U+301E2-301E3, U+301F0, U+30270, U+302C0, U+302D9, U+302DB-302DC, U+302DE, U+302F7, U+302FB, U+30300,
    U+30302, U+30335, U+3033B, U+3034E, U+30370-30371, U+30396, U+303A0, U+30409, U+30414, U+3043A, U+3043F, U+3044A,
    U+3044C, U+30450, U+3045D-3045E,


{
	const playerNames = players.split('vs')

	return {
		player0Name: playerNames[0].trim(),
		player1Name: playerNames[1].trim(),
	}
}

export const serializeData = (data: FileData, dataSeperator: string): RawMatchData[] => {
	let matchIndices = [] as MatchIndices
	data.forEach((r: string, index: number) => {
		if (r.match(new RegExp(dataSeperator))) matchIndices.push(index)
	})

	const x = matchIndices.map((r, index, arr) => {
		const currentMatchRaw = data.slice(arr[index], arr[index + 1])

		const { player0Name, player1Name } = getPlayersNames(currentMatchRaw[1])

		return {
			matchId: currentMatchRaw[0].split(':')[1].trim(),
			player0: {
				name: player0Name,
			},
			player1: {
				name: player1Name,
			},
			pointsProgression: currentMatchRaw.slice(2),
		}
	})

	return x
}
import { LAMBDA_CHARS_MATCHER } from "../model/model";
import { flatten } from "../helpers/arrayHelpers";

const fullLambdaExpression = (lexeme: string) =>
  lexeme.match(LAMBDA_CHARS_MATCHER) ||
  lexeme.includes(' ');

export default (str: string): string[] => {
  // split on . and space but keep in matching group: positive lookbehind
  const intermediate = str.split(/(?<=[ .])/);
  return flatten(intermediate.map(lexeme => {
    // handle vars in omega combinator e.g. 'xx' in λx.xx
    if (!fullLambdaExpression(lexeme) && lexeme.length > 1) {
      return lexeme.split('');
    }
    return lexeme;
  }));
}
export interface Rules {
  loadshift: Loadshift;
  timeshift: Timeshift;
  schedule: Schedule;
}

interface Loadshift {
  from: string[];
  to: string[];
}

interface Timeshift {
  from: string[];
  to: string[];
}
interface Schedule {
  init: string[];
  calc: string[];
}
export type FormField = {
  readonly descriptor: FieldDescriptor,
  readonly mandatory: boolean,
  readonly disabled: boolean,
  readonly tailButtons: TailButton[]|null
};

export type TailButton = {
  readonly title?: string,
  readonly iconId?: string,
  readonly clickArgument: any,
  readonly disabled?: boolean
};

export type FieldDescriptor =
  StringFieldDescriptor
  | NumericFieldDescriptor
  | BooleanFieldDescriptor
  | SelectStaticFieldDescriptor
  | CustomFieldDescriptor;

export type FieldDescriptorBase = {
  readonly id: string,
  readonly label: string,
  readonly note?: string
};

export type CustomFieldDescriptor = FieldDescriptorBase & {
  readonly type: 'custom',
  readonly subType: 'string',
};

export type StringFieldDescriptor = FieldDescriptorBase & {
  readonly type: 'text',
  readonly maxLength: number | undefined,
  readonly emptyToNull: boolean
};

export type NumericFieldDescriptor = FieldDescriptorBase & {
  readonly type: 'numeric',
  readonly min?: number|undefined
  readonly max?: number|undefined
};

export type BooleanFieldDescriptor = FieldDescriptorBase & {
  readonly type: 'bool'
};

export type SelectStaticFieldDescriptor = FieldDescriptorBase & {
  readonly type: 'select-static',
  readonly items: any[];
  readonly idMember: string;
  readonly textMember: string;
  readonly multi: boolean;
  readonly nullSelection: boolean
};
import {AnnotationLine} from './annotation-elements/annotation-polylines/annotation-line.class';
import {AnnotationElement} from './annotation-element.class';
import {AnnotationHighlighter} from './annotation-elements/annotation-polyl


='Sleep' AND b.trx_isolation_level IS NOT NULL ,'Trx sleep',a.Command) as Command, a.Time_ms as Time, a.State, SUBSTRING(COALESCE(a.INFO,''),1,1000) as Info ,0 as Progress , COALESCE(TIMESTAMPDIFF(SECOND,b.trx_started , now()),0) as trx_time, COALESCE(b.trx_isolation_level,'') as trx_isolation_level, COALESCE(b.trx_tables_in_use,0) as trx_tables_in_use, COALESCE(b.trx_tables_locked,0) as trx_tables_locked, COALESCE(b.trx_lock_structs,0) as trx_lock_structs, COALESCE(b.trx_lock_memory_bytes,0) as trx_lock_memory_bytes, COALESCE(b.trx_rows_locked,0) as trx_rows_locked, COALESCE(b.trx_rows_modified,0) as trx_rows_modified, COALESCE(b.trx_is_read_only,0) as trx_is_read_only  FROM INFORMATION_SCHEMA.PROCESSLIST a LEFT JOIN INFORMATION_SCHEMA.INNODB_TRX b ON b.trx_mysql_thread_id=a.id  " + filter_order_limit
		}
		if !full_process_is {
			stmt = "SHOW FULL PROCESSLIST"
		}
	} else if version.IsPostgreSQL() {
		// WHERE state <> 'idle' 		AND pid<>pg_backend_pid()
		stmt = `SELECT pid as "Id", coalesce(usename,'') as "User",coalesce(client_hostname || client_port,'') as "Host" , coalesce(datname,'') as db , coalesce(query,'') as "Command", extract(epoch from NOW()) - extract(epoch from query_start) as "Time",  coalesce(state,'') as "State",COALESCE(application_name,'')  as "Info" ,0 as "Progress"  FROM pg_stat_activity`
	}
	err = db.Select(&pl, stmt)
	if err != nil {
		return nil, stmt, fmt.Errorf("ERROR: Could not get processlist: %s", err)
	}
	return pl, stmt, nil
}

/*func GetProcesslistTableFromUser(db *sqlx.DB, version *version.Version, user string) ([]Processlist, string, error) {
	pl := []Processlist{}
	var err error
	stmt := ""
	if version.IsMariaDB() {
		//MariaDB
		stmt = "SELECT Id, User, Host, `Db` AS `db`, Command, Time_ms as Time, State, SUBSTRING(COALESCE(INFO_BINARY,''),1,1000) as Info, CASE WHEN Max_Stage < 2 THEN Progress ELSE (Stage-1)/Max_Stage*100+Progress/Max_Stage END AS Progress FROM INFORMATION_SCHEMA.PROCESSLIST WHERE User='+ user +'"
	} else if version.IsMySQLOrPercona() {
		//MySQL
		stmt = "SELECT Id, User, Host, `Db` AS `db`, Command, Time as Time, State, SUBSTRING(COALESCE(INFO,''),1,1000) as Info ,0 as Progress FROM INFORMATION_SCHEMA.PROCESSLIST WHERE  User='+ user +'"
		if version.GreaterEqual("8.0") {
			stmt = "SELECT Id, User, Host, `Db` AS `db`, Command, Time_ms as Time, State, SUBSTRING(COALESCE(INFO,''),1,1000) as Info ,0 as Progress FROM INFORMATION_SCHEMA.PROCESSLIST WHERE   User='+ user +'"
		}
	} else if version.IsPostgreSQL() {
		// WHERE state <> 'idle' 		AND pid<>pg_backend_pid()
		stmt = `SELECT pid as "Id", coalesce(usename,'') as "User",coalesce(client_hostname || client_port,'') as "Host" , coal


// doOnContentViewChanged 添加的回调
  private val mOnCreateContentViewAction = ArrayList<(rootView: View) -> Any?>()

  final override fun doOnCreateContentView(action: (rootView: View) -> Any?) {
    if (mHasContentViewChanged) {
      if (action.invoke(rootView) != null) {
        mOnCreateContentViewAction.add(action)
      }
    } else mOnCreateContentViewAction.add(action)
  }

  override fun onContentChanged() {
    super.onContentChanged()
    if (mHasContentViewChanged) throw IllegalStateException("不允许多次调用 setContentView")
    mHasContentViewChanged = true
    val iterator = mOnCreateContentViewAction.iterator()
    while (iterator.hasNext()) {
      if (iterator.next().invoke(rootView) == null) {
        iterator.remove()
      }
    }
  }
}package com.cyxbs.components.base.utils

import android.os.Bundle
import android.os.IBinder
import android.os.Parcelable
import android.util.Size
import androidx.core.os.bundleOf
import java.io.Serializable
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

/**
 * 这里面所有的类型参考了官方的设计：[bundleOf]
 */
class ArgumentHelperNullable<T>(
  private val arguments: () -> Bundle
) : ReadWriteProperty<Any, T?> {

  private var mValue: T? = null

  @Suppress("UNCHECKED_CAST")
  override fun getValue(thisRef: Any, property: KProperty<*>): T? {
    if (mValue != null) return mValue
    @Suppress("DEPRECATION") // 这里使用 get() 更方便
    mValue = arguments.invoke().get(property.name) as T?
    return mValue
  }

  @Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
  override fun setValue(thisRef: Any, property: KProperty<*>, value: T?) {
    val name = property.name
    arguments.invoke().apply {
      if (value == null) {
        mValue = null
        remove(name)
        return
      }
      when (value) {
        is String -> putString(name, value) // 优先判断 String

        // Scalars
        is Int -> putInt(name, value)
        is Boolean -> putBoolean(name, value)
        is Byte -> putByte(name, value)
        is Char -> putChar(name, value)
        is Double -> putDouble(name, value)
        is Float -> putFloat(name, value)
        is Long -> putLong(name, value)
        is Short -> putShort(name, value)

        // References
        is Bundle -> putBundle(name, value)
        is CharSequence -> putCharSequence(name, value)
        is Parcelable -> putParcelable(name, value)

        // Scalar arrays
        is BooleanArray -> putBooleanArray(name, value)
        is ByteArray -> putByteArray(name, value)
        is CharArray -> putCharArray(name, value)
        is DoubleArray -> putDoubleArray(name, value)
        is FloatArray -> putFloatArray(name, value)
        is IntArray -> putIntArray(name, value)
        is LongArray -> putLongArray(name, value)
        is ShortArray -> putShortArray(name, value)

        // Reference arrays
        is Array<*> -> {
          val componentType = value!!::class.java.componentType!!
          @Suppress("UNCHECKED_CAST") // Checked by reflection.
          when {


re
     */
    public ngOnInit() {
        this.activitiytimeline.getTimeLineData(this.module);
    }

    /**
     * a getter for the activities
     */
    get activities() {
        return this.activitiytimeline.activities[this.module].list;
    }

    /**
     * checks if tehera are any activiites to be displayed. Otherwise shows an illustration
     */
    get hasActivities() {
        return this.activitiytimeline.activities[this.module].list.length > 0 ? true : false;
    }

    /**
     * indicator if teh service is loading. This displays stencils
     */
    get loading() {
        return this.activitiytimeline.activities[this.module].loading;
    }

    /**
     * indicator if the service is loading more item . This displays stencils
     */
    get loadingmore() {
        return this.activitiytimeline.activities[this.module].loadingmore;
    }

    /**
     * checks if there are aggregates
     */
    get hasAggregates() {
        try {
            return this.activitiytimeline.activities[this.module].aggregates.module.length > 0;
        } catch (e) {
            return false;
        }
    }

    /**
     * @ignore
     *
     * a trackby function for the loop
     *
     * @param index
     * @param item
     */
    public trackByFn(index, item) {
        return item.id;
    }
}
import { ROOT_URI } from '../../src/routes/paths';
import { urlMatches } from '../../src/utils/UriMatcher';

describe ('URI Matcher', () => {

  it('should return True if the URIs are a perfect match', () => {
    const result: boolean = urlMatches(ROOT_URI, ROOT_URI);
    expect(result).toBe(true);
  });

  it('should return True if the actual URI has a trailing slash', () => {
    const result: boolean = urlMatches(ROOT_URI, `${ROOT_URI}/`);
    expect(result).toBe(true);
  });

  it('should return True if the actual URI contains a query string', () => {
    const result: boolean = urlMatches(ROOT_URI, `${ROOT_URI}?test-param=1`);
    expect(result).toBe(true);
  })

  it('should return False if the URIs do not match', () => {
    const result: boolean = urlMatches(ROOT_URI, 'different-uri');
    expect(result).toBe(false);
  });

  it('should return False if the actual URI is a sub-page of the expected URI', () => {
    const result: boolean = urlMatches(ROOT_URI, `${ROOT_URI}/different-uri`);
    expect(result).toBe(false);
  });
});
import { AfterViewInit, Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { map } from 'rxjs/operators';

@Directive({
  selector: '[appSort]'
})
export class SortDirective implements AfterViewInit {

  @Output() changeSort = new EventEmitter<string>();
  @Input() sortArray: Array<any>;
  @Input() sortDirection: string;
  originalArray: Array<any>
  constructor() { }

  ngAfterViewInit() {
    this.originalArray = [...this.sortArray];
  }

  @HostListener('click') onClick() {
    if (this.sortDirection === 'none') {
      this.sortDirection = 'ascending';
      this.sortArray.sort((n, m) => {
        if (n.name.toLocaleLowerCase() > m.name.toLocaleLowerCase()) {
          return 1;
        } else {
          return -1;
        }
      });
    } else if (this.sortDirection === 'ascending') {
      this.sortDirection = 'descending';
      this.sortArray.sort((n, m) => {
        if (n.name.toLocaleLowerCase() > m.


#!/usr/bin/env python3
import socket
import json
import time

SERVER_HOST = "127.0.0.1"
SERVER_PORT = 9001
RETRY_DELAY = 1.0  # seconds

class JsonSocket:
    """Line-delimited JSON over a socket using a file-like wrapper."""

    def __init__(self, sock: socket.socket):
        self._sock = sock
        self._fp = sock.makefile("rwb")

    def send(self, obj: dict) -> None:
        self._fp.write((json.dumps(obj) + "\n").encode("utf-8"))
        self._fp.flush()

    def recv(self) -> dict:
        line = self._fp.readline()
        if not line:
            raise ConnectionError("peer closed connection")
        return json.loads(line.decode("utf-8"))

    def close(self) -> None:
        try:
            self._fp.close()
        finally:
            self._sock.close()

class SimpleExecutor:
    """Minimal placeholder: acknowledges any command."""

    def run(self, command: str) -> dict:
        return {"status": "Ok", "echo": command}

class AgentClient:
    def __init__(self, host: str, port: int, retry_delay: float = 1.0):
        self.host = host
        self.port = port
        self.retry_delay = retry_delay
        self.executor = SimpleExecutor()

    def _connect_with_retry(self) -> JsonSocket:
        while True:
            try:
                sock = socket.create_connection(
                    (self.host, self.port), timeout=5)
                sock.settimeout(None)
                print("[agent] connected to server.")
                return JsonSocket(sock)
            except OSError:
                print("[agent] server unavailable, retrying ...")
                time.sleep(self.retry_delay)

    def run(self) -> None:
        jsock = self._connect_with_retry()
        try:
            # Loop: receive commands, respond with OK
            while True:
                try:
                    incoming = jsock.recv()
                except ConnectionError:
                    print("[agent] server disconnected.")
                    break

                if incoming.get("type") == "command":
                    cmd = incoming.get("data", "")
                    if cmd.lower() == "exit":
                        print("[agent] received exit. closing.")
                        break
                    result = self.executor.run(cmd)
                    jsock.send({"type": "result", **result})
                # ignore unknown message types
        finally:
            jsock.close()

if __name__ == "__main__":
    AgentClient(SERVER_HOST, SERVER_PORT, RETRY_DELAY).run()


ramerate] :
  /// Filter by framerate, 'MAX_30_FPS' or 'MAX_60_FPS'
  ///
  /// Parameter [resolution] :
  /// Filter by resolution, 'SD', 'HD', 'FHD', or 'UHD'
  ///
  /// Parameter [resourceType] :
  /// Filter by resource type, 'INPUT', 'OUTPUT', 'MULTIPLEX', or 'CHANNEL'
  ///
  /// Parameter [specialFeature] :
  /// Filter by special feature, 'ADVANCED_AUDIO' or 'AUDIO_NORMALIZATION'
  ///
  /// Parameter [videoQuality] :
  /// Filter by video quality, 'STANDARD', 'ENHANCED', or 'PREMIUM'
  Future<ListReservationsResponse> listReservations({
    String? channelClass,
    String? codec,
    int? maxResults,
    String? maximumBitrate,
    String? maximumFramerate,
    String? nextToken,
    String? resolution,
    String? resourceType,
    String? specialFeature,
    String? videoQuality,
  }) async {
    _s.validateNumRange(
      'maxResults',
      maxResults,
      1,
      1000,
    );
    final $query = <String, List<String>>{
      if (channelClass != null) 'channelClass': [channelClass],
      if (codec != null) 'codec': [codec],
      if (maxResults != null) 'maxResults': [maxResults.toString()],
      if (maximumBitrate != null) 'maximumBitrate': [maximumBitrate],
      if (maximumFramerate != null) 'maximumFramerate': [maximumFramerate],
      if (nextToken != null) 'nextToken': [nextToken],
      if (resolution != null) 'resolution': [resolution],
      if (resourceType != null) 'resourceType': [resourceType],
      if (specialFeature != null) 'specialFeature': [specialFeature],
      if (videoQuality != null) 'videoQuality': [videoQuality],
    };
    final response = await _protocol.send(
      payload: null,
      method: 'GET',
      requestUri: '/prod/reservations',
      queryParams: $query,
      exceptionFnMap: _exceptionFns,
    );
    return ListReservationsResponse.fromJson(response);
  }

  /// Produces list of tags that have been created for a resource
  ///
  /// May throw [NotFoundException].
  /// May throw [BadRequestException].
  /// May throw [InternalServerErrorException].
  /// May throw [ForbiddenException].
  Future<ListTagsForResourceResponse> listTagsForResource({
    required String resourceArn,
  }) async {
    final response = await _protocol.send(
      payload: null,
      method: 'GET',
      requestUri: '/prod/tags/${Uri.encodeComponent(resourceArn)}',
      exceptionFnMap: _exceptionFns,
    );
    return ListTagsForResourceResponse.fromJson(response);
  }

  /// Purchase an offering and create a reservation.
  ///
  /// May throw [BadRequestException].
  /// May throw [InternalServerErrorException].
  /// May throw [ForbiddenException].
  /// May throw [BadGatewayException].
  /// May throw [NotFoundException].
  /// May throw [GatewayTimeoutException].
  /// May throw [TooManyRequestsException].
  /// May throw [ConflictException].
  ///
  /// Parameter [count] :
  /// Number of resources
  ///
  /// Parameter [offeringId] :
  /// Offering to purchase, e.g. '87654321'
  ///
  /// Parameter [name] :
  /// Name for the new reservation
  ///
  /// Parameter [renewalSettings] :
  /// Renewal settings for the reservation
  ///
  /// Parameter [requestId] :
  /// Unique request ID to be specified. This is needed to prevent retries from
  /// creating multiple resources.
  ///
  /// Parameter [start] :
  /// Requested reservation start time (UTC


import sys
sys.path.append("..")

from cred.cred import bot
from telebot.types import ReplyKeyboardRemove
from db.dbconn import cursor,conn

@bot.message_handler(func=lambda message: message.text == "🚘 Offer a Ride")
def offer_ride(message):
    chat_id = message.chat.id
    bot.send_message(chat_id, "📍 Please share your Pickup Location to get started:",
                     parse_mode="HTML", reply_markup=ReplyKeyboardRemove())
    bot.register_next_step_handler(message, get_pickup_location)

def get_pickup_location(message):
    chat_id = message.chat.id
    if not message.location:
        bot.send_message(chat_id, "⚠ Please share your pick up location.",parse_mode="HTML")
        return offer_ride(message)

    pickup_lat, pickup_lon = message.location.latitude, message.location.longitude
    bot.send_message(chat_id, "Now share your Drop Location:",parse_mode="HTML")
    bot.register_next_step_handler(message, get_drop_location, pickup_lat, pickup_lon)

def get_drop_location(message, pickup_lat, pickup_lon):
    chat_id = message.chat.id
    if not message.location:
        bot.send_message(chat_id, "⚠ Please share your drop location.",parse_mode="HTML")
        return get_pickup_location(message)

    drop_lat, drop_lon = message.location.latitude, message.location.longitude
    bot.send_message(chat_id, "Enter Time of Travel (e.g., 9:00 AM):",parse_mode="HTML")
    bot.register_next_step_handler(message, get_time, pickup_lat, pickup_lon, drop_lat, drop_lon)

def get_time(message, pickup_lat, pickup_lon, drop_lat, drop_lon):
    chat_id = message.chat.id
    time = message.text
    bot.send_message(chat_id, "Enter Number of Seats Available:",parse_mode="HTML")
    bot.register_next_step_handler(message, get_seats, pickup_lat, pickup_lon, drop_lat, drop_lon, time)

def get_seats(message, pickup_lat, pickup_lon, drop_lat, drop_lon, time):
    chat_id = message.chat.id
    seats = int(message.text)
    bot.send_message(chat_id, "Enter Fare per Person (₹):",parse_mode="HTML")
    bot.register_next_step_handler(message, save_ride, pickup_lat, pickup_lon, drop_lat, drop_lon, time, seats)

def save_ride(message, pickup_lat, pickup_lon, drop_lat, drop_lon, time, seats):
    chat_id = message.chat.id
    fare = int(message.text)
    username = message.from_user.username or "Unknown"

    cursor.execute("""
        INSERT INTO rides (user_id, username, pickup_lat, pickup_lon, drop_lat, drop_lon, time, seats, fare)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
    """, (chat_id, username, pickup_lat, pickup_lon, drop_lat, drop_lon, time, seats, fare))
    conn.commit()

    bot.send_message(chat_id, f"✅ Ride Listed!\n⏰ Time: {time} \n🪑 Seats: {seats} \n💰 Fare: ₹{fare}",parse_mode="HTML")


                .setHomepageUrl("http://angularjs.org")
                .setLicenseIds(licenseIds)
                .setRelease(release)
                .setPackageManager(PackageManager.NPM)
                .setDescription("Sanitizes an html string by stripping all potentially dangerous tokens.");

        given(this.packageServiceMock.getPackageForUserById(eq(package1.getId()))).willReturn(package1);
        given(this.packageServiceMock.validatePackageIds(any())).willReturn(true);

        Set<String> linkedPackages = new HashSet<>();
        linkedPackages.add(package1.getId());

        release.setPackageIds(linkedPackages);
        releaseList.add(release);

        Release release2 = new Release();
        Map<String, String> release2ExternalIds = new HashMap<>();
        release2ExternalIds.put("mainline-id-component", "4876");
        release2ExternalIds.put("ws-component-id", "[\"589211\",\"987135\"]");
        release2.setId("6868686868");
        release2.setName("Angular");
        release2.setCpeid("cpe:/a:Google:Angular:2.3.1:");
        release2.setReleaseDate("2016-12-15");
        release2.setVersion("2.3.1");
        release2.setCreatedOn("2016-12-18");
        release2.setCreatedBy("admin@sw360.org");
        release2.setSourceCodeDownloadurl("http://www.google.com");
        release2.setBinaryDownloadurl("http://www.google.com/binaries");
        release2.setModerators(new HashSet<>(Arrays.asList("admin@sw360.org", "jane@sw360.org")));
        release2.setComponentId(component.getId());
        release2.setComponentType(ComponentType.OSS);
        release2.setClearingState(ClearingState.NEW_CLEARING);
        release2.setMainlineState(MainlineState.MAINLINE);
        release2.setExternalIds(release2ExternalIds);
        release2.setLanguages(new HashSet<>(Arrays.asList("C++", "Java")));
        release2.setOperatingSystems(ImmutableSet.of("Windows", "Linux"));
        release2.setSoftwarePlatforms(new HashSet<>(Arrays.asList("Java SE", ".NET")));
        release2.setContributors(new HashSet<>(Arrays.asList("admin@sw360.org", "jane@sw360.org")));
        release2.setVendor(new Vendor("TV", "Test Vendor", "http://testvendor.com"));
        release2.setReleaseIdToRelationship(releaseIdToRelationship);
        release2.setClearingInformation(clearingInfo);
        release2.setCotsDetails(cotsDetails);
        release2.setEccInformation(eccInformation);
        release2.setAttachments(ImmutableSet.of(att1));
        release2.setMainLicenseIds(Set.of("MIT", "GPL"));
        release2.setOtherLicenseIds(Set.of("MIT"));
        releaseList.add(release2);

        Package package2 = new Package()
                .setId("875689754")
                .setName("applicationinsights-web")
                .setVersion("2.5.11")
                .setCreatedBy("user@sw360.org")
                .setCreatedOn("2023-02-02")
                .setPurl("pkg:npm/@microsoft/applicationinsights-web@2.5.11")
                .setRelease(release2)
                .setPackageManager(PackageManager.NPM)
                .setPackageType(CycloneDxComponentType.LIBRARY)
                .setVcs("git+https://github.com/microsoft/ApplicationInsights-JS.git")
                .setHomepageUrl("https://github.com/microsoft/ApplicationInsights-JS#readme")
                .setDescription("Application Insights is an extension of Azure Monitor and provides application performance monitoring (APM) features");

        given(this.packageServiceMock.getPackageForUserById(eq(package2.getId()))).willReturn(package2);

        Set<String> linkedPackages2


ASYNC_EXEC_THREAD_KEEP_ALIVE,
                      RN_RH_ASYNC_EXEC_THREAD_KEEP_ALIVE_DEFAULT,
                      Type.DURATION,
                      EnumSet.of(Info.REPNODE,
                                 Info.POLICY, Info.HIDDEN, Info.NORESTART),
                      Scope.STORE,
                      1L, Long.MAX_VALUE,
                      null); }

    /**
     * An obsolete parameter, introduced in 19.5 and obsoleted in 20.1, and now
     * ignored, that used to specify the size of the queue used to store
     * incoming requests while they are waiting to be handled by a thread in
     * the request handler thread pool. Now the queue is sized based on the
     * difference between RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS and
     * RN_RH_ASYNC_EXEC_MAX_THREADS.
     *
     * @since 19.1
     * @deprecated as of 20.1, see #RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS
     */
    @Deprecated
    private static final String RN_RH_ASYNC_EXEC_QUEUE_SIZE =
        "rnRHAsyncExecQueueSize";
    /**
     * @deprecated as of 20.1, see #RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS_DEFAULT
     */
    @Deprecated
    private static final String RN_RH_ASYNC_EXEC_QUEUE_SIZE_DEFAULT = "0";
    static { putState(RN_RH_ASYNC_EXEC_QUEUE_SIZE,
                      RN_RH_ASYNC_EXEC_QUEUE_SIZE_DEFAULT,
                      Type.INT,
                      EnumSet.of(Info.REPNODE,
                                 Info.POLICY, Info.HIDDEN, Info.NORESTART),
                      Scope.STORE,
                      0, 10000,
                      null); }

    /**
     * The maximum number of concurrent asynchronous requests that an RN can
     * handle before it should do throttling.
     *
     * @since 20.1
     */
    public static final String RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS =
        "rnRHAsyncMaxConcurrentRequests";
    /**
     * Provide a value enough larger than RN_RH_ASYNC_EXEC_MAX_THREADS_DEFAULT
     * to handle short bursts of requests.
     */
    public static final int RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS_DEFAULT = 1000;
    static { putState(RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS,
                      Integer.toString(
                          RN_RH_ASYNC_MAX_CONCURRENT_REQUESTS_DEFAULT),
                      Type.INT,
                      EnumSet.of(Info.REPNODE,
                                 Info.POLICY),
                      Scope.STORE,
                      1, Integer.MAX_VALUE,
                      null); }

    /**
     * The maximum number of active socket connections that the async request
     * handler will permit, or 0 if there is no limit. This limit will be
     * applied to all RN services.
     */
    public static final String RN_ACCEPT_MAX_ACTIVE_CONNS =
        "rnAcceptMaxActiveConns";
    /**
     * The default value is 80% of the 10240 value that we suggest in the
     * Tuning Appendix of the Administrator's Guide as the limit on the number
     * of open file descriptors that should be permitted per RN. The file
     * descriptor limit is likely the limiting factor on the number of incoming
     * socket connections that a process can support simultaneously.
     */
    public static final String RN_ACCEPT_MAX_ACTIVE_CONNS_DEFAULT =
        Integer.toString((int) (0.8 * 10240));
    static { putState(RN_ACCEPT_MAX_ACTIVE_CONNS,
                      RN_ACCEPT_MAX_ACTIVE_CONNS_DEFAULT,
                      Type.INT,
                      EnumSet.of(Info.REPNODE,
                                 Info.POLICY),
                      Scope.STORE,
                      0, 100000,


        jsonElement.asStringOrNull?.let { setValue(it) }
    }
}

class CharSequenceSetting(
    name: CharSequence,
    value: CharSequence,
    visibility: ((() -> Boolean))? = null,
    consumer: (prev: CharSequence, input: CharSequence) -> CharSequence = { _, input -> input },
    description: CharSequence = "",
    override val isTransient: Boolean = false
) : AbstractCharSequenceSetting<CharSequence>(name, value, visibility, consumer, description) {
    override fun setValue(valueIn: String) {
        value = valueIn
    }
}

class StringSetting(
    name: CharSequence,
    value: String,
    visibility: ((() -> Boolean))? = null,
    consumer: (prev: String, input: String) -> String = { _, input -> input },
    description: CharSequence = "",
    override val isTransient: Boolean = false
) : AbstractCharSequenceSetting<String>(name, value, visibility, consumer, description) {
    override fun setValue(valueIn: String) {
        value = valueIn
    }
}package dev.luna5ama.trollhack.graphics.font

import dev.luna5ama.trollhack.graphics.texture.AbstractTexture
import org.lwjgl.opengl.GL11.*
import org.lwjgl.opengl.GL12.*
import org.lwjgl.opengl.GL14.GL_TEXTURE_LOD_BIAS
import org.lwjgl.opengl.GL30.GL_COMPRESSED_RED_RGTC1
import org.lwjgl.opengl.GL45.*

class GlyphTexture(override val width: Int, override val height: Int, levels: Int) : AbstractTexture() {
    init {
        textureID = glCreateTextures(GL_TEXTURE_2D)

        glTextureParameteri(textureID, GL_TEXTURE_MIN_LOD, 0)
        glTextureParameteri(textureID, GL_TEXTURE_MAX_LOD, levels)

        glTextureParameteri(textureID, GL_TEXTURE_BASE_LEVEL, 0)
        glTextureParameteri(textureID, GL_TEXTURE_MAX_LEVEL, levels)

        glTextureParameteri(textureID, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
        glTextureParameteri(textureID, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)

        glTextureParameteri(textureID, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
        glTextureParameteri(textureID, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)
        glTextureParameterf(textureID, GL_TEXTURE_LOD_BIAS, 0.0f)

        glTextureStorage2D(textureID, levels + 1, GL_COMPRESSED_RED_RGTC1, width, height)
    }
}package dev.luna5ama.trollhack.graphics.esp

import dev.luna5ama.trollhack.event.AlwaysListening
import dev.luna5ama.trollhack.event.events.render.Render3DEvent
import dev.luna5ama.trollhack.event.listener
import dev.luna5ama.trollhack.graphics.MatrixUtils
import dev.luna5ama.trollhack.graphics.RenderUtils3D
import dev.luna5ama.trollhack.graphics.color.ColorRGB
import dev.luna5ama.trollhack.graphics.mask.BoxOutlineMask
import dev.luna5ama.trollhack.graphics.mask.BoxVertexMask
import dev.luna5ama.trollhack.graphics.mask.SideMask
import dev.luna5ama.trollhack.graphics.shaders.DrawShader
import dev.luna5ama.trollhack.util.accessor.renderPosX
import dev.luna5ama.trollhack.util.accessor.renderPosY
import dev.luna5ama.trollhack.util.accessor.renderPosZ
import dev.luna5ama.trollhack.util.threads.onMainThread
import it.unimi.dsi.fastutil.floats.FloatArrayList
import it.unimi.dsi.fastutil.ints.IntArrayList
import it.unimi.dsi.fastutil.shorts.ShortArrayList
impor


_MSG("setsockopt", errno);

  /* Construct local address structure */
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(esl_opt_GetInteger(opts, "--wport"));

  /* Bind to the local address */
  if (bind(sock_fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) LOG_FATAL_MSG("bind", errno);

  /* Mark the socket so it will listen for incoming connections */
  if (listen(sock_fd, esl_opt_GetInteger(opts, "--wcncts")) < 0) LOG_FATAL_MSG("listen", errno);

  args->sock_fd = sock_fd;

  if ((n = pthread_create(&thread_id, NULL, worker_comm_thread, (void *)args)) != 0) LOG_FATAL_MSG("thread create", n);
}

#endif /*HMMER_THREADS*/


.574219h62.347656zm-31.171875-213.1875h-.40625c-20.921875 0-34.453125-14.402344-34.453125-32.402344 0-18.40625 13.945313-32.410156 35.273437-32.410156 21.328126 0 34.453126 14.003906 34.859376 32.410156 0 18-13.53125 32.402344-35.273438 32.402344zm255.984375 213.1875h-62.339844v-100.347656c0-25.21875-9.027343-42.417969-31.585937-42.417969-17.222656 0-27.480469 11.601563-31.988282 22.800781-1.648437 4.007813-2.050781 9.609375-2.050781 15.214844v104.75h-62.34375s.816407-169.976562 0-187.574219h62.34375v26.558594c8.285157-12.78125 23.109375-30.960937 56.1875-30.960937 41.019531 0 71.777344 26.808593 71.777344 84.421874zm0 0";
}

.insta-svg {
    -fx-shape: "M386.878,0H164.156C73.64,0,0,73.64,0,164.156v222.722 c0,90.516,73.64,164.156,164.156,164.156h222.722c90.516,0,164.156-73.64,164.156-164.156V164.156 C551.033,73.64,477.393,0,386.878,0z M495.6,386.878c0,60.045-48.677,108.722-108.722,108.722H164.156 c-60.045,0-108.722-48.677-108.722-108.722V164.156c0-60.046,48.677-108.722,108.722-108.722h222.722 c60.045,0,108.722,48.676,108.722,108.722L495.6,386.878L495.6,386.878zM275.517,133C196.933,133,133,196.933,133,275.516 s63.933,142.517,142.517,142.517S418.034,354.1,418.034,275.516S354.101,133,275.517,133z M275.517,362.6 c-48.095,0-87.083-38.988-87.083-87.083s38.989-87.083,87.083-87.083c48.095,0,87.083,38.988,87.083,87.083 C362.6,323.611,323.611,362.6,275.517,362.6z";
}

.yt-svg {
    -fx-shape: "m256 0c-141.363281 0-256 114.636719-256 256s114.636719 256 256 256 256-114.636719 256-256-114.636719-256-256-256zm159.960938 256.261719s0 51.917969-6.585938 76.953125c-3.691406 13.703125-14.496094 24.507812-28.199219 28.195312-25.035156 6.589844-125.175781 6.589844-125.175781 6.589844s-99.878906 0-125.175781-6.851562c-13.703125-3.6875-24.507813-14.496094-28.199219-28.199219-6.589844-24.769531-6.589844-76.949219-6.589844-76.949219s0-


type.getName()),
			() -> new OpenApiBuildingError("Object with name `" + type.getName() + "` is already registered.")
		);
		this.registeredTypes.put(type.getName(), type);

		return OpenApiTypeReference.typeRefTo(type);
	}

	@Nonnull
	public Optional<OpenApiTypeReference> getRegisteredType(@Nonnull String name) {
		return Optional.ofNullable(this.registeredTypes.get(name))
			.map(OpenApiTypeReference::typeRefTo);
	}

	public void registerEndpoint(@Nonnull OpenApiEndpoint<?> endpoint) {
		Assert.isPremiseValid(
			!this.registeredEndpoints.containsKey(endpoint.getPath()) ||
				!this.registeredEndpoints.get(endpoint.getPath()).containsKey(endpoint.getMethod()),
			() -> new OpenApiBuildingError("There is already registered `" + endpoint.getMethod() + "` endpoint at `" + endpoint.getPath() + "`.")
		);

		this.registeredEndpoints.computeIfAbsent(
				endpoint.getPath(),
				path -> createHashMap(HttpMethod.values().length)
			)
			.put(endpoint.getMethod(), endpoint);
	}

	@Nonnull
	public Rest buildRest() {
		final OpenAPI openApi = buildOpenApi();
		final Map<String, Class<? extends Enum<?>>> enumMapping = buildEnumMapping();
		final List<Endpoint> endpoints = buildEndpoints(openApi, enumMapping);

		return new Rest(openApi, endpoints);
	}

	@Nonnull
	private OpenAPI buildOpenApi() {
		final OpenAPI openApi = new OpenAPI(SpecVersion.V31)
			.servers(buildOpenApiServers());

		final Info info = new Info();
		info.setTitle(getOpenApiTitle());
		info.setContact(new Contact().email("novotny@fg.cz").url("https://www.fg.cz"));
		info.setVersion(VersionUtils.readVersion());
		info.setLicense(new License().name("Business Source License 1.1").url("https://github.com/FgForrest/evitaDB/blob/master/LICENSE"));
		openApi.info(info);

		final Components components = new Components();
		this.registeredTypes.forEach((name, object) -> components.addSchemas(name, object.toSchema()));
		openApi.setComponents(components);

		final Paths paths = new Paths();
		this.registeredEndpoints.forEach((path, endpoints) -> {
			final PathItem pathItem = new PathItem();
			endpoints.forEach((method, endpoint) -> pathItem.operation(method, endpoint.toOperation()));
			paths.addPathItem("/" + path.toString(), pathItem);
		});
		openApi.setPaths(paths);

		validateReferences(openApi);
		return openApi;
	}

	@Nonnull
	private Map<String, Class<? extends Enum<?>>> buildEnumMapping() {
		final Map<String, Class<? extends Enum<?>>> enumMapping = this.registeredCustomEnums.entrySet()
			.stream()
			.filter(it -> it.getValue() != null) // we want mappings only for enums that have Java enum associated with it
			.collect(Collectors.toMap(
				Entry::getKey,
				Entry::getValue,
				(o, o2) -> { throw new RestInternalError("Enum items cannot merge."); },
				LinkedHashMap::new
			));

		return Collections.unmodifiableMap(enumMapping);
	}

	@Nonnull
	private List<Rest.Endpoint> buildEndpoints(@Nonnull OpenAPI openApi, @Nonnull Map<String, Class<? extends Enum<?>>> enumMapping) {
		final List<Rest.Endpoint> builtEndpoints = new LinkedList<>();
		this.registeredEndpoints.forEach((path, endpoints) ->
			endpoints.forEach((method, endpoint) ->
				builtEndpoints.add(new Rest.Endpoint(
					path,
					com.linecorp.armeria.common.HttpMethod.valueOf(endpoint.getMethod().name()),
					endpoint.toHandler(this.objectMapper, this.evita, this


                return <VElement&IVNodeMethod>p;
            }else{
                return this;
            }
        }
        // addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void
        // {

        // }
        // dispatchEvent(evt: Event): boolean
        // {
        //     return false;
        // }
        // removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void
        // {

        // }
        addText(this: VNode&IVNodeMethod, ...args:string[]): VNode&IVNodeMethod {
            let s = args.join('\r\n');
            let t = this(s, 3);
            this.appendChild(t);
            return this;
        }
        addText2(this: VNode&IVNodeMethod,fn: Function): VNode&IVNodeMethod{
            // let t = newVNode($t.getFunctionComment(fn), 3, this.nodeName === 'PRE');
            let t = this(getFunctionComment(fn), 3);
            this.appendChild(t);
            return this;
        }

        /**
         * 添加子节点，并返回子节点
         */
        append(this: VNode, name: string, nodeType: ENodeType): VNode&IVNodeMethod {
            return this.doAppendChild($$$(name, nodeType));
        }

        /**
         * 添加子节点，并返回子节点
         */
        appendChild(this: VNode, vNode: VNode&IVNodeMethod): VNode&IVNodeMethod {
            let idx =Array.prototype.indexOf.call(this.childNodes,vNode);
            if (idx === -1) {
                return this.doAppendChild( vNode);
            } else {
                return vNode;
            }
        }

        /**
         * 添加子节点，并返回子节点
         */
        protected doAppendChild(this: VNode, vNode: VNode&IVNodeMethod) {

            Array.prototype.push.call(this.childNodes,vNode);
            let p = vNode.parentNode;
            if (p) {
                p.removeChild(vNode);
            }
            vNode.parentNode = <VNode&IVNodeMethod>this;
            return vNode;
        }
        insertBefore(this:  VNode&IVNodeMethod, newChild:  VNode&IVNodeMethod, refChild:  VNode&IVNodeMethod):  VNode&IVNodeMethod {
            //添加到childNodes里
            let chds = this.childNodes;
            let idx:number = indexOf.call(chds,refChild);
            if (idx === -1) {
                return newChild;
            }
            let p2 = newChild.parentNode;
            if (p2) {
                p2.removeChild(newChild);
            }
            splice.call(chds,idx, 0, newChild);
            newChild.parentNode = this;
            return newChild;
        }
        insertBefore2(this:  VNode&IVNodeMethod, newChild:  VNode&IVNodeMethod, refChild:  VNode&IVNodeMethod):  VNode&IVNodeMethod{
            return this.insertBefore(newChild,refChild);
        }
        remove(){
            let p=this.parentNode;
            if(p){
                p.removeChild(<any>this);
            }
        }
        removeChild(this:  VNode&IVNodeMethod, vNode: VNode&IVNodeMethod): VNode&IVNodeMethod {
            if (!vNode || this.childNodes.length === 0) {
                return vNode;
            }
            removeItem(this.childNodes, vNode);
            vNode.parentNode = null;
            return vNode;
        }
        getData(this: VNode): string {
            return this.vmData.data;
        }
        abstract cloneNode(deep:boolean): VNode&IVNodeMethod

        abstract toHTMLString():string[];
        // createElement(name: string): IVElement;
        // createTextNode(value: string): IVText;
        // createComment(value: string): IVComment;
        // addEventListener(name: string, fn?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
        // removeEventListener(name: string, fn?: EventListenerOrEventListenerObject, useCapture?: boolean): void;


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

#ifndef _DEMDLTEXCOORDSORTER_H_
#define _DEMDLTEXCOORDSORTER_H_

#include <dragengine/common/math/decMath.h>

/**
 * \brief Textue coordinates sorter.
 *
 * Older models store texture coordinates for face corners. The Drag[en]gine
 * expects though face corners to index into a list of texture coordinates.
 * This allows graphic modules to optimize and reduce size.
 *
 * This class builds the minimal list of texture coordinates from the face
 * corners and assigns them the texture coordinate index.
 */
class demdlTexCoordSorter{
private:
	struct sBucketEntry{
		const decVector2 *texCoords;
		int index;
		sBucketEntry *next;
	};

	int pFaceCount;
	int pTexCoordSetCount;
	int *pFaceCorners;
	decVector2 *pFaceTexCoords;

	sBucketEntry **pTCBuckets;
	sBucketEntry *pTCBucketEntries;
	const decVector2 **pTexCoords;
	int pTexCoordCount;

public:
	/** \name Constructors and Destructors */
	/*@{*/
	/** \brief Create texture coordinates sorter. */
	demdlTexCoordSorter();

	/** \brief Clean up texture coordinates sorter. */
	~demdlTexCoordSorter();
	/*@}*/

	/** \name Management */
	/*@{*/
	/** \brief Set number of faces and texture coordinate sets. */
	void Resize( int faceCount, int texCoordSetCount );

	/**
	 * \brief Sort texture coordinates.
	 *
	 * Replaces the list of texture coordinates with the smallest list of texture
	 * coordinates containing no duplicates and assigns the matching indices to
	 * the face corners.
	 */
	void Sort();

	/** \brief Number of faces. */
	inline int GetFaceCount() const{ return pFaceCount; }

	/** \brief Number of texture coordinate sets. */
	inline int GetTexCoordSetCount() const{ return pTexCoordSetCount; }

	/** \brief Face corner texture coordinate index. */
	int GetFaceCornerAt( int face, int corner ) const;

	/** \brief Set face corner texture coordinate index. */
	void SetFaceCornerAt( int face, int corner, int texCoord );

	/** \brief Face texture coordinate. */
	const decVector2 &GetFaceTexCoordAt( int face, int corner, int texCoordSet ) const;

	/** \brief Set face texture coordinate. */
	void SetFaceTexCoordAt( int face, int corner, int texCoordSet, const decVector2 &texCoord );

	/** \brief Number of texture coordinates. */
	inline int GetTexCoordCount() const{ return pTexCoordCount; }

	/** \brief Texture coordinate. */
	const decVector2 &GetTexCoordAt( int index, int texCoordSet ) const;
	/*@}*/

private:
	int HashTexCoords( const decVector2 *texCoords ) const;
	bool TexCoordsAreEqual( const decVector2 *texCoords1, const decVector2 *texCoords2 ) const;
};

#endif