spa de maná",
  [24451] = "Bandas de sangre de lykul",
  [24452] = "Guanteletes de luz estelar",
  [24453] = "Hoja corta de diente de Zangar",
  [24454] = "Capa de presteza duradera",
  [24455] = "Guerrera del vigía de la noche",
  [24456] = "Grebas del guardián de hierro",
  [24457] = "Guardahombros del portador de la Verdad",
  [24458] = "Faja tachonada de Virtud",
  [24459] = "Capa de rayos sanadores",
  [24460] = "Dije de tenacidad",
  [24461] = "Portaodio",
  [24462] = "Perlas de perspicacia luminosas",
  [24463] = "Espaldares de fuerza bruta",
  [24464] = "Los colmillos del acechador",
  [24465] = "Coselete de pellejo de arrastrado",
  [24466] = "Leotardos del fullero",
  [24467] = "Fuego viviente",
  [24468] = "Champiñón fulminante",
  [24469] = "Núcleo de lodo",
  [24470] = "Jaula de múrlocs",
  [24471] = "Planes de ataque de Ango\'rosh",
  [24472] = "Cabeza del jefe Grog\'ak",
  [24473] = "Núcleo de triturador iracundo",
  [24474] = "Cristal de visión violeta",
  [24475] = "Huella de Gordawg",
  [24476] = "Almeja jaggal",
  [24477] = "Carne de almeja jaggal",
  [24478] = "Perla jaggal",
  [24479] = "Perla oscura",
  [24480] = "Esencia fantasmal",
  [24481] = "Togas de augurador",
  [24482] = "Informe de Alturus",
  [24483] = "Basidio marchito",
  [24484] = "Basidio marchito",
  [24485] = "Veneno de sangrador Luz pantanosa",
  [24486] = "Pellejo zarpacieno",
  [24487] = "Segundo trozo de la llave",
  [24488] = "Tercer trozo de la llave",
  [24489] = "Llave de aprendiz restaurada",
  [24490] = "The Master\'s Key",
  [24491] = "Cannonball",
  [24492] = "Los apuntes de Keanna",
  [24493] = "Hoja de cercenador Colmillo de la Marisma",
  [24494] = "Lágrimas de la diosa",
  [24495] = "Monster - Sword2H, Felguard Legionnaire",
  [24496] = "Cuerno de Banthar",
  [24497] = "Tótem de protección Feropantano",
  [24498] = "Tótem Feropantano",
  [24499] = "Manual de venenos de Dagapantano",
  [24500] = "Vial de veneno de Dagapantano",
  [24501] = "Roca de Gordawg",
  [24502] = "Calavera de Mazo de Guerra",
  [24503] = "Cabeza terránea de Gurok",
  [24504] = "Viento aullador",
  [24505] = "Corazón de Eburnia",
  [24506] = "Elemental Sliver",
  [24507] = "Fragmento elemental",
  [24508] = "Trozo de elemental",
  [24509] = "Primordial Element",
  [24510] = "Núcleo primordial",


n heap.Pop(h).(vdPair) }

type nb struct{ to, wt int }

func dijkstra(g [][]nb, st int) []int {
	const inf int = 1e18
	dist := make([]int, len(g))
	for i := range dist {
		dist[i] = inf
	}
	dist[st] = 0
	q := hp{{st, 0}}
	for len(q) > 0 {
		p := q.pop()
		v := p.v
		if dist[v] < p.d {
			continue
		}
		for _, e := range g[v] {
			w := e.to
			if newD := dist[v] + e.wt; newD < dist[w] {
				dist[w] = newD
				q.push(vdPair{w, newD})
			}
		}
	}
	return dist
}

func countRestrictedPaths(n int, edges [][]int) (ans int) {
	const mod int = 1e9 + 7
	g := make([][]nb, n)
	for _, e := range edges {
		v, w, wt := e[0]-1, e[1]-1, e[2]
		g[v] = append(g[v], nb{w, wt})
		g[w] = append(g[w], nb{v, wt})
	}
	dist := dijkstra(g, n-1)

	// 递推写法是排序 dist，按其升序转移
	dp := make([]int, n)
	for i := range dp {
		dp[i] = -1
	}
	var f func(int) int
	f = func(v int) (res int) {
		if v == n-1 {
			return 1
		}
		dv := &dp[v]
		if *dv != -1 {
			return *dv
		}
		defer func() { *dv = res }()
		for _, e := range g[v] {
			if w := e.to; dist[w] < dist[v] {
				res += f(w)
			}
		}
		return res % mod
	}
	return f(0) % mod
}
// Code generated by copypasta/template/leetcode/generator_test.go
package main

import (
	"github.com/EndlessCheng/codeforces-go/leetcode/testutil"
	"testing"
)

func Test(t *testing.T) {
	t.Log("Current test is [d]")
	examples := [][]string{
		{
			`[[0,1],[1,0],[1,2],[2,1]]`,
			`4.00000`,
		},
		{
			`[[1,1],[3,3]]`,
			`2.82843`,
		},
		{
			`[[1,1]]`,
			`0.00000`,
		},
		{
			`[[1,1],[0,0],[2,0]]`,
			`2.73205`,
		},
		{
			`[[0,1],[3,2],[4,5],[7,6],[8,9],[11,1],[2,12]]`,
			`32.94036`,
		},
		// TODO 测试参数的下界和上界
		{
			`[[44,23],[18,45],[6,73],[0,76],[10,50],[30,7],[92,59],[44,59],[79,45],[69,37],[66,63],[10,78],[88,80],[44,87]]`,
			`499.28078`,
		},
		{
			`[[55,91],[83,86],[48,8],[71,31],[50,28],[28,52],[89,18],[61,5],[100,100],[63,94],[93,49],[82,72],[17,9],[63,48],[83,96],[47,2],[43,50],[95,32],[87,74],[39,80],[57,15],[98,95],[37,53]]`,


charCodeAt(0)<=i.charCodeAt(0)?e:t8),iSe=r=>{let{length:e}=r;return r.slice(0,e-e%2)},nSe=[[/\\?\s+$/,r=>r.indexOf("\\")===0?_4:t8],[/\\\s/g,()=>_4],[/[\\$.|*+(){^]/g,r=>`\\${r}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(r,e,t)=>e+6<t.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(r,e)=>`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>vD],[/\\\\/g,()=>vD],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(r,e,t,i,n)=>e===vD?`\\[${t}${iSe(i)}${n}`:n==="]"&&i.length%2===0?`[${rSe(t)}${i}]`:"[]"],[/(?:[^*])$/,r=>/\/$/.test(r)?`${r}$`:`${r}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(r,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],e8=Object.create(null),sSe=(r,e)=>{let t=e8[r];return t||(t=nSe.reduce((i,n)=>i.replace(n[0],n[1].bind(r)),r),e8[r]=t),e?new RegExp(t,"i"):new RegExp(t)},kD=r=>typeof r=="string",oSe=r=>r&&kD(r)&&!VQe.test(r)&&r.indexOf("#")!==0,aSe=r=>r.split(_Qe),PD=class{constructor(e,t,i,n){this.origin=e,this.pattern=t,this.negative=i,this.regex=n}},ASe=(r,e)=>{let t=r,i=!1;r.indexOf("!")===0&&(i=!0,r=r.substr(1)),r=r.replace(XQe,"!").replace(ZQe,"#");let n=sSe(r,e);return new PD(t,r,i,n)},lSe=(r,e)=>{throw new e(r)},Ka=(r,e,t)=>kD(r)?r?Ka.isNotRelative(r)?t(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:t("path must not be empty",TypeError):t(`path must be a string, but got \`${e}\``,TypeError),r8=r=>$Qe.test(r);Ka.isNotRelative=r8;Ka.convert=r=>r;var DD=class{constructor({ignorecase:e=!0}={}){eSe(this,$4,!0),this._rules=[],this._ignorecase=e,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[$4]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(oSe(e)){let t=ASe(e,this._ignorecase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,Z4(kD(e)?aSe(e):e).forEach(this._addPattern,th


     {
            currentAssembly.AddRange(assemblies);

            if (includeReferences)
            {
                var referencedPaths = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.dll");
                var toLoad = referencedPaths.Where(r => !assemblies.Any(x => x.Location.Equals(r)))
                                .Where(x => !prefixIgnore.Any(p => p.Contains(x)))
                                .ToList();

                toLoad.ForEach(path => currentAssembly.Add(Assembly.LoadFile(path)));
            }

        }

        public bool IsValidType(string type) => currentAssembly.Any(x => x.GetType(type) != null);

        public bool IsValidMethod(string type, string method) => currentAssembly?
                                                                    .FirstOrDefault(x => x.GetType(type) != null)?.GetType(type)?.GetMethod(method) != null;

    }
}


15);
	-moz-transform: scale(1.15);
	-o-transform: scale(1.15);
	-ms-transform: scale(1.15);
	transform: scale(1.15);
}
.plusitem:active {
	-webkit-transform: scale(1);
	-moz-transform: scale(1);
	-o-transform: scale(1);
	-ms-transform: scale(1);
	transform: scale(1);
}
.plusitemone, .plusitemtwo {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	margin: auto;
	background-color: #aad6df;
}
.plusitemone {
	width: 50%;
	height: 1px;
}
.plusitemtwo {
	width: 1px;
	height: 50%;
}

#expenseup, #expensedown {
	font-family: "Museo-300";
	font-size: 12px;
	color: #a2c1c6;
	font-style: italic;
	position: absolute;
	bottom:0px;
	margin: auto;
	width: 90px;
	height: 12px;
	cursor: pointer;
	text-align: center;
}
#expenseup {
	left: 63%;
}
#expensedown {
	left: 35%;
}
.frame {
	text-align: left;
	overflow: hidden;
	position: absolute;
	top:50px; left: 0; right: 0; bottom: 0;
	width: 100%;
	height: 284px;
}
.wrapper {
	position: absolute;
	top:0; left: 0; right: 0; bottom: 0;
	width: 100%;
	height: 100%;
}
#expenseslider {
	-webkit-transition: 0.25s;
	-moz-transition: 0.25s;
	-o-transition: 0.25s;
	-ms-transition: 0.25s;
	transition: 0.25s;
	display: none;
	position: absolute; /*RELATIVE!*/
	bottom: 0px;
	margin: auto;
	width: 100%;
}
.itembackground {
	display: block;
	position: relative;
	top: -26px;
	left: 25px;
}
.incomeitem, .expenseitem {
	-webkit-transition: 350ms ease-out;
	-moz-transition: 350ms ease-out;
	-o-transition: 350ms ease-out;
	-ms-transition: 350ms ease-out;
	transition: 350ms ease-out;
	background-position: 25px center;
	background-repeat: no-repeat;
	background-size: 42px 42px;
	border-bottom: 1px solid #e2e2e2;
	width: 100%;
	height: 70px;
	z-index: 500;
	cursor: pointer;
	overflow: hidden;
}
.incomeitem:hover, .expenseitem:hover {
	background-color: #fbfbfb;
}
.incomeitem:active, .expenseitem:active  {
	background-color: #f7f7f7;
}
.newitemadded {
	-webkit-animation: 4s newitemadded ease-out;
	-moz-animation: 4s newitemadded ease-out;
	-o-animation: 4s newitemadded ease-out;
	-ms-animation: 4s newitemadded ease-out;
	animation: 4s newitemadded ease-out;
}
.title11museo300 {
	font-family: "Museo-100";
	font-size: 14px;
	color: #676767;
	position: relative;
	left: 35%;
	top:12px;
}
.title9museo300 {
	font-family: "Museo-300";
	font-size: 9px;
	color: #676767;
	position: relative;
	left: 35%;
	top:20px;
}
.bolddigit20 {
	font-family: "Museo-50


mul	x13, x30, x4
  45f9b4:	9b083448 	madd	x8, x2, x8, x13
  45f9b8:	8b0b00ce 	add	x14, x6, x11
  45f9bc:	9a8681c6 	csel	x6, x14, x6, hi  // hi = pmore
  45f9c0:	8b098252 	add	x18, x18, x9, lsl #32
  45f9c4:	9b017dee 	mul	x14, x15, x1
  45f9c8:	8b538108 	add	x8, x8, x19, lsr #32
  45f9cc:	92407e73 	and	x19, x19, #0xffffffff
  45f9d0:	8b088273 	add	x19, x19, x8, lsl #32
  45f9d4:	9b0f7e2f 	mul	x15, x17, x15
  45f9d8:	8b498269 	add	x9, x19, x9, lsr #32
  45f9dc:	9b047e34 	mul	x20, x17, x4
  45f9e0:	8b0900c9 	add	x9, x6, x9
  45f9e4:	9b013c66 	madd	x6, x3, x1, x15
  45f9e8:	9b047c24 	mul	x4, x1, x4
  45f9ec:	eb0801bf 	cmp	x13, x8
  45f9f0:	9b027fde 	mul	x30, x30, x2
  45f9f4:	9b015041 	madd	x1, x2, x1, x20
  45f9f8:	8b4e80cd 	add	x13, x6, x14, lsr #32
  45f9fc:	9b117c63 	mul	x3, x3, x17
  45fa00:	92407dc6 	and	x6, x14, #0xffffffff
  45fa04:	9b117c51 	mul	x17, x2, x17
  45fa08:	8b0b03c2 	add	x2, x30, x11
  45fa0c:	8b448021 	add	x1, x1, x4, lsr #32
  45fa10:	9a9e805e 	csel	x30, x2, x30, hi  // hi = pmore
  45fa14:	8b0b0062 	add	x2, x3, x11
  45fa18:	eb0d01ff 	cmp	x15, x13
  45fa1c:	9a838043 	csel	x3, x2, x3, hi  // hi = pmore
  45fa20:	8b0d80c6 	add	x6, x6, x13, lsl #32
  45fa24:	eb01029f 	cmp	x20, x1
  45fa28:	92407c84 	and	x4, x4, #0xffffffff
  45fa2c:	8b0b022b 	add	x11, x17, x11
  45fa30:	8b06012e 	add	x14, x9, x6
  45fa34:	8b018084 	add	x4, x4, x1, lsl #32
  45fa38:	8b4883c8 	add	x8, x30, x8, lsr #32
  45fa3c:	9a918171 	csel	x17, x11, x17, hi  // hi = pmore
  45fa40:	eb13013f 	cmp	x9, x19
  45fa44:	9a9f27e2 	cset	x


d return the longest search domain entry", func() {
			searchDomains := []string{
				"pix3ob5ymm5jbsjessf0o4e84uvij588rz23iz0o.com",
				"3wg5xngig6vzfqjww4kocnky3c9dqjpwkewzlwpf.com",
				"t4lanpt7z4ix58nvxl4d.com",
				"14wg5xngig6vzfqjww4kocnky3c9dqjpwkewzlwpf.com",
				"4wg5xngig6vzfqjww4kocnky3c9dqjpwkewzlwpf.com",
			}
			domain := GetDomainName(searchDomains)
			Expect(domain).To(Equal("14wg5xngig6vzfqjww4kocnky3c9dqjpwkewzlwpf.com"))
		})
	})

	Context("subdomain", func() {
		It("should be added to the longest service domain", func() {
			searchDomains := []string{"default.svc.cluster.local", "svc.cluster.local", "cluster.local"}

			const subdomain = "subdomain"
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(subdomain + "." + searchDomains[0]))
		})

		It("should not be added if subdomain is empty", func() {
			searchDomains := []string{"default.svc.cluster.local", "svc.cluster.local", "cluster.local"}

			const subdomain = ""
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(""))
		})

		It("should be added even if the longest existing service domain isn't the first", func() {
			searchDomains := []string{"svc.cluster.local", "cluster.local", "default.svc.cluster.local"}

			const subdomain = "subdomain"
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(subdomain + "." + searchDomains[2]))
		})

		It("should not be added if the longest existing service domain already has it", func() {
			searchDomains := []string{"svc.cluster.local", "cluster.local", "subdomain.default.svc.cluster.local"}

			const subdomain = "subdomain"
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(""))
		})

		It("should be added to the right entry if the longest entry is not a service entry", func() {
			searchDomains := []string{"default.svc.cluster.local", "svc.cluster.local",
				"cluster.local", "this.is.a.very.very.very.long.entry"}

			const subdomain = "subdomain"
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(subdomain + "." + searchDomains[0]))
		})

		It("should not be added if there is no service entry", func() {
			searchDomains := []string{"example.com"}

			const subdomain = "subdomain"
			domain := DomainNameWithSubdomain(searchDomains, subdomain)
			Expect(domain).To(Equal(""))
		})
	})
})
/*
 * This file is part of the KubeVirt project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language


0000',
				tzName: 'LHST',
				tzOffsetFROM: '+1100',
				tzOffsetTO: '+1030',
				startMinutes: 0,
				startHours: 2,
				startMonth: 4,
				startDay: 0,
				startCount: 1
			},
			{
				dtStart: '19860316T020000',
				tzName: 'LHST',
				tzOffsetFROM: '+1100',
				tzOffsetTO: '+1030',
				startMinutes: 0,
				startHours: 2,
				rDates: ['20070325T020000','20060402T020000','20050327T020000','20040328T020000','20030330T020000','20020331T020000','20010325T020000','20000326T020000','19990328T020000','19980329T020000','19970330T020000','19960331T020000','19950305T020000','19940306T020000','19930307T020000','19920301T020000','19910303T020000','19900304T020000','19890319T020000','19880320T020000','19870315T020000','19860316T020000']
			},
			{
				dtStart: '19820307T020000',
				tzName: 'LHST',
				tzOffsetFROM: '+1130',
				tzOffsetTO: '+1030',
				startMinutes: 0,
				startHours: 2,
				rDates: ['19850303T020000','19840304T020000','19830306T020000','19820307T020000']
			},
			{
				dtStart: '19810301T000000',
				tzName: 'LHST',
				tzOffsetFROM: '+1000',
				tzOffsetTO: '+1030',
				startMinutes: 0,
				startHours: 0,
				rDates: ['19810301T000000']
			},
			{
				dtStart: '18950201T000000',
				tzName: 'AEST',
				tzOffsetFROM: '+103620',
				tzOffsetTO: '+1000',
				startMinutes: 0,
				startHours: 0,
				rDates: ['18950201T000000']
			}
		]
	},
	'Australia/Adelaide': {
		daylightComponents:
		[
			{
				dtStart: '20081005T020000',
				tzName: 'ACDT',
				tzOffsetFROM: '+0930',
				tzOffsetTO: '+1030',
				startMinutes: 0,
				startHours: 2,
				startMonth: 10,
				startDay: 0,
				startCount: 1
			},
			{
				dtStart: '19170101T000100',
				tzName: 'ACDT',
				tzOffsetFROM: '+0930',
				tzOffsetTO: '+1030',
				startMinutes: 1,
				startHours: 0,
				rDates: ['20071028T020000','20061029T020000','20051030T020000','20041031T020000','20031026T020000','20021027T020000','20011028T020000','20001029T020000','19991031T020000','19981025T020000','19971026T020000','19961027T020000','19951029T020000','19941030T020000','19931031T020000','19921025T020000','19911027T020000','19901028T020000','19891029T020000','19881030T020000','19871025T020000','19861019T020000','19851027T020000','19841028T020000','19831030T020000','19821031T020000','19811025T020000','19801026T020000','19791028T020000','19781029T020000','19771030T020000','19761031T020000','19751026T020000','19741027T020000','19731028T020000','19721029T020000','19711031T020000','19431003T020000','19420927T020000','


 Box::new(|_, _| None),
            x: 0.,
            y: 0.,
            phantom: PhantomData,
        }
    }
}

impl<D, G: Graph<D>> Force<D, G> for RadialForce<D, G> {
    fn build(&self, graph: &G) -> Box<dyn ForceContext> {
        let strength_accessor = &self.strength;
        let strength = graph.nodes().map(|u| strength_accessor(graph, u)).collect();

        let radius_accessor = &self.radius;
        let radius = graph.nodes().map(|u| radius_accessor(graph, u)).collect();

        Box::new(RadialForceContext::new(strength, radius, self.x, self.y))
    }
}
<reponame>typerslow/helix
#[macro_export]
macro_rules! key {
    ($key:ident) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::$key,
            modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
        }
    };
    ($($ch:tt)*) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
            modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
        }
    };
}

#[macro_export]
macro_rules! shift {
    ($key:ident) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::$key,
            modifiers: ::helix_view::keyboard::KeyModifiers::SHIFT,
        }
    };
    ($($ch:tt)*) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
            modifiers: ::helix_view::keyboard::KeyModifiers::SHIFT,
        }
    };
}

#[macro_export]
macro_rules! ctrl {
    ($key:ident) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::$key,
            modifiers: ::helix_view::keyboard::KeyModifiers::CONTROL,
        }
    };
    ($($ch:tt)*) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
            modifiers: ::helix_view::keyboard::KeyModifiers::CONTROL,
        }
    };
}

#[macro_export]
macro_rules! alt {
    ($key:ident) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::$key,
            modifiers: ::helix_view::keyboard::KeyModifiers::ALT,
        }
    };
    ($($ch:tt)*) => {
        ::helix_view::input::KeyEvent {
            code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
            modifiers: ::helix_view::keyboard::KeyModifiers::ALT,
        }
    };
}

/// Macro for defining the root of a `Keymap` object. Example:
///
/// ```
/// # use helix_core::hashmap;
/// # use helix_term::keymap;
/// # use helix_term::keymap::Keymap;
/// let normal_mode = keymap!({ "Normal mode"
///     "i" => insert_mode,
///     "g" => { "Goto"
///         "g" => goto_file_start,
///         "e" => goto_file_end,
///     },
///     "j" | "down" => move_line_down,
/// });
/// let keymap = Keymap::new(normal_mode);
/// ```
#[macro_export]
macro_rules! keymap {
    (@trie $cmd:ident) => {
        $crate::keymap::KeyTrie::Leaf($crate::command


t: Int) {
            //删除对应缓存
            displayNodeList.removeRange(fromPosition, fromPosition + oldItemCount)
            //增加缓存容量
            displayNodeList.addAll(fromPosition, arrayOfNulls<ShieldDisplayNode>(newItemCount).asList())

            //全量notify
            listObservables.forEach {
                it.onChanged()
            }
        }

        override fun onChanged(sender: RangeHolder) {
            //清空缓存
            displayNodeList = RangeRemoveableArrayList(arrayOfNulls<ShieldDisplayNode>(size()).asList())
            listObservables.forEach {
                it.onChanged()
            }
        }

        //只是position内容发生变化，整体range没有变化
        override fun onItemRangeChanged(sender: RangeHolder, positionStart: Int, itemCount: Int) {
            //失效缓存
            for (i in positionStart until positionStart + itemCount) {
                displayNodeList[i] = null
            }
            listObservables.forEach {
                it.onItemRangeChanged(positionStart, itemCount)
            }
        }

        override fun onItemRangeInserted(sender: RangeHolder, positionStart: Int, itemCount: Int) {
            //增加缓存容量
            displayNodeList.addAll(positionStart, arrayOfNulls<ShieldDisplayNode>(itemCount).asList())
            listObservables.forEach {
                it.onItemRangeInserted(positionStart, itemCount)
            }

        }

        override fun onItemRangeRemoved(sender: RangeHolder, positionStart: Int, itemCount: Int) {
            //删除对应缓存
            displayNodeList.removeRange(positionStart, positionStart + itemCount)
            listObservables.forEach {
                it.onItemRangeRemoved(positionStart, itemCount)
            }
        }

        override fun onItemRangeMoved(sender: RangeHolder, fromPosition: Int, toPosition: Int) {
            //not support
        }

    }
}package com.dianping.shield.node.cellnode.callback

import android.content.Context
import android.view.View
import android.view.ViewGroup
import com.dianping.shield.node.cellnode.NodePath
import com.dianping.shield.node.cellnode.ShieldDisplayNode
import com.dianping.shield.node.itemcallbacks.ViewPaintingCallback
import com.dianping.shield.node.processor.NodeCreator

/**
 * Created by zhi.he on 2018/6/26.
 * originCallback Item上的原始callback
 */
class DefaultViewPaintingCallback(var originCallback: ViewPaintingCallback) : ViewPaintingCallback {
    override fun updateView(view: View, data: Any?, path: NodePath?) {
        if (data is ShieldDisplayNode) {
            originCallback.updateView(view, data.data, path)
        } else {
            originCallback.updateView(view, data, path)
        }
    }

    override fun onCreateView(context: Context, parent: ViewGroup?, viewType: String?): View {
        val originViewType = NodeCreator.revertViewType(viewType)
        return originCallback.onCreateView(context, parent, originViewType)
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as DefaultViewPaintingCallback

        if (originCallback != other.originCallback) return false

        return true
    }

    override fun hashCode(): Int {
        return originCallback.hashCode()
    }

}package com.dianping.shield.node.cellnode.callback.lazyload

import com.dianping.shield.entity.CellType
import com.dianping.shield.node.cellnode.ShieldDisplayNode
import com.dianping.shield.node.cellnode.ShieldRow
import com.dianping.shield.node.cellnode.ShieldSection
import com.dianping.shield.node.itemcallbacks.lazy.LazyLoadRowItemProvider
import com.dianping.shield.node.processor.ProcessorHolder
import com.


			"failed": 0,
					"skipped": 0,
					"successful": 1,
					"total": 1
				},
				"aggregations": {
					"maxAgg": {
						"value": 1199.72900390625
					},
					"minAgg": {
						"value": 100.14596557617188
					}
				},
				"hits": {
					"hits": [],
					"max_score": null,
					"total": {
						"relation": "eq",
						"value": 2156
					}
				},
				"timed_out": false,
				"took": 130
			},
			"start_time_in_millis": 1740835409689
		}`,
		ExpectedPancakeResults: []model.QueryResultRow{
			{Cols: []model.QueryResultCol{
				model.NewQueryResultCol("metric__maxAgg_col_0", 1199.72900390625),
				model.NewQueryResultCol("metric__minAgg_col_0", 100.14596557617188),
			}},
		},
		ExpectedPancakeSQL: `
			SELECT maxOrNull("AvgTicketPrice") AS "metric__maxAgg_col_0",
			  minOrNull("AvgTicketPrice") AS "metric__minAgg_col_0"
			FROM __quesma_table_name
			WHERE ("timestamp">=__quesma_from_unixtime64mili(1740230608853) AND "timestamp"<=
			  __quesma_from_unixtime64mili(1740835408853))`,
	},
	{ // [1]
		TestName: "fill out when panel starts missing - don't know which panel it is",
		QueryRequestJson: `
		{
			"_source": {
				"excludes": []
			},
			"aggs": {
				"maxAgg": {
					"max": {
						"field": "FlightDelayMin"
					}
				},
				"minAgg": {
					"min": {
						"field": "FlightDelayMin"
					}
				}
			},
			"fields": [
				{
					"field": "timestamp",
					"format": "date_time"
				}
			],
			"query": {
				"bool": {
					"filter": [
						{
							"range": {
								"timestamp": {
									"format": "strict_date_optional_time",
									"gte": "2025-02-22T13:23:28.853Z",
									"lte": "2025-03-01T13:23:28.853Z"
								}
							}
						}
					],
					"must": [],
					"must_not": [
						{
							"match_phrase": {
								"FlightDelayMin": {
									"query": 0
								}
							}
						}
					],
					"should": []
				}
			},
			"runtime_mappings": {
				"hour_of_day": {
					"script": {
						"source": "emit(doc['timestamp'].value.getHour());"
					},
					"type": "long"
				}
			},
			"script_fields": {},
			"size": 0,
			"stored_fields": [
				"*"
			],
			"track_total_hits": true
		}`,
		ExpectedResponse: `
		{
			"completion_time_in_millis": 1740835409723,
			"expiration_time_in_millis": 1740835469689,
			"id": "Fmd4bDdrWGNnUTJ1UWt2b3ZiNVRSbUEdUEQ3d19oVkxSMEthNU02NjIwRGpkZzo2NjU5MTc=",
			"is_partial": false,
			"is_running": false,
			"response": {
				"_shards": {
					"failed": 0,
					"skipped": 0,
					"successful": 1,
					"total": 1
				},
				"aggregations": {
					"maxAgg": {
						"value


 'package:flutter_dmzj/widgets/status/app_empty_widget.dart';
import 'package:get/get.dart';
import 'package:remixicon/remixicon.dart';

class NovelDownloadingView extends StatelessWidget {
  const NovelDownloadingView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Expanded(
          child: Obx(
            () => Stack(
              children: [
                ListView.separated(
                  itemCount: NovelDownloadService.instance.taskQueues.length,
                  separatorBuilder: (_, i) => const Divider(
                    height: 1,
                  ),
                  itemBuilder: (_, i) {
                    var task = NovelDownloadService.instance.taskQueues[i];
                    return buildItem(task);
                  },
                ),
                Offstage(
                  offstage: NovelDownloadService.instance.taskQueues.isNotEmpty,
                  child: const AppEmptyWidget(),
                ),
              ],
            ),
          ),
        ),
        BottomAppBar(
          child: SizedBox(
            height: 48,
            child: Row(
              children: [
                Expanded(
                  child: TextButton.icon(
                    style: TextButton.styleFrom(
                      textStyle: const TextStyle(fontSize: 14),
                    ),
                    onPressed: NovelDownloadService.instance.pauseAll,
                    icon: const Icon(
                      Remix.pause_line,
                      size: 20,
                    ),
                    label: const Text("暂停全部"),
                  ),
                ),
                Expanded(
                  child: TextButton.icon(
                    style: TextButton.styleFrom(
                      textStyle: const TextStyle(fontSize: 14),
                    ),
                    onPressed: NovelDownloadService.instance.resumeAll,
                    icon: const Icon(
                      Remix.download_line,
                      size: 20,
                    ),
                    label: const Text("开始全部"),
                  ),
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }

  Widget buildItem(NovelDownloader task) {
    return Obx(
      () => Padding(
        padding: AppStyle.edgeInsetsA12,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Text(
              "${task.info.value.volumeName} - ${task.info.value.chapterName}",
            ),
            Text(
              task.info.value.novelName,
              style: Get.textTheme.bodySmall,
            ),
            Row(
              children: [
                Expanded(
                  child: Text(
                    parseStatus(task.info.value.status),
                    style: Get.textTheme.bodySmall,
                  ),
                ),
                Row(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    buildButton(
                      icon: Icons.refresh_rounded,
                      text: "重试",
                      visible: task.status == DownloadStatus.error ||
                          task.status == DownloadStatus.errorLoad,
                      onPressed: () {
                        task.retry();
                      },
                    ),
                    buildButton(
                      icon: Icons.play_arrow_rounded,
                      visible: task.status == DownloadStatus.wait ||
                          task.status == DownloadStatus.pauseCellular,
                      text: "开始",
                      onPressed: () {
                        task.start();
                      },
                    ),
                    buildButton(
                      icon: Icons.play_arrow_rounded,
                      visible: task.status == DownloadStatus.pause,
                      te


oringOptions {}
impl ::core::clone::Clone for MediaMirroringOptions {
    fn clone(&self) -> Self {
        *self
    }
}
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct MediaPixelFormat(pub i32);
impl MediaPixelFormat {
    pub const Nv12: Self = Self(0i32);
    pub const Bgra8: Self = Self(1i32);
    pub const P010: Self = Self(2i32);
}
impl ::core::marker::Copy for MediaPixelFormat {}
impl ::core::clone::Clone for MediaPixelFormat {
    fn clone(&self) -> Self {
        *self
    }
}
pub type MediaPropertySet = *mut ::core::ffi::c_void;
pub type MediaRatio = *mut ::core::ffi::c_void;
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct MediaRotation(pub i32);
impl MediaRotation {
    pub const None: Self = Self(0i32);
    pub const Clockwise90Degrees: Self = Self(1i32);
    pub const Clockwise180Degrees: Self = Self(2i32);
    pub const Clockwise270Degrees: Self = Self(3i32);
}
impl ::core::marker::Copy for MediaRotation {}
impl ::core::clone::Clone for MediaRotation {
    fn clone(&self) -> Self {
        *self
    }
}
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct MediaThumbnailFormat(pub i32);
impl MediaThumbnailFormat {
    pub const Bmp: Self = Self(0i32);
    pub const Bgra8: Self = Self(1i32);
}
impl ::core::marker::Copy for MediaThumbnailFormat {}
impl ::core::clone::Clone for MediaThumbnailFormat {
    fn clone(&self) -> Self {
        *self
    }
}
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct SphericalVideoFrameFormat(pub i32);
impl SphericalVideoFrameFormat {
    pub const None: Self = Self(0i32);
    pub const Unsupported: Self = Self(1i32);
    pub const Equirectangular: Self = Self(2i32);
}
impl ::core::marker::Copy for SphericalVideoFrameFormat {}
impl ::core::clone::Clone for SphericalVideoFrameFormat {
    fn clone(&self) -> Self {
        *self
    }
}
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct StereoscopicVideoPackingMode(pub i32);
impl StereoscopicVideoPackingMode {
    pub const None: Self = Self(0i32);
    pub const SideBySide: Self = Self(1i32);
    pub const TopBottom: Self = Self(2i32);
}
impl ::core::marker::Copy for StereoscopicVideoPackingMode {}
impl ::core::clone::Clone for StereoscopicVideoPackingMode {
    fn clone(&self) -> Self {
        *self
    }
}
pub type TimedMetadataEncodingProperties = *mut ::core::ffi::c_void;
pub type VideoEncodingProperties = *mut ::core::ffi::c_void;
#[doc = "*Required features: 'Media_MediaProperties'*"]
#[repr(transparent)]
pub struct VideoEncodingQuality(pub i32);
impl VideoEncodingQuality {
    pub const Auto: Self = Self(0i32);
    pub const HD1080p: Self = Self(1i32);
    pub const HD720p: Self = Self(2i32);
    pub const Wvga: Self = Self(3i32);
    pub const Ntsc: Self = Self(4i32);
    pub const Pal: Self = Self(5i32);
    pub const Vga: Self = Self(6i32);
    pub const Qvga: Self = Self(7i32);
    pub const Uhd2160p: Self = Self(8i32);
    pub const Uhd4320p


 "package-preview-2021-07-02", not(feature = "no-default-tag")))]
pub use package_preview_2021_07_02::{models, operations, operations::Client, operations::ClientBuilder};
#[cfg(feature = "package-preview-2021-03")]
pub mod package_preview_2021_03;
#[cfg(all(feature = "package-preview-2021-03", not(feature = "no-default-tag")))]
pub use package_preview_2021_03::{models, operations, operations::Client, operations::ClientBuilder};
#[cfg(feature = "package-preview-2021-02")]
pub mod package_preview_2021_02;
#[cfg(all(feature = "package-preview-2021-02", not(feature = "no-default-tag")))]
pub use package_preview_2021_02::{models, operations, operations::Client, operations::ClientBuilder};
#[cfg(feature = "package-preview-2020-08-31")]
pub mod package_preview_2020_08_31;
#[cfg(all(feature = "package-preview-2020-08-31", not(feature = "no-default-tag")))]
pub use package_preview_2020_08_31::{models, operations, operations::Client, operations::ClientBuilder};
//! Linear Quadtree.
//! # Contracts:
//! - Key axis must be an integer in the interval [0, 2^16)
//!
pub mod quadtree;
pub mod morton_table;

use std::ops::{Add, AddAssign, Deref};

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct Point(pub [u32; 2]);

impl AddAssign for Point {
    fn add_assign(&mut self, p: Self) {
        self.0[0] += p.0[0];
        self.0[1] += p.0[1];
    }
}

impl Deref for Point {
    type Target = [u32; 2];
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl Add for Point {
    type Output = Self;

    fn add(mut self, rhs: Self) -> Self {
        self += rhs;
        self
    }
}

impl Point {
    pub fn new(x: u32, y: u32) -> Self {
        Self([x, y])
    }

    pub fn dist(&self, rhs: &Self) -> u32 {
        let x = self[0] as i32 - rhs[0] as i32;
        let y = self[1] as i32 - rhs[1] as i32;
        let squared = (x * x + y * y) as f32;
        let res = squared.sqrt();
        res as u32
    }
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct Value(pub u32);
//! Test client and server TLS connected with TLS.

extern crate bytes;
extern crate env_logger;
extern crate futures;
extern crate httpbis;
extern crate regex;
extern crate tls_api;
extern crate tls_api_native_tls;
extern crate tokio_core;
extern crate tokio_tls_api;

extern crate httpbis_test;
use httpbis_test::*;

use bytes::Bytes;

use std::sync::Arc;

use futures::future::Future;

use httpbis::Headers;
use httpbis::SimpleHttpMessage;
use httpbis::*;

use httpbis::AnySocketAddr;

use tls_api::Certificate;
use tls_api::TlsAcceptorBuilder as tls_api_TlsAcceptorBuilder;
use tls_api::TlsConnector as tls_api_TlsConnector;
use tls_api::TlsConnectorBuilder;
use tls_api_native_tls::TlsAcceptor;
use tls_api_native_tls::TlsAcceptorBuilder;
use tls_api_native_tls::TlsConnector;

fn test_tls_acceptor() -> TlsAcceptor {
    let pkcs12 = include_bytes!("ident


printStackTrace();
        }
        chunkPCMDataContainer= new ArrayList<>();
        initMediaDecode();//解码器

        if (encodeType == MediaFormat.MIMETYPE_AUDIO_AAC) {
            initAACMediaEncode();//AAC编码器
        }else if (encodeType == MediaFormat.MIMETYPE_AUDIO_MPEG) {
            initMPEGMediaEncode();//mp3编码器
        }

    }

    /**
     * 初始化解码器
     */
    private void initMediaDecode() {
        try {
            mediaExtractor=new MediaExtractor();//此类可分离视频文件的音轨和视频轨道
            mediaExtractor.setDataSource(srcPath);//媒体文件的位置
            for (int i = 0; i < mediaExtractor.getTrackCount(); i++) {//遍历媒体轨道 此处我们传入的是音频文件，所以也就只有一条轨道
                MediaFormat format = mediaExtractor.getTrackFormat(i);
                String mime = format.getString(MediaFormat.KEY_MIME);
                if (mime.startsWith("audio")) {//获取音频轨道
//                    format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, 200 * 1024);
                    mediaExtractor.selectTrack(i);//选择此音频轨道
                    mediaDecode = MediaCodec.createDecoderByType(mime);//创建Decode解码器
                    mediaDecode.configure(format, null, null, 0);
                    break;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        if (mediaDecode == null) {
            Log.e(TAG, "create mediaDecode failed");
            return;
        }
        mediaDecode.start();//启动MediaCodec ，等待传入数据
//        decodeInputBuffers=mediaDecode.getInputBuffers();//MediaCodec在此ByteBuffer[]中获取输入数据
//        decodeOutputBuffers=mediaDecode.getOutputBuffers();//MediaCodec将解码后的数据放到此ByteBuffer[]中 我们可以直接在这里面得到PCM数据
        decodeBufferInfo=new MediaCodec.BufferInfo();//用于描述解码得到的byte[]数据的相关信息
        showLog("buffers:" + decodeInputBuffers.length);
    }

    /**
     * 初始化AAC编码器
     */
    private void initAACMediaEncode() {
        try {
            MediaFormat encodeFormat = MediaFormat.createAudioFormat(encodeType, 44100, 2);//参数对应-> mime type、采样率、声道数
            encodeFormat.setInteger(MediaFormat.KEY_BIT_RATE, 96000);//比特率
            encodeFormat.setInteger(MediaFormat.KEY_AAC_PROFILE, MediaCodecInfo.CodecProfileLevel.AACObjectLC);
            encodeFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, 100 * 1024);
            mediaEncode = MediaCodec.createEncoderByType(encodeType);
            mediaEncode.configure(encodeFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
        } catch (IOException e) {
            e.printStackTrace();
        }

        if (mediaEncode == null) {
            Log.e(TAG, "create mediaEncode failed");
            return;
        }
        mediaEncode.start();
        encodeInputBuffers=mediaEncode.getInputBuffers();
        encodeOutputBuffers=mediaEncode.getOutputBuffers();
        encodeBufferInfo=new MediaCodec.BufferInfo();
    }


 iframe{width:600px!important}}@media screen and (max-height:900px){.modaal-instagram iframe{width:500px!important}.modaal-video-container{max-width:900px;max-height:510px}}@media only screen and (max-height:820px){.modaal-gallery-label{display:none}}@keyframes instaReveal{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes instaReveal{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes modaal-loading-spinner{0%{opacity:1;-ms-transform:scale(1.5);-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:.1;-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1)}}@keyframes modaal-loading-spinner{0%{opacity:1;-ms-transform:scale(1.5);-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:.1;-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1)}}/* ambiance theme for codemirror */

/* Color scheme */

.cm-s-ambiance .cm-keyword { color: #cda869; }
.cm-s-ambiance .cm-atom { color: #CF7EA9; }
.cm-s-ambiance .cm-number { color: #78CF8A; }
.cm-s-ambiance .cm-def { color: #aac6e3; }
.cm-s-ambiance .cm-variable { color: #ffb795; }
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
.cm-s-ambiance .cm-variable-3 { color: #faded3; }
.cm-s-ambiance .cm-property { color: #eed1b3; }
.cm-s-ambiance .cm-operator {color: #fa8d6a;}
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
.cm-s-ambiance .cm-string { color: #8f9d6a; }
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
.cm-s-ambiance .cm-meta { color: #D2A8A1; }
.cm-s-ambiance .cm-qualifier { color: yellow; }
.cm-s-ambiance .cm-builtin { color: #9999cc; }
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
.cm-s-ambiance .cm-tag { color: #fee4ff }
.cm-s-ambiance .cm-attribute {  color: #9B859D; }
.cm-s-ambiance .cm-header {color: blue;}
.cm-s-ambiance .cm-quote { color: #24C2C7; }
.cm-s-ambiance .cm-hr { color: pink; }
.cm-s-ambiance .cm-link { color: #F4C20B; }
.cm-s-ambiance .cm-special { color: #FF9D00; }
.cm-s-ambiance .cm-error { color: #AF2018; }

.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
.cm-s-ambiance .C


课程评价统计
func courseCountEvaluate() {
	var courseEvas []model.CourseEvaluate
	model.DB().Where("status = 1").Order("course_id desc, lesson_id desc").Find(&courseEvas)
	var (
		courseID      string
		lessonID      string
		all           int
		good          int
		normal        int
		bad           int
		star          float64
		sum           int
		callNameCount map[int]int
		taskCount     map[int]int
		examTypeCount map[int]int

		// 运行统计
		runCount int
	)
	for k, courseEva := range courseEvas {
		if courseID != courseEva.CourseID || lessonID != courseEva.LessonID {
			if courseID != "" && lessonID != "" {
				star = float64(sum) / float64(all)
				courseCount := model.CourseCount{}
				if err := model.DB().Where("course_id = ? and lesson_id = ?", courseID, lessonID).First(&courseCount).Error; err != nil {
					log.Printf("%s -- %s -- %s,不存在", courseID, lessonID, courseEvas[k-1].CourseName)
				} else {
					courseCount.Star = star
					courseCount.Good = good
					courseCount.Normal = normal
					courseCount.Bad = bad
					courseCount.ExamType = max(examTypeCount)
					courseCount.Task = max(taskCount)
					courseCount.CallName = max(callNameCount)
					model.DB().Save(&courseCount)
					runCount++
				}
			}
			courseID = courseEva.CourseID
			lessonID = courseEva.LessonID
			// 初始化
			all, sum, good, normal, bad = 0, 0, 0, 0, 0
			// 统计
			taskCount = make(map[int]int)
			callNameCount = make(map[int]int)
			examTypeCount = make(map[int]int)
		}
		all++
		sum = sum + courseEva.Star
		taskCount[courseEva.Task]++
		callNameCount[courseEva.CallName]++
		examTypeCount[courseEva.ExamType]++
		switch courseEva.Star {
		case 3:
			good++
		case 2:
			normal++
		case 1:
			bad++
		}
	}
	log.Println("总计成功统计课程:", runCount)
}

func max(data map[int]int) int {
	maxVal := 0
	maxKey := 0
	for k, v := range data {
		if maxVal < v {
			maxKey = k
			maxVal = v
		}
	}
	return maxKey
}
package model

// CourseEvaluate 评价表，包含用户的评价
type CourseEvaluate struct {
	Model
	NickName   string `json:"nick_name"`
	Avatar     string `json:"avatar"`
	UserID     uint   `json:"user_id"`
	CourseID   string `json:"course_id"`               // 课程号
	LessonID   string `json:"lesson_id"`               // 课序号
	Comment    string `json:"comment"`                 // 评价信息
	CallName   int    `json:"call_name"`               // 点名/签到方式: 0: 不点名, 1: 偶尔抽点 2: 偶尔全点 3: 全点
	ExamType   int    `json:"exam_type"`               // 考核方式: 0: 论文, 1: 考试, 2:大作业, 3: 其他
	Task       int    `json:"task"`                    // 作业: 0: 无作业, 2: 有作业
	Star       int    `json:"star"`                    // 评分 1-3分
	Score      int    `json:"score"`                   // 计分, 分数代表本条评价的权重
	Status     int    `json:"status" gorm:"default:1"` // 是否显示，-1: 不显示, 1: 显示
	CourseName string `json:"course_name"`             // 课程名
}

// CBNewCourseEvaluate 回调函数：如果评教信息不存在则新建一条
// 应用于成绩新增，课程表更新，评教更新
func CBNewCourseEvaluate(uid uint


g and top_flag:
            target_button = 2  # temp_down
        elif left_flag and bot_flag:
            target_button = 3  # cooling
        elif center_flag and bot_flag:
            target_button = 4  # fan
        elif right_flag and bot_flag:
            target_button = 5  # off

        # Update colorFlags in shared data
        if target_button is not None:
            # Set the target button's colorFlag to True (automatically sets others to False)
            self.data.update_color_flag(target_button, True)
        else:
            # No valid gaze position, clear all colorFlags
            data = self.data.read_memory()
            if any(data['color_flags']):
                for i in range(6):
                    if data['color_flags'][i]:
                        self.data.update_color_flag(i, False)
                        break

        # Update secondFlag based on mouth state
        current_data = self.data.read_memory()
        if mouth_open != current_data['second_flag']:
            self.data.update_second_flag(mouth_open)

    def run(self):
        """Run the main tracking loop."""
        cap = cv2.VideoCapture(0)

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

                start_time = time.time()
                results = self.process_frame(frame)

                self.map_gaze_to_buttons(results)

                if results:
                    # Here you can add your application logic
                    # For example, logging results or controlling external systems
                    print(f"Position flags: {results}")

                key = cv2.waitKey(1)
                if key == 27:  # ESC key
                    break

        finally:
            cap.release()
            cv2.destroyAllWindows()

def main():
    """Run the eye tracking system."""
    try:
        system = EyeTrackingSystem()
        system.run()
    except FileNotFoundError:
        print("Calibration file not found. Please run calibration first.")
        print("Run: python main_calibration.py")

if __name__ == "__main__":
    main()


lasses:\n{:?}\n",
            node_id,
            zwave.node(node_id).map(|n| n.get_commands())
        );

        // Turn each node on
        zwave
            .node(node_id)
            .map(|n| n.basic_set(0x00))
            .unwrap()
            .unwrap();

        // Get the status for each node
        println!(
            "Node 3 Status: {:?}",
            zwave.node(node_id).map(|n| n.basic_get())
        );
    }

    loop {
        let duration = time::Duration::from_millis(50);
        thread::sleep(duration);
    }
}
use super::complex::Complex;
use wasm_bindgen::prelude::*;

/// Returns e^(i theta) for real theta.
#[wasm_bindgen(js_name = ComplexFunctions_Cis)]
pub fn cis(theta: f64) -> Complex {
    let c = theta.cos();
    let s = theta.sin();
    Complex::new(c, s)
}
<gh_stars>0
use crate::errors::{SharingError, WebError};
use libchordr::data_exchange::setlist::SerializeService as LibChordrSerializeService;
use libchordr::data_exchange::DxSerializer;
use libchordr::models::setlist::Setlist;

pub struct SerializeService {}

impl SerializeService {
    pub fn serialize(setlist: &Setlist) -> Result<String, WebError> {
        Ok(LibChordrSerializeService::serialize(setlist).map_err(|e| SharingError::from(e))?)
    }
}
<reponame>olson-sean-k/bismuth
use arrayvec::ArrayVec;
use num::Bounded;
use std::convert::{AsMut, AsRef};
use std::ops::{Deref, DerefMut};

use cube::edit::Cursor;
use cube::geometry::Geometry;
use cube::space::{self, Intersects, LogWidth, Partition, RayCast, RayIntersection, Spatial};
use cube::traverse::{PathTraversal, Traversal};
use cube::CubeError;
use math::{Clamp, FRay3, FScalar, UPoint3};
use resource::ResourceId;

type NodeLink = Box<[Node; 8]>;

pub enum Node {
    Leaf(LeafNode),
    Branch(BranchNode),
}

impl Node {
    fn new() -> Self {
        Node::Leaf(LeafNode::new())
    }

    pub fn is_leaf(&self) -> bool {
        match *self {
            Node::Leaf(..) => true,
            _ => false,
        }
    }

    pub fn as_leaf(&self) -> Option<&LeafNode> {
        match *self {
            Node::Leaf(ref leaf) => Some(leaf),
            _ => None,
        }
    }

    pub fn as_leaf_mut(&mut self) -> Option<&mut LeafNode> {
        match *self {
            Node::Leaf(ref mut leaf) => Some(leaf),
            _ => None,
        }
    }

    pub fn as_branch(&self) -> Option<&BranchNode> {
        match *self {
            Node::Branch(ref branch) => Some(branch),
            _ => None,
        }
    }

    pub fn as_branch_mut(&mut self) -> Option<&mut BranchNode> {
        match *self {
            Node::Branch(ref mut branch) => Some(branch),
            _ => None,
        }
    }

    fn hint(&self) -> &Hint {
        match *self {
            Node::Leaf(ref leaf) => &leaf.hint,
            Node::Branch(ref branch) => &branch.hint,
        }
    }

    #[allow(dead_code)]
    fn hint_mut(&mut self) -> &mut Hint {
        match *self {
            Node::Leaf(ref mut leaf) => &mut leaf.hint,
            Node::Branch(ref mut branch) => &mut branch.hint,
        }
    }

    fn as_orphan(&self) -> (OrphanNode<&LeafPayload, &BranchPayload>, Option<&NodeLink>) {
        match *self {
            Node::Le


 block. Reason: {:?}", other))
        }
    }
}
use super::component::*;
use super::plane::Plane;
use super::triangle::Triangle;
use super::Camera;
use super::Entity;
use crate::rendering;
use crate::vertex::*;
use pantheon::context::Context;
use pantheon::graphics::prelude::*;
use pantheon::graphics::Drawable;
use pantheon::input::mouse;
use pantheon::math::*;
use pantheon::winit::event::MouseButton;

pub fn _get_unit_cube_verts() -> [Vec3; 8] {
    [
        // front
        Vec3::new(-0.5, -0.5, 0.5),
        Vec3::new(0.5, -0.5, 0.5),
        Vec3::new(0.5, 0.5, 0.5),
        Vec3::new(-0.5, 0.5, 0.5),
        // back
        Vec3::new(-0.5, -0.5, -0.5),
        Vec3::new(0.5, -0.5, -0.5),
        Vec3::new(0.5, 0.5, -0.5),
        Vec3::new(-0.5, 0.5, -0.5),
    ]
}

pub fn get_cube_verts(size: f32) -> [Vec3; 8] {
    [
        // front
        size * Vec3::new(-0.5, -0.5, 0.5),
        size * Vec3::new(0.5, -0.5, 0.5),
        size * Vec3::new(0.5, 0.5, 0.5),
        size * Vec3::new(-0.5, 0.5, 0.5),
        // back
        size * Vec3::new(-0.5, -0.5, -0.5),
        size * Vec3::new(0.5, -0.5, -0.5),
        size * Vec3::new(0.5, 0.5, -0.5),
        size * Vec3::new(-0.5, 0.5, -0.5),
    ]
}

pub fn cube_normals() -> [Vec3; 8] {
    [
        (0, 0, 1).into(),  // front
        (1, 0, 0).into(),  // right
        (0, 1, 0).into(),  // bottom
        (-1, 0, 0).into(), // left
        (0, -1, 0).into(), // top
        (0, 0, -1).into(), // back
        (0, 0, 0).into(),
        (0, 0, 0).into(),
    ]
}

#[rustfmt::skip]
fn cube_indices() -> [u32; 36] {
    [
        // front
        0, 1, 2,
        0, 2, 3,
        // right
        1, 6, 2,
        1, 5, 6,
        // bottom
        2, 7, 3,
        2, 6, 7,
        // left
        3, 4, 0,
        3, 7, 4,
        // top
        4, 1, 0,
        4, 5, 1,
        // back
        5, 4, 7,
        5, 7, 6,
    ]
}

pub fn cuboid_default_colors() -> [Color; 8] {
    // from https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_05#Adding_the_3rd_dimension
    [
        // front colors
        (1.0, 0.0, 0.0).into(),
        (0.0, 1.0, 0.0).into(),
        (0.0, 0.0, 1.0).into(),
        (1.0, 1.0, 1.0).into(),
        // back colors
        (1.0, 0.0, 0.0).into(),
        (0.0, 1.0, 0.0).into(),
        (0.0, 0.0, 1.0).into(),
        (1.0, 1.0, 1.0).into(),
    ]
}

#[derive(Debug, Copy, Clone)]
enum CubioidVertMode {
    Shaded([ShadedVertex; 8]),
    Basic([BasicVertex; 8]),
}

#[allow(dead_code)]
impl CubioidVertMode {
    pub fn is_vertex(&self) -> bool {
        match self {
            &CubioidVertMode::Basic(_) => true,
            _ => false,
        }
    }

    pub fn as_basic(&self) -> &[BasicVertex; 8] {
        match self {
            &CubioidVertMode::Basic(ref verts) => verts,
            _ => panic!("bad usage"),
        }
    }

    pub fn try_as_basic(&self) -> Option<&[BasicVertex; 8]> {
        match self {
            &CubioidVertMode::Basic(


yt,Dyt];function Oyt(e,t){return f(),J("svg",zyt,_yt)}const Pyt={render:Oyt},Ayt={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"1000",height:"324.683",overflow:"visible",style:{overflow:"visible"},viewBox:"0 0 1000 324.684"},Kyt=w("path",{d:"M651.185.5c-70.933 0-134.322 36.766-134.322 104.694 0 77.9 112.423 83.28 112.423 122.415 0 16.478-18.884 31.229-51.137 31.229-45.773 0-79.984-20.611-79.984-20.611l-14.638 68.547s39.41 17.41 91.734 17.41c77.552 0 138.576-38.572 138.576-107.66 0-82.316-112.89-87.537-112.89-123.86 0-12.91 15.501-27.053 47.662-27.053 36.286 0 65.892 14.99 65.892 14.99l14.326-66.204S696.614.5 651.185.5zM2.218 5.497.5 15.49s29.842 5.461 56.719 16.356c34.606 12.492 37.072 19.765 42.9 42.353l63.51 244.832h85.138L379.927 5.497h-84.942L210.707 218.67l-34.39-180.696c-3.154-20.68-19.13-32.477-38.685-32.477H2.218zm411.865 0L347.449 319.03h80.999l66.4-313.534h-80.765zm451.759 0c-19.532 0-29.88 10.457-37.474 28.73L709.699 319.03h84.942l16.434-47.468h103.483l9.994 47.468H999.5L934.115 5.497h-68.273zm11.047 84.707 25.178 117.653h-67.454L876.89 90.204z",style:{fill:"#1434cb","fill-opacity":"1",stroke:"none"}},null,-1),$yt=[Kyt];function qyt(e,t){return f(),J("svg",Ayt,$yt)}const tXt={render:qyt},eXt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},iXt=w("path",{stroke:"currentColor","stroke-width":"2",d:"M2 5a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v9.586a1 1 0 0 1-.293.707l-4.414 4.414a1 1 0 0 1-.707.293H3a1 1 0 0 1-1-1V5Z"},null,-1),nXt=w("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M8 12h8"},null,-1),lXt=[iXt,nXt];function rXt(e,t){return f(),J("svg",eXt,lXt)}const aXt={render:rXt},sXt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 76 76"},oXt=w("path",{fill:"currentColor","fill-rule":"evenodd",d:"M15.89 15.07 38 26.543v22.9


       final v0 = un.addVariant(variant: 0, property: 'v0');
//       expect(un.discriminator.encode(v0.variant, b), dlo.span);
//       expect(un.getVariant(b.toBytes()), v0);
//       expect(un.decode(b.toBytes()), {"v0": true});
//     });
//     test('basics', () {
//       final dlo = LayoutConst.u8();
//       final vlo = SequenceLayout(
//           elementLayout: LayoutConst.u8(), count: ConstantLayout(8));
//       final un = Union(dlo, defaultLayout: vlo);
//       final SequenceLayout clo = un.defaultLayout as SequenceLayout;
//       final b = LayoutByteWriter.filled(9, 0);

//       expect(un.span, 9);
//       expect(un.getSpan(null), un.span);
//       expect(un.usesPrefixDiscriminator, true);
//       // check
//       // expect(clo, vlo);
//       expect(clo.count, vlo.count);
//       expect(clo.elementLayout, vlo.elementLayout);
//       expect(un.discriminator.property, 'variant');
//       expect(un.defaultLayout?.property, 'content');
//       expect(dlo.span + vlo.span, un.span);
//       expect(un.property, null);

//       final o = un.decode(b.toBytes());
//       expect(o["variant"], 0);
//       expect(o["content"], [0, 0, 0, 0, 0, 0, 0, 0]);
//       o["variant"] = 5;
//       o["content"][3] = 3;
//       o["content"][7] = 7;
//       expect(un.encode(o, b), dlo.span + vlo.span);
//       expect(
//           BytesUtils.bytesEqual(
//               BytesUtils.fromHexString("050000000300000007"), b.toBytes()),
//           true);
//     });
//   });
// }

// void offsetLayout() {
//   group("offsetLayout", () {
//     test('codec', () {
//       final u8_ = LayoutConst.u8();
//       final bl = LayoutConst.offset(u8_, -1, 'bl');
//       final al = LayoutConst.offset(u8_, 1, 'al');
//       LayoutByteWriter b = LayoutByteWriter.fromHex("0001020304050607");
//       expect(u8_.decode(b.toBytes()), 0);
//       expect(al.decode(b.toBytes()), 1);
//       expect(u8_.decode(b.toBytes(), offset: 4), 4);
//       expect(al.decode(b.toBytes(), offset: 4), 5);
//       expect(bl.decode(b.toBytes(), offset: 4), 3);
//       expect(u8_.encode(0x80, b), 1);
//       expect(al.encode(0x91, b), 1);
//       expect(u8_.encode(0x84, b, offset: 4), 1);
//       expect(al.encode(0x94, b, offset: 4), 1);
//       expect(bl.encode(0x74, b, offset: 4), 1);
//       expect(
//           BytesUtils.bytesEqual(BytesUtils.fromHexString('8091027484940607'), b.toBytes()),
//           true);
//     });
//     test('ctor', () {
//       final u8_ = LayoutConst.u8();
//       final l0 = OffsetLayout(u8_);

//       final nl = OffsetLayout(u8_, offset: -3, property: 'nl');
//       final dl = OffsetLayout(LayoutConst.u8(property: 'ol'), offset: 5);
//       final al = OffsetLayout(u8_, offset: 21);
//       expect(l0.layout, u8_);
//       expect(l0.offset, 0);
//       expect(l0.property, null);
//       expect(nl.layout, u8_);
//       expect(nl.offset, -3);
//       expect(nl.property, 'nl');
//       expec


）由最高人民法院国际商事专家委员会专家提供；

（六）由法律查明服务机构或者中外法律专家提供；

（七）其他适当途径。

人民法院通过前款规定的其中一项途径无法获得外国法律或者获得的外国法律内容不明确、不充分的，应当通过该款规定的不同途径补充查明。

人民法院依据本条第一款第一项的规定要求当事人协助提供外国法律的，不得仅以当事人未予协助提供为由认定外国法律不能查明。

第三条 当事人提供外国法律的，应当提交该国法律的具体规定并说明获得途径、效力情况、与案件争议的关联性等。外国法律为判例法的，还应当提交判例全文。

第四条 法律查明服务机构、法律专家提供外国法律的，除提交本解释第三条规定的材料外，还应当提交法律查明服务机构的资质证明、法律专家的身份及资历证明，并附与案件无利害关系的书面声明。

第五条 查明的外国法律的相关材料均应当在法庭上出示。人民法院应当听取各方当事人对外国法律的内容及其理解与适用的意见。

第六条 人民法院可以召集庭前会议或者以其他适当方式，确定需要查明的外国法律的范围。

第七条 人民法院认为有必要的，可以通知提供外国法律的法律查明服务机构或者法律专家出庭接受询问。当事人申请法律查明服务机构或者法律专家出庭，人民法院认为有必要的，可以准许。

法律查明服务机构或者法律专家现场出庭确有困难的，可以在线接受询问，但法律查明服务机构或者法律专家所在国法律对跨国在线参与庭审有禁止性规定的除外。

出庭的法律查明服务机构或者法律专家只围绕外国法律及其理解发表意见，不参与其他法庭审理活动。

第八条 人民法院对外国法律的内容及其理解与适用，根据以下情形分别作出处理：

（一）当事人对外国法律的内容及其理解与适用均无异议的，人民法院可以予以确认；

（二）当事人对外国法律的内容及其理解与适用有异议的，应当说明理由。人民法院认为有必要的，可以补充查明或者要求当事人补充提供材料。经过


urn Boolean(match)
  }

  /**
   * Get the list as an array
   */
  toArray (): PeerId[] {
    return this.list.slice()
  }

  /**
   * Remove the last element
   */
  pop (): PeerId | undefined {
    return this.list.pop()
  }

  /**
   * The length of the list
   */
  get length (): number {
    return this.list.length
  }
}
/**
 * v-click-outside
 *
 * ```vue
 * <div v-click-outside="onClickOutside">
 * ```
 */

import { VNodeDirective } from 'vue/types/vnode'

interface ClickOutsideDirective extends VNodeDirective{
  value?: (e: Event) => void
}

export default {
  inserted (el: HTMLElement, binding: ClickOutsideDirective) {
    el._clickOutside = (e: Event) => {
      if (!el.contains(e.target as HTMLElement)) {
        binding.value!(e)
      }
    }
    document.body.addEventListener('click', el._clickOutside, true)
  },

  unbind (el: HTMLElement) {
    /* istanbul ignore next */
    if (!el._clickOutside) {
      return
    }

    document.body.removeEventListener('click', el._clickOutside, true)
    delete el._clickOutside
  },
}
import { RegisterContextual } from 'ava';

export default function querying(test: RegisterContextual<any>) {

  // -----------------
  // #find()
  // -----------------

  test('#find() returns the requested record', async (t) => {
    let { lookup } = t.context;
    let Post = lookup('model:post');

    let post = await Post.create({ title: 'one' });

    let result = await Post.find(post.id);
    t.truthy(result);
    t.is(result.id, 1);
    t.is(result.title, 'one');
  });

  test('#find() returns null if not found', async (t) => {
    let { lookup } = t.context;
    let Post = lookup('model:post');

    let result = await Post.find('non-existent-id');
    t.is(result, null);
  });

  // -----------------
  // #queryOne()
  // -----------------

  test('#queryOne() returns the matching record with basic filter syntax', async (t) => {
    let { lookup } = t.context;
    let Post = lookup('model:post');
    await Post.create({ title: 'one' });

    let result = await Post.queryOne({ title: 'one' });
    t.truthy(result);
    t.is(result.id, 1);
    t.is(result.title, 'one');
  });

  test('#queryOne() returns null if not found', async (t) => {
    let { lookup } = t.context;
    let Post = lookup('model:post');

    let result = await Post.queryOne({ foo: 'bar' });
    t.is(result, null);
  });

  // -----------------
  // #query()
  // -----------------

  test('#query() returns the matching records with basic filter syntax', async (t) => {
    let { lookup } = t.context;
    let Post = lookup('model:post');
    await Post.create({ title: 'hello' });
    await Post.create({ title: 'hello' });
    await Post.create({ title: 'hello' });
    await Post.create({ title: 'goodbye' });

    let result = await Post.query({ title: 'hello' });
    t.is(result.length, 3, 'returns the correct number of records');
    t.is(result[0].id, 1);
    t.is(result[0].title, 'hello');
    t.is(result[1].title,


utsideGroup],
      '''
f([a = 0]) {}
''',
    );
  }
}

/// Test how well the parser recovers when tokens are missing in a typedef.
@reflectiveTest
class TypedefTest extends AbstractRecoveryTest {
  @failingTest
  void test_missingFunction() {
    testRecovery(
      '''
typedef Predicate = bool <E>(E element);
''',
      [ParserErrorCode.missingIdentifier],
      '''
typedef Predicate = bool Function<E>(E element);
''',
    );
  }
}
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/src/dart/error/syntactic_errors.dart';

import 'partial_code_support.dart';

main() {
  LibraryDirectivesTest().buildAll();
}

class LibraryDirectivesTest extends PartialCodeTest {
  buildAll() {
    buildTests('library_directive', [
      TestDescriptor(
        'keyword',
        'library',
        [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken],
        'library _s_;',
        failing: ['functionNonVoid', 'getter'],
      ),
      TestDescriptor('name', 'library lib', [
        ParserErrorCode.expectedToken,
      ], 'library lib;'),
      TestDescriptor(
        'nameDot',
        'library lib.',
        [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken],
        'library lib._s_;',
        failing: ['functionNonVoid', 'getter'],
      ),
      TestDescriptor('nameDotName', 'library lib.a', [
        ParserErrorCode.expectedToken,
      ], 'library lib.a;'),
    ], PartialCodeTest.prePartSuffixes);
  }
}
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

import '../../dart/resolution/node_text_expectations.dart';
import '../elements_base.dart';

main() {
  defineReflectiveSuite(() {
    defineReflectiveTests(LibraryExportElementTest_keepLinking);
    defineReflectiveTests(LibraryExportElementTest_fromBytes);
    defineReflectiveTests(UpdateNodeTextExpectations);
  });
}

abstract class LibraryExportElementTest extends ElementsBaseTest {
  test_export_class() async {
    newFile('$testPackageLibPath/a.dart', 'class C {}');
    var library = await buildLibrary('export "a.dart";');
    configuration.withExportScope = true;
    checkElementText(library, r'''
library
  reference: <testLibrary>
  fragments
    #F0 <testLibraryFragment>
      element: <testLibrary>
      libraryExports
        package:test/a.dart
  exportedReferences
    exported[(0, 0)] package:test/a.dart::@class::C
  exportNamespace
    C: package:test/a.dart::@class::C
''');
  }

  test_export_class_type_alias() async {
    newFile('$testPackageLibPath/a.dart', r'''
class C = _D with _E;


utineLock.Dispose();
        }

        /// <summary>
        /// 通过路径直接加载硬盘上的AssetBundle
        /// </summary>
        private async ETTask LoadBundleFinish(string assetBundlePath)
        {
            if (_loadState == LoadState.Finish)
            {
                return;
            }
            ETTask tcs = ETTask.Create(true);

            using (UnityWebRequest webRequest = UnityWebRequestAssetBundle.GetAssetBundle(assetBundlePath))
            {
                UnityWebRequestAsyncOperation weq = webRequest.SendWebRequest();
                if (_loadProgress != null)
                {
                    _loadProgress.WeqOperation = weq;
                }
                weq.completed += (o) =>
                {
                    tcs.SetResult();
                };
                await tcs;
#if UNITY_2020_1_OR_NEWER
                if (webRequest.result == UnityWebRequest.Result.Success)
#else
                if (string.IsNullOrEmpty(webRequest.error))
#endif
                {
                    AssetBundle assetBundle = DownloadHandlerAssetBundle.GetContent(webRequest);
                    //判断是否还需要
                    if (_refCount > 0)
                    {

                        if (AssetBundle == null)
                        {
                            AssetBundle = assetBundle;
                        }
                        else
                        {
                            assetBundle.Unload(true);
                        }
                    }
                    else
                    {
                        assetBundle.Unload(true);
                        AssetComponent.AddPreUnLoadPool(this);
                    }
                }
                else
                {
                    AssetLogHelper.LogError("UnityWebRequest加载AssetBundle失败: \t" + assetBundlePath);
                }
            }

        }

        /// <summary>
        /// 强制加载完成
        /// </summary>
        internal void ForceLoadFinish(string bundlePackageName)
        {
            if (_loadState == LoadState.Finish)
            {
                return;
            }
            string assetBundlePath = AssetComponent.BundleFileExistPath_WebGL(bundlePackageName, AssetBundleName);
            if (AssetBundle == null)
            {
                using (UnityWebRequest webRequest = UnityWebRequestAssetBundle.GetAssetBundle(assetBundlePath))
                {
                    webRequest.SendWebRequest();
                    while (!webRequest.isDone){}
#if UNITY_2020_1_OR_NEWER
                    if (webRequest.result == UnityWebRequest.Result.Success)
#else
                    if (string.IsNullOrEmpty(webRequest.error))
#endif
                    {
                        AssetBundle assetBundle = DownloadHandlerAssetBundle.GetContent(webRequest);
                        if (AssetBundle == null)
                        {
                            AssetBundle = assetBundle;
                            _loadState = LoadState.Finish;
                            if (_loadProgress != null)
                            {
                                _loadProgress.WeqOperation = null;
                            }
                            if (_refCount <= 0)
                            {
                                AssetComponent.AddPreUnLoadPool(this);
                            }
                        }
                        else
                        {
                            AssetLogHelper.LogError("同步加载了正在异步加载的资源, WebGL出现此错误请检查资源加载是否冲突, 否则会引起异步加载失败。资源名: " + FilePath +
                                                    "\nAssetBundle包名: " + AssetBundleName);
                            assetBundle.Unload(true);
                        }
                    }
                    else
                    {
                        AssetLogHelper.LogError("UnityWebRequest同步加载正在异步加载的资源 AssetBundle失败: \t" + assetBundlePath);
                    }
                }
                return;
            }

        }


#include <err.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>

#define XDIM 10
#define YDIM 10
#define ZDIM 10

int main(int argc, char *argv[]) {
    hid_t fileId, dataspaceId, attrspaceId, datasetId, attrId, attrTypeId,
          groupId;
    hsize_t dataDims[3];
    float x, y, z, x_delta = 0.1, y_delta = 0.1, z_delta = 0.1;
    float data[XDIM][YDIM][ZDIM];
    char unit[] = "K";
    int i, j, k;

    if (argc != 2)
        errx(EXIT_FAILURE, "no HDF5 file name given");

    /* data initialization */
    x = 0.0;
    for (i = 0; i < XDIM; i++) {
        y = 0.0;
        for (j = 0; j < YDIM; j++) {
            z = 0.0;
            for (k = 0; k < ZDIM; k++) {
                data[i][j][k] = exp(-(x*x + y*y + z*z));
                z += z_delta;
            }
            y += y_delta;
        }
        x += x_delta;
    }

    /* open file, overwriting existing file */
    fileId = H5Fcreate(argv[1], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

    /* create data space */
    dataDims[0] = XDIM;
    dataDims[1] = YDIM;
    dataDims[2] = ZDIM;
    dataspaceId = H5Screate_simple(3, dataDims, NULL);

    /* create data set */
    datasetId = H5Dcreate(fileId, "/temperature", H5T_IEEE_F64LE,
                          dataspaceId, H5P_DEFAULT, H5P_DEFAULT,
                          H5P_DEFAULT);

    /* write data to HDF5 */
    H5Dwrite(datasetId, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
             H5P_DEFAULT, data);

    H5Sclose(dataspaceId);

    /* create and write an attribute for the data set */
    attrspaceId = H5Screate(H5S_SCALAR);
    attrTypeId = H5Tcopy(H5T_C_S1);
    H5Tset_size(attrTypeId, strlen(unit) + 1);
    attrId = H5Acreate(datasetId, "units", attrTypeId, attrspaceId,
                       H5P_DEFAULT, H5P_DEFAULT);
    H5Awrite(attrId, attrTypeId, unit);
    H5Tclose(attrTypeId);
    H5Sclose(attrspaceId);
    H5Aclose(attrId);

    /* close data set */
    H5Dclose(datasetId);

    /* close file */
    H5Fclose(fileId);

    return EXIT_SUCCESS;
}


llow4:hsl(54, 100%, 86.6%);--yellow5:hsl(52, 97.9%, 82.0%);--yellow6:hsl(50, 89.4%, 76.1%);--yellow7:hsl(47, 80.4%, 68.0%);--yellow8:hsl(48, 100%, 46.1%);--yellow9:hsl(53, 92.0%, 50.0%);--yellow10:hsl(50, 100%, 48.5%);--yellow11:hsl(42, 100%, 29.0%);--yellow12:hsl(40, 55.0%, 13.5%);}
}
:root.t_dark, :root.t_light .t_dark, :root.t_dark .t_light .t_dark, :root.t_light .t_dark .t_light .t_dark, :root.t_dark .t_light .t_dark .t_light .t_dark, :root .t_sub_theme .t_dark, :root.t_dark .t_sub_theme .t_dark, :root .t_sub_theme .t_dark .t_sub_theme .t_dark, :root.t_dark .t_sub_theme .t_dark .t_sub_theme .t_dark {--color1:#050505;--color2:#151515;--color3:#191919;--color4:#232323;--color5:#282828;--color6:#323232;--color7:#424242;--color8:#494949;--color9:#545454;--color10:#626262;--color11:#a5a5a5;--color12:#fff;--shadowColor:rgba(0,0,0,0.3);--shadowColorHover:rgba(0,0,0,0.3);--shadowColorPress:rgba(0,0,0,0.2);--shadowColorFocus:rgba(0,0,0,0.2);--background:#151515;--backgroundHover:#191919;--backgroundPress:#232323;--backgroundFocus:#151515;--backgroundStrong:#050505;--backgroundTransparent:rgba(10,10,10,0);--color:#fff;--colorHover:#a5a5a5;--colorPress:#fff;--colorFocus:#a5a5a5;--colorTransparent:rgba(255,255,255,0);--borderColor:#232323;--borderColorHover:#282828;--borderColorPress:#191919;--borderColorFocus:#232323;--placeholderColor:#545454;--blue1:hsl(212, 35.0%, 9.2%);--blue2:hsl(216, 50.0%, 11.8%);--blue3:hsl(214, 59.4%, 15.3%);--blue4:hsl(214, 65.8%, 17.9%);--blue5:hsl(213, 71.2%, 20.2%);--blue6:hsl(212, 77.4%, 23.1%);--blue7:hsl(211, 85.1%, 27.4%);--blue8:hsl(211, 89.7%, 34.1%);--blue9:hsl(206, 100%, 50.0%);--blue10:hsl(209, 100%, 60.6%);--blue11:hsl(210, 100%, 66.1%);--blue12:hsl(206, 98.0%, 95.8%);--gray1:hsl(0, 0%, 8.5%);--gray2:hsl(0, 0%, 11.0%);--gray3:hsl(0, 0%, 13.6%);--gray4:hsl(0, 0%, 15.8%);--gray5:hsl(0, 0%, 17.9%);--gray6:hsl(0, 0%, 20.5%);--gray7:hsl(0, 0%, 24.3%);--gray8:hsl(0, 0%, 31.2%);--gray9:hsl(0, 0%, 43.9%);--gray10:hsl(0, 0


-style: italic;
 color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
 color: #008000;
 text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
 color: #008000;
 text-decoration: underline;
}
span.rvts6 /* Font Style */
{
}
span.rvts7 /* Font Style */
{
 font-size: 14pt;
 font-weight: bold;
 color: #365f91;
}
span.rvts8
{
 font-size: 24pt;
 font-weight: bold;
}
span.rvts9
{
 font-size: 12pt;
}
span.rvts10
{
 font-size: 14pt;
}
span.rvts11
{
 font-size: 12pt;
}
a.rvts12, span.rvts12
{
 font-size: 12pt;
 font-weight: bold;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts12:hover { color: #0000ff; }
a.rvts13, span.rvts13
{
 font-size: 12pt;
 font-weight: bold;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts13:hover { color: #0000ff; }
span.rvts14
{
 font-size: 9pt;
}
a.rvts15, span.rvts15
{
 font-size: 14pt;
 font-weight: bold;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts15:hover { color: #0000ff; }
a.rvts16, span.rvts16
{
 font-size: 14pt;
 font-weight: bold;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts16:hover { color: #0000ff; }
span.rvts17 /* Font Style */
{
 font-family: 'Tahoma', 'Geneva', sans-serif;
 font-style: italic;
 color: #c0c0c0;
}
a.rvts18, span.rvts18 /* Font Style */
{
 font-family: 'Tahoma', 'Geneva', sans-serif;
 font-style: italic;
 color: #6666ff;
 text-decoration: underline;
}
span.rvts19
{
 font-size: 24pt;
 text-decoration: underline;
}
span.rvts20 /* Font Style */
{
 font-size: 11pt;
 font-family: 'Courier New', 'Courier', monospace;
 color: #000080;
}
span.rvts21 /* Font Style */
{
 font-size: 11pt;
}
span.rvts22 /* Font Style */
{
 font-size: 12pt;
 font-weight: bold;
}
a.rvts23, span.rvts23
{
 font-size: 12pt;
 font-weight: bold;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts23:hover { color: #0000ff; }
span.rvts24 /* Font Style */
{
 font-size: 11pt;
}
span.rvts25
{
 font-size: 11pt;
 font-weight: bold;
}
span.rvts26 /* Font Style */
{
 font-size: 11pt;
 font-weight: bold;
 color: #0096bb;
}
a.rvts27, span.rvts27
{
 font-size: 11pt;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts27:hover { color: #0000ff; }
a.rvts28, span.rvts28
{
 font-size: 11pt;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts28:hover { color: #0000ff; }
span.rvts29 /* Font Style */
{
 font-size: 11pt;
 font-weight: bold;
 color: #008817;
}
span.rvts30 /* Font Style */
{
 font-size: 11pt;
 color: #c10031;
}
a.rvts31, span.rvts31
{
 font-size: 11pt;
 color: #0000ff;
 text-decoration: underline;
}
a.rvts31:


ParentView","path":"./src/store/index.js + 11 modules (concatenated)/src/components/ParentView","statSize":955,"groups":[{"id":null,"label":"index.vue","path":"./src/store/index.js + 11 modules (concatenated)/src/components/ParentView/index.vue","statSize":359,"parsedSize":162,"gzipSize":45,"inaccurateSizes":true},{"id":null,"label":"index.vue?vue&type=template&id=6e583e1f","path":"./src/store/index.js + 11 modules (concatenated)/src/components/ParentView/index.vue?vue&type=template&id=6e583e1f","statSize":596,"parsedSize":270,"gzipSize":76,"inaccurateSizes":true}],"parsedSize":432,"gzipSize":121,"inaccurateSizes":true}],"parsedSize":11797,"gzipSize":3322,"inaccurateSizes":true}]}],"parsedSize":11870,"gzipSize":3343},{"id":"56d7","label":"main.js + 63 modules (concatenated)","path":"./src/main.js + 63 modules (concatenated)","statSize":81422,"parsedSize":31765,"gzipSize":10477,"concatenated":true,"groups":[{"label":"src","path":"./src/main.js + 63 modules (concatenated)/src","statSize":81032,"groups":[{"id":null,"label":"main.js","path":"./src/main.js + 63 modules (concatenated)/src/main.js","statSize":4290,"parsedSize":1673,"gzipSize":552,"inaccurateSizes":true},{"label":"utils","path":"./src/main.js + 63 modules (concatenated)/src/utils","statSize":15390,"groups":[{"id":null,"label":"busEvent.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/busEvent.js","statSize":73,"parsedSize":28,"gzipSize":9,"inaccurateSizes":true},{"id":null,"label":"mqttTool.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/mqttTool.js","statSize":4248,"parsedSize":1657,"gzipSize":546,"inaccurateSizes":true},{"label":"dict","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict","statSize":9317,"groups":[{"id":null,"label":"index.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/index.js","statSize":1023,"parsedSize":399,"gzipSize":131,"inaccurateSizes":true},{"id":null,"label":"DictOptions.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/DictOptions.js","statSize":1477,"parsedSize":576,"gzipSize":190,"inaccurateSizes":true},{"id":null,"label":"Dict.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/Dict.js","statSize":3733,"parsedSize":1456,"gzipSize":480,"inaccurateSizes":true},{"id":null,"label":"DictData.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/DictData.js","statSize":586,"parsedSize":228,"gzipSize":75,"inaccurateSizes":true},{"id":null,"label":"DictConverter.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/DictConverter.js","statSize":1099,"parsedSize":428,"gzipSize":141,"inaccurateSizes":true},{"id":null,"label":"DictMeta.js","path":"./src/main.js + 63 modules (concatenated)/src/utils/dict/DictMeta.js","statSize":1399,"parsedSize":545,"gzipSize":180,"inaccurateS


 %q, want zero", token.ValidAtLeastUntil)
	}
}

func TestNewWithExpiry(t *testing.T) {
	expireTime := time.Date(2020, time.January, 1, 1, 0, 0, 0, time.UTC)
	token := NewWithExpiry("foo", expireTime)

	if token.RawToken != "foo" {
		t.Errorf("got %q, want %q", token.RawToken, "foo")
	}
	if !expireTime.Equal(token.ValidAtLeastUntil) {
		t.Errorf("got %q, want %q", token.ValidAtLeastUntil, expireTime)
	}
}
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package structured

import (
	"fmt"
	"testing"

	"github.com/google/go-cmp/cmp"
)

func TestMergeNode(t *testing.T) {
	testCases := []struct {
		Name               string
		Prev               string
		Patch              string
		Expected           string
		ArrayMergeStrategy *MergeConfigResolver
	}{
		{
			Name: "merge to update a field",
			Prev: `foo: bar
qux: 2
`,
			Patch: `foo: baz
`,
			Expected: `foo: baz
qux: 2
`,
		},
		{
			Name: "merge to add a field",
			Prev: `foo: bar
qux: 2
`,
			Patch: `quux: 3
`,
			Expected: `foo: bar
qux: 2
quux: 3
`,
		},
		{
			Name: "merge sequence of sequence should be handled with replace strategy",
			Prev: `foo:
- - 1
  - 2
- - 3
- - 4
`,
			Patch: `foo:
- - 1
  - 2
  - 3
- - 4
`,
			Expected: `foo:
    - - 1
      - 2
      - 3
    - - 4
`,
		},
		{
			Name: "$patch:replace directive at root",
			Prev: `foo: bar
qux: 2
`,
			Patch: `$patch: replace
quux: 3
`,
			Expected: `quux: 3
`,
		},
		{
			Name: "$patch:replace directive in child map",
			Prev: `foo:
  bar: baz
  qux:
    quux: 42
`,
			Patch: `foo:
  bar: baz2
  qux:
    $patch: replace
    quux2: 42
`,
			Expected: `foo:
    bar: baz2
    qux:
        quux2: 42
`,
		},
		{
			Name: "$patch:delete directive in map",
			Prev: `foo:
  bar: baz
  qux:
    quux: 42
`,
			Patch: `foo:
  bar: baz2
  qux:
    $patch: delete
`,
			Expected: `foo:
    bar: baz2
`,
		},
		{
			Name: "$patch: merge must be ignored",
			Prev: `foo:
  bar: baz
`,
			Patch: `foo:
  bar: baz2
  $patch: merge
`,
			Expected: `foo:
    bar: baz2
`,
		},
		{
			Name: "$deleteFromPrimitiveList on a string array",
			Prev: `foo:
- a
- b
- c
`,
			Patch: `$deleteFromPrimitiveList/f


eners) > 0 {
		if err := gwTmpl.Execute(&buf, listeners); err != nil {
			return nil, err
		}
	}

	for _, r := range routes {
		if buf.Len() > 0 {
			buf.WriteString("\n---\n")
		}

		if err := hrTmpl.Execute(&buf, r); err != nil {
			return nil, err
		}
	}

	return decodeObjects(&buf)
}

func generateBackendAppObjects(backends []string) ([]client.Object, error) {
	objects := make([]client.Object, 0, 2*len(backends))

	for _, backend := range backends {
		var buf bytes.Buffer

		if err := appTmpl.Execute(&buf, backend); err != nil {
			return nil, err
		}

		objs, err := decodeObjects(&buf)
		if err != nil {
			return nil, err
		}

		objects = append(objects, objs...)
	}

	return objects, nil
}
package framework

import (
	"context"
	"fmt"
	"os/exec"

	"sigs.k8s.io/controller-runtime/pkg/client"
)

const (
	CollectorNamespace        = "collector"
	collectorChartReleaseName = "otel-collector"
	//nolint:lll
	// renovate: datasource=helm depName=opentelemetry-collector registryUrl=https://open-telemetry.github.io/opentelemetry-helm-charts
	collectorChartVersion = "0.136.1"
)

// InstallCollector installs the otel-collector.
func InstallCollector() ([]byte, error) {
	ctx := context.Background()
	repoAddArgs := []string{
		"repo",
		"add",
		"open-telemetry",
		"https://open-telemetry.github.io/opentelemetry-helm-charts",
	}

	if output, err := exec.CommandContext(ctx, "helm", repoAddArgs...).CombinedOutput(); err != nil {
		return output, err
	}

	if output, err := exec.CommandContext(
		ctx,
		"helm",
		"repo",
		"update",
	).CombinedOutput(); err != nil {
		return output, fmt.Errorf("failed to update helm repos: %w; output: %s", err, string(output))
	}

	args := []string{
		"install",
		collectorChartReleaseName,
		"open-telemetry/opentelemetry-collector",
		"--create-namespace",
		"--namespace", CollectorNamespace,
		"--version", collectorChartVersion,
		"-f", "manifests/telemetry/collector-values.yaml",
		"--wait",
	}

	return exec.CommandContext(ctx, "helm", args...).CombinedOutput()
}

// UninstallCollector uninstalls the otel-collector.
func UninstallCollector(resourceManager ResourceManager) ([]byte, error) {
	args := []string{
		"uninstall", collectorChartReleaseName,
		"--namespace", CollectorNamespace,
	}

	output, err := exec.CommandContext(context.Background(), "helm", args...).CombinedOutput()
	if err != nil {
		return output, err
	}

	return nil, resourceManager.DeleteNamespace(CollectorNamespace)
}

// GetCollectorPodName returns the name of the collector Pod.
func GetCollectorPodName(resourceManager ResourceManager) (string, error) {
	collectorPodNames, err := resourceManager.GetPodNames(
		CollectorNamespace,
		client.MatchingLabels{
			"app.kubernetes.io/name": "opentelemetry-collector",
		},
	)
	if err != nil {
		return "", err
	}

	if len(collectorPodNames) != 1 {
		return "", fmt.Errorf("expected 1 collector pod, got %d", len(collectorPodNames))
	}

	return collectorPodNames[0], nil
}
package framework

import (
	"fmt"
	"runtime/debug"

	. "github.com/onsi/ginkgo/v2"


ражна такса за защита за всяка завършена сделка.';
  }

  @override
  String description250Sbfee57Sbagoradesk(Object appName) {
    return 'Регистрирането, купуването и продажбата на криптовалути е напълно безплатно. Потребителите на $appName, които създават реклами се таксуват с 1% арбитражна такса за защита за всяка завършена сделка.';
  }

  @override
  String description250Sbguide250Sb2fa(Object appName) {
    return 'Това ръководство ще ви помогне да настроите двуфакторно удостоверяване за вашия $appName профил.';
  }

  @override
  String get description250Sbguide250Sbbtc => 'Зад гърба ни ли са дните в които можете да купувате биткойни с кредитна карта незабавно и без проверка? Не точно. Тук ви представяме лесен, анонимен, личен и бърз начин за придобиване на биткойни с пари в брой само с няколко стъпки.';

  @override
  String description250Sbguide250Sbbuy(Object appName) {
    return 'Това ръководство ще ви помогне да разберете как да купувате Monero с популярни онлайн методи за плащане (като банков превод, PayPal, кредитна карта и др.). $appName е изключително ефективен начин за закупуване на Monero анонимно без проверка на самоличността. ';
  }

  @override
  String description250Sbguide250Sbbuy57Sbagoradesk(Object appName) {
    return 'Това ръководство ще ви помогне да разберете как да купувате криптовалута с популярни онлайн методи за плащане (като банков превод, PayPal, кредитна карта и др.). $appName е изключително ефективен начин за закупуване на криптовалута анонимно без проверка на самоличността. ';
  }

  @override
  String description250Sbguide250Sblocal(Object appName) {
    return 'Това ръководство ще ви помогне да разберете как анонимно да купувате или продавате Monero за пари чрез местна среща. $appName е изключително ефективен начин за търговия с XMR без проверка на ID. ';
  }

  @override
  String description250Sbguide250Sblocal57Sbagoradesk(Object appName) {
    return 'Това ръководство ще ви помогне да разберете как анонимно да купувате или продавате криптовалути за пари чрез местна среща. В $appName можете да търгувате с криптовалути без проверка на ID. ';
  }

  @override
  String description250Sbguide250Sbsell(Object appName) {
    return 'Това ръководство ще ви помогне да разберете как да продавате Monero с популярни онлайн методи за плащане (като банков превод


5](rtc_cntl_store5) module"]
pub type RTC_CNTL_STORE5 = crate::Reg<u32, _RTC_CNTL_STORE5>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _RTC_CNTL_STORE5;
#[doc = "`read()` method returns [rtc_cntl_store5::R](rtc_cntl_store5::R) reader structure"]
impl crate::Readable for RTC_CNTL_STORE5 {}
#[doc = "`write(|w| ..)` method takes [rtc_cntl_store5::W](rtc_cntl_store5::W) writer structure"]
impl crate::Writable for RTC_CNTL_STORE5 {}
#[doc = "RTC_CNTL_STORE5"]
pub mod rtc_cntl_store5;
#[doc = "RTC_CNTL_STORE6\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rtc_cntl_store6](rtc_cntl_store6) module"]
pub type RTC_CNTL_STORE6 = crate::Reg<u32, _RTC_CNTL_STORE6>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _RTC_CNTL_STORE6;
#[doc = "`read()` method returns [rtc_cntl_store6::R](rtc_cntl_store6::R) reader structure"]
impl crate::Readable for RTC_CNTL_STORE6 {}
#[doc = "`write(|w| ..)` method takes [rtc_cntl_store6::W](rtc_cntl_store6::W) writer structure"]
impl crate::Writable for RTC_CNTL_STORE6 {}
#[doc = "RTC_CNTL_STORE6"]
pub mod rtc_cntl_store6;
#[doc = "RTC_CNTL_STORE7\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rtc_cntl_store7](rtc_cntl_store7) module"]
pub type RTC_CNTL_STORE7 = crate::Reg<u32, _RTC_CNTL_STORE7>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _RTC_CNTL_STORE7;
#[doc = "`read()` method returns [rtc_cntl_store7::R](rtc_cntl_store7::R) reader structure"]
impl crate::Readable for RTC_CNTL_STORE7 {}
#[doc = "`write(|w| ..)` method takes [rtc_cntl_store7::W](rtc_cntl_store7::W) writer structure"]
impl crate::Writable for RTC_CNTL_STORE7 {}
#[doc = "RTC_CNTL_STORE7"]
pub mod rtc_cntl_store7;
#[doc = "RTC_CNTL_LOW_POWER_ST\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rtc_cntl_low_power_st](rtc_cntl_low_power_st) module"]
pub type RTC_CNTL_LOW_POWER_ST =


map_err(|_| {
            DecodeError::BytesInvalid(format!("Invalid AggregatePublicKey bytes: {:?}", bytes))
        })?;

        Ok(AggregatePublicKey(pubkey))
    }

    pub fn add_without_affine(&mut self, public_key: &PublicKey) {
        self.0.point.add(&public_key.as_raw().point)
    }

    pub fn affine(&mut self) {
        self.0.point.affine()
    }

    pub fn add(&mut self, public_key: &PublicKey) {
        self.0.add(public_key.as_raw())
    }

    /// Returns the underlying public key.
    pub fn as_raw(&self) -> &RawAggregatePublicKey {
        &self.0
    }

    /// Returns the underlying point as compressed bytes.
    pub fn as_bytes(&self) -> Vec<u8> {
        self.as_raw().as_bytes()
    }

    pub fn into_raw(self) -> RawAggregatePublicKey {
        self.0
    }

    /// Return a hex string representation of this key's bytes.
    #[cfg(test)]
    pub fn as_hex_string(&self) -> String {
        serde_hex::encode(self.as_bytes())
    }
}

impl_ssz!(
    AggregatePublicKey,
    BLS_PUBLIC_KEY_BYTE_SIZE,
    "AggregatePublicKey"
);
impl_tree_hash!(AggregatePublicKey, BLS_PUBLIC_KEY_BYTE_SIZE);

impl Serialize for AggregatePublicKey {
    /// Serde serialization is compliant the Ethereum YAML test format.
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        serializer.serialize_str(&hex_encode(self.as_bytes()))
    }
}

impl<'de> Deserialize<'de> for AggregatePublicKey {
    /// Serde serialization is compliant the Ethereum YAML test format.
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>,
    {
        let bytes = deserializer.deserialize_str(PrefixedHexVisitor)?;
        let agg_sig = AggregatePublicKey::from_ssz_bytes(&bytes)
            .map_err(|e| serde::de::Error::custom(format!("invalid ssz ({:?})", e)))?;

        Ok(agg_sig)
    }
}
use rusqlite::{Connection, Row};
use std::iter::Iterator;
use walkdir::{DirEntry, WalkDir, WalkDirIterator};
use std::path::{Component, Path, PathBuf};
use std::fs::{self, File};
use std::io::prelude::*;
use mbtile_error::{MBTileError, ToMBTileResult};
use rustc_serialize::json::{self, Json};
use std::fmt;
use std::collections::BTreeMap;
use flate2::read::ZlibDecoder;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::io::Cursor;
use regex::Regex;

#[derive(RustcDecodable, Debug)]
pub enum Command {
    Import,
    Export,
    Metadata,
}

#[derive(RustcDecodable, Debug, Clone, Copy)]
pub enum Scheme {
    Xyz,
    Tms,
    Wms,
    Ags,
}

impl fmt::Display for Scheme {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        let res = match *self {
            Scheme::Xyz => "xyz",
            Scheme::Tms => "tms",
            Scheme::Wms => "wms",
            Scheme::Ags => "ags",
        };
        write!(f, "{}", res)
    }
}

#[derive(RustcDecodable, Debug, Clone, Copy)]
pub enum ImageFormat {
    Png,
    Jpg,
    Webp,
    Pbf,
}

fn mbtiles_connect(mbtiles_file: &Path) -> Result<Connection, MBTileError> {
    Ok(try!(Connection::open(mbtiles_file).desc(format!("Can't connect to {:?


#ifndef VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_DUPLEX_CHALLENGER_H_
#define VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_DUPLEX_CHALLENGER_H_

#include <stdint.h>

#include <memory>

#include "rust/cxx.h"

#include "tachyon/c/zk/air/sp1/baby_bear_poseidon2_duplex_challenger.h"

namespace tachyon::sp1_api::baby_bear_poseidon2 {

struct TachyonBabyBear;

class DuplexChallenger {
 public:
  DuplexChallenger();
  explicit DuplexChallenger(
      tachyon_sp1_baby_bear_poseidon2_duplex_challenger* challenger)
      : challenger_(challenger) {}
  DuplexChallenger(const DuplexChallenger& other) = delete;
  DuplexChallenger& operator=(const DuplexChallenger& other) = delete;
  ~DuplexChallenger();

  tachyon_sp1_baby_bear_poseidon2_duplex_challenger* challenger() {
    return challenger_;
  }

  void observe(const TachyonBabyBear& value);
  rust::Box<TachyonBabyBear> sample();
  rust::Vec<uint8_t> write_hint() const;
  std::unique_ptr<DuplexChallenger> clone() const;

 private:
  tachyon_sp1_baby_bear_poseidon2_duplex_challenger* challenger_;
};

std::unique_ptr<DuplexChallenger> new_duplex_challenger();

}  // namespace tachyon::sp1_api::baby_bear_poseidon2

#endif  // VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_DUPLEX_CHALLENGER_H_


 on 26/02/15.
 */
public class Utils {

    public static void setUp(Context context) throws InterruptedException {
        setUp(context, null);
    }

    public static void setUp(Context context, List<RushColumn> columns) throws InterruptedException {
        context.deleteDatabase("rush.db");

        final List<Class<? extends Rush>> classes = new ArrayList<>();

        classes.add(Bug6.class);
        classes.add(Bug7Child.class);
        classes.add(Bug7Parent.class);
        classes.add(Bug29A.class);
        classes.add(Bug29B.class);
        classes.add(Bug29C.class);
        classes.add(Bug34.class);
        classes.add(Bug61Child.class);
        classes.add(Bug61Parent.class);
        classes.add(Bug78.class);
        classes.add(Bug119Parent.class);
        classes.add(Bug119Child.class);

        classes.add(SetupObject.class);
        classes.add(TestBase1.class);
        classes.add(TestBase2.class);
        classes.add(TestChildObject.class);
        classes.add(TestCustomColumn.class);
        classes.add(TestCustomName.class);
        classes.add(TestModifiers.class);
        classes.add(TestObject.class);
        classes.add(TestPageListObject.class);
        classes.add(TestRootObject.class);
        classes.add(TestSelfReference.class);
        classes.add(TestUpgrade1.class);
        classes.add(TestUpgrade2.class);
        classes.add(TestUpgrade3.class);
        classes.add(TestUpgrade4.class);
        classes.add(TestUpgrade5.class);

        RushInitializeConfig rushInitializeConfig = new AndroidInitializeConfig(context, classes);

        if(columns != null) {
            for (RushColumn rushColumn : columns) {
                rushInitializeConfig.addRushColumn(rushColumn);
            }
        }

        RushAndroid.initialize(rushInitializeConfig);

        // Saving this object makes setUp wait until initialize finishes
        // otherwise it seems that the thread initialize is done on gets killed
        new SetupObject().save();
    }
}
package exercises;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.regex.MatchResult;
import java.util.Set;
import java.util.Scanner;
import java.util.stream.Collectors;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * JDK 9 added several new streams-producing APIs in the java.util.regex.Matcher
 * and java.util.Scanner classes. These APIs make it even easier to process text
 * using pattern matching and fluent streams pipelines. The exercises in this file
 * use the new JDK 9 pattern matching APIs.
 */
public class G_MatcherScanner {
    /**
     * Shakespeare used "poetic contractions" which (for purposes of this exercise)
     * are words that have an apostrophe (') in a position farther than one letter from
     * the end of the word. An example of modern English contraction is "can't" where
     * the apostrophe precedes the last letter of the word. An example of a poetic
     * contraction is "o'er" (over) where the apostrophe occurs earlier in the word.
     *
     * Use the Pattern WORD_PAT (defined below) to match words with an apostrophe
     * earlier in the word. Match the text from Shakespeare's first sonnet, which has
     * been loaded into the String variable SONNET, using the


 error when calling handleSafe if the data is not supported.', async(): Promise<void> => {
      const handler = new WaterfallHandler([ handlerFalse, handlerFalse ]);

      await expect(handler.handleSafe(null)).rejects.toThrow('Not supported, Not supported');
    });
  });
});
/**
 *Created by 夜雪暮歌 on 2021/3/20
 **/

// 测试 removeComments: true（为false时上面的文件信息注释不会被删除）
// 测试tsc编译
interface Obj {
    a: string
    b: number
}

const nickName: string = 'yxmg'
const object: Obj = { a: '1', b: 1 }
import DailyStreak from './dailyStreak';
import addDays from 'date-fns/addDays';
import subDays from 'date-fns/esm/subDays';
import isSameDay from 'date-fns/esm/isSameDay';
import { DailyStreak as IDailyStreak } from '../entities/DailyStreak';

const today = Date.now();
const tommorow = addDays(today, 1).getTime();
const yesterday = subDays(today, 1).getTime();
const twoDaysAgo = subDays(today, 2).getTime();
const threeDaysAgo = subDays(today, 3).getTime();

describe('DailyStreak', () => {
  it('Detects days in a row properly.', () => {
    const daysInARow = new DailyStreak({
      perDay: 3,
      startsAt: today,
      updatedAt: tommorow,
    }).getDaysInARow();

    expect(daysInARow).toEqual(2);
  });

  it('Should update if started yesterday.', () => {
    const result = new DailyStreak({
      perDay: 3,
      startsAt: yesterday,
      updatedAt: null,
    }).shouldUpdate({
      tasksDoneToday: 3,
    });

    expect(result).toEqual(true);
  });

  it('Should not update twice per day.', () => {
    const result = new DailyStreak({
      perDay: 3,
      startsAt: twoDaysAgo,
      updatedAt: today,
    }).shouldUpdate({
      tasksDoneToday: 5,
    });

    expect(result).toEqual(false);
  });

  it('Specific case: if started yesterday, dont reset today.', () => {
    const shouldUpdate = new DailyStreak({
      perDay: 3,
      startsAt: yesterday,
      updatedAt: yesterday,
    }).shouldUpdate({
      tasksDoneToday: 5,
    });

    expect(shouldUpdate).toEqual(true);
  });

  it("Specific case: if started two days ago, don't reset.", () => {
    const shouldUpdate = new DailyStreak({
      perDay: 3,
      startsAt: twoDaysAgo,
      updatedAt: yesterday,
    }).shouldUpdate({
      tasksDoneToday: 5,
    });

    expect(shouldUpdate).toEqual(true);
  });

  it('Returns proper streak if streak was created yesterday.', () => {
    const yesterdaysStreak = {
      perDay: 3,
      updatedAt: yesterday,
      startsAt: yesterday,
    };
    const updatedStreak = new DailyStreak(
      yesterdaysStreak,
    ).getUpdatedStreak({
      tasksDoneToday: 3,
    });

    expect(updatedStreak.startsAt).toEqual(yesterdaysStreak.startsAt);
    expect(
      updatedStreak.updatedAt !== yesterdaysStreak.updatedAt,
    ).toBeTruthy();
    expect(
      isSameDay(updatedStreak.updatedAt as number, today),
    ).toBeTruthy();
  });

  it('Returns proper streak if streak was created two days ago.', () => {
    const yesterdaysStreak = {