ETURN n.type as type, count(n) as count
ORDER BY count DESC

// 查看每个部分包含的子节点数量
MATCH (part)-[:INCLUDES]->(detail)
RETURN part.name, count(detail) as detail_count
ORDER BY detail_count DESC
```

## 🔍 知识图谱探索

### 可视化查询
```cypher
// 展示完整的知识图谱结构（小规模）
MATCH p=(root {id: 'root'})-[:CONTAINS*1..2]->(n)
RETURN p
LIMIT 50

// 展示德国家族企业特征
MATCH (root)-[:CONTAINS]->(part {name: '第三部分 德国家族企业特征综述'})-[:INCLUDES]->(char)
RETURN part, char

// 展示匡特家族的故事线
MATCH (n:KnowledgeNode)
WHERE n.type IN ['第十三部分', '第十四部分']
RETURN n
```

### 路径查询
```cypher
// 查找从根节点到某个具体概念的路径
MATCH path = (root {id: 'root'})-[:CONTAINS*]->(target)
WHERE target.name CONTAINS '创新'
RETURN path
LIMIT 5

// 查找相关概念之间的关系
MATCH (n1:KnowledgeNode)-[r]-(n2:KnowledgeNode)
WHERE n1.description CONTAINS '财务' AND n2.description CONTAINS '财务'
RETURN n1, r, n2
```

## 🛠 故障排除

### 常见问题

1. **连接失败**
   - 检查Neo4j是否正在运行
   - 验证连接参数（URI、用户名、密码）
   - 确认端口7687未被占用

2. **导入错误**
   - 确认CSV文件编码为UTF-8
   - 检查文件路径是否正确
   - 验证CSV文件格式

3. **内存不足**
   - 增加Neo4j内存配置
   - 减小批处理大小（修改batch_size参数）

### 性能优化

```cypher
// 创建额外索引（如需要）
CREATE INDEX IF NOT EXISTS FOR (n:KnowledgeNode) ON (n.description)

// 查看当前索引
SHOW INDEXES
```

## 📈 后续使用建议

1. **定期备份**
   ```bash
   # 备份数据库
   neo4j-admin dump --database=neo4j --to=/path/to/backup.dump
   ```

2. **性能监控**
   - 使用Neo4j Browser的查询分析器
   - 监控查询执行时间
   - 优化复杂查询

3. **扩展功能**
   - 集成APOC插件获得更多功能
   - 考虑使用Graph Data Science库进行图分析
   - 开发Web应用程序进行知识图谱可视化

## 📚 参考资源

- [Neo4j官方文档](https://neo4j.com/docs/)
- [Cypher查询语言指南](https://neo4j.com/developer/cypher/)
- [APOC插件文档](https://neo4j.com/labs/apoc/)

---

如有问题，请检查日志输出或联系技


(uint8_t *buf)
{
    register uint8_t i, a, b, c, d, e, x, y, z;

    for (i = 0; i < 16; i += 4)
    {
        a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3];
        e = a ^ b ^ c ^ d;
        z = rj_xtime(e);
        x = e ^ rj_xtime(rj_xtime(z^a^c));  y = e ^ rj_xtime(rj_xtime(z^b^d));
        buf[i] ^= x ^ rj_xtime(a^b);   buf[i+1] ^= y ^ rj_xtime(b^c);
        buf[i+2] ^= x ^ rj_xtime(c^d); buf[i+3] ^= y ^ rj_xtime(d^a);
    }
} /* aes_mixColumns_inv */

/* -------------------------------------------------------------------------- */
void aes_expandEncKey(uint8_t *k, uint8_t *rc)
{
    register uint8_t i;

    k[0] ^= rj_sbox(k[29]) ^ (*rc);
    k[1] ^= rj_sbox(k[30]);
    k[2] ^= rj_sbox(k[31]);
    k[3] ^= rj_sbox(k[28]);
    *rc = F( *rc);

    for(i = 4; i < 16; i += 4)  k[i] ^= k[i-4],   k[i+1] ^= k[i-3],
        k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
    k[16] ^= rj_sbox(k[12]);
    k[17] ^= rj_sbox(k[13]);
    k[18] ^= rj_sbox(k[14]);
    k[19] ^= rj_sbox(k[15]);

    for(i = 20; i < 32; i += 4) k[i] ^= k[i-4],   k[i+1] ^= k[i-3],
        k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];

} /* aes_expandEncKey */

/* -------------------------------------------------------------------------- */
void aes_expandDecKey(uint8_t *k, uint8_t *rc)
{
    uint8_t i;

    for(i = 28; i > 16; i -= 4) k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
        k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];

    k[16] ^= rj_sbox(k[12]);
    k[17] ^= rj_sbox(k[13]);
    k[18] ^= rj_sbox(k[14]);
    k[19] ^= rj_sbox(k[15]);

    for(i = 12; i > 0; i -= 4)  k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
        k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];

    *rc = FD(*rc);
    k[0] ^= rj_sbox(k[29]) ^ (*rc);
    k[1] ^= rj_sbox(k[30]);
    k[2] ^= rj_sbox(k[31]);
    k[3] ^= rj_sbox(k[28]);
} /* aes_expandDecKey */

/* -------------------------------------------------------------------------- */
void aes256_init(aes256_context *ctx, uint8_t *k)
{
    uint8_t rcon = 1;
    register uint8_t i;

    for (i = 0; i < sizeof(ctx->key); i++) ctx->enckey[i] = ctx->deckey[i] = k[i];
    for (i = 8;--i;) aes_expandEncKey(ctx->deckey, &rcon);
} /* aes256_init */

/* -------------------------------------------------------------------------- */
void aes256_done(aes256_context *ctx)
{
    register uint8_t i;

    for (i = 0; i < sizeof(ctx->key); i++)
        ctx->key[i] = ctx->enckey[i] = ctx->deckey[i] = 0;
} /*


ge['sum_44_4'] = SumCell(out_channels, norm_type=norm_type)
            # sum(p4_2, p3) -> p3_out
            stage['sum_43_3'] = SumCell(out_channels, norm_type=norm_type)
            # sum(p3_out, p4_2) -> p4_out
            stage['sum_34_4'] = SumCell(out_channels, norm_type=norm_type)
            # sum(p5, gp(p4_out, p3_out)) -> p5_out
            stage['gp_43_5'] = GPCell(with_conv=False)
            stage['sum_55_5'] = SumCell(out_channels, norm_type=norm_type)
            # sum(p7, gp(p5_out, p4_2)) -> p7_out
            stage['gp_54_7'] = GPCell(with_conv=False)
            stage['sum_77_7'] = SumCell(out_channels, norm_type=norm_type)
            # gp(p7_out, p5_out) -> p6_out
            stage['gp_75_6'] = GPCell(out_channels, norm_type=norm_type)
            self.fpn_stages.append(stage)

        for m in self.modules():
            if isinstance(m, nn.SyncBatchNorm):
                m._specify_ddp_gpu_num(1)

    def init_weights(self):
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                caffe2_xavier_init(m)

    @auto_fp16()
    def forward(self, inputs):
        assert len(inputs) == len(self.in_channels)
        # build P6-P7 on top of P5
        inputs = list(inputs)
        for downsample in self.extra_downsamples:
            inputs.append(downsample(inputs[-1]))

        # 1x1 on P3-P7
        feats = [
            lateral_conv(inputs[i + self.start_level])
            for i, lateral_conv in enumerate(self.lateral_convs)
        ]

        p3, p4, p5, p6, p7 = feats

        for stage in self.fpn_stages:
            # gp(p6, p4) -> p4_1
            p4_1 = stage['gp_64_4'](p6, p4, out_size=p4.shape[-2:])
            # sum(p4_1, p4) -> p4_2
            p4_2 = stage['sum_44_4'](p4_1, p4, out_size=p4.shape[-2:])
            # sum(p4_2, p3) -> p3_out
            p3 = stage['sum_43_3'](p4_2, p3, out_size=p3.shape[-2:])
            # sum(p3_out, p4_2) -> p4_out
            p4 = stage['sum_34_4'](p3, p4_2, out_size=p4.shape[-2:])
            # sum(p5, gp(p4_out, p3_out)) -> p5_out
            p5_tmp = stage['gp_43_5'](p4, p3, out_size=p5.shape[-2:])
            p5 = stage['sum_55_5'](p5, p5_tmp, out_size=p5.shape[-2:])
            # sum(p7, gp(p5_out, p4_2)) -> p7_out
            p7_tmp = stage['gp_54_7'](p5, p4_2, out_size=p7.shape[-2:])
            p7 = stage['sum_77_7'](p7, p7_tmp, out_size=p7.shape[-2:])
            # gp(p7_out, p5_out) -> p6_out
            p6 = stage['gp_75_6'](p7, p5, out_size=p6.shape[-2:])

        return tuple([p3, p4, p5, p6, p7])


1|0;if((z|0)==(s|0)){A=e;break a}else{v=z;w=z}}do{x=x+1|0;if((x|0)==(f|0))break b;y=y+1|0}while((a[y>>0]|0)==(a[x>>0]|0));w=v+1|0;if((w|0)==(s|0)){A=e;break a}else{t=w;u=w}}A=v}else A=e;while(0);e=A;if((r|0)==(e|0)){r=Ha(12)|0;B6(r,5);Ka(r|0,2720,374)}c[k>>2]=p;c[m>>2]=A;c[j>>2]=c[k>>2];c[i>>2]=c[m>>2];vp(o,d,j,i,0);i=g+11|0;if((a[i>>0]|0)<0){a[c[g>>2]>>0]=0;c[g+4>>2]=0}else{a[g>>0]=0;a[i>>0]=0}Y6(g,0);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];o=a[i>>0]|0;if(((o<<24>>24<0?c[g+4>>2]|0:o&255)+-1|0)>>>0<2){l=h;return e+2|0}else{e=Ha(12)|0;B6(e,1);Ka(e|0,2720,374)}return 0}function gp(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;i=l;l=l+16|0;j=i+12|0;k=i+8|0;m=i+4|0;n=i;o=c[e>>2]|0;e=c[f>>2]|0;f=o;p=e;if((o|0)==(e|0)){e=Ha(12)|0;B6(e,3);Ka(e|0,2720,374)}e=a[o>>0]|0;switch(e<<24>>24|0){case 0:{_6(g,e)|0;q=o+1|0;l=i;return q|0}case 98:{_6(g,8)|0;q=o+1|0;l=i;return q|0}case 100:{e=h+80|0;b[e>>1]=b[e>>1]|2048;q=o+1|0;l=i;return q|0}case 68:{e=h+82|0;b[e>>1]=b[e>>1]|2048;q=o+1|0;l=i;return q|0}case 115:{e=h+80|0;b[e>>1]=b[e>>1]|8192;q=o+1|0;l=i;return q|0}case 83:{e=h+82|0;b[e>>1]=b[e>>1]|8192;q=o+1|0;l=i;return q|0}case 119:{e=h+80|0;b[e>>1]=b[e>>1]|3072;do if(!(a[h+85>>0]|


er select,.crosslet * .crosslet_panel .box:hover select,.crosslet .crosslet_panel .box.selected input[type="text"],.crosslet * .crosslet_panel .box.selected input[type="text"],.crosslet .crosslet_panel .box:hover input[type="text"],.crosslet * .crosslet_panel .box:hover input[type="text"]{background-color:#fff;border:1px solid #b3b3b3;transition:background-color .2s;-moz-transition:background-color .2s;-webkit-transition:background-color .2s;-o-transition:background-color .2s}.crosslet .crosslet_panel .box.selected .graph,.crosslet * .crosslet_panel .box.selected .graph,.crosslet .crosslet_panel .box:hover .graph,.crosslet * .crosslet_panel .box:hover .graph{margin:5px;margin-bottom:2px;display:block}.crosslet .crosslet_panel .box.selected .graph svg,.crosslet * .crosslet_panel .box.selected .graph svg,.crosslet .crosslet_panel .box:hover .graph svg,.crosslet * .crosslet_panel .box:hover .graph svg{height:45px;transition:height .2s;-moz-transition:height .2s;-webkit-transition:height .2s;-o-transition:height .2s}.crosslet .crosslet_panel .box.selected .graph .axis,.crosslet * .crosslet_panel .box.selected .graph .axis,.crosslet .crosslet_panel .box:hover .graph .axis,.crosslet * .crosslet_panel .box:hover .graph .axis{display:inline;transition:display .2s;-moz-transition:display .2s;-webkit-transition:display .2s;-o-transition:display .2s}.crosslet .crosslet_panel .box.selected .graph .brush .resize,.crosslet * .crosslet_panel .box.selected .graph .brush .resize,.crosslet .crosslet_panel .box:hover .graph .brush .resize,.crosslet * .crosslet_panel .box:hover .graph .brush .resize{display:inline}.crosslet .crosslet_panel .box.selected .graph .background.bar,.crosslet * .crosslet_panel .box.selected .graph .background.bar,.crosslet .crosslet_panel .box:hover .graph .background.bar,.crosslet * .crosslet_panel .box:hover .graph .background.bar{fill:#ccc}.crosslet .box:not(.selected):hover .foreground.bar,.crosslet * .box:not(.selected):hover .foreground.bar{fill:#808080}.crosslet .box:not(.selected) .foreground.bar,.crosslet * .box:not(.selected) .foreground.bar{fill:#bcbcbc}.crosslet svg g.crosslet_geometry{fill-opacity:.5}.crosslet svg g.crosslet_geometry path{fill:white;stroke:none}.crosslet svg g.crosslet_geometry path:hover{fill-opacity:.2;stroke-width:2px;stroke:white;box-shadow:-5px -5px -5px -5px rgba(0,0,0,0.8)}.crosslet svg .hover{display:none}.crosslet svg .hover rect{stroke:none;fill-opacity:.5;fill:#efefef;border-radius:5px}.crosslet svg .hover text{font-size:12px;fill:black;font-weight:bold}.crosslet svg:hover .hover{display:inline}/*!
 * Bootstrap Responsive v2.2.2
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 */

@-ms-viewport {
  width: device-width;
}

.clearfix {
  *zoom: 1;
}

.clearfix:before,
.clearfix:after {
  display: table;
  line-height: 0;
  content: "";
}

.clearfix:after {
  clear: both;
}

.hide-text {


 ill-formed subsequence.
			switch {
			case nSrc+1 >= n || src[nSrc+1] < accept.Lo || accept.Hi < src[nSrc+1]:
				size = 1
			case nSrc+2 >= n || src[nSrc+2] < utf8internal.LoCB || utf8internal.HiCB < src[nSrc+2]:
				size = 2
			default:
				size = 3 // As we are short, the maximum is 3.
			}
			goto handleInvalid
		}
		if c = src[nSrc+1]; c < accept.Lo || accept.Hi < c {
			size = 1
			goto handleInvalid // invalid continuation byte
		} else if size == 2 {
		} else if c = src[nSrc+2]; c < utf8internal.LoCB || utf8internal.HiCB < c {
			size = 2
			goto handleInvalid // invalid continuation byte
		} else if size == 3 {
		} else if c = src[nSrc+3]; c < utf8internal.LoCB || utf8internal.HiCB < c {
			size = 3
			goto handleInvalid // invalid continuation byte
		}
		nSrc += size
		continue

	handleInvalid:
		// Copy the scanned input so far.
		nDst += copy(dst[nDst:], src[pSrc:nSrc])

		// Append RuneError to the destination.
		const runeError = "\ufffd"
		if nDst+len(runeError) > len(dst) {
			return nDst, nSrc, transform.ErrShortDst
		}
		nDst += copy(dst[nDst:], runeError)

		// Skip the maximal subpart of an ill-formed subsequence according to
		// the W3C standard way instead of the Go way. This Transform is
		// probably the only place in the text repo where it is warranted.
		nSrc += size
		pSrc = nSrc

		// Recompute the maximum source length.
		if sz := len(dst) - nDst; sz < len(src)-nSrc {
			err = transform.ErrShortDst
			n = nSrc + sz
			atEOF = false
		}
	}
	return nDst + copy(dst[nDst:], src[pSrc:nSrc]), nSrc, err
}

// UTF16 returns a UTF-16 Encoding for the given default endianness and byte
// order mark (BOM) policy.
//
// When decoding from UTF-16 to UTF-8, if the BOMPolicy is IgnoreBOM then
// neither BOMs U+FEFF nor noncharacters U+FFFE in the input stream will affect
// the endianness used for decoding, and will instead be output as their
// standard UTF-8 encodings: "\xef\xbb\xbf" and "\xef\xbf\xbe". If the BOMPolicy
// is UseBOM or ExpectBOM a staring BOM is not written to the UTF-8 output.
// Instead, it overrides the default endianness e for the remainder of the
// transformation. Any subsequent BOMs U+FEFF or noncharacters U+FFFE will not
// affect the endianness used, and will instead be output as their standard
// UTF-8 encodings. For UseBOM, if there is no starting BOM, it will proceed
// with the default Endianness. For ExpectBOM, in that case, the transformation
// will return early with an ErrMissingBOM error.
//
// When encoding from UTF-8 to UTF-16, a BOM will be inserted at the start of
// the output if the BOMPolicy is UseBOM or ExpectBOM. Otherwise, a BOM will not
// be inserted. The UTF-8 input does not need to contain a BOM.
//
// There is no concept of a 'native' endianness. If the UTF-16 data is produced
// and consumed in a greater context that implies a certain endianness, use
// IgnoreBOM. Otherwise, use ExpectBOM and always produce and consume a BOM.
//
// In the language of http://www.unicode.org/faq/utf_bom.html#bom10,


10,(byte)0xD4,(byte)0xB8
	   };
	public final static short SECP256K1_K = 0x01; // cofactor
	public final static short OFFSET_SECP256K1_P = 0;
	public final static short OFFSET_SECP256K1_a = 32;
	public final static short OFFSET_SECP256K1_b = 64;
	public final static short OFFSET_SECP256K1_R = 96;
	public final static short OFFSET_SECP256K1_G = 128;

	public static void setCommonCurveParameters(ECKey eckey){
		eckey.setFieldFP( SECP256K1, OFFSET_SECP256K1_P, (short)32);
		eckey.setA( SECP256K1, OFFSET_SECP256K1_a, (short)32);
		eckey.setB( SECP256K1, OFFSET_SECP256K1_b, (short)32);
		eckey.setR( SECP256K1, OFFSET_SECP256K1_R, (short)32);
		eckey.setG( SECP256K1, OFFSET_SECP256K1_G, (short)65);
		eckey.setK( SECP256K1_K);
	}

	public static boolean checkCurveParameters(ECKey eckey, byte[] tmpbuffer, short tmpoffset){

		eckey.getA(tmpbuffer, tmpoffset);
		if (0!=Util.arrayCompare(tmpbuffer, tmpoffset, SECP256K1, OFFSET_SECP256K1_a, (short)32))
			return false;
		eckey.getB(tmpbuffer, tmpoffset);
		if (0!=Util.arrayCompare(tmpbuffer, tmpoffset, SECP256K1, OFFSET_SECP256K1_b, (short)32))
			return false;
		eckey.getG(tmpbuffer, tmpoffset);
		if (0!=Util.arrayCompare(tmpbuffer, tmpoffset, SECP256K1, OFFSET_SECP256K1_G, (short)65))
			return false;
		eckey.getR(tmpbuffer, tmpoffset);
		if (0!=Util.arrayCompare(tmpbuffer, tmpoffset, SECP256K1, OFFSET_SECP256K1_R, (short)32))
			return false;
		eckey.getField(tmpbuffer, tmpoffset);
		if (0!=Util.arrayCompare(tmpbuffer, tmpoffset, SECP256K1, OFFSET_SECP256K1_P, (short)32))
			return false;
		if (eckey.getK()!= SECP256K1_K)
			return false;

		return true;
	}

//
//	private final static byte[] SECP256K1_P = {(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF, (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,
//											   (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF, (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,
//											   (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF, (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,
//											   (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFE, (byte)0xFF,(byte)0xFF,(byte)0xFC,(byte)0x2F};
//	private final static byte[


spellid)
			name = name or L["Unknown"]
			icon = icon or [[Interface\ICONS\INV_Misc_QuestionMark]]
			rawset(t, spellid, icon)
			rawset(ns.spellnames, spellid, name)
			return icon
		end,
		__newindex = function(t, spellid, icon)
			rawset(t, spellid, icon)
		end
	})
end

-------------------------------------------------------------------------------
-- creatures, players and pets checkers

do
	local strsub = string.sub
	local UnitGUID, UnitName = UnitGUID, UnitName
	local UnitClass, UnitIsPlayer = UnitClass, UnitIsPlayer

	local BITMASK_GROUP = Private.BITMASK_GROUP
	local BITMASK_PETS = Private.BITMASK_PETS
	local BITMASK_FRIENDLY = Private.BITMASK_FRIENDLY
	local BITMASK_NPC = Private.BITMASK_NPC
	local BITMASK_PLAYER = Private.BITMASK_PLAYER

	ns.userGUID = UnitGUID("player")
	_, ns.userClass = UnitClass("player")
	ns.userName = UnitName("player")
	ns.userRealm = gsub(GetRealmName(), "%s", "")

	-- checks if the given guid/flags are those of a creature.
	function Private.IsCreature(guid, flags)
		if tonumber(guid) then
			return (band(strsub(guid, 1, 5), 0x00F) == 3 or band(strsub(guid, 1, 5), 0x00F) == 5)
		end
		return (band(flags or 0, BITMASK_NPC) ~= 0)
	end

	-- used to protect tables
	local table_mt = {__metatable = true}

	-- players & pets [guid] = UnitID
	local guidToUnit = setmetatable(Private.guidToUnit or {}, table_mt)
	Private.guidToUnit = guidToUnit

	-- players: [guid] = class / pets: [guid] = owner guid
	local guidToClass = setmetatable(Private.guidToClass or {}, table_mt)
	Private.guidToClass = guidToClass

	-- players only: [guid] = name
	local guidToName = setmetatable(Private.guidToName or {}, table_mt)
	Private.guidToName = guidToName

	-- pets only: [pet guid] = owner guid
	local guidToOwner = setmetatable(Private.guidToOwner or {}, {
		__metatable = true,
		__newindex = function(t, guid, owner)
			rawset(guidToClass, guid, owner)
			rawset(t, guid, owner)
		end
	})
	Private.guidToOwner = guidToOwner

	do
		-- tables used to cached results in order to speed up check
		local __t1 = Private.WeakTable() -- cached players
		local __t2 = Private.WeakTable() -- cached pets

		-- checks if the guid is a player (extra: helps IsPet)
		function Private.IsPlayer(guid, name, flags)
			-- already cached?
			if __t1[guid] ~= nil then
				return __t1[guid]
			end

			-- group member?
			if guidToName[guid] then
				__t1[guid] = 1
				__t2[guid] = (__t2[guid] == nil) and false or __t2[guid]
				return 1
			end

			-- group pet?
			if guidToClass[guid] then
				__t1[guid] = false
				__t2[guid] = __t2[guid] or 1
				return false
			end

			-- player by flgs?
			if band(flags or 0, BITMASK_PLAYER) == BITMASK_PLAYER then
				__t1[guid] = true
				__t2[guid] = (__t2[guid] == nil) and false or __t2[guid]
				return true
			end

			-- player by UnitIsPlayer?
			if name and UnitIsPlayer(name) then
				__t1[guid] = true
				__t2[guid] = (__t2[guid] == nil) and false or __t2[guid]
				ret


forName("java.lang.ThreadGroup", false, ThreadUtil_ESTest_scaffolding.class.getClassLoader()));
    mock(Class.forName("java.util.concurrent.ThreadFactory", false, ThreadUtil_ESTest_scaffolding.class.getClassLoader()));
  }

  private static void resetClasses() {
    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ThreadUtil_ESTest_scaffolding.class.getClassLoader());

    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
      "org.apache.commons.exec.ThreadUtil"
    );
  }
}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.math4.neuralnet.twod.util;

import java.util.List;
import org.apache.commons.math4.neuralnet.internal.NeuralNetException;
import org.apache.commons.math4.neuralnet.DistanceMeasure;
import org.apache.commons.math4.neuralnet.MapRanking;
import org.apache.commons.math4.neuralnet.Neuron;
import org.apache.commons.math4.neuralnet.twod.NeuronSquareMesh2D;

/**
 * Visualization of high-dimensional data projection on a 2D-map.
 * The method is described in
 *

 *  Using Smoothed Data Histograms for Cluster Visualization in Self-Organizing Maps
 *

 *  by Elias Pampalk, Andreas Rauber and Dieter Merkl.
 *

 * @since 3.6
 */
public class SmoothedDataHistogram implements MapDataVisualization {
    /** Smoothing parameter. */
    private final int smoothingBins;
    /** Distance. */
    private final DistanceMeasure distance;
    /** Normalization factor. */
    private final double membershipNormalization;

    /**
     * @param smoothingBins Number of bins.
     * @param distance Distance.
     */
    public SmoothedDataHistogram(int smoothingBins,
                                 DistanceMeasure distance) {
        this.smoothingBins = smoothingBins;
        this.distance = distance;

        double sum = 0;
        for (int i = 0; i < smoothingBins; i++) {
            sum += smoothingBins - i;
        }

        this.membershipNormalization = 1d / sum;
    }

    /**
     * {@inheritDoc}
     *
     * @throws IllegalArgumentException if the size of the {@code map} is
     * smaller than the number of {@link #SmoothedDataHistogram(int,DistanceMeasure)
     * smoothing bins}.
     */
    @Override
    public double[][] computeImage(NeuronSquareMesh2D map,
                                   Iterable<double[]> data) {
        final int nR = map.getNumberOfRows();
        final int nC = map.getNumberOfColumns();

        final int mapSize = nR * nC;
        if (mapSize < smoothingBins) {
            throw new NeuralNetException(NeuralNetException.TOO_SMALL,
                                         mapSize, smoothingBins);
        }

        final LocationFinder finder = new LocationFinder(map);
        final MapRanking rank = new MapRanking(map.getNetwork(), distance);

        // Histogram bins.
        final double[][] histo = new double[nR][nC];

        for (final double[] sample : data) {
            final List<Neuron> sorted =


on|',
  [21465] = '?|David Wayne|',
  [21469] = 'A|Daranelle|She is a centaur, just off the road to the right.',
  [21471] = '?|Stormer Ewan Wildwing|',
  [21475] = '?|Scout Zagran|',
  [21496] = 'H|Dertrok|Standing next to 2 small hills.',
  [21499] = '?|Overseer Ripsaw|',
  [21500] = '?|Morgroron|',
  [21501] = '?|Makazradon|',
  [21516] = "?|Death's Watch|",
  [21519] = "?|Death's Might|",
  [21644] = '?|Skettis Wing Guard|',
  [21649] = '?|Skettis Windwalker|',
  [21650] = '?|Skettis Talonite|',
  [21656] = '?|Illidari Satyr|',
  [21657] = "?|Neltharaku|He's a big blue ghost dragon that flies around in the sky all around this area.  You may need to search for him.",
  [21660] = '?|Cabal Abjurist|',
  [21661] = '?|Cabal Skirmisher|',
  [21662] = '?|Cabal Tomb-Raider|',
  [21663] = '?|Oronu the Elder|',
  [21690] = '?|R-3D0|',
  [21691] = 'A|Toshley|Dressed in all black, standing in the middle of town.',
  [21694] = '?|Bog Overlord|',
  [21700] = '?|Akama|',
  [21709] = '?|Eykenen|',
  [21710] = '?|Uylaru|',
  [21711] = '?|Haalum|',
  [21753] = '?|Shadow Council Felsworn|',
  [21754] = '?|Shadow Council Zealot|',
  [21755] = 'A|Nickwinkle the Metro-Gnome|To the left as you enter town, next to a big orange orb.',
  [21767] = '?|Harbinger of the Raven|',
  [21769] = "?|Overlord Or'barokh|",
  [21770] = '?|Researcher Tiorus|',
  [21771] = '?|Warcaller Sardon Truslice|',
  [21772] = '?|Chief Apothecary Hildagard|',
  [21773] = '?|Thane Yoregar|',
  [21774] = '?|Zorus the Judicator|',
  [21775] = '?|Warcaller Beersnout|',
  [21777] = '?|Gnomus|',
  [21782] = 'B|Timeon|Standing on the edge of the moonwell.',
  [21784] = '?|Ghostrider of Karabor|',
  [21788] = '?|Shadowmoon Zealot|',
  [21789] = '?|Nakansi|',
  [21790] = '?|Plexi|',
  [21795] = '?|Shadowmoon Harbinger|',
  [21797] = '?|Ancient Shadowmoon Spirit|',
  [21801] = "?|Vhel'kur|",
  [21803] = '?|Ashtongue Handler|',
  [21809] = '?|Wyrmcult Poacher|',
  [21810] = '?|Wyrmcult Hewer|',
  [21815] = '?|Cleric of Karabor|',
  [21817] = '?|Adolescent Nether Drake|',
  [21820] = '?|Mature Nether Drake|',
  [21821] = '?|Proto-Nether Drake|',
  [21822] = '?|Vindicator Aluumen|',
  [21824] = 'A|Dizzy Dina|Under a big gear whee


",
				txt("foo", "simple"),
				a("foo", "1.2.3.4"),
				txt("@", "asimple"),
				a("@", "2.2.2.2"),
				ignore("foo", "", ""),
			).ExpectNoChanges().UnsafeIgnore(),
			tc("VERIFY PREVIOUS",
				txt("foo", "simple"),
				a("foo", "1.2.3.4"),
				txt("@", "asimple"),
				a("@", "2.2.2.2"),
			).ExpectNoChanges(),
		),

		// IGNORE with wildcards

		testgroup("IGNORE wilds",
			tc("Create some records",
				a("foo.bat", "1.2.3.4"),
				a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
			),

			tc("ignore label=foo.*",
				// a("foo.bat", "1.2.3.4"),
				// a("foo.bat", "2.3.4.5"),
				// txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
				ignore("foo.*", "", ""),
			).ExpectNoChanges(),
			tc("VERIFY PREVIOUS",
				a("foo.bat", "1.2.3.4"),
				a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
			).ExpectNoChanges(),

			tc("ignore label=foo.bat,type",
				// a("foo.bat", "1.2.3.4"),
				// a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				// a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
				ignore("*.bat", "A", ""),
			).ExpectNoChanges(),
			tc("VERIFY PREVIOUS",
				a("foo.bat", "1.2.3.4"),
				a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
			).ExpectNoChanges(),

			tc("ignore target=*.domain",
				a("foo.bat", "1.2.3.4"),
				a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				// cname("mail.bat", "ghs.googlehosted.com."),
				ignore("", "", "*.googlehosted.com."),
			).ExpectNoChanges(),
			tc("VERIFY PREVIOUS",
				a("foo.bat", "1.2.3.4"),
				a("foo.bat", "2.3.4.5"),
				txt("foo.bat", "simple"),
				a("bar.bat", "5.5.5.5"),
				cname("mail.bat", "ghs.googlehosted.com."),
			).ExpectNoChanges(),
		),

		// IGNORE with changes
		testgroup("IGNORE with modify",
			not("NAMECHEAP"), // Will fail until converted to use diff2 module.
			tc("Create some records",
				a("foo", "1.1.1.1")


seCRLF

	// i is so we can track row count as we process each streamed in row
	hasError := false
	i := 1
	for {
		row, err := r.Read()
		if err == io.EOF {
			break
		}
		if i == 1 && fieldsPerRecord == 0 {
			fieldsPerRecord = len(row)
		}
		if err != nil {
			serr := fmt.Sprintf("%s", err)
			if strings.HasSuffix(serr, "wrong number of fields in line") == true && fieldsPerRecord >= 0 {
				if verbose {
					fmt.Fprintf(eout, "row %d: expected %d, got %d cells\n", i, fieldsPerRecord, len(row))
				}
			} else {
				hasError = true
				if verbose {
					fmt.Fprintln(eout, err)
				}
			}
		}
		// Trim trailing cells if needed
		if fieldsPerRecord > 0 && len(row) > fieldsPerRecord {
			row = row[0:fieldsPerRecord]
		}
		if fieldsPerRecord > 0 && len(row) < fieldsPerRecord {
			// Append cells if needed
			for len(row) < fieldsPerRecord { //expectedCellCount {
				row = append(row, "")
			}
		}
		if trimSpace || trimLeftSpace || trimRightSpace {
			for i := range row {
				s := row[i]
				switch {
				case trimSpace:
					row[i] = strings.TrimSpace(s)
				case trimRightSpace:
					row[i] = strings.TrimRight(s, " \t\n\r")
				case trimLeftSpace:
					row[i] = strings.TrimLeft(s, " \t\n\r")
				}
			}
		}
		if err := w.Write(row); err != nil {
			fmt.Fprintf(eout, "error writing row %d: %s", i, err)
			hasError = true
		}
		i++
		if verbose == true && (i%100) == 0 {
			fmt.Fprintf(eout, "Processed %d rows\n", i)
		}
		if hasError && stopOnError {
			os.Exit(1)
		}
	}
	// Finally we need to flush any remaining output...
	w.Flush()
	err = w.Error()
	if err != nil {
		fmt.Fprintln(eout, err)
		os.Exit(1)
	}
	if verbose == true {
		fmt.Fprintf(eout, "Processed %d rows\n", i)
	}
	//fmt.Fprintf(app.Out, "%s", eol)
}
package babyapi

import (
	"log/slog"
	"net/http"
	"time"

	"github.com/go-chi/chi/v5"
	"github.com/go-chi/chi/v5/middleware"
	"github.com/go-chi/render"
)

var DefaultMiddleware = []func(http.Handler) http.Handler{
	middleware.RequestID,
	middleware.RealIP,
	middleware.Recoverer,
}

func (a *API[T]) applyDefaultMiddleware(r chi.Router) {
	for _, m := range DefaultMiddleware {
		r.Use(m)
	}
	r.Use(a.logMiddleware)
}

func (a *API[T]) logMiddleware(next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		logger := slog.Default()
		logger = logger.With(
			"method", r.Method,
			"path", r.RequestURI,
			"host", r.Host,
			"from", r.RemoteAddr,
			"request_id", middleware.GetReqID(r.Context()),
		)

		ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor)

		t1 := time.Now()
		defer func() {
			if r.URL.Path == "/metrics" {
				return
			}
			logger.With(
				"status", ww.Status(),
				"


uf.ByteString) ref;
    }
  }

  public static final int POSITIONALQUERYPARAMS_FIELD_NUMBER = 2;
  @SuppressWarnings("serial")
  private java.util.List<io.evitadb.externalApi.grpc.generated.GrpcQueryParam> positionalQueryParams_;
  /**
   *

   * The positional query parameters.
   *

   *
   * repeated .io.evitadb.externalApi.grpc.generated.GrpcQueryParam positionalQueryParams = 2;
   */
  @java.lang.Override
  public java.util.List<io.evitadb.externalApi.grpc.generated.GrpcQueryParam> getPositionalQueryParamsList() {
    return positionalQueryParams_;
  }
  /**
   *

   * The positional query parameters.
   *

   *
   * repeated .io.evitadb.externalApi.grpc.generated.GrpcQueryParam positionalQueryParams = 2;
   */
  @java.lang.Override
  public java.util.List<? extends io.evitadb.externalApi.grpc.generated.GrpcQueryParamOrBuilder>
      getPositionalQueryParamsOrBuilderList() {
    return positionalQueryParams_;
  }
  /**
   *

   * The positional query parameters.
   *

   *
   * repeated .io.evitadb.externalApi.grpc.generated.GrpcQueryParam positionalQueryParams = 2;
   */
  @java.lang.Override
  public int getPositionalQueryParamsCount() {
    return positionalQueryParams_.size();
  }
  /**
   *

   * The positional query parameters.
   *

   *
   * repeated .io.evitadb.externalApi.grpc.generated.GrpcQueryParam positionalQueryParams = 2;
   */
  @java.lang.Override
  public io.evitadb.externalApi.grpc.generated.GrpcQueryParam getPositionalQueryParams(int index) {
    return positionalQueryParams_.get(index);
  }
  /**
   *

   * The positional query parameters.
   *

   *
   * repeated .io.evitadb.externalApi.grpc.generated.GrpcQueryParam positionalQueryParams = 2;
   */
  @java.lang.Override
  public io.evitadb.externalApi.grpc.generated.GrpcQueryParamOrBuilder getPositionalQueryParamsOrBuilder(
      int index) {
    return positionalQueryParams_.get(index);
  }

  public static final int NAMEDQUERYPARAMS_FIELD_NUMBER = 3;
  private static final class NamedQueryParamsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, io.evitadb.externalApi.grpc.generated.GrpcQueryParam> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, io.evitadb.externalApi.grpc.generated.GrpcQueryParam>newDefaultInstance(
                io.evitadb.externalApi.grpc.generated.GrpcEvitaSessionAPI.internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_NamedQueryParamsEntry_descriptor,
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.MESSAGE,
                io.evitadb.externalApi.grpc.generated.GrpcQueryParam.getDefaultInstance());
  }
  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<
      java.lang.String, io.evitadb.externalApi.grpc.generated.GrpcQueryParam> namedQueryParams_;
  private com.google.protobuf.MapField<java.lang.String, io.evitadb.externalApi.grpc.generated.GrpcQueryParam>
  internalGetNamedQueryParams() {
    if (namedQueryParams_ == null) {


{
    case IMGFMT_YV12:
    case IMGFMT_I420:
        return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW |VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN|VFCAP_ACCEPT_STRIDE;
    }
    return 0;
}

static int control(uint32_t request, void *data)
{
    switch (request) {
        case VOCTRL_GET_IMAGE:
            return get_image(data);
        case VOCTRL_QUERY_FORMAT:
            return query_format(*((uint32_t*)data));
        case VOCTRL_DRAW_IMAGE:
            return draw_image(data);
        case VOCTRL_FULLSCREEN:
            return pfb_fullscreen();
        case VOCTRL_XOVERLAY_SUPPORT:
            return VO_TRUE;
        case VOCTRL_XOVERLAY_SET_COLORKEY:
            return pfb_set_colorkey(data);
        case VOCTRL_XOVERLAY_SET_WIN:
            return pfb_set_window(data);
    }

    return VO_NOTIMPL;
}


<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
trim<wbr/>Off<wbr/>Url<wbr/>Protocol

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
trim<wbr/>Trailing<wbr/>Slash

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
twox128

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
twox256

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
twox64<wbr/>Concat

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
u8a<wbr/>Eq
Compare two Uint8Arrays for equality

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
u8a<wbr/>To<wbr/>Hex
Convert a Uint8Array to a hex string

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
u8a<wbr/>To<wbr/>String
Convert a Uint8Array to a string

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
wait<wbr/>For
Wait for a certain amount of time in milliseconds

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
xxhash<wbr/>As<wbr/>Hex

<svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg>
xxhash<wbr/>As<wbr/>U8a

Generated using TypeDoc

<!DOCTYPE html><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ShapeSet | Dedot API References


ps>;

    fn get_device_class(&self) -> String;

    fn get_display_name(&self) -> String;

    fn get_properties(&self) -> Option<Structure>;

    fn has_classes(&self, classes: &str) -> bool;

    fn has_classesv(&self, classes: &[&str]) -> bool;

    fn reconfigure_element<P: IsA<Element>>(&self, element: &P) -> bool;

    fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
}

impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
    fn create_element<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element> {
        let name = name.into();
        let name = name.to_glib_none();
        unsafe {
            from_glib_full(ffi::gst_device_create_element(self.to_glib_none().0, name.0))
        }
    }

    fn get_caps(&self) -> Option<Caps> {
        unsafe {
            from_glib_full(ffi::gst_device_get_caps(self.to_glib_none().0))
        }
    }

    fn get_device_class(&self) -> String {
        unsafe {
            from_glib_full(ffi::gst_device_get_device_class(self.to_glib_none().0))
        }
    }

    fn get_display_name(&self) -> String {
        unsafe {
            from_glib_full(ffi::gst_device_get_display_name(self.to_glib_none().0))
        }
    }

    fn get_properties(&self) -> Option<Structure> {
        unsafe {
            from_glib_full(ffi::gst_device_get_properties(self.to_glib_none().0))
        }
    }

    fn has_classes(&self, classes: &str) -> bool {
        unsafe {
            from_glib(ffi::gst_device_has_classes(self.to_glib_none().0, classes.to_glib_none().0))
        }
    }

    fn has_classesv(&self, classes: &[&str]) -> bool {
        unsafe {
            from_glib(ffi::gst_device_has_classesv(self.to_glib_none().0, classes.to_glib_none().0))
        }
    }

    fn reconfigure_element<P: IsA<Element>>(&self, element: &P) -> bool {
        unsafe {
            from_glib(ffi::gst_device_reconfigure_element(self.to_glib_none().0, element.to_glib_none().0))
        }
    }

    fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe {
            let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
            connect(self.to_glib_none().0, "removed",
                transmute(removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
        }
    }
}

unsafe extern "C" fn removed_trampoline<P>(this: *mut ffi::GstDevice, f: glib_ffi::gpointer)
where P: IsA<Device> {
    let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
    f(&Device::from_glib_borrow(this).downcast_unchecked())
}
#![deny(warnings)]
#![allow(dead_code)]

#[macro_use]
mod leema;

#[macro_use]
extern crate pest_derive;

use crate::leema::application::Application;
use crate::leema::canonical::Canonical;
use crate::leema::code;
use crate::leema::failure::Lresult


        const V = e3.clone().neg().rotate(R);
            expect(V.a).toBe(0);
            expect(V.x).toBe(0);
            expect(V.y).toBe(0);
            expect(V.z).toBe(1);
            expect(V.yz).toBe(0);
            expect(V.zx).toBe(0);
            expect(V.xy).toBe(0);
        });
        it("(random, random) should be rotor that rotates a to b", function () {
            const a = Geometric3.random().grade(1).direction(true);
            const b = Geometric3.random().grade(1).direction(true);
            const R = Geometric3.rotorFromDirections(a, b);
            const V = a.clone().rotate(R);
            expect(V.a).toBe(0);
            expect(V.x).toBeCloseTo(b.x, PRECISION);
            expect(V.y).toBeCloseTo(b.y, PRECISION);
            expect(V.z).toBeCloseTo(b.z, PRECISION);
            expect(V.yz).toBe(0);
            expect(V.zx).toBe(0);
            expect(V.xy).toBe(0);
        });
    });

    describe("rotorFromFrameToFrame", function () {
        it("[e1, e2, e3] to [e1, e2, e3] should be 1", function () {
            const R = Geometric3.rotorFromFrameToFrame([e1, e2, e3], [e1, e2, e3]);
            expect(R.a).toBe(1);
        });
        it("[e2, e3, e1] to [e3, e2, -e1]", function () {
            const R = Geometric3.rotorFromFrameToFrame([e2, e3, e1], [e3, e2, e1.__neg__()]);
            const f1 = e2.clone().rotate(R);
            expect(f1.x).toBeCloseTo(e3.x, 14);
            expect(f1.y).toBeCloseTo(e3.y, 14);
            expect(f1.z).toBeCloseTo(e3.z, 14);
            const f2 = e3.clone().rotate(R);
            expect(f2.x).toBeCloseTo(e2.x, 14);
            expect(f2.y).toBeCloseTo(e2.y, 14);
            expect(f2.z).toBeCloseTo(e2.z, 14);
        });
    });

    describe("rotorFrmGeneratorAngle", function () {
        describe("(e1 ^ e2, PI)", function () {
            const B: BivectorE3 = e1.clone().ext(e2);
            const R = Geometric3.random();
            R.rotorFromGeneratorAngle(B, Math.PI);
            R.approx(12);
            it("shoud equal e2 ^ e1", function () {
                expect(R.equals(e2.clone().ext(e1))).toBeTruthy();
            });
        });
        describe("(2  e1 ^ e2, PI/2)", function () {
            const B = e1.clone().ext(e2).mulByNumber(2);
            const R = Geometric3.one.clone().addVector(e1).addVector(e2).addVector(e3).addPseudo(1).add(B);
            R.rotorFromGeneratorAngle(B, Math.PI / 2);
            R.approx(12);
            it("shoud equal e2 ^ e1", function () {
                expect(R.equals(e2.clone().ext(e1))).toBeTruthy();
            });
        });
    });

    describe("reflect", function () {
        const n = Geometric3.vector(1, 0, 0);
        const a = Geometric3.vector(2, 3, 0, Unit.METER);
        const chain = a.reflect(n);

        it("should reflect (2,3)", function () {
            expect


ode}", "Remove"))
                {
                    var client = GetProxmoxClient();
                    var endpoint = $"nodes/{Node}/lxc/{CTID}";

                    if (Force.IsPresent)
                    {
                        endpoint += "?force=1";
                    }

                    var response = client.Delete(endpoint);
                    var responseData = JsonUtility.DeserializeResponse<JObject>(response);
                    var taskId = responseData["upid"]?.ToString();

                    var taskStatus = WaitForTask(Node, taskId);
                    if (taskStatus != "OK")
                    {
                        throw new Exception($"Failed to remove container: {taskStatus}");
                    }

                    WriteVerbose($"Container {CTID} on node {Node} removed successfully");
                }
            }
            catch (Exception ex)
            {
                WriteError(new ErrorRecord(ex, "RemoveProxmoxContainerError", ErrorCategory.OperationStopped, null));
            }
        }

        private string WaitForTask(string node, string taskId)
        {
            var client = GetProxmoxClient();
            var status = "";
            var attempts = 0;
            var maxAttempts = 60; // Wait up to 60 seconds

            while (attempts < maxAttempts)
            {
                var response = client.Get($"nodes/{node}/tasks/{taskId}/status");
                var data = JsonUtility.DeserializeResponse<JObject>(response);
                status = data["status"]?.ToString();

                if (status == "stopped")
                {
                    return data["exitstatus"]?.ToString() ?? "OK";
                }

                System.Threading.Thread.Sleep(1000);
                attempts++;
            }

            throw new Exception("Timeout waiting for task to complete");
        }
    }
}


t mock_character.hp <= mock_character.max_hp

    def test_collection_assertions(self):
        """コレクションの具体的なアサーション"""
        from src.character.party import Party

        party = Party("TestParty")

        char1 = Character.create_character("Hero1", "human", "fighter", BaseStats(strength=15))
        char2 = Character.create_character("Hero2", "elf", "mage", BaseStats(intelligence=16))

        party.add_character(char1)
        party.add_character(char2)

        # ❌ 悪い例: 抽象的なアサーション
        # assert len(party.characters) > 0
        # assert char1 in party.characters.values()

        # ✅ 良い例: 具体的なアサーション
        assert len(party.characters) == 2
        assert char1.character_id in party.characters
        assert char2.character_id in party.characters
        assert party.characters[char1.character_id].name == "Hero1"
        assert party.characters[char2.character_id].name == "Hero2"

    def test_floating_point_assertions(self):
        """浮動小数点数の適切なアサーション"""
        # 浮動小数点計算のテスト例（単純な計算でデモ）
        base_value = 10.0
        modifier = 1.15  # 15%ボーナス

        calculated_value = base_value * modifier

        # ❌ 悪い例: 厳密な等価比較（浮動小数点誤差で失敗する可能性）
        # assert calculated_value == 11.5

        # ✅ 良い例: 適切な許容誤差での比較
        expected_value = 11.5
        assert abs(calculated_value - expected_value) < 0.01

        # pytest.approx を使用した例
        assert calculated_value == pytest.approx(11.5, rel=1e-2)

    def test_exception_assertions(self):
        """例外の具体的なアサーション"""
        # 例外を発生させる関数の例
        def validate_positive_number(value):
            if value <= 0:
                raise ValueError("値は正の数である必要があります")
            return value

        # ❌ 悪い例: 例外の種類のみチェック
        # with pytest.raises(Exception):
        #     validate_positive_number(-1)

        # ✅ 良い例: 例外の種類とメッセージをチェック
        with pytest.raises(ValueError, match="値は正の数である必要があります"):
            validate_positive_number(-1)

    def test_state_transition_assertions(self, mock_character):
        """状態遷移の具体的なアサーション"""
        # 初期状態のシミュレート
        mock_character.status = "good"
        initial_hp = mock_character.hp

        # 致命的ダメージのシミュレート
        mock_character.hp = 0
        mock_character.status = "dead"

        # ❌ 悪い例: 抽象的な状態チェック
        # assert mock_character.status != "good"

        # ✅ 良い例: 具体的な状態チェック
        assert mock_character.status == "dead"
        assert mock_character.hp == 0


. Used to detect conflict.
	maxAssigned uint64  // max transaction assigned by us.

	// All transactions with startTs < startTxnTs return true for hasConflict.
	startTxnTs  uint64
	subscribers map[int]chan pb.OracleDelta
	updates     chan *pb.OracleDelta
	doneUntil   y.WaterMark
}

// Init initializes the oracle.
func (o *Oracle) Init() {
	o.commits = make(map[uint64]uint64)
	// Remove the older btree file, before creating NewTree, as it may contain stale data leading
	// to wrong results.
	o.keyCommit = z.NewTree("oracle")
	o.subscribers = make(map[int]chan pb.OracleDelta)
	o.updates = make(chan *pb.OracleDelta, 100000) // Keeping 1 second worth of updates.
	o.doneUntil.Init(nil)
	go o.sendDeltasToSubscribers()
}

// close releases the memory associated with btree used for keycommit.
func (o *Oracle) close() {
	if err := o.keyCommit.Close(); err != nil {
		glog.Warningf("error while closing tree: %v", err)
	}
}

func (o *Oracle) updateStartTxnTs(ts uint64) {
	o.Lock()
	defer o.Unlock()
	o.startTxnTs = ts
	o.keyCommit.Reset()
}

// TODO: This should be done during proposal application for Txn status.
func (o *Oracle) hasConflict(src *api.TxnContext) bool {
	// This transaction was started before I became leader.
	if src.StartTs < o.startTxnTs {
		return true
	}
	for _, k := range src.Keys {
		ki, err := strconv.ParseUint(k, 36, 64)
		if err != nil {
			glog.Errorf("Got error while parsing conflict key %q: %v\n", k, err)
			continue
		}
		if last := o.keyCommit.Get(ki); last > src.StartTs {
			return true
		}
	}
	return false
}

func (o *Oracle) purgeBelow(minTs uint64) {
	var timer x.Timer
	timer.Start()

	o.Lock()
	defer o.Unlock()

	// Set startTxnTs so that every txn with start ts less than this, would be aborted.
	o.startTxnTs = minTs

	// Dropping would be cheaper if abort/commits map is sharded
	for ts := range o.commits {
		if ts < minTs {
			delete(o.commits, ts)
		}
	}
	timer.Record("commits")

	// There is no transaction running with startTs less than minTs
	// So we can delete everything from rowCommit whose commitTs < minTs
	stats := o.keyCommit.Stats()
	if stats.Occupancy < 50.0 {
		return
	}
	o.keyCommit.DeleteBelow(minTs)
	timer.Record("deleteBelow")
	glog.V(2).Infof("Purged below ts:%d, len(o.commits):%d, keyCommit: [before: %+v, after: %+v].\n",
		minTs, len(o.commits), stats, o.keyCommit.Stats())
	if timer.Total() > time.Second {
		glog.V(2).Infof("Purge %s\n", timer.String())
	}
}

func (o *Oracle) commit(src *api.TxnContext) error {
	o.Lock()
	defer o.Unlock()

	if o.hasConflict(src) {
		return x.ErrConflict
	}
	// We store src.Keys as string to ensure compatibility with all the various language clients we
	// have. But, really they are just uint64s encoded as strings. We use base 36 during creation of
	// these keys in FillContext in posting/mvcc.go.
	for _, k := range src.Keys {
		ki, err := strconv.ParseUi


 _settings.Converters.Add(new NullableDateOnlyJsonConverter());
            _settings.Converters.Add(new DateOnlyJsonConverter());

            _settings.Converters.Add(new NullableTimeOnlyJsonConverter());
            _settings.Converters.Add(new TimeOnlyJsonConverter());
        }

        public static T DeserializeJson<T>(this string json)
            where T : notnull
        {
            return JsonConvert.DeserializeObject<T>(json, _settings)!;
        }

        public static string SerializeJson<T>(this T obj)
            where T : notnull
        {
            return JsonConvert.SerializeObject(obj, _settings)!;
        }
    }
}


90 */  swc1    $f16, 0x0090($sp)
/* 01384 80967CD4 C632002C */  lwc1    $f18, 0x002C($s1)          ## 0000002C
/* 01388 80967CD8 4600B306 */  mov.s   $f12, $f22
/* 0138C 80967CDC 46120100 */  add.s   $f4, $f0, $f18
/* 01390 80967CE0 0C00CFC8 */  jal     Math_Rand_CenteredFloat

/* 01394 80967CE4 E7A40094 */  swc1    $f4, 0x0094($sp)
/* 01398 80967CE8 461A0180 */  add.s   $f6, $f0, $f26
/* 0139C 80967CEC 3C018097 */  lui     $at, %hi(D_80969378)       ## $at = 80970000
/* 013A0 80967CF0 4600E306 */  mov.s   $f12, $f28
/* 013A4 80967CF4 0C00CFC8 */  jal     Math_Rand_CenteredFloat

/* 013A8 80967CF8 E4269378 */  swc1    $f6, %lo(D_80969378)($at)
/* 013AC 80967CFC 3C018097 */  lui     $at, %hi(D_8096937C)       ## $at = 80970000
/* 013B0 80967D00 E420937C */  swc1    $f0, %lo(D_8096937C)($at)
/* 013B4 80967D04 0C00CFC8 */  jal     Math_Rand_CenteredFloat

/* 013B8 80967D08 4600B306 */  mov.s   $f12, $f22
/* 013BC 80967D0C 461E0200 */  add.s   $f8, $f0, $f30
/* 013C0 80967D10 44805000 */  mtc1    $zero, $f10                ## $f10 = 0.00
/* 013C4 80967D14 3C018097 */  lui     $at, %hi(D_80969380)       ## $at = 80970000
/* 013C8 80967D18 E4289380 */  swc1    $f8, %lo(D_80969380)($at)
/* 013CC 80967D1C 3C018097 */  lui     $at, %hi(D_80969388)       ## $at = 80970000
/* 013D0 80967D20 E42A9388 */  swc1    $f10, %lo(D_80969388)($at)
/* 013D4 80967D24 3C014270 */  lui     $at, 0x4270                ## $at = 42700000
/* 013D8 80967D28 44816000 */  mtc1    $at, $f12                  ## $f12 = 60.00
/* 013DC 80967D2C 0C00CFBE */  jal     Math_Rand_ZeroFloat

/* 013E0 80967D30 00000000 */  nop
/* 013E4 80967D34 4600040D */  trunc.w.s $f16, $f0
/* 013E8 80967D38 240E03E8 */  addiu   $t6, $zero, 0x03E8         ## $t6 = 000003E8
/* 013EC 80967D3C AFAE0018 */  sw      $t6, 0x0018($sp)
/* 013F0 80967D40 03C02025 */  or      $a0, $s8, $zero            ## $a0 = 0000


uteString(engine, "clss c; cast<intf1>(c); cast<intf2>(c);", mod);
	if( r < 0 )
		TEST_FAILED;

	r = ExecuteString(engine, "intf1 @a = clss(); cast<clss>(a).Test2(); cast<intf2>(a).Test2();", mod);
	if( r < 0 )
		TEST_FAILED;

	// Test use of handle after invalid cast (should throw a script exception)
	r = ExecuteString(engine, "intf1 @a = clss(); cast<intf3>(a).Test3();", mod);
	if( r != asEXECUTION_EXCEPTION )
		TEST_FAILED;

	// Don't permit cast operator to remove constness
	bout.buffer = "";
	engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL);
	r = ExecuteString(engine, "const intf1 @a = clss(); cast<intf2>(a).Test2();", mod);
	if( r >= 0 )
		TEST_FAILED;

	if( bout.buffer != "ExecuteString (1, 41) : Error   : No matching signatures to 'intf2::Test2() const'\n" )
	{
		TEST_FAILED;
		PRINTF("%s", bout.buffer.c_str());
	}

	// It should be allowed to cast null to an interface
	bout.buffer = "";
	r = ExecuteString(engine, "intf1 @a = cast<intf1>(null);", mod);
	if( r != asEXECUTION_FINISHED )
		TEST_FAILED;
	if( bout.buffer != "" )
	{
		TEST_FAILED;
		PRINTF("%s", bout.buffer.c_str());
	}

	//--------------
	// Using constructor as implicit cast operator
	// TODO: Script classes should perhaps allow implicit casts to be implemented as well
/*	engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL);
	engine->AddScriptSection(0, "Test2", script2, strlen(script2));
	r = mod->Build(0);
	if( r < 0 )
		TEST_FAILED;
	r = ExecuteString(engine, "Test()");
	if( r != asEXECUTION_FINISHED )
		TEST_FAILED;
*/
	engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL);
	mod = engine->GetModule(0, asGM_ALWAYS_CREATE);
	mod->AddScriptSection("Test3", script3, strlen(script3));
	r = mod->Build();
	if( r >= 0 )
		TEST_FAILED;

	//-------------
	// "test" + string(type) + "\n"
	// "test" + type + "\n"
	engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL);
	r = engine->RegisterObjectType("type", 4, asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); assert( r >= 0 );
	RegisterScriptString(engine);
	r = engine->RegisterObjectBehaviour("string", asBEHAVE_FACTORY, "string@ f(const type &in)", asFUNCTION(TypeToString), asCALL_GENERIC); assert( r >= 0 );
	r = ExecuteString(engine, "type t; string a = \"a\" + string(t) + \"b\";");
	if( r < 0 )
		TEST_FAILED;

	// Since the constructor is not 'explicit' it can be used implicitly too
	engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL);
	bout.buffer = "";
	r = ExecuteString(engine, "type t; string a = \"a\" + t + \"b\";");
	if( r < 0 )
		TEST_FAILED;
	if (bout.buffer != "")
	{
		PRINTF("%s", bout.buffer.c_str());
		TEST_FAILED;
	}

	// Try using the asMETHOD macro with a cast operator
	// The f


 = get_integer(p->val);

            if (seconds_found == FLB_TRUE) {
                try_assign_time(seconds, nanos, tms);
                return FLB_TRUE;
            }
        }
    }

    return FLB_FALSE;
}

timestamp_status extract_timestamp(msgpack_object *obj,
                                   struct flb_time *tms)
{
    if (extract_format_timestamp_object(obj, tms)) {
        return FORMAT_TIMESTAMP_OBJECT;
    }
    if (extract_format_timestamp_duo_fields(obj, tms)) {
        return FORMAT_TIMESTAMP_DUO_FIELDS;
    }
    return TIMESTAMP_NOT_PRESENT;
}


card.animal-card[data-id="A532_Zooplankton"] .ark-card-top {
  background-image: url(/img/animals/A532_Zooplankton.jpg);
}
.zoo-card.animal-card[data-id="A533_BlacksideHawkfish"] .ark-card-top {
  background-image: url(/img/animals/A533_BlacksideHawkfish.jpg);
}
.zoo-card.animal-card[data-id="A534_SouthernBlue-RingedOctopl"] .ark-card-top {
  background-image: url(/img/animals/A534_SouthernBlue-RingedOctopl.jpg);
}
.zoo-card.animal-card[data-id="A535_SharknoseGoby"] .ark-card-top {
  background-image: url(/img/animals/A535_SharknoseGoby.jpg);
}
.zoo-card.animal-card[data-id="A536_LonghornCowfish"] .ark-card-top {
  background-image: url(/img/animals/A536_LonghornCowfish.jpg);
}
.zoo-card.animal-card[data-id="A537_BlackbarTriggerfish"] .ark-card-top {
  background-image: url(/img/animals/A537_BlackbarTriggerfish.jpg);
}
.zoo-card.animal-card[data-id="A538_DevilFirefish"] .ark-card-top {
  background-image: url(/img/animals/A538_DevilFirefish.jpg);
}
.zoo-card.animal-card[data-id="A539_MericanWhitespottedFilefis"] .ark-card-top {
  background-image: url(/img/animals/A539_MericanWhitespottedFilefis.jpg);
}
.zoo-card.animal-card[data-id="A540_GuineafowlPuffer"] .ark-card-top {
  background-image: url(/img/animals/A540_GuineafowlPuffer.jpg);
}
.zoo-card.animal-card[data-id="A541_BluespottedRibbontailRay"] .ark-card-top {
  background-image: url(/img/animals/A541_BluespottedRibbontailRay.jpg);
}
.zoo-card.animal-card[data-id="A542_Humpheadwrasse"] .ark-card-top {
  background-image: url(/img/animals/A542_Humpheadwrasse.jpg);
}
.zoo-card.animal-card[data-id="A543_CoastalMantaRay"] .ark-card-top {
  background-image: url(/img/animals/A543_CoastalMantaRay.jpg);
}
.zoo-card.animal-card[data-id="A544_CaribbeanReefShark"] .ark-card-top {
  background-image: url(/img/animals/A544_CaribbeanReefShark.jpg);
}
.zoo-card.animal-card[data-id="A545_LongcombSawfish"] .ark-card-top {
  background-image: url(/img/animals/A545_LongcombSawfish.jpg);
}
.zoo-card.animal-card[data-id="A546_SandTigerShark"] .ark-card-top {
  background-image: url(/img/animals/A546_SandTigerShark.jpg);
}
.zoo-card.animal-card[data-id="A547_MediterraneanRainbow"] .ark-card-top {
  background-image: url(/img/animals/A547_MediterraneanRainbow.jpg);
}
.zoo-card.animal-card[data-id="A548_LinedSeahorse"] .ark-card-top {
  background-image: url(/img/animals/A548_LinedSeahorse.jpg);
}
.zoo-card.animal-card[data-id="A549_MmonOct


" viewBox="0 0 30 30"><path fill="currentColor" d="M3.74 14.44c0 2.04.5 3.93 1.51 5.65s2.37 3.1 4.09 4.1 3.61 1.51 5.65 1.51V3.19c-2.04 0-3.92.5-5.65 1.51S6.26 7.07 5.25 8.8s-1.51 3.6-1.51 5.64z"/></svg>';
  static const String moon_waning_crescent_1 =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 30"><path fill="currentColor" d="M3.74 14.44c0 2.04.5 3.93 1.51 5.65s2.37 3.1 4.09 4.1 3.61 1.51 5.65 1.51c-1-3.14-1.49-6.9-1.49-11.26 0-3.43.5-7.18 1.49-11.25-2.04 0-3.92.5-5.65 1.51S6.26 7.07 5.25 8.8s-1.51 3.6-1.51 5.64z"/></svg>';
  static const String moon_waning_crescent_2 =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 30"><path fill="currentColor" d="M3.74 14.44c0 2.04.5 3.93 1.51 5.65s2.37 3.1 4.1 4.1S12.96 25.7 15 25.7c-2.01-2.74-3.02-6.5-3.02-11.26 0-3.98 1.01-7.73 3.02-11.25-2.04 0-3.93.5-5.65 1.51s-3.1 2.37-4.1 4.09-1.51 3.61-1.51 5.65z"/></svg>';
  static const String moon_waning_crescent_3 =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 30"><path fill="currentColor" d="M3.74 14.44c0 2.04.5 3.93 1.51 5.65s2.37 3.1 4.09 4.1 3.61 1.51 5.65 1.51c-2.99-2.33-4.48-6.09-4.48-11.26 0-2.32.42-4.46 1.25-6.4s1.91-3.56 3.23-4.85c-2.04 0-3.92.5-5.65 1.51S6.26 7.07 5.25 8.8s-1.51 3.6-1.51 5.64z"/></svg>';
  static const String moon_waning_crescent_4 =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 30"><path fill="currentColor" d="M3.74 14.44c0 2.04.5 3.9


      Ok(())
    }
}
#[derive(Debug, Default)]
pub struct DepositionLockArgsBuilder {
    pub(crate) owner_lock_hash: Byte32,
    pub(crate) layer2_lock: Script,
    pub(crate) cancel_timeout: Uint64,
}
impl DepositionLockArgsBuilder {
    pub const FIELD_COUNT: usize = 3;
    pub fn owner_lock_hash(mut self, v: Byte32) -> Self {
        self.owner_lock_hash = v;
        self
    }
    pub fn layer2_lock(mut self, v: Script) -> Self {
        self.layer2_lock = v;
        self
    }
    pub fn cancel_timeout(mut self, v: Uint64) -> Self {
        self.cancel_timeout = v;
        self
    }
}
impl molecule::prelude::Builder for DepositionLockArgsBuilder {
    type Entity = DepositionLockArgs;
    const NAME: &'static str = "DepositionLockArgsBuilder";
    fn expected_length(&self) -> usize {
        molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1)
            + self.owner_lock_hash.as_slice().len()
            + self.layer2_lock.as_slice().len()
            + self.cancel_timeout.as_slice().len()
    }
    fn write<W: ::molecule::io::Write>(&self, writer: &mut W) -> ::molecule::io::Result<()> {
        let mut total_size = molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1);
        let mut offsets = Vec::with_capacity(Self::FIELD_COUNT);
        offsets.push(total_size);
        total_size += self.owner_lock_hash.as_slice().len();
        offsets.push(total_size);
        total_size += self.layer2_lock.as_slice().len();
        offsets.push(total_size);
        total_size += self.cancel_timeout.as_slice().len();
        writer.write_all(&molecule::pack_number(total_size as molecule::Number))?;
        for offset in offsets.into_iter() {
            writer.write_all(&molecule::pack_number(offset as molecule::Number))?;
        }
        writer.write_all(self.owner_lock_hash.as_slice())?;
        writer.write_all(self.layer2_lock.as_slice())?;
        writer.write_all(self.cancel_timeout.as_slice())?;
        Ok(())
    }
    fn build(&self) -> Self::Entity {
        let mut inner = Vec::with_capacity(self.expected_length());
        self.write(&mut inner)
            .unwrap_or_else(|_| panic!("{} build should be ok", Self::NAME));
        DepositionLockArgs::new_unchecked(inner.into())
    }
}
#[derive(Clone)]
pub struct CustodianLockArgs(molecule::bytes::Bytes);
impl ::core::fmt::LowerHex for CustodianLockArgs {
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        use molecule::hex_string;
        if f.alternate() {
            write!(f, "0x")?;
        }
        write!(f, "{}", hex_string(self.as_slice()))
    }
}
impl ::core::fmt::Debug for CustodianLockArgs {
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        write!(f, "{}({:#x})", Self::NAME, self)
    }
}
impl ::core::fmt::Display for CustodianLockArgs {
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        write!(f, "{} {{ ", Self::NAME)?;
        write!(
            f,
            "{}: {}",
            "deposition_lock_args",
            self.deposition_lock_args()
        )?;
        write!(
            f,
            ", {}: {}",
            "deposition_block_


on.setGraphic(new FontIcon("unil-setting:16:BLUE"));
        advanceSetButton.setLayoutX(600);
        advanceSetButton.setLayoutY(10);

        final JFXComboBox<TargetNameEnum> targetNameJFXComboBox =
                new JFXComboBox<>(FXCollections.observableArrayList(TargetNameEnum.values()));
        targetNameJFXComboBox.setPrefWidth(160);
        targetNameJFXComboBox.setLayoutX(115);
        targetNameJFXComboBox.setLayoutY(10);
        targetNameJFXComboBox.setValue(TargetNameEnum.MyBatis3Flex);
        targetNameJFXComboBox.valueProperty().bindBidirectional(mybatisOfficialExportConfig.targetNameProperty());
        targetNameJFXComboBox.setVisible(false);

        Label logicDeleteLabel = new Label("逻辑删除");
        logicDeleteLabel.setLayoutX(27);
        logicDeleteLabel.setLayoutY(15);
        TextField logicDeleteField = new TextField();
        logicDeleteField.setText(mybatisOfficialExportConfig.getLogicDeleteField());
        logicDeleteField.setPromptText("逻辑删除字段");
        logicDeleteField.textProperty().bindBidirectional(mybatisOfficialExportConfig.logicDeleteFieldProperty());
        logicDeleteField.setLayoutX(90);
        logicDeleteField.setLayoutY(10);

        Label versionLabel = new Label("乐观锁");
        versionLabel.setLayoutX(262);
        versionLabel.setLayoutY(15);
        TextField version = new TextField();
        version.setText(mybatisOfficialExportConfig.getVersion());
        version.setPromptText("乐观锁字段");
        version.textProperty().bindBidirectional(mybatisOfficialExportConfig.versionProperty());
        version.setLayoutX(320);
        version.setLayoutY(10);

        mybatisOfficialExportConfig.setTargetName(TargetNameEnum.MyBatis3Flex);

        anchorPane.getChildren().addAll(userJava8CheckBox, useCommentCheckBox, logicDeleteLabel,
                versionLabel, logicDeleteField, version,
                useLombokGetSetCheckBox, useLombokBuilderCheckBox, targetNameJFXComboBox, advanceSetButton);
        return anchorPane;
    }
}
package com.alan344.component.dialog;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
 * @author AlanSun
 * @date 2023/2/8 9:44
 */
public class AlDialog extends BorderPane {
    protected HBox actionHBox = new HBox();

    protected final Stage stage;

    public AlDialog(Stage stage1) {
        this.getStylesheets().add("css/common.css");
        this.setBottom(actionHBox);

        actionHBox.setSpacing(10);
        actionHBox.setPadding(new Insets(5));
        actionHBox.setAlignment(Pos.CENTER_RIGHT);

        stage = new Stage();
        stage.setScene(new Scene(this));
        stage.setResizable(false);
        stage.initModality(Modality.WINDOW_MODAL);
        stage.getIcons().add(new Image("image/icon.png"));
        stage.initOwner(stage1);

        this.addEventHandler(KeyEvent.KEY_PRESSED, event -> {
            if (event.getCode() == KeyCode.ESCAPE) {
                stage.close();
            }
        });
    }

    public void setActions(Button... buttons) {
        for (int i = buttons.length - 1; i >= 0; i--) {
            actionHBox.getChildren().add(0, buttons[i]);
        }
    }
}
package com.github.alantr7.codebots.api;


uzz.html">Fuzzing with afl-fuzz

Runtime tracing with the instrumented runtime

Chapter 13Lexer and parser generators (ocamllex, ocamlyacc)

Version 4.12

< The OCaml Manual

Lexer and parser generators (ocamllex, ocamlyacc)

1Overview of ocamllex

2Syntax of lexer definitions

3Overview of ocamlyacc

4Syntax of grammar definitions

5Options

6A complete example

7Common errors

This chapter describes two program generators: ocamllex, that
produces a lexical analyzer from a set of regular expressions with
associated semantic actions, and ocamlyacc, that produces a parser
from a grammar with associated semantic actions.

These program generators are very close to the well-known lex and
yacc commands that can be found in most C programming environments.
This chapter assumes a working knowledge of lex and yacc: while
it describes the input syntax for ocamllex and ocamlyacc and the
main differences with lex and yacc, it does not explain the basics
of writing a lexer or parser description in lex and yacc. Readers
unfamiliar with lex and yacc are referred to “Compilers:
principles, techniques, and tools” by Aho, Sethi and Ullman
(Addison-Wesley, 1986), or “Lex & Yacc”, by Levine, Mason and
Brown (O’Reilly, 1992).

1Overview of ocamllex

<p


4"] });
        data.add("S009", { requires: 4, components: ["an..6", "an..3", "an..3", "an..3", "an..6", "an..6", "an..6"] });
        data.add("0068", { requires: 0, components: ["an..35"] });
        data.add("S010", { requires: 1, components: ["n..2", "a1"] });
        data.add("S016", { requires: 1, components: ["an..14", "an..3", "an..3", "an..3"] });
        data.add("S017", { requires: 1, components: ["an..14", "an..3", "an..3", "an..3"] });
        data.add("S018", { requires: 1, components: ["an..14", "an..3", "an..3", "an..3"] });

        // UNS
        data.add("0081", { requires: 1, components: ["a1"] });

        // UNT
        data.add("0074", { requires: 1, components: ["n..10"] });
        data.add("0062", { requires: 1, components: ["an..14"] });

        // UNZ
        data.add("0036", { requires: 1, components: ["n..6"] });
        data.add("0020", { requires: 1, components: ["an..14"] });

        return data;
    }

    build(): Dictionary<ElementEntry> {

        let dict: Dictionary<ElementEntry>;
        const fileLoc: string | undefined = this.getDefinitionFileLoc();
        if (fileLoc) {
            const sData: string = fs.readFileSync(fileLoc, { encoding: "utf-8" });
            const data: { [key: string]: ElementEntry} = JSON.parse(sData) as ({ [key: string]: ElementEntry });

            dict = new Dictionary<ElementEntry>(data);
        } else {
            dict = new Dictionary<ElementEntry>();
        }

        return ElementTableBuilder.enrichWithDefaultElements(dict);
    }
}
import { Repository, getRepository } from "typeorm";
import IUsuarioRepositorio from "@modules/usuarios/repositories/IUsuarioRepositorio";
import ICriarUsuarioDTO from "@modules/usuarios/dtos/ICriarUsuarioDTO";
import Usuario from "../entities/Usuario";

class UsuarioRepositorio implements IUsuarioRepositorio {
  private ormRepository: Repository<Usuario>;

  constructor() {
    this.ormRepository = getRepository(Usuario);
  }

  public async buscarPorIdUsuario(idUsuario: number): Promise<Usuario | undefined> {
    const dadosUsuario = await this.ormRepository.findOne(
      {
        where: {
          id: idUsuario,
        }
      });

    return dadosUsuario;
  }

  public async buscarUsuarioCodigoIntegracao(codigo_integracao: string, email: string): Promise<Usuario | undefined> {
    const usuarioUsuario = await this.ormRepository.findOne(
      {
        where: {
          codigo_integracao,
          email,
        }
      });

    return usuarioUsuario;
  }

  public async buscarEmailUsuario(email: string):
    Promise<Usuario | undefined> {
    const usuarioUsuario = await this.ormRepository.findOne(
      {
        where: {
          email,
        }
      });

    return usuarioUsuario;
  }

  public async buscarCpfCnpjUsuario(cpf_cnpj: string): Promise<Usuario | undefined> {
    const usuarioUsuario = await this.ormRepository.findOne(
      {
        where: {
          cpf_cnpj
        }
      });

    return usuarioUsuario;
  }

  public async criar(usuarioUsuario: ICriarUsuarioDTO):
    Promise<Usuario> {
    const UsuarioUsuario = this.ormRepository.create(usuarioUsuario);

    await this.ormRepository.save(Usuario


TimeErrorCode.mixinSuperClassConstraintNonInterface,
          39,
          1,
        ),
      ],
    );

    var node = findNode.singleMixinOnClause;
    assertResolvedNodeText(node, r'''
MixinOnClause
  onKeyword: on
  superclassConstraints
    NamedType
      name: A
      element: <testLibrary>::@extensionType::A
      type: A
''');
  }

  test_Never() async {
    await assertErrorsInCode(
      '''
mixin M on Never {}
''',
      [
        error(
          CompileTimeErrorCode.mixinSuperClassConstraintNonInterface,
          11,
          5,
        ),
      ],
    );

    var node = findNode.singleMixinOnClause;
    assertResolvedNodeText(node, r'''
MixinOnClause
  onKeyword: on
  superclassConstraints
    NamedType
      name: Never
      element: Never
      type: Never
''');
  }

  test_void() async {
    await assertErrorsInCode(
      r'''
mixin M on void {}
''',
      [
        error(ParserErrorCode.expectedTypeName, 11, 4),
        error(
          CompileTimeErrorCode.mixinSuperClassConstraintNonInterface,
          11,
          4,
        ),
      ],
    );

    var node = findNode.singleMixinOnClause;
    assertResolvedNodeText(node, r'''
MixinOnClause
  onKeyword: on
  superclassConstraints
    NamedType
      name: void
      element: <null>
      type: void
''');
  }
}
// Copyright (c) 2019, 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/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

import '../dart/resolution/context_collection_resolution.dart';

main() {
  defineReflectiveSuite(() {
    defineReflectiveTests(NonConstantMapElementTest);
    defineReflectiveTests(NonConstantMapKeyTest);
    defineReflectiveTests(NonConstantMapValueTest);
  });
}

@reflectiveTest
class NonConstantMapElementTest extends PubPackageResolutionTest
    with NonConstantMapElementTestCases {}

mixin NonConstantMapElementTestCases on PubPackageResolutionTest {
  test_forElement_notConst_noError() async {
    await assertNoErrorsInCode('''
void main() {
  var x;
  print({x: x, for (final x2 in [x]) x2: x2});
}
''');
  }

  test_ifElement_mayBeConst() async {
    await assertNoErrorsInCode('''
void main() {
  const {1: null, if (true) null: null};
}
''');
  }

  test_ifElement_nested_mayBeConst() async {
    await assertNoErrorsInCode('''
void main() {
  const {1: null, if (true) if (true) null: null};
}
''');
  }

  test_ifElement_notConstCondition() async {
    await assertErrorsInCode(
      '''
void main() {
  bool notConst = true;
  const {1: null, if (notConst) null: null};
}
''',
      [error(CompileTimeErrorCode.nonConstantMapElement, 60, 8)],
    );
  }

  test_ifElementWithElse_mayBeConst() async {
    await assertErrorsInCode(
      '''
void main() {
  const isTrue = true;
  const {1: null, if (isTrue) null: null else null: null};
}
''',
      [error(WarningCode.deadCode, 83, 10)],
    );
  }

  test_spreadElement_mayBeConst() async {
    await assertNoErrorsInCode('''
void main() {
  const {1: null,


{
    var hash = 0
    val MODULUS = 1000000007
    for (c in key.toCharArray()) {
        hash = hash xor c.code
    }
    return hash and MODULUS
}

/* 旋轉雜湊 */
fun rotHash(key: String): Int {
    var hash = 0L
    val MODULUS = 1000000007
    for (c in key.toCharArray()) {
        hash = ((hash shl 4) xor (hash shr 28) xor c.code.toLong()) % MODULUS
    }
    return hash.toInt()
}

/* Driver Code */
fun main() {
    val key = "Hello 演算法"

    var hash = addHash(key)
    println("加法雜湊值為 $hash")

    hash = mulHash(key)
    println("乘法雜湊值為 $hash")

    hash = xorHash(key)
    println("互斥或雜湊值為 $hash")

    hash = rotHash(key)
    println("旋轉雜湊值為 $hash")
}/**
 * File: linear_search.kt
 * Created Time: 2024-01-25
 * Author: curtishd (1023632660@qq.com)
 */

package chapter_searching

import utils.ListNode

/* 線性查詢（陣列） */
fun linearSearchArray(nums: IntArray, target: Int): Int {
    // 走訪陣列
    for (i in nums.indices) {
        // 找到目標元素，返回其索引
        if (nums[i] == target)
            return i
    }
    // 未找到目標元素，返回 -1
    return -1
}

/* 線性查詢（鏈結串列） */
fun linearSearchLinkedList(h: ListNode?, target: Int): ListNode? {
    // 走訪鏈結串列
    var head = h
    while (head != null) {
        // 找到目標節點，返回之
        if (head._val == target)
            return head
        head = head.next
    }
    // 未找到目標節點，返回 null
    return null
}

/* Driver Code */
fun main() {
    val target = 3

    /* 在陣列中執行線性查詢 */
    val nums = intArrayOf(1, 5, 3, 2, 4, 7, 5, 9, 10, 8)
    val index = linearSearchArray(nums, target)
    println("目標元素 3 的索引 = $index")

    /* 在鏈結串列中執行線性查詢 */
    val head = ListNode.arrToLinkedList(nums)
    val node = linearSearchLinkedList(head, target)
    println("目標節點值 3 的對應節點物件為 $node")
}/**
 * File: preorder_traversal_ii_compact.kt
 * Created Time: 2024-01-25
 * Author: curtishd (1023632660@qq.com)
 */

package chapter_backtracking.preorder_traversal_ii_compact

import utils.TreeNode
import utils.printTree

var path: MutableList<TreeNode>? = null
var res: MutableList<MutableList<TreeNode>>? = null

/* 前序走訪：例題二 */
fun preOrder(root: TreeNode?) {
    if (root == null) {
        return
    }
    // 嘗試
    path!!.add(


D_RAWAF	0x02240000
#define	DLT_NETBSD_RAWAF(af)	(DLT_CLASS_NETBSD_RAWAF | (af))
#define	DLT_NETBSD_RAWAF_AF(x)	((x) & 0x0000ffff)
#define	DLT_IS_NETBSD_RAWAF(x)	(DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)

/*
 * The instruction encodings.
 */
/* instruction classes */
#define BPF_CLASS(code) ((code) & 0x07)
#define		BPF_LD		0x00
#define		BPF_LDX		0x01
#define		BPF_ST		0x02
#define		BPF_STX		0x03
#define		BPF_ALU		0x04
#define		BPF_JMP		0x05
#define		BPF_RET		0x06
#define		BPF_MISC	0x07

/* ld/ldx fields */
#define BPF_SIZE(code)	((code) & 0x18)
#define		BPF_W		0x00
#define		BPF_H		0x08
#define		BPF_B		0x10
#define BPF_MODE(code)	((code) & 0xe0)
#define		BPF_IMM 	0x00
#define		BPF_ABS		0x20
#define		BPF_IND		0x40
#define		BPF_MEM		0x60
#define		BPF_LEN		0x80
#define		BPF_MSH		0xa0

/* alu/jmp fields */
#define BPF_OP(code)	((code) & 0xf0)
#define		BPF_ADD		0x00
#define		BPF_SUB		0x10
#define		BPF_MUL		0x20
#define		BPF_DIV		0x30
#define		BPF_OR		0x40
#define		BPF_AND		0x50
#define		BPF_LSH		0x60
#define		BPF_RSH		0x70
#define		BPF_NEG		0x80
#define		BPF_JA		0x00
#define		BPF_JEQ		0x10
#define		BPF_JGT		0x20
#define		BPF_JGE		0x30
#define		BPF_JSET	0x40
#define BPF_SRC(code)	((code) & 0x08)
#define		BPF_K		0x00
#define		BPF_X		0x08

/* ret - BPF_K and BPF_X also apply */
#define BPF_RVAL(code)	((code) & 0x18)
#define		BPF_A		0x10

/* misc */
#define BPF_MISCOP(code) ((code) & 0xf8)
#define		BPF_TAX		0x00
#define		BPF_TXA		0x80

/*
 * The instruction data structure.
 */
struct bpf_insn {
	u_short	code;
	u_char 	jt;
	u_char 	jf;
	bpf_u_int32 k;
};

/*
 * Macros for insn array initializers.
 */
#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }

#if __STDC__ || defined(__cplusplus)
extern int bpf_validate(const struct bpf_insn *, int);
extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
#else
extern int bpf_validate();
extern u_int bpf_filter();
#endif

/*
 * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
 */
#define BPF_MEMWORDS 16

#ifdef __cplusplus
}
#endif

#endif


, 22
# CHECK-ENCODING: encoding: [0x00,0x1e,0x16,0xff,0x00,0x16,0x00,0xe4]
vsld %vix, (%v22, %v30), 22

# CHECK-INST: vsld %v11, (%v22, %vix), 127, %vm11
# CHECK-ENCODING: encoding: [0x00,0xff,0x16,0x0b,0x00,0x7f,0x0b,0xe4]
vsld %v11, (%v22, %vix), 127, %vm11

# CHECK-INST: vsld %v11, (%vix, %v22), 21, %vm11
# CHECK-ENCODING: encoding: [0x00,0x16,0xff,0x0b,0x00,0x15,0x0b,0xe4]
vsld %v11, (%vix, %v22), 21, %vm11

# CHECK-INST: vsld %v12, (%v20, %v22), 2, %vm12
# CHECK-ENCODING: encoding: [0x00,0x16,0x14,0x0c,0x00,0x02,0x0c,0xe4]
vsld %v12, (%v20, %v22), 2, %vm12


& (title=\"OA\" || title=\"办公\")) || body=\"class=\\\"STYLE1\\\">新OA办公系统\"",
    "Author": "su18@javaweb.org",
    "Homepage": "https://www.tongda2000.com/",
    "DisclosureDate": "2021-05-20",
    "References": [
        "https://fofa.so/"
    ],
    "HasExp": true,
    "Is0day": true,
    "Level": "3",
    "CVSS": "9.0",
    "CVEIDs": [],
    "CNVD": [],
    "CNNVD": [],
    "ScanSteps": [
        "AND",
        {
            "Request": {
                "method": "GET",
                "uri": "/",
                "follow_redirect": false,
                "header": {},
                "data_type": "text",
                "data": ""
            },
            "ResponseTest": {
                "type": "group",
                "operation": "AND",
                "checks": [
                    {
                        "type": "item",
                        "variable": "$code",
                        "operation": "==",
                        "value": "200",
                        "bz": ""
                    }
                ]
            },
            "SetVariable": []
        }
    ],
    "ExploitSteps": [
        "AND",
        {
            "Request": {
                "method": "GET",
                "uri": "/",
                "follow_redirect": false,
                "header": {},
                "data_type": "text",
                "data": ""
            },
            "ResponseTest": {
                "type": "group",
                "operation": "AND",
                "checks": [
                    {
                        "type": "item",
                        "variable": "$code",
                        "operation": "==",
                        "value": "200",
                        "bz": ""
                    }
                ]
            },
            "SetVariable": []
        }
    ],
    "ExpParams": [],
    "ExpTips": {
        "type": "",
        "content": ""
    },
    "AttackSurfaces": {
        "Application": [],
        "Support": [],
        "Service": [],
        "System": [],
        "Hardware": []
    },
    "PocId": "10481"
}`

	checkIsTongdaOA1231234 := func(host *httpclient.FixUrl) bool {
		requestConfig := httpclient.NewGetRequestConfig("/inc/expired.php")
		requestConfig.VerifyTls = false
		requestConfig.FollowRedirect = false
		if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil {
			return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "tongda")
		}
		return false
	}
	getTongdaCodeUID435345 := func(host *httpclient.FixUrl) string {
		requestConfig := httpclient.NewGetRequestConfig("/ispirit/login_code.php")
		requestConfig.VerifyTls = false
		requestConfig.FollowRedirect = false
		if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil {
			if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "\"codeuid\"") {
				return regexp.MustCompile(`\{"codeuid":"\{(.*?)}"`).FindStringSubmatch(resp.RawBody)[1]
			}
		}
		return ""
	}


 &mut VarSet) -> usize {
    let epoch = Epoch::new(self._id());
    let mut offset = 0;
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      offset = op._store_val(txn, vars, offset, &mut NullIo);
    });
    offset
  }

  fn val_size(&self, txn: TxnId, vars: &mut VarSet) -> usize {
    let epoch = Epoch::new(self._id());
    let mut offset = 0;
    vars.unmask_all();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      offset = op._store_val(txn, vars, offset, &mut NullIo);
    });
    vars.unmask_all();
    offset
  }

  fn max_val_delta(&self, txn: TxnId, vars: &mut VarSet) -> Option<usize> {
    let epoch = Epoch::new(self._id());
    let mut offset = 0;
    let mut max_size = None;
    vars.unmask_all();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      let next_offset = op._store_val(txn, vars, offset, &mut NullIo);
      let delta = next_offset - offset;
      match max_size {
        None => max_size = Some(delta),
        Some(prev_max_size) => if prev_max_size < delta {
          max_size = Some(delta);
        },
      }
      offset = next_offset;
    });
    vars.unmask_all();
    max_size
  }

  fn load_val(&self, txn: TxnId, vars: &mut VarSet, mut offset: usize, reader: &mut Any) -> usize {
    let epoch = Epoch::new(self._id());
    vars.unmask_all();
    //reader.reset();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      offset = op._load_val(txn, vars, offset, reader);
    });
    vars.unmask_all();
    offset
  }

  fn load_grad(&self, txn: TxnId, vars: &mut VarSet, mut offset: usize, reader: &mut Any) -> usize {
    let epoch = Epoch::new(self._id());
    vars.unmask_all();
    //reader.reset();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      offset = op._load_grad(txn, vars, offset, reader);
    });
    vars.unmask_all();
    offset
  }

  /*fn load_r_val(&self, txn: TxnId, vars: &mut VarSet, mut offset: usize, reader: &mut SerialIoBuf) -> usize {
    let epoch = Epoch::new(self._id());
    vars.unmask_all();
    reader.reset();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &mut |op| {
      offset = op._load_r_val(txn, vars, offset, reader.as_any());
    });
    vars.unmask_all();
    offset
  }*/

  fn store_val(&self, txn: TxnId, vars: &mut VarSet, mut offset: usize, writer: &mut Any) -> usize {
    let epoch = Epoch::new(self._id());
    vars.unmask_all();
    //writer.reset();
    self._push(epoch, &mut |_op| {});
    self._pop(epoch, &


            .copy(applicationContext)

    private fun getWrappedContext(context: Context, dp: DeviceProfile): Context {
        return object : ActivityContextWrapper(context) {
            override fun getDeviceProfile(): DeviceProfile {
                return dp
            }
        }
    }
}
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.launcher3.graphics

import android.graphics.Matrix
import android.graphics.Matrix.ScaleToFit.FILL
import android.graphics.Path
import android.graphics.Path.Direction
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.Region
import android.platform.uiautomatorhelpers.DeviceHelpers.context
import android.view.View
import androidx.core.graphics.PathParser
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.launcher3.graphics.ShapeDelegate.Circle
import com.android.launcher3.graphics.ShapeDelegate.Companion.AREA_CALC_SIZE
import com.android.launcher3.graphics.ShapeDelegate.Companion.AREA_DIFF_THRESHOLD
import com.android.launcher3.graphics.ShapeDelegate.Companion.areaDiffCalculator
import com.android.launcher3.graphics.ShapeDelegate.Companion.pickBestShape
import com.android.launcher3.graphics.ShapeDelegate.GenericPathShape
import com.android.launcher3.graphics.ShapeDelegate.RoundedSquare
import com.android.launcher3.icons.GraphicsUtils
import com.android.launcher3.views.ClipPathView
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith

@SmallTest
@RunWith(AndroidJUnit4::class)
class ShapeDelegateTest {

    @Test
    fun `areaDiffCalculator increases with outwards shape`() {
        val diffCalculator =
            areaDiffCalculator(
                Path().apply {
                    addCircle(
                        AREA_CALC_SIZE / 2f,
                        AREA_CALC_SIZE / 2f,
                        AREA_CALC_SIZE / 2f,
                        Direction.CW,
                    )
                }
            )
        assertThat(diffCalculator(Circle())).isLessThan(AREA_DIFF_THRESHOLD)
        assertThat(diffCalculator(Circle())).isLessThan(diffCalculator(RoundedSquare(.9f)))
        assertThat(diffCalculator(RoundedSquare(.9f)))
            .isLessThan(diffCalculator(RoundedSquare(.8f)))
        assertThat(diffCalculator(RoundedSquare(.8f)))
            .isLessThan(diffCalculator(RoundedSquare(.7f)))
        assertThat(diffCalculator(RoundedSquare(.7f)))
            .isLessThan(diffCalculator(RoundedSquare(.6f)))
        assertThat(diffCalculator(RoundedSquare(.6f)))
            .isLessThan(diffCalculator(RoundedSquare(.5f)))
    }

    @Test
    fun `areaDiffCalculator increases with inwards shape`() {
        val diffCalculator = areaDiffCalculator(roundedRectPath(0.5f))
        assertThat(diffCalculator(RoundedSquare(.5f))).isLessThan(AREA_DIFF_THRESHOLD)
        assertThat(diffCalculator(RoundedSquare(.5f)))
            .isLessThan(diffCalculator(RoundedSquare(.6f)))
        assertThat(diffCalculator(RoundedSquare(.5f)))
            .isLessThan(diffCalculator(RoundedSquare(.4f)))
    }

    @Test
    fun


r row = _findRowByIndex(parent, rowIndex);
    parent.children.remove(row);
  }

  @override
  void updateCell(String sheet, int columnIndex, int rowIndex, dynamic value) {
    super.updateCell(sheet, columnIndex, rowIndex, value);

    var row = _findRowByIndex(_sheets[sheet]!, rowIndex)!;
    var cell = _findCellByIndex(row, columnIndex)!;
    _replaceCell(row, cell, value);
  }

  void _parseContent() {
    var file = _archive.findFile(contentXML);
    file?.decompress();
    var content = XmlDocument.parse(utf8.decode(file?.content));
    if (_update == true) {
      _archiveFiles = <String, ArchiveFile>{};
      _sheets = <String, XmlElement>{};
      _xmlFiles = {
        contentXML: content,
      };
      _parseStyles(content);
    }
    content.findAllElements('table:table').forEach((node) {
      var name = node.getAttribute('table:name')!;
      if (_update == true) {
        _sheets[name] = node;
      }
      _parseTable(node, name);
    });
  }

  void _parseStyles(XmlDocument document) {
    _styleNames.clear();
    document.findAllElements('style:style').forEach((style) {
      var name = style.getAttribute('style:name')!;
      var family = style.getAttribute('style:family')!;
      _styleNames[family] ??= <String>[];
      _styleNames[family]!.add(name);
    });
  }

  void _parseTable(XmlElement node, String name) {
    var table = tables[name] = SpreadsheetTable(name);
    var rows = _findRows(node);

    // Remove tailing empty rows
    var filledRows = rows.toList().reversed.skipWhile((row) {
      var empty = true;
      for (var cell in _findCells(row)) {
        if (_readCell(cell) != null) {
          empty = false;
          break;
        }
      }
      if (empty) {
        row.parent?.children.remove(row);
      }

      return empty;
    });

    filledRows.toList().reversed.forEach((child) {
      _parseRow(child, table);
    });

    _normalizeTable(table);
  }

  void _parseRow(XmlElement node, SpreadsheetTable table) {
    var row = [];
    var cells = _findCells(node);

    // Remove tailing empty cells
    var filledCells =
        cells.toList().reversed.skipWhile((cell) => _readCell(cell) == null);

    filledCells.toList().reversed.forEach((child) {
      _parseCell(child, table, row);
    });

    var repeat = _getRowRepeated(node);
    for (var index = 0; index < repeat; index++) {
      table._rows.add(List.from(row));
    }

    _countFilledRow(table, row);
  }

  void _parseCell(XmlElement node, SpreadsheetTable table, List row) {
    var value = _readCell(node);
    var repeat = _getCellRepeated(node);
    for (var index = 0; index < repeat; index++) {
      row.add(value);
    }

    _countFilledColumn(table, row, value);
  }

  dynamic _readCell(XmlElement node) {
    dynamic value;
    var type = node.getAttribute('office:value-type');
    switch (type) {
      case 'float':
      case 'percentage':
      case 'currency':
        value = num.parse(node.getAttribute('office:value')!);
        break;
      case 'boolean':
        value =
            node.getAttribute('office:boolean-value')!.toLowerCase() == 'true';
        break;
      case 'date':
        value = DateTime.parse(node.getAttribute('office:date-value')!)
            .toIso8601String();
        break;
      case 'time


(this.backgroundJobUuid);
		String apiResponse = event.toString();
		logger.info("recv BACKGROUND_JOB : {}" , apiResponse);
		Map<String, String> headers = event.getEventHeaders();

		boolean responseOK = apiResponse.contains("OK");
		if(agentChannel.getCallDirection().equalsIgnoreCase(CallDirection.OUTBOUND)) {
			boolean callFailed = customerChannel.getAnsweredTime() == 0L &&
					!customerChannel.testFlag(ChannelFlag.RECV_RING_MEDIA);
			if (!responseOK && callFailed) {
				releaseSignal();
				ProcessDialedResultCase(apiResponse);
			}
		}else{
			if (!responseOK) {
				releaseSignal();
				ProcessDialedResultCase(apiResponse);
			}
		}

		if(agentChannel.getRecvBgApiResultHook() != null) {
			agentChannel.getRecvBgApiResultHook().onRecv(event.toString(), getTraceId());
			agentChannel.setRecvBgApiResultHook(null);
		}

		if(customerChannel.getRecvBgApiResultHook() != null) {
			customerChannel.getRecvBgApiResultHook().onRecv(event.toString(), getTraceId());
			customerChannel.setRecvBgApiResultHook(null);
		}
	}

	public void clearCustomerHoldCallFlag(){
		if(customerChannel.testFlag(ChannelFlag.HOLD_CALL)) {
			customerChannel.clearFlag(ChannelFlag.HOLD_CALL);
		}
	}

	/**
	 *  判断通话是否正常结束了；
	 *  判断条件如下：
	 *  收到了振铃提示语音； 或者
	 *  客户已经应答； 或者
	 *  外呼结束时返回的sipCode不是 480/404/500等；
	 * @return
	 */
	public boolean checkCustomerChannelCallStatus(){
		String hangupSipCode = customerChannel.getHangupSipCode();
		if(hangupSipCode.startsWith("4") || hangupSipCode.startsWith("5")){
			return false;
		}
		if(customerChannel.testFlag(ChannelFlag.RECV_RING_MEDIA)){
			return true;
		}
		if(customerChannel.getAnsweredTime() > 0L){
			return true;
		}
		return false;
	}

	/**
	 * reset customerChannel last call status data
	 */
	public void resetCustomerChannelLastCallStatus(){
		customerChannel.setHangupSipCode("");
		customerChannel.clearFlag(ChannelFlag.RECV_RING_MEDIA);
		customerChannel.setAnsweredTime(0L);
		customerChannel.setHangupTime(0L);
	}

	/**
	 * 结束通话
	 */
	public synchronized void endCall(String... hangupReason) {
		if (agentChannel.getHangupTime() == 0L) {
			logger.info("{} recv hangup extension command", getTraceId());
			String reason = "manually_hangup";
			if(hangupReason.length > 0){
				reason = hangupReason[0];
			}
			EslConnectionUtil.sendExecuteCommand(
					"hangup",
					reason,
					agentChannel.getUuid()
			);
		}
	}

	public synchronized void playMp4File(String mp4FilePath){
		if(PhoneCallType.AUDIO_CALL.equalsIgnoreCase(agentChannel.getCallType())){
			callApiObject.sendReplyToAgent(
					new MessageResponse(RespStatus.REQUEST_PARAM_ERROR,
							"Current call is audio-call. Cant not send video file.")
			);
			return;
		}

		if (customerChannel.getHangupTime() > 0L) {
			callApiObject.sendReplyToAgent(
					new MessageResponse(RespStatus.REQUEST_PARAM_ERROR,
							"customerChannel is hangup a


# audio input and output example
#
# Note: You will need an SD card to run this example.
#
# Records audio from multiple channels and saves each to separate wav files

import os
from media.media import *   #导入media模块，用于初始化vb buffer
from media.pyaudio import * #导入pyaudio模块，用于采集和播放音频
import media.wave as wave   #导入wav模块，用于保存和加载wav音频文件
from machine import FPIOA

def exit_check():
    try:
        os.exitpoint()
    except KeyboardInterrupt as e:
        print("user stop: ", e)
        return True
    return False

def init_audio_pdm_io():
    """
    初始化PDM音频接口的IO配置（基于庐山派开发板）

    函数功能：配置庐山派开发板上与PDM音频采集相关的GPIO引脚功能，
    映射PDM时钟线和数据线到指定物理引脚，设置引脚为输入/输出模式。
    具体引脚分配如下：
    - 引脚26：PDM时钟线(PDM_CLK)，配置为输出模式
    - 引脚27：PDM数据0线(PDM_IN0)，配置为输入模式
    - 引脚35：PDM数据1线(IIS_D_OUT0_PDM_IN1)，配置为输入模式
    - 引脚36：PDM数据2线(IIS_D_IN1_PDM_IN2)，配置为输入模式
    - 引脚34：PDM数据3线(IIS_D_IN0_PDM_IN3)，配置为输入模式
    """
    fpioa = FPIOA()
    fpioa.set_function(26, FPIOA.PDM_CLK,oe=0x1,ie=0x0)   #pdm clk
    fpioa.set_function(27, FPIOA.PDM_IN0,oe=0x0,ie=0x1)  #pdm data0
    fpioa.set_function(35, FPIOA.IIS_D_OUT0_PDM_IN1,oe=0x0,ie=0x1)  #pdm data1
    fpioa.set_function(36, FPIOA.IIS_D_IN1_PDM_IN2,oe=0x0,ie=0x1)  #pdm data2
    fpioa.set_function(34, FPIOA.IIS_D_IN0_PDM_IN3,oe=0x0,ie=0x1)  #pdm data3

def record_audio_pdm(base_filename, duration, num_channels):
    CHUNK = 44100//25  #设置音频chunk值
    FORMAT = paInt16       #设置采样精度,支持16bit(paInt16)/24bit(paInt24)/32bit(paInt32)
    RATE = 44100           #设置采样率
    pdm_chn_cnt = num_channels // 2

    init_audio_pdm_io()  #初始化pdm音频io口

    try:
        p = PyAudio()
        p.initialize(CHUNK)    #初始化PyAudio对象
        MediaManager.init()    #vb buffer初始化

        #创建音频输入流
        stream = p.open(format=FORMAT,
                        channels=num_channels,
                        rate=RATE,
                        input=True,
                        frames_per_buffer=CHUNK,
                        input_device_index=1) #使用PDM设备采集音频

        # 初始化音频帧存储数组，每个元素对应一个通道的帧列表
        channel_frames = [[] for _ in range(pdm_chn_cnt)]

        # 计算总帧数
        total_frames = int(RATE / CHUNK * duration)

        #采集音频数据并存入列表
        print(f"开始录制 {pdm_chn_cnt}组 {num_channels}声道pdm音频，持续 {duration} 秒...")
        for i in range(total_frames):
            for ch in range(pdm_chn_cnt):
                data = stream.read(chn=ch)
                channel_frames[ch].append(data)

            # 每100帧打印一次进度
            if i % 100 == 0:
                progress = (i / total_frames) * 100
                print(f"录制进度: {progress:.1f}%", end='\r')

            if exit_check():
                print("\n用户中断录制")
                break

        # 为每组pdm创建单独的WAV文件
        for ch in range(pdm_chn_cnt):
            # 生成带索引号的文件名，如 base_0.wav, base_1.wav
            filename = f"{base_filename}_ch{ch}.wav"

            # 将列表中的数据保存到wav文件中
            wf = wave.open(filename, 'wb') #创建wav 文件
            wf.set_channels(2)  # 每个文件保存双声道
            wf.set_sampwidth(p.get_sample_size(FORMAT))  #设置wav 采样精度
            wf.set_framerate(RATE)  #设置wav 采样率
            wf.write_frames(b''.join(channel_frames[ch])) #存储对应通道的音频数据
            wf.close() #关闭wav文件
            print(f"已保存声道 {ch*2},{ch*2+1} 到 {filename}")

    except BaseException as e:
            import sys
            sys.print_exception(e)
    finally:
        stream.stop_stream() #停止采集音频数据
        stream.close()#关闭音频输入流
        p.terminate()#释放音频对象
        MediaManager.deinit() #释放vb buffer
        print("录制完成，资源已释放")

if __name__ == "__main__":
    os.exitpoint(os.EXITPOINT_ENABLE)
    print("pdm sample start")
    # 录制4组共8声道音频，保存为/sdcard/examples/test_ch0.wav 至 test_ch3.wav
    record_audio_pdm('/data/test', 15, 8)

    print("pdm sample done")


0 turn off experiment by default
// Date 2014/06/04 12:00 fixed possibility of shutdown crash
// Date 2014/05/19 00:00 delay 0, experiment
// Date 2013/10/06 00:00 allow to load scripts into about:xxx
// Date 2013/09/13 00:00 Bug 856437 Remove Components.lookupMethod, remove REPLACEDOCUMENTOVERLAY
// Date 2012/04/19 23:00 starUIをbindを使うように
// Date 2012/04/19 21:00 starUI元に戻した
// Date 2012/02/04 00:00 due to bug 726444 Implement the Downloads Panel.
// Date 2012/02/04 00:00 due to bug 726440
// Date 2011/11/19 15:30 REPLACECACHE 追加 Bug 648125
// Date 2011/09/30 13:40 fix bug 640158
// Date 2011/09/30 13:00 fix bug 640158
// Date 2011/04/07 00:00 hackVersion
// Date 2010/10/10 00:00 Bug 377498 mozIJSSubscriptLoader::loadSubScript charset 入ったけどメタデータ // @charset  UTF-8 としとけばUTF-8で読み込む
// Date 2010/03/31 00:00 XULDocumentのみに適用
// Date 2010/03/11 17:30 debugbuildで動かない場合がある件に対応。
// Date 2010/02/28 13:00 ↓が直っているので元に戻した。
// Date 2009/08/06 00:00 tree_style_tab-0.8.2009073102があるとxulのdocument.overlayが出来なくなる件に対応
// Date 2009/05/23 00:00 userChrome.js0.8.1実験中 v3.0.25mod
// Date 2009/04/13 00:00 overlayのobserveの処理変更 v3.0.24mod
// Date 2009/03/10 00:00 例外トラップ
// Date 2009/02/15 15:00 chromehiddenなwindow(popup等)の場合にロードするかどうかを指定できるようにした。
// Date 2008/12/29 06:00 面倒だからdocument.overlayを置き換えるようにした。
// Date 2008/12/27 18:00 Webpanelにchromeを読み込んだときのエラーが出るのを修正(thanks 音吉)
// Date 2008/09/16 00 00 面倒だからFirefox3 の場合はeditBookmarkOverlay.xulは先読みするように修正
// Date 2008/08/28 00 00 なぜか0.8.0+を使っている人がいたので, それに対応
// Date 2008/08/26 23:50 08/26 18:00 以降 Fx2で動かなくなったようなので, 直した
// Date 2008/08/26 22:00 v3.0.11modで動かないなら,これ以降のものも動かないよ。たぶん
// Date 2008/08/26 18:00 Fx3のStarUIをなんとかして欲しいな。
// Date 2008/08/18 04:00 AUTOREMOVEBOM = trueなら文字コード自動判定するようにした。
// Date 2008/08/16 15:00 BOMを自動的に取り除くかどうか指定できるようにした
// Date 2008/07/29 23:00 なんかバグあったかも
// Date 2008/07/25 00:00 USE_0_63_FOLDERおよびFORCESORTSCRIPTがtrueの場合は, フォルダも名順でソートするようにした
// Date 2008/07/14 01:00 typo, regression
// Date 2008/07/14 00:00 typo, regression
// Date 2008/07/13 22:00 サイドバーweb-panelsにchromeウインドウを読み込んだ場合に対応
// Date 2008/03/23 12:00 80氏のフォルダ規則に対応, 0.8modバージョンにも対応
//

(function(){
  "use strict";
  // -- config --
  /*
    EXPERIMENT：取消延迟加载（实验性的）？true 为不延迟，false 为延迟。为 true 则一些脚本可能会运行不正常。
      true 和 false 区别2点：
        1、对非主界面的脚本本来有个 500ms 的延迟，true 后就没了。
        2、本来是一个个加载 xul 文件，而 true 则把所有的 xul 加起来一次性加载。 前不久卡饭还有个 userChromejs 扩展的优化版，就是优化 xul 文件的加载。
    EXCLUDE_