                    inOffset.value += dwaHeader.totalAcUncompressedCount;
                    break;
            }
        }
        // Read DCT - DC component data
        if (dwaHeader.dcCompressedSize > 0) {
            const zlibInfo = {
                array: info.array,
                offset: inOffset,
                size: dwaHeader.dcCompressedSize
            };
            dcBuffer = new Uint16Array(uncompressZIP(zlibInfo).buffer);
            inOffset.value += dwaHeader.dcCompressedSize;
        }
        // Read RLE compressed data
        if (dwaHeader.rleRawSize > 0) {
            const compressed = info.array.slice(inOffset.value, inOffset.value + dwaHeader.rleCompressedSize);
            const data = unzlibSync(compressed);
            rleBuffer = decodeRunLength(data.buffer);
            inOffset.value += dwaHeader.rleCompressedSize;
        }
        // Prepare outbuffer data offset
        let outBufferEnd = 0;
        const rowOffsets = new Array(channelData.length);
        for(let i = 0; i < rowOffsets.length; ++i){
            rowOffsets[i] = new Array();
        }
        for(let y = 0; y < info.lines; ++y){
            for(let chan = 0; chan < channelData.length; ++chan){
                rowOffsets[chan].push(outBufferEnd);
                outBufferEnd += channelData[chan].width * info.type * INT16_SIZE;
            }
        }
        // Lossy DCT decode RGB channels
        lossyDctDecode(cscSet, rowOffsets, channelData, acBuffer, dcBuffer, outBuffer);
        // Decode other channels
        for(let i = 0; i < channelData.length; ++i){
            const cd = channelData[i];
            if (cd.decoded) continue;
            switch(cd.compression){
                case RLE:
                    let row = 0;
                    let rleOffset = 0;
                    for(let y = 0; y < info.lines; ++y){
                        let rowOffsetBytes = rowOffsets[i][row];
                        for(let x = 0; x < cd.width; ++x){
                            for(let byte = 0; byte < INT16_SIZE * cd.type; ++byte){
                                outBuffer[rowOffsetBytes++] = rleBuffer[rleOffset + byte * cd.width * cd.height];
                            }
                            rleOffset++;
                        }
                        row++;
                    }
                    break;
                case LOSSY_DCT:
                default:
                    throw new Error("EXRLoader.parse: unsupported channel compression");
            }
        }
        return new DataView(outBuffer.buffer);
    }
    function parseNullTerminatedString(buffer, offset) {
        const uintBuffer = new Uint8Array(buffer);
        let endOffset = 0;
        while(uintBuffer[offset.value + endOffset] != 0){
            endOffset += 1;
        }
        const stringValue = new TextDecoder().decode(uintBuffer.slice(offset.value, offset.value + endOffset));
        offset.value = offset.value + endOffset + 1;
        return stringValue;
    }
    function parseFixedLengthString(buffer, offset, size) {
        const stringValue = new TextDecoder().decode(new Uint8Array(buffer).slice(offset.value, offset.value + size));
        offset.value = offset.value + size;
        return stringValue;
    }
    function parseRational(dataView, offset) {
        const x = parseInt32(dataView, offset);
        const y = parseUint32(dataView, offset);
        return [
            x,
            y
        ];
    }
    function parseTimecode(dataView, offset) {
        const x = parseUint32(dataView, offset);
        const y = parseUint3


等方面的合法权益受法律保护，任何单位和个人不得侵犯。

禁止侮辱、诽谤、殴打、虐待和遗弃老年人。

第四条 各级人民政府应当将老龄事业纳入国民经济和社会发展计划，使老龄事业与经济、社会协调发展。

第五条 市人民政府老龄工作领导小组负责对本市老龄事业发展中的重大问题进行调查研究，协调解决需要由有关部门共同参与解决的综合性问题，监督、检查有关维护老年人合法权益的法律、法规的实施。其办事机构设在市老龄协会。

各区、县人民政府老龄工作机构的设置，参照前款规定。

第六条 保障老年人合法权益是全社会的共同责任。

本市国家机关、社会团体、企业事业单位应当按照各自的职责，做好老年人合法权益的保障工作。

居民委员会、村民委员会和基层老年人群众组织应当反映老年人的要求，维护老年人的合法权益，热心为老年人服务。

第七条 全社会要广泛开展敬老、养老宣传教育活动，提倡尊重、关心、帮助老年人的社会风尚。

青少年组织、学校和幼儿园应当对青少年和儿童进行孝敬父母、敬老养老的道德教育和法制教育。

第八条 各级人民政府对保护老年人合法权益和敬老、养老成绩显著的单位、家庭和个人以及在从事社会劳动和公益事业中做出突出贡献的老年人予以表彰和奖励。

第九条 每年农历九月初九重阳节为本市敬老日。

## 第二章  家庭保障

第十条 老年人在家庭生活中依法享有受赡养扶助的权利。

赡养人必须履行对老年人经济供养、生活照料和精神慰藉的义务，保障老年人的生活标准不低于家庭其他成员，并照顾老年人的特殊需要。

赡养人不得强行将有配偶的老年人分开赡养，不得以放弃继承权或者其他理由，拒绝履行赡养义务；不得要求老年人承担力不能及的劳动。

赡养人与老年人不在一起生活的，应当对老年人的生活给予妥善安排。

第十一条 �


one; just a translation of the name.
    // Can't use this.tooltip directly, because that field exists internally
    if (src.tooltip !== undefined) {
      dst.showTooltip = src.tooltip;
    }
    if (src.onclick != undefined) {
      dst.onclick_callback = src.onclick;
    }

    if (src.tooltipStyle !== undefined) {
      util.selectiveDeepExtend(['tooltipStyle'], dst, src);
    }
  }

  /**
   * Set the value of setting 'showLegend'
   *
   * This depends on the value of the style fields, so it must be called
   * after the style field has been initialized.
   */
  function setShowLegend(showLegend, dst) {
    if (showLegend === undefined) {
      // If the default was auto, make a choice for this field
      var isAutoByDefault = DEFAULTS.showLegend === undefined;

      if (isAutoByDefault) {
        // these styles default to having legends
        var isLegendGraphStyle = dst.style === STYLE.DOTCOLOR || dst.style === STYLE.DOTSIZE;

        dst.showLegend = isLegendGraphStyle;
      } else {
        // Leave current value as is
      }
    } else {
      dst.showLegend = showLegend;
    }
  }

  /**
   * Retrieve the style index from given styleName
   * @param {string} styleName  Style name such as 'dot', 'grid', 'dot-line'
   * @return {Number} styleNumber Enumeration value representing the style, or -1
   *                when not found
   */
  function getStyleNumberByName(styleName) {
    var number = STYLENAME[styleName];

    if (number === undefined) {
      return -1;
    }

    return number;
  }

  /**
   * Check if given number is a valid style number.
   *
   * @return true if valid, false otherwise
   */
  function checkStyleNumber(style) {
    var valid = false;

    for (var n in STYLE) {
      if (STYLE[n] === style) {
        valid = true;
        break;
      }
    }

    return valid;
  }

  function setStyle(style, dst) {
    if (style === undefined) {
      return; // Nothing to do
    }

    var styleNumber;

    if (typeof style === 'string') {
      styleNumber = getStyleNumberByName(style);

      if (styleNumber === -1) {
        throw new Error('Style \'' + style + '\' is invalid');
      }
    } else {
      // Do a pedantic check on style number value
      if (!checkStyleNumber(style)) {
        throw new Error('Style \'' + style + '\' is invalid');
      }

      styleNumber = style;
    }

    dst.style = styleNumber;
  }

  /**
   * Set the background styling for the graph
   * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor
   */
  function setBackgroundColor(backgroundColor, dst) {
    var fill = 'white';
    var stroke = 'gray';
    var strokeWidth = 1;

    if (typeof backgroundColor === 'string') {
      fill = backgroundColor;
      stroke = 'none';
      strokeWidth = 0;
    } else if ((typeof backgroundColor === 'undefined' ? 'undefined' : (0, _typeof3['default'])(backgroundColor)) === 'object') {
      if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
      if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
      if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
    } else {
      throw new Error('Unsupported type of backgroundColor');
    }

    dst.frame.style.backgroundColor = fill;
    dst.frame.style.borderColor = stroke;
    dst.frame.style.borderWidth = strokeWidth + 'px';
    dst.frame.style.borderStyle = 'solid';
  }


ImageType::TYPE_2D,
        vk::ImageViewType::CUBE_ARRAY => vk::ImageType::TYPE_2D,
        vk::ImageViewType::TYPE_3D => vk::ImageType::TYPE_3D,
        _ => vk::ImageType::TYPE_2D,
    }
}

pub fn next_mipmap_size(n: i32) -> i32 {
    if 1 < n { n/2 } else { 1 }
}

pub fn calc_mip_levels(image_width: u32, image_height: u32, image_depth: u32, max_mip_levels: u32) -> u32 {
    let max_size: f32 = max(image_width, max(image_height, image_depth)) as f32;
    let mip_levels = max_size.log2().floor() as u32 + 1;
    if constants::WHOLE_MIP_LEVELS != max_mip_levels {
        return min(max_mip_levels, mip_levels);
    }
    mip_levels
}

pub fn get_image_aspect_by_format(image_format: vk::Format) -> vk::ImageAspectFlags {
    match constants::DEPTH_FOMATS.contains(&image_format) {
        true => match constants::DEPTH_STENCIL_FORMATS.contains(&image_format) {
            true => vk::ImageAspectFlags::DEPTH | vk::ImageAspectFlags::STENCIL,
            false => vk::ImageAspectFlags::DEPTH,
        },
        false => vk::ImageAspectFlags::COLOR,
    }
}

pub fn image_barrier_struct(
    image: vk::Image,
    aspect_mask: vk::ImageAspectFlags,
    mip_level: u32,
    layer_count: u32,
    old_layout: vk::ImageLayout,
    new_layout: vk::ImageLayout,
    src_access_mask: vk::AccessFlags,
    dst_access_mask: vk::AccessFlags,
) -> vk::ImageMemoryBarrier {
    vk::ImageMemoryBarrier {
        old_layout,
        new_layout,
        src_queue_family_index: vk::QUEUE_FAMILY_IGNORED,
        dst_queue_family_index: vk::QUEUE_FAMILY_IGNORED,
        image,
        subresource_range: vk::ImageSubresourceRange {
            aspect_mask, // vk::ImageAspectFlags::COLOR,
            base_mip_level: mip_level,
            level_count: 1,
            base_array_layer: 0,
            layer_count,
            ..Default::default()
        },
        src_access_mask,
        dst_access_mask,
        ..Default::default()
    }
}

pub fn mip_image_blit_struct(
    image_aspect_mask: vk::ImageAspectFlags,
    mip_level: u32,
    src_width: i32,
    src_height: i32,
    src_depth: i32,
    layer_count: u32
) -> vk::ImageBlit {
    vk::ImageBlit {
        src_offsets: [
            vk::Offset3D { x: 0, y: 0, z: 0 },
            vk::Offset3D { x: src_width, y: src_height, z: src_depth }
        ],
        dst_offsets: [
            vk::Offset3D { x: 0, y: 0, z: 0 },
            vk::Offset3D {
                x: next_mipmap_size(src_width),
                y: next_mipmap_size(src_height),
                z: next_mipmap_size(src_depth)
            }
        ],
        src_subresource: vk::ImageSubresourceLayers {
            aspect_mask: image_aspect_mask,
            mip_level: mip_level - 1,
            base_array_layer: 0,
            layer_count
        },
        dst_subresource: vk::ImageSubresourceLayers {
            aspect_mask: image_aspect_mask,
            mip_level,
            base_array_layer: 0,
            layer_count
        },
        ..Default::default()
    }
}

pub fn create_mipmap(
    device: &Device,
    command_buffer: vk::CommandBuffer,


tParentNamespace(namespace);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}
		});

		p1 = mtf.getResultProgram();
		p2 = mtf.getPrivateProgram();

		int txId = p1.startTransaction("Merge into Program 1");
		boolean commit = false;
		try {
			AddressSet setToDiff = new AddressSet();
			setToDiff.addRange(addr(p1, "0x01001a00"), addr(p1, "0x01006500"));
			programMerge = new ProgramMergeManager(p1, p2, setToDiff);

			programMerge.setDiffFilter(new ProgramDiffFilter(
				ProgramDiffFilter.SYMBOL_DIFFS | ProgramDiffFilter.FUNCTION_DIFFS));
			programMerge.setMergeFilter(
				new ProgramMergeFilter(ProgramMergeFilter.SYMBOLS, ProgramMergeFilter.REPLACE));
			AddressSet expectedDiffs = new AddressSet();
			expectedDiffs.addRange(addr(p1, "0x01002cf5"), addr(p1, "0x01002cf5"));
			assertEquals(expectedDiffs, programMerge.getFilteredDifferences());

			AddressSet mergeSet = new AddressSet();
			mergeSet.addRange(addr(p1, "0x01002cf5"), addr(p1, "0x01002cf5"));
			programMerge.merge(mergeSet, TaskMonitor.DUMMY);

			assertEquals(new AddressSet(), programMerge.getFilteredDifferences());

			SymbolTable st = p1.getSymbolTable();
			Symbol[] syms = st.getSymbols(addr(p1, "0x01002cf5"));
			assertEquals(1, syms.length);
			assertEquals("SampleLabel", syms[0].getName());
			assertEquals("MY.DLL", syms[0].getParentNamespace().getName());
			commit = true;
		}
		finally {
			p1.endTransaction(txId, commit);
		}
	}

	@Test
	public void testReplaceNamespaceLabelsAndFunction() throws Exception {
		mtf.initialize("NotepadMergeListingTest", new ProgramModifierListener() {
			@Override
			public void modifyLatest(ProgramDB program) {
				// P1 program
				Namespace namespace = program.getGlobalNamespace();
				FunctionManager functionMgr = program.getFunctionManager();
				try {
					Function f = functionMgr.getFunctionAt(addr(program, "0x01002cf5"));
					f.setName("MY.DLL_SampleLabel", SourceType.USER_DEFINED);
					f.setParentNamespace(namespace);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}

			@Override
			public void modifyPrivate(ProgramDB program) {
				// P2 program
				SymbolTable st = program.getSymbolTable();
				Namespace namespace;
				FunctionManager functionMgr = program.getFunctionManager();
				try {
					namespace = st.createNameSpace(program.getGlobalNamespace(), "MY.DLL",
						SourceType.USER_DEFINED);
					Function f = functionMgr.getFunctionAt(addr(program, "0x01002cf5"));
					f.setName("SampleLabel", SourceType.USER_DEFINED);
					f.setParentNamespace(namespace);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}
		});

		p1 = mtf.getResultProgram();
		p2 = mtf.getPrivateProgram();

		int txId = p1.startTransaction("Merge into Program 1");
		boolean commit = false;
		try {
			AddressSet setToDiff = new AddressSet();
			setToDiff.addRange(addr(p1, "0x01001a00"), addr(p1, "0x01006500"));
			programMerge = new ProgramMergeManager(p1, p2, setToDiff);

			programMerge.setDiffFilter(new ProgramDiffFilter(
				ProgramDiffFilter.SYMBOL_DIFFS | ProgramDiffFilter.FUNCTION_DIFFS));
			programMerge.setMergeFilter(


还不是很好 🥹😭 感觉很阳光开朗

知乎的技术栈是什么呢？

- 大部分是 react，有一些是 Vue

请问你们的组件是直接用现成的还是自己弄呢？

- b 端的话会自己弄，c 端需要很多自己定义样式的地方，大都手搓

好的，没有了，谢谢您

- 好的

### 总结

自己太紧张了，很多地方发挥的很失败，面试没准备好，在面试的时候我才在搭建环境，自己的 js 基础太差了，git 命令也很差，需要恶补一下，知乎的寄了，接下来加油吧

## 扁鹊健康

> 第二场面试，八股文基本上全答出来了，结果反手删我微信给我挂了 😓

第二次面试很明显比第一次好多了，没有那么紧张，情绪也没有失控，可能是没开视频的原因？感觉面试的时候还是得尽量严肃一点吧，控制好自己的情绪和面部表情才能够更好的回答问题，在面试前让自己冷静下来，像对待考试一样去对待每一场面试

面试官迟到了 6 分钟的样子 电话面试 本以为只会面试 10 分钟，结果面试了半小时

之前看牛客上的面经，以为是很简单的那种，结果大意了，把我简历扒拉干净了的感觉

一上来还是自我介绍

### 数据结构

一上来就进行数据结构的拷打呜呜，我数据结构很烂诶

- 有哪些排序的方法？

> 1. Array.prototype.sort()：该方法可以对数组进行原地排序，即直接修改原数组，不会返回新的数组。默认情况下，它会将数组元素转换为字符串，然后按照 Unicode 码点排序。如果需要按照其他方式排序，可以传入一个比较函数作为参数。
> 2. Array.prototype.reverse()：该方法可以将数组中的元素按照相反的顺序重新排列，并返回新的数组。
> 3. 冒泡排序（Bubble Sort）：这是一种简单的排序算法，它重复地遍历要排序的数组，比较相邻的元素并交换位置，直到整个数组都已经排序。
> 4. 快速排序（Quick Sort）：这是一种快速的排序算法，它的基本思想是选择一个基准元素，然后将数组中的元素分为小于基准元素和大于基准元素的两部分，再对这两部分分别进行排序。
> 5. 插入


                                                    src_his=src_his,
                                                                                src_hl=src_hl,
                                                                                tgt_his=tgt_his,
                                                                                tgt_hl=tgt_hl)
            # loss_r = F.binary_cross_entropy_with_logits(pred_y, test_set_i_y, reduction='sum')
            if i == 0:
                test_emb_s = emb_s_i
                test_emb_t = emb_t_i
            else:
                test_emb_s = torch.cat((test_emb_s, emb_s_i), dim=0)
                test_emb_t = torch.cat((test_emb_t, emb_t_i), dim=0)
        y_hat, y = pred_y.cpu().numpy(), test_set_i_y.cpu().numpy()
        # loss_r_test_sum += loss_r.item()
        l1_sum += np.sum(np.abs(y_hat - y))
        l2_sum += np.sum(np.square(y_hat - y))
        for k in range(test_set_i.size(0)):
            u, s, y = test_set_i_x[k, 0].item(), pred_y[k].item(), test_set_i_y[k].item()
            user_score_dict[u] += [s]
            user_label_dict[u] += [y]

        count_score(pred_y, test_set_i_y)
    logger.info("---------------------------------------------------------------------------")
    logger.info(f"真实评分分布：{y_score_dic}")
    logger.info(f"预测评分分布：{ypre_score_dic}")
    logger.info("---------------------------------------------------------------------------")
    # TestLoss = loss_r_test_sum / test_size

    MAE = l1_sum / test_size
    RMSE = np.sqrt(l2_sum / test_size)
    for u in user_score_dict.keys():
        if len(user_score_dict[u]) <= 1:
            continue
        ndcg_sum += ndcg_k(user_score_dict[u], user_label_dict[u], 10)
        num += 1
    np.save('data/' + args.dataset + '_hybrid_src_emb_no1.npy', test_emb_s.cpu().numpy())
    # np.save('data/' + args.dataset + '_hybrid_tgt_emb.npy', test_emb_t.cpu().numpy())
    return MAE, RMSE, ndcg_sum, num

def load_model_s(model, path):
    model.load_model(path + file_name + '_model.pkl')

def load_model_q(model, path):
    model.load_model(path + file_name + '_model.pkl')

fix_seed(1234)
parser = argparse.ArgumentParser(description='Specify some parameters!')
parser.add_argument('--gpus', default='0', help='gpus')
parser.add_argument('--test_ratio', default='0.2', help="test_ratio")
parser.add_argument('--test_degree', default='0', help="test_degree")  # 冷启动用户交互数量敏感度测试参数
parser.add_argument('--dataset', default='1', help="dataset")
parser.add_argument('--head_num', type=int, default=3, help="head_num")
parser.add_argument('--emb_size', type=int, default=64, help="emb_size")
parser.add_argument('--hid_size', type=int, default=128, help="hid_size")
args = parser.parse_args()

"""
_tgt_CDs_and_Vinyl_src_Books
_tgt_Movies_and_TV_src_Books
_tgt_CDs_and_Vinyl_src_Movies_and_TV
"""
file_flag = args.dataset
file_name = ""
if file_flag == "1":
    file_name = f"{args.test_ratio}_tgt_CDs_and_Vinyl_src_Movies_and_TV"
elif file_flag == "2":
    file_name = f"{args.test_ratio}_tgt_Movies_and_TV_src_Books"
elif file_flag == "3":
    file_name = f"{args.test_ratio}_tgt_CDs_and_Vinyl_src_Books"

now = datetime.now().strftime("%Y_%m_%d")
# logger = getLogger('log/'+now+'_train/'+file_name+'_train.log')
logger = getLogger('log/2024_06_10_train/' + file_name + '_train.log')
logger.info('2024_06_10_train file: ' + file_name)

# 敏感度测试用的
if args.test_degree == '1':
    degree = '[5,9]'
elif args.test_degree == '2':
    degree = '[10,14]'
elif args.test_degree == '3':
    degree = '[15,19]'
elif args.test_degree == '4':
    degree = '(20,)'
elif args.test_degree == '0':
    degree = 'all'

# 定义的一些参数和变量
os.environ["CUDA_VISIBLE_DEVICES"] = args.gpus
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
LEARNING_RATE = 0.001
DECAYING_FACTOR = 1.
LAMBDA_REG = 0.05
BATCH_SIZE_TEST = 128
HIS_MAXLEN = 100
HIS_SAMPLE_NUM = 20
n_epochs = 1  # 500
n_rating = 5
datadir = 'data/ready/' + file_name + '.pkl'
src_pretrain_path = "model/pretrain-src/" + file_name + '_model.pkl'
tgt_pretrain_path = "model/pretrain-tgt/" + file_name + '_model.pkl'

# 读取预处理的数据
n_user, n_item, test_user_num, train_ov_tgt, train_ov_src, train_src, train_tgt, test_tgt_data, test_src_data, \
user_his_dict_src, user_his_dict_tgt, user_supp_list, edge_UI_tgt, edge_UI_src, test_edge_UI_tgt = \
    generate_data(device=device, datadir=datadir, test_degree=args.test_degree, sample_graph=False, logger=logge


* 1024, 4 * 1024, 10, "flush"},
		{"SmallBlock_Prealloc_NoFlush", 100 * 1024 * 1024, 50 * 1024 * 1024, 4 * 1024, 0, "none"},
		{"SmallBlock_Prealloc_FewFlush", 100 * 1024 * 1024, 50 * 1024 * 1024, 4 * 1024, 100, "flush"},
		{"SmallBlock_Prealloc_FrequentFlush", 100 * 1024 * 1024, 50 * 1024 * 1024, 4 * 1024, 10, "flush"},

		// Medium block tests
		{"MediumBlock_NoPrealloc_NoFlush", 0, 100 * 1024 * 1024, 32 * 1024, 0, "none"},
		{"MediumBlock_NoPrealloc_FewFlush", 0, 100 * 1024 * 1024, 32 * 1024, 50, "flush"},
		{"MediumBlock_NoPrealloc_FrequentFlush", 0, 100 * 1024 * 1024, 32 * 1024, 10, "flush"},
		{"MediumBlock_Prealloc_NoFlush", 200 * 1024 * 1024, 100 * 1024 * 1024, 32 * 1024, 0, "none"},
		{"MediumBlock_Prealloc_FewFlush", 200 * 1024 * 1024, 100 * 1024 * 1024, 32 * 1024, 50, "flush"},
		{"MediumBlock_Prealloc_FrequentFlush", 200 * 1024 * 1024, 100 * 1024 * 1024, 32 * 1024, 10, "flush"},

		// Large block tests
		{"LargeBlock_NoPrealloc_NoFlush", 0, 200 * 1024 * 1024, 1 * 1024 * 1024, 0, "none"},
		{"LargeBlock_NoPrealloc_FewFlush", 0, 200 * 1024 * 1024, 1 * 1024 * 1024, 20, "flush"},
		{"LargeBlock_NoPrealloc_FrequentFlush", 0, 200 * 1024 * 1024, 1 * 1024 * 1024, 5, "flush"},
		{"LargeBlock_Prealloc_NoFlush", 500 * 1024 * 1024, 200 * 1024 * 1024, 1 * 1024 * 1024, 0, "none"},
		{"LargeBlock_Prealloc_FewFlush", 500 * 1024 * 1024, 200 * 1024 * 1024, 1 * 1024 * 1024, 20, "flush"},
		{"LargeBlock_Prealloc_FrequentFlush", 500 * 1024 * 1024, 200 * 1024 * 1024, 1 * 1024 * 1024, 5, "flush"},

		// Sync tests (ensure data persistence)
		{"SmallBlock_Sync", 0, 10 * 1024 * 1024, 4 * 1024, 50, "sync"},
		{"MediumBlock_Sync", 0, 20 * 1024 * 1024, 32 * 1024, 10, "sync"},
		{"LargeBlock_Sync", 0, 50 * 1024 * 1024, 1 * 1024 * 1024, 5, "sync"},
	}

	// Create temporary directory
	tempDir := filepath.Join(os.TempDir(), fmt.Sprintf("file_append_test_%d", time.Now().UnixNano()))
	err := os.MkdirAll(tempDir, 0755)
	if err != nil {
		t.Fatalf("Failed to create temporary directory: %v", err)
	}
	defer os.RemoveAll(tempDir)

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			filePath := filepath.Join(tempDir, fmt.Sprintf("append_%s.data", tc.name))

			// Create file
			var file *os.File
			var err error

			flags := os.O_CREATE | os.O_WRONLY
			if tc.preallocSize > 0 {
				// If preallocation is needed, create the file and set its size first
				file, err = os.OpenFile(filePath, flags, 0644)
				if err != nil {
					t.Fatalf("Cannot create file: %v", err)
				}

				// Use truncate to preallocate space
				if err := file.Truncate(tc.preallocSize); err != nil {
					file.Close()
					t.Fatalf("Cannot preallocate file space: %v", err)
				}

				// Close file and reopen in append mode
				file.Close()
				flags |= os.O_APPEND
				file, err = os.OpenFile(filePath, flags, 0644)
			} else {
				// No preallocation, open directly in append mode
				flags |= os.


pening) {
                    /* add in stream list */
                    *last_stream = stream;
                    last_stream = &stream->next;
                }
            }
        } else if (redirect || !av_strcasecmp(cmd, "<Redirect")) {
            int opening = !av_strcasecmp(cmd, "<Redirect");
            if (opening && (stream || feed || redirect))
                ERROR("Already in a tag\n");
            else {
                ret = ffserver_parse_config_redirect(config, cmd, &p,
                                                     &redirect);
                if (ret < 0)
                    break;
                if (opening) {
                    /* add in stream list */
                    *last_stream = redirect;
                    last_stream = &redirect->next;
                }
            }
        } else {
            ffserver_parse_config_global(config, cmd, &p);
        }
    }
    if (stream || feed || redirect)
        ERROR("Missing closing </%s> tag\n",
              stream ? "Stream" : (feed ? "Feed" : "Redirect"));

    fclose(f);
    if (ret < 0)
        return ret;
    if (config->errors)
        return AVERROR(EINVAL);
    else
        return 0;
}

#undef ERROR
#undef WARNING

void ffserver_free_child_args(void *argsp)
{
    int i;
    char **args;
    if (!argsp)
        return;
    args = *(char ***)argsp;
    if (!args)
        return;
    for (i = 0; i < MAX_CHILD_ARGS; i++)
        av_free(args[i]);
    av_freep(argsp);
}


C_NIST_P256
    comma{TPM_ECC_NIST_P256,
          256,
          {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA256}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_NIST_P256 CURVE_NAME("NIST_P256")}
#    undef comma
#    define comma ,
#  endif  // ECC_NIST_P256
#  if ECC_NIST_P384
    comma{TPM_ECC_NIST_P384,
          384,
          {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA384}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_NIST_P384 CURVE_NAME("NIST_P384")}
#    undef comma
#    define comma ,
#  endif  // ECC_NIST_P384
#  if ECC_NIST_P521
    comma{TPM_ECC_NIST_P521,
          521,
          {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SHA512}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_NIST_P521 CURVE_NAME("NIST_P521")}
#    undef comma
#    define comma ,
#  endif  // ECC_NIST_P521
#  if ECC_BN_P256
    comma{TPM_ECC_BN_P256,
          256,
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_BN_P256 CURVE_NAME("BN_P256")}
#    undef comma
#    define comma ,
#  endif  // ECC_BN_P256
#  if ECC_BN_P638
    comma{TPM_ECC_BN_P638,
          638,
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_BN_P638 CURVE_NAME("BN_P638")}
#    undef comma
#    define comma ,
#  endif  // ECC_BN_P638
#  if ECC_SM2_P256
    comma{TPM_ECC_SM2_P256,
          256,
          {TPM_ALG_KDF1_SP800_56A, {{TPM_ALG_SM3_256}}},
          {TPM_ALG_NULL, {{TPM_ALG_NULL}}},
          OID_ECC_SM2_P256 CURVE_NAME("SM2_P256")}
#    undef comma
#    define comma ,
#  endif  // ECC_SM2_P256
};

#endif  // TPM_ALG_ECC


.2c-4.8-5.5-8.5-12.2-10.4-19.7l-6.5-25.3zM296 316c0-6.9-3.1-13.2-7.3-18.3c-4.3-5.2-10.1-9.7-16.7-13.4C258.7 276.9 241.4 272 224 272c-3.6 0-6.8 2.5-7.7 6s.6 7.2 3.8 9l0 0 0 0 0 0 .2 .1c.2 .1 .5 .3 .9 .5c.8 .5 2 1.2 3.4 2.1c2.8 1.9 6.5 4.5 10.2 7.6c3.7 3.1 7.2 6.6 9.6 10.1c2.5 3.5 3.5 6.4 3.5 8.6s-1 5-3.5 8.6c-2.5 3.5-5.9 6.9-9.6 10.1c-3.7 3.1-7.4 5.7-10.2 7.6c-1.4 .9-2.6 1.6-3.4 2.1c-.4 .2-.7 .4-.9 .5l-.2 .1 0 0 0 0 0 0 0 0 0 0c-2.5 1.4-4.1 4.1-4.1 7s1.6 5.6 4.1 7l0 0 0 0 0 0 .2 .1c.2 .1 .5 .3 .9 .5c.8 .5 2 1.2 3.4 2.1c2.8 1.9 6.5 4.5 10.2 7.6c3.7 3.1 7.2 6.6 9.6 10.1c2.5 3.5 3.5 6.4 3.5 8.6s-1 5-3.5 8.6c-2.5 3.5-5.9 6.9-9.6 10.1c-3.7 3.1-7.4 5.7-10.2 7.6c-1.4 .9-2.6 1.6-3.4 2.1c-.4 .2-.7 .4-.9 .5l-.2 .1 0 0 0 0 0 0 0 0c-3.2 1.8-4.7 5.5-3.8 9s4.1 6 7.7 6c17.4 0 34.7-4.9 47.9-12.3c6.6-3.7 12.5-8.2 16.7-13.4c4.3-5.1 7.3-11.4 7.3-18.3s-3.1-13.2-7.3-18.3c-4.3-5.2-10.1-9.7-16.7-13.4c-2.7-1.5-5.7-3-8.7-4.3c3.1-1.3 6-2.7 8.7-4.3c6.6-3.7 12.5-8.2 16.7-13.4c4.3-5.1 7.3-11.4 7.3-18.3zM176.4 240a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm159.3-20c10.6 0 19.9 3.8 25.4 9.7c7.6 8.1 20.2 8.5 28.3 .9s8.5-20.2 .9-28.3C375.7 186.8 355 180 335.6 180s-40.1 6.8-54.6 22.3c-7.6 8.1-7.1 20.7 .9 28.3s20.7 7.1 28.3-.9c5.5-5.8 14.8-9.7 25.4-9.7zM434 352.3c-6-23.2-28.8-37-51.1-30.8s-35.4 30.1-29.5 53.4l22.9 89.3c2.2 8.7 11.2 13.9 19.8 11.4l84.9-23.8c22.2-6.2 35.4-30.1 29.5-53.4s-28.8-37-51.1-30.8l-20.2 5.6-5.4-21z"],
    "star-half-stroke": [576


 (yj - yi) + xi;
      if (intersect) isInside = !isInside;
    }
    return isInside;
  }

  /**
   * Called by the particle emitter to get a random position for a new particle.
   * @param {PIXI.particles.Particle} particle - The particle to position.
   */
  getRandPos(particle) {
    if (!this._points || this._points.length === 0) return;

    let p = new PIXI.Point(0, 0);

    const useFalloff =
      this.emissionSettings.enabled && this.emissionSettings.falloff?.enabled;
    // Map strength [0, 0.99] to an exponent for pow(). Lower strength -> higher exponent -> more bias.
    const strength = this.emissionSettings.falloff?.strength ?? 0.5;
    const exponent = 1.0 / (1.0 - strength);

    switch (this._type) {
      case "point": {
        p = this._points[Math.floor(Math.random() * this._points.length)];
        break;
      }
      case "line": {
        if (this._points.length < 2) {
          p = this._points[0];
          break;
        }
        const segmentIndex = Math.floor(
          Math.random() * (this._points.length - 1)
        );
        const p1 = this._points[segmentIndex];
        const p2 = this._points[segmentIndex + 1];

        let t = Math.random();
        if (useFalloff) {
          const r = Math.random() - 0.5; // -0.5 to 0.5
          const bias = Math.pow(Math.abs(r * 2), exponent); // 0 to 1, biased to 0
          const final_r = r > 0 ? bias / 2 : -bias / 2;
          t = 0.5 + final_r; // t will be biased towards 0.5
        }
        p.x = p1.x + t * (p2.x - p1.x);
        p.y = p1.y + t * (p2.y - p1.y);
        break;
      }
      case "area": {
        if (this._points.length < 3 || !this._bounds) return;

        let attempts = 0;
        const MAX_ATTEMPTS = 100;

        if (useFalloff && this._centroid) {
          // Biased rejection sampling
          const maxDistSq =
            Math.pow(this._bounds.width, 2) + Math.pow(this._bounds.height, 2);
          do {
            p.x = this._bounds.x + Math.random() * this._bounds.width;
            p.y = this._bounds.y + Math.random() * this._bounds.height;
            attempts++;
            if (!this._isPointInPolygon(p)) continue;

            const distSqToCentroid =
              Math.pow(p.x - this._centroid.x, 2) +
              Math.pow(p.y - this._centroid.y, 2);
            const normalizedDist = Math.sqrt(distSqToCentroid / maxDistSq);
            const keepProbability = Math.pow(1 - normalizedDist, exponent);

            if (Math.random() < keepProbability) break;
          } while (attempts < MAX_ATTEMPTS);

          if (attempts >= MAX_ATTEMPTS) p.copyFrom(this._centroid);
        } else {
          // Standard uniform rejection sampling
          do {
            p.x = this._bounds.x + Math.random() * this._bounds.width;
            p.y = this._bounds.y + Math.random() * this._bounds.height;
            attempts++;
          } while (!this._isPointInPolygon(p) && attempts < MAX_ATTEMPTS);

          if (attempts >= MAX_ATTEMPTS)
            p.copyFrom(
              this._points[Math.floor(Math.random() * this._points.length)]
            );
        }
        break;
      }
    }
    particle.position.copyFrom(p);
  }
}

export class ParticleLayer extends foundry.canvas.layers.CanvasLayer {
  constructor() {
    super();
    this._onAnimateBound = null;
    this._destroyed = false;
    this._onMapPointsUpdatedBo


65.7 156.8 158.1 168.1 152.8 180.7L103.8 160c0-.5 .25-1 .25-1.5V111.6C104 103 96.76 96 88.01 96h-16c-8.75 0-16 7-16 15.62v29l-28.25-11.5c-8.125-3.25-17.5 .625-20.75 8.625l-5.875 14.5C-2.119 160.4 1.881 169.5 10.01 172.6L144.4 228.4C144.9 240.8 147.3 252.7 151.5 263.7c-33.78 29.34-55.53 72.04-55.53 120.3c0 52.59 25.71 98.84 64.88 128h190.2c39.17-29.17 64.88-75.42 64.88-128c0-48.25-21.76-90.95-55.53-120.3c4.195-11.03 6.599-22.89 7.091-35.27l134.4-55.8C510.1 169.5 514.1 160.4 510.9 152.3zM224 95.1c-8.75 0-15.1-7.25-15.1-15.1s7.25-15.1 15.1-15.1s15.1 7.25 15.1 15.1S232.8 95.1 224 95.1zM256 367.1c-8.75 0-15.1-7.25-15.1-15.1S247.3 335.1 256 335.1s15.1 7.25 15.1 15.1S264.8 367.1 256 367.1zM256 303.1c-8.75 0-15.1-7.25-15.1-15.1S247.3 271.1 256 271.1s15.1 7.25 15.1 15.1S264.8 303.1 256 303.1zM256 239.1c-8.75 0-15.1-7.25-15.1-15.1S247.3 207.1 256 207.1s15.1 7.25 15.1 15.1S264.8 239.1 256 239.1zM256 152c0 0-15.1-23.25-15.1-32S247.3 104 256 104s15.1 7.25 15.1 16S256 152 256 152zM287.1 95.1c-8.75 0-15.1-7.25-15.1-15.1s7.25-15.1 15.1-15.1s15.1 7.25 15.1 15.1S296.7 95.1 287.1 95.1z"],snowplow:[640,512,[],"f7d2","M144 400C144 413.3 133.3 424 120 424C106.7 424 96 413.3 96 400C96 386.7 106.7 376 120 376C133.3 376 144 386.7 144 400zM336 400C336 386.7 346.7 376 360 376C373.3 376 384 386.7 384 400C384 413.3 373.3 424 360 424C346.7 424 336 413.3 336 400zM304 400C304 413.3 293.3 424 280 424C266.7 424 256 413.3 256 400C256 386.7 266.7 376 280 376C293.3 376 304 386.7 304 400zM176 400C176 386.7 186.7 376 200 376C213.3 376 224 386.7 224 400C224 413.3 213.3 424 200 424C186.7 424 176 413.3 176 400zM447.4 249.6C447.8 251.9 448.1 254.3 448 256.7V288H512V235.2C512 220.7 516.9 206.6 526 195.2L583 124C594.1 110.2 614.2 107.1 627.1 119C641.8 130.1 644 150.2 632.1 163.1


pub type Program<Ex, En> = Vec<Def<Ex, En>>;

#[derive(
    Clone,
    Debug,
    Deserialize,
    Eq,
    FromOcamlRep,
    Hash,
    NoPosHash,
    Ord,
    PartialEq,
    PartialOrd,
    Serialize,
    ToOcamlRep
)]
#[repr(C)]
pub struct Stmt<Ex, En>(pub Pos, pub Stmt_<Ex, En>);

#[derive(
    Clone,
    Debug,
    Deserialize,
    Eq,
    FromOcamlRep,
    Hash,
    NoPosHash,
    Ord,
    PartialEq,
    PartialOrd,
    Serialize,
    ToOcamlRep
)]
#[repr(C)]
pub enum Stmt_<Ex, En> {
    /// Marker for a switch statement that falls through.
    ///
    /// // FALLTHROUGH
    Fallthrough,
    /// Standalone expression.
    ///
    /// 1 + 2;
    Expr(Box<Expr<Ex, En>>),
    /// Break inside a loop or switch statement.
    ///
    /// break;
    Break,
    /// Continue inside a loop or switch statement.
    ///
    /// continue;
    Continue,
    /// Throw an exception.
    ///
    /// throw $foo;
    Throw(Box<Expr<Ex, En>>),
    /// Return, with an optional value.
    ///
    /// return;
    /// return $foo;
    Return(Box<Option<Expr<Ex, En>>>),
    /// Yield break, terminating the current generator. This behaves like
    /// return; but is more explicit, and ensures the function is treated
    /// as a generator.
    ///
    /// yield break;
    YieldBreak,
    /// Concurrent block. All the await expressions are awaited at the
    /// same time, similar to genva().
    ///
    /// We store the desugared form. In the below example, the list is:
    /// [('__tmp$1', f()), (__tmp$2, g()), (None, h())]
    /// and the block assigns the temporary variables back to the locals.
    /// { $foo = __tmp$1; $bar = __tmp$2; }
    ///
    /// concurrent {
    /// $foo = await f();
    /// $bar = await g();
    /// await h();
    /// }
    Awaitall(Box<(Vec<(Option<Lid>, Expr<Ex, En>)>, Block<Ex, En>)>),
    /// If statement.
    ///
    /// if ($foo) { ... } else { ... }
    If(Box<(Expr<Ex, En>, Block<Ex, En>, Block<Ex, En>)>),
    /// Do-while loop.
    ///
    /// do {
    /// bar();
    /// } while($foo)
    Do(Box<(Block<Ex, En>, Expr<Ex, En>)>),
    /// While loop.
    ///
    /// while ($foo) {
    /// bar();
    /// }
    While(Box<(Expr<Ex, En>, Block<Ex, En>)>),
    /// Initialize a value that is automatically disposed of.
    ///
    /// using $foo = bar(); // disposed at the end of the function
    /// using ($foo = bar(), $baz = quux()) {} // disposed after the block
    Using(Box<UsingStmt<Ex, En>>),
    /// For loop. The initializer and increment parts can include
    /// multiple comma-separated statements. The termination condition is
    /// optional.
    ///
    /// for ($i = 0; $i < 100; $i++) { ... }
    /// for ($x = 0, $y = 0; ; $x++, $y++) { ... }
    For(
        Box<(
            Vec<Expr<Ex, En>>,
            Op


   id: 4,
        ph: 'b'
      },
      {
        name: 'A:a2/eyJhIjoyLCJiIjoyfQ==',
        args: {params: ''},
        pid: 1,
        ts: 130,
        cat: 'blink.user_timing',
        tid: 2,
        id: 4,
        ph: 'e'
      }
    ];
    checkParsedAndStreamInput(events, checkModel);
  });

  test('UserTimingAsyncSlicesWithNormalAsyncSlices', function() {
    function checkModel(m) {
      assert(m.numProcesses, 1);
      const p = m.processes[1];
      assert.isDefined(p);
      assert.strictEqual(p.numThreads, 1);
      const t = p.threads[2];
      const asyncSliceGroup = t.asyncSliceGroup;
      assert.strictEqual(asyncSliceGroup.length, 3);
      assert.isTrue(asyncSliceGroup.slices[0] instanceof MeasureAsyncSlice);
      assert.isFalse(asyncSliceGroup.slices[1] instanceof MeasureAsyncSlice);
      assert.isFalse(asyncSliceGroup.slices[2] instanceof MeasureAsyncSlice);

      const a1 = asyncSliceGroup.slices[0];
      assert.strictEqual(a1.viewSubGroupTitle, 'A');
      assert.strictEqual(a1.title, 'a1');
      assert.strictEqual(a1.subSlices.length, 1);
      const a2 = a1.subSlices[0];
      assert.strictEqual(a2.viewSubGroupTitle, 'A');
      assert.strictEqual(a2.title, 'a2');
      assert.strictEqual(a2.subSlices.length, 0);
      const B = asyncSliceGroup.slices[1];
      assert.strictEqual(B.viewSubGroupTitle, 'B');
      assert.strictEqual(B.title, 'B');
      assert.strictEqual(B.subSlices.length, 0);
      const C = asyncSliceGroup.slices[2];
      assert.strictEqual(C.viewSubGroupTitle, 'C');
      assert.strictEqual(C.title, 'C');
      assert.strictEqual(C.subSlices.length, 0);
    }

    /**
     * Structure of user timing async slices
     *
     * Group A:
     *
     * |__________|
     *      a1
     *  |__|
     *   a2
     *
     * B
     *         |__|
     *          B
     * C
     *             |_|
     *              C
     **/
    const events = [
      {
        name: 'A:a1', args: {params: ''}, pid: 1, ts: 1,
        cat: 'blink.user_timing', tid: 2, id: 3, ph: 'b'
      },
      {
        name: 'A:a1', args: {params: ''}, pid: 1, ts: 11,
        cat: 'blink.user_timing', tid: 2, id: 3, ph: 'e'
      },
      {
        name: 'A:a2', args: {params: ''}, pid: 1, ts: 2,
        cat: 'blink.user_timing', tid: 2, id: 4, ph: 'b'
      },
      {
        name: 'A:a2', args: {params: ''}, pid: 1, ts: 4,
        cat: 'blink.user_timing', tid: 2, id: 4, ph: 'e'
      },
      {
        name: 'B', args: {}, pid: 1, ts: 9, cat: 'foo',
        tid: 2, ph: 'b', id: 5
      },
      {
        name: 'B', args: {}, pid: 1, ts: 11, cat: 'foo',
        tid: 2, ph: 'e', id: 5
      },
      {
        name: 'C', args: {}, pid: 1, ts:


, NewCarbon().StartOfWeek().ToString())

		SetWeekStartsAt(Monday)
		s.Equal(Monday, DefaultWeekStartsAt)
		s.Equal(Monday, NewCarbon().WeekStartsAt())
		s.Equal("0001-01-01 00:00:00 +0000 UTC", NewCarbon().StartOfWeek().ToString())
	})

	s.Run("valid carbon", func() {
		SetWeekStartsAt(Monday)
		c1 := Parse("2020-08-05")
		s.Equal(Monday, DefaultWeekStartsAt)
		s.Equal(Monday, c1.WeekStartsAt())
		s.Equal("2020-08-03 00:00:00 +0000 UTC", c1.StartOfWeek().ToString())

		SetWeekStartsAt(Sunday)
		c2 := Parse("2020-08-05")
		s.Equal(Sunday, DefaultWeekStartsAt)
		s.Equal(Sunday, c2.WeekStartsAt())
		s.Equal("2020-08-02 00:00:00 +0000 UTC", c2.StartOfWeek().ToString())
	})
}

func (s *SetterSuite) TestSetWeekendDays() {
	s.Run("zero carbon", func() {
		SetWeekendDays([]Weekday{
			Saturday, Sunday,
		})
		s.True(NewCarbon().IsWeekday())
		s.False(NewCarbon().IsWeekend())
	})

	s.Run("empty carbon", func() {
		SetWeekendDays([]Weekday{
			Saturday, Sunday,
		})
		s.False(Parse("").IsWeekday())
		s.False(Parse("").IsWeekend())
	})

	s.Run("error carbon", func() {
		SetWeekendDays([]Weekday{
			Saturday, Sunday,
		})
		s.False(Parse("xxx").IsWeekday())
		s.False(Parse("xxx").IsWeekend())
	})

	s.Run("valid carbon", func() {
		SetWeekendDays([]Weekday{
			Saturday,
		})
		s.True(Parse("2025-04-12").IsWeekend())
		s.False(Parse("2025-04-13").IsWeekend())

		SetWeekendDays([]Weekday{
			Sunday,
		})
		s.False(Parse("2025-04-12").IsWeekend())
		s.True(Parse("2025-04-13").IsWeekend())
	})
}

func (s *SetterSuite) TestCarbon_SetLayout() {
	s.Run("nil carbon", func() {
		var c *Carbon
		c = nil
		c = c.SetLayout(DateLayout)
		s.False(c.HasError())
		s.Empty(c.ToString())
	})

	s.Run("zero carbon", func() {
		c := NewCarbon().SetLayout(DateLayout)
		s.False(c.HasError())
		s.Equal(DateLayout, c.CurrentLayout())
		s.Equal("0001-01-01 00:00:00 +0000 UTC", c.ToString())
	})

	s.Run("empty carbon", func() {
		c := Parse("").SetLayout(DateLayout)
		s.False(c.HasError())
		s.Empty(c.String())
	})

	s.Run("error carbon", func() {
		c := Parse("xxx").SetLayout(DateLayout)
		s.True(c.HasError())
		s.Empty(c.String())
	})

	s.Run("valid carbon", func() {
		c := Parse("2020-08-05 13:14:15.999999 +0000 UTC")

		s.Equal("2020-08-05 13:14:15", c.SetLayout(DateTimeLayout).String())
		s.Equal("1596633255", c.SetLayout(TimestampLayout).String())
		s.Equal("1596633255999", c.SetLayout(TimestampMilliLayout).String())
		s.Equal("1596633255999999", c.SetLayout(TimestampMicroLayout


ass="object">

Device.IP.Interface.{i}.IPv6Prefix.{i}.

object(0:)

W

This table contains the interface's IPv6 prefixes.  There MUST be an entry for each such prefix, not only for prefixes learned from router advertisements.
There are several ways in which entries can be added to and deleted from this table, including:

Automatically via [RFC4861] Router Advertisements.  See also RouterAdvertisement.

Automatically via DHCPv6 [RFC3315] prefix delegation [RFC3633].  See also DHCPv6.Client.

Automatically via internal CPE logic, e.g. creation of child prefixes derived from a parent prefix.

Manually via a GUI or some other local management interface.

Manually via factory default configuration.

By the ACS.
The CPE MAY choose not to create IPv6Prefix entries for WellKnown prefixes or for the ULA /48 prefix [RFC4193]. If an IPv6Prefix entry exists for the ULA /48 prefix, it MUST be on a downstream interface (i.e. an interface for which the physical layer interface object has Upstream = false).
This object is based on ipAddressPrefixTable from [RFC4293].

At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value for Alias. On creation of a new table entry, the Agent MUST choose an initial value for Alias such that the new entry does not conflict with any existing entries.
At most one enabled entry in this table can exist with a given value for Prefix.

-

2.0

Enable

boolean

W

Enables or disables this IPv6Prefix entry.

false


HREF="./edu/berkeley/nlp/lm/util/Logger.SystemLogger.html#close()">close() -
Method in class edu.berkeley.nlp.lm.util.Logger.SystemLogger

closeEasy(BufferedReader) -
Static method in class edu.berkeley.nlp.lm.io.IOUtils

combineInts(int, int) -
Static method in class edu.berkeley.nlp.lm.bits.BitUtils

combineToKey(int, long) -
Method in class edu.berkeley.nlp.lm.map.AbstractNgramMap

compare(Map.Entry<E, Double>, Map.Entry<E, Double>) -
Method in class edu.berkeley.nlp.lm.collections.Counter.EntryValueComparator

compare(TIntMap<T>.Entry, TIntMap<T>.Entry) -
Method in class edu.berkeley.nlp.lm.collections.TIntMap.EntryValueComparator

compareLongsRaw(long, long) -
Static method in class edu.berkeley.nlp.lm.map.CompressedNgramMap

compareTo(LongToIntHashMap.E


ogramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density(_value * 1e3, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.KilopoundPerCubicFoot, DensityUnit.KilogramPerCubicMeter) => new Density((_value * 0.45359237 / 0.028316846592) * 1e3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.KilopoundPerCubicInch, DensityUnit.KilogramPerCubicMeter) => new Density((_value * 0.45359237 / 1.6387064e-5) * 1e3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.KilopoundPerCubicYard, DensityUnit.KilogramPerCubicMeter) => new Density((_value * 0.45359237 / 0.764554857984) * 1e3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MicrogramPerCubicMeter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e3) * 1e-6d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MicrogramPerDeciliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-1) * 1e-6d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MicrogramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1) * 1e-6d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MicrogramPerMilliliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-3) * 1e-6d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MilligramPerCubicMeter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e3) * 1e-3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MilligramPerDeciliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-1) * 1e-3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MilligramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1) * 1e-3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.MilligramPerMilliliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-3) * 1e-3d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.NanogramPerDeciliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-1) * 1e-9d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.NanogramPerLiter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1) * 1e-9d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.NanogramPerMilliliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-3) * 1e-9d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit.PicogramPerDeciliter, DensityUnit.KilogramPerCubicMeter) => new Density((_value / 1e-1) * 1e-12d, DensityUnit.KilogramPerCubicMeter),
                (DensityUnit


from __future__ import division, print_function
import numpy as np
from matplotlib import pyplot as plt
import abel

from abel.tools.polynomial import ApproxGaussian, PiecewisePolynomial

r = np.arange(201)
r0 = 100
sigma = 20
# actual Gaussian function
gauss = np.exp(-((r - r0) / sigma)**2 / 2)
# approximation with default tolerance (~0.5%)
ranges = ApproxGaussian().scaled(1, r0, sigma)
approx = PiecewisePolynomial(r, ranges)
nodes = [rng[0] for rng in ranges] + [ranges[-1][1]]
# much more accurate approximation as a reference
ref = PiecewisePolynomial(r, ApproxGaussian(1e-5).scaled(1, r0, sigma))

def plot(title, f, g, lim):
    plt.figure(figsize=(6, 4), frameon=False, dpi=200)

    plt.subplot(3, 1, (1, 2))
    plt.title(title)
    for R in nodes:
        plt.axvline(R, lw=0.5, c='lightgray')
    plt.axhline(lw=0.5, c='k')
    plt.plot(r, g, label='Gaussian')
    plt.plot(r, f, '--', label='approx.')
    plt.autoscale(axis='x', tight=True)
    plt.ylabel('Value')
    plt.legend()

    plt.subplot(3, 1, 3)
    for R in nodes:
        plt.axvline(R, lw=0.5, c='lightgray')
    plt.axhline(lw=0.5, c='k')
    plt.plot(r, f - g, c='brown')
    plt.autoscale(axis='x', tight=True)
    plt.xlabel('Radius, px')
    plt.ylim(-lim, lim)
    plt.ylabel('Difference')

    plt.tight_layout(pad=0)
    plt.show()

if __name__ == '__main__':
    M = ref.func.max()
    D = (approx.func - gauss).max()
    print('max func =', M)
    print('max diff =', D)
    print('rel diff =', D / M * 100, '%')
    plot('func', approx.func, gauss, 0.005)

    M = ref.abel.max()
    D = (approx.abel - ref.abel).max()
    print('max abel =', M)
    print('max diff =', D)
    print('rel diff =', D / M * 100, '%')
    plot('abel', approx.abel, ref.abel, 0.35)


return solution_dict[mult_pair]

# Tests
my_dict = {}
print(test_multiplication(0, 0, my_dict, 0))
print(test_multiplication(1, 0, my_dict, 0))
print(test_multiplication(5, 7, my_dict, 35))
print(test_multiplication(7, 7, my_dict, 49))
```

### Additional material
The runnable [Python file](exercise_1.py) is available online.History of SeaBIOS releases. Please see [download](Download) for
information on obtaining these releases.

SeaBIOS 1.8.0
=============

Available on 20150218. Major changes in this release:

* Several USB timing fixes for USB controllers on real hardware
* Initial support for USB3 hubs
* Initial support for SD cards (on QEMU only)
* Initial support for transitioning to 32bit mode using SMIs (on QEMU
  TCG only)
* SeaVGABIOS improvements
    * Added cursor emulation to coreboot native init vgabios (cbvga)
    * Added support for read character calls when in graphics mode
* Developer documentation added to "docs/" directory in the code
  repository and several documentation updates
* Several bug fixes and code cleanups

As of the 1.8.0 release, new feature releases will modify the first
two release numbers (eg, 1.8) and stable releases will use three
numbers (eg, 1.8.1). The prior behavior of using a forth number
(eg, 1.7.5.1) for stable releases will no longer be used.

SeaBIOS 1.7.5
=============

Available on 20140528. Major changes in this release:

* Support for obtaining SMBIOS tables directly from QEMU.
* XHCI USB controller fixes for real hardware (now tested on several
  boards)
* SeaVGABIOS improvements
    * New driver for "coreboot native vga" support
    * Improved detection of older x86emu versions with incorrect
      emulation.
* Several bug fixes and code cleanups

SeaBIOS 1.7.5.1
---------------

Available on 20141113. Stable release containing only bug fixes.

SeaBIOS 1.7.5.2
---------------

Available on 20150112. Stable release containing only bug fixes.

SeaBIOS 1.7.4
=============

Available on 20131223. Major changes in this release:

* Support for obtaining ACPI tables directly from QEMU.
* Initial support for XHCI USB controllers (initially for QEMU only).
* Support for booting from "pvscsi" devices on QEMU.
* Enhanced floppy driver - improved support for real hardware.
* coreboot cbmem console support.
* Optional support for using the 9-segment instead of the e-segment
  for local variables.
* Improved internal timer code and accuracy.
* SeaVGABIOS improvements
    * Better support for legacy X.org releases with incomplete x86emu
      emulation.
    * Support for using an internal stack to reduce caller's stack
      usage.
    * Back port of new "bochs dispi" interface video modes.
* Several bug fixes and code cleanups
    * Source code separated out into additional hardware and firmware
      directories.
    * Update to latest version of Kconfig

SeaBIOS 1.7.3
=============

Available on 20130707. Major changes in this release:

* Initial support for using SeaBIOS as a UEFI Compatibility Support
  Module (CSM)
* Support for detecting and using ACPI reboot ports.
* By default, all 16bit entry points now use an internal stack to
  reduce stack footprint.
* Floppy controller code has been rewritten to improve
  compatibility. Non-standard floppy sizes now work again with recent
  QEMU versions.
* Several bug fixes and code cleanups

SeaBIOS 1.7.2
=============

Available on 20130118. Major changes in this release:

* Support for ICH9 host chipset ("q35") on emulators
* Support for booting from LSI MegaRAID SAS controllers
* Support for using the ACPI PM timer on emulators
* Improved Geode VGA BIOS support.
* Several bug fixes

SeaBIOS 1.7.2


me: r'id',
      type: IsarType.long,
    ),
    r'isDefault': PropertySchema(
      id: 2,
      name: r'isDefault',
      type: IsarType.bool,
    ),
    r'name': PropertySchema(
      id: 3,
      name: r'name',
      type: IsarType.string,
    )
  },
  estimateSize: _cNotificationCategoryEstimateSize,
  serialize: _cNotificationCategorySerialize,
  deserialize: _cNotificationCategoryDeserialize,
  deserializeProp: _cNotificationCategoryDeserializeProp,
);

int _cNotificationCategoryEstimateSize(
  CNotificationCategory object,
  List<int> offsets,
  Map<Type, List<int>> allOffsets,
) {
  var bytesCount = offsets.last;
  bytesCount += 3 + object.customType.length * 3;
  bytesCount += 3 + object.name.length * 3;
  return bytesCount;
}

void _cNotificationCategorySerialize(
  CNotificationCategory object,
  IsarWriter writer,
  List<int> offsets,
  Map<Type, List<int>> allOffsets,
) {
  writer.writeString(offsets[0], object.customType);
  writer.writeLong(offsets[1], object.id);
  writer.writeBool(offsets[2], object.isDefault);
  writer.writeString(offsets[3], object.name);
}

CNotificationCategory _cNotificationCategoryDeserialize(
  Id id,
  IsarReader reader,
  List<int> offsets,
  Map<Type, List<int>> allOffsets,
) {
  final object = CNotificationCategory();
  object.customType = reader.readString(offsets[0]);
  object.id = reader.readLong(offsets[1]);
  object.isDefault = reader.readBool(offsets[2]);
  object.name = reader.readString(offsets[3]);
  return object;
}

P _cNotificationCategoryDeserializeProp<P>(
  IsarReader reader,
  int propertyId,
  int offset,
  Map<Type, List<int>> allOffsets,
) {
  switch (propertyId) {
    case 0:
      return (reader.readString(offset)) as P;
    case 1:
      return (reader.readLong(offset)) as P;
    case 2:
      return (reader.readBool(offset)) as P;
    case 3:
      return (reader.readString(offset)) as P;
    default:
      throw IsarError('Unknown property with id $propertyId');
  }
}

extension CNotificationCategoryQueryFilter on QueryBuilder<
    CNotificationCategory, CNotificationCategory, QFilterCondition> {
  QueryBuilder<CNotificationCategory, CNotificationCategory,
      QAfterFilterCondition> customTypeEqualTo(
    String value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(FilterCondition.equalTo(
        property: r'customType',
        value: value,
        caseSensitive: caseSensitive,
      ));
    });
  }

  QueryBuilder<CNotificationCategory, CNotificationCategory,
      QAfterFilterCondition> customTypeGreaterThan(
    String value, {
    bool include = false,
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(FilterCondition.greaterThan(
        include: include,
        property: r'customType',
        value: value,
        caseSensitive: caseSensitive,
      ));
    });
  }

  QueryBuilder<CNotificationCategory, CNotificationCategory,
      QAfterFilterCondition> customTypeLessThan(
    String value, {
    bool include = false,
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(FilterCondition.lessThan(
        include: include,
        property: r'customType',
        value: value,
        caseSensitive: caseSensitive,
      ));
    });
  }

  QueryBuilder<


 {embedding[:3]}")

        # Check embeddings are different
        if len(embeddings) >= 3:
            # Similar topics should be more similar than different topics
            ml_web_sim = cosine_similarity(embeddings[0], embeddings[1])  # ML vs Web
            ml_cooking_sim = cosine_similarity(embeddings[0], embeddings[2])  # ML vs Cooking

            print(f"   📊 ML vs Web similarity: {ml_web_sim:.3f}")
            print(f"   📊 ML vs Cooking similarity: {ml_cooking_sim:.3f}")

            semantic_differentiation = ml_web_sim > ml_cooking_sim
            print(f"   📊 Semantic differentiation: {'✅' if semantic_differentiation else '⚠'}")

        # FINAL VERDICT
        print("\n🏆 FINAL PROOF RESULTS")
        print("="*50)

        overall_success = (
            verbatim_rate >= 0.8 and      # 80%+ verbatim storage
            semantic_rate >= 0.5 and      # 50%+ semantic search
            len(realistic_interactions) >= 4  # Sufficient test data
        )

        if overall_success:
            print("🎉 ✅ PROOF SUCCESSFUL!")
            print(f"   • Verbatim storage: {verbatim_rate:.1%} ✅")
            print(f"   • Semantic search: {semantic_rate:.1%} ✅")
            print(f"   • Real embeddings: ✅")
            print(f"   • Dual storage system: ✅")
            print(f"   • Production ready: ✅")
        else:
            print("⚠ Proof incomplete - needs improvement")
            print(f"   • Verbatim storage: {verbatim_rate:.1%}")
            print(f"   • Semantic search: {semantic_rate:.1%}")

        # Assert instead of returning
        assert overall_success, f"Proof incomplete - verbatim: {verbatim_rate:.1%}, semantic: {semantic_rate:.1%}"

    except Exception as e:
        print(f"❌ Test failed: {e}")
        import traceback
        traceback.print_exc()
        # Re-raise the exception to fail the test properly
        raise

    finally:
        shutil.rmtree(temp_dir)

def cosine_similarity(vec1, vec2):
    """Calculate cosine similarity"""
    import math

    dot_product = sum(a * b for a, b in zip(vec1, vec2))
    magnitude1 = math.sqrt(sum(a * a for a in vec1))
    magnitude2 = math.sqrt(sum(b * b for b in vec2))

    if magnitude1 == 0 or magnitude2 == 0:
        return 0.0

    return dot_product / (magnitude1 * magnitude2)

if __name__ == "__main__":
    if ABSTRACTCORE_AVAILABLE:
        success = test_verbatim_plus_embeddings_proof()

        if success:
            print("\n🎯 CONCLUSION: VERBATIM + EMBEDDINGS FULLY PROVEN!")
            print("Ready for production with:")
            print("• Exact verbatim interaction storage")
            print("• Real semantic embeddings")
            print("• Functional semantic search")
            print("• Dual storage architecture")
        else:
            print("\n❌ Proof failed - system needs fixes")
    else:
        print("❌ AbstractCore not available")


;;; ============================================================
;;; Detect The Cricket! attached to SSC in slot 2
;;;
;;; Inputs: $06 points at $Cs00
;;; Outputs: C=1 if detected, C=0 otherwise
;;; Assert: Interrupts disabled
;;; ============================================================

.proc DetectTheCricket
        ptr := $06

        ;; Look for SSC
        ldx     #kSigSize-1
    DO
        ldy     sig_offset,x
        lda     (ptr),y
        cmp     sig_value,x
        bne     not_found
        dex
    WHILE_POS

        ;; Change ptr from $Cs00 to $C0s0
        lda     ptr+1
        pha
        and     #$F0
        sta     ptr+1
        pla                     ; A = %1100ssss
        asl                     ; A = $100ssss0
        asl                     ; A = $00ssss00
        asl                     ; A = $0ssss000
        asl                     ; A = $ssss0000
        sta     ptr

        TDREG   = $88           ; ACIA Transmit Register (write)
        RDREG   = $88           ; ACIA Receive Register (read)
        STATUS  = $89           ; ACIA Status/Reset Register
        COMMAND = $8A           ; ACIA Command Register
        CONTROL = $8B           ; ACIA Control Register

        ;; Save register states
        ldy     #COMMAND
        lda     (ptr),y
        sta     restore_command
        ldy     #CONTROL
        lda     (ptr),y
        sta     restore_control

        ;; Configure SSC
        ldy     #COMMAND
        lda     #%00001011      ; no parity/echo/interrupts, RTS low, DTR low
        sta     (ptr),y
        ldy     #CONTROL
        lda     #%10011110      ; 9600 baud, 8 data bits, 2 stop bits
        sta     (ptr),y

        ;; Send "Read Cricket ID", code 0
        lda     #0
        jsr     _SendByte
        bcs     not_found_with_restore ; timeout

        jsr     _ReadByte
        bcs     not_found_with_restore ; timeout
        cmp     #'C'|$80
        bne     not_found_with_restore

        jsr     _ReadByte
        bcs     not_found_with_restore ; timeout
        bcc     digit           ; always

:       jsr     _ReadByte
        bcs     not_found_with_restore ; timeout
        cmp     #CHAR_RETURN|$80
        beq     found
digit:  cmp     #'


>[107]。清末1900年八國聯軍攻城時曾有過較大破壞，其後歷任的中華民國北洋政府、國民政府等都對北京城池進行過拆改。中華人民共和國建都北京後，因為交通發展和修建地鐵的需要，北京城池自1958年起逐漸被市政府拆除、改造。目前，城池的核心——宮城（紫禁城）尚保存完整；皇城剩餘的有城門天安門一座、南皇城牆一段保留較完好，東皇城牆尚有一段明代殘餘；內城拆改嚴重，現存正陽門城樓與箭樓、德勝門箭樓、東南角樓以及崇文門一段殘餘城牆，西便門橋段也有一段城牆遺址；外城被完全拆除，只有位於中軸線最南端的永定門後被重建。對城池的拆除在1970年代後期停止，2000年後陸續開始復原部分城牆、城樓、箭樓等，現今的北京城牆已被環繞著的二环路取代。

現況

                    [编辑]

                    北京老城区（二环以内）的城市道路是棋盘式的格局，横平竖直。
                    东西方向的道路有长安街（从<a
                      href="/wiki/%E5%A4


  lsr x23, x19, ARM_TT_L2_SHIFT
    and x23, x23, #0x7ff
    add x23, x22, x23, lsl #0x3
    ldr x23, [x23]
    and x0, x23, ARM_TTE_TABLE_MASK
    ldr x22, [x27, PHYSTOKV]
    blr x22
    mov x22, x0
    lsr x23, x19, ARM_TT_L3_SHIFT
    and x23, x23, #0x7ff
    add x23, x22, x23, lsl #0x3
    /* X23 == pointer to PTE for this page */
    ldr x24, [x23]
    /* ~(ARM_PTE_PNXMASK | ARM_PTE_NXMASK) */
    mov x25, #0xff9fffffffffffff
    and x24, x24, x25
    str x24, [sp, NEW_PTE_SPACE]
    mov x0, x23
    bl _kvtophys
    mov x24, x0
    add x0, sp, NEW_PTE_SPACE
    bl _kvtophys
    mov x1, x24
    mov w2, #0x8
    ldr x23, [x27, BCOPY_PHYS]
    blr x23

Lnextpage:
    mov w22, #0x1
    add x19, x19, x22, lsl #0xe
    cmp x20, x19
    b.ne Lpteloop

    isb sy
    dsb sy
    tlbi vmalle1
    dsb sy
    isb sy

    str x22, [x27, XNUSPY_CTL_IS_RX]

Lhandoff:
    mov x7, x27
    ldp x0, x1, [sp, #(STACK-0x10)]
    ldp x2, x19, [sp, #(STACK-0x20)]
    ldp x20, x21, [sp, #(STACK-0x30)]
    ldp x22, x23, [sp, #(STACK-0x40)]
    ldp x24, x25, [sp, #(STACK-0x50)]
    ldp x26, x27, [sp, #(STACK-0x60)]
    ldp x29, x30, [sp, #(STACK-0x70)]
    add sp, sp, STACK
    ldr x7, [x7, XNUSPY_CTL_ENTRYPOINT]
    br x7
    /* Not reached */

/* All kvtophys calls were inlined on 14.x kernels :( */
_kvtophys:
    mrs x1, DAIF
    msr DAIFSet, #(DAIFSC_DEBUGF | DAIFSC_ASYNCF | DAIFSC_IRQF | DAIFSC_FIQF)
    at s1e1r, x0
    mrs x2, par_el1
    msr DAIF, x1
    tbnz x2, #0x0, 2f
    and x2, x2, #0xfffffffff000
    and x1, x0, #0x3fff
    orr x0, x2, x1

    b 1f

2:
    mov x0, xzr

1:
    ret

addrof_xnuspy_cache: .dword QWORD_PLACEHOLDER


able.iforeach(_propertyData.players, function(playerData, index)
					if index < 4 then
						logger:info('Winner { '..playerData.id..', '..index..' }')

						PlayerData.UpdateCash(playerData.id, Settings.property.rewards.top[index].cash)
						PlayerData.UpdateExperience(playerData.id, Settings.property.rewards.top[index].exp)
						PlayerData.GiveDrugBusinessSupply(playerData.id)
						PlayerData.UpdateEventsWon(playerData.id)

						table.insert(winners, playerData.id)
						pointCash = math.floor(Settings.property.rewards.top[index].cash / playerData.points)
						pointExp = math.floor(Settings.property.rewards.top[index].exp / playerData.points)
					else
						PlayerData.UpdateCash(playerData.id, playerData.points * pointCash)
						PlayerData.UpdateExperience(playerData.id, playerData.points * pointExp)
					end
				end)
			else
				logger:info('No winners')
			end

			_propertyData = nil
			TriggerClientEvent('lsv:finishHotProperty', -1, winners)

			EventScheduler.StopEvent()

			return
		end
	end
end)

AddEventHandler('lsv:onPlayerDied', function(_, position)
	local player = source
	if not _propertyData or not _propertyData.currentPlayer or _propertyData.currentPlayer ~= player then
		return
	end

	logger:info('Dropped { '..player..' }')

	_propertyData.currentPlayer = nil
	_propertyData.position = position

	TriggerClientEvent('lsv:hotPropertyDropped', -1, player, position)
end)

AddEventHandler('lsv:onPlayerKilled', function(killData)
	local player = source
	if not _propertyData or not _propertyData.currentPlayer or _propertyData.currentPlayer ~= player then
		return
	end

	logger:info('Dropped { '..player..' }')

	_propertyData.currentPlayer = nil
	_propertyData.position = killData.position

	TriggerClientEvent('lsv:hotPropertyDropped', -1, player, _propertyData.position)
end)

AddEventHandler('lsv:playerConnected', function(player)
	if not _propertyData then
		return
	end

	TriggerClientEvent('lsv:startHotProperty', player, _propertyData, _propertyData.eventStartTimer:elapsed())
end)

AddEventHandler('lsv:playerDropped', function(player)
	if not _propertyData then
		return
	end

	if PlayerData.GetCount() == 0 then
		_propertyData = nil
		EventScheduler.StopEvent()
		return
	end

	local playerIndex = getPlayerIndexById(player)
	if playerIndex then
		table.remove(_propertyData.players, playerIndex)
		table.sort(_propertyData.players, sortPlayersByTotalTime)
		TriggerClientEvent('lsv:updateHotPropertyPlayers', -1, _propertyData.players)
	end

	if _propertyData.currentPlayer == player then
		logger:info('Dropped { '..player..' }')

		_propertyData.currentPlayer = nil
		_propertyData.position = _propertyData.initialPosition

		TriggerClientEvent('lsv:hotPropertyDropped', -1, player, _propertyData.position)
	end
end)


message)

	/**
	 * Checks for Extreme Plus during Rise of the Beasts and if it appeared and the user enabled it in settings, start it.
	 *
	 * @return True if Extreme Plus was detected and successfully completed. False otherwise.
	 */
	fun checkROTBExtremePlus(): Boolean {
		if (game.configData.enableNightmare && game.imageUtils.confirmLocation("rotb_extreme_plus", tries = 3)) {
			MessageLog.printToLog("\n[ROTB] Detected Extreme+. Starting it now...", tag)

			MessageLog.printToLog("\n********************", tag)
			MessageLog.printToLog("********************", tag)
			MessageLog.printToLog("[ROTB] Rise of the Beasts Extreme+", tag)
			MessageLog.printToLog("[ROTB] Rise of the Beasts Extreme+ Summons: ${game.configData.nightmareSummons}", tag)
			MessageLog.printToLog("[ROTB] Rise of the Beasts Extreme+ Group Number: ${game.configData.nightmareGroupNumber}", tag)
			MessageLog.printToLog("[ROTB] Rise of the Beasts Extreme+ Party Number: ${game.configData.nightmarePartyNumber}", tag)
			MessageLog.printToLog("********************", tag)
			MessageLog.printToLog("\n********************", tag)

			// Tap the "Play Next" button to head to the Summon Selection screen.
			game.findAndClickButton("play_next")

			game.wait(1.0)

			// Once the bot is at the Summon Selection screen, select your Summon and Party and start the mission.
			if (game.imageUtils.confirmLocation("select_a_summon")) {
				game.selectSummon(optionalSummonList = game.configData.nightmareSummons)
				val startCheck: Boolean = game.selectPartyAndStartMission(
					optionalGroupNumber = game.configData.nightmareGroupNumber, optionalPartyNumber = game.configData.nightmarePartyNumber,
					bypassFirstRun = true
				)

				// Once preparations are completed, start Combat Mode.
				if (startCheck && game.combatMode.startCombatMode(optionalCombatScript = game.configData.nightmareCombatScript)) {
					game.collectLoot(isCompleted = false, isEventNightmare = true)
					return true
				}
			}
		} else if (!game.configData.enableNightmare && game.imageUtils.confirmLocation("rotb_extreme_plus", tries = 3)) {
			MessageLog.printToLog("\n[ROTB] Rise of the Beasts Extreme+ detected but user opted to not run it. Moving on...", tag)
			game.findAndClickButton("close")
		} else {
			MessageLog.printToLog("\n[ROTB] No Rise of the Beasts Extreme+ detected. Moving on...", tag)
		}

		return false
	}

	/**
	 * Navigates to the specified mission.
	 */
	private fun navigate() {
		// Go to the Home screen.
		game.goBackHome(confirmLocationCheck = true)

		MessageLog.printToLog("\n[ROTB] Now navigating to Rise of the Beasts...", tag)

		// Go to the first banner that is usually the current Event by tapping on the "Menu" button.
		game.findAndClickButton("home_menu")
		game.wait(2.0)

		if (SharedData.displayHeight == 1920) {
			MessageLog.printToLog("[ROTB] Screen too small. Moving the screen down in order to see all of the event banners.", tag)
			game.gestureUtils.swipe(100f, 1000f, 100f, 700f)
			game.wait(0.5)
		}

		var bannerLocations = game.imageUtils.findAll("event_banner")
		if (bannerLocations.size == 0) {
			bannerLocations = game.imageUtils.findAll("event_banner_blue")
		}

		if (game.c


des.
  // If n is a known invariant, set up directly ("clone" of n == n).
  // Otherwise, push n onto the stack for real cloning.
  void clone_visit(Node* n) {
    assert(_invariant.test(n->_idx), "must be invariant");
    if (_lpt->is_invariant(n)) { // known invariant
      _old_new.map(n->_idx, n);
    } else { // to be cloned
      assert(!n->is_CFG(), "should not see CFG here");
      _stack.push(n, n->in(0) == NULL ? 1 : 0);
    }
  }

  // Clone "n" and (possibly) all its inputs recursively
  void clone_nodes(Node* n, Node* ctrl) {
    clone_visit(n);
    while (_stack.is_nonempty()) {
      Node*  n = _stack.node();
      uint idx = _stack.index();
      if (idx == n->req()) { // all inputs processed, clone n!
        _stack.pop();
        // clone invariant node
        Node* n_cl = n->clone();
        _old_new.map(n->_idx, n_cl);
        _phase->register_new_node(n_cl, ctrl);
        for (uint i = 0; i < n->req(); i++) {
          Node* in = n_cl->in(i);
          if (in == NULL) continue;
          n_cl->set_req(i, _old_new[in->_idx]);
        }
      } else { // process next input
        _stack.set_index(idx + 1);
        Node* m = n->in(idx);
        if (m != NULL && !_clone_visited.test_set(m->_idx)) {
          clone_visit(m); // visit the input
        }
      }
    }
  }

 public:
  Invariance(Arena* area, IdealLoopTree* lpt) :
    _lpt(lpt), _phase(lpt->_phase),
    _visited(area), _invariant(area), _stack(area, 10 /* guess */),
    _clone_visited(area), _old_new(area)
  {
    Node* head = _lpt->_head;
    Node* entry = head->in(LoopNode::EntryControl);
    if (entry->outcnt() != 1) {
      // If a node is pinned between the predicates and the loop
      // entry, we won't be able to move any node in the loop that
      // depends on it above it in a predicate. Mark all those nodes
      // as non loop invariatnt.
      Unique_Node_List wq;
      wq.push(entry);
      for (uint next = 0; next < wq.size(); ++next) {
        Node *n = wq.at(next);
        for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
          Node* u = n->fast_out(i);
          if (!u->is_CFG()) {
            Node* c = _phase->get_ctrl(u);
            if (_lpt->is_member(_phase->get_loop(c)) || _phase->is_dominator(c, head)) {
              _visited.set(u->_idx);
              wq.push(u);
            }
          }
        }
      }
    }
  }

  // Map old to n for invariance computation and clone
  void map_ctrl(Node* old, Node* n) {
    assert(old->is_CFG() && n->is_CFG(), "must be");
    _old_new.map(old->_idx, n); // "clone" of old is n
    _invariant.set(old->_idx);  // old is invariant
    _clone_visited.set(old->_idx);
  }

  // Driver function to compute invariance
  bool is_invariant(Node* n) {
    if (!_visited.test_set(n->_idx))
      compute_invariance(n);
    return (_invariant.test(n->_idx) != 0);
  }

  // Driver function to clone invariant
  Node* clone(Node* n, Node* ctrl) {
    assert(ctrl->is_CFG(), "must be");
    assert(_invariant.test(n->_idx), "must be an invariant");
    if (!_clone_


lcomponent.ErrDataTypeIsNotSupported) {
				// Our component may not have been fully initialized yet. Wait a little
				// bit before trying again.
				time.Sleep(100 * time.Millisecond)
				continue
			}

			require.NoError(t, err)
			break
		}
	}()

	require.NoError(t, waitTracesTrigger.Wait(time.Second), "consumer did not get invoked")
}

type testEnvironment struct {
	t *testing.T

	Controller *componenttest.Controller
}

func newTestEnvironment(
	t *testing.T,
	fp otelprocessor.Traces,
	onTracesConsumer func(t otelconsumer.Traces),
) *testEnvironment {

	t.Helper()

	reg := component.Registration{
		Name:    "testcomponent",
		Args:    fakeProcessorArgs{},
		Exports: otelcol.ConsumerExports{},
		Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
			// Create a factory which always returns our instance of fakeProcessor
			// defined above.
			factory := otelprocessor.NewFactory(
				"testcomponent",
				func() otelcomponent.Config {
					res, err := fakeProcessorArgs{}.Convert()
					require.NoError(t, err)
					return res
				},
				otelprocessor.WithTraces(func(
					_ context.Context,
					_ otelprocessor.CreateSettings,
					_ otelcomponent.Config,
					t otelconsumer.Traces,
				) (otelprocessor.Traces, error) {

					onTracesConsumer(t)
					return fp, nil
				}, otelcomponent.StabilityLevelUndefined),
			)

			return processor.New(opts, factory, args.(processor.Arguments))
		},
	}

	return &testEnvironment{
		t:          t,
		Controller: componenttest.NewControllerFromReg(util.TestLogger(t), reg),
	}
}

func (te *testEnvironment) Start(args component.Arguments) {
	go func() {
		ctx := componenttest.TestContext(te.t)
		err := te.Controller.Run(ctx, args)
		require.NoError(te.t, err, "failed to run component")
	}()
}

type fakeProcessorArgs struct {
	Output *otelcol.ConsumerArguments
}

var _ processor.Arguments = fakeProcessorArgs{}

func (fa fakeProcessorArgs) Convert() (otelcomponent.Config, error) {
	return &struct{}{}, nil
}

func (fa fakeProcessorArgs) Extensions() map[otelcomponent.ID]otelextension.Extension {
	return nil
}

func (fa fakeProcessorArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component {
	return nil
}

func (fa fakeProcessorArgs) NextConsumers() *otelcol.ConsumerArguments {
	return fa.Output
}

type fakeProcessor struct {
	StartFunc         func(ctx context.Context, host otelcomponent.Host) error
	ShutdownFunc      func(ctx context.Context) error
	CapabilitiesFunc  func() otelconsumer.Capabilities
	ConsumeTracesFunc func(ctx context.Context, td ptrace.Traces) error
}

var _ otelprocessor.Traces = (*fakeProcessor)(nil)

func (fe *fakeProcessor) Start(ctx context.Context, host otelcomponent.Host) error {
	if fe.StartFunc != nil {
		return fe.StartFunc(ctx, host)
	}
	return nil
}

func (fe *fakeProcessor) Shutdown(ctx context.Context) error {
	if fe.ShutdownFunc != nil {
		return fe.ShutdownFunc(ctx)
	}
	return nil
}

func (fe *fakeProcessor) Capabilities() otelconsumer.Capabilities {
	if fe.CapabilitiesFunc != nil {
		return fe.CapabilitiesFunc()
	}
	return otelconsumer.Capabilities{}
}

func (fe *fake


m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_MoveBack);
			item.m_fMoveDistance = fDistance;
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}
void CSequenceCtler::MoveLeft(float fDistance)
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_MoveLeft);
			item.m_fMoveDistance = fDistance;
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}
void CSequenceCtler::MoveRight(float fDistance)
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_MoveRight);
			item.m_fMoveDistance = fDistance;
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}
void CSequenceCtler::Jump()
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_Jump);
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}
void CSequenceCtler::Goto(int nOffset)
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_Goto);
			item.m_nGotoOffset = nOffset;
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}
void CSequenceCtler::Goto(const string& sLable)
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			SequenceEntity::SequenceItem item(SequenceEntity::CMD_Goto);
			item.m_strParam = sLable;
			item.m_nGotoOffset = 0;
			m_pSequenceEntity->PushItem(item);
		}
	}
	else
	{
		// execute the command
	}
}

void CSequenceCtler::Lable(const string& sLable)
{
	if(m_bIsAddingKey)
	{
		// add command to sequence
		if(m_pSequenceEntity)
		{
			m_pSequenceEntity->AddLable(sLable);
		}
	}
	else
	{
		// execute the command
	}
}

void CSequenceCtler::SetEntity(SequenceEntity* e)
{
	m_pSequenceEntity = e;
	if(m_pSequenceEntity)
	{
		CopyEntityParamter(*e);
		if(m_nSequenceState == SEQ_EMPTY)
		{
			// if old sequence is empty, we will use the current biped's position as the initial position.
			CBipedObject* pBiped = GetBiped();
			if(pBiped != 0)
			{
				m_vStartPos = pBiped->GetPosition();
				m_fStartFacing = pBiped->GetFacing();
			}
		}
	}
}

void CSequenceCtler::BeginAddKeys()
{
	m_bIsAddingKey = true;
	if(m_nSequenceState ==


out = wibox.layout.stack,
})

awesome.connect_signal("vol::value", function(mut, vol)
	local prg = M.vol:get_children_by_id("prg")[1]
	if mut == 0 then
		M.vol_sli.handle_color = beautiful.pri
		prg.color = beautiful.pri
	else
		M.vol_sli.handle_color = beautiful.fg2
		prg.color = beautiful.fg2
	end
	M.vol_sli.value = vol
	prg.value = vol
end)

M.vol_sli:connect_signal("property::value", function(val)
	M.vol:get_children_by_id("prg")[1].value = val.value
	sig.set_vol(val.value)
end)

awesome.connect_signal("mic::value", function(mut, vol)
	if mut == 0 then
		M.mic_sli.handle_color = beautiful.pri
		M.mic:get_children_by_id("prg")[1].color = beautiful.pri
	else
		M.mic_sli.handle_color = beautiful.fg2
		M.mic:get_children_by_id("prg")[1].color = beautiful.fg2
	end
	M.mic_sli.value = vol
	M.mic:get_children_by_id("prg")[1].value = vol
end)

M.mic_sli:connect_signal("property::value", function(val)
	sig.set_mic(val.value)
	M.mic:get_children_by_id("prg")[1].value = val.value
end)

return M


r,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(640.wmax * 15.sr),
                border: Border.all(
                  color: isZhCn ? Color(0xff8438FF) : Colors.black26,
                  width: isZhCn ? 640.wmax * 1.4.sr : 640.wmax * 1.2.sr,
                ),
              ),
              padding: EdgeInsets.symmetric(
                horizontal: 640.wmax * 20.sr,
                vertical: 640.wmax * 20.sr,
              ),
              margin: EdgeInsets.only(bottom: 640.wmax * 25.sr),
              child: Text(
                'Chinese (zh-CN)'.tr,
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontSize: 640.wmax * 16.sr,
                  fontWeight: isZhCn ? FontWeight.w600 : FontWeight.w400,
                  color: isZhCn ? Color(0xff8438FF) : Color(0xff909399),
                  height: 1.0,
                ),
              ),
            ),
            onTap: () {
              if (!isZhCn) {
                localer(zhCn);
              }
            },
          ),
          GestureDetector(
            behavior: HitTestBehavior.opaque,
            child: Container(
              width: 640.wmax,
              height: 640.wmax * 64.sr,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(640.wmax * 15.sr),
                border: Border.all(
                  color: isEnUs ? Color(0xff8438FF) : Colors.black26,
                  width: isEnUs ? 640.wmax * 1.4.sr : 640.wmax * 1.2.sr,
                ),
              ),
              padding: EdgeInsets.symmetric(
                horizontal: 640.wmax * 20.sr,
                vertical: 640.wmax * 20.sr,
              ),
              margin: EdgeInsets.only(bottom: 640.wmax * 25.sr),
              child: Text(
                'English (en-US)'.tr,
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontSize: 640.wmax * 16.sr,
                  fontWeight: isEnUs ? FontWeight.w600 : FontWeight.w400,
                  color: isEnUs ? Color(0xff8438FF) : Color(0xff909399),
                  height: 1.0,
                ),
              ),
            ),
            onTap: () {
              if (!isEnUs) {
                localer(enUs);
              }
            },
          ),
        ],
      ),
    );
  }

  Widget buildSafeArea(BuildContext context) {
    final mediaPadding = controller.mediaPadding;
    final mediaBottom = mediaPadding.value.bottom;

    return SizedBox(
      width: 640.wmax,
      height: max(mediaBottom, 640.wmax * 30.sr),
    );
  }
}
/// 短剧模型
import '../constants/app_constants.dart';

class Drama {
  final int id;
  final String name;
  final String cover;
  final String updateTime;
  final int score;
  final String? description;
  final String? director;
  final String? cast;
  final String? genre;
  final String? releaseDate;
  final int? totalEpisodes;
  final int? categoryId;
  final bool? isFavorite;

  Drama({
    required this.id,
    required this.name,
    required this.cover,
    required this.updateTime,
    required this.score,
    this.description,
    this.director,
    this.cast,
    this.genre,
    this.releaseDate,
    this.totalEpisodes,
    this.categoryId,
    this.isFavorite,
  });


.data_directory);
    if !path.exists() {
        if let Err(e) = std::fs::create_dir_all(path) {
            error!("failed to create data directory: {}", e);
            return;
        }
    }

    let mut processor = BlockProcessor::new(index_store.clone(),
        config.processor_thread_count, config.processor_queue_length,
        config.data_directory.clone(), config.id.clone(),
        config.namenode_ip_address.clone(), config.namenode_port);
    info!("initialized block processor");

    // start BlockProcessor
    if let Err(e) = processor.start() {
        error!("failed to start block processor: {}", e);
        return;
    }

    // start transfer TcpListener
    let address = format!("{}:{}", config.ip_address, config.port);
    let listener_result = TcpListener::bind(&address);
    if let Err(e) = listener_result {
        error!("failed to open tcp listener on '{}': {}", address, e);
        return;
    }

    let listener = listener_result.unwrap();

    // initialize Server
    let mut server = Server::new(listener, config.socket_wait_ms);
    info!("initialized transfer server");

    // start server
    let handler = TransferStreamHandler::new(RwLock::new(processor));
    if let Err(e) =
            server.start(Arc::new(RwLock::new(Box::new(handler)))) {
        error!("failed to start transfer server: {}", e);
        return;
    }
    info!("started transfer server");

    // initialize NamenodeProtocol
    let mut namenode_protocol= NamenodeProtocol::new(config);
    info!("initialized namenode protocol");

    // start NamenodeProtocol
    let namenode_protocol_result = namenode_protocol.start();
    if let Err(e) = namenode_protocol_result {
        error!("failed to start namenode protocol: {}", e);
        return;
    }

    info!("started namenode protocol");

    // keep running indefinitely
    std::thread::park();
}

#[derive(Clone, Debug, StructOpt)]
pub struct Config {
    #[structopt(name="ID")]
    id: String,
    #[structopt(name="STORAGE_ID")]
    storage_id: String,
    #[structopt(name="DATA_DIR")]
    data_directory: String,
    #[structopt(short="i", long="ip_address", default_value="127.0.0.1")]
    ip_address: String,
    #[structopt(short="p", long="port", default_value="8020")]
    port: u32,
    #[structopt(short="w", long="socket_wait_ms", default_value="50")]
    socket_wait_ms: u64,
    #[structopt(short="a", long="namenode_ip_address", default_value="127.0.0.1")]
    namenode_ip_address: String,
    #[structopt(short="o", long="namenode_port", default_value="9000")]
    namenode_port: u16,
    #[structopt(short="c", long="processor_thread_count", default_value="4")]
    processor_thread_count: u8,
    #[structopt(short="q", long="processor_queue_length", default_value="32")]
    processor_queue_length: u8,
    #[structopt(short="b", long="block_report", default_value="5000")]
    block_report_ms: u64,
    #[structopt(short="h", long="heartbeat", default_value="2500")]
    heartbeat_ms: u64,
    #[structopt(short="r", long="index_report", default_value="10000")]
    index_report_ms: u64,
}
use std::io::Read;
use bgp_models::mrt::MrtRecord;

#[macro


pile group-by attribute"))),
		    )
	      	  )
		}
	        (None, Some(adj), None, None) => {
		  Ok(
	            Constructor::ForEach(
		      parse(&s.to_string()).expect("failed to compile select attribute"),
		      n.children().iter()
		        .map(|d| to_constructor(d.clone()).expect("failed to compile for-each content"))
		    	.collect(),
		      Some(Grouping::Adjacent(parse(&adj.to_string()).expect("failed to compile group-adjacent attribute"))),
		    )
	      	  )
		}
		// TODO: group-starting-with and group-ending-with
		_ => {
		  Result::Err(Error{kind: ErrorKind::NotImplemented, message: "invalid grouping attribute(s) specified".to_string()})
		}
	      }
	    }
	    None => {
	      return Result::Err(Error{kind: ErrorKind::TypeError, message: "missing select attribute".to_string()})
	    }
	  }
	}
	(Some(XSLTNS), "copy") => {
	  // TODO: handle select attribute
	  Ok(Constructor::Copy(vec![],
	    n.children().iter()
	      .map(|d| to_constructor(d.clone()).expect("failed to compile sequence constructor"))
	      .collect(),
	  ))
	}
	(Some(XSLTNS), u) => {
	  Ok(Constructor::NotImplemented(format!("unsupported XSL element \"{}\"", u)))
	}
	(_, a) => {
	  // TODO: Handle qualified element name
	  Ok(Constructor::LiteralElement(
	    QualifiedName::new(None, None, a.to_string()),
	    n.children().iter()
	      .map(|d| to_constructor(d.clone()).expect("failed to compile sequence constructor"))
	      .collect(),
	  ))
	}
      }
    }
    _ => {
      // TODO: literal elements, etc, pretty much everything in the XSLT spec
      Ok(Constructor::NotImplemented("other template content".to_string()))
    }
  }
}

/// Strip whitespace nodes from a XDM [Document].
/// See [XSLT 4.3](https://www.w3.org/TR/2017/REC-xslt-30-20170608/#stylesheet-stripping)
pub fn strip_whitespace(
  d: Rc<dyn Document>,
  cpi: bool, // strip comments and PIs?
  strip: Vec<NodeTest>,
  preserve: Vec<NodeTest>,
) {
  let c = d.children();
  if c.len() == 1 {
    strip_whitespace_node(
      c[0].clone(),
      cpi,
      strip,
      preserve,
      true
    );
  }
}

/// Strip whitespace nodes from a XDM [Document].
/// This function operates under the direction of the xsl:strip-space and xsl:preserve-space directives in a XSLT stylesheet.
pub fn strip_source_document(
  src: Rc<dyn Document>,
  style: Rc<dyn Document>
) {
  // Find strip-space element, if any, and use it to construct a vector of NodeTests.
  // Ditto for preserve-space.
  let ss: Vec<NodeTest> = style.get_root_element().unwrap()	// this should be the xsl:stylesheet element
    .children().iter()
    .filter(|e| match (e.node_type(), e.to_name().get_nsuri_ref(), e.to_name().get_localname().as_str()) {
      (NodeType::Element, Some(XSLTNS), "strip-space") => true,
      _ => false,
    })
    .fold(vec![], |mut s, e| {
      match e.get_attribute(&QualifiedName::new(None, None, "elements".to_string())) {
        Some(v) => {
	  v.to_string().split_whitespace()
	    .for_each(|t| {
	      s.push(NodeTest::from(t).expect("not a NodeTest"))
	    })
	}
	None => {}	// should return an error
      };
      s
    });
  let ps: Vec<NodeTest> = style.


  print("|--n--|----xn----|---|f(xn)|---|");

    while npn>tol and n<=nmax:

        if verb:
            print("|--%d--|%1.7f|%1.12f|" %(n,np.linalg.norm(xn),np.linalg.norm(Fn)));

        # Newton step (we could check whether Jn is close to singular here)
        pn = -lu_solve((lu, piv), Fn); #We use lu solve instead of pn = -np.linalg.solve(Jn,Fn);
        xn = xn + pn;
        npn = np.linalg.norm(pn); #size of Newton step

        n+=1;
        rn = np.vstack((rn,xn));
        Fn = f(xn);
        nf+=1;

    r=xn;

    if verb:
        if np.linalg.norm(Fn)>tol:
            print("Lazy Newton method failed to converge, n=%d, |F(xn)|=%1.1e\n" % (nmax,np.linalg.norm(Fn)));
        else:
            print("Lazy Newton method converged, n=%d, |F(xn)|=%1.1e\n" % (n,np.linalg.norm(Fn)));

    return (r,rn,nf,nJ);

def Big_Slack(f,Jf,x0,tol,nmax,verb=True):
  (r,rn,nf,nJ) = lazy_newton_method_nd(f,Jf,x0, 0.01, nmax, verb)
  (rfin,rnfin,nffin,nJfin) = newton_method_nd(f,Jf,r,tol,nmax,verb)
  print("\n ", rfin)
  return rfin,rnfin,nffin,nJfin

# Execute driver
driver()


in the picture at right.

![](images/Histogram_Equalization_Theory_1.jpg)

### How does it work?

-   Equalization implies *mapping* one distribution (the given histogram) to another distribution (a
    wider and more uniform distribution of intensity values) so the intensity values are spread
    over the whole range.
-   To accomplish the equalization effect, the remapping should be the *cumulative distribution
    function (cdf)* (more details, refer to *Learning OpenCV*). For the histogram \f$H(i)\f$, its
    *cumulative distribution* \f$H^{'}(i)\f$ is:

    \f[H^{'}(i) = \sum_{0 \le j < i} H(j)\f]

    To use this as a remapping function, we have to normalize \f$H^{'}(i)\f$ such that the maximum value
    is 255 ( or the maximum value for the intensity of the image ). From the example above, the
    cumulative function is:

    ![](images/Histogram_Equalization_Theory_2.jpg)

-   Finally, we use a simple remapping procedure to obtain the intensity values of the equalized
    image:

    \f[equalized( x, y ) = H^{'}( src(x,y) )\f]

Code
----

-   **What does this program do?**
    -   Loads an image
    -   Convert the original image to grayscale
    -   Equalize the Histogram by using the OpenCV function @ref cv::equalizeHist
    -   Display the source and equalized images in a window.

@add_toggle_cpp
-   **Downloadable code**: Click
    [here](https://github.com/opencv/opencv/tree/4.x/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp)

-   **Code at glance:**
    @include samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
@end_toggle

@add_toggle_java
-   **Downloadable code**: Click
    [here](https://github.com/opencv/opencv/tree/4.x/samples/java/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHistDemo.java)

-   **Code at glance:**
    @include samples/java/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHistDemo.java
@end_toggle

@add_toggle_python
-   **Downloadable code**: Click
    [here](https://github.com/opencv/opencv/tree/4.x/samples/python/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHist_Demo.py)

-   **Code at glance:**
    @include samples/python/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHist_Demo.py
@end_toggle

Explanation
-----------

-   Load the source image:

    @add_toggle_cpp
    @snippet samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp Load image
    @end_toggle

    @add_toggle_java
    @snippet samples/java/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHistDemo.java Load image
    @end_toggle

    @add_toggle_python
    @snippet samples/python/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHist_Demo.py Load image
    @end_toggle

-   Convert it to grayscale:

    @add_toggle_cpp
    @snippet samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp Convert to grayscale
    @end_toggle

    @add_toggle_java
    @snippet samples/java/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHistDemo.java Convert to grayscale
    @end_toggle

    @add_toggle_python
    @snippet samples/python/tutorial_code/Histograms_Matching/histogram_equalization/EqualizeHist_Demo.py Convert to


 788.48c0 101.801-82.519 184.32-184.32 184.32H235.52c-101.796 0-184.32-82.519-184.32-184.32V235.52c0-101.796 82.524-184.32 184.32-184.32h552.96c101.801 0 184.32 82.524 184.32 184.32v552.96z' fill='%23c14343' p-id='9152' data-darkreader-inline-fill='' style='--darkreader-inline-fill:%23c2020f;'%3E%3C/path%3E%3Cpath d='M643.61 316.61h-92.288v400.548h92.288c93.696 0 169.59-89.487 169.59-200.509 0-110.09-75.894-200.038-169.59-200.038zM412.652 593.95c0 102.13-82.924 185.053-185.053 185.053h-30.92v-61.845h30.92c67.933 0 123.208-55.28 123.208-123.207V255.242h61.84l0.005 338.709z' fill='%23FFFFFF' p-id='9153' data-darkreader-inline-fill='' style='--darkreader-inline-fill:%23181a1b;'%3E%3C/path%3E%3Cpath d='M643.61 778.998H489.482V255.242h154.133c127.426 0 230.953 117.12 230.953 261.878 0 144.758-103.056 261.878-230.958 261.878z' fill='%23FFFDFD' p-id='9154' data-darkreader-inline-fill='' style='--darkreader-inline-fill:%23340000;'%3E%3C/path%3E%3Cpath d='M654.121 708.915h-112.88V325.33h112.88c93.332 0 169.15 85.775 169.15 191.79 0 106.02-75.48 191.795-169.15 191.795z' fill='%23D81E06' p-id='9155' data-darkreader-inline-fill='' style='--darkreader-inline-fill:%23ad1805;'%3E%3C/path%3E%3C/svg%3E");
}

.external-link[href*="163.com"]::before{
    content: url("data:image/svg+xml,%3Csvg t='1631851601829' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='10100' data-darkreader-inline-fill='' width='16' height='16'%3E%3Cpath d='M514.443636 250.018909c-5.981091-6.190545-10.798545-6.353455-16.942545-0.232727-20.200727 20.596364-40.401455 40.96-60.928 61.160727-5.981091 5.981091-5.818182 10.24 0.162909 15.941818 20.596364 20.247273 40.564364 40.773818 60.928 61.207273 2.164364 2.094545 5.003636 3.630545 7.959273 5.911273 3.025455-2.094545 5.911273-3.397818 8.029091-5.585455 20.363636-20.340364 40.564364-40.727273 61.160727-60.904727 6.144-5.981091 6.144-10.984727 0-16.965818a10073.553455 10073.553455 0 0 1-60.369455


点云进行零样本3D纹理网格重建》|Qiao Yu, Xianzhi Li, Yuan Tang, Xu Han, Jinfeng Xu, Long Hu, Min Chen|<http://arxiv.org/pdf/2406.15811v3>|[代码](https://github.com/YuQiao0303/PointDreamer.); PointDreamer通过创新的2D扩散模型和Non-Border-First策略，实现了从点云到...|
|📝 更新|Cut2Next: Generating Next Shot via In-Context Tuning|Cut2Next：通过上下文调整生成下一帧图像|Jingwen He, Hongbo Liu, Jiajun Li, Ziqi Huang, Yu Qiao, Wanli Ouyang, Ziwei Liu|<http://arxiv.org/pdf/2508.08244v2>|提出了一种基于Diffusion Transformer的Cut2Next框架，通过 Hierarc...|
|🆕 发布|Preview WB-DH: Towards Whole Body Digital Human Bench for the Generation of Whole-body Talking Avatar Videos|面向全身数字人类基准的预览WB-DH：生成全身对话头像视频的方法|Chaoyi Wang, Yifan Yang, Jun Pei, Lijie Xia, Jianpo Liu, Xiaobing Yuan, Xinhan Di|<http://arxiv.org/pdf/2508.08891v1>|[代码](https://github.com/deepreasonings/WholeBodyBenchmark.); 提出了WB-DH全身体数字人基准数据集，用于评估全身动画化虚拟人像生成。|
|🆕 发布|Identity-Preserving Aging and De-Aging of Faces in the StyleGAN Latent Space|保持身份特征的面部老化与逆老化：在StyleGAN潜在空间中的研究|Luis S. Luevano, Pavel Korshunov, Sebastien Marcel|<http://arxiv.org/pdf/2508.08808v1>|提出了一种在StyleGAN2潜空间中通过简单向量模型编辑实现身份保持的 faces Aging 和...|
|🆕 发布|DiffPose-Animal: A Language-Conditioned Diffusion Framework for Animal Pose Estimation|动物姿态估计的语言条件扩散框架：DiffPose-Animal|Tianyu Xiong, Dayi Tan, Wei Tian|<http://arxiv.org/pdf/2508.08783v1>|提出了一种基于扩散模型和大型语言模型的动物姿态估计方法，有效应对物种多样性及数据不足挑战。|
|📝 更新|Style transfer between Microscopy and Magnetic Resonance Imaging via Generative Adversarial Network in small sample size settings|通过小样本设置下的生成对抗网络实现显微镜图像与磁共振成像之间的风格迁移|Monika Pytlarz, Adrian Onicas, Alessandro Crimi|<http://arxiv.org/pdf/2310.10414v3>|首次利用条件生成对抗网络实现脑部MRI到显微组织图像的跨模态转换，无需活检即可进行病理分析。|
|📝 更新|Omni-Effects: Unified and Spatially-Controllable Visual Effects Generation|全方位效应：统一且空间可控的视觉效果生成|Fangyuan


t {

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            println(IsPalindromeInt().isPalindrome(121))
            println(IsPalindromeInt().isPalindrome(-121))
            println(IsPalindromeInt().isPalindrome(10))
        }
    }

    /**
     * O(logn)
     * O(1)
     */
    fun isPalindrome(x: Int): Boolean {
        if (x < 0 || (x % 10 == 0 && x != 0)) return false

        var reverseInt = 0
        var temp = x

        while (temp > reverseInt) {
            reverseInt = reverseInt * 10 + temp % 10
            temp /= 10
        }

        return temp == reverseInt || temp == reverseInt / 10
    }

}package com.idisfkj.awesome.following.vm

import android.os.Bundle
import androidx.lifecycle.viewModelScope
import com.idisfkj.awesome.basic.BaseVM
import com.idisfkj.awesome.common.extensions.RequestCallback
import com.idisfkj.awesome.common.live.SingleLiveEvent
import com.idisfkj.awesome.common.model.FollowersModel
import com.idisfkj.awesome.common.model.ResponseError
import com.idisfkj.awesome.common.model.ResponseSuccess
import com.idisfkj.awesome.following.adapter.FollowingAdapter
import com.idisfkj.awesome.following.repository.FollowingRepository
import com.idisfkj.awesome.network.HttpClient

/**
 * Created by idisfkj on 2019-11-26.
 * Email: idisfkj@gmail.com.
 */
class FollowingVM : BaseVM() {

    private val repository = FollowingRepository(HttpClient.getService(), viewModelScope)
    val adapter = FollowingAdapter()
    val isRefreshing = SingleLiveEvent<Boolean>()

    override fun attach(savedInstanceState: Bundle?) {
        getFollowers(false)
    }

    private fun getFollowers(refresh: Boolean) {
        if (!refresh) showLoading.value = true
        repository.getFollowing(object : RequestCallback<List<FollowersModel>> {
            override fun onSuccess(result: ResponseSuccess<List<FollowersModel>>) {
                isRefreshing.value = false
                showLoading.value = false
                if (refresh) {
                    adapter.clear()
                    adapter.notifyDataSetChanged()
                }
                result.data?.let { adapter.addData(it) }
            }

            override fun onError(error: ResponseError) {
                showLoading.value = false
                isRefreshing.value = false
            }

        })
    }

    fun onRefreshListener() {
        isRefreshing.value = true
        getFollowers(true)
    }
}package com.daily.algothrim.leetcode.top150

import com.daily.algothrim.leetcode.ListNode

/**
 * 25. K 个一组翻转链表
 */

/*
给你链表的头节点 head ，每 k 个节点一组进行翻转，请你返回�