egio, "regio", 60, "l1-2", "l5-6");

		test.doSimStepUntil(600);
		test.debugFiles(collector, utils.getOutputDirectory() + "/congestedWithHeadway");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("cargo", 359, 2000, 0)
			.hasTrainState("regio", 485, 2000, 0);

	}

	@Test
	void testOpposite() {

		RailsimTestUtils.Holder test = getTestEngine("networkMicroBi.xml");

		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio1", 0, "l1-2", "l7-8");
		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "l8-7", "l2-1");

		test.doSimStepUntil(600);
		test.debugFiles(collector, utils.getOutputDirectory() + "/opposite");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("regio1", 293, 600, 0)
			.hasTrainState("regio2", 358, 1000, 0);

		test = getTestEngine("networkMicroBi.xml");

		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio1", 0, "l1-2", "l7-8");
		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "l8-7", "l2-1");

		test.doStateUpdatesUntil(600, 1);
		test.debugFiles(collector, utils.getOutputDirectory() + "/opposite_detailed");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("regio1", 293, 600, 0)
			.hasTrainState("regio2", 358, 1000, 0);

	}

	@Test
	void testVaryingSpeedOne() {

		RailsimTestUtils.Holder test = getTestEngine("networkMesoUni.xml");

		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 0, "t1_IN-t1_OUT", "t3_IN-t3_OUT");

		test.doSimStepUntil(10000);
		test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedOne");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("regio", 7599, 0, 2.7777777)
			.hasTrainState("regio", 7674, 200, 0);

		test = getTestEngine("networkMesoUni.xml");

		RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 0, "t1_IN-t1_OUT", "t3_IN-t3_OUT");

		test.doStateUpdatesUntil(10000, 1);
		test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedOne_detailed");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("regio", 7599, 0, 2.7777777)
			.hasTrainState("regio", 7674, 200, 0);

	}

	@Test
	void testVaryingSpeedMany() {

		RailsimTestUtils.Holder test = getTestEngine("networkMesoUni.xml");

		for (int i = 0; i < 10; i++) {
			RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio" + i, 60 * i, "t1_IN-t1_OUT", "t3_IN-t3_OUT");
		}

		test.doSimStepUntil(30000);
		test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedMany");

		RailsimTestUtils.assertThat(collector)
			.hasTrainState("regio0", 7599, 0, 2.7777777)
			.hasTrainState("regio0", 7674, 200, 0)
			.hasTrainState("regio1", 7734, 200, 0)
			.hasTrainState("regio9", 23107, 200, 0);

		test = getTestEngine("networkMesoUni.xml");

		for (int i


e device, VkSwapchainKHR swapchain,
    // uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t*
    // pImageIndex);
    pub unsafe fn acquire_next_image_khr(&self, swapchain: SwapchainKhrHandle, timeout: u64,
            semaphore: Option<SemaphoreHandle>, fence: Option<FenceHandle>) -> VdResult<u32> {
        let mut image_index = 0;
        let result = self.proc_addr_loader().khr_swapchain.vkAcquireNextImageKHR(
                self.handle().to_raw(), swapchain.to_raw(), timeout,
                semaphore.map(|s| s.to_raw()).unwrap_or(0),
                fence.map(|f| f.to_raw()).unwrap_or(0), &mut image_index);
        error::check(result, "vkAcquireNextImageKHR", image_index)
    }

    /// Queues an image for presentation.
    ///
    /// https://manned.org/vkQueuePresentKHR.3
    //
    // *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo);
    pub unsafe fn queue_present_khr<Q>(&self, queue: Q, present_info: &PresentInfoKhr)
            -> VdResult<()>
            where Q: Handle<Target=QueueHandle> {
        let result = self.proc_addr_loader().khr_swapchain.vkQueuePresentKHR(
            queue.handle().to_raw(), present_info.as_raw());
        error::check(result, "vkQueuePresentKHR", ())
    }

    /// Creates multiple swapchains that share presentable images.
    ///
    /// https://manned.org/vkCreateSharedSwapchainsKHR.3
    //
    // *PFN_vkCreateSharedSwapchainsKHR)(VkDevice device, uint32_t
    // swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const
    // VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains);
    pub unsafe fn create_shared_swapchains_khr(&self, create_infos: &[SwapchainCreateInfoKhr],
            allocator: Option<*const vks::VkAllocationCallbacks>)
            -> VdResult<SmallVec<[SwapchainKhrHandle; 4]>> {
        let allocator = allocator.unwrap_or(ptr::null());
        let mut swapchains = SmallVec::<[SwapchainKhrHandle; 4]>::new();
        swapchains.reserve_exact(create_infos.len());
        swapchains.set_len(create_infos.len());
        let result = self.proc_addr_loader().khr_display_swapchain.vkCreateSharedSwapchainsKHR(self.handle().to_raw(),
            create_infos.len() as u32, create_infos as *const _ as *const vks::VkSwapchainCreateInfoKHR,
            allocator, swapchains.as_mut_ptr() as *mut vks::VkSwapchainKHR);
        error::check(result, "vkCreateSharedSwapchainsKHR", swapchains)
    }

    ///
    ///
    ///
    //
    // *PFN_vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool,
    // VkCommandPoolTrimFlagsKHR flags);
    pub unsafe fn trim_command_pool_khr<P>(&self, _command_pool: P, _flags: CommandPoolTrimFlagsKhr)
             -> VdResult<()>
            where P: Handle<Target=CommandPoolHandle> {
        // self.proc_addr_loader().
        //     vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags);
        unimplemented!();
    }

    ///
    ///
    ///
    //
    // *PFN_vkGetMemoryWin32HandleK


= OpNode("emb1", "lookup_table")->AsIntermediate();
    auto* emb1_out = VarNode("emb1_out")
                         ->assert_is_op_output("lookup_table", "Out")
                         ->AsIntermediate();
    auto* eltwise01 =
        OpNode("eltwise01", "search_seq_arithmetic")->AsIntermediate();
    auto* eltwise01_out =
        VarNode("eltwise01_out")
            ->assert_is_op_output("search_seq_arithmetic", "Out")
            ->AsOutput();

    auto* att_2in1_w =
        VarNode("att_2in1_w")
            ->assert_is_op_input("__xpu__mmdnn_search_attention", "W")
            ->AsInput();
    auto* att_2in1_b =
        VarNode("att_2in1_b")
            ->assert_is_op_input("__xpu__mmdnn_search_attention", "b")
            ->AsInput();
    auto* att_2in1 =
        OpNode("att_2in1", "__xpu__mmdnn_search_attention")->AsIntermediate();
    auto* att_2in1_out =
        VarNode("att_2in1_out")
            ->assert_is_op_output("__xpu__mmdnn_search_attention", "Out")
            ->AsIntermediate();
    auto* seq_pool_2in1 =
        OpNode("seq_pool_2in1", "sequence_pool")->AsIntermediate();
    auto* seq_pool_2in1_out = VarNode("seq_pool_2in1_out")
                                  ->assert_is_op_output("sequence_pool", "Out")
                                  ->AsOutput();
    auto* seq_pool_2in1_max_idx =
        VarNode("seq_pool_2in1_max_idx")
            ->assert_is_op_output("sequence_pool", "MaxIndex")
            ->AsIntermediate();

    *input0 >> *emb0 >> *emb0_out >> *eltwise01 >> *eltwise01_out;
    *emb_tbl >> *emb0;
    *input1 >> *emb1 >> *emb1_out >> *eltwise01;
    *emb_tbl >> *emb1;

    *eltwise01_out >> *att_2in1 >> *att_2in1_out >> *seq_pool_2in1 >>
        *seq_pool_2in1_out;
    *seq_pool_2in1 >> *seq_pool_2in1_max_idx;
    *att_2in1_w >> *att_2in1;
    *att_2in1_b >> *att_2in1;
  }

  void InsertNewNode(SSAGraph* graph, const key2nodes_t& matched) override {
    cpp::OpDesc op_desc;
    op_desc.SetType("__xpu__mmdnn_bid_emb_att");
    op_desc.SetInput("id0", {matched.at("input0")->arg()->name});
    op_desc.SetInput("id1", {matched.at("input1")->arg()->name});
    op_desc.SetInput("emb_tbl", {matched.at("emb_tbl")->arg()->name});
    op_desc.SetInput("att_fc_w", {matched.at("att_2in1_w")->arg()->name});
    op_desc.SetInput("att_fc_b", {matched.at("att_2in1_b")->arg()->name});
    op_desc.SetOutput("att_pool_out",
                      {matched.at("seq_pool_2in1_out")->arg()->name});
    op_desc.SetOutput("emb_fw_out", {matched.at("eltwise01_out")->arg()->name});

    auto* att_fc_op_info = matched.at("att_2in1")->stmt()->op_info();
    op_desc.SetAttr<float>("att_fc_w_max",
                           att_fc_op_info->GetAttr<float>("W_max"));

    auto* new_stmt = matched.at("emb0")->stmt();
    auto new_op = LiteOpRegistry::Global().Create(


;
}

export enum Event {
  GET_SONGS = 'get-songs',
  SEND_SONGS = 'send-songs',
  SELECT_SONG = 'select-song',
}
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { PresentationExchangeInputDescriptorModel } from '../../index';

/**
 * Class to model the presentation_definition as defined by Presentation Exchange.
 * See https://identity.foundation/presentation-exchange/#presentation-definition
 */
export class PresentationDefinitionModel {
 /**
   * Create an instance of PresentationDefinitionModel
   * @param PresentationExchangeInputDescriptorModel PresentationExchangeInputDescriptorModel instance
   */
  constructor (
    /**
     * The resource MUST contain this property, and its value MUST be an array of Input Descriptor objects.
     */
    public input_descriptors?: PresentationExchangeInputDescriptorModel[],

    /**
     * The resource MAY contain this property, and if present its value SHOULD be a human-friendly name that describes what the Presentation Definition pertains to.
     */
    public name?: string,
    /**
     * The resource MAY contain this property, and if present its value MUST be a string that describes the purpose for which the Presentation Definition’s inputs are being requested.
     */
    public purpose?: string) {
  }

  /**
   * Populate this object from a model
   * @param input model to populate object
   */
  public populateFrom(input: PresentationDefinitionModel): PresentationDefinitionModel {
    this.name = input.name;
    this.purpose = input.purpose;
    this.input_descriptors = [];
    const objectToPopulate = new PresentationExchangeInputDescriptorModel();
    for (let inx = 0; input.input_descriptors && inx < input.input_descriptors.length ; inx++ ) {
      const item: PresentationExchangeInputDescriptorModel = input.input_descriptors[inx];
      this.input_descriptors.push(objectToPopulate.populateFrom(item));
    }
    return this;
  }
}import {Encriptador} from "../Encriptador"

describe("ESC1", () => {
    it("Comprobacion password", () => {
        let cad = ""
        let encriptador = new Encriptador()
        let resEsperado = "c60580980424b7112df8d5b652b977f3"

        //flag encontrado
        let encontrado : boolean = false

        for (let i=48; i< 123; i++)
        {
            for (let j=48; j< 123; j++)
            {
                for (let k=48; k< 123; k++)
                {
                    for (let l=48; l< 123; l++)
                    {
                        cad += String.fromCharCode(i)
                        cad += String.fromCharCode(j)
                        cad += String.fromCharCode(k)
                        cad += String.fromCharCode(l)

                        let resObtenido = new String(encriptador.encrypt(cad))

                        //encontrado = resEsperado == resObtenido
                        if (resObtenido == resEsperado)
                        {
                            encontrado = true
                            break;
                        }else
                        {
                            cad = ""
                        }
                    }


_mix_f32 v0, v1, -abs(v2), v3
// GFX9: v_mad_mix_f32 v0, v1, -|v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x44]

v_mad_mix_f32 v0, v1, v2, -abs(v3)
// GFX9: v_mad_mix_f32 v0, v1, v2, -|v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x84]

v_mad_mixlo_f16 v0, abs(v1), -v2, abs(v3)
// GFX9: v_mad_mixlo_f16 v0, |v1|, -v2, |v3| ; encoding: [0x00,0x05,0xa1,0xd3,0x01,0x05,0x0e,0x44]

v_mad_mixhi_f16 v0, -v1, abs(v2), -abs(v3)
// GFX9: v_mad_mixhi_f16 v0, -v1, |v2|, -|v3| ; encoding: [0x00,0x06,0xa2,0xd3,0x01,0x05,0x0e,0xa4]

v_mad_mixlo_f16 v0, v1, v2, v3 clamp
// GFX9: v_mad_mixlo_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa1,0xd3,0x01,0x05,0x0e,0x04]

v_mad_mixhi_f16 v0, v1, v2, v3 clamp
// GFX9: v_mad_mixhi_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa2,0xd3,0x01,0x05,0x0e,0x04]

//
// op_sel with non-packed instructions
//

v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,0,0]
// GFX9: v_mad_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]

v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0]
// GFX9: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] ; encoding: [0x00,0x08,0xa0,0xd3,0x01,0x05,0x0e,0x04]

v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0]
// GFX9: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] ; encoding: [0x00,0x10,0xa0,0xd3,0x01,0x05,0x0e,0x04]

v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1]
// GFX9: v_mad


"""
@Brief:
    calc stats for a foldername/
    modified from official inception score implementation
    [bioinf-jku/TTUR](https://github.com/bioinf-jku/TTUR)
@Author: lzhbrian (https://lzhbrian.me)
@Date: 2019.4.7
@Usage:
    python precalc_stats_official_tf.py foldername/ output_path/
    python precalc_stats_official_tf.py /data4/linziheng/datasets/imagenet/valid_64x64/ imagenet_valid_stats_test.npz
"""

import sys
import os
from glob import glob
import numpy as np
import fid_official_tf
from scipy.misc import imread
import tensorflow as tf

########
# PATHS
########
# data_path = 'data' # set path to training set images
# output_path = 'fid_stats.npz' # path for where to store the statistics

data_path = sys.argv[1]
output_path = sys.argv[2]

# if you have downloaded and extracted
#   http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz
# set this path to the directory where the extracted files are, otherwise
# just set it to None and the script will later download the files for you

cur_dirname = os.path.dirname(os.path.abspath(__file__))
MODEL_DIR = '%s/res/' % cur_dirname

inception_path = '%s/' % MODEL_DIR
print("check for inception model..")
inception_path = fid_official_tf.check_or_download_inception(inception_path) # download inception if necessary
print("ok")

# loads all images into memory (this might require a lot of RAM!)
print("load images..")
image_list = []
for ext in ('*.png', '*.jpg', '*.jpeg', '.bmp'):
    image_list.extend(glob(os.path.join(data_path, ext)))

images = np.array([imread(str(fn)).astype(np.float32) for fn in image_list])
print("%d images found and loaded" % len(images))

print("create inception graph..")
fid_official_tf.create_inception_graph(inception_path)  # load the graph into the current TF graph
print("ok")

print("calculate FID stats..")
with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    mu, sigma = fid_official_tf.calculate_activation_statistics(images, sess, batch_size=100)
    np.savez_compressed(output_path, mu=mu, sigma=sigma)
print("finished")


SCENE_STATE = scenes.State.LEVEL1;
                }
            });

            this.Start();
        }

        // PUBLIC METHODS

        public Start(): void
        {
            let fontSize:string = "25px";
            let font:string = "Consolas";
            let fontColor:string = "Green";
            let isCentered:boolean = false;
            let xPos:number = 50;

            this.startLabel = [
                new objects.Label("Two possibilities exist:",               fontSize, font, fontColor, xPos, 125, isCentered),
                new objects.Label("  Either we are alone in the Universe,", fontSize, font, fontColor, xPos, 165, isCentered),
                new objects.Label("  or we are not.",                       fontSize, font, fontColor, xPos, 190, isCentered),
                new objects.Label("Both are equally terrifying.",           fontSize, font, fontColor, xPos, 230, isCentered),
                new objects.Label("  ― Arthur C. Clarke ",                  fontSize, font, fontColor, xPos, 270, isCentered)
            ];

            this.Main();
        }

        public Update(): void {
            this.startLabel.forEach(label => {
                label.alpha = this.quote_alpha;
            });
            this.quote_alpha += this.quote_delta;

            if (this.quote_alpha >= 1){
                this.quote_delta *= -1
            }
            // -10 used to allow for some delay on animation completion
            if (this.quote_alpha <= -0.25){
                // this.PauseSound("menu");
                // this.RewindSound("levels");
                config.Game.SCENE_STATE = scenes.State.LEVEL1;
            }

        }

        public Main(): void {

            // a hacky way to set the screen's background color
            this.addChild(new objects.Rectangle(0, 0, 640, 480, "#000"));

            this.startLabel.forEach(label => {
                this.addChild(label);
            });

        }

    }
}import { useEffect, useRef } from 'react'

const useOnceOn = (condition: boolean, callback: () => void) => {
  const hasRun = useRef(false)

  useEffect(() => {
    if (condition && !hasRun.current) {
      hasRun.current = true
      callback()
    }
  }, [condition, callback])
}

export default useOnceOn
/**
 * Per workspace (to avoid subtle differences and issues), we want to have a deterministic
 * location within the OS's tmp directory where we write log files for background processes
 * and where we create the actual unix socket/named pipe for the daemon.
 */
import { statSync, writeFileSync } from 'fs';
import { ensureDirSync, rmdirSync } from 'fs-extra';
import { join } from 'path';
import { projectGraphCacheDirectory } from '../utils/cache-directory';
import { createHash } from 'crypto';
import { tmpdir } from 'tmp';
import { workspaceRoot } from '../utils/workspace-root';

export const DAEMON_DIR_FOR_CURRENT_WORKSPACE = join(
  projectGraphCacheDirectory,
  'd'
);

export const DAEMON_OUTPUT_LOG_FILE = join(
  DAEMON_DIR_FOR_CURRENT_WORKSPACE,
  'daemon.log'
);

const socketDir = createSocketDir();

export const DAEMON_SOCKET_PATH = join(
  socketDir,
  // As per notes above on socket/named pipe length limitations, we keep this intentionally short
  'd.sock'
);

export function writeDaemonLogs(


for i := 1; i <= numCarpets; i++ {
		nf := make([]int, m)
		for j := carpetLen * i; j < m; j++ {
			nf[j] = min(nf[j-1]+int(floor[j]-'0'), f[j-carpetLen])
		}
		f = nf
	}
	return f[m-1]
}

func minimumWhiteTiles2(floor string, numCarpets, carpetLen int) int {
	m := len(floor)
	f := make([][]int, numCarpets+1)
	for i := range f {
		f[i] = make([]int, m)
	}
	// 单独计算 i=0 的情况，本质是 floor 的前缀和
	f[0][0] = int(floor[0] - '0')
	for j := 1; j < m; j++ {
		f[0][j] = f[0][j-1] + int(floor[j]-'0')
	}
	for i := 1; i <= numCarpets; i++ {
		for j := carpetLen * i; j < m; j++ {
			f[i][j] = min(f[i][j-1]+int(floor[j]-'0'), f[i-1][j-carpetLen])
		}
	}
	return f[numCarpets][m-1]
}

func minimumWhiteTiles1(floor string, numCarpets, carpetLen int) int {
	m := len(floor)
	memo := make([][]int, numCarpets+1)
	for i := range memo {
		memo[i] = make([]int, m)
		for j := range memo[i] {
			memo[i][j] = -1
		}
	}
	var dfs func(int, int) int
	dfs = func(i, j int) (res int) {
		if j < carpetLen*i {
			return
		}
		p := &memo[i][j]
		if *p != -1 {
			return *p
		}
		defer func() { *p = res }()
		res = dfs(i, j-1) + int(floor[j]-'0')
		if i > 0 {
			res = min(res, dfs(i-1, j-carpetLen))
		}
		return
	}
	return dfs(numCarpets, m-1)
}
package main

import "math/big"

// https://space.bilibili.com/206214
func maxWeight1(n int, edges [][]int, k int, t int) int {
	if n <= k {
		return -1
	}

	type edge struct{ to, wt int }
	g := make([][]edge, n)
	for _, e := range edges {
		x, y, wt := e[0], e[1], e[2]
		g[x] = append(g[x], edge{y, wt})
	}

	ans := -1
	type tuple struct{ x, i, s int }
	vis := map[tuple]bool{}
	var dfs func(int, int, int)
	dfs = func(x, i, s int) {
		if i == k {
			ans = max(ans, s)
			return
		}
		args := tuple{x, i, s}
		if vis[args] {
			return
		}
		vis[args] = true
		for _, e := range g[x] {
			if s+e.wt < t {
				dfs(e.to, i+1, s+e.wt)
			}
		}
	}
	for x := range n {
		dfs(x, 0, 0)
	}
	return ans
}

func maxWeight2(n int, edges [][]int, k int, t int) int {
	if n <= k {
		return -1
	}

	type edge


.theme-slider:hover .carousel-control-prev, .theme-slider:focus .carousel-control-next,
.theme-slider:focus .carousel-control-prev {
  color: #5e6e82;
  opacity: 0.5 !important;
}
.theme-slider .carousel-control-prev,
.theme-slider .carousel-control-next {
  width: 3rem;
  height: 3rem;
  background: #fff;
  border-radius: 50%;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  -webkit-box-shadow: -0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  box-shadow: -0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  -webkit-transition: opacity 0.4s ease-in-out;
  transition: opacity 0.4s ease-in-out;
  color: #5e6e82;
  opacity: 0;
}
.theme-slider .carousel-control-prev:hover, .theme-slider .carousel-control-prev:focus,
.theme-slider .carousel-control-next:hover,
.theme-slider .carousel-control-next:focus {
  opacity: 1 !important;
}
.theme-slider .carousel-control-prev {
  right: 0.5rem;
}
.theme-slider .carousel-control-next {
  left: 0.5rem;
}

/*-----------------------------------------------
|   Form
-----------------------------------------------*/
.form-check-label {
  line-height: 1.45rem;
}

.primary-form-check-input {
  background: #2c7be5;
}

/*-----------------------------------------------
|   Remove spinner from Input[type="number"]
-----------------------------------------------*/
.input-spin-none::-webkit-outer-spin-button,
.input-spin-none::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-spin-none[type=number] {
  -moz-appearance: textfield;
  /* Firefox */
}

/*-----------------------------------------------
|   Theme Checkbox
-----------------------------------------------*/
.form-check-input-primary {
  border-color: #2c7be5 !important;
}
.form-check-input-primary:focus {
  -webkit-box-shadow: 0 0 0 0.25rem rgba(44, 123, 229, 0.25);
  box-shadow: 0 0 0 0.25rem rgba(44, 123, 229, 0.25);
}
.form-check-input-primary:checked {
  background-color: #2c7be5 !important;
}
.form-check-input-primary.falcon-dual-switch {
  background-color: #2c7be5 !important;
}
.form-check-input.falcon-dual-switch {
  background-color: #2c7be5;
}
.form-check-input-secondary {
  border-color: #748194 !important;
}
.form-check-input-secondary:focus {
  -webkit-box-shadow: 0 0 0 0.25rem rgba(116, 129, 148, 0.25);
  box-shadow: 0 0 0 0.25rem rgba(116, 129, 148, 0.25);
}
.form-check-input-secondary:checked {
  background-color: #748194 !important;
}
.form-check-input-secondary.falcon-dual-switch {
  background-color: #748194 !important;
}
.form-check-input.falcon-dual-switch {
  background-co


essage": "未授權訪問",
                    "timestamp": "2024-12-20T10:30:00Z",
                }
            }
        },
    },
    403: {
        "description": "禁止訪問",
        "model": ErrorResponse,
        "content": {
            "application/json": {
                "example": {
                    "success": False,
                    "error_code": 403,
                    "message": "權限不足",
                    "timestamp": "2024-12-20T10:30:00Z",
                }
            }
        },
    },
    404: {
        "description": "資源不存在",
        "model": ErrorResponse,
        "content": {
            "application/json": {
                "example": {
                    "success": False,
                    "error_code": 404,
                    "message": "資源不存在",
                    "timestamp": "2024-12-20T10:30:00Z",
                }
            }
        },
    },
    422: {
        "description": "驗證錯誤",
        "model": ValidationErrorResponse,
        "content": {
            "application/json": {
                "example": {
                    "success": False,
                    "error_code": 422,
                    "message": "請求參數驗證失敗",
                    "validation_errors": [
                        {
                            "field": "email",
                            "message": "郵箱格式不正確",
                            "value": "invalid-email",
                        }
                    ],
                    "timestamp": "2024-12-20T10:30:00Z",
                }
            }
        },
    },
    500: {
        "description": "內部服務器錯誤",
        "model": ErrorResponse,
        "content": {
            "application/json": {
                "example": {
                    "success": False,
                    "error_code": 500,
                    "message": "內部服務器錯誤",
                    "timestamp": "2024-12-20T10:30:00Z",
                }
            }
        },
    },
}


#include <stdint.h> // for intptr_t
#include "pbc.h"
#include "pbc_test.h"

/* I've heard that sometimes automatic garbage collection can outperform
 * manual collection, so I briefly tried using the Boehm-Demers-Weiser GC
 * library. Both GMP and PBC support custom memory allocation routines so
 * incorporating the GC library is trivial.
 *
 * Automatic garbage collection appears to slow this program down a little,
 * even if only PBC collects automatically. (The case where PBC collects
 * manually but GMP collects automatically cannot be achieved with the GC
 * library because PBC objects point at GMP objects.)
 *
 * Perhaps specially-tailored memory allocation routines could shave off
 * some time, but one would have to thoroughly analyze PBC and GMP memory usage
 * patterns.
 *
 * Below is the commented-out code that collects garbage for PBC. Of course,
 * if you want to use it you must also tell the build system where to find
 * gc.h and to link with the GC library.
 *
 * Also, you may wish to write similar code for GMP (which I unfortunately
 * deleted before thinking that it might be useful for others).
 * Note GC_MALLOC_ATOMIC may be used for GMP since the mpz_t type does not
 * store pointers in the memory it allocates.
 *
 * The malloc and realloc functions should exit on failure but I didn't
 * bother since I was only seeing if GC could speed up this program.

#include <gc.h>
#include <pbc_utils.h>

void *gc_alloc(size_t size) {
  return GC_MALLOC(size);
}

void *gc_realloc(void *ptr, size_t size) {
  return GC_REALLOC(ptr, size);
}

void gc_free(void *ptr) {
  UNUSED_VAR(ptr);
}

 * The following should be the first two statements in main()

GC_INIT();
pbc_set_memory_functions(gc_alloc, gc_realloc, gc_free);

 */

int main(int argc, char **argv) {
  pairing_t pairing;
  element_t x, y, r, r2;
  int i, n;
  double t0, t1, ttotal, ttotalpp;
  pairing_pp_t pp;

  // Cheat for slightly faster times:
  // pbc_set_memory_functions(malloc, realloc, free);

  pbc_demo_pairing_init(pairing, argc, argv);

  element_init_G1(x, pairing);
  element_init_G2(y, pairing);
  element_init_GT(r, pairing);
  element_init_GT(r2, pairing);

  n = 10;
  ttotal = 0.0;
  ttotalpp = 0.0;
  for (i=0; i<n; i++) {
    element_random(x);
    element_random(y);

    pairing_pp_init(pp, x, pairing);
    t0 = pbc_get_time();
    pairing_pp_apply(r, y, pp);
    t1 = pbc_get_time();
    ttotalpp += t1 - t0;
    pairing_pp_clear(pp);

    t0 = pbc_get_time();

    element_pairing(r2, x, y);
    t1 = pbc_get_time();
    ttotal += t1 - t0;

    element_printf("x = %B\n", x);
    element_printf("y = %B\n", y);
    element_printf("e(x,y) = %B\n", r);
    if (element_cmp(r, r2)) {
      printf("BUG!\n");
      exit(1);
    }
  }
  printf("average pairing time = %f\n", ttotal / n);
  printf("average pairing time (preprocessed) = %f\n", ttotalpp / n);

  element_clear(x);
  element_clear(y);
  element_clear(r);
  element_clear(r2);

  pairing_clear(pairing);

  return 0;
}


*/  addu       $v1, $v1, $a1
/* 5C98860 8007BA98 1400C3A4 */  sh         $v1, 0x14($a2)
/* 5C98864 8007BA9C 0500C390 */  lbu        $v1, 0x5($a2)
/* 5C98868 8007BAA0 0800C590 */  lbu        $a1, 0x8($a2)
/* 5C9886C 8007BAA4 21104400 */  addu       $v0, $v0, $a0
/* 5C98870 8007BAA8 1600C2A4 */  sh         $v0, 0x16($a2)
/* 5C98874 8007BAAC 0E00C294 */  lhu        $v0, 0xE($a2)
/* 5C98878 8007BAB0 21186500 */  addu       $v1, $v1, $a1
/* 5C9887C 8007BAB4 0500C3A0 */  sb         $v1, 0x5($a2)
/* 5C98880 8007BAB8 0780043C */  lui        $a0, %hi(D_8007589C)
/* 5C98884 8007BABC 9C58848C */  lw         $a0, %lo(D_8007589C)($a0)
/* 5C98888 8007BAC0 01004224 */  addiu      $v0, $v0, 0x1
/* 5C9888C 8007BAC4 21200402 */  addu       $a0, $s0, $a0
/* 5C98890 8007BAC8 0E00C2A4 */  sh         $v0, 0xE($a2)
/* 5C98894 8007BACC 06008290 */  lbu        $v0, 0x6($a0)
/* 5C98898 8007BAD0 09008390 */  lbu        $v1, 0x9($a0)
/* 5C9889C 8007BAD4 00000000 */  nop
/* 5C988A0 8007BAD8 21104300 */  addu       $v0, $v0, $v1
/* 5C988A4 8007BADC 060082A0 */  sb         $v0, 0x6($a0)
/* 5C988A8 8007BAE0 0780043C */  lui        $a0, %hi(D_8007589C)
/* 5C988AC 8007BAE4 9C58848C */  lw         $a0, %lo(D_8007589C)($a0)
/* 5C988B0 8007BAE8 00000000 */  nop
/* 5C988B4 8007BAEC 21200402 */  addu       $a0, $s0, $a0
/* 5C988B8 8007BAF0 07008290 */  lbu        $v0, 0x7($a0)
/* 5C988BC 8007BAF4 0A008390 */  lbu        $v1, 0xA($a0)
/* 5C988C0 8007BAF8 00000000 */  nop
/* 5C988C4 8007BAFC 21104300 */  addu       $v0, $v0, $v1
/* 5C988C8 8007BB00 070082A0 */  sb         $v0, 0x7($a0)
/* 5C988CC 8007BB04 0780023C */  lui        $v0, %hi(D_8007589C)
/* 5C988D0 8007BB08 9C58428C */  lw         $v0, %lo(D_8007589C)($v0)
/* 5C988D4 8007BB0C 00000000 */  nop
/* 5C988D8 8007BB10 21180202 */  addu       $v1, $s0, $v0
/* 5C988DC 8007BB14 0E006284 */  lh         $v0, 0xE($v1)
/* 5C988E0 8007BB18 00000000 */  nop
/* 5C988E4 8007BB1C 15004228 */  slti       $v0, $v0, 0x15
/*


   b = c;
      }
      Comparable<T>? aValue = getField(a);
      Comparable<T>? bValue = getField(b);

      aValue ??= '' as Comparable<T>;
      bValue ??= '' as Comparable<T>;

      return Comparable.compare(aValue, bValue);
    });
    notifyListeners();
  }

  final int _selectedCount = 0;

  @override
  DataRow? getRow(int index) {
    assert(index >= 0);
    if (index >= listaEstoqueReajusteCabecalho!.length) return null;
    final EstoqueReajusteCabecalho estoqueReajusteCabecalho = listaEstoqueReajusteCabecalho![index];
    return DataRow.byIndex(
      index: index,
      cells: <DataCell>[
        DataCell(Text(estoqueReajusteCabecalho.id?.toString() ?? ''), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
        DataCell(Text(estoqueReajusteCabecalho.colaborador?.pessoa?.nome?.toString() ?? ''), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
        DataCell(Text(Biblioteca.formatarData(estoqueReajusteCabecalho.dataReajuste)), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
        DataCell(Text(Constantes.formatoDecimalTaxa.format(estoqueReajusteCabecalho.taxa ?? 0)), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
        DataCell(Text(estoqueReajusteCabecalho.tipoReajuste ?? ''), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
        DataCell(Text(estoqueReajusteCabecalho.justificativa ?? ''), onTap: () {
          _detalharEstoqueReajusteCabecalho(estoqueReajusteCabecalho, context);
        }),
      ],
    );
  }

  @override
  int get rowCount => listaEstoqueReajusteCabecalho!.length;

  @override
  bool get isRowCountApproximate => false;

  @override
  int get selectedRowCount => _selectedCount;
}

void _detalharEstoqueReajusteCabecalho(EstoqueReajusteCabecalho estoqueReajusteCabecalho, BuildContext context) {
  Navigator.of(context).push(MaterialPageRoute(
        builder: (BuildContext context) =>
        EstoqueFormacaoCabecalhoPage(estoqueReajusteCabecalho: estoqueReajusteCabecalho, title: 'Estoque Reajuste Cabecalho - Editando', operacao: 'A')));
}/*
Title: T2Ti ERP 3.0
Description: PersistePage relacionada à tabela [OS_STATUS]

The MIT License

Copyright: Copyright (C) 2021 T2Ti.COM

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge


�ה המתמחה בניהול פריסות (Deployments) מורכבות. מאפשרת לקדם שינויים בצורה מבוקרת בין סביבות (Dev → Test → Prod), עם תמיכה ב-GitOps. יתרונות: שקיפות בתהליכים, ניהול סביבות מרובות, שילוב עם Kubernetes. רלוונטיות: מסייעת לארגונים לשמור על שליטה ואוטומציה בפריסות בקנה מידה גדול.
Dagger
מנוע CI/CD פרוגרמטי שמאפשר להגדיר Pipelines באמצעות קוד בשפות פופולריות (Python, Go, Node.js). ה-Pipelines רצים בקונטיינרים, מה שמבטיח עקביות בין סביבות פיתוח, CI וייצור. יתרונות: ניידות מלאה, יכולת קומפוזיציה מודולרית של שלבי Build ו-Deploy. רלוונטיות: מתאים לצוותים המעוניינים ב-CI/CD כקוד מלא (Pipeline as Code).
Pulumi
פלטפורמת Infrastructure as Code (IaaC) המאפשרת לכתוב תשתיות בענן וב-Kubernetes באמצעות שפות תכנות אמיתיות כמו TypeScript, Python, Go. יתרונות: מודולריות, בדיקות יחידה לקוד תשתיתי, גמישות בהשוואה ל-Terraform. רלוונטיות: נותנת מענה לצוותי פיתוח שמעדיפים כתיבה בשפות תכנות ולא YAML בלבד.
Dapr
Distributed Application Runtime – רנטיים לבניית מיקרו-שירותים מודרניים. מגיע עם יכולות מובנות כמו pub/sub, שמירת state, ו-secrets management. יתרונות: מוריד מהמפתחים את המורכבות של בניית Distributed Systems. רלוונטיות: מתאים לכל ארגון שמפתח מערכות מבוזרות על Kubernetes.
Score
פרויקט קוד פתוח (CNCF Sandbox) לכתיבת הגדרות Workload אחידות. מאפשר למפתח לתאר דרישות אפליקציה בצורה מופשטת (פורט, תלות בדאטהבייס) ולתרגם אותן לכלי מימוש שונים (Docker Compose, Helm, Kubernetes). יתרונות: מפשט הגד


);
    vmlsl.u8        q1,     d7,     d29     @mul_res2 = vmlsl_u8(mul_res2,
                                            @ vreinterpret_u8_u32(src_tmp4), coeffabs_7);
    vdup.u32        d4,     d7[1]
    vadd.i16        q0,     q0,     q1      @mul_res1 = vaddq_u16(mul_res1,
                                            @ mul_res2);
    vmlsl.u8        q4,     d7,     d27
    vld1.u32        {d4[1]},[r3],   r2
    vmlal.u8        q4,     d4,     d28
    vdup.u32        d5,     d4[1]
    vhadd.s16       q0,     q0,     q15
    vqrshrun.s16    d0,     q0,     #6      @sto_res = vqmovun_s16(sto_res_tmp);
    vld1.u32        {d5[1]},[r3]
    add             r3,     r1,     r6
    vst1.32         {d0[0]},[r1]            @vst1_lane_u32((uint32_t *)pu1_dst,
                                            @ vreinterpret_u32_u8(sto_res), 0);
    v


adius: 5px;
  height: 2.532rem; }
  .sg-btn-large.sg-btn-square, .sg-btn-large.sg-btn-circle, .sg-btn-large.sg-btn.sg-btn-icon {
    padding: 0;
    width: 2.532rem;
    line-height: 2.532rem; }
  .sg-btn-large.sg-btn-circle {
    border-radius: 100%; }

.sg-btn-small {
  padding: calc(0.4rem - 1px) 0.8rem;
  font-size: 0.866rem;
  border-radius: 3px;
  height: 1.666rem; }
  .sg-btn-small.sg-btn-square, .sg-btn-small.sg-btn-circle, .sg-btn-small.sg-btn.sg-btn-icon {
    padding: 0;
    width: 1.666rem;
    line-height: 1.666rem; }
  .sg-btn-small.sg-btn-circle {
    border-radius: 100%; }

.sg-btn-xsmall {
  padding: calc(0.2rem - 1px) 0.533rem;
  font-size: 0.8rem;
  border-radius: 2px;
  height: 1.2rem; }
  .sg-btn-xsmall.sg-btn-square, .sg-btn-xsmall.sg-btn-circle, .sg-btn-xsmall.sg-btn.sg-btn-icon {
    padding: 0;
    width: 1.2rem;
    line-height: 1.2rem; }
  .sg-btn-xsmall.sg-btn-circle {
    border-radius: 100%; }

.sg-btn-facebook {
  color: #3b5998;
  border: 1px solid #C3D1EB;
  background-color: #F7F9FD; }
  .sg-btn-facebook:hover, .sg-btn-facebook:active {
    color: #FFFFFF;
    border-color: #3b5998;
    background-color: #3b5998;
    text-decoration: none; }
  .sg-btn-facebook:active {
    color: #FFFFFF;
    border-color: #2d4373;
    background-color: #2d4373; }
  .sg-btn-facebook.sg-state--active {
    color: #FFFFFF;
    border-color: #2d4373;
    background-color: #2d4373; }
  .sg-btn-facebook.sg-state--disable {
    color: #879fd0;
    border-color: #e9eef8;
    background-color: #F7F9FD;
    cursor: inherit; }
    .sg-btn-facebook.sg-state--disable:hover, .sg-btn-facebook.sg-state--disable:active {
      color: #879fd0;
      border-color: #e9eef8;
      background-color: #F7F9FD;
      cursor: inherit; }

.sg-btn-twitter {
  color: #00b6f1;
  border: 1px solid #C3D1EB;
  background-color: #F7F9FD; }
  .sg-btn-twitter:hover, .sg-btn-twitter:active {
    color: #FFFFFF;
    border-color: #00b6f1;
    background-color: #00b6f1;
    text-decoration: none; }
  .sg-btn-twitter:active {
    color: #FFFFFF;
    border-color: #008fbe;
    background-color: #008fbe; }
  .sg-btn-twitter.sg-state--active {
    color: #FFFFFF;
    border-color: #008fbe;
    background-color: #008fbe; }
  .sg-btn-twitter.sg-state--disable {
    color: #77deff;
    border-color: #e9eef8;
    background-color: #F7F9FD;
    cursor: inherit; }
    .sg-btn-twitter.sg-state--disable:hover, .sg-btn-twitter.sg-state


file
    fs.copy(path.join(tempDir, 'readme'), path.join(distDir)),
  ]

  // Wait until done
  await Promise.all(operations)

  console.log('Production assets copied to dist folder')
}

copyAssets()
import { Injectable } from '@angular/core';
import { FormGroup } from '@angular/forms';

@Injectable({
  providedIn: 'root'
})
export class FormService {

  constructor() { }

  handleMsgInputInvalid(input: any): string {
    const err = input.errors;

    if (err.required) {
      return 'Este campo é obrigatório';
    } else if (err.minlength) {
      const min = err.minlength;
      return `Este campo deve possuir no mínimo ${min.requiredLength} caractéres`;
    } else if (err.maxlength) {
      return `Você ultrapassou o limite de ${err.maxlength.requiredLength} caractéres`;
    } else if (err.email) {
      return 'Formato de e-mail inválido';
    } else if (err.MatchPassword) {
      return `Os campos de senha estão diferentes`;
    } else if (err.completeNamePattern) {
      return 'Preencher o nome completo. Ex: João da Silva';
    } else {
      return '';
    }
  }

  hasError(input: any): boolean {
    return input.invalid && input.dirty;
  }

  submitForm(form: FormGroup) {
    for (const i in form.controls) {
      form.controls[i].markAsDirty();
      form.controls[i].updateValueAndValidity();
    }
  }

}
import AttributeSpec from "../APIObjectKinds/Attribute/spec";
import PlainIndexSpec from "../APIObjectKinds/PlainIndex/spec";
import SpatialIndexSpec from "../APIObjectKinds/SpatialIndex/spec";
import TextIndexSpec from "../APIObjectKinds/TextIndex/spec";
import UniqueIndexSpec from "../APIObjectKinds/UniqueIndex/spec";
import APIObject from "../Interfaces/APIObject";
import APIObjectDatabase from "../Interfaces/APIObjectDatabase";

type IndexSpec = PlainIndexSpec | TextIndexSpec | SpatialIndexSpec | UniqueIndexSpec;

/**
 * Returns an object whose `attributes` property is an object whose keys are
 * `Attribute` paths, and whose values are booleans indicating whether or not
 * attribute is indexed.
 *
 * @param namespace {APIObjectDatabase} The namespace in which to find attributes.
 * @returns {Promise} A promised object with list of paths mapped to booleans indicating whether they were indexed.
 */
export default async function
getIndexedAttributes (namespace: APIObjectDatabase): Promise<{ attributes: Record<string, boolean> }> {
    const attributes: APIObject<AttributeSpec>[] = (namespace.kindIndex.attribute || []);
    const indexes: APIObject<IndexSpec>[] = (namespace.kindIndex.plainindex || [])
        .concat(namespace.kindIndex.textindex || [])
        .concat(namespace.kindIndex.spatialindex || [])
        .concat(namespace.kindIndex.uniqueindex || []);
    const result: { attributes: Record<string, boolean> } = {
        attributes: {},
    };
    attributes.forEach((attr: APIObject<AttributeSpec>): void => {
        const path: string = `${attr.spec.databaseName.toLowerCase()}.`
            + `${attr.spec.structName.toLowerCase()}.`
            + `${attr.spec.name.toLowerCase()}`;
        result.attributes[path] = false;
    });
    indexes.forEach((index: APIObject<IndexSpec>): void => {
        index.spec.keyAttributes.forEach((ka): void => {
            const path: string = `${index.spec.databaseName.toLowerCase()}.`
                + `${index.spec.struct


          },
            result_processor=lambda x: x["extend_attributes"]
        )

    def taobao_alitrip_it_fare_addrt(
            self,
            ticketing_airline,
            origin_land,
            destination,
            cabin,
            valid_date4_dep,
            valid_date4_ret,
            sale_date,
            adult_passenger_identity,
            ticket_price,
            luggage_rule,
            is_can_all_refund,
            is_can_part_refund,
            can_dep_change,
            can_ret_change,
            noshow_restrict,
            out_file_code='',
            file_code='',
            product_type='',
            stock_mode='',
            is_rt='',
            rt_type='',
            combination_filecode='',
            is_allow_oj='',
            oj_type='',
            combination_oj_filecode='',
            sale_airline='',
            address_option='',
            trip_type='',
            transit_land='',
            restrict_flight_no='',
            exclude_flight_no='',
            exclude_date_range4_dep='',
            trip_date_point4_dep='',
            trip_exclude_date_point4_dep='',
            flight_date_restrict4_dep='',
            flight_date_point4_dep='',
            exclude_date_range4_ret='',
            trip_date_point4_ret='',
            trip_exclude_date_point4_ret='',
            flight_date_restrict4_ret='',
            flight_date_point4_ret='',
            min_stay='',
            max_stay='',
            min_travel_person='',
            max_travel_person='',
            gv2_child_rule='',
            nationality='',
            exclude_nationality='',
            passenger_age='',
            adult_tax='',
            child_price='',
            child_tax='',
            return_point='',
            adjust_money='',
            rt_commission_formula='',
            early_ticketing_time_limit='',
            late_ticketing_time_limit='',
            vip_code='',
            fare_source='',
            is_create_pnr='',
            booking_office='',
            receipts='',
            is_validat_price='',
            is_can_refund4_dep='',
            refund_price4_dep='',
            refund_part_price4_dep='',
            is_can_refund4_ret='',
            refund_price4_ret='',
            refund_part_price4_ret='',
            is_can_reissue4_dep='',
            reissue_price4_dep='',
            reissue_part_price4_dep='',
            is_can_reissue4_ret='',
            reissue_price4_ret='',
            reissue_part_price4_ret='',
            no_show_time_limit4_dep='',
            is_no_show_can_refund4_dep='',
            is_no_show_can_reissue4_dep='',
            no_show_penalty4_dep='',
            no_show_time_limit4_ret='',
            is_no_show_can_refund4_ret='',
            is_no_show_can_reissue4_ret='',
            no_show_penalty4_ret='',
            luggage_rule4_dep='',
            luggage_rule4_ret='',
            remark='',
            working_hours='',
            refund_rule='',
            reissue_rule='',
            noshow_rule='',
            apply_channel='',
            commodity_type='',
            code_sharing_type='',
            extend_attributes='',
            buy_ticket_notice='',
            refund_fee_all_unused='',
            refund_currency_all_unused='CNY',
            refund_fee_type_all_unused='全程',
            refund_fee_part_unused='',
            refund_currency_part_unused='CNY',
            refund_fee_type_part_unused='全程',
            dep_change_fee='',
            dep_change_currency='CNY',
            dep_change_fee_type='全程',
            ret_change_fee='',
            ret_change_currency='CNY',
            ret_change_fee_type='全程',
            noshow_time_restrict='',
            noshow_time_restrict_unit='小时',
            noshow_rule_type='',
            noshow_fee='',
            noshow_currency='CNY',
            farebasis='',
            fare_type_code='',
            tariff='',
            rule_id='',
            fare_direct_destrict='0'
    ):
        """
        【国际机票自有政策】单条往返添加
        自有政策往返添加接口
        文档地址：https://open-doc.dingtalk.com/docs/api.htm?apiId=25497

        :param ticketing_airline: 出票航司,1.不可为空 2.航空公司二字码 3.只能输入一个
        :param origin_land: 始发地,多个用“,”隔开 1.不得为空 2.可以填写：机场三字码”或“城市码” 3.最多允许100个机场三字码/城市码
        :param destination: 目的地，多个用“,”隔开 1.不得为空 2.可以填写：机场三字码”或“城市码” 3.最多允许100个机场三字码/城市码
        :param cabin: 舱位， 用','表示航段的分割。 1、舱位代码。每段只允许录入一个舱位代码，若全程舱位一致则可以只录入一个


  $at, 0x2000
    li    $t1, 1
    or    $k1, $k1, $at
    sw    $t1, 0x18($k0)
    b     .L80326BD0
     sw    $k1, 0x118($k0)

glabel __osEnqueueAndYield
    lui   $a1, %hi(D_80334890 + 0x10)
    lw    $a1, %lo(D_80334890 + 0x10)($a1)
    mfc0  $t0, $12
    lw    $k1, 0x18($a1)
    ori   $t0, $t0, 2
    sw    $t0, 0x118($a1)
    sd    $s0, 0x98($a1)
    sd    $s1, 0xa0($a1)
    sd    $s2, 0xa8($a1)
    sd    $s3, 0xb0($a1)
    sd    $s4, 0xb8($a1)
    sd    $s5, 0xc0($a1)
    sd    $s6, 0xc8($a1)
    sd    $s7, 0xd0($a1)
    sd    $gp, 0xe8($a1)
    sd    $sp, 0xf0($a1)
    sd    $fp, 0xf8($a1)
    sd    $ra, 0x100($a1)
    beqz  $k1, .L80326D70
     sw    $ra, 0x11c($a1)
    cfc1  $k1, $31
    sdc1  $f20, 0x180($a1)
    sdc1  $f22, 0x188($a1)
    sdc1  $f24, 0x190($a1)
    sdc1  $f26, 0x198($a1)
    sdc1  $f28, 0x1a0($a1)
    sdc1  $f30, 0x1a8($a1)
    sw    $k1, 0x12c($a1)

.L80326D70:
.ifdef VERSION_EU
    lw    $k1, 0x118($a1)
    andi  $t1, $k1, 0xff00
    beqz  $t1, .L802F3FBC
     nop
    lui   $t0, %hi(D_8030208C)
    addiu $t0, %lo(D_8030208C)
    lw    $t0, ($t0)
    li    $at, -1
    xor   $t0, $t0, $at
    lui   $at, (0xFFFF00FF >> 16)
    andi  $t0, $t0, 0xff00
    ori   $at, (0xFFFF00FF & 0xFFFF)
    or    $t1, $t1, $t0
    and   $k1, $k1, $at
    or    $k1, $k1, $t1
    sw    $k1, 0x118($a1)
.L802F3FBC:
.endif
    lui   $k1, %hi(MI_INTR_MASK_REG)
    lw    $k1, %lo(MI_INTR_MASK_REG)($k1)
.ifdef VERSION_EU
    beqz  $k1, .L802F3FF4
     nop
    lui   $k0, %hi(D_8030208C)
    addiu $k0, %lo(D_8030208C)
    lw    $k0, ($k0)
    lw    $t0, 0x128($a1)
    li    $at, -1
    srl   $k0, $k0, 0x10
    xor   $k0, $k0, $at
    andi  $k0, $k0, 0x3f
    and   $k0, $k0, $t0
    or    $k1, $k1, $k0
.L802F3FF4:
.endif
    be


yer player = client.getLocalPlayer();
		List<NPC> npcs = client.getNpcs();
		for (NPC npc : npcs)
		{
			if (player.getInteracting() != npc && npc.getInteracting() != player)
			{
				continue;
			}
			for (int dx = -1; dx <= 1; dx++)
			{
				for (int dy = -1; dy <= 1; dy++)
				{
					if (dx == 0 && dy == 0)
					{
						continue;
					}
					renderTileIfValidForMovement(graphics, npc, dx, dy);
				}
			}
		}

		for (int dx = -1; dx <= 1; dx++)
		{
			for (int dy = -1; dy <= 1; dy++)
			{
				if (dx == 0 && dy == 0)
				{
					continue;
				}
				renderTileIfValidForMovement(graphics, player, dx, dy);
			}
		}
	}

	private void renderTileIfHasLineOfSight(Graphics2D graphics, WorldArea start, int targetX, int targetY)
	{
		WorldPoint targetLocation = new WorldPoint(targetX, targetY, start.getPlane());

		// Running the line of sight algorithm 100 times per frame doesn't
		// seem to use much CPU time, however rendering 100 tiles does
		if (start.hasLineOfSightTo(client.getTopLevelWorldView(), targetLocation))
		{
			LocalPoint lp = LocalPoint.fromWorld(client, targetLocation);
			if (lp == null)
			{
				return;
			}

			Polygon poly = Perspective.getCanvasTilePoly(client, lp);
			if (poly == null)
			{
				return;
			}

			OverlayUtil.renderPolygon(graphics, poly, LINE_OF_SIGHT_COLOR);
		}
	}

	private void renderLineOfSight(Graphics2D graphics)
	{
		WorldArea area = client.getLocalPlayer().getWorldArea();
		for (int x = area.getX() - CULL_LINE_OF_SIGHT_RANGE; x <= area.getX() + CULL_LINE_OF_SIGHT_RANGE; x++)
		{
			for (int y = area.getY() - CULL_LINE_OF_SIGHT_RANGE; y <= area.getY() + CULL_LINE_OF_SIGHT_RANGE; y++)
			{
				if (x == area.getX() && y == area.getY())
				{
					continue;
				}
				renderTileIfHasLineOfSight(graphics, area, x, y);
			}
		}
	}

	private void renderInteracting(Graphics2D graphics)
	{
		Stream.concat(
			client.getPlayers().stream(),
			client.getNpcs().stream()
		).forEach(fa ->
		{
			Actor ta = fa.getInteracting();
			if (ta == null)
			{
				return;
			}

			LocalPoint fl = fa.getLocalLocation();
			Point fs = Perspective.localToCanvas(client, fl, client.getPlane(), fa.getLogicalHeight() / 2);
			if (fs == null)
			{
				return;
			}
			int fsx = fs.getX();
			int fsy = fs.getY() - INTERACTING_SHIFT;

			LocalPoint tl = ta.getLocalLocation();
			Point ts = Perspective.localToCanvas(client, tl, client.getPlane(), ta.getLogicalHeight() / 2);
			if (ts == null)
			{
				return;
			}
			int tsx = ts.getX();
			int tsy = ts.getY() - INTERACTING_SHIFT;

			graphics.setColor(INTERACTING_COLOR);
			graphics.drawLine(fsx, fsy, tsx, tsy);

			AffineTransform t = new AffineTransform();


x scale title string. Defaults to NULL, which converts to sentence case with spaces. Use "" if you would like no title.

x_title_wrap

Number of characters to wrap the x title to. Defaults to 50.

y_zero_mid

For a numeric y variable, add balance to the y scale so that zero is in the centre of the y scale.

y_breaks_n

For a numeric or date x variable, the desired number of intervals on the x scale, as calculated by the pretty algorithm. Defaults to 5.

y_expand

A vector of range expansion constants used to add padding to the y scale, as per the ggplot2 expand argument in ggplot2 scales functions.

y_labels

A function or named vector to modify y scale labels. Use ggplot2::waiver() to keep y labels untransformed.

y_title

y scale title string. Defaults to NULL, which converts to sentence case with spaces. Use "" if you would like no title.

y_title_wrap

Number of characters to wrap the y title to. Defaults to 50.

y_zero

For a numeric y variable, TRUE or FALSE of whether the minimum of the y scale is zero. Defaults to TRUE.

y_zero_line

For a numeric y variable, TRUE or FALSE whether to add a zero reference line to the y scale. Defaults to TRUE if there are positive and negative values in y_var. Otherwise defaults to FALSE.

caption

Caption title string.

caption_wrap

Number of characters to wrap the caption to. Defaults to 80.

stat

String of "boxplot" or "identity". Defaults to "boxplot".

ymin_var

Unquoted numeric variable for minimum of whisker on the y scale for when stat = "identity" is selected.

ylower_var

Unquoted numeric variable for minimum of box on the y scale for when stat = "identity" is selected.

ymiddle_var

Unquoted numeric variable for middle of box on the y scale for when stat = "identity" is selected.

yupper_var

Unquoted numeric variable for maximum of box on the y scale for when stat = "identity" is selected.

ymax_var

Unquoted numeric variable for maximum of whisker on the y scale for when stat = "identity" is selected.

theme

A ggplot2 theme.

mobile

Whether the plot is to be displayed on a mobile device. Defaults to FALSE.

Value

A ggplot object.

Examples<a class="anchor" aria-label="anchor" href="#ref-examples


(_contexts.end(), Context(_nextId++,
		kernel, pc, gridDim, ctaDim, (const void*) parameterBuffer,
		kernel->argumentMemorySize(), _getExecutingContext(), this,
		_getExecutingContext()->priority + 1));

	// Add to parent
	auto parent = _getExecutingContext();
	report("  attaching to parent context " << parent->id);

	parent->children.push_back(context);

	// Add to pool of executing contexts
	_executingContexts.insert(std::make_pair(context->priority, context));
}

ir::PTXU64 EmulatedKernelScheduler::argumentMemory() const
{
	return (ir::PTXU64)_getExecutingContext()->argumentMemory.data();
}

void EmulatedKernelScheduler::_scheduler()
{
	while(!_executingContexts.empty())
	{
		// Highest priority context
		auto contextIterator = _executingContexts.begin();
		auto context         = contextIterator->second;

		context->executeUntilYield();

		_executingContexts.erase(contextIterator);

		report("  context " << context->id << " running kernel "
			<< context->kernel->name << " yielded");

		if(context->exited())
		{
			report("   it exited");
			bool hasParent = context->hasParent();

			if(hasParent)
			{
				auto parent     = context->parent;
				bool wasBlocked = parent->blockedOnChildren();

				auto child = std::find(parent->children.begin(),
					parent->children.end(), context);
				assert(child != parent->children.end());

				parent->children.erase(child);

				report("    disconnecting from parent "
					<< parent->kernel->name << " (context "
					<< parent->id << ")");

				if(wasBlocked && !parent->blockedOnChildren())
				{
					report("     waking up parent");
					_executingContexts.insert(std::make_pair(
						parent->priority, parent));
				}
			}

			// detach all children
			for(auto child = context->children.begin();
				child != context->children.end(); ++child)
			{
				assert((*child)->parent == context);
				(*child)->parent = _contexts.end();
			}

			_contexts.erase(context);
		}
	}
}

EmulatedKernelScheduler::Context::iterator
	EmulatedKernelScheduler::_getExecutingContext() const
{
	assert(!_executingContexts.empty());
	return _executingContexts.begin()->second;
}

const EmulatedKernel* EmulatedKernelScheduler::_getKernelAtPC(
	unsigned int pc) const
{
	return _getExecutingContext()->kernel->getKernel(pc);
}

EmulatedKernelScheduler::Context::Context(Id i, EmulatedKernel* k,
	const ir::Dim3& g, const ir::Dim3& c, iterator p,
	EmulatedKernelScheduler* s, Priority pr)
: id(i), kernel(k), startingPC(0), gridDimensions(g),
	argumentMemory(k->ArgumentMemory,
		k->ArgumentMemory + k->argumentMemorySize()),
	 parent(p), priority(pr),  _scheduler(s),
	_cta(new CooperativeThreadArray(k, g, c, k->argumentMemorySize(),
		k->parameterMemorySize(), k->registerCount(), k->localMemorySize(),
		k->globalLocalMemorySize(), k->totalSharedMemorySize(),
		s->_generators)),
	_positionInGrid(ir::Dim3(0, 0, 0))
{

}

EmulatedKernelScheduler::Context::Context(Id i, const EmulatedKernel* k,
	uint64_t pc, const


<!-- slide -->
### vim 常用按键说明
```cpp
除了 i, Esc, :wq 之外,其实 vim 还有非常多的按键可以使用.命令模式下：
- 光标移动
  - j下 k上 h左 l右
  - w前进一个词 b后退一个词
  - Ctrl+d 向下半屏  ctrl+u 向上半屏
  - G 移动到最后一行 gg 第一行 ngg 第n行
- 复制粘贴
  - dd 删一行 ndd 删n行
  - yy 复制一行 nyy复制n行
  - p将复制的数据粘贴在下一行 P粘贴到上一行
  - u恢复到前一个动作 ctrl+r重做上一个动作
- 搜索替换
  - /word 向下找word     ？word 向上找
  - n重复搜索 N反向搜索
  - :1,$s/word1/word2/g从第一行到最后一行寻找 word1 字符串,并将该字符串
    取代为 word2
```

<!-- slide -->
### vim 常用按键说明
```cpp
底线命令模式下：
- :set nu	显示行号
- :set nonu	取消行号
- :set paste	粘贴代码不乱序
【注：把caps lock按键映射为ctrl,能提高编辑效率.】
```
<!-- slide -->
### Markdown 文档语法
```cpp
# 一级标题
## 二级标题
*斜体* **粗体**
- 列表项
  - 子列表项
> 引用
[超链接](http://asdf.com)
![图片名](http://asdf.com/a.jpg)

|表格标题1|表格标题2|
 |-|-|
|内容1|内容2|

```
<!-- slide -->

##谢谢
<!-- slide -->

## Maven

### 基本概念
- 标准项目结构

|目录|描述|
|---|---|
|`src/main/java`|源代码目录|
|`src/main/resources`|资源目录，一般是存放配置文件|
|`src/main/filters`|资源过滤文件|
|`src/main/webapp`|Web 应用资源|
|`src/test/java`|测试代码|
|`src/test/resources`|测试资源，用于测试的配置文件|
|`src/test/filters`|测试资源过滤文件|
|`src/it`|集成测试|
|`src/assembly`|程序集描述符|
|`src/site`|站点文档|
|`target`|编译输出目录|
|`pom.xml`|maven 项目配置文件|
|`LICENSE.txt`|项目许可证|
|`NOTICE.txt`|项目依赖和通知|
|`README.txt`|项目描述|

#### POM Files的基本内容

- **POM**（Project Object Model）文件定义了项目的构建配置，包括项目的依赖、插件、目标等。（就是所说的pom项目对象模型）包含：
- **项目基本信息**：如项目名称、版本、描述、URL


abungsleiter Wirrbart","Forscherliga"},
[2918] = {"Berater Belgrum",nil},
[2919] = {"Wächter der Fam'retor",nil},
[2920] = {"Lucien Knobelzang",nil},
[2921] = {"Lotwil Veriatus",nil},
[2922] = {"Servo",nil},
[2923] = {"Räudige Silbermähne",nil},
[2924] = {"Silbermähnenwolf",nil},
[2925] = {"Silbermähnenheuler",nil},
[2926] = {"Silbermähnenpirscher",nil},
[2927] = {"Heimtückische Eulenbestie",nil},
[2928] = {"Primitive Eulenbestie",nil},
[2929] = {"Wilde Eulenbestie",nil},
[2930] = {"Schildwache Glynda Nal'Shea",nil},
[2931] = {"Zaricotl",nil},
[2932] = {"Magregan Grubenschatten",nil},
[2934] = {"Bewahrer Bel'dugur",nil},
[2937] = {"Dagun der Gefräßige",nil},
[2938] = {"Aldric Waidmann","Bärenausbilder"},
[2939] = {"Jackson Bayne","Eberausbilder"},
[2941] = {"Lanie Riet","Greifenmeisterin"},
[2942] = {"Dylan Bissel","Wolfausbilder"},
[2943] = {"Ransin Donner",nil},
[2944] = {"Boss Tho'grun",nil},
[2945] = {"Murdaloc",nil},
[2946] = {"Helculars Marionette",nil},
[2947] = {"Harken Windtotem",nil},
[2948] = {"Mull Donnerhorn",nil},
[2949] = {"Gerber der Bleichmähnen",nil},
[2950] = {"Kürschner der Bleichmähnen",nil},
[2951] = {"Wilderer der Bleichmähnen",nil},
[2952] = {"Stacheleber der Borstennacken",nil},
[2953] = {"Schamane der Borstennacken",nil},
[2954] = {"Kampfeber der Borstennacken",nil},
[2955] = {"Ebenenschreiter",nil},
[2956] = {"Ausgewachsener Ebenenschreiter",nil},
[2957] = {"Alter Ebenenschreiter",nil},
[2958] = {"Präriewolf",nil},
[2959] = {"Präriepirscher",nil},
[2960] = {"Präriewolfalpha",nil},
[2961] = {"Bergpuma",nil},
[2962] = {"Harpyie der Windfurien",nil},
[2963] = {"Windhexe der Windfurien",nil},
[2964] = {"Zauberhexerin der Windfurien",nil},
[2965] = {"Matriarchin der Windfurien",nil},
[2966] = {"Kampfeber",nil},
[2967] = {"Zentaur der Galak",nil},
[2968] = {"Kundschafter der Galak",nil},
[2969] = {"Drahtiger Sturzflieger",nil},
[2970] = {"Sturzflieger",nil},
[2971] = {"Kralliger Sturzflieger",nil},
[2972] = {"Kodokalb",nil},
[2973] = {"Kodobulle",nil},
[2974] = {"Kodomatriarchin",nil},
[2975] = {"Mietling der Venture Co.",nil},
[2976] = {"Hilfsarbeiter der Venture Co.",nil},
[2977] = {"Zuchtmeister der Venture Co.",nil},
[2978] = {"Tagelöhner der Venture Co.",nil},
[2979] = {"Vorsteher der


his.fuelBurnTimeLeft = fuelMaxBurnTime;
        if (!getWorld().isRemote) {
            markDirty();
        }
    }

    @Override
    public void update() {
        super.update();
        if (!getWorld().isRemote) {
            updateCurrentTemperature();
            generateSteam();

            if (getOffsetTimer() % 5 == 0) {
                fillInternalTankFromFluidContainer(containerInventory, containerInventory, 0, 1);
                pushFluidsIntoNearbyHandlers(STEAM_PUSH_DIRECTIONS);
            }

            if (fuelMaxBurnTime <= 0) {
                tryConsumeNewFuel();
                if (fuelBurnTimeLeft > 0) {
                    if (wasBurningAndNeedsUpdate) {
                        this.wasBurningAndNeedsUpdate = false;
                    } else setBurning(true);
                }
            }

            if (wasBurningAndNeedsUpdate) {
                this.wasBurningAndNeedsUpdate = false;
                setBurning(false);
            }
        }
    }

    private void updateCurrentTemperature() {
        if (fuelMaxBurnTime > 0) {
            if (getOffsetTimer() % 12 == 0) {
                if (fuelBurnTimeLeft % 2 == 0 && currentTemperature < getMaxTemperate())
                    currentTemperature++;
                fuelBurnTimeLeft -= isHighPressure ? 2 : 1;
                if (fuelBurnTimeLeft == 0) {
                    this.fuelMaxBurnTime = 0;
                    this.timeBeforeCoolingDown = 40;
                    //boiler has no fuel now, so queue burning state update
                    this.wasBurningAndNeedsUpdate = true;
                }
            }
        } else if (timeBeforeCoolingDown == 0) {
            if (currentTemperature > 0)
                currentTemperature--;
        } else --timeBeforeCoolingDown;
    }

    private void generateSteam() {
        if(currentTemperature >= 100) {
            if (getOffsetTimer() % getBoilingCycleLength() == 0) {
                int fillAmount = (int) (baseSteamOutput * (currentTemperature / (getMaxTemperate() * 1.0)));
                boolean hasDrainedWater = waterFluidTank.drain(1, true) != null;
                int filledSteam = 0;
                if (hasDrainedWater) {
                    filledSteam = steamFluidTank.fill(ModHandler.getSteam(fillAmount), true);
                }
                if (this.hasNoWater && hasDrainedWater) {
                    getWorld().setBlockToAir(getPos());
                    getWorld().createExplosion(null,
                        getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5,
                        2.0f, true);
                } else this.hasNoWater = !hasDrainedWater;
                if (filledSteam == 0 && hasDrainedWater) {
                    getWorld().playSound(null, getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5,
                        SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0f, 1.0f);
                    steamFluidTank.drain(4000, true);
                }
            }
        } else {
            this.hasNoWater = false;
        }
    }

    public boolean isBurning() {
        return isBurning;
    }

    public void setBurning(boolean burning) {
        this.isBurning = burning;
        if (!getWorld().isRemote) {
            markDirty();
            writeCustomData(100, buf -> buf.writeBoolean(burning));
        }
    }

    protected abstract void tryConsumeNewFuel();

    public int getMaxTemperate() {
        return isHighPressure ? 1000 : 500;
    }

    public double getTemperaturePercent() {
        return currentTemperature / (getMaxTemperate() * 1.0


�照一定概率增加访问次数。这样的设计方法，就既包含了访问的时间段对访问频率的影响，也避免了 8 bits 计数器对访问次数的影响。而对于访问时间来说，Redis 还会获取最新访问时间戳并更新到 lru 变量中。

那么最后，我们再来看下 Redis 是如何基于 LFU 算法淘汰数据的。

### LFU算法淘汰数据

在实现使用 LFU 算法淘汰数据时，Redis 是采用了和实现近似 LRU 算法相同的方法。也就是说，Redis 会使用一个**全局数组EvictionPoolLRU**，来保存待淘汰候选键值对集合。然后，在 processCommand 函数处理每个命令时，它会调用 freeMemoryIfNeededAndSafe 函数和 freeMemoryIfNeeded 函数，来执行具体的数据淘汰流程。

这个淘汰流程我在上节课已经给你介绍过了，你可以再去整体回顾下。这里，我也再简要总结下，也就是分成三个步骤：

- 第一步，调用 getMaxmemoryState 函数计算待释放的内存空间；
- 第二步，调用 evictionPoolPopulate 函数随机采样键值对，并插入到待淘汰集合 EvictionPoolLRU 中；
- 第三步，遍历待淘汰集合 EvictionPoolLRU，选择实际被淘汰数据，并删除。

<!-- -->

虽然这个基本流程和 LRU 算法相同，但是你要**注意**，LFU 算法在淘汰数据时，在第二步的 evictionPoolPopulate 函数中，使用了不同的方法来计算每个待淘汰键值对的空闲时间。

具体来说，在实现 LRU 算法时，待淘汰候选键值对集合 EvictionPoolLRU 中的每个元素，都使用**成员变量idle**来记录它距离上次访问的空闲时间。

而当实现 LFU 算法时，因为 LFU 算法会对访问次数进行衰减和按概率增加，所以，它是使用**访问次数**来近似表示访问频率的。相应的，LFU 算法其实是用 255 减去键值对的访问次数，这样来计算 EvictionPoolLRU 数组中每个元素的 idle 变量值的。而且，在计算 idle 变量值前，LFU 算法还会**调用LFUDecrAndReturn函数，衰减一次键值对的访问次数**，以便能更加准确地反映实际选择待淘汰数据时，数据的访问频率。

下面的代码展示了 LFU 算法计算 idle 变量值的过程，你可以看下。

```
if (server.maxmemory_policy & MAXM


994 bytes decrease)
    Output file size = 474955 bytes (1162 bytes = 0.24% decrease)

    ### mobile1.jpg (jpg) ###
    /usr/bin/convert -define registry:temporary-path=/home/imagicktmp mobile1.jpg -define jpeg:size=4096x4096 -filter Triangle -define filter:support=2 -define jpeg:fancy-upsampling=off -unsharp 0.25x0.08+8.3+0.045 -interlace none -strip           -write mpr:mobile1 -resize 2048x2048\> -write mobile1_optimal.jpg +delete           mpr:mobile1 -define webp:thread-level=1 -define webp:method=4 -define webp:alpha-quality=100 -define    webp:lossless=false -quality 75 -resize 2048x2048\> mobile1.webp
    jpegoptim -p --max=82 mobile1_optimal.jpg
    mobile1_optimal.jpg 1200x900 24bit N JFIF  [OK] 340252 --> 280918 bytes (17.44%), optimized.
    ### mobile2.jpg (jpg) ###
    /usr/bin/convert -define registry:temporary-path=/home/imagicktmp mobile2.jpg -define jpeg:size=4096x4096 -filter Triangle -define filter:support=2 -define jpeg:fancy-upsampling=off -unsharp 0.25x0.08+8.3+0.045 -interlace none -strip           -write mpr:mobile2 -resize 2048x2048\> -write mobile2_optimal.jpg +delete           mpr:mobile2 -define webp:thread-level=1 -define webp:method=4 -define webp:alpha-quality=100 -define    webp:lossless=false -quality 75 -resize 2048x2048\> mobile2.webp
    jpegoptim -p --max=82 mobile2_optimal.jpg
    mobile2_optimal.jpg 1200x900 24bit N JFIF  [OK] 212594 --> 177339 bytes (16.58%), optimized.
    ### mobile3.jpg (jpg) ###
    /usr/bin/convert -define registry:temporary-path=/home/imagicktmp mobile3.jpg -define jpeg:size=4096x4096 -filter Triangle -define filter:support=2 -define jpeg:fancy-upsampling=off -unsharp 0.25x0.08+8.3+0.045 -interlace none -strip           -write mpr:mobile3 -resize 2048x2048\> -write mobile3_optimal.jpg +delete           mpr:mobile3 -define webp:thread-level=1 -define webp:method=4 -define webp:alpha-quality=100 -define    webp:lossless=false -quality 75 -resize 2048x2048\> mobile3.webp
    jpegoptim -p --max=82 mobile3_optimal.jpg
    mobile3_optimal.jpg 1200x900 24bit N JFIF  [OK] 261382 --> 217147 bytes (16.92%), optimized.
    ### png24-image1.png (png) ###
    /usr/bin/convert -define registry:temporary-path=/home/imagicktmp png24-image1.png -interlace none -strip -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=2           -write mpr:png24-image1 -resize 2048x2048\> -write png24-image1_optimal.png +delete           mpr:png24-image1 -define webp:thread-level=1 -define webp:method=4 -define webp:alpha-quality=100 -define webp:lossless=false -quality 75     -resize 2048x2048\> png24-image1.webp
    optipng -o2 png24-image1_optimal.png -preserve -out png24-image1_optimal.png
    ** Processing: png24-image1_optimal.png
    600x400 pixels, 3x8 bits/pixel, RGB
    Input IDAT size = 386006 bytes
    Input file size = 386195 bytes

    Trying:

    Output IDAT size = 386006 bytes (no change)
    Output file size


Code.SomeCode);
	}

	@Override
	public String getName() {
		final CharSequence title = Item.Title;
		return title != null ? String.valueOf(title) : "";
	}

	@Override
	public String getSummary() {
		final CharSequence summary = Item.getSummary();
		return summary != null ? summary.toString() : "";
	}

	@Override
	public Pair<String,String> getTreeTitle() {
		final INetworkLink link = getLink();
		return new Pair(getName(), link != null ? link.getTitle() : null);
	}

	@Override
	protected ZLImage createCover() {
		return createCoverForItem(Library, Item, true);
	}

	public boolean isContentValid() {
		if (myLoadedTime < 0) {
			return false;
		}
		final int reloadTime = 15 * 60 * 1000; // 15 minutes in milliseconds
		return System.currentTimeMillis() - myLoadedTime < reloadTime;
	}

	public void updateLoadedTime() {
		myLoadedTime = System.currentTimeMillis();
	}

	public void updateVisibility() {
		final LinkedList<FBTree> toRemove = new LinkedList<FBTree>();

		ListIterator<FBTree> nodeIterator = subtrees().listIterator();
		FBTree currentTree = null;
		int nodeCount = 0;

		for (int i = 0; i < myChildrenItems.size(); ++i) {
			final NetworkCatalogItem currentItem = myChildrenItems.get(i);
			boolean processed = false;
			while (currentTree != null || nodeIterator.hasNext()) {
				if (currentTree == null) {
					currentTree = nodeIterator.next();
				}
				if (!(currentTree instanceof NetworkCatalogTree)) {
					currentTree = null;
					++nodeCount;
					continue;
				}
				NetworkCatalogTree child = (NetworkCatalogTree)currentTree;
				if (child.Item == currentItem) {
					switch (child.Item.getVisibility()) {
						case TRUE:
							child.updateVisibility();
							break;
						case FALSE:
							toRemove.add(child);
							break;
						case UNDEFINED:
							child.clearCatalog();
							break;
					}
					currentTree = null;
					++nodeCount;
					processed = true;
					break;
				} else {
					boolean found = false;
					for (int j = i + 1; j < myChildrenItems.size(); ++j) {
						if (child.Item == myChildrenItems.get(j)) {
							found = true;
							break;
						}
					}
					if (!found) {
						toRemove.add(currentTree);
						currentTree = null;
						++nodeCount;
					} else {
						break;
					}
				}
			}
			final int nextIndex = nodeIterator.nextIndex();
			if (!processed && NetworkTreeFactory.createNetworkTree(this, currentItem, nodeCount) != null) {
				++nodeCount;
				nodeIterator = subtrees().listIterator(nextIndex + 1);
			}
		}

		while (currentTree != null || nodeIterator.hasNext()) {
			if (currentTree == null) {
				currentTree = nodeIterator.next();
			}
			if (currentTree instanceof NetworkCatalogTree) {
				toRemove.add(currentTree);
			}
			currentTree = null;
		}

		for (FBTree tree : toRemove) {
			tree.removeSelf();
		}
	}

	@Override
	public void removeTrees(Set<NetworkTree> trees) {
		for (NetworkTree t : trees) {
			if (t instanceof NetworkCatalogTree) {
				myChildrenItems.remove(((NetworkCatalogTree)t).Item);
			}
		}
		super.removeTrees(trees);
	}

	@Override
	protected String getStringId() {
		return Item.getStringId();
	}

	public void startItemsLoader(ZLNetworkContext nc, boolean authenticate, boolean resumeNotLoad) {
		new CatalogExpander(nc, this, authenticate, resumeNotLoad).start();
	}

	public synchronized void clearCatalog


",begin:"\\(",end:"\\)"}]},e.COMMENT("!","$",{relevance:0}),e.COMMENT("begin_doc","end_doc",{relevance:10}),a]}};var QE=function(e){var t="[A-Za-zА-Яа-яёЁ_!][A-Za-zА-Яа-яёЁ_0-9]*",n={className:"number",begin:e.NUMBER_RE,relevance:0},a={className:"string",variants:[{begin:'"',end:'"'},{begin:"'",end:"'"}]},r={className:"doctag",begin:"\\b(?:TODO|DONE|BEGIN|END|STUB|CHG|FIXME|NOTE|BUG|XXX)\\b",relevance:0},i={variants:[{className:"comment",begin:"//",end:"$",relevance:0,contains:[e.PHRASAL_WORDS_MODE,r]},{className:"comment",begin:"/\\*",end:"\\*/",relevance:0,contains:[e.PHRASAL_WORDS_MODE,r]}]},o={$pattern:t,keyword:"and и else иначе endexcept endfinally endforeach конецвсе endif конецесли endwhile конецпока except exitfor finally foreach все if если in в not не or или try while пока ",built_in:"SYSRES_CONST_ACCES_RIGHT_TYPE_EDIT SYSRES_CONST_ACCES_RIGHT_TYPE_FULL SYSRES_CONST_ACCES_RIGHT_TYPE_VIEW SYSRES_CONST_ACCESS_MODE_REQUISITE_CODE SYSRES_CONST_ACCESS_NO_ACCESS_VIEW SYSRES_CONST_ACCESS_NO_ACCESS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW SYSRES_CONST_ACCESS_RIGHTS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_TYPE_CHANGE SYSRES_CONST_ACCESS_TYPE_CHANGE_CODE SYSRES_CONST_ACCESS_TYPE_EXISTS SYSRES_CONST_ACCESS_TYPE_EXISTS_CODE SYSRES_CONST_ACCESS_TYPE_FULL SYSRES_CONST_ACCESS_TYPE_FULL_CODE SYSRES_CONST_ACCESS_TYPE_VIEW SYSRES_CONST_ACCESS_TYPE_VIEW_CODE SYSRES_CONST_ACTION_TYPE_ABORT SYSRES_CONST_ACTION_TYPE_ACCEPT SYSRES_CONST_ACTION_TYPE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ADD_ATTACHMENT SYSRES_CONST_ACTION_TYPE_CHANGE_CARD SYSRES_CONST_ACTION_TYPE_CHANGE_KIND SYSRES_CONST_ACTION_TYPE_CHANGE_STORAGE SYSRES_CONST_ACTION_TYPE_CONTINUE SYSRES_CONST_ACTION_TYPE_COPY SYSRES_CONST_ACTION_TYPE_CREATE SYSRES_CONST_ACTION_TYPE_CREATE_VERSION SYSRES_CONST_ACTION_TYPE_D


sort[data-v-1a575e80]:hover{border:1px solid #d0982c;background:rgba(255,255,255,.2)}#app[skin=TUF] .theme_button[data-v-1a575e80],#app[skin=tuf] .theme_button[data-v-1a575e80]{border:1px solid #d0982c!important}#app[skin=TUF] .theme_progress[data-v-1a575e80],#app[skin=tuf] .theme_progress[data-v-1a575e80]{background:rgba(255,255,255,.22)}#app[skin=TUF] .theme_search-label[data-v-1a575e80],#app[skin=tuf] .theme_search-label[data-v-1a575e80]{background:rgba(255,255,255,.1)}#app[skin=ROG] .theme_active.router-link-exact-active.software-item[data-v-1a575e80],#app[skin=rog] .theme_active.router-link-exact-active.software-item[data-v-1a575e80]{background-color:rgba(0,0,0,.5);border-radius:12px 12px 0 0}#app[skin=ROG] .theme_active.router-link-exact-active.software-item span[data-v-1a575e80],#app[skin=rog] .theme_active.router-link-exact-active.software-item span[data-v-1a575e80]{color:#cf0a2c}#app[skin=ROG] .theme_box[data-v-1a575e80],#app[skin=rog] .theme_box[data-v-1a575e80]{background-color:rgba(0,0,0,.5)}#app[skin=ROG] .theme_backgroundColor[data-v-1a575e80],#app[skin=rog] .theme_backgroundColor[data-v-1a575e80]{background-color:rgba(119,119,119,.12)}#app[skin=ROG] .theme_apps[data-v-1a575e80],#app[skin=rog] .theme_apps[data-v-1a575e80]{border:1px solid #680516;background-color:rgba(43,43,43,.24)}#app[skin=ROG] .theme_tags[data-v-1a575e80],#app[skin=rog] .theme_tags[data-v-1a575e80]{border:1px solid #ffffff00;background:rgba(255,255,255,.1)}#app[skin=ROG] .theme_tags.on[data-v-1a575e80],#app[skin=ROG] .theme_tags[data-v-1a575e80]:hover,#app[skin=rog] .theme_tags.on[data-v-1a575e80],#app[skin=rog] .theme_tags[data-v-1a575e80]:hover{border:1px solid #680516;background:rgba(255,255,255,.2)}#app[skin=ROG] .theme_sort[data-v-1a575e80],#app[skin=rog] .theme_sort[data-v-1a575e80]{border:1px solid #ffffff00;background:rgba(255,255,255,.1)}#app[skin=ROG] .theme_sort.on[data-v-1a575e80],#app[skin=ROG] .theme_sort[data-v-1a575e80]:hover,#app[skin=rog] .theme_sort.on[data-v-1a575e80],#app[skin=rog] .theme_sort[data-v-1a575e80]:hover{border:1px solid #680516;background:rgba(255,255,255,.2)}#app[skin=ROG] .theme_button[data-v-1a575e80],#app[skin=rog] .theme_button[data-v-1a575e80]{border:1px solid #680516!important}#app[skin=ROG] .theme_progress[data-v-1a575e80],#app[skin=rog] .theme_progress[data-v-1a575e80]


 Asterion à Bashal'Aran.";
		   ["name"] = "Bashal'Aran";
		};
		[958] = {
		   ["name"] = "Les outils des Bien-nés";
		   ["objective"] = "Retrouver 7 Reliques de Bien-né pour Thundris Tissevent à Auberdine.";
		};
		[959] = {
		   ["name"] = "Fuite de porto aux docks";
		   ["objective"] = "Le grutier Bigglefuzz de Cabestan veut que vous repreniez la Bouteille de porto vieille de 99 ans à Magglish le Dingue, qui se cache dans les Cavernes des lamentations.";
		};
		[960] = {
		   ["name"] = "Onu réfléchit";
		};
		[961] = {
		   ["name"] = "Onu réfléchit";
		};
		[962] = {
		   ["name"] = "Fleur de serpent";
		   ["objective"] = "L'Apothicaire Zamah des Pitons du Tonnerre veut que vous récoltiez 10 Fleurs de serpent.";
		};
		[963] = {
		   ["name"] = "Un amour éternel";
		   ["objective"] = "Libérer l'esprit d'Anaya Coursaurore et rapporter son pendentif à Cerellean Blanchegriffe à Auberdine.";
		};
		[964] = {
		   ["name"] = "Fragments de squelette";
		   ["objective"] = "Apporter 15 Fragments de squelette à l'Apothicaire Dithers à la Barricade, dans les Maleterres de l'ouest.";
		};
		[965] = {
		   ["name"] = "La Tour d'Althalaxx";
		   ["objective"] = "Trouver Balthule Frappelombre près de la Tour d'Althalaxx à Sombrivage.";
		};
		[966] = {
		   ["name"] = "La Tour d'Althalaxx";
		   ["objective"] = "Collecter 4 Parchemins passés pour Balthule Frappelombre près de la Tour d'Althalaxx.";
		};
		[967] = {
		   ["name"] = "La Tour d'Althalaxx";
		   ["objective"] = "Remettre la Lettre de Balthule à Delgren le Purificateur dans la forêt d'Orneval.";
		};
		[968] = {
		   ["name"] = "Les puissances d'en bas";
		   ["objective"] = "Apportez le Livre : Les puissances d'en bas à Gerrig Poigne-d'os, dans la Caverne lugubre de Forgefer.";
		};
		[969] = {
		   ["name"] = "Que la chance soit avec vous";
		   ["objective"] = "Collecter 4 Éclats cognegivre pour le sorcier-docteur Mau'ari à Long-guet.";
		};
		[970] = {
		   ["name"] = "La Tour d'Althalaxx";
		   ["objective"] = "Trouver une Gemme d'âme luminescente et la rapporter à Delgren le Purificateur au poste de Maestra.";
		};
		[971] = {
		   ["name"] = "La connaissance des profondeurs";
		   ["objective"] = "Apportez le « Manuscrit de Lorgalis » à Gerrig Poigne-d'os dans la Caverne lugubre de Forgefer.";
		};
		[972] = {
		   ["name"] = "Le sapta d'eau";
		};
		[973] = {
		   ["name"] = "La Tour d'Althalaxx";
		   ["objective"] = "Apporter le Tome d'Ilkrud Magthrull à Delgren le Purificateur au Poste de Maestra.";
		};
		[974] = {
		   ["objective"] = "Krakle, au cratère d'Un'Goro, vous demande de décou


S,fp};

use std::fmt::Debug;

fn first_2<T>(mut foo:T, mut not_foo:T)
where
    T: Array2Variant<u8,TS!(Foo)> + Copy
{
    {
        assert_eq!( foo.fields(fp!(::Foo=>0,1)), Some(( &101, &202 )) );

        assert_eq!( foo.fields_mut(fp!(::Foo=>0,1)), Some(( &mut 101, &mut 202 )) );

        assert_eq!( foo.into_field(fp!(::Foo.0)), Some(101) );
        assert_eq!( foo.into_field(fp!(::Foo.1)), Some(202) );

        assert_eq!( foo.is_variant(fp!(Foo)), true );
    }
    {
        assert_eq!( not_foo.fields(fp!(::Foo=>0,1)), None );

        assert_eq!( not_foo.fields_mut(fp!(::Foo=>0,1)), None );

        assert_eq!( not_foo.into_field(fp!(::Foo.0)), None );
        assert_eq!( not_foo.into_field(fp!(::Foo.1)), None );

        assert_eq!( not_foo.is_variant(fp!(Foo)), false );
    }
}

first_2( Enum::Foo(101,202), Enum::Bar );
first_2( OtherEnum::Foo(101,202,"303"), OtherEnum::Bar );

#[derive(Structural,Copy,Clone)]
# #[struc(no_trait)]
enum Enum{
    Foo(u8,u8),
    Bar,
}

#[derive(Structural,Copy,Clone)]
# #[struc(no_trait)]
enum OtherEnum{
    Foo(u8,u8,&'static str),
    Bar,
}

```

*/

#![allow(non_camel_case_types)]

use crate::{
    field::{IntoField, IntoFieldMut, IntoVariantFieldMut},
    path::array_paths::{
        I0, I1, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I2, I20, I21, I22, I23, I24, I25,
        I26, I27, I28, I29, I3, I30, I31, I4, I5, I6, I7, I8, I9,
    },
};

/*

fn main() {
    use std::fmt::Write;

    const S:&'static str="    ";

    let mut reg=String::new();

    const MAX:usize=32;
    const CHUNK_SIZE:usize=8;
    const CHUNK_COUNT:usize=MAX/CHUNK_SIZE;

    println!("declare_array_traits!{{");
    for i in 0..CHUNK_COUNT {
        let prev=i.saturating_sub(1)*8;
        let curr=i*8;
        let next=(i+1)*8;
        let next=if next==MAX { MAX+1 }else{ next };

        if next<MAX {
            print!("{S}(Array_{0}_{1} [",curr,next,S=S);
            if i!=0 {
                print!("Array_{}_{} ",prev,curr);
            }
            print!("] [");
            for field in curr..next {
                print!("I{0} ",field);
            }
            println!("] )");
        }
        for arr_len in curr..next {
            let _=write!(reg,"{S}(Array{0} [",arr_len,S=S);
            if i!=0 {
                let _=write!(reg,"Array_{}_{} ",prev,curr);
            }
            let _=write!(reg,"] [");
            for field in curr..arr_len {
                let _=write!(reg,"I{0} ",field);
            }
            let _=writeln!(reg,"] )");
        }
    }
    println!("{}",reg);
    println!("}}");
}

*/

macro_rules! declare_array_traits {
    (
        $((
            $(#[$meta:meta])*
            $trait_name:ident
            $trait_name_move:ident
            [$($super


ath a Steel Sky (Germany).png",
  "Named_Boxarts/Benefactor (Europe).png",
  "Named_Boxarts/Best of the Best - Championship Karate (Europe).png",
  "Named_Boxarts/Betrayal (Europe).png",
  "Named_Boxarts/Better Dead Than Alien (Europe).png",
  "Named_Boxarts/Better Dead Than Alien (USA).png",
  "Named_Boxarts/Better Maths (Europe) (Age 12 - 16).png",
  "Named_Boxarts/Beverly Hills Cop (Europe).png",
  "Named_Boxarts/Beyond Dark Castle (Europe).png",
  "Named_Boxarts/Beyond Zork - The Coconut of Quendor (USA) (r57).png",
  "Named_Boxarts/Beyond the Ice Palace (Europe) (Budget - Encore).png",
  "Named_Boxarts/Beyond the Ice Palace (Europe).png",
  "Named_Boxarts/Beyond the Ice Palace + Battleships (Europe) (Compilation - The Story So Far - Vol 1).png",
  "Named_Boxarts/Bi-Fi Roll - Action in Hollywood (Germany) (v1.01) (Promo).png",
  "Named_Boxarts/Big Business (Europe).png",
  "Named_Boxarts/Big Run (Europe).png",
  "Named_Boxarts/Biing! - Sex, Intrigen und Skalpelle (Germany) (AGA).png",
  "Named_Boxarts/Biing! - Sex, Intrigen und Skalpelle (Germany).png",
  "Named_Boxarts/Bill Elliott's NASCAR Challenge (Europe).png",
  "Named_Boxarts/Bill's Tomato Game (Europe) (Demo, Promo) (Bundled with Cytron).png",
  "Named_Boxarts/Bill's Tomato Game (Europe).png",
  "Named_Boxarts/Billiards II Simulator (Europe).png",
  "Named_Boxarts/Billiards Simulator (Europe) (En,Fr,De).png",
  "Named_Boxarts/Bio Challenge (Europe) (Compilation - Light Force).png",
  "Named_Boxarts/Bio Challenge (Europe).png",
  "Named_Boxarts/Bionic Commando (Europe).png",
  "Named_Boxarts/Bionic Commando (USA).png",
  "Named_Boxarts/Birds of Prey (Europe).png",
  "Named_Boxarts/Bismarck (Europe).png",
  "Named_Boxarts/Bismarck (France).png",
  "Named_Boxarts/Black Cauldron, The (Europe) (v2.00) (HLS).png",
  "Named_Boxarts/Black Crypt (Europe).png",
  "Named_Boxarts/Black Gold (Germany) (v1.16 14.1.1992) (Compilation - World of Business).png",
  "Named_Boxarts/Black Gold (Germany).png",
  "Named_Boxarts/Black Hornet (Europe).png",
  "Named_Boxarts/Black Lamp (Europe).png",
  "Named_Boxarts/Black Sect (France).png",
  "Named_Boxarts/Black Shadow (Europe) (Compilation - Computer Hits - Volume Two).png",
  "Named_Boxarts/Black Shadow (Europe).png",
  "Named_Boxarts/Black Tiger (Europe).png",
  "Named_Boxarts/Blackjack Academy (Europe).png",
  "Named_Boxarts/Blade Warrior (Europe) (Budget - Zeppelin Platinum).png",
  "Named_Boxarts/Blade Warrior (Europe).png",
  "Named_Boxarts/Blastaball (Europe).png",
  "Named_Boxarts/Blastar (Europe).png",
  "Named_Boxarts/Blasteroids (Europe).png",
  "Named_Boxarts/Blazing Thunder (Europe).png",
  "Named_Boxarts/Blitzkrieg - Battle at the Ardennes (Europe) (v1.10).png",
  "Named_Boxarts/Blob (Europe) (Compilation - Corkers).png",
  "Named_Boxarts/Blob (Europe).png",
  "Named_Box


/*
 * This file is part of the DSView project.
 * DSView is based on PulseView.
 *
 * Copyright (C) 2021 DreamSourceLab <support@dreamsourcelab.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#ifndef _DS_TIMER_H
#define _DS_TIMER_H

#include <QObject>
#include <functional>
#include <QTimer>
#include <chrono>

using std::chrono::high_resolution_clock;
using std::chrono::milliseconds;

typedef std::function<void()> CALLBACL_FUNC;

class DsTimer : protected QObject
{
     Q_OBJECT

public:
    DsTimer();

    void TimeOut(int millsec, CALLBACL_FUNC f);

    void TimeOut(int millsec);

    void SetCallback(CALLBACL_FUNC f);

    void Start(int millsec, CALLBACL_FUNC f);

    void Start(int millsec);

    void Stop();

    inline bool IsActived(){
        return _isActived;
    }

    long long GetActiveTimeLong();

    void ResetActiveTime();

private slots:
    void on_timeout();

private:
    QTimer          _timer;
    bool            _binded;
    bool            _isActived;
    high_resolution_clock::time_point _beginTime;
    CALLBACL_FUNC   _call;
};

#endif


.info .vip-hinter[data-vip-type]{color:#fff;background-color:#fb7299;border-color:#fb7299}#i_menu_profile .info .uname{line-height:16px;padding-bottom:15px;text-align:center}#i_menu_profile .info .uname b{position:relative;display:inline-block}#i_menu_profile .info .uname .user-info-level{margin-right:0}#i_menu_profile .info .coin,#i_menu_profile .info .score{max-width:70px;text-align:left;float:left;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#i_menu_profile .info .coin{position:relative;max-width:none;overflow:visible}#i_menu_profile .info .coin:hover{color:#00a1d6}#i_menu_profile .info .coin.hover-first .b-back{-webkit-animation:coin-bounce 1s cubic-bezier(0.45,0.05,0.55,0.95) .2s;-moz-animation:coin-bounce 1s cubic-bezier(0.45,0.05,0.55,0.95) .2s;animation:coin-bounce 1s cubic-bezier(0.45,0.05,0.55,0.95) .2s}#i_menu_profile .info .coin.hover-first .pre{top:18px}#i_menu_profile .info .coin.hover-first .cur{top:0}#i_menu_profile .info .coin.hover-first .reward-for-login{*filter:alpha(opacity=0);filter:alpha(opacity=0) \9;opacity:0;transition:.4s ease 1.6s}:root #i_menu_profile .info .coin.hover-first .reward-for-login{filter:alpha(opacity=100)}#i_menu_profile .info .coin.hover-again .pre{top:18px}#i_menu_profile .info .coin.hover-again .cur{top:0}#i_menu_profile .info .coin.hover-again .reward-for-login{*filter:alpha(opacity=0);filter:alpha(opacity=0) \9;opacity:0}:root #i_menu_profile .info .coin.hover-again .reward-for-login{filter:alpha(opacity=100)}#i_menu_profile .info .coin .b-back{display:block;position:absolute;z-index:1;top:0;left:0;width:18px;height:18px;margin-right:10px;background:url("/images/base/icons.png") no-repeat -279px -1495px}@keyframes -webkit-coin-bounce{0%{-webkit-transform:translateY(0px) rotateY(0deg)}60%{-webkit-transform:translateY(-42px) rotateY(360deg)}100%{-webkit-transform:translateY(0px)}}@keyframes -moz-coin-bounce{0%{-moz-transform:translateY(0px) rotateY(0deg)}60%{-moz-transform:translateY(-42px) rotateY(360deg)}100%{-moz-transform:translateY(0px)}}@keyframes coin-bounce{0%{transform:translateY(0px) rotateY(0deg)}60%{transform:translateY(-42px) rotateY(360deg)}100%{transform:translateY(0px)}}#i_menu_profile .info .coin .outside{position:relative;display:inline-block;vertical-align:top;width:90px;height:18px;overflow:hidden}#i_menu_profile .info .coin .pre,#i_menu_profile .info .coin .cur{position:absolute;top:0;left:0;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:18px;line-height:18px;transition:all .5s}#i_menu_profile .info .coin .cur{top:-18px}#i_menu_profile .info .coin .reward-for-login{*filter:alpha(opacity=100);fil


((e) => -e.value.tracks.getTotalListenCount());
        break;
      case GroupSortType.firstListen:
        sortThis((e) => e.value.tracks.getFirstListen() ?? DateTime(99999).millisecondsSinceEpoch);
        break;
      case GroupSortType.latestPlayed:
        sortThis((e) => -(e.value.tracks.getLatestListen() ?? 0));
        break;
      case GroupSortType.shuffle:
        playlistList.shuffle();
        break;

      default:
        null;
    }
  }

  Future<void> prepareAllPlaylists() async => await super.prepareAllPlaylistsFile();

  @override
  String get EMPTY_NAME => lang.PLEASE_ENTER_A_NAME;

  @override
  String get NAME_CONTAINS_BAD_CHARACTER => lang.NAME_CONTAINS_BAD_CHARACTER;

  @override
  String get SAME_NAME_EXISTS => lang.PLEASE_ENTER_A_DIFFERENT_NAME;

  @override
  String get NAME_IS_NOT_ALLOWED => lang.PLEASE_ENTER_A_DIFFERENT_NAME;

  @override
  String get PLAYLIST_NAME_FAV => k_PLAYLIST_NAME_FAV;

  @override
  String get PLAYLIST_NAME_HISTORY => k_PLAYLIST_NAME_HISTORY;

  @override
  String get PLAYLIST_NAME_MOST_PLAYED => k_PLAYLIST_NAME_MOST_PLAYED;

  @override
  FutureOr<bool> canRemovePlaylist(YoutubePlaylist playlist) {
    // -- note: popping page is managed internally inside [YTNormalPlaylistSubpage]
    return true;
  }

  @override
  void onPlaylistRemovedFromMap(YoutubePlaylist playlist) {
    // -- the ui uses the playlist map directly. this can be used to remove from other lists if required.
  }

  @override
  Map<String, dynamic> itemToJson(YoutubeID item) => item.toJson();

  @override
  dynamic sortToJson(List<YTSortType> items) => items.map((e) => e.name).toList();

  @override
  String get favouritePlaylistPath => AppPaths.YT_LIKES_PLAYLIST;

  @override
  String get playlistsDirectory => AppDirs.YT_PLAYLISTS;

  @override
  String get playlistsArtworksDirectory => AppDirs.YT_PLAYLISTS_ARTWORKS;

  @override
  bool get sortAfterPreparing => false;

  @override
  Future<Map<String, YoutubePlaylist>> prepareAllPlaylistsFunction() async {
    final params = _ReadPlaylistFilesParams(
      path: playlistsDirectory,
      sortBy: settings.ytPlaylistSort.value,
      reverse: settings.ytPlaylistSortReversed.value,
    );

    return await _readPlaylistFilesCompute.thready(params);
  }

  @override
  Future<YoutubePlaylist?> prepareFavouritePlaylistFunction() {
    return _prepareFavouritesFile.thready(favouritePlaylistPath);
  }

  static YoutubePlaylist? _prepareFavouritesFile(String path) {
    try {
      final response = File(path).readAsJsonSync();
      return YoutubePlaylist.fromJson(response, (itemJson) => YoutubeID.fromJson(itemJson), _sortFromJson);
    } catch (_) {
      return null;
    }
  }

  static Map<String, YoutubePlaylist> _readPlaylistFilesCompute(_ReadPlaylistFilesParams params) {
    final entries = <MapEntry<String, YoutubePlaylist>>[];
    final files = Directory(params.path).listSyncSafe();
    final filesL = files.length;
    for (int i = 0; i < filesL; i++) {
      var f = files[i];
      if (f is File) {
        try {
          final response = f.readAsJsonSync(ensureExists: false);
          final pl = YoutubePlaylist.fromJson(response, (itemJson) => YoutubeID.fromJson(itemJson), _sortFromJson);
          en


Border}}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.theme-brand .dark .mat-mdc-progress-bar .mdc-linear-progress__buffer-dots,.theme-brand.dark .mat-mdc-progress-bar .mdc-linear-progress__buffer-dots{background-color:transparent;background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(33, 150, 243, 0.25)'/%3E%3C/svg%3E")}}.theme-brand .dark .mat-mdc-progress-bar .mdc-linear-progress__buffer-bar,.theme-brand.dark .mat-mdc-progress-bar .mdc-linear-progress__buffer-bar{background-color:#2196f340;background-color:var(--mdc-linear-progress-track-color, rgba(33, 150, 243, .25))}.theme-brand .dark .mat-mdc-progress-bar.mat-accent,.theme-brand.dark .mat-mdc-progress-bar.mat-accent{--mdc-linear-progress-active-indicator-color: #1e293b;--mdc-linear-progress-track-color: rgba(30, 41, 59, .25)}.theme-brand .dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots,.theme-brand.dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots{background-color:#1e293b40;background-color:var(--mdc-linear-progress-track-color, rgba(30, 41, 59, .25))}@media (forced-colors: active){.theme-brand .dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots,.theme-brand.dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots{background-color:ButtonBorder}}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.theme-brand .dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots,.theme-brand.dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-dots{background-color:transparent;background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(30, 41, 59, 0.25)'/%3E%3C/svg%3E")}}.theme-brand .dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-bar,.theme-brand.dark .mat-mdc-progress-bar.mat-accent .mdc-linear-progress__buffer-bar{background-color:#1e293b40;background-color:var(--mdc-linear-progress-track-color, rgba(30, 41, 59, .25))}.theme-brand .dark .mat-mdc-progress-bar.mat-warn,.theme-brand.dark .mat-mdc-progress-bar.mat-warn{--mdc-linear-progress-active-indicator-color: #dc


OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  @webassemblyjs/ieee754@1.11.5

https://github.com/xtuc/webassemblyjs

  The MIT License (MIT)

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  @webassemblyjs/leb128@1.11.5

https://github.com/xtuc/webassemblyjs

  Copyright 2012 The Obvious Corporation. http://obvious.com/

  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

  ------------------------------------------------------------------------- Apache License Version 2.0, January 2004 http://www.apache.org/licenses/

  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

  1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted


ict_page(uint64_t page_id);

    // File operations
    bool open_file(const std::string& filename, bool create_new);
    void close_file();
    uint64_t get_file_size();
};
```

#### File Header and Metadata
```c
class FileMetadata {
private:
    FileHeader header;
    std::vector<ColumnMetadata> columns;

public:
    // File operations
    bool create_new_file(const std::string& filename);
    bool open_existing_file(const std::string& filename);

    // Column management
    void add_column(const std::string& name, DataType type);
    ColumnMetadata* get_column(const std::string& name);

    // Statistics
    void update_statistics(const std::string& column, const ColumnStatistics& stats);
    ColumnStatistics get_statistics(const std::string& column);
};
```

### Phase 2: B+ Tree Implementation (Weeks 5-8)

#### Generic B+ Tree
```c
template<typename KeyType, typename ValueType>
class BPlusTree {
private:
    uint64_t root_page_id;
    PageManager* page_manager;
    KeyComparator<KeyType> comparator;

public:
    // Search operations
    std::vector<ValueType> find(const KeyType& key);
    std::vector<ValueType> range_search(const KeyType& min, const KeyType& max);

    // Bulk loading (for immutable design)
    void bulk_load(std::vector<std::pair<KeyType, ValueType>>& sorted_data);

    // Iterator support
    class Iterator {
        // Implementation for range scans
    };
    Iterator begin();
    Iterator end();
    Iterator lower_bound(const KeyType& key);
    Iterator upper_bound(const KeyType& key);
};
```

#### Type-Specific Implementations
```c
// Specialized implementations for different data types
using IntegerBTree = BPlusTree<int64_t, uint64_t>;
using DoubleBTree = BPlusTree<double, uint64_t>;
using StringBTree = BPlusTree<std::string, uint64_t>;
using BinaryBTree = BPlusTree<std::vector<uint8_t>, uint64_t>;

// Key comparators
template<>
struct KeyComparator<double> {
    int operator()(const double& a, const double& b) const {
        // Handle NaN and infinity cases
        if (std::isnan(a) && std::isnan(b)) return 0;
        if (std::isnan(a)) return 1;
        if (std::isnan(b)) return -1;
        return (a < b) ? -1 : (a > b) ? 1 : 0;
    }
};
```

### Phase 3: RoaringBitmap Integration (Weeks 9-10)

#### Bitmap Management
```c
class BitmapManager {
private:
    PageManager* page_manager;
    std::unordered_map<uint64_t, roaring::Roaring> bitmap_cache;

public:
    // Bitmap operations
    uint64_t store_bitmap(const roaring::Roaring& bitmap);
    roaring::Roaring load_bitmap(uint64_t page_id);

    // Set operations
    roaring::Roaring intersect(const std::vector<uint64_t>& bitmap_pages);
    roaring::Roaring union_bitmaps(const std::vector<uint64_t>& bitmap_pages);
    roaring::Roaring negate_bitmap(uint64_t bitmap_page, uint64_t total_rows);

    // Utility functions
    std::vector<uint64_t> extract_row_numbers(const roaring::Roaring& bitmap);
    uint64_t count_set_bits(uint64_t bitmap_page);
};
```

#### Value Storage Decision Logic
```c
class ValueStorageManager {
public:
    struct StorageDecision {
        enum Type { DIRECT, SMALL_ARRAY, ROARING_BITMAP } type;
        uint64_t storage_location;
        uint32_t value_count;
    };

    StorageDecision decide_storage(const std::vector<uint64_t>& row_numbers) {
        StorageDecision decision;
        decision.value_count = row_numbers.size(