.content.startsWith("true"))
            {
                embedBuilder.content[embedBuilder.content.length-1].inline = true;
            }
            embedBuilder.fields--;
            if(embedBuilder.fields <= 0)
            {
               embedBuilder.state = EmbedBuilderState.REQUESTING_COLOR
               message.channel.send("**Saved!**\nPlease type the color you want in #RRGGBB format:")
            }
            else {
                embedBuilder.state = EmbedBuilderState.REQUESTING_FIELD_NAME
                message.channel.send("**Field Saved!**\nPlease type the next field name you want:")
            }
        }
      }
  }

/**
 * saves the color and requests the next thing
 */
export function requestColor(message : Message) : void
{
    if(!/^#[0-9A-F]{6}$/i.test(message.content))
    {
        message.channel.send("**Error!**\nPlease type the color you want in #RRGGBB format:")
        return;
    }

    if(message.member)
    {
        // save color
        var embedBuilder = embedHolder.get(message.member);
        if(embedBuilder)
        {
            embedBuilder.color = message.content
            embedBuilder.state = EmbedBuilderState.REQUESTING_TARGET_CHANNEL
            message.channel.send("**Saved!**\nPlease mention the channel you want to post in:")
        }
    }

}

/**
 * saves the target channel, shows a preview and waits for confirmation
 */
export function requestTargetChannel(message : Message) : void
{
    if(message.member)
    {
        // save target channel
        var targetChannel = message.mentions.channels.first()
        if(targetChannel === undefined)
        {
            message.channel.send("**Error!**\nPlease mention the channel you want to post in:")
            return;
        }
        var embedBuilder = embedHolder.get(message.member);
        if(targetChannel && embedBuilder)
        {
            embedBuilder.targetChannelID = targetChannel.id
            embedBuilder.state = EmbedBuilderState.READY
        }

        // show preview
        var embed = embedHolder.get(message.member)
        if(embed)
        {
            var messageEmbed = new MessageEmbed()
            .setTitle(embed.title)
            .setFooter(`Lore Network`/* - ${formatCurrentDateTime()}`*/, iconURL)
            .setColor(embed.color)
            .addFields(embed.content)
            .setTimestamp()

            message.channel.send(messageEmbed)
            message.channel.send("**Saved!**\nTo send the embed, type \"send\", to cancel type \"cancel\":")
        }
    }
}

/**
 * sends the embed and removes everything
 */
export function sendEmbed(message : Message)
{
    if(message.member)
    {
        var embed = embedHolder.get(message.member)
        if(embed)
        {
            if(message.guild)
            {
                var channel : TextChannel = message.guild.channels.cache.get(embed.targetChannelID) as TextChannel
                var messageEmbed : MessageEmbed = new MessageEmbed()
                .setTitle(embed.title)
                .setFooter(`Lore Network`/* - ${formatCurrentDateTime()}`*/, iconURL)
                .setColor(embed.color)
                .addFields(embed.content)
                .setTimestamp()

                channel.send(messageEmbed)
                message.channel.send("**Sent!**")
                embedHolder.delete(message.member)
            }
        }
    }
}

/**
 * cancels the embed and removes everything
 */
export function cancelEmbed(message : Me


.3.min.js"},
      { load: "edge_includes/edge.3.0.0.min.js"},
      { load: "LightControl_edge.js"},
      { load: "LightControl_edgeActions.js"}];

if (AdobeEdge.bootstrapLoading) { signaledLoading = true; AdobeEdge.loadResources=doLoadResources; AdobeEdge.playWhenReady=playWhenReady; }

loadResources(aLoader, doDelayLoad);

var plSTF="width",ctrPlS="both",minPlW="0",maxPlW=undefined,plWidth="550px",plHeight="334px";

preContent={dom: [ ]};//simpleContent

dlContent={dom: [ ]};//simpleContent

})( "EDGE-1952032168");/**
 * Adobe Edge: symbol definitions
 */
(function($, Edge, compId){
//images folder
var im='images/';

var fonts = {};
var opts = {};
var resources = [
];
var symbols = {
"stage": {
    version: "3.0.0",
    minimumCompatibleVersion: "3.0.0",
    build: "3.0.0.322",
    baseState: "Base State",
    scaleToFit: "width",
    centerStage: "both",
    initialState: "Base State",
    gpuAccelerate: false,
    resizeInstances: false,
    content: {
            dom: [
            {
                id: 'ControlButton',
                type: 'rect',
                rect: ['329', '141','auto','auto','auto', 'auto'],
                title: 'Open Door'
            }],
            symbolInstances: [
            {
                id: 'ControlButton',
                symbolName: 'MainMenuButton_S',
                autoPlay: {

                }
            }
            ]
        },
    states: {
        "Base State": {
            "${_Stage}": [
                ["color", "background-color", 'rgba(23,23,23,1.00)'],
                ["style", "overflow", 'hidden'],
                ["style", "height", '334px'],
                ["style", "width", '550px']
            ],
            "${_ControlButton}": [
                ["style", "left", '165px'],
                ["style", "top", '141px']
            ]
        }
    },
    timelines: {
        "Default Timeline": {
            fromState: "Base State",
            toState: "",
            duration: 0,
            autoPlay: true,
            timeline: [
                { id: "eid9", tween: [ "style", "${_ControlButton}", "top", '141px', { fromValue: '141px'}], position: 0, duration: 0 },
                { id: "eid8", tween: [ "style", "${_ControlButton}", "left", '165px', { fromValue: '165px'}], position: 0, duration: 0 }            ]
        }
    }
},
"MainMenuButton_S": {
    version: "3.0.0",
    minimumCompatibleVersion: "3.0.0",
    build: "3.0.0.322",
    baseState: "Base State",
    scaleToFit: "none",
    centerStage: "none",
    initialState: "Base State",
    gpuAccelerate: false,
    resizeInstances: true,
    content: {
            dom: [
                {
                    rect: ['0px', '0px', '220px', '52px', 'auto', 'auto'],
                    borderRadius: ['10px', '10px', '10px', '10px'],
                    id: 'Normal',
                    stroke: [0, 'rgb(0, 0, 0)', 'none'],
                    type: 'rect',
                    fill: ['rgba(211,203,115,1.00)']
                },
                {
                    rect: ['0px', '0px', '224px', '65px', 'auto', 'auto'],
                    borderRadius: ['10px', '10px', '10px', '10px'],
                    type: 'rect',
                    id: 'Highlight',
                    stroke: [0, 'rgb(0, 0, 0)', 'none'],
                    display: 'none',
                    fill: ['rgba(178,169,192,1.00)'


            .deleted
            .iter()
            .map(|record| record.digest.clone()),
    );
    let path_index: HashMap<String, &RefCell<FileRecord>> = HashMap::from_iter(
        archive_metadata
            .expected
            .iter()
            .map(|r| (r.borrow().path.clone(), r)),
    );
    let digest_index: HashMap<FileDigest, &RefCell<FileRecord>> = HashMap::from_iter(
        archive_metadata
            .expected
            .iter()
            .map(|r| (r.borrow().digest.clone(), r)),
    );
    for record in records {
        // Rename dupes.
        if let Some(existing_path) = existing_paths.get(&(record.mtime, record.digest.clone())) {
            rename_with_prefix(
                process_dir,
                &record.path,
                "DUPE.",
                Some(&archive_dir.join(existing_path).to_string_lossy()),
            )?;
            continue;
        }
        // Rename changed files.
        if let Some(expected_cell) = path_index.get(&record.path) {
            if expected_cell.borrow().digest != record.digest {
                rename_with_prefix(process_dir, &record.path, "CHANGED.", None)?;
                continue;
            }
        }
        // Rename files with mtime changed.
        if let Some(expected_cell) = digest_index.get(&record.digest) {
            if expected_cell.borrow().mtime != record.mtime {
                rename_with_prefix(process_dir, &record.path, "METADATA.", None)?;
                continue;
            }
        }
        // Rename previously deleted files.
        if deleted_digests.contains(&record.digest) {
            rename_with_prefix(process_dir, &record.path, "DELETED.", None)?;
            continue;
        }
        // Remember new files.
        new_files.push(record);
    }
    if new_files.is_empty() {
        remove_file_if_exists(&process_metadata_json_path)?;
    } else {
        write_json_file(&new_files, &process_metadata_json_path)?;
    }
    Ok(())
}

fn main() -> Result<(), Box<String>> {
    let opt = get_opt();
    let archive_metadata_path = opt.archive.join(ARCHIVE_METADATA_JSON);
    let mut archive_metadata: ArchiveMetadata = read_json_file(&archive_metadata_path, false)?;
    normalize(&mut archive_metadata);
    let mut actual_records: Vec<FileRecord> = Vec::new();
    walk_dir(&opt.archive, &mut actual_records)?;
    let all_ok = check_for_existing_and_changed_files(
        &archive_metadata.expected,
        &mut actual_records,
        &opt.archive,
    )? & check_for_renamed_files(&archive_metadata.expected, &mut actual_records)?
        & check_for_deleted_files(&mut archive_metadata)?;
    check_for_new_files(&mut archive_metadata, &mut actual_records);
    if all_ok {
        println!("Verified {}", opt.archive.to_string_lossy());
    }
    if let Some(process_dir) = opt.process {
        process_files(&mut archive_metadata, &opt.archive, &process_dir)?;
    }
    write_archive_metadata(&archive_


an when compiling with clang
	filter "toolset:clang"
			buildoptions { "-fsanitize=undefined", "-fsanitize=address" } -- , "-fsanitize=memory" }
			linkoptions { "-fsanitize=undefined", "-fsanitize=address" } --, "-fsanitize=memory" }

	-- linux library cflags and libs
	filter "system:linux"
		buildoptions {
			"`pkg-config --cflags sdl2`",
			"`pkg-config --cflags gl`",
			"`pkg-config --cflags glu`",
			"-Wno-parentheses" -- Disable parentheses warning for the Tests target, as Catch's macros generate this everywhere.
		}
		l


 { background: url('../img/profiles/dl.jpg') no-repeat; background-size: cover; }
	.SUM.profiles_player_card, .BS.profiles_player_card, .DSM.profiles_player_card, .DS.profiles_player_card, .ESUM.profiles_player_card { background: url('../img/profiles/sum.jpg') no-repeat; background-size: cover; }
	.RF.profiles_player_card, .FM.profiles_player_card, .FB.profiles_player_card, .BF.profiles_player_card { background: url('../img/profiles/rf.jpg') no-repeat; background-size: cover; }
	.GL.profiles_player_card, .ML.profiles_player_card, .SL.profiles_player_card, .AL.profiles_player_card { background: url('../img/profiles/gl.jpg') no-repeat; background-size: cover; }
	.RW.profiles_player_card, .RSM.profiles_player_card, .GRM.profiles_player_card, .MRW.profiles_player_card, .IRW.profiles_player_card { background: url('../img/profiles/rw.jpg') no-repeat; background-size: cover; }
	.SLR.profiles_player_card, .SLRR.profiles_player_card, .MSLR.profiles_player_card, .SLTR.profiles_player_card, .RS.profiles_player_card { background: url('../img/profiles/sl.jpg') no-repeat; background-size: cover; }
	.GC.profiles_player_card, .GB.profiles_player_card, .MGB.profiles_player_card, .HGC.profiles_player_card, .MGC.profiles_player_card { background: url('../img/profiles/gc.jpg') no-repeat; background-size: cover; }
	.LIW.profiles_player_card, .LIM.profiles_player_card, .SHW.profiles_player_card, .LUW.profiles_player_card, .GLW.profiles_player_card { background: url('../img/profiles/liw.jpg') no-repeat; background-size: cover; }
	.LEM.profiles_player_card, .WAM.profiles_player_card, .ARM.profiles_player_card, .MYM.profiles_player_card, .BAM.profiles_player_card { background: url('../img/profiles/lem.jpg') no-repeat; background-size: cover; }
	.IK.profiles_player_card, .MIK.profiles_player_card, .IM.profiles_player_card, .MYK.profiles_player_card, .PPK.profiles_player_card { background: url('../img/profiles/ik.jpg') no-repeat; background-size: cover; }
	.ALC.profiles_player_card, .ALMN.profiles_player_card, .ALMTR.profiles_player_card, .ALFC.profiles_player_card, .CRE.profiles_player_card { background: url('../img/profiles/alc.jpg') no-repeat; background-size: cover; }

.profiles_player_content {
	float: right;
	width: 50%;
	color: #fff;
}

.profiles_player_table {
	width: 100%;
}

.profiles_player_table .cname {
	font-family: 'Cinzel', serif;
	text-align: center;
	font-size: 24px;
	color: #fff;
	font-weight: bold;
}

.profiles_player_table .cclass {
	text-align: center;
	font-size: 11px;
	color: #eee;
}

.profiles_player_table .isoffline {
	color: #ff0000;
}

.profiles_player_table


/*
 * arch/score/mm/extable.c
 *
 * Score Processor version.
 *
 * Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
 *  Lennox Wu <lennox.wu@sunplusct.com>
 *  Chen Liqin <liqin.chen@sunplusct.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, see the file COPYING, or write
 * to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <linux/module.h>

int fixup_exception(struct pt_regs *regs)
{
	const struct exception_table_entry *fixup;

	fixup = search_exception_tables(regs->cp0_epc);
	if (fixup) {
		regs->cp0_epc = fixup->fixup;
		return 1;
	}
	return 0;
}


.22 and adding to acc */
    out = ((x2 * (0xFFFFF - yfract)));
    acc += (((q63_t) out * (xfract)));

    /* y1 * (1 - xfract) * (yfract)  in 2.22 and adding to acc */
    out = ((y1 * (0xFFFFF - xfract)));
    acc += (((q63_t) out * (yfract)));

    /* y2 * (xfract) * (yfract)  in 2.22 and adding to acc */
    out = ((y2 * (yfract)));
    acc += (((q63_t) out * (xfract)));

    /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
    return (acc >> 40);

  }

  /**
   * @} end of BilinearInterpolate group
   */

#ifdef	__cplusplus
}
#endif

#endif /* _ARM_MATH_H */

/**
 *
 * End of file.
 */


同党内走资派的复辟倒退活动紧密联系在一起的，要重视挖他们的后台。”目的就是妄图改变专政性质，倒转专政矛头，把专政机关这把刀子砍向党内，为“四人帮”篡夺党和国家的最高领导权的反革命阴谋效劳。

   祝    家    耀一九七七年六月七日

    注：施义之，原公安部党的核心小组负责人。祝家耀、张其瑞，原公安部党的核心小组成员。

   （四）施义之在全国公安局长座谈会议期间的反党讲话

   一九七六年六月，公安部召开全国公安局长座谈会。华国锋同志指示这次会议的任务是研究打击现行反革命的问题。但是，施义之、祝家耀秉承“四人帮”的旨意，篡改会议方向，把会议引向讨论“对走资派怎样实行无产阶级专政”的问题。

   下面是施义之的反党讲话记录（节录）

   影印件原文

   召集人会议：1976。6．18．于前门饭店晚7．5.    355（房间）

   施义之同志指示：

   各组讨论的问题：

   （1）研究敌人活动特点规律，就得研究社会主义革命时期，谁是我们的敌人谁是我们的朋（友）。

   （2）为什么党内资产阶级和反革命联系起来。

   （3）敌人制造散布谣言，在社会上有市场，在内部市场多为什么？研究下谣言的欺骗性。

   （4）公安机关如何适应当前斗争形势。

   A、斗争的对象、任务变了，斗争的矛头应对准谁。

   B、斗争的形势、斗争的手段有那些变化。

   C、同党内资产


 noteBlockDefinitions.reduce(
  (previousMap: NoteBlockDefinitionMap, noteBlockDefinition: NoteBlockDefinition) => ({
    ...previousMap,
    [noteBlockDefinition.type]: noteBlockDefinition,
  }),
  {},
);

export default noteBlockDefinitions;
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import {BehaviorSubject} from 'rxjs';
@Injectable({
  providedIn: 'root'
})

export class DateService {

  public date: BehaviorSubject<moment.Moment> = new BehaviorSubject(moment());

  public calendarDate: BehaviorSubject<moment.Moment> = new BehaviorSubject(moment());

  public dateFilter = 'm';
  public choiceFirstDay = moment();
  public choiceLastDay = moment();
  public lastDayMonth = this.date.value.clone().endOf('month');

  constructor() {
  }

  go(dir: number): void {
    switch (this.dateFilter) {
      case 'd':
        this.date.next(this.date.value.add(dir, 'day'));
        break;
      case 't':
        this.date.next(this.date.value.add(dir, 'day'));
        break;
      case 'w':
        this.date.next(this.date.value.add(dir, 'week'));
        break;
      case 'm':
        this.changeMonth(dir);
        break;
      case 'y':
        this.changeYear(dir);
        break;
      case 'r':
        this.changeRange(dir);
        break;
    }
    this.lastDayMonth = this.date.value.clone().endOf('month');
  }

  changeMonth(dir: number, typeDate?: string): void {
    typeDate === 'cd' ?
      this.calendarDate.next(this.calendarDate.value.add(dir, 'month')) :
      this.date.next(this.date.value.add(dir, 'month'));
  }

  changeYear(dir: number, typeDate?: string): void {
    typeDate === 'cd' ?
      this.calendarDate.next(this.calendarDate.value.add(dir, 'year')) :
      this.date.next(this.date.value.add(dir, 'year'));
  }

  changeRange(dir: number): void {
    let difference = this.choiceLastDay.startOf('day')
      .diff(this.choiceFirstDay.startOf('day'), 'day');
    dir > 0 ? difference = difference * dir + 1 : difference = difference * dir - 1;
    this.choiceFirstDay.add(difference, 'day');
    this.choiceLastDay.add(difference, 'day');
    this.date.next(this.choiceFirstDay);
  }

  selectDay(date: moment.Moment): void {
    const value = this.calendarDate.value.set({
      date: date.date(),
      month: date.month(),
      year: date.year()
    });
    this.calendarDate.next(value);
  }
}

export const AddressTypes =
  [
    { value: 'shipping', label: 'Shipping' },
    { value: 'billing', label: 'Billing' },
  ]

export class Address {
  nameAddress: string = 'shipping';
  address: string = '';
  address2: string = '';
  city: string = '';
  cities: string[] = [];
  state: string = '';
  zip: string = '';
  country: string = '';
}
interface EventPayloads {
  start: {
    user: string;
  };
  stop: {
    user: string;
    after: number;
  };
  end: {};
}

type Spread<Ev, EvOrig, E> = Ev extends keyof E
  ? EvOrig[] extends Ev[]
    ? E[Ev]
    : never
  : never;

class EventDischarger2<E> {
  emit<Ev extends keyof E>(eventName: Ev, payload: Spread<Ev, Ev, E>) {
    // 省略
  }
}

// 使用例
const ed2 = new EventDischarger2<EventPayloads>();
ed2.emit('start', {
  user: 'user1',
});
ed2.emit('stop', {
  user: 'user1',
  after: 3,
});
ed2.emit('en


 null));
		list2.add(new Wood("sumac_lacquer", FoodInit.LOG_SU_LACQUER, FoodInit.PLANK_SU_LACQUER, BuildInit.STAIRS_SUMAC, BuildInit.SLIM_STAIRS_SUMAC, BuildInit.SLAB_SUMAC, BuildInit.FENCE_SUMAC,
				BuildInit.DOOR_SUMAC, BuildInit.TRAPDOOR_SUMAC));
		list2.add(new Wood("lacquerware", () -> null, FoodInit.PLANK_LACQUERWARE, BuildInit.STAIRS_LACQUER, BuildInit.SLIM_STAIRS_LACQUER, BuildInit.SLAB_LACQUER, BuildInit.FENCE_LACQUER,
				BuildInit.DOOR_LACQUER, BuildInit.TRAPDOOR_LACQUER));
		list2.add(new Wood("sorghum", () -> null, FoodInit.PLANK_RE_SORGHUM, BuildInit.STAIRS_SORGHUM, BuildInit.SLIM_STAIRS_SORGHUM, BuildInit.SLAB_SORGHUM, BuildInit.FENCE_SORGHUM, () -> null,
				() -> null));
		woods = list2.build();
	}

	public record Seeding(
			Supplier<? extends ItemLike> output,
			Supplier<Item> input,
			int count) {}

	public record Wood(
			String name,
			Supplier<Block> logBlock,
			Supplier<Block> plankBlock,
			Supplier<Block> stairsBlock,
			Supplier<Block> slimStairsBlock,
			Supplier<Block> slabBlock,
			Supplier<Block> fenceBlock,
			Supplier<Block> doorBlock,
			Supplier<Block> trapdoorBlock) {}

	public static void addCompostables() {
		ComposterBlock.COMPOSTABLES.put(FoodInit.DUST_ASH.get(), 0.3F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_BR_RAPESEED.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_BR_GREEN.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_BR_CABBAGE.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_BR_RADISH.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_CR_OAT.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_CR_RYE.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_CR_BARLEY.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_PE_GREEN.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_PE_GARBANZO.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_PE_SOY.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_PE_ADZUKI.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_RE_SORGHUM.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.CROP_RE_CORN.get(), 0.65F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FEED_STRAW.get(), 0.5F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FEED_HAY.get(), 0.5F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FEED_COMPOUND.get(), 0.5F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FOOD_LEAF_MOLD.get(), 0.85F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FOOD_PRESS_CAKE.get(), 0.85F);
		ComposterBlock.COMPOSTABLES.put(FoodInit.FOOD_FISH_POWDER.get(), 0.85F);
		ComposterBlock.COMPOSTABLES.pu


lampToGround"/>.
        /// </remarks>
        [KmlElement("maxAltitude", 2)]
        public double? MaximumAltitude { get; set; }

        /// <summary>
        /// Gets or sets the minimum altitude in meters above the vertical datum.
        /// </summary>
        /// <remarks>
        /// This property is affected by <see cref="AltitudeMode"/> and must
        /// be less than or equal to <see cref="MaximumAltitude"/>. If both
        /// <c>MinimumAltitude</c> and <c>MaximumAltitude</c> are specified,
        /// <c>AltitudeMode</c> shall not have a value of
        /// <see cref="Dom.AltitudeMode.ClampToGround"/>.
        /// </remarks>
        [KmlElement("minAltitude", 1)]
        public double? MinimumAltitude { get; set; }

        /// <summary>
        /// Gets or sets extended altitude mode information.
        /// [Google Extension]
        /// </summary>
        [KmlElement("altitudeMode", KmlNamespaces.GX22Namespace, 4)]
        public GX.AltitudeMode? GXAltitudeMode { get; set; }
    }
}


,0xd6,0xfa,0x04,0x0e,0x04,0x01,0x40,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, v255 row_half_mirror
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xfe,0x07,0x01,0x41,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, s105 row_shl:1
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xa6,0x01,0x01,0x01,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, vcc_hi row_shl:15
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xae,0x01,0x01,0x0f,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, vcc_lo row_shr:1
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xaa,0x01,0x01,0x11,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, ttmp15 row_shr:15
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xee,0x01,0x01,0x1f,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, exec_hi row_ror:1
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xfe,0x01,0x01,0x21,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, exec_lo row_ror:15
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xfa,0x01,0x01,0x2f,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, null row_share:0 row_mask:0xf bank_mask:0xf
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xf2,0x01,0x01,0x50,0x01,0xff]

v_add_lshl_u32_e64_dpp v5, v1, v2, -1 row_share:15 row_mask:0x0 bank_mask:0x1
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0x06,0x03,0x01,0x5f,0x01,0x01]

v_add_lshl_u32_e64_dpp v5, v1, v2, 0.5 row_xmask:0 row_mask:0x1 bank_mask:0x3 bound_ctrl:1 fi:0
// GFX12: [0x05,0x00,0x47,0xd6,0xfa,0x04,0xc2,0x03,0x01,0x60,0x09,0x13]

v_add_lshl_u32_e6


			int32_t L_58 = V_7;
			NullCheck(L_57);
			RuntimeObject * L_59 = (RuntimeObject *)((L_57)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_58)))->get_key_2();
			EntryU5BU5D_t72113B36C1268236715BADBA0FB14031D9164FD4* L_60 = V_6;
			int32_t L_61 = V_7;
			NullCheck(L_60);
			ResourceLocator_t1783916E271C27CB09DF57E7E5ED08ECA4B3275C  L_62 = (ResourceLocator_t1783916E271C27CB09DF57E7E5ED08ECA4B3275C )((L_60)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_61)))->get_value_3();
			KeyValuePair_2_t2D8427F03B42441C4598C9D3AAB86FBA90CDF7F6  L_63;
			memset((&L_63), 0, sizeof(L_63));
			KeyValuePair_2__ctor_m036B07A37CD133C33431E3A1AD0C3A57DBC521F0((&L_63), (RuntimeObject *)L_59, (ResourceLocator_t1783916E271C27CB09DF57E7E5ED08ECA4B3275C )L_62, /*hidden argument*/IL2CPP_RGCTX_METHOD_INFO(method->klass->rgctx_data, 26));
			KeyValuePair_2_t2D8427F03B42441C4598C9D3AAB86FBA90CDF7F6  L_64 = L_63;
			RuntimeObject * L_65 = Box(IL2CPP_RGCTX_DATA(method->klass->rgctx_data, 25), &L_64);
			NullCheck(L_54);
			ArrayElementTypeCheck (L_54, L_65);
			(L_54)->SetAt(static_cast<il2cpp_array_size_t>(L_56), (RuntimeObject *)L_65);
		}

IL_016d:
		{
			int32_t L_66 = V_7;
			V_7 = (int32_t)((int32_t)il2cpp_codegen_add((int32_t)L_66, (int32_t)1));
		}

IL_0173:
		{
			int32_t L_67 = V_7;
			int32_t L_68 = V_5;
			if ((((int32_t)L_67) < ((int32_t)L_68)))
			{
				goto IL_012d;
			}
		}

IL_0179:
		{
			goto IL_018c;
		}
	} // end try (depth: 1)
	catch(Il2CppExceptionWrapper& e)
	{
		__exception_local = (Exception_t *)e.ex;
		if(il2cpp_codegen_class_is_assignable_from (ArrayTypeMismatchException_tE34C1032B089C37399200997F079C640D23D9499_il2cpp_TypeInfo_var, il2cpp_codegen_object_class(e.ex)))
			goto CATCH_017b;
		throw e;
	}

CATCH_017b:
	{ // begin catch(System.ArrayTypeMismatchException)
		ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 * L_69 = (ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 *)il2cpp_codegen_object_


     }

        static void countPressed(void *btn_ptr)
        {
            AppNavigator &obj = getObject(btn_ptr);
            obj.m_touch_list = obj.m_touch_logger.serialize();
            obj.m_list_pos = 0;
            ESP_LOGI(TAG, "Touch event count: %u", obj.m_touch_list.size());
        }

        static void nextPressed(void *btn_ptr)
        {
            AppNavigator &obj = getObject(btn_ptr);
            if (obj.m_touch_list.size() <= 0)
            {
                ESP_LOGW(TAG, "no touch detected");
                return;
            }
            ESP_LOGI(TAG, "%s", obj.m_touch_list[obj.m_list_pos].dump().c_str());
            ++obj.m_list_pos;
            obj.m_list_pos %= obj.m_touch_list.size();
        }

    public:
        void init(void)
        {
            bsp_board_init();
            bsp_btn_register_callback(BOARD_BTN_ID_PREV, BUTTON_PRESS_DOWN, AppNavigator::countPressed, reinterpret_cast<void *>(this));
            bsp_btn_register_callback(BOARD_BTN_ID_ENTER, BUTTON_PRESS_DOWN, AppNavigator::nextPressed, reinterpret_cast<void *>(this));

            m_touch_logger.init();
        }
    };
}#pragma once

#include <string>
#include <ctime>
#include <vector>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "driver/touch_pad.h"
#include "json.hpp"

namespace app
{
    struct TouchEvent_t
    {
        uint32_t timestamp;
        uint32_t pad_num;
        uint32_t intr_mask;
    };
    NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TouchEvent_t, timestamp, pad_num, intr_mask);

    class AppTouchLogger
    {
    private:
        constexpr static const char *TAG{"touch_logger"};
        std::vector<TouchEvent_t> m_touch_list;

        static void touchsensor_interrupt_cb(void *arg)
        {
            TouchEvent_t touch_event{esp_log_timestamp(),
                                     touch_pad_get_current_meas_channel(),
                                     touch_pad_read_intr_status_mask()};

            AppTouchLogger &obj = *(reinterpret_cast<AppTouchLogger *>(arg));
            obj.m_touch_list.push_back(touch_event);
        }

    public:
        void init(void)
        {
            touch_pad_init();
            touch_pad_config(TOUCH_PAD_NUM9);

            touch_filter_config_t filter_info = {
                .mode = TOUCH_PAD_FILTER_IIR_16,
                .debounce_cnt = 1,
                .noise_thr = 0,
                .jitter_step = 4,
                .smh_lvl = TOUCH_PAD_SMOOTH_IIR_2,
            };
            touch_pad_filter_set_config(&filter_info);
            touch_pad_filter_enable();
            touch_pad_timeout_set(true, SOC_TOUCH_PAD_THRESHOLD_MAX);

            touch_pad_isr_register(touchsensor_interrupt_cb, this, TOUCH_PAD_INTR_MASK_ALL);
            touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE);

            touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
            touch_pad_fsm_start();

            vTaskDelay(pdMS_TO_TICKS(50));
            uint32_t touch_value;
            touch_pad_read_benchmark(TOUCH_PAD_NUM9,


multihash_update(
        ctx: *mut br_multihash_context,
        data: *const cty::c_void,
        len: usize,
    );
}
extern "C" {
    #[doc = " \\brief Compute a hash output from a multi-hasher."]
    #[doc = ""]
    #[doc = " The hash output for the concatenation of all bytes injected in the"]
    #[doc = " provided context since the last initialisation or reset call, is"]
    #[doc = " computed and written in the buffer pointed to by `dst`. The hash"]
    #[doc = " function to use is identified by `id` and must be one of the standard"]
    #[doc = " hash functions. If that hash function was indeed configured in the"]
    #[doc = " multi-hasher context, the corresponding hash value is written in"]
    #[doc = " `dst` and its length (in bytes) is returned. If the hash function"]
    #[doc = " was _not_ configured, then nothing is written in `dst` and 0 is"]
    #[doc = " returned."]
    #[doc = ""]
    #[doc = " The context itself is not modified, so extra bytes may be injected"]
    #[doc = " afterwards to continue the hash computations."]
    #[doc = ""]
    #[doc = " \\param ctx   pointer to the context structure."]
    #[doc = " \\param id    the hash function symbolic identifier."]
    #[doc = " \\param dst   destination buffer for the hash output."]
    #[doc = " \\return  the hash output length (in bytes), or 0."]
    pub fn br_multihash_out(
        ctx: *const br_multihash_context,
        id: cty::c_int,
        dst: *mut cty::c_void,
    ) -> usize;
}
#[doc = " \\brief Type for a GHASH implementation."]
#[doc = ""]
#[doc = " GHASH is a sort of keyed hash meant to be used to implement GCM in"]
#[doc = " combination with a block cipher (with 16-byte blocks)."]
#[doc = ""]
#[doc = " The `y` array has length 16 bytes and is used for input and output; in"]
#[doc = " a complete GHASH run, it starts with an all-zero value. `h` is a 16-byte"]
#[doc = " value that serves as key (it is derived from the encryption key in GCM,"]
#[doc = " using the block cipher). The data length (`len`) is expressed in bytes."]
#[doc = " The `y` array is updated."]
#[doc = ""]
#[doc = " If the data length is not a multiple of 16, then the data is implicitly"]
#[doc = " padded with zeros up to the next multiple of 16. Thus, when using GHASH"]
#[doc = " in GCM, this method may be called twice, for the associated data and"]
#[doc = " for the ciphertext, respectively; the zero-padding implements exactly"]
#[doc = " the GCM rules."]
#[doc = ""]
#[doc = " \\param y      the array to update."]
#[doc = " \\param h      the GHASH key."]
#[doc = " \\param data   the input data (may be `NULL` if `len` is zero)."]
#[doc = " \\param len    the input data length (in bytes)."]
pub type br_ghash = ::core::option::Option<
    unsafe extern "C" fn(
        y: *mut cty::c_void,
        h: *const cty::c_void,
        data: *const cty::c_void,
        len: usize,
    ),
>;
extern "C" {
    #[doc = " \\brief GHASH implementation using multiplications (mixed 32-bit)."]
    #[doc = ""]
    #[doc = " This implementation uses multiplications of 32-bit values, with a"]
    #


    for (const point of possibleResultPoints) {
      try {
        const x1 = Math.max(0, Math.floor(point.getX() - innerMargin));
        const y1 = Math.max(0, Math.floor(point.getY() - innerMargin));
        const x2 = Math.min(
          image.width,
          Math.floor(point.getX() + innerMargin)
        );
        const y2 = Math.min(
          image.height,
          Math.floor(point.getY() + innerMargin)
        );
        return processResult(
          reader.decode(binaryBitmap.crop(x1, y1, x2 - x1, y2 - y1)),
          x1,
          y1,
          contentPrefix,
          scale
        );
      } catch (error) {
        // ignore errors
      }
    }
    throw error;
  }
}
import {
  WebClient,
  Block,
  KnownBlock,
  MessageAttachment,
} from '@slack/web-api';

import { getSlackBotInfo } from '../install-provider';

interface SendMessageParams {
  attachments?: MessageAttachment[];
  botToken?: string;
  content: string | (Block | KnownBlock)[];
  channel: string;
  threadId?: string | null;
  teamId: string;
  ephemeral?: { user: string };
}

const sendMessage = async ({
  attachments,
  botToken,
  channel,
  content,
  ephemeral,
  teamId,
  threadId,
}: SendMessageParams): Promise<void> => {
  const web = new WebClient(
    botToken ?? (await getSlackBotInfo(teamId)).botToken,
  );
  const blocks =
    typeof content === 'string'
      ? [
          {
            text: {
              text: content,
              type: 'mrkdwn',
            },
            type: 'section',
          },
        ]
      : content;
  if (ephemeral) {
    await web.chat.postEphemeral({
      attachments,
      blocks,
      channel,
      text: '',
      thread_ts: threadId,
      user: ephemeral.user,
    });
    return;
  }
  await web.chat.postMessage({
    attachments,
    blocks,
    channel,
    text: '',
    thread_ts: threadId || undefined,
  });
};

export default sendMessage;
import * as _ from 'lodash';

export function replace<T>(o: T): T {
    return _.merge(o, {__replace: true});
}

export function remove(): any {
    return null;
}

export function merge<T>(
    src1: T,
    ...srcN: any[]
): T
{
    return (_ as any).mergeWith({}, src1, ...srcN, (dest: any, src: any, key: any) => {
        if (src) {
            if (src.__replace) {
                delete src.__replace;
                return src;
            }
        }
        return undefined;
    })
}
import * as Observable from "@reactive-js/core/Observable";
import {
  SideEffect,
  bindMethod,
  incrementBy,
  pipe,
  returns,
} from "@reactive-js/core/functions";
import * as Scheduler from "@reactive-js/core/Scheduler";
import {
  DisposableLike_dispose,
  SchedulerLike_schedule,
} from "@reactive-js/core";

const scheduler = Scheduler.createHostScheduler();

const subscription = pipe(
  Observable.generate(incrementBy(1), returns(0)),
  Observable.delay(1),
  Observable.throttle(2000),
  Observable.map(x => `${x}`),
  Observable.forEach(x => console.log(x)),
  Observable.subscribe(scheduler),
);

scheduler[SchedulerLike_schedule](
  bindMethod(subscription,


private void FixedUpdate()
    {
        _speedMagnitude = _rb.velocity.magnitude;
        _speedMagnitudeKmH = _speedMagnitude * 3.6f;

        var currentAlpha = RoboUtils.Scale(40, 100, 0, 1, _speedMagnitudeKmH);
        currentAlpha = Mathf.Clamp(currentAlpha, 0, 1);
        _gradient.alphaKeys = new GradientAlphaKey[]{ new GradientAlphaKey(currentAlpha, 0), new GradientAlphaKey(0, 1) };
        _trail.colorGradient = _gradient;

        var maxTrailWidth = 0.6f;
        var minTrailWidth = 0.3f;
        var trailWidth = RoboUtils.Scale(40, 80, minTrailWidth, maxTrailWidth, _speedMagnitudeKmH);
        _trail.startWidth = Mathf.Clamp(trailWidth, minTrailWidth, maxTrailWidth);
    }
}


ll ) {
          rtn = rtn
            .put("group", group)
            .put("appConfig", group.getAppConfig(rtn));
        }
        rtn = rtn.put("theme", ((Themes) x.get("themes")).findTheme(rtn));

        return rtn;
      `
    },
    {
      name: 'validate',
      args: [
        { name: 'x', type: 'Context' }
      ],
      javaCode: `
        if ( getUserId() < 0 ) {
          throw new IllegalStateException("User id is invalid.");
        }

        if ( getAgentId() < 0 ) {
          throw new IllegalStateException("Agent id is invalid.");
        }

        if ( getUserId() > 0 ) {
          checkUserEnabled(x, getUserId());
        }

        if ( getAgentId() > 0 ) {
          checkUserEnabled(x, getAgentId());
        }
      `
    },
    {
      name: 'checkUserEnabled',
      args: [
        { name: 'x', type: 'Context' },
        { name: 'userId', type: 'Long' }
      ],
      javaCode: `
        User user = (User) ((DAO) x.get("localUserDAO")).find(userId);

        if ( user == null
         || (user instanceof LifecycleAware && ((LifecycleAware)user).getLifecycleState() != LifecycleState.ACTIVE)
       ) {
          ((Logger) x.get("logger")).warning("Session", "User not found.", userId);
          throw new RuntimeException(String.format("User with id '%d' not found.", userId));
        }

        if ( ! user.getEnabled() ) {
          throw new RuntimeException(String.format("The user with id '%d' has been disabled.", userId));
        }
      `
    }
  ]
});
/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.nanos.servlet',
  name: 'VirtualHostRoutingServlet',

  implements: [
    'foam.nanos.servlet.Servlet'
  ],

  javaImports: [
    'foam.core.X',
    'foam.dao.DAO',
    'foam.nanos.app.AppConfig',
    'foam.nanos.jetty.HttpServer',
    'foam.nanos.logger.Logger',
    'foam.nanos.theme.Theme',
    'foam.nanos.theme.ThemeDomain',
    'java.io.IOException',
    'java.io.PrintWriter',
    'java.util.HashMap',
    'javax.servlet.ServletConfig',
    'javax.servlet.ServletException',
    'javax.servlet.ServletRequest',
    'javax.servlet.ServletResponse'
  ],

  properties: [
    {
      class: 'Map',
      name: 'customHostMapping',
      documentation: `Custom host mapping that will directly serve the index file for the specified virtual host.`
    },
    {
      class: 'Boolean',
      name: 'isResourceStorage',
      documentation: `If set to true, generate index file from jar file resources.`,
      value: false
    },
    {
      class: 'String',
      name: 'defaultHost'
    },
    {
      class: 'Object',
      transient: true,
      javaType: 'ServletConfig',
      name: 'servletConfig'
    }
  ],
  methods: [
    {
      name: 'destroy',
      type: 'Void',
      javaCode: '//noop'
    },
    {
      name: 'getServletInfo',
      type: 'String',
      javaCode: 'return "VirtualHostRoutingServlet";'
    },
    {
      name: 'init',
      type: 'Void',
      args: [ { name: 'config', javaType: 'ServletConfig' } ],
      javaCode: 'setServletConfig(config);',
      code: function() { }
    },
    {
      name: 'populateHead',
      type: 'Void',
      documentation: `Generates the index file's head content based on theme and prints it to the response writer.`,
      args: [


 225px);
    height: 390px;
    width: 450px;
  }

  .home .models .responsive-grid a {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 4px;
    margin-right: 10px;
    margin-left: 10px;
    color: #606060;
    width: 125px;
  }

  .home .models .responsive-grid img {
    transition: transform .2s ease-in-out;
    max-width: 100%;
    display: block;
    border: 1px solid #EAEAEA;
    width: 115px;
    height: 115px;
    margin: 4px;
  }

  .home .models .responsive-grid figure {
    overflow: hidden;
    height: 150px;
    margin: 0;
  }

  .home .models .title {
    margin-bottom: 20px;
    border-bottom: 2px solid #EAEAEA;
    text-align: center;
    overflow: hidden;
    padding: 11px 0;
  }

  .home .models .responsive-grid a:nth-of-type(4n),
  .home .models .responsive-grid a:first-child {
    margin-left: 0;
  }

  .home .models .responsive-grid a:nth-of-type(3n) {
    margin-right: 0;
  }
}

@media screen and (max-width: 459px) {

  .home .models {
    z-index: 2;
    border-radius: 4px;
    position: absolute;
    border: 1px solid #b3b3b3;
    background-color: white;
    top: calc(50% - 250px);
    left: calc(50% - 150px);
    height: 480px;
    width: 300px;
  }

  .home .models .responsive-grid a {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
    margin-right: 10px;
    margin-left: 10px;
    color: #606060;
    width: 125px;
    height: 125px;
  }

  .home .models .responsive-grid img {
    transition: transform .2s ease-in-out;
    max-width: 100%;
    display: block;
    border: none;
    width: 115px;
    height: 115px;
    margin: 4px;
  }

  .home .models .responsive-grid figure {
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    height: 150px;
    margin: 0;
  }

  .home .models .title {
    border-bottom: 1px solid #cccccc;
    margin-bottom: 10px;
    text-align: center;
    overflow: hidden;
    padding-top: 3px;
    height: 30px;
  }

  .home .models .responsive-grid a:nth-of-type(2n + 1),
  .home .models .responsive-grid a:first-child {
    margin-left: 0;
  }

  .home


Locator,
    shared_args: SharedArguments<Unverified>,
    source_args: SourceArguments<Unverified>,
) -> Result<Option<BoxStream<CsvStream>>> {
    let _shared_args = shared_args.verify(BigMlLocator::features())?;
    let _source_args = source_args.verify(BigMlLocator::features())?;

    let id = match source.action {
        BigMlAction::ReadDataset(id) => id,
        _ => return Err(format_err!("cannot read data from {}", source)),
    };
    debug!(ctx.log(), "reading data from {}", id);

    let creds = BigMlCredentials::try_default()?;
    let client = creds.client()?;
    let response = client.download(&id).await?;
    let csv_stream =
        CsvStream::from_http_response(strip_id_prefix(&id).to_owned(), response)?;

    Ok(Some(box_stream_once(Ok(csv_stream))))
}

/// Remove the "dataset/" prefix from `id`.
fn strip_id_prefix<R: Resource>(id: &Id<R>) -> &str {
    // For any given `Resource` type `R`, we know the actual ID prefix, so we
    // can strip it like this.
    &id.as_str()[R::id_prefix().len()..]
}

#[test]
fn strips_id_prefix() {
    use bigml::resource::Dataset;
    let id = "dataset/abc123".parse::<Id<Dataset>>().unwrap();
    assert_eq!(strip_id_prefix(&id), "abc123");
}
<gh_stars>0
struct Solution;
use std::collections::HashMap;
impl Solution {
    pub fn group_anagrams(strs: Vec<String>) -> Vec<Vec<String>> {
        if strs.len() <= 1 {
            return vec![strs];
        }
        let mut map: HashMap<String, Vec<String>> = HashMap::new();
        for str in strs {
            // 排序
            let mut key = str.clone().into_bytes();
            key.sort();
            let key = unsafe { String::from_utf8_unchecked(key) };
            // 按排序后的 key 分组
            let value = map.entry(key.clone()).or_insert(Vec::new());
            value.push(str);
        }
        let mut ans = Vec::with_capacity(map.len());
        for (_key, value) in map {
            ans.push(value);
        }
        ans
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::common::sort_2d_vec;

    #[test]
    fn test_group_anagrams() {
        let strs: Vec<String> = vec!["eat", "tea", "tan", "ate", "nat", "bat"]
            .into_iter()
            .map(|s| s.to_string())
            .collect();
        let mut ans = Solution::group_anagrams(strs);
        let mut want = vec![vec!["ate", "eat", "tea"], vec!["nat", "tan"], vec!["bat"]];
        sort_2d_vec(&mut ans);
        sort_2d_vec(&mut want);
        assert_eq!(ans, want);
    }
}
<reponame>Fifthrow/rusty-q<filename>demos/ipc/src/main.rs
#![feature(box_patterns)]

extern crate rustyq;

use rustyq::{
    api,
    kbindings::*
};

// Attempts to connect to localhost port 12001, runs a query and prints result
fn main() {
    let handle = match api::Handle::connect("localhost", 12001, "user") {
        Ok(h) => h,
        Err(e) => { println!("{}", e); std::process::exit(1) }
    };
    let query = "([]a:til 10;b:reverse til 10;c:10?`4;d:{x#.Q.a}each til 10)";
    let k = match handle.query(query) {
        Ok(h) => h,
        Err(e) => { println!("{}", e); std::process::exit(1) }
    };
    handle.close();
    let KOwned(k) = k;
    println!("{:?}", KVal::new(k));
}
//! # Epoxy
//! ### The Reactive Glue for Frontend Rust Apps
//!
//! This library provides 2 basic reactive programming primitives. `Stream` represents a stateless
//! pipe of data that can be sub


--折扣券物体
local options={};
local opDatas=nil;
local drop=nil;
local data=nil;
local dropVal=nil;
local isChoosie=true;
local lockVID=nil;
local hasVID=false;
local currNum=0;
local isMax=false;

function Awake()
    --设置mask大小
    local arr = CSAPI.GetMainCanvasSize()
    CSAPI.SetRectSize(mask,arr[0],arr[1]);
    local x,y=CSAPI.GetAnchor(gameObject.transform.parent.gameObject);
    CSAPI.SetAnchor(mask,-x,-y);
end

--data=CommodityDat
function Init(_d,_num,_isMax)
    data=_d;
    currNum=_num or 1;
    lockVID=ShopMgr:GetJumpVoucherID();
    opDatas=GetVoucherOptions();
    isMax=_isMax;
    Refresh();
    local cData=GetChooiseList();
    if cData then
        EventMgr.Dispatch(EventType.Shop_PayVoucher_Change,cData)
    end
end

function Refresh()
    if data==nil then
        do return end
    end
    SetChoosieState(isChoosie);
    if lockVID==nil  then
        CSAPI.SetGOActive(useNode,true);
        CSAPI.SetGOActive(unUseNode,false);
        CSAPI.SetGOActive(rightObj,#opDatas>0);
        if dropVal==nil then
            dropVal=1;
        end
        ItemUtil.AddItems("Shop/VoucherDownListItem",options,opDatas,Content,OnDropChange,1,dropVal);
    else
        if #opDatas==0 then
            CSAPI.SetGOActive(useNode,false);
            CSAPI.SetGOActive(unUseNode,true);
            CSAPI.SetGOActive(rightObj,false);
            hasVID=false;
        else
            local isShowUse=false;
            if hasVID and dropVal~=nil then
                isShowUse=true;
            end
            CSAPI.SetGOActive(useNode,isShowUse);
            CSAPI.SetGOActive(unUseNode,isShowUse~=true);
            CSAPI.SetGOActive(rightObj,true);
            ItemUtil.AddItems("Shop/VoucherDownListItem",options,opDatas,Content,OnDropChange,1,dropVal);
        end
    end
    SetDropInfo();
end

function OnDropChange(lua)
    if lua and lua.GetIndex()~=dropVal then
        options[dropVal].SetSelect(false);
        lua.SetSelect(true);
        dropVal=lua.GetIndex();
    end
    SetDropInfo();
    SetDownList(false)
    EventMgr.Dispatch(EventType.Shop_PayVoucher_Change,GetChooiseList())
end

function SetDropInfo()
    if opDatas and dropVal and opDatas[dropVal] then
        CSAPI.SetText(txtName,opDatas[dropVal].txt);
        CSAPI.SetText(txtTime,opDatas[dropVal].txt2);
    end
end

function GetChooiseList()
    if isChoosie and opDatas and opDatas[dropVal] then
        return {{id=opDatas[dropVal].id,num=1}};
    end
    return nil;
end

function SetDownList(isShow)
    CSAPI.SetGOActive(mask,isShow==true);
    CSAPI.SetGOActive(downListView,isShow==true);
    CSAPI.SetRectAngle(arrow,0,0,isShow and 90 or -90);
end

function OnClickAnyway()
    SetDownList(false)
    CloseQuestion();
end

--显示下拉框
function OnClickDrop()
    if not IsNil(downListView) and downListView.activeSelf==true then
        OnClickAnyway()
        do return end;
    end
    CSAPI.SetGOActive(useNode,


olid #fff;
}

.editor-toolbar .easymde-dropdown:hover {
  background: linear-gradient(
    to bottom right,
    #fff 0%,
    #fff 84%,
    #333 50%,
    #333 100%
  );
}

.easymde-dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  padding: 8px;
  z-index: 2;
  top: 30px;
}

.easymde-dropdown:active .easymde-dropdown-content,
.easymde-dropdown:focus .easymde-dropdown-content {
  display: block;
}
.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-


(clazz).isNotNull
            .isInterface
            .hasMethods("_component0", "_component1")
            .matches { cls -> !AppWithAppPart.Module::class.java.isAssignableFrom(cls) }

        val targetFile1 = "build/in-test-generated-ksp/sources/" + AppWithAppPart::class.java.name.replace('.', '/') + "SubmoduleImpl.kt"
        val targetFile2 = "src/test/kotlin/" + AppWithAppPartApp::class.java.name.replace('.', '/') + ".kt"
        val classLoaderApp = symbolProcessFiles(listOf(targetFile1, targetFile2))
        val appClazz = classLoaderApp.loadClass(AppWithAppPartApp::class.java.name + "Graph")
        assertThat(appClazz).isNotNull
    }

    @Test
    fun appPartAndAppSubmodule() {
        val classLoader: ClassLoader = symbolProcess(AppWithAppPart::class, listOf(ProcessorOptions.SUBMODULE_GENERATION))
        val clazz = classLoader.loadClass(AppWithAppPart::class.java.name + "SubmoduleImpl")
        assertThat(clazz).isNotNull
            .isInterface
            .hasMethods("_component0", "_component1")
            .matches { cls -> !AppWithAppPart.Module::class.java.isAssignableFrom(cls) }

        val targetFile1 = "build/in-test-generated-ksp/sources/" + AppWithAppPart::class.java.name.replace('.', '/') + "SubmoduleImpl.kt"
        val targetFile2 = "src/test/kotlin/" + AppWithAppPartApp::class.java.name.replace('.', '/') + ".kt"
        val classLoaderApp = symbolProcessFiles(listOf(targetFile1, targetFile2), listOf(ProcessorOptions.SUBMODULE_GENERATION))
        val appClazz = classLoaderApp.loadClass(AppWithAppPartApp::class.java.name + "Graph")
        assertThat(appClazz).isNotNull
        val appClazzSubmodule = classLoaderApp.loadClass(AppWithAppPartApp::class.java.name + "SubmoduleImpl")
        assertThat(appClazzSubmodule).isNotNull
    }

    private fun <T> findNodeOf(graphDraw: ApplicationGraphDraw, type: Class<T>, vararg tags: Class<*>): NodeImpl<T> {
        val nodes = findNodesOf(graphDraw, type, *tags)
        check(nodes.size == 1)
        return nodes[0]
    }

    private fun <T> findNodesOf(graphDraw: ApplicationGraphDraw, type: Class<T>, vararg tags: Class<*>): List<NodeImpl<T>> {
        val graph = graphDraw.init()
        val anyTag = listOf(*tags).contains(Tag.Any::class.java)
        val nonTagged = tags.isEmpty()
        return graphDraw.nodes
            .filter { type.isInstance(graph[it]) }
            .filter { node ->
                if (anyTag) {
                    return@filter true
                }
                if (nonTagged) {
                    return@filter node.tags().isEmpty()
                }
                return@filter tags.all { listOf(*node.tags()).contains(it) }
            }.map { it as NodeImpl<T> }
            .toList()
    }

    fun testClass(targetClass: KClass<*>, processorProviders: List<SymbolProcessorProvider> = listOf()): ApplicationGraphDraw {
        return try {
            val graphClass = targetClass.qualifiedName + "Graph"
            val processorsArray = (processorProviders + KoraAppProcessorProvider()).toTypedArray()
            val classLoader = symbolProcess(targetClass, *processorsArray)
            val clazz = try {
                classLoader.loadClass(graphClass)
            } catch (e: ClassNotFoundException) {
                val packageClasses = classLoader.getResourceAsStream(targetClass.java.packageName.replace('.', '/')).use { stream ->
                    val reader = BufferedReader(InputStreamReader(stream


;
}
/**
 * \brief Get the data as a matrix, where each "row" is the concatenation of rows and columns, and each "column" is batches
 * \return matrix of shape `t.d.rows() * t.d.cols()` x `t.d.batch_elems()`
 */
inline Eigen::Map<Eigen::MatrixXf> rowcol_matrix(Tensor & t) {
  return Eigen::Map<Eigen::MatrixXf>(t.v, t.d.rows() * t.d.cols(), t.d.batch_elems());
}
inline const Eigen::Map<Eigen::MatrixXf> rowcol_matrix(const Tensor & t) {
  return Eigen::Map<Eigen::MatrixXf>(t.v, t.d.rows() * t.d.cols(), t.d.batch_elems());
}

/**
 * \brief Get the data as a matrix, where each "row" is the concatenation of rows, and each "column" is the concatenation of columns and batches
 * \return matrix of shape `t.d.rows() * t.d.cols()` x `t.d.batch_elems()`
 */
inline Eigen::Map<Eigen::MatrixXf> colbatch_matrix(Tensor & t) {
  return Eigen::Map<Eigen::MatrixXf>(t.v, t.d.rows(), t.d.cols() * t.d.batch_elems());
}
inline const Eigen::Map<Eigen::MatrixXf> colbatch_matrix(const Tensor & t) {
  return Eigen::Map<Eigen::MatrixXf>(t.v, t.d.rows(), t.d.cols() * t.d.batch_elems());
}

}

#endif


           "qIwtkCFXiFk0MlQ0x+84CjvgSnp4wAgh6ggAyeMbynjS7R9Ovsiz4Fl67Wd6tv7Zgg5tqIA/+YgyNCM5" +
                "rSaOHfJCqUCZpogjOgCEWVTJG5YXLDA5GSBsSRpgGKYCA27PMFYQgABpYugHZXQTEXdy/oWCeSY4JXgq" +
                "ZtcHlxNljTFi+JfCG1X8F+S40ezuNyZgzY4fzAuyQrBH8QQbKQNYAcKMCQKwKlg2zQFUemkzCnsUGLBn" +
                "4oFokziwZH0W1oQBeyuIEADvdNW4JKFmvZ8ANqQA4CDNAELDShAM3eSNRR9x6Wybe5CvlbyP7GdsxGJ8" +
                "R23AsxFWb1qUtdxHdJtPk4atress0gVn8efRtdsGHpMQRgIp1bDITNOF0BEICgAGgWGaHph+aR7Xn5GM" +
                "BwBhL9lIrhTtH/T0cgBBPZhi1teMuBUlNJAhwnBir6zQci4Gzl8mr4xdN3MBFS2gwVRFURoW+8Qnb1tU" +
                "DTtgMGcAE3kgBPwAYHsiCDok1e4BpSNH1TtAdTVCF10EiOpE7uZAJjMCJRpAI3NxYEIHN54gbsFxbqh0" +
                "MxoX4gUAQGAAQ0CAQoQFAG1QFiUH8SgXb1AUf6h3qnZ14PdXWEwWrUVWeiZYQbxVdy5UxLkC8agAUxBR" +
                "x5AhNbhBtZuBlcyIVC1SAm0AIT+BkW2BVnMH2LwijoNCm0wk6NQkUq8ADyZy43gAJl0AFmkiYd8E8QQF" +
                "VPBQBYJQk8CDl88W4e1YSEMTrIIiUgVyTA/xd71WYlZ0Y7AtiEUhJAkxhAPTRtY1IFT6UBWQAcWJAmAG" +
                "AAb4EApIgAc3FN9jRTNPAALUUWsMgmWNSFuaEC82QCkecA8lRzV2RwXmFwLyFOXREHo/IDddgpYXAD+X" +
                "IAYcAETMAHT3EADXABBdUBT9eDQphAhEE56qRkPrgqIndccsR7Smhf5xhjXIKEe4VXeFVXS3EEyYKABh" +
                "AGBsABHNAI5TJ5H5AGj3BVTzAcBCAIPgAcBkIXc6JT2aR+DSdswnEgdgJ0CEIc6pdUdmAHaXJQAMACBX" +
                "UDhQABl7IEKdcxIhdtJmkUcRVXAvGO8DhXsmQXzqQsKdeSNNmSdwBXvP9TkifpQ8iCJFzjEwfGTDs5lA" +
                "aRNUchlHekJEmSXhVhOkCocURZhPJRbxRklBjBlK9mS3CDZAQIHu3BVvJxYu/1XWM5hEuSIUOSNfHBWT" +
                "/4EOS1EP5nX1ayN9KVH+HlXbmEHtIxfExDl3Wpl//HJYdBju0xEHOjZ+DllyujNIj5XGfz


    return null;
            }

            IThumbnails thumbnails = adapter as IThumbnails;
            return await thumbnails.GetItemThumbnail(adapterEntryId, relativePath).ConfigureAwait(false);
        }
    }
}


90762, "y": -0.5231296337653348, "IDs": "SssO", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.7124139434772826, "y": 0.3671201835082076, "IDs": "MAXssPH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.076102653475974, "y": -0.6049337096170793, "IDs": "NsssB", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.6107961865937448, "y": 0.413112283826938, "IDs": "MAXaasN", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.7015256055365904, "y": -0.4960042018749471, "IDs": "MAXssssC", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.6025618720242094, "y": 0.08396052211435526, "IDs": "NsSH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.48396039339162017, "y": -0.44856971607098733, "IDs": "MINssssN", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.47465877076992935, "y": 0.226291195126614, "IDs": "MINdNH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.4133652626261053, "y": -0.6990148183840885, "IDs": "MAXsCH3", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.008160285987213385, "y": -0.26854113313936046, "IDs": "NssssC", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.5788344710613011, "y": 0.18833454101753175, "IDs": "SsSH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.7147988316611582, "y": -0.2680471045224811, "IDs": "MINssNH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.1938934157883754, "y": 0.5177956910995556, "IDs": "NsF", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.29557100393818525, "y": 0.08568096129347551, "IDs": "NssssSn", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.6162005530476194, "y": -0.035332048188337004, "IDs": "NsssSiH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.6900904220159457, "y": 0.01285486512972742, "IDs": "MINssNH2", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": -0.8257014690287086, "y": -0.41166696073893455, "IDs": "MINssCH2", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.5688078411701817, "y": 0.1881640799687899, "IDs": "NaasC", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.7014008984352287, "y": -0.12587722190083864, "IDs": "SaaCH", "Subtypes": "Estate", "colors": "#6568f7"}, {"x": 0.4615870596225919,


});
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
 *  This file is a part of the ModelEngine Project.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

tinymce.addI18n('zh_CN',{
  "Redo":"重做","Undo":"撤销","Cut":"剪切",
  "Copy":"复制","Paste":"粘贴","Select all":"全选",
  "New document":"新文件","Ok":"确定","Cancel":"取消","Visual aids":"网格线",
  "Bold":"粗体","Italic":"斜体","Underline":"下划线","Strikethrough":"删除线",
  "Superscript":"上标","Subscript":"下标","Clear formatting":"清除格式","Align left":"左边对齐",
  "Align center":"中间对齐","Align right":"右边对齐","Justify":"两端对齐",
  "Bullet list":"项目符号","Numbered list":"编号列表","Decrease indent":"减少缩进",
  "Increase indent":"增加缩进","Close":"关闭","Formats":"格式",
  "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.":"你的浏览器不支持打开剪贴板，请使用Ctrl+X\/C\/V等快捷键。",
  "Headers":"标题","Header 1":"标题1","Header 2":"标题2","Header 3":"标题3","Header 4":"标题4",
  "Header 5":"标题5","Header 6":"标题6","Headings":"标题","Heading 1":"标题1","Heading 2":"标题2",
  "Heading 3":"标题3","Heading 4":"标题4","Heading 5":"标题5","Heading 6":"标题6","Preformatted":"预先格式化的",
  "Div":"Div","Pre":"Pre","Code":"代码","Paragraph":"段落","Blockquote":"引文区块","Inline":"文本","Blocks":"基块",
  "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"当前为纯文本粘贴模式，再次点击可以回到普通粘贴模式。",
  "Fonts":"字体","Font Sizes":"字号","Class":"类型","Browse for an image":"浏览图像","OR":"或","Drop an image here":"拖放一张图像至此",
  "Upload":"上传","Block":"块","Align":"对齐","Default":"默认","Circle":"空心圆","Disc":"实心圆","Square":"方块","Lower Alpha":"小写英文字母",
  "Lower Greek":"小写希腊字母","Lower Roman":"小写罗马字母","Upper Alpha":"大写英文字母","Upper Roman":"大写罗马字母","Anchor...":"锚点...",
  "Name":"名称","Id":"标识符","Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.":"标识符应该以字母开头，后跟字母、数字、破折号、点、冒号或下划线。","You have unsaved changes are you sure you


"""
Build a simple lexicon from train.txt using jieba (search mode).
- Keep words with length >= 2
- Keep words with frequency >= min_freq
Saves: lexicon.json
"""
import os, json, argparse, collections
import jieba
from conll_utils import read_conll

def main(args):
    train_path = os.path.join(args.data_dir, "train.txt")
    sents, labels = read_conll(train_path)
    # build corpus strings
    corpus = ["".join(s) for s in sents]
    freq = collections.Counter()
    for s in corpus:
        # search mode yields overlapping words
        for w, start, end in jieba.tokenize(s, mode='search'):
            if len(w) >= args.min_word_len:
                freq[w] += 1
    # filter by min_freq
    items = [(w, c) for w, c in freq.items() if c >= args.min_freq]
    # sort by (-freq, -len, word)
    items.sort(key=lambda x: (-x[1], -len(x[0]), x[0]))
    # id starts from 1; 0 is padding
    word2id = {w: i+1 for i, (w, _) in enumerate(items)}
    id2word = {i: w for w, i in word2id.items()}
    meta = {
        "min_freq": args.min_freq,
        "min_word_len": args.min_word_len,
        "size": len(word2id),
        "word2id": word2id,
        "id2word": id2word
    }
    out_path = os.path.join(args.out_dir, "lexicon.json")
    os.makedirs(args.out_dir, exist_ok=True)
    with open(out_path, "w", encoding="utf-8") as f:
        json.dump(meta, f, ensure_ascii=False, indent=2)
    print(f"Lexicon size: {len(word2id)} saved to {out_path}")

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--data_dir", type=str, default="/mnt/data")
    parser.add_argument("--out_dir", type=str, default="/mnt/data/lebert")
    parser.add_argument("--min_freq", type=int, default=2)
    parser.add_argument("--min_word_len", type=int, default=2)
    args = parser.parse_args()
    main(args)


 TestSubnetLimiterCleanup(t *testing.T) {
	tc := []struct {
		Limit
		TTL time.Duration
	}{
		{Limit: Limit{RPS: 1, Burst: 10}, TTL: 10 * time.Second},
		{Limit: Limit{RPS: 0.1, Burst: 2}, TTL: 20 * time.Second},
		{Limit: Limit{RPS: 1, Burst: 100}, TTL: 100 * time.Second},
		{Limit: Limit{RPS: 3, Burst: 6}, TTL: 2 * time.Second},
	}
	for i, tt := range tc {
		t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
			ip1, ip2 := netip.IPv6Loopback(), netip.MustParseAddr("2001::")
			sl := SubnetLimiter{IPv6SubnetLimits: []SubnetLimit{{PrefixLength: 64, Limit: tt.Limit}}}
			now := time.Now()
			// Empty the ip1 bucket
			for range tt.Burst {
				require.True(t, sl.Allow(ip1, now))
			}
			for range tt.Burst / 2 {
				require.True(t, sl.Allow(ip2, now))
			}
			epsilon := 100 * time.Millisecond
			// just before ip1 expiry
			now = now.Add(tt.TTL).Add(-epsilon)
			sl.cleanUp(now) // ip2 will be removed
			require.Equal(t, 1, sl.ipv6Heaps[0].Len())
			// just after ip1 expiry
			now = now.Add(2 * epsilon)
			require.True(t, sl.Allow(ip2, now))        // remove the ip1 bucket
			require.Equal(t, 1, sl.ipv6Heaps[0].Len()) // ip2 added in the previous call
		})
	}
}

func TestTokenBucketFullAfter(t *testing.T) {
	tc := []struct {
		*rate.Limiter
		FullAfter time.Duration
	}{
		{Limiter: rate.NewLimiter(1, 10), FullAfter: 10 * time.Second},
		{Limiter: rate.NewLimiter(0.01, 10), FullAfter: 1000 * time.Second},
		{Limiter: rate.NewLimiter(0.01, 1), FullAfter: 100 * time.Second},
	}
	for i, tt := range tc {
		t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
			b := tokenBucket{tt.Limiter}
			now := time.Now()
			for range b.Burst() {
				tt.Allow()
			}
			epsilon := 10 * time.Millisecond
			require.GreaterOrEqual(t, tt.FullAfter+epsilon, b.FullAt(now).Sub(now))
			require.LessOrEqual(t, tt.FullAfter-epsilon, b.FullAt(now).Sub(now))
		})
	}
}
//go:build openssl
// +build openssl

package crypto

import (
	stdcrypto "crypto"

	"github.com/libp2p/go-libp2p/core/crypto"
)

// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.KeyPairFromStdKey instead
func KeyPairFromStdKey(priv stdcrypto.PrivateKey) (_priv PrivKey, _pub PubKey, err error) {
	return crypto.KeyPairFromStdKey(priv)
}

// PrivKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) private keys
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.PrivKeyToStdKey instead
func PrivKeyToStdKey(priv PrivKey) (_priv stdcrypto.PrivateKey, err error) {
	return crypto.PrivKeyToStdKey(priv)
}

// PubKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) public keys
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.PubKeyToStdKey instead
func PubKeyToStdKey(pub PubKey) (key stdcrypto.PublicKey, err error) {
	return crypto.P


	this.couponFee3 = couponFee3;
	}

}
package space.chensheng.wechatty.mp.material.upload;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import space.chensheng.wechatty.common.conf.AppContext;
import space.chensheng.wechatty.common.material.Material;
import space.chensheng.wechatty.common.material.MaterialUploader;
import space.chensheng.wechatty.common.material.MediaType;

public abstract class TemporaryMedia extends Material {

	private MediaType mediaType;

	private File media;

	/**
	 * The material will expire in 3 days
	 * @param mediaType
	 * @param media
	 * @throws NullPointerException if any argument is null
	 */
	public TemporaryMedia(AppContext appContext, MediaType mediaType, File media) {
		super(appContext, "https://api.weixin.qq.com/cgi-bin/media/upload");

		if (mediaType == null) {
			throw new NullPointerException("mediaType may not be null");
		}

		if (media == null) {
			throw new NullPointerException("media may not be null");
		}

		this.mediaType = mediaType;
		this.media = media;
	}

	@Override
	protected void addQueryParam(Map<String, String> queryParams) {
		queryParams.put("access_token", this.getAppContext().getAccessTokenFetcher().getAccessToken());
		queryParams.put("type", mediaType.toString());
	}

	@Override
	protected Object createPostBody() {
		Map<String, Object> postBody = new HashMap<String, Object>();
		postBody.put("media", media);
		return postBody;
	}

	@Override
	protected MaterialUploader getUploader(AppContext appContext) {
		return appContext.getMultiPartUploader();
	}
}
package space.chensheng.wechatty.mp.material.upload;

import java.io.File;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;

import space.chensheng.wechatty.common.conf.AppContext;
import space.chensheng.wechatty.common.material.MediaType;
import space.chensheng.wechatty.common.util.JsonBean;

public class VideoPermanentMedia extends PermanentMedia {

	private Description description;

	/**
	 *
	 * @param media {@code size <= 10M},  format: mp4
	 * @param title
	 * @param introduction
	 */
	public VideoPermanentMedia(AppContext appContext, File media, String title, String introduction) {
		super(appContext, MediaType.VIDEO, media);
		description = new Description();
		description.title = title;
		description.introduction = introduction;
	}

	@Override
	protected void addPostBody(Map<String, Object> postBody) {
		postBody.put("description", description);
	}

	private static class Description extends JsonBean {
		@JsonProperty
		String title;

		@JsonProperty
		String introduction;
	}
}
package space.chensheng.wechatty.mp.message.reply;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import space.chensheng.wechatty.common.message.MessageType;
import space.chensheng.wechatty.common.message.base.ReplyMessage;
import space.chensheng.wechatty.common.message.base.XmlMessage;
import space.chensheng.wechatty.common.util.XmlUtil.XStreamCDATA;

public class MusicReplyMessage extends ReplyMessage {

	@XStreamAlias("Music")
	protected MusicItem musicItem;

	public MusicReplyMessage() {
		super(MessageType.MUSIC);
		musicItem = new MusicItem();
	}

	public String getThumbMediaId() {
		return musicItem.thumbMediaId;
	}

	public void setThumbMediaId(String thumbMediaId) {
		musicItem.thumbMediaId = thumbMediaId;
	}

	public void setTitle(String title) {
		musicItem.title = title;
	}

	public v


fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #FFEBE9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #FFF0EB;--color-scale-coral-1: #FFD6CC;--color-scale-coral-2: #FFB4A1;--color-scale-coral-3: #FD8C73;--color-scale-coral-4: #EC6547;--color-scale-coral-5: #C4432B;--color-scale-coral-6: #9E2F1C;--color-scale-coral-7: #801F0F;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901 }@media (prefers-color-scheme: dark){:root{--color-canvas-default-transparent: rgba(13,17,23,0);--color-marketing-icon-primary: #79c0ff;--color-marketing-icon-secondary: #1f6feb;--color-diff-blob-addition-num-text: #c9d1d9;--color-diff-blob-addition-fg: #c9d1d9;--color-diff-blob-addition-num-bg: rgba(63,185,80,.3);--color-diff-blob-addition-line-bg: rgba(46,160,67,.15);--color-diff-blob-addition-word-bg: rgba(46,160,67,.4);--color-diff-blob-deletion-num-text: #c9d1d9;--color-diff-blob-deletion-fg: #c9d1d9;--color-diff-blob-deletion-num-bg: rgba(248,81,73,.3);--color-diff-blob-deletion-line-bg: rgba(248,81,73,.15);--color-diff-blob-deletion-word-bg: rgba(248,81,73,.4);--color-diff-blob-hunk-num-bg: rgba(56,139,253,.4);--color-diff-blob-expander-icon: #8b949e;--color-diff-blob-selected-line-highlight-mix-blend-mode: screen;--color-diffstat-deletion-border: rgba(240,246,252,.1);--color-diffstat-additi


                   random_pages = random.randint(1, 5)
            self.write_file(wrote_num)  # 将剩余不足3页的微博写入文件
            if not self.filter:
                print('共爬取' + str(self.got_num) + '条微博')
            else:
                print('共爬取' + str(self.got_num) + '条原创微博')
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def run(self):
        """运行爬虫"""
        try:
            self.get_weibo_info()
            print('信息抓取完毕')
            print('*' * 100)

        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

class WeiboTopicScrapy(Thread):

    def __init__(self,keyword,filter,limit_date):
        Thread.__init__(self)
        self.headers={
            'Cookie':Cookie,
            'User_Agent':User_Agent
        }
        self.keyword = keyword
        self.filter = filter # 1: 原创微博； 0：所有微博
        self.limit_date = limit_date
        self.flag = True
        self.got_num = 0  # 爬取到的微博数
        self.weibo = []  # 存储爬取到的所有微博信息
        if not os.path.exists('topic'):
            os.mkdir('topic')
        self.start()

    def deal_html(self,url):
        """处理html"""
        try:
            html = requests.get(url, headers=self.headers).content
            selector = etree.HTML(html)
            return selector
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def deal_garbled(self,info):
        """处理乱码"""
        try:
            info = (info.xpath('string(.)').replace(u'\u200b', '').encode(
                sys.stdout.encoding, 'ignore').decode(sys.stdout.encoding))
            return info
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def get_long_weibo(self,weibo_link):
        """获取长原创微博"""
        try:
            selector = self.deal_html(weibo_link)
            info = selector.xpath("//div[@class='c']")[1]
            wb_content = self.deal_garbled(info)
            wb_time = info.xpath("//span[@class='ct']/text()")[0]
            weibo_content = wb_content[wb_content.find(':') +
                                       1:wb_content.rfind(wb_time)]
            return weibo_content
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def get_original_weibo(self,info, weibo_id):
        """获取原创微博"""
        try:
            weibo_content = self.deal_garbled(info)
            weibo_content = weibo_content[:weibo_content.rfind(u'赞')]
            a_text = info.xpath('div//a/text()')
            if u'全文' in a_text:
                weibo_link = 'https://weibo.cn/comment/' + weibo_id
                wb_content = self.get_long_weibo(weibo_link)
                if wb_content:
                    weibo_content = wb_content
            return weibo_content
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def get_long_retweet(self,weibo_link):
        """获取长转发微博"""
        try:
            wb_content = self.get_long_weibo(weibo_link)
            weibo_content = wb_content[:wb_content.rfind('原文转发')]
            return weibo_content
        except Exception as e:
            print('Error: ', e)
            traceback.print_exc()

    def get_retweet(self,info, weibo_id):
        """获取转发微博"""
        try:
            original_user = info.xpath("div/span[@class='cmt']/a/text()")
            if not original_user:
                wb_content = '转发微博已被删除'
                return wb_content
            else:
                original_user = original_user[0]
            wb_content = self.deal_garbled(info)
            wb_content = wb_content[wb_content.find(':') +
                                    1:wb_content.rfind('赞')]
            wb_content = wb_content[:wb_content.rfind('赞')]
            a_text = info.xpath('div//a/text()')
            if '全文' in a_text:
                weibo_link = 'https://weibo.cn/comment/' + weibo_id
                weibo_content = self.get_long_retweet(weibo_link)
                if weibo_content:
                    wb_content = weibo_content
            retweet_reason = self.deal_garbled(info.xpath('div')[-1])
            retweet_reason = retweet_reason[:retweet_reason.rindex('赞')]
            wb_content = (retweet_reason + '\n' + '原始用户: ' + original_user +
                          '\n' + '转发内容: ' + wb_content)
            return wb_content
        except Exception as e:
            print('Error: ',


unction Initialize()

  RegisterHandlers();

  ContextPtr:SetInitHandler( OnInit );
  ContextPtr:SetShutdown( OnShutdown );

  Controls.ScrollStack:RegisterSizeChanged( OnStackSizeChanged );

  Events.NotificationAdded.Add(       OnNotificationAdded );
  Events.NotificationDismissed.Add(     OnNotificationDismissed );
  Events.NotificationRefreshRequested.Add(  OnNotificationRefreshRequested );
	Events.NotificationActivated.Add(			OnNotificationActivated );

  Events.UnitKilledInCombat.Add( OnUnitKilledInCombat );

  Events.SystemUpdateUI.Add( OnUpdateUI );

  Events.PhaseBegin.Add( OnPhaseBegin );

  Events.LocalPlayerChanged.Add( OnLocalPlayerChanged );

  Events.InterfaceModeChanged.Add(    OnInterfaceModeChanged );

  m_isLoadComplete = false;
  Events.LoadGameViewStateDone.Add( OnLoadGameViewStateDone );

  LuaEvents.ActionPanel_ActivateNotification.Add( OnLuaActivateNotification );

  -- CQUI
  LuaEvents.CQUI_AddNotification.Add( CQUI_AddNotification );
end
Initialize();


Checker('bigint'),\n    bool: createPrimitiveTypeChecker('boolean'),\n    func: createPrimitiveTypeChecker('function'),\n    number: createPrimitiveTypeChecker('number'),\n    object: createPrimitiveTypeChecker('object'),\n    string: createPrimitiveTypeChecker('string'),\n    symbol: createPrimitiveTypeChecker('symbol'),\n\n    any: createAnyTypeChecker(),\n    arrayOf: createArrayOfTypeChecker,\n    element: createElementTypeChecker(),\n    elementType: createElementTypeTypeChecker(),\n    instanceOf: createInstanceTypeChecker,\n    node: createNodeChecker(),\n    objectOf: createObjectOfTypeChecker,\n    oneOf: createEnumTypeChecker,\n    oneOfType: createUnionTypeChecker,\n    shape: createShapeTypeChecker,\n    exact: createStrictShapeTypeChecker,\n  };\n\n  /**\n   * inlined Object.is polyfill to avoid requiring consumers ship their own\n   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n   */\n  /*eslint-disable no-self-compare*/\n  function is(x, y) {\n    // SameValue algorithm\n    if (x === y) {\n      // Steps 1-5, 7-10\n      // Steps 6.b-6.e: +0 != -0\n      return x !== 0 || 1 / x === 1 / y;\n    } else {\n      // Step 6.a: NaN == NaN\n      return x !== x && y !== y;\n    }\n  }\n  /*eslint-enable no-self-compare*/\n\n  /**\n   * We use an Error-like object for backward compatibility as people may call\n   * PropTypes directly and inspect their output. However, we don't use real\n   * Errors anymore. We don't inspect their stack anyway, and creating them\n   * is prohibitively expensive if they are created too often, such as what\n   * happens in oneOfType() for any type before the one that matched.\n   */\n  function PropTypeError(message, data) {\n    this.message = message;\n    this.data = data && typeof data === 'object' ? data: {};\n    this.stack = '';\n  }\n  // Make `instanceof Error` still work for returned errors.\n  PropTypeError.prototype = Error.prototype;\n\n  function createChainableTypeChecker(validate) {\n    if (true) {\n      var manualPropTypeCallCache = {};\n      var manualPropTypeWarningCount = 0;\n    }\n    function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n      componentName = componentName || ANONYMOUS;\n      propFullName = propFullName || propName;\n\n      if (secret !== ReactPropTypesSecret) {\n        if (throwOnDirectAccess) {\n          // New behavior only for users of `prop-types` package\n          var err = new Error(\n            'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n            'Use `PropTypes.checkPropTypes()` to call them. ' +\n            'Read more at http://fb.me/use-check-prop-types'\n          );\n          err.name = 'Invariant Violation';\n          throw err;\n        } else if ( true && typeof console !== 'undefined') {\n          // Old behavior for people using React.PropTypes\n          var cacheKey = componentName + ':' + propName;\n          if (\n            !manualPropTypeCallCache[cacheKey] &&\n            // Avoid spamming the console because they are often not actionable except for lib authors\n            manualPropTypeWarningCount < 3\n          ) {\n            printWarning(\n              'You are manually calling a React.PropTypes validation ' +\n              'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n              'and will throw in the standalone `prop


0, 0, 0.1);
            z-index: 998;
        }
        .menu.show {
            display: block;
        }
        button[type="submit"] {
            padding: 10px 20px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        button[type="submit"]:hover {
            background-color: #0056b3;
        }
        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }
        li {
            margin-bottom: 10px;
        }
        a.button, a.special-button {
            text-decoration: none;
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin-right: 10px;
        }
        a.button:hover, a.special-button:hover {
            background-color: #0056b3;
        }
        a.special-button {
            background-color: #28a745;
        }
        a.special-button:hover {
            background-color: #218838;
        }
        .cards {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
        }
        .card {
            width: calc(33.33% - 20px);
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
            padding: 20px;
        }
        .card img {
            width: 100%;
            border-radius: 5px;
            margin-bottom: 10px;
        }
        .card h3 {
            font-size: 18px;
            margin: 0;
            margin-bottom: 10px;
        }
        .card p {
            font-size: 14px;
            color: #777;
            margin: 0;
        }
        .menu a.button {
            margin-bottom: 10px;
        }
    </style>

Página Inicial

        {% if messages %}

                {% for message in messages %}

{{ message }}

                {% endfor %}

        {% endif %}

        <form method="GET" action="">
            {% csrf_token %}
            <input type="text" name="keyword" placeholder="Digite sua pesquisa">
            <button type="submit">Pesquisar</button>
            Filtro de busca
        </form>

        <form method="GET" action="">
            Categoria:
            <select name="categoria" id="categoria">
                <option value="">Todas</option>
                {% for key, value in categorias %}
                <option value="{{ key }}">{{ value }}</option>
                {% endfor %}
            </select>
            <button type="submit">Filtrar</button>
        </form>

        {% if itens %}

Produtos</


age types

import (
	"encoding/json"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
)

func TestDurationUnmarshal(t *testing.T) {
	type testCase struct {
		name           string
		input          string
		expectedResult *Duration
		expectedErr    error
	}

	testCases := []testCase{
		{
			name:           "valid duration",
			input:          "60s",
			expectedResult: &Duration{Duration: time.Minute},
		},
		{
			name:        "int value",
			input:       "60",
			expectedErr: fmt.Errorf("time: missing unit in duration \"60\""),
		},
		{
			name:        "no duration value",
			input:       "abc",
			expectedErr: fmt.Errorf("time: invalid duration \"abc\""),
		},
	}

	for _, testCase := range testCases {
		t.Run(testCase.name, func(t *testing.T) {
			var d Duration
			input, err := json.Marshal(testCase.input)
			require.NoError(t, err)
			err = json.Unmarshal(input, &d)

			if testCase.expectedResult != nil {
				require.Equal(t, (*testCase.expectedResult).Nanoseconds(), d.Nanoseconds())
			}

			if err != nil {
				require.Equal(t, testCase.expectedErr.Error(), err.Error())
			}
		})
	}
}
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package miner

import (
	"container/heap"
	"math/big"
	"sync/atomic"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/txpool"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/holiman/uint256"
)

// txWithMinerFee wraps a transaction with its gas price or effective miner gasTipCap
type txWithMinerFee struct {
	tx   *txpool.LazyTransaction
	from common.Address
	fees *uint256.Int
}

// newTxWithMinerFee creates a wrapped transaction, calculating the effective
// miner gasTipCap if a base fee is provided.
// Returns error in case of a negative effective miner gasTipCap.
func newTxWithMinerFee(tx *txpool.LazyTransaction, from common.Address, baseFee *uint256.Int) (*txWithMinerFee, error) {
	tip := new(uint256.Int).Set(tx.GasTipCap)
	if baseFee != nil {
		if tx.GasFeeCap.Cmp(baseFee) < 0 {
			return nil, types.ErrGasFeeCapTooLow
		}
		tip = new(uint256.Int).Sub(tx.GasFeeCap, baseFee)
		if tip.Gt(tx.GasTipCap) {
			tip = tx.GasTipCap
		}
	}
	return &txWith


--- forked by https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http.lua
local http_headers = require "resty.http_headers"

local ngx = ngx
local ngx_socket_tcp = ngx.socket.tcp
local ngx_req = ngx.req
local ngx_req_socket = ngx_req.socket
local ngx_req_get_headers = ngx_req.get_headers
local ngx_req_get_method = ngx_req.get_method
local str_gmatch = string.gmatch
local str_lower = string.lower
local str_upper = string.upper
local str_find = string.find
local str_sub = string.sub
local tbl_concat = table.concat
local tbl_insert = table.insert
local ngx_encode_args = ngx.encode_args
local ngx_re_match = ngx.re.match
local ngx_re_gsub = ngx.re.gsub
local ngx_re_find = ngx.re.find
local ngx_log = ngx.log
local ngx_DEBUG = ngx.DEBUG
local ngx_ERR = ngx.ERR
local ngx_var = ngx.var
local ngx_print = ngx.print
local ngx_header = ngx.header
local co_yield = coroutine.yield
local co_create = coroutine.create
local co_status = coroutine.status
local co_resume = coroutine.resume
local setmetatable = setmetatable
local tonumber = tonumber
local tostring = tostring
local unpack = unpack
local rawget = rawget
local select = select
local ipairs = ipairs
local pairs = pairs
local pcall = pcall
local type = type

-- http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.1
local HOP_BY_HOP_HEADERS = {
    ["connection"]          = true,
    ["keep-alive"]          = true,
    ["proxy-authenticate"]  = true,
    ["proxy-authorization"] = true,
    ["te"]                  = true,
    ["trailers"]            = true,
    ["transfer-encoding"]   = true,
    ["upgrade"]             = true,
    ["content-length"]      = true, -- Not strictly hop-by-hop, but Nginx will deal
                                    -- with this (may send chunked for example).
}

-- Reimplemented coroutine.wrap, returning "nil, err" if the coroutine cannot
-- be resumed. This protects user code from inifite loops when doing things like
-- repeat
--   local chunk, err = res.body_reader()
--   if chunk then -- <-- This could be a string msg in the core wrap function.
--     ...
--   end
-- until not chunk
local co_wrap = function(func)
    local co = co_create(func)
    if not co then
        return nil, "could not create coroutine"
    else
        return function(...)
            if co_status(co) == "suspended" then
                return select(2, co_resume(co, ...))
            else
                return nil, "can't resume a " .. co_status(co) .. " coroutine"
            end
        end
    end
end

-- Returns a new table, recursively copied from the one given.
--
-- @param   table   table to be copied
-- @return  table
local function tbl_copy(orig)
    local orig_type = type(orig)
    local copy
    if orig_type == "table" then
        copy = {}
        for orig_key, orig_value in next, orig, nil do
            copy[tbl_copy(orig_key)] = tbl_copy(orig_value)
        end
    else -- number, string, boolean, etc
        copy = orig
    end
    return copy
end

local _M = {
    _VERSION = '0.11',
}
_M._USER_AGENT = "lua-resty-http/" .. _M._VERSION .. " (Lua) ngx_lua/" .. ngx.config.ng


es and cables.]]),
	OnAction = ChoGGi_Funcs.Menus.CablesAndPipesRepair,
}

c = c + 1
Actions[c] = {ActionName = T(302535920000609--[[Attach Buildings To Nearest Working Dome]]),
	ActionMenubar = "ECM.ECM.Fixes",
	ActionId = ".Attach Buildings To Nearest Working Dome",
	ActionIcon = icon,
	RolloverText = T(302535920000610--[[If you placed inside buildings outside and removed the dome they're attached to; use this.]]),
	OnAction = ChoGGi_Funcs.Menus.AttachBuildingsToNearestWorkingDome,
}

c = c + 1
Actions[c] = {ActionName = T(302535920001533--[[Remove Invalid Label Objects]]),
	ActionMenubar = "ECM.ECM.Fixes",
	ActionId = ".Remove Invalid Label Objects",
	ActionIcon = icon,
	RolloverText = T(302535920001534--[[Checks the city.labels for invalid objects and removes them from the label.]]),
	OnAction = ChoGGi_Funcs.Menus.RemoveInvalidLabelObjects,
}

-- menu
c = c + 1
Actions[c] = {ActionName = T(302535920000938--[[Toggles]]),
	ActionMenubar = "ECM.ECM.Fixes",
	ActionId = ".Toggles",
	ActionIcon = "CommonAssets/UI/Menu/folder.tga",
	OnActionEffect = "popup",
	ActionSortKey = "6Toggles",
}

c = c + 1
Actions[c] = {ActionName = T(302535920000248--[[Colonists Stuck Outside Service Buildings]]),
	ActionMenubar = "ECM.ECM.Fixes.Toggles",
	ActionId = ".Colonists Stuck Outside Service Buildings",
	ActionIcon = icon,
	RolloverText = function()
		return SettingState(
			ChoGGi.UserSettings.ColonistsStuckOutsideServiceBuildings,
			T(302535920000249--[["Colonists will leave a diner/etc and stop outside of it and not move anymore (might be related to one of those smarter worker ai mods).

Seems to fix it after a Sol or two, so you shouldn't need to leave this running."]])
		)
	end,
	OnAction = ChoGGi_Funcs.Menus.ColonistsStuckOutsideServiceBuildings_Toggle,
}

c = c + 1
Actions[c] = {ActionName = T(302535920000613--[[Drone Carry Amount]]),
	ActionMenubar = "ECM.ECM.Fixes.Toggles",
	ActionId = ".Drone Carry Amount",
	ActionIcon = icon,
	RolloverText = function()
		return SettingState(
			ChoGGi.UserSettings.DroneResourceCarryAmountFix,
			T(302535920000614--[["Drones only pick up resources from buildings when the amount stored is equal or greater then their carry amount.
This forces them to pick up whenever there's more then one resource).

If you have an insane production amount set then it'll take an (in-game) hour between calling drones."]])
		)
	end,
	OnAction = ChoGGi_Funcs.Menus.DroneResourceCarryAmountFix_Toggle,
}

c = c + 1
Actions[c] = {ActionName = T(302535920000615--[[Sort Command Center Dist]]),
	ActionMenubar = "ECM.ECM.Fixes.Toggles",
	ActionId = ".Sort Command Center Dist",
	ActionIcon = "CommonAssets/UI/Menu/Axis.tga",
	RolloverText = function()
		return SettingState(
			ChoGGi.UserSettings.SortCommandCenterDist,
			T(302535920000616--[["Each Sol goes through all buildings and sorts their cc list by nearest.

Takes less then a second on a map with 3600+ buildings and 50+ drone hubs."]])
		)
	end,
	OnAction


 Map<String, List<int>>> toJson() => {
        'WorkerCodeUpdated': {
          'signature': signature,
          'signer': signer,
        }
      };

  int _sizeHint() {
    int size = 1;
    size = size + _i1.U8SequenceCodec.codec.sizeHint(signature);
    size = size + _i1.U8SequenceCodec.codec.sizeHint(signer);
    return size;
  }

  void encodeTo(_i1.Output output) {
    _i1.U8Codec.codec.encodeTo(
      6,
      output,
    );
    _i1.U8SequenceCodec.codec.encodeTo(
      signature,
      output,
    );
    _i1.U8SequenceCodec.codec.encodeTo(
      signer,
      output,
    );
  }

  @override
  bool operator ==(Object other) =>
      identical(
        this,
        other,
      ) ||
      other is WorkerCodeUpdated &&
          _i5.listsEqual(
            other.signature,
            signature,
          ) &&
          _i5.listsEqual(
            other.signer,
            signer,
          );

  @override
  int get hashCode => Object.hash(
        signature,
        signer,
      );
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;

import 'package:polkadart/scale_codec.dart' as _i1;
import 'package:quiver/collection.dart' as _i4;

import 'disk.dart' as _i2;

class Cr {
  const Cr({
    required this.cpu,
    required this.mem,
    required this.disk,
    required this.gpu,
  });

  factory Cr.decode(_i1.Input input) {
    return codec.decode(input);
  }

  /// u32
  final int cpu;

  /// u32
  final int mem;

  /// Vec<Disk>
  final List<_i2.Disk> disk;

  /// u32
  final int gpu;

  static const $CrCodec codec = $CrCodec();

  _i3.Uint8List encode() {
    return codec.encode(this);
  }

  Map<String, dynamic> toJson() => {
        'cpu': cpu,
        'mem': mem,
        'disk': disk.map((value) => value.toJson()).toList(),
        'gpu': gpu,
      };

  @override
  bool operator ==(Object other) =>
      identical(
        this,
        other,
      ) ||
      other is Cr &&
          other.cpu == cpu &&
          other.mem == mem &&
          _i4.listsEqual(
            other.disk,
            disk,
          ) &&
          other.gpu == gpu;

  @override
  int get hashCode => Object.hash(
        cpu,
        mem,
        disk,
        gpu,
      );
}

class $CrCodec with _i1.Codec<Cr> {
  const $CrCodec();

  @override
  void encodeTo(
    Cr obj,
    _i1.Output output,
  ) {
    _i1.U32Codec.codec.encodeTo(
      obj.cpu,
      output,
    );
    _i1.U32Codec.codec.encodeTo(
      obj.mem,
      output,
    );
    const _i1.SequenceCodec<_i2.Disk>(_i2.Disk.codec).encodeTo(
      obj.disk,
      output,
    );
    _i1.U32Codec.codec.encodeTo(
      obj.gpu,
      output,


::new();

  for (ns, file_info) in program_data {
    let mut defs: HashMap<Arc<str>, Edn> = HashMap::new();
    for (def, code) in file_info {
      defs.insert(def, dump_code(&code));
    }

    let file = IrDataFile { defs };
    files.insert(ns, file);
  }

  let data = IrData {
    configs: IrDataConfig {
      init_fn: init_fn.to_owned(),
      reload_fn: reload_fn.to_owned(),
    },
    files,
  };

  let content = match format(&data.to_edn(), true) {
    Ok(v) => v,
    Err(e) => return Err(format!("failed {}", e)),
  };

  let code_emit_path = Path::new(emit_path);
  if !code_emit_path.exists() {
    let _ = fs::create_dir(code_emit_path);
  }

  let js_file_path = code_emit_path.join("program-ir.cirru"); // TODO mjs_mode
  let _ = fs::write(&js_file_path, content);
  println!("wrote to: {}", js_file_path.to_str().unwrap());

  Ok(())
}

fn dump_code(code: &Calcit) -> Edn {
  match code {
    Calcit::Number(n) => Edn::Number(*n),
    Calcit::Nil => Edn::Nil,
    Calcit::Str(s) => Edn::Str((**s).into()),
    Calcit::Bool(b) => Edn::Bool(b.to_owned()),
    Calcit::Keyword(s) => Edn::Keyword(s.to_owned()),
    Calcit::Symbol { sym, ns, at_def, resolved } => {
      let resolved = match resolved {
        Some(resolved) => match &**resolved {
          ResolvedDef {
            ns: r_ns,
            def: r_def,
            rule: import_rule,
          } => {
            let mut xs: HashMap<Edn, Edn> = HashMap::new();
            xs.insert(Edn::kwd("kind"), Edn::kwd("def"));
            xs.insert(Edn::kwd("ns"), Edn::Str((**r_ns).into()));
            xs.insert(Edn::kwd("at_def"), Edn::Str((**at_def).into()));
            xs.insert(Edn::kwd("def"), Edn::Str((**r_def).into()));
            xs.insert(
              Edn::kwd("rule"),
              match import_rule.to_owned().map(|x| (&*x).to_owned()) {
                Some(ImportRule::NsAs(_n)) => Edn::kwd("ns"),
                Some(ImportRule::NsDefault(_n)) => Edn::kwd("default"),
                Some(ImportRule::NsReferDef(_ns, _def)) => Edn::kwd("def"),
                None => Edn::Nil,
              },
            );

            Edn::Map(xs)
          }
          ResolvedLocal => {
            let mut xs: HashMap<Edn, Edn> = HashMap::new();
            xs.insert(Edn::kwd("kind"), Edn::kwd("local"));
            Edn::Map(xs)
          }
          ResolvedRaw => {
            let mut xs: HashMap<Edn, Edn> = HashMap::new();
            xs.insert(Edn::kwd("kind"), Edn::kwd("raw"));
            Edn::Map(xs)
          }
        },
        None => {
          let mut xs: HashMap<Edn, Edn> = HashMap::new();
          xs.insert(Edn::kwd("kind"), Ed