arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
}

#[lang = "panic_fmt"]
pub extern "C" fn panic_fmt(fmt: fmt::Arguments, file: &'static str, line: u32) -> ! {
    write_fmt(fmt);
    hprintln!("\nfile: {}; line: {}", file, line);
    debug::exit(Err(()));
    loop {}
}
//use super::*;

#[derive(Debug, Clone)]
pub enum NodeType {
    Junction,
    Reservoir,
    Tank,
}

//------------------------------------Node-------------------------------

pub trait Node {

    fn node_type(&self)-> NodeType;

    fn print(&self){
        println!("{}", self.to_string());
    }

    fn to_string(&self)-> String;
}use crate::backend::{
    ColorType,
    TextureImage2D,
};
use image;
use image::jpeg::{
    JpegDecoder,
};
use image::png::{
    PngDecoder,
};
use image::{
    ImageDecoder,
};

use std::io;

pub fn from_png_buffer(buffer: &[u8]) -> TextureImage2D {
    let cursor = io::Cursor::new(buffer);
    let image_decoder = PngDecoder::new(cursor).unwrap();
    let (width, height) = image_decoder.dimensions();
    let total_bytes = image_decoder.total_bytes();
    let image_decoder_color_type = image_decoder.color_type();
    let color_type = match image_decoder_color_type {
        image::ColorType::Rgb8 => ColorType::Rgb8,
        image::ColorType::Rgba8 => ColorType::Rgba8,
        _ => ColorType::L8,
    };
    let bytes_per_pixel = image_decoder_color_type.bytes_per_pixel() as u32;
    let mut image_data = vec![0 as u8; total_bytes as usize];
    image_decoder.read_image(&mut image_data).unwrap();

    assert_eq!(total_bytes, (width * height * bytes_per_pixel) as u64);

    TextureImage2D::new(width, height, color_type, bytes_per_pixel, image_data)
}

pub fn from_png_reader<R: io::Read>(reader: &mut R) -> TextureImage2D {
    let image_decoder = PngDecoder::new(reader).unwrap();
    let (width, height) = image_decoder.dimensions();
    let total_bytes = image_decoder.total_bytes();
    let image_decoder_color_type = image_decoder.color_type();
    let color_type = match image_decoder_color_type {
        image::ColorType::Rgb8 => ColorType::Rgb8,
        image::ColorType::Rgba8 => ColorType::Rgba8,
        _ => ColorType::L8,
    };
    let bytes_per_pixel = image_decoder_color_type.bytes_per_pixel() as u32;
    let mut image_data = vec![0 as u8; total_bytes as usize];
    image_decoder.read_image(&mut image_data).unwrap();

    assert_eq!(total_bytes, (width * height * bytes_per_pixel) as u64);

    TextureImage2D::new(width, height, color_type, bytes_per_pixel, image_data)
}

pub fn from_jpeg_reader<R: io::Read>(reader: &mut R) -> TextureImage2D {
    let image_decoder = JpegDecoder::new(reader).unwrap();
    let (width, height) = image_decoder.dimensions();
    let total_bytes = image_decoder.total_bytes();
    let image_decoder_color_type = image_decoder.color_type();
    let color_type = match image_decoder_color_type {
        image::ColorType::Rgb8 => ColorType::Rgb8,
        image::ColorType::Rgba8 => ColorType::Rgba8,
        _ => ColorType::L8,
    };
    let bytes_per_pixel = image_decod


e",
		rating: 3,
		num: -56,
	},
	diamonddust: {
		desc: "On switch-in, this Pokémon summons Diamond Dust for 5 turns. During the effect, Pokémon are immune to all Rock-type attacks and Stealth Rock; Weather Ball becomes an Ice-type move, and its base power is 100; and other weather-related moves and Abilities behave as they do in Hail.",
		shortDesc: "5 turns: all Pokémon are immune to Rock; counts as hail.",
		onStart(source) {
			this.field.setWeather('diamonddust');
		},
		name: "Diamond Dust",
		rating: 3,
		num: -27,
	},
	// Diamond Dust modded into other Abilities
	forecast: {
		onUpdate(pokemon) {
			if (pokemon.baseSpecies.baseSpecies !== 'Castform' || pokemon.transformed) return;
			let forme = null;
			switch (pokemon.effectiveWeather()) {
			case 'sunnyday':
			case 'desolateland':
				if (pokemon.species.id !== 'castformsunny') forme = 'Castform-Sunny';
				break;
			case 'raindance':
			case 'primordialsea':
				if (pokemon.species.id !== 'castformrainy') forme = 'Castform-Rainy';
				break;
			case 'hail':
			case 'diamonddust':
				if (pokemon.species.id !== 'castformsnowy') forme = 'Castform-Snowy';
				break;
			default:
				if (pokemon.species.id !== 'castform') forme = 'Castform';
				break;
			}
			if (pokemon.isActive && forme) {
				pokemon.formeChange(forme, this.effect, false, '[msg]');
			}
		},
		name: "Forecast",
		rating: 2,
		num: 59,
	},
	icebody: {
		desc: "If Hail or Diamond Dust is active, this Pokémon restores 1/16 of its maximum HP, rounded down, at the end of each turn. This Pokémon takes no damage from Hail.",
		shortDesc: "If Hail or Diamond Dust is active, heals 1/16 of its max HP each turn; immunity to Hail.",
		onWeather(target, source, effect) {
			if (effect.id === 'hail' || effect.id === 'diamonddust') {
				this.heal(target.baseMaxhp / 16);
			}
		},
		onImmunity(type, pokemon) {
			if (type === 'hail') return false;
		},
		name: "Ice Body",
		rating: 1,
		num: 115,
	},
	iceface: {
		desc: "If this Pokémon is an Eiscue, the first physical hit it takes in battle deals 0 neutral damage. Its ice face is then broken and it changes forme to Noice Face. Eiscue regains its Ice Face forme when Hail or Diamond Dust begins or when Eiscue switches in while Hail or Diamond Dust is active. Confusion damage also breaks the ice face.",
		shortDesc: "If Eiscue, the first physical hit it takes deals 0 damage. Effect restored in Hail, Diamond Dust.",
		onStart(pokemon) {
			if (
				(this.field.isWeather('hail') || this.field.isWeather('diamonddust')) &&
				pokemon.species.id === 'eiscuenoice' && !pokemon.transformed
			) {
				this.add('-activate', pokemon, 'ability: Ice Face');
				this.effectData.busted = false;
				pokemon.formeChange('Eiscue', this.effect, true);
			}
		},
		onDamagePriority: 1,
		onDamage(damage, target, source, effect) {
			if (
				effect && effect.effectType === 'Move' && effect.category === 'Physical' &&
				target.species.id === 'eiscue' && !target.transformed
			) {
				this.add('-activate', target, 'ability: Ice Face');


using System;
using LazySquirrelLabs.TerracedTerrainGenerator.Data;
using LazySquirrelLabs.TerracedTerrainGenerator.Utils;
using Unity.Collections;
using UnityEngine;

namespace LazySquirrelLabs.TerracedTerrainGenerator.ShapeGeneration.Plane.Polygons
{
	/// <summary>
	/// Generates a regular polygon mesh with 5 or more sides.
	/// </summary>
	internal class RegularPolygonGenerator : PolygonGenerator
	{
		#region Fields

		/// <summary>
		/// How many sides the polygon has.
		/// </summary>
		private readonly ushort _sides;

		#endregion

		#region Setup

		/// <summary>
		/// Creates a regular polygon generator.
		/// </summary>
		/// <param name="sides">How many sides the generated polygon should have.</param>
		/// <param name="radius">The radius of the generated polygon (distance between the center and its
		/// vertices).</param>
		/// <exception cref="ArgumentException">Thrown if the number of sides is less than 5. For squares and triangles,
		/// check <see cref="SquareGenerator"/> and <see cref="TriangleGenerator"/>.</exception>
		internal RegularPolygonGenerator(ushort sides, float radius) : base(radius)
		{
			if (sides < 5)
			{
				throw new ArgumentException("Regular polygons should have


 bits) {

        maskHighOrder(u, bits);

        return field.getElement(u);
    }

    /**
     * Mask off the high order bits of an encoded integer in an array. The
     * array is modified in place.
     *
     * @param arr an array containing an encoded integer
     * @param bits the number of bits to keep
     * @return the number, in range [1,8], of bits kept in the highest byte
     */
    private static byte maskHighOrder(byte[] arr, int bits) {

        int lastByteIndex = arr.length - 1;
        byte bitsMod8 = (byte) (bits % 8);
        byte highBits = bitsMod8 == 0 ? 8 : bitsMod8;
        byte msbMaskOff = (byte) ((1 << highBits) - 1);
        arr[lastByteIndex] &= msbMaskOff;

        return highBits;
    }

    /**
     * Prune an encoded scalar value by modifying it in place. The extra
     * high-order bits are masked off, the highest valid bit it set, and the
     * number is rounded down to a multiple of the cofactor.
     *
     * @param k an encoded scalar value
     * @param bits the number of bits in the scalar
     * @param logCofactor the base-2 logarithm of the cofactor
     */
    private static void pruneK(byte[] k, int bits, int logCofactor) {

        int lastByteIndex = k.length - 1;

        // mask off unused high-order bits
        byte highBits = maskHighOrder(k, bits);

        // set the highest bit
        byte msbMaskOn = (byte) (1 << (highBits - 1));
        k[lastByteIndex] |= msbMaskOn;

        // round down to a multiple of the cofactor
        byte lsbMaskOff = (byte) (0xFF << logCofactor);
        k[0] &= lsbMaskOff;
    }

    private void pruneK(byte[] k) {
        pruneK(k, params.getBits(), params.getLogCofactor());
    }

    private ImmutableIntegerModuloP decodeU(byte [] u) {
        return decodeU(u, params.getBits());
    }

    // Constant-time conditional swap
    private static void cswap(int swap, MutableIntegerModuloP x1,
        MutableIntegerModuloP x2) {

        x1.conditionalSwapWith(x2, swap);
    }

    private static IntegerFieldModuloP getIntegerFieldModulo(BigInteger p) {

        if (p.equals(IntegerPolynomial25519.MODULUS)) {
            return new IntegerPolynomial25519();
        }
        else if (p.equals(IntegerPolynomial448.MODULUS)) {
            return new IntegerPolynomial448();
        }

        throw new ProviderException("Unsupported prime: " + p.toString());
    }

    private int bitAt(byte[] arr, int index) {
        int byteIndex = index / 8;
        int bitIndex = index % 8;
        return (arr[byteIndex] & (1 << bitIndex)) >> bitIndex;
    }

    /*
     * Constant-time Montgomery ladder that computes k*u and returns the
     * result as a field element.
     */
    private IntegerModuloP pointMultiply(byte[] k,
                                         ImmutableIntegerModuloP u) {

        ImmutableIntegerModuloP x_1 = u;
        MutableIntegerModuloP x_2 = this.one.mutable();
        MutableIntegerModuloP z_2 = this.zero.mutable();
        MutableIntegerModuloP x_3 = u.mutable();
        MutableIntegerModuloP z_3 = this.one.mutable();
        int swap = 0;

        // Variables below are reused to avoid unnecessary allocation
        // They will be assigned in the loop, so initial value doesn't matter
        MutableIntegerModuloP m1 = this.zero.mutable();
        MutableIntegerModuloP DA = this.zero.mutable();
        MutableIntegerModuloP E = this.zero.mutable();
        MutableIntegerModuloP a24_times_E = this.zero.mutable();

        // Comments describe the equivalent operations from RFC 7748


bg     = beautiful.transparent,
							id     = 'background_role',
							widget = naughty.container.background,
						},
						strategy = 'min',
						width    = dpi(250),
						widget   = wibox.container.constraint,
					},
					strategy = 'max',
					height    = dpi(250),
					width    = dpi(250),
					widget   = wibox.container.constraint
				},
				bg = beautiful.back


\u{1F1EF}\u{1F1F4}",
		["category"] = "Flags",
	},
	["eye"] = {
		["popularity"] = 122,
		["base"] = "\u{1F441}\u{FE0F}",
		["category"] = "PeopleAndBody",
	},
	["handball"] = {
		["popularity"] = 981,
		["base"] = "\u{1F93E}",
		["category"] = "PeopleAndBody",
	},
	["flag-kz"] = {
		["popularity"] = 1375,
		["base"] = "\u{1F1F0}\u{1F1FF}",
		["category"] = "Flags",
	},
	["man-mountain-biking"] = {
		["popularity"] = 9999,
		["base"] = "\u{1F6B5}\u{200D}\u{2642}\u{FE0F}",
		["category"] = "PeopleAndBody",
	},
	["flag-ky"] = {
		["popularity"] = 1540,
		["base"] = "\u{1F1F0}\u{1F1FE}",
		["category"] = "Flags",
	},
	["garlic"] = {
		["popularity"] = 9999,
		["base"] = "\u{1F9C4}",
		["category"] = "FoodAndDrink",
	},
	["file-cabinet"] = {
		["popularity"] = 1356,
		["base"] = "\u{1F5C4}\u{FE0F}",
		["category"] = "Objects",
	},
	["flag-jm"] = {
		["popularity"] = 1049,
		["base"] = "\u{1F1EF}\u{1F1F2}",
		["category"] = "Flags",
	},
	["flag-kn"] = {
		["popularity"] = 1508,
		["base"] = "\u{1F1F0}\u{1F1F3}",
		["category"] = "Flags",
	},
	["deer"] = {
		["popularity"] = 628,
		["base"] = "\u{1F98C}",
		["category"] = "AnimalsAndNature",
	},
	["loudspeaker"] = {
		["popularity"] = 183,
		["base"] = "\u{1F4E2}",
		["category"] = "Objects",
	},
	["tiger2"] = {
		["popularity"] = 675,
		["base"] = "\u{1F405}",
		["category"] = "AnimalsAndNature",
	},
	["waning-crescent-moon"] = {
		["popularity"] = 959,
		["base"] = "\u{1F318}",
		["category"] = "TravelAndPlaces",
	},
	["flag-gu"] = {
		["popularity"] = 1476,
		["base"] = "\u{1F1EC}\u{1F1FA}",
		["category"] = "Flags",
	},
	["blue-book"] = {
		["popularity"] = 880,
		["base"] = "\u{1F4D8}",
		["category"] = "Objects",
	},
	["manual-wheelchair"] = {
		["popularity"] = 9999,
		["base"] = "\u{1F9BD}",
		["category"] = "TravelAndPlaces",
	},
	["clock1"] = {
		["popularity"] = 732,
		["base"] = "\u{1F550}",
		["category"] = "TravelAndPlaces",
	},
	["pray"] = {
		["popularity"] = 6,
		["base"] = "\u{1F64F}",
		["category"] = "PeopleAndBody",
	},
	["flag-scotland"] = {
		["popularity"] = 1072,
		["base"] = "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u


, -1);
    }

    const target = new duck.ProtoDuck({
      route: "",
      namespace: namespace,
    }) as InstanceType<ProtoDuck>;

    for (const key in target.types) {
      this.types[key] = target.types[key];
    }

    yield takeEvery(this.types.CREATE_DUCK, function* createDuck(action) {
      // 创建动态Duck
      const id = duck.generateId(action.payload);
      if (id in duck.DuckPool) return;
      const parentSelector = duck.selector;
      const target = new duck.ProtoDuck({
        route: id,
        namespace,
        selector: (state) => {
          return parentSelector(state)[id] || {};
        },
      }) as InstanceType<ProtoDuck>;
      duck.DuckPool[id] = target;
      yield put({ type: `${namespace}/${id}/${SLAVE_DUCK_INIT_TYPE}` });
      duck.DuckPool[id]["_sagaHandler"] = yield fork([target, target.saga]);
    });

    yield takeLatest(
      (action: Action<any>) =>
        action.type.startsWith(namespace) &&
        Object.values(duck.types).indexOf(action.type) < 0,
      function* (action: Action<any>) {
        // 向上汇聚
        const actionType = action.type.slice(namespace.length + 1);
        const slaveId = actionType.split("/")[0];
        if (!(slaveId in duck.DuckPool)) return;
        const subType = actionType.slice(slaveId.length + 1);
        if (subType === SLAVE_DUCK_INIT_TYPE) return;
        yield put({
          type: `${namespace}/${subType}`,
          payload: action.payload,
          slaveId,
        });
      }
    );
    yield takeLatest(this.types.CLEAR, function* () {
      for (const duckId in duck.DuckPool) {
        yield cancel(duck.DuckPool[duckId]["_sagaHandler"]);
      }
      delete duck.DuckPool;
      duck.DuckPool = {};
    });
  }

  generateId(seed) {
    return `Dynamic-${seed}`;
  }
  /**
   * 仅仅从selectors中那取
   * @param key
   */
  *getValueMap(key: string) {
    const res = {};
    const state = yield select();
    for (const id in this.DuckPool) {
      if (this.DuckPool[id].selectors[key])
        res[id] = this.DuckPool[id].selectors[key](state);
    }
    return res;
  }

  getDucks() {
    return this.DuckPool;
  }

  getDuck(seed: string): InstanceType<this["ProtoDuck"]> {
    const id = this.generateId(seed);
    return this.DuckPool[id];
  }
}

// 测试/示例代码
// if (process.env.NEVER_RUN) {
//   class DuckA extends Duck {}
//   class TestDuck extends DynamicDuck {
//     get ProtoDuck() {
//       return DuckA
//     }
//   }

//   const foo = new TestDuck()
//   foo.creators.createDuck('1')
//   const duck1 = foo.getDuck('1')

//   foo.creators.createDuck('2')
//   const duck2 = foo.getDuck('2')

//   duck1 !== duck2 //true

//   const DuckMap = foo.getDucks()
//   DuckMap['1'] === duck1 //true
//   DuckMap['2'] === duck2 //true
// }
import {Logger} from 'mitosis';
import {IConfiguration, IInstruction, InstructionType, InstructionTypeMap} from './interface';

export class InstructionFactory {

  public static arrayFromJSON(instructions: Array<any> =


eta-key {
    width: 90px;
}

.vm-meta .form-field {
    float: left;
}

.vm-meta .form-actions .form-action {
    float: left;
    margin-right: 10px;
    height: 11px;
}

.vm-meta .editor .form-actions .cancel {
    margin-right: 0;
}

.vm-meta .editor .form-actions {
    float: right;
    margin:0;
    padding:0;
    margin-left: 15px;
    margin-top: 0px;
}

.vm-meta .editor {
    background-color: rgba(64, 133, 165, 0.898) !important;
    background-color: #649DB8;
    font-size:0.9em;
}

.vm-meta .meta-key-title {
    font-size: 1.3em;
    color: #fff;
    margin-bottom: 10px;
    display: none;
    float: left;
}

.vm-meta .editor-content {
    padding: 10px;
}

.vm-meta .inner-mask {
    background-color: #fff;
    opacity:0.6;
    position: absolute;
    top:0;
    left:0;
}

.vm-meta .editor label {
    float: left;
    color: #fff;
    margin-right: 2px;
    padding-top:4px;
    font-size: 0.9em;
}

.vm-meta .editor input {
    border: none;
    width: 170px;
    margin-left: 10px;
    font-size: 0.9em;
    padding: 4px;
}

.vm-meta li.create .options-object-cont {
    background-color: #B3C9AD ;
    border-color: #788774;
}
.vm-meta li.create .options-object-cont .value,
.vm-meta li.create .options-object-cont .title {
    color: #fff;
}

.overlay-wizard .container {
    width: 624px !important;
}

.overlay.overlay-wizard {
    width: 640px;
}

.create-wizard-overlay .vm-network .list-cont.personalize-cont:last-child .confirm-params {
  margin-right: 0!important;
}

.create-wizard-overlay .list-cont.personalize-cont.noborder,
.create-wizard-overlay .vm-network .list-cont.personalize-cont:last-child {
  border-right: none;
  margin-right: 0;
  width: 298px;
}

.create-wizard-overlay .vm-network .list-cont.personalize-cont .confirm-params {
  max-height: 240px;
}

.create-wizard-overlay .vm-network .list-cont.personalize-cont {
  height: 330px;
}

.create-wizard-overlay .vm-network .list-cont.personalize-cont {
    width: 47%;
}

.create-wizard-overlay .list-cont.personalize-cont.meta.last {
    width: 220px !important;
}

.create-wizard-overlay .header-step.current {
    font-weight: bold;
}

.create-wizard-overlay .create-step-cont {
    min-height: 240px;
}
.create-wizard-overlay .create-controls {
    padding: 10px;
}

.create-wizard-overlay ul li {
    cursor: pointer;
    padding: 4px;
}

.create-wizard-overlay ul li.selected {
    background-color: #aaa;
}

.cont-toggler-wrapper {
  float: left;
  margin-right: 5px;
}

.cont-toggler-wrapper.disabled .cont-toggler,
.cont-toggler.disabled {
  background-color: #C1CED4;
  background-image: url("../images/down-arrow-lighter.png");
  border-right-color


e<2;e++){x.
drawXBitmap(f[e].x,f[e].y,V,46,13,O)}x.drawXBitmap(c,118,P,623,12,C);x.drawXBitmap(n,w,r.sprites[r.isAnimated?Math.floor(t%500/250):0],r.width,r.height,C);if(s){x.drawXBitmap(10,d+17,B[Math.floor(t%200/100)],55,26,C)}else{x.drawXBitmap(10,d,k[Math.floor(
t%200/100)],o,M,C)}x.setTextColor(C);x.drawText(l,235,5);x.pushSprite();if(20<n+r.width&&40>n&&d+M-20>w){if(w<78){if(w<50){if(!v)continue}else{if(s)continue}}p.default.tone(60,100);delay(20);p.default.tone(60,180);F.default.setTextColor(C);F.default.
setTextSize(2);F.default.setTextAlign(0);F.default.drawText("GAME OVER",70,40);delay(500);while(!m.default.getAnyPress()){delay(10)}n=300;delay(500);Y=now()}}}N();
import {log, Mirroring} from '../common';

const INITIAL_PALETTES = [
  0x09, 0x01, 0x00, 0x01, 0x00, 0x02, 0x02, 0x0D, // Background palettes 0, 1
  0x08, 0x10, 0x08, 0x24, 0x00, 0x00, 0x04, 0x2C, // Background palettes 2, 3
  0x09, 0x01, 0x34, 0x03, 0x00, 0x04, 0x00, 0x14, // Sprite palettes 0, 1
  0x08, 0x3A, 0x00, 0x02, 0x00, 0x20, 0x2C, 0x08, // Sprite palettes 2, 3
];

// $10000 +----------------------------------------------------------+ $10000
//        |                                                          |
//        |                  Mirrors of $0000-$3FFF                  |
//        |                                                          |
//  $4000 +----------------------------------------------------------+ $4000
//        |                  Mirrors of $3F00-$3F1F                  |
//  $3F20 +----------------------------------+-----------------------+ $3F20
//        |         Sprite palettes (4)      |                       |
//  $3F10 +----------------------------------+  Palette RAM indexes  |
//        |       Background palettes (4)    |                       |
//  $3F00 +----------------------------------+-----------------------+ $3F00 (Universal background color)
//        |                  Mirrors of $2000-$2EFF                  |
//  $3000 +-------------------+--------------+-----------------------+ $3000
//        | Attribute table 3 |              |                       |
//  $2FC0 +-------------------+  Nametable 3 |                       |
//        |


/            @_link-color-active
//            #ff5501
//            '' | false | value
//            Active link color
//

//

//            @_link-text-decoration-active
//            underline
//            '' | false | value
//            Active link text decoration
//

//

//

//  # Heading styling mixin
//
//  The .lib-heading() mixin is used to set heading styles to an element. To use this mixin, set the type of heading that you want to inherit styles from. The mixin uses global heading variables.
//
//  ```html
//  <h1 class="example-heading">Example heading</h1>
//  <h2 class="example-heading-2">Example heading</h2>
//  ```

.example-heading {
    .lib-heading(h1);
}
.example-heading-2 {
    .lib-heading(h2);
}

//  # Base typography mixins
//
//  Magento UI library offers mixins to styles elements sets.
//
//  The .lib-typography__base() mixin applyes basic styles from _variables.less to the following elements:
//
//  ```css
//  html
//  body
//  p
//  abbr
//  b
//  strong
//  em
//  i
//  mark
//  small
//  .small
//  hr
//  sub,
//  sup
//  dfn
//  ```
//
//  ```html
//  <p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac <small>turpis</small> egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, <em>tempor</em> sit amet, ante. Donec <sub>eu</sub> libero sit amet quam egestas semper. <code>Aenean ultricies</code> mi vitae <sup>est</sup>. Mauris placerat eleifend leo. <abbr>Quisque</abbr> sit amet est et sapien <mark>ullamcorper</mark> pharetra.</p>
//  <hr>
//  <p><dfn>Pellentesque</dfn> habitant <i>morbi</i> tristique <b>senectus</b> et netus et malesuada fames ac turpis egestas.</p>
//  ```

.lib-typography__base();

//  # Base typography mixin variables
//

//

//

//            Mixin variable
//            Global variable
//            Default value
//            Allowed values
//            Comment
//

//

//            @_abbr-border-color
//            @abbr__border-color
//            @border-color__base
//            '' | false | value
//            <abbr> border color
//

//

//            @_dfn-font-style
//            @font-style__emphasis
//            italic
//            '' | false | value</td


Hp() - 1 - 2 - 3 - 4 - 5);
		});
	}

	@Test
	public void testOverflowingEnergy() {
		runGym((context, player, opponent) -> {
			Random random = new XORShiftRandom(101010L);
			List<Card> cards = context.getCardCatalogue().getAll().stream()
					.filter(card -> card.getBaseManaCost() > 0)
					.filter(card -> card.getCardType().equals(CardType.SPELL))
					.collect(Collectors.toList());
			for (int i = 0; i < 7; i++) {
				receiveCard(context, player, cards.get(random.nextInt(cards.size())).getCardId());
			}
			receiveCard(context, player, "spell_lunstone");
			playCard(context, player, "spell_overflowing_energy");
			assertEquals(player.getHand().size(), 10);
			int count = 0;
			for (Card card : player.getHand()) {
				if (card.getCardId().equals("spell_lunstone")) {
					count++;
				}
			}
			assertEquals(count, 3);
		});

		runGym((context, player, opponent) -> {
			Random random = new Random();
			List<Card> cards = context.getCardCatalogue().getAll().stream()
					.filter(card -> card.getBaseManaCost() == 0)
					.filter(card -> card.getCardType().equals(CardType.SPELL))
					.collect(Collectors.toList());
			for (int i = 0; i < 8; i++) {
				receiveCard(context, player, cards.get(random.nextInt(cards.size())).getCardId());
			}
			playCard(context, player, "spell_overflowing_energy");
			assertEquals(player.getHand().size(), 10);
			assertEquals(player.getHand().get(8).getCardId(), player.getHand().get(9).getCardId());
			for (int i = 0; i < player.getHand().size() - 2; i++) {
				if (player.getHand().get(i).getCardId().equals(player.getHand().get(9).getCardId())) {
					return;
				}
			}
			assertTrue(false);
		});

		runGym((context, player, opponent) -> {
			receiveCard(context, player, "spell_overflowing_energy");
			receiveCard(context, player, "spell_overflowing_energy");
			receiveCard(context, player, "spell_overflowing_energy");
			playCard(context, player, "spell_overflowing_energy");
			assertEquals(5, player.getHand().size());
		});
	}

	@Test
	public void testChainedChimera() {
		runGym((context, player, opponent) -> {
			Card chimera = receiveCard(context, player, "minion_chained_chimera");
			playCard(context, player, "spell_lunstone");
			playCard(context, player, "spell_lunstone");
			player.setMana(4);
			playCard(context, player, chimera);
			assertEquals(player.getMana(), 1);
		});
	}

	@Test
	public void testDiscardedCreation() {
		runGym((context, player, opponent) -> {
			Card card = receiveCard(context, player, "minion_discarded_creation");
			playCard(context, player, "spell_lunstone");
			playCard(context, player, "spell_lunstone");
			playCard(context, player, "spell_lunstone");
			playCard(context, player, "spell_lunstone");
			Minion minion = playMinionCard(context, player, card);
			assertTrue(minion.hasAttribute(Attribute.CHARGE));
			assertFalse(minion.hasAttribute(Attribute.RUSH));
		});

		runGym((context


split( '\n' );
			for (let i = 0; i < 8; i++) {
				// allow for redirection, [Redirected to whois.ripe.net]
				const line = lines[i];
				if( line.substr( 0, 1 ) === '[' ) {
					let pos = line.indexOf( 'whois.' );
					if( pos === -1 ) {
						// [vault.krypt.com] length is the same!
						pos = line.indexOf( 'vault.' );
					}
					if( pos > -1 ) {
						const parts = line.substr( pos ).split( '.' );
						nic = line.substr( pos+6, line.indexOf( ']' ) - ( pos+6 ) );
						if( parts[1] === 'registro' ) {
							nic = nic.replace(/registro/,'nic');
						}
					}
				} else {
					i = 8; // teminate loop
				}
			}
		}
		this.nic = nic;
		return nic;
	}
	//
	// process the raw data from whois
	// returns: this class { nic, net, abuse, inet }
	ProcessNetSolutions( nic: string, raw: string ) {
		let net = '', abuse = '', inet = '';
		const lines = raw.split( '\n' );
		const netAtt = [ 'customer organization', 'org-name' ];
		const inetAtt = [ 'ip-network' ];
		const abuseAtt = [ 'abuse-email', 'abuse-contact;i' ];
		raw.split( '\n' ).forEach( ( line ) => {
			const flds = line.split( ':' );
			if( this.netSolutions.includes( nic ) ) {
				if( flds.length > 2 ) {
					const attrib: string = flds[1].toLowerCase( );
					if( netAtt.includes( attrib ) ) { net = flds[2].replace(/(\r\n|\n|\r)/gm,''); }
					if( abuseAtt.includes( attrib ) ) { abuse = flds[2].replace(/(\r\n|\n|\r)/gm,''); }
					if( inetAtt.includes( attrib ) ) { inet = flds[2].replace(/(\r\n|\n|\r)/gm,''); }
				}
			}
		});
		this.nic = nic; this.net = net; this.abuse = abuse; this.inet = inet;
		if( this.BadAbuseEmail() ) {
			this.abuse = '';
		}
		return { 'nic': nic, 'net': net, 'abuse': abuse, 'inet': inet };
	}
	//
	// process the raw data from whois
	// returns: this class { nic, net, abuse, inet }
	ProcessTw( nic: string, raw: string ) {
		let net = '', abuse = '', inet = '';
		const lines: string[] = raw.split( '\n' );
		let prvs: string[] = [];
		raw.split( '\n' ).forEach( ( line ) => {
			const flds: string[] = line.trim().split( ':' );
			if( flds.length > 1 ) {
				const attrib: string = flds[0].toLowerCase( );
				if( attrib === 'netname' ) { net = flds[1].trim().replace(/(\r\n|\n|\r)/gm,''); }
				if( attrib === 'netblock' ) { inet = flds[1].replace(/(\r\n|\n|\r)/gm,''); }
			} else {
				if( prvs.length > 1 ) {
					// Technical contact:
					// network-adm@hinet.net
					const attrib: string = prvs[0].toLowerCase( );
					if( attrib === 'technical contact' ) {
						abuse = flds[0].trim().replace(/(\r\n|\n|\r)/gm,'');
					}
				}
			}
			prvs = flds;
		});
		this.nic = nic; this.net = net; this.abuse = abuse; this.inet = inet;
		if( this.BadAbuseEmai


    if (typeof offsetAfter === 'function') {
      offsetAfter = params.slidesOffsetAfter.call(swiper);
    }

    const previousSnapGridLength = swiper.snapGrid.length;
    const previousSlidesGridLength = swiper.slidesGrid.length;
    let spaceBetween = params.spaceBetween;
    let slidePosition = -offsetBefore;
    let prevSlideSize = 0;
    let index = 0;

    if (typeof swiperSize === 'undefined') {
      return;
    }

    if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
      spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
    }

    swiper.virtualSize = -spaceBetween; // reset margins

    if (rtl) slides.css({
      marginLeft: '',
      marginBottom: '',
      marginTop: ''
    });else slides.css({
      marginRight: '',
      marginBottom: '',
      marginTop: ''
    }); // reset cssMode offsets

    if (params.centeredSlides && params.cssMode) {
      setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', '');
      setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', '');
    }

    const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;

    if (gridEnabled) {
      swiper.grid.initSlides(slidesLength);
    } // Calc slides

    let slideSize;
    const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
      return typeof params.breakpoints[key].slidesPerView !== 'undefined';
    }).length > 0;

    for (let i = 0; i < slidesLength; i += 1) {
      slideSize = 0;
      const slide = slides.eq(i);

      if (gridEnabled) {
        swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
      }

      if (slide.css('display') === 'none') continue; // eslint-disable-line

      if (params.slidesPerView === 'auto') {
        if (shouldResetSlideSize) {
          slides[i].style[getDirectionLabel('width')] = ``;
        }

        const slideStyles = getComputedStyle(slide[0]);
        const currentTransform = slide[0].style.transform;
        const currentWebKitTransform = slide[0].style.webkitTransform;

        if (currentTransform) {
          slide[0].style.transform = 'none';
        }

        if (currentWebKitTransform) {
          slide[0].style.webkitTransform = 'none';
        }

        if (params.roundLengths) {
          slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
        } else {
          // eslint-disable-next-line
          const width = getDirectionPropertyValue(slideStyles, 'width');
          const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
          const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
          const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
          const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
          const boxSizing = slideStyles.getPropertyValue('box-sizing');

          if (boxSizing && boxSizing === 'border-box') {
            slideSize = width + marginLeft + marginRight;
          } else {
            const {
              clientWidth,
              offsetWidth
            } = slide[0];
            slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
          }
        }

        if (currentTransform) {
          slide[0].style.transform = currentTrans


().unwrap();
        let _res = SignalContext::curve_calculate_agreement(&public, &private).unwrap();
    }

    #[test]
    fn curve_verify_signature() {
        // Create all contexts and builder.
        let alice_identity_public = [
            0x05, 0xab, 0x7e, 0x71, 0x7d, 0x4a, 0x16, 0x3b, 0x7d, 0x9a, 0x1d, 0x80, 0x71, 0xdf,
            0xe9, 0xdc, 0xf8, 0xcd, 0xcd, 0x1c, 0xea, 0x33, 0x39, 0xb6, 0x35, 0x6b, 0xe8, 0x4d,
            0x88, 0x7e, 0x32, 0x2c, 0x64,
        ];
        let alice_ephemeral_public = [
            0x05, 0xed, 0xce, 0x9d, 0x9c, 0x41, 0x5c, 0xa7, 0x8c, 0xb7, 0x25, 0x2e, 0x72, 0xc2,
            0xc4, 0xa5, 0x54, 0xd3, 0xeb, 0x29, 0x48, 0x5a, 0x0e, 0x1d, 0x50, 0x31, 0x18, 0xd1,
            0xa8, 0x2d, 0x99, 0xfb, 0x4a,
        ];
        let alice_signature = [
            0x5d, 0xe8, 0x8c, 0xa9, 0xa8, 0x9b, 0x4a, 0x11, 0x5d, 0xa7, 0x91, 0x09, 0xc6, 0x7c,
            0x9c, 0x74, 0x64, 0xa3, 0xe4, 0x18, 0x02, 0x74, 0xf1, 0xcb, 0x8c, 0x63, 0xc2, 0x98,
            0x4e, 0x28, 0x6d, 0xfb, 0xed, 0xe8, 0x2d, 0xeb, 0x9d, 0xcd, 0x9f, 0xae, 0x0b, 0xfb,
            0xb8, 0x21, 0x56, 0x9b, 0x3d, 0x90, 0x01, 0xbd, 0x81, 0x30, 0xcd, 0x11, 0xd4, 0x86,
            0xce, 0xf0, 0x47, 0xbd, 0x60, 0xb8, 0x6e, 0x88,
        ];

        let out = SignalContext::curve_verify_signature(
            &alice_identity_public,
            &alice_ephemeral_public,
            &alice_signature,
        );

        assert_eq!(out, true);

        let fake_alice_signature = [
            0x00, 0xe8, 0x8c, 0xa9, 0xa8, 0x9b, 0x4a, 0x11, 0x5d, 0xa7, 0x91, 0x09, 0xc6, 0x7c,
            0x9c, 0x74, 0x64, 0xa3, 0xe4, 0x18, 0x02, 0x74, 0xf1, 0xcb, 0x8c, 0x63, 0xc2, 0x98,
            0x4e, 0x28, 0x6d, 0xfb, 0xed, 0xe8, 0x2d, 0xeb, 0x9d, 0xcd, 0x9f, 0xae, 0x0b, 0xfb,
            0xb8, 0x21, 0x56, 0x9b, 0x3d, 0x90, 0x01, 0xbd, 0x81, 0x30, 0xcd, 0x11, 0xd4, 0x86,
            0xce, 0xf0, 0x47, 0xbd, 0x60, 0xb8, 0x6e, 0x88,
        ];
        let failout = SignalContext::curve_verify_signature(
            &alice_identity_public,
            &alice_ephemeral_public,
            &fake_alice_signature,
        );

        assert_eq!(failout, false);
    }

    #[test]
    fn test_wa_signature() {
        let wa_pub_key = [
            0xF7, 0x42, 0x48, 0xD2, 0xE8, 0xC4, 0x72, 0x06, 0x0F, 0x5B, 0x39, 0xE9, 0xE0, 0xCC,
            0x76, 0xC3, 0x38, 0x3F, 0xAB, 0x94, 0xF6, 0x91, 0x0F, 0xCC, 0xD0, 0xDB, 0x60, 0xB3,


.JavaLocalPattern -> {
          threadNames[pattern.threadName] = referenceMatcher
        }
        is StaticFieldPattern -> {
          val mapOrNull = staticFieldNameByClassName[pattern.className]
          val map = if (mapOrNull != null) mapOrNull else {
            val newMap = mutableMapOf<String, ReferenceMatcher>()
            staticFieldNameByClassName[pattern.className] = newMap
            newMap
          }
          map[pattern.fieldName] = referenceMatcher
        }
        is InstanceFieldPattern -> {
          val mapOrNull = fieldNameByClassName[pattern.className]
          val map = if (mapOrNull != null) mapOrNull else {
            val newMap = mutableMapOf<String, ReferenceMatcher>()
            fieldNameByClassName[pattern.className] = newMap
            newMap
          }
          map[pattern.fieldName] = referenceMatcher
        }
        is NativeGlobalVariablePattern -> {
          jniGlobals[pattern.className] = referenceMatcher
        }
      }
    }
    this.fieldNameByClassName = fieldNameByClassName
    this.staticFieldNameByClassName = staticFieldNameByClassName
    this.threadNameReferenceMatchers = threadNames
    this.jniGlobalReferenceMatchers = jniGlobals
  }

  fun findPathsFromGcRoots(
    leakingObjectIds: Set<Long>,
    computeRetainedHeapSize: Boolean
  ): PathFindingResults {
    listener.onAnalysisProgress(FINDING_PATHS_TO_RETAINED_OBJECTS)

    val objectClass = graph.findClassByName("java.lang.Object")
    val sizeOfObjectInstances = determineSizeOfObjectInstances(objectClass, graph)
    val javaLangObjectId = objectClass?.objectId ?: -1

    // Estimate of how many objects we'll visit. This is a conservative estimate, we should always
    // visit more than that but this limits the number of early array growths.
    val estimatedVisitedObjects = (graph.instanceCount / 2).coerceAtLeast(4)

    val state = State(
      leakingObjectIds = leakingObjectIds.toLongScatterSet(),
      sizeOfObjectInstances = sizeOfObjectInstances,
      computeRetainedHeapSize = computeRetainedHeapSize,
      javaLangObjectId = javaLangObjectId,
      estimatedVisitedObjects = estimatedVisitedObjects
    )

    return state.findPathsFromGcRoots()
  }

  private fun determineSizeOfObjectInstances(
    objectClass: HeapClass?,
    graph: HeapGraph
  ): Int {
    return if (objectClass != null) {
      // In Android 16 ClassDumpRecord.instanceSize for java.lang.Object can be 8 yet there are 0
      // fields. This is likely because there is extra per instance data that isn't coming from
      // fields in the Object class. See #1374
      val objectClassFieldSize = objectClass.readFieldsByteSize()

      // shadow$_klass_ (object id) + shadow$_monitor_ (Int)
      val sizeOfObjectOnArt = graph.identifierByteSize + INT.byteSize
      if (objectClassFieldSize == sizeOfObjectOnArt) {
        sizeOfObjectOnArt
      } else {
        0
      }
    } else {
      0
    }
  }

  private fun Set<Long>.toLongScatterSet(): LongScatterSet {
    val longScatterSet = LongScatterSet()
    longScatterSet.ensureCapacity(size)
    forEach { longScatterSet.add(it) }
    return longScatterSet
  }

  private fun State.findPathsFromGcRoots(): PathFindingResults {
    enqueueGcRoots()

    val shortestPathsToLeakingObjects = mutableListOf<ReferencePathNode>()
    visitingQueue@ while (queuesNotEmpty) {
      val node = poll()
      if (leakingObjectIds.contains(node.objectId)) {
        shortestPathsToLeakingObjects.add(node)
        // Found all refs, stop searching (unless computing retained size)
        if (shortestPathsToLeakingObjects.size == leakingObjectIds.size()) {
          if (computeRetainedHeapSize) {
            listener.onAnalysisProgress(FINDING_DOMINATORS)
          } else {
            break@visitingQueue
          }
        }


   assert_eq!(
            writer.get("retry-regressed-list.txt", &mime::TEXT_PLAIN_UTF_8),
            b"brson/hello-rs\nsyn\n",
        );
    }
}
<reponame>KIBEBENSON/hhvm<gh_stars>1-10
// Copyright (c) 2019, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.

use ocamlrep::ptr::UnsafeOcamlPtr;
use ocamlrep::rc::RcOc;
use ocamlrep::OcamlRep;
use oxidized::relative_path::RelativePath;
use std::rc::Rc;

pub const INVALID: char = '\x00';

#[derive(Debug)]
struct SourceTextImpl<'a> {
    // All the indices in existing implementation are byte based, instead of unicode
    // char boundary based. This is bad experience for non-ASCII source files, but don't want to
    // change it now and deal with tracking all the dependencies of it.
    // Additionally, Rust assumes that &strs are valid UTF-8", but "test/slow/labels/74.php" suggests
    // that invalid unicode sequence can be a valid Hack program.
    // Using byte slice instead of &str looks ugly, but prevents us from constantly fighting
    // with compiler trying to guide us towards unicode semantics.
    text: &'a [u8],

    file_path: RcOc<RelativePath>,

    ocaml_source_text: Option<UnsafeOcamlPtr>,
}
#[derive(Debug, Clone)]
pub struct SourceText<'a>(Rc<SourceTextImpl<'a>>);

impl<'a> SourceText<'a> {
    pub fn make(file_path: RcOc<RelativePath>, text: &'a [u8]) -> Self {
        Self::make_with_raw(file_path, text, 0)
    }

    pub fn make_with_raw(
        file_path: RcOc<RelativePath>,
        text: &'a [u8],
        ocaml_source_text: usize,
    ) -> Self {
        Self(Rc::new(SourceTextImpl {
            file_path,
            text,
            ocaml_source_text: if ocaml_source_text == 0 {
                None
            } else {
                unsafe { Some(UnsafeOcamlPtr::new(ocaml_source_text)) }
            },
        }))
    }

    pub fn file_path(&self) -> &RelativePath {
        self.0.file_path.as_ref()
    }

    pub fn file_path_rc(&self) -> RcOc<RelativePath> {
        RcOc::clone(&self.0.file_path)
    }

    pub fn text(&self) -> &'a [u8] {
        self.0.text
    }

    pub fn length(&self) -> usize {
        self.text().len()
    }

    pub fn ocaml_source_text(&self) -> Option<UnsafeOcamlPtr> {
        self.0.ocaml_source_text
    }

    pub fn get(&self, index: usize) -> char {
        self.text()
            .get(index)
            .map(|x| *x as char)
            .unwrap_or(INVALID)
    }

    pub fn sub(&self, start: usize, length: usize) -> &'a [u8] {
        let len = self.length();

        if start >= len {
            b""
        } else if start + length > len {
            &self.text()[start..]
        } else {
            &self.text()[start..(start + length)]
        }
    }

    pub fn sub_as_str(&self, start: usize, length: usize) -> &'a str {
        unsafe { std::str::from_utf8_unchecked(self.sub(start, length)) }
    }
}

impl<'content> OcamlRep for SourceText<'


rbx, 16(%rbp)
	cmpq	$_ZNK5boost16exception_detail25error_info_container_impl7add_refEv, %rdx
	jne	.L3107
.L3115:
	addl	$1, 88(%rbx)
	jmp	.L3105
	.p2align 4,,10
	.p2align 3
.L3106:
	movq	%rbx, 16(%rbp)
	movl	$_ZTVN5boost16exception_detail25error_info_container_implE+16, %eax
	jmp	.L3115
	.p2align 4,,10
	.p2align 3
.L3107:
	movq	%rbx, %rdi
	call	*%rdx
.LEHE530:
	jmp	.L3135
.L3116:
	movq	%rax, %rbx
.L3113:
	movq	24(%rsp), %rdi
	testq	%rdi, %rdi
	je	.L3114
	call	_ZN5boost6detail15sp_counted_base7releaseEv
.L3114:
	movq	%rbx, %rdi
.LEHB531:
	call	_Unwind_Resume
.LEHE531:
.L3117:
	movq	40(%rsp), %rdi
	movq	%rax, %rbx
	testq	%rdi, %rdi
	je	.L3113
	call	_ZN5boost6detail15sp_counted_base7releaseEv
	jmp	.L3113
	.cfi_endproc
.LFE13722:
	.section	.gcc_except_table
.LLSDA13722:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE13722-.LLSDACSB13722
.LLSDACSB13722:
	.uleb128 .LEHB528-.LFB13722
	.uleb128 .LEHE528-.LEHB528
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB529-.LFB13722
	.uleb128 .LEHE529-.LEHB529
	.uleb128 .L3117-.LFB13722
	.uleb128 0
	.uleb128 .LEHB530-.LFB13722
	.uleb128 .LEHE530-.LEHB530
	.uleb128 .L3116-.LFB13722
	.uleb128 0
	.uleb128 .LEHB531-.LFB13722
	.uleb128 .LEHE531-.LEHB531
	.uleb128 0
	.uleb128 0
.LLSDACSE13722:
	.section	.text._ZN5boost16exception_detail11set_info_rvINS_10error_infoINS_27tag_original_exception_typeEPKSt9type_infoEEE3setINS0_39current_exception_std_exception_wrapperISt8bad_castEEEERKT_SF_OS7_,"axG",@progbits,_ZN5boost16exception_detail11set_info_rvINS_10error_infoINS_27tag_original_exception_typeEPKSt9type_infoEEE3setINS0_39current_exception_std_exception_wrapperISt8bad_castEEEERKT_SF_OS7_,comdat
	.size	_ZN5boost16exception_detail11set_info_rvINS_10error_infoINS_27tag_original_exception_typeEPKSt9type_infoEEE3setINS0_39current_exception_std_exception_wrapperISt8bad_castEEEERKT_SF_OS7_, .-_ZN5boost16exception_detail11set


4. 前置技能条件验证
```lpc
// 验证最多5项前置技能及其等级
for (i = 1; i <= 5; i++) {
    if (b["sk" + i] && who->query_skill(b["sk" + i], 1) < b["lv" + i])
        return "你的" + to_chinese(b["sk" + i]) + "火候不够，恐怕难以领悟其中精要。";
}
```

#### 5. 内功轻功要求检查
```lpc
// 检查基础内功和轻功等级
if (b["force"] && who->query_skill("force", 1) < b["force"])
    return "你的内功修为太差，恐怕难以领悟其中精要。";

if (b["dodge"] && who->query_skill("dodge", 1) < b["dodge"])
    return "你的轻功修为太差，恐怕难以领悟其中精要。";
```

#### 6. 内力精力修为验证
```lpc
// 验证内力上限是否达标
if (b["neili"] && who->query("max_neili") < b["neili"])
    return "你的内力修为太差，恐怕难以领悟其中精要。";

// 验证精力上限是否达标
if (b["jingli"] && who->query("max_jingli") < b["jingli"])
    return "你的精力修为太差，恐怕难以领悟其中精要。";
```

#### 7. 武功传授执行
```lpc
// 计算技能提升等级
lvl = who->query_skill(name, 1) / 2 + 1;
if (lvl > 200) lvl = 200;

// 授予主要武功技能
who->set_skill(name, lvl);

// 提升相关基础技能（如果是可激发类型）
for (i = 1; i <= 5; i++) {
    if (b["sk" + i] && member_array(b["sk" + i], valid_types) != -1)
        who->set_skill(b["sk" + i], who->query_skill(b["sk" + i], 1) + lvl/2);
}
```

#### 8. 门派贡献值扣除
```lpc
// 扣除门派贡献值（如果配置了要求）
if (b["gongxian"])
    who->add("gongxian", -b["gongxian"]);
```

## ⚙ 配置参数详解

### 武功传授配置参数

| 参数名 | 类型 | 必须 | 说明 | 示例 |
|--------|------|------|------|------|
| `name` | string | 是 | 武功技能名称 | "sword", "force", "dodge" |
| `perform` | string | 否 | 绝招名称（预留） | "pi", "qiao" |
| `free` | int | 否 | 是否无视门派限制（1=是） | 1 |
| `


optdeps(package.to_string())?.iter().for_each(|x| {
                            opt_deps.push(x.to_string());
                        });
                    }
                    opt_deps.iter().for_each(|x| packages.push(x.to_string()));
                    opt_args.iter().for_each(|x| packages.push(x.to_string()));
                    break;
                }
                _ => return Err(String::from("Macro not implemented or invalid")),
            }
        } else {
            packages.push(pack.to_string());
        }
    }
    if !options.nobuild {
        build(operation, packages, options).map(|_| vec![String::from("")])
    } else {
        Ok(packages)
    }
}
<reponame>tami5/neo4jrs<filename>macros/src/lib.rs<gh_stars>0
mod ast;
mod bolt_struct;
mod label;

use proc_macro::TokenStream;
use proc_macro_error::proc_macro_error;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};

#[proc_macro_derive(BoltStruct, attributes(signature))]
#[proc_macro_error]
pub fn derive_boltstruct(input: TokenStream) -> TokenStream {
    bolt_struct::expand(parse_macro_input!(input as DeriveInput))
        .unwrap_or_else(to_stream)
        .into()
}

#[proc_macro_derive(Label, attributes(neo4j))]
#[proc_macro_error]
pub fn derive_label(input: TokenStream) -> TokenStream {
    label::expand(parse_macro_input!(input as DeriveInput))
        .unwrap_or_else(to_stream)
        .into()
}

fn to_stream(errors: Vec<syn::Error>) -> proc_macro2::TokenStream {
    let compile_errors = errors.iter().map(syn::Error::to_compile_error);
    quote!(#(#compile_errors)*)
}
<filename>src/object.rs
use std::collections::HashMap;

use id::Id;
use timestamp::Timestamp;

/// Temporary structure to encode object details.
///
/// I'm still thinking about how objects should be structured, but I want to
/// tinker with other pieces of the codebase.
#[derive(Debug, Clone)]
pub enum ObjectDetails {
    Forest {
        // This isn't relevant outside the battlefield
        tapped: bool,
    },
}

/// A super simplified view of abilities; this will need to be separated into
/// mana abilities and not, represent priority, and actually represent
/// descriptors of what these abilities do.
#[derive(Debug, Clone)]
pub enum Ability {
    AddGreen,
}

/// Describes an object that exists anywhere in the game.
///
/// The game dictates that when objects move to different zones, they actually
/// become new objects (with new IDs!). That motivates the idea that the object
/// itself should be lightweight and replacable, with most of the interesting
/// data living inside another, persistent object.
///
/// We'll need to represent several kinds of object:
/// * Cards
///     * Permanents and non-permanents on the battlefield
///     * Cards in a graveyard, library, or hand
///     * Spells on the stack
/// * Tokens
///     * Unique tokens, like 2/2 zombies
///     * Copies of cards
/// * Emblems
/// * Abilities on the stack, never represented by a card
/// * Copies of spells on the stack
#[derive(Debug, Clone)]
pub struct Object {
    pub id: Id,
    pub zone: Id,

    /// A monotonically-increasing value describing when the


 the percpu data structure pointer for the boot cpu */
    /* NOTE: sets the first cpu as APIC id 0 for now, which may not be correct. Fixed later in boot. */
    xor %edi, %edi
    xor %esi, %esi
    call x86_configure_percpu_early

    /* call the main module */
    call lk_main

0:                          /* just sit around waiting for interrupts */
    hlt                     /* interrupts will unhalt the processor */
    pause
    jmp 0b                  /* so jump back to halt to conserve power */


];
                }

                return results;
            }
            catch
            {
                return
                [
                    "Error while finding the camera"
                ];
            }
        }
        private async Task CheckUpdate(string currentVersion)
        {
            var latestRelease = await AppUpdater.GetGithubLatestReleaseInfo();

            if (latestRelease != null && !currentVersion.Equals(latestRelease.Name, StringComparison.OrdinalIgnoreCase))
            {
                var sb = new StringBuilder();
                sb.AppendLine($"The latest version '{latestRelease.Name}' was released on {latestRelease.CreatedAt.ToString("MMMM dd, yyyy")}.");
                sb.AppendLine();
                sb.AppendLine("Please check the description of the latest version as below:");
                sb.AppendLine(latestRelease.Body);
                sb.AppendLine();
                sb.AppendLine($"It is recommended to download and use the latest version for smoothest experience.");

                var noti = new ContentDialog
                {
                    X


///  myPath.enabledTags |= 1 << 5;
		/// To set it to false, you would do
		///  myPath.enabledTags &= ~(1 << 5);
		///
		/// The Seeker has a popup field where you can set which tags to use.
		/// Note: If you are using a Seeker. The Seeker will set this value to what is set in the inspector field on StartPath.
		/// So you need to change the Seeker value via script, not set this value if you want to change it via script.
		///
		/// See: CanTraverse
		///
		public int enabledTags = -1;

		/// List of zeroes to use as default tag penalties
		static readonly int[] ZeroTagPenalties = new int[32];

		///
		/// The tag penalties that are actually used.
		/// If manualTagPenalties is null, this will be ZeroTagPenalties
		/// See: tagPenalties
		///
		protected int[] internalTagPenalties;

		///
		/// Tag penalties set by other scripts
		/// See: tagPenalties
		///
		protected int[] manualTagPenalties;

		///
		/// Penalties for each tag.
		/// Tag 0 which is the default tag, will have added a penalty of tagPenalties[0].
		/// These should only be positive values since the A* algorithm cannot handle negative penalties.
		///
		/// When assigning an array to this property it must have a length of 32.
		///
		/// Note: Setting this to null, or trying to assign an array which does not have a length of 32, will make all tag penalties be treated as if they are zero.
		///
		/// Note: If you are using a Seeker. The Seeker will set this value to what is set in the inspector field when you call seeker.StartPath.
		/// So you need to change the Seeker's value via script, not set this value.
		///
		/// See: Seeker.tagPenalties
		///
		public int[] tagPenalties {
			get {
				return manualTagPenalties;
			}
			set {
				if (value == null || value.Length != 32) {
					manualTagPenalties = null;
					internalTagPenalties = ZeroTagPenalties;
				} else {
					manualTagPenalties = value;
					internalTagPenalties = value;
				}
			}
		}

		///
		/// True for paths that want to search all nodes and not jump over nodes as optimizations.
		/// This disables Jump Point Search when that is enabled to prevent e.g ConstantPath and FloodPath
		/// to become completely useless.
		///
		internal virtual bool FloodingPath {
			get {
				return false;
			}
		}

		///
		/// Total Length of the path.
		/// Calculates the total length of the <see cref="vectorPath"/>.
		/// Cache this rather than call this function every time since it will calculate the length every time, not just return a cached value.
		/// Returns: Total length of <see cref="vectorPath"/>, if <see cref="vectorPath"/> is null positive infinity is returned.
		///
		public float GetTotalLength () {
			if (vectorPath == null) return float.PositiveInfinity;
			float tot = 0;
			for (int i = 0; i < vectorPath.Count-1; i++) tot += Vector3.Distance(vectorPath[i], vectorPath[i+1]);
			return tot;
		}

		///
		/// Waits until this path has been calculated and returned.
		/// Allows for very easy scripting.
		///
		/// IEnumerator Start () {
		///  var path = seeker.StartPath(transform.position, transform.position + transform.forward*10, null);
		///  yield return StartCoroutine(path.WaitForPath());
		///  // The path is calculated now
		/// }
		///
		///
		/// Note: Do n


��ٜ࣪࣪࣪۬☪̸─ׅ─ׅ┈ ─๋︩︪─╮
 ╭╼☁⬪࣪ꥈ𑁍⃪࣭۪ٜ݊݊݊݊݊໑ٜ࣪ 🄾🄽 / 🄾🄵🄵 ໑⃪࣭۪ٜ݊݊݊݊𑁍ꥈ࣪⬪☁
 ┃֪࣪  ╰─ׅ─ׅ┈ ─๋︩︪─☪̸⃘̸࣭ٜ࣪࣪࣪۬◌⃘⃪۪𐇽֟፝֯۫۫۫۬🔥⃘⃪۪֟፝֯۫۫۫۬◌⃘࣭ٜ࣪࣪࣪۬☪̸─ׅ─ׅ┈ ─๋︩︪─╯
 ├ׁ̟̇❍✎ .enable <option>
 ├ׁ̟̇❍✎ .disable <option>
 ╚▭࣪▬ִ▭࣪▬ִ▭࣪▬ִ▭࣪▬ִ▭࣪▬ִ▭࣪▬▭╝

 .    ╭─ׅ─ׅ┈ ─๋︩︪─☪̸⃘̸࣭ٜ࣪࣪࣪۬◌⃘⃪۪𐇽֟፝֯۫۫۫۬🔥⃘⃪۪֟፝֯۫۫۫۬◌⃘࣭ٜ࣪࣪࣪۬☪̸─ׅ─ׅ┈ ─๋︩︪─╮
 ╭╼☁⬪࣪ꥈ𑁍⃪࣭۪ٜ݊݊݊݊݊໑ٜ࣪ 🄳🄴🅂🄲🄰🅁🄶🄰🅂 ໑⃪࣭۪ٜ݊݊݊݊𑁍ꥈ࣪⬪☁
 ┃֪࣪  ╰─ׅ─ׅ┈ ─๋︩︪─☪̸⃘̸࣭ٜ࣪࣪࣪۬◌⃘⃪۪𐇽֟፝֯۫۫۫۬🔥⃘⃪۪֟፝֯۫۫۫۬◌⃘࣭ٜ࣪࣪࣪۬☪̸─ׅ─ׅ┈ ─๋︩︪─╯
 ├ׁ̟̇❍✎ .facebook
 ├ׁ̟̇❍✎ .fb
 ├ׁ̟̇❍✎ .play
 ├ׁ̟̇❍✎ .playvid
 ├ׁ̟̇❍✎ .gitclone *<url git>*
 ├ׁ̟̇❍✎ .instagram
 ├ׁ̟̇❍✎ .ig
 ├ׁ̟̇❍✎ .imagen <query>


ix2:], wa[ix3:], wa[ix4:])
			}
		default:
			if ido == 1 {
				na = !na
			}
			if na {
				radfg(ido, ip, l1, idl1, ch, ch, ch, c, c, wa[iw:])
				na = false
			} else {
				radfg(ido, ip, l1, idl1, c, c, c, ch, ch, wa[iw:])
				na = true
			}
		}

		l2 = l1
	}

	if na {
		return
	}
	for i := 0; i < n; i++ {
		c[i] = ch[i]
	}
}

func radf2(ido, l1 int, cc, ch, wa1 []float64) {
	cc3 := newThreeArray(ido, l1, 2, cc)
	ch3 := newThreeArray(ido, 2, l1, ch)

	for k := 0; k < l1; k++ {
		ch3.set(0, 0, k, cc3.at(0, k, 0)+cc3.at(0, k, 1))
		ch3.set(ido-1, 1, k, cc3.at(0, k, 0)-cc3.at(0, k, 1))
	}
	if ido < 2 {
		return
	}
	if ido > 2 {
		idp2 := ido + 1
		for k := 0; k < l1; k++ {
			for i := 2; i < ido; i += 2 {
				ic := idp2 - (i + 1)

				t2 := complex(wa1[i-2], -wa1[i-1]) * cc3.atCmplx(i-1, k, 1)
				ch3.setCmplx(i-1, 0, k, cc3.atCmplx(i-1, k, 0)+t2)

				// This is left as conj(z1)-conj(z2) rather than conj(z1-z2)
				// to retain current signed zero behaviour.
				ch3.setCmplx(ic-1, 1, k, cmplx.Conj(cc3.atCmplx(i-1, k, 0))-cmplx.Conj(t2))
			}
		}
		if ido%2 == 1 {
			return
		}
	}
	for k := 0; k < l1; k++ {
		ch3.set(0, 1, k, -cc3.at(ido-1, k, 1))
		ch3.set(ido-1, 0, k, cc3.at(ido-1, k, 0))
	}
}

func radf3(ido, l1 int, cc, ch, wa1, wa2 []float64) {
	const (
		taur = -0.5
		taui = 0.866025403784439 // sqrt(3)/2
	)

	cc3 := newThreeArray(ido, l1, 3, cc)
	ch3 := newThreeArray(ido, 3, l1, ch)

	for k := 0; k < l1; k++ {
		cr2 := cc3.at(0, k, 1) + cc3.at(0, k, 2)
		ch3.set(0, 0, k, cc3.at(0, k, 0)+cr2)
		ch3.set(0, 2, k, taui*(cc3.at(0, k, 2)-cc3.at(0, k, 1)))
		ch3.set(ido-1, 1, k, cc3.at(0, k, 0)+taur*cr2)
	}
	if ido < 2 {
		return
	}
	idp2 := ido + 1
	for k := 0; k < l1; k++ {
		for i := 2; i < ido; i += 2 {
			ic := idp2 - (i + 1)

			d2 := complex(wa1[i-2], -wa1[i-1]) * cc3.atCmplx(i-1, k, 1)
			d3 := complex(wa2[i-2], -wa2[i-1]) * cc3.atCmplx(i-1, k, 2)
			c2 := d2 + d3
			ch3.setCmplx(i-1, 0, k, cc3


 1)},
      {TimeInterval.withTypeAndLength(TimeIntervalType.DAY, 1)},
      {TimeInterval.withTypeAndLength(TimeIntervalType.WEEK, 1)},
      {TimeInterval.withTypeAndLength(TimeIntervalType.MONTH, 1)},
      {TimeInterval.withTypeAndLength(TimeIntervalType.MONTH, 12)},
      {TimeInterval.withTypeAndLength(TimeIntervalType.YEAR, 1)},
      {TimeInterval.withMillis(2592000000L)}
    };
  }

  @Test(groups = "fast", dataProvider = "timeintervals")
  public void testSerDe(TimeInterval timeInterval) throws Exception {
    String serialized = MAPPER.writeValueAsString(timeInterval);
    TimeInterval deserialized = MAPPER.readValue(serialized, TimeInterval.class);
    Assert.assertEquals(timeInterval, deserialized);
  }
}
/*
 * Copyright (C) 2012 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.util;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import com.fasterxml.jackson.datatype.joda.JodaModule;

public class StandardObjectMapper {
  public static final ObjectMapper MAPPER = new ObjectMapper();

  static {
    MAPPER.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
    MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    MAPPER.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
    MAPPER.disable(MapperFeature.AUTO_DETECT_GETTERS);
    MAPPER.disable(MapperFeature.AUTO_DETECT_IS_GETTERS);
    // to allow C/C++ style comments in JSON (non-standard, disabled by default)
    JsonFactory jsonFactory = MAPPER.getFactory();
    jsonFactory.enable(JsonParser.Feature.ALLOW_COMMENTS);
    // to allow (non-standard) unquoted field names in JSON:
    jsonFactory.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES);
    // to allow use of apostrophes (single quotes), non standard
    jsonFactory.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
    jsonFactory.enable(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS);
    jsonFactory.enable(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER);
    MAPPER.registerModule(new GuavaModule());
    MAPPER.registerModule(new JodaModule());
  }

  private StandardObjectMapper() {
    throw new AssertionError();
  }
}
/*
 * Copyright (C) 2012 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.util;

import com.google.common.io.PatternFilen


width:580px;
	margin:30px 0 30px 75px;
	padding:0 0 0 20px;
	font-family:Georgia, "Times New Roman", Times, serif;
	font-weight:bold;
	font-size:16px;

}
.help li {
	display:list-item;
	margin-bottom:10px;
	color: #007FB3;
}

.help li p {
	font-size:13px;
	color:#444;
	margin:0;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:normal;
	line-height:140%;
}

.help li h3 {
	font-size:14px;
	font-weight:bold;
	color:#444;
	margin:0;
	display:inline-block;
	padding:0;
	font-family:Arial, Helvetica, sans-serif;
}

.help li a:hover {
	text-decoration:underline;
}

.poilist_name {

}
.poilist_perex {

}

.geo_map_mapcanvas {
    font-size: 12px;
}

.geomap_body_holder {
    width: 100%;
    height: 100%;
}

.geo_map_mapcanvas_large {
    font-size: 12px;
    width: 100%;
    height: 100%;
}

.popup_title {
    font-size: 17px;
    margin: 12px 0 10px 0;
    background-color: #fffffa;
    color: #202000;
	padding:0;
	min-height:25px;
	max-width:200px;

}

.popup_title.edit_mode, .popup_text.edit_mode, .popup_content.edit_mode {
	max-width:260px;
}
.popup_video {

}
.popup_image {

}
.popup_text {
    font-size: 14px;
	max-width:200px;

}
.popup_content {
    font-size: 14px;
    margin-top: 10px;
	max-width:200px;

}

.geomap_open_large_map {
    float: right;
    margin-top: -22px;
}

.geo_poi_list_name_pos {
    color: #000040;
}

.olFramedCloudPopupContent input[type="text"] {
    border: 1px solid #9D9D9D;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) inset;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 16px;
    height: 23px;
    margin: 12px 0 10px;
    padding: 0;
    text-indent: 3px;
	font-size:17px;
	width:100%;
	color:#444;
}

.olFramedCloudPopupContent textarea {
    border: 1px solid #9D9D9D;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) inset;
    font-family: Arial,Helvetica,sans-serif;
    margin: 0;
    padding: 0 0 0 3px;
	font-size:14px;
	width:100%;
	color:#444;
}

.article_backlinks {
    max-width: 200px;
}
@mixin round_corners_custom($top, $right, $bottom, $left) {
	-moz-border-radius: $top $right $bottom $left !important;
	-webkit-border-radius: $top $right $bottom $left !important;
}

@mixin round_corners($radius) {
	@include round_corners_custom($radius, $radius, $radius, $radius);
}

.syntaxhighlighter {
	a,
	div,
	code,
	table,
	table td,
	table tr,
	table tbody,
	table thead,
	table caption,
	textarea {
		@include round_corners(0);

		background: none !important;
		border: 0 !important;
		bottom: auto !important;
		float: none !important;
		height: auto !important;
		left: auto !important;
		line-height: 1.1em !important;
		margin: 0 !important;
		outline: 0 !important;
		overflow: visible !import


79053, 7.0, 13.0, 10.333333015441895, 33.66666793823242, 31.66666603088379, 91.33333587646484, 80.33333587646484, 73.66666412353516, 77.66666412353516, 92.66666412353516, 92.66666412353516, 109.66666412353516, 126.66666412353516, 125.0, 120.0, 112.0, 109.33333587646484, 116.33333587646484, 109.33333587646484, 105.0, 90.0, 87.0, 84.0, 84.0, 87.66666412353516, 79.0, 70.0, 70.33333587646484, 65.33333587646484, 51.33333206176758, 51.33333206176758, 58.33333206176758, 59.0, 60.0, 57.66666793823242, 56.0, 56.0, 52.0, 46.66666793823242, 44.66666793823242, 42.66666793823242, 34.33333206176758, 33.33333206176758, 37.33333206176758, 35.0, 32.66666793823242, 33.0, 33.66666793823242, 33.66666793823242, 33.66666793823242, 31.33333396911621, 30.33333396911621, 23.66666603088379, 22.66666603088379, 23.33333396911621, 23.33333396911621, 22.66666603088379, 21.66666603088379, 18.33333396911621, 17.66666603088379, 16.66666603088379, 16.33333396911621, 16.0, 15.666666984558105, 15.666666984558105, 15.666666984558105, 16.66666603088379, 13.333333015441895, 16.33333396911621, 15.333333015441895, 16.33333396911621, 14.333333015441895, 12.333333015441895, 11.333333015441895, 11.333333015441895, 11.666666984558105, 11.666666984558105, 11.666666984558105, 11.666666984558105, 11.666666984558105, 11.666666984558105, 11.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 8.0, 8.0, 8.0, 8.0, 8.666666984558105, 8.666666984558105, 8.666666984558105, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 7.666666507720947, 10.0, 6.666666507720947, 7.0, 6.666666507720947, 6.666666507720947, 6.666666507720947, 6.666666507720947, 6.666666507720947, 7.0, 7.0, 6.333333492279053, 6.333333492279053, 7.333333492279053, 7.0, 7.0, 7.666666507720947, 8.0, 8.0, 8.0, 8.333333015441895, 8.0, 8.0, 7.666666507720947, 8.333333015441895, 8.0, 7.333333492279053, 7.0, 7.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 5.666666507720947, 0.0,};

		//for(int refIndex = 0; refIndex < refVals.length; refIndex++)
		//	assertEquals( refVals[ refIndex ],d[refIndex], 0.0 );
	}

	@Test
	public void testGetRow()
	{
		ColorProcessor testColorProcessor = new ColorProcessor(width, height, getRefImageArray() );
		int[] testArray = new int[ width ];
		testColorProcessor.getRow( 0, 0, testArray, width );
		int[] refArray = getRefIma


-toggle" open>

impl<'a> From<&'a mut [u8; 20]> for H160

fn from(bytes: &'a mut [u8; 20]) -> H160

Constructs a hash type from the given reference
to the mutable bytes array of fixed length.

Note

The given bytes are interpreted in big endian order.

impl From<[u8; 20]> for H160

fn from(bytes: [<a class="primitive" href="https://doc.rust-lang.org/ni


t depthEffect) then
		if (dynamicConnection) then
			dynamicConnection:Disconnect()
		end

		return warn("No depthEffect has been set!")
	end

	if (not keepEffectEnabled) then
		depthEffect.Enabled = false
	end

	if (dynamicConnection) then
		dynamicConnection:Disconnect()
	end
end

--//Resets the DepthOfField effect to default settings or to optional args
function DynamicDepth:Reset(optionalConfig)
	self:StopUpdating()

	if (optionalConfig) then
		if (typeof(optionalConfig) ~= "table") then return warn("Config table is not a valid table!") end

		setProperties(optionalConfig)
	else
		for property, value in pairs(PROPERTIRES) do
			depthEffect[property] = value
		end
	end
end

--//Mutators
function DynamicDepth:Enable()
	if (not depthEffect) then return warn("No depthEffect has been set!") end

	depthEffect.Enabled = true
end

function DynamicDepth:Disable()
	if (not depthEffect) then return warn("No depthEffect has been set!") end

	depthEffect.Enabled = false
end

--//Brute force set's the focus radius
function DynamicDepth:SetFocusRadius(depth)
	if (not depthEffect) then return warn("No depthEffect has been set!") end

	depthEffect.InFocusRadius = depth
end

--//Overwrites the depthEffect instance with a new one
function DynamicDepth:SetEffect(effect)
	if (depthEffect) then
		depthEffect:Destroy()
	end

	depthEffect = effect
end

--//Initiator.  Creates instance if CREATE_ON_INIT is false
function DynamicDepth:Init()
	if (CREATE_ON_INIT) then
		depthEffect = Instance.new("DepthOfFieldEffect")
		depthEffect.Parent = Camera

		depthEffect.Enabled = IS_ENABLED

		--Set properties to config properties
		for property, value in pairs(PROPERTIRES) do
			if depthEffect[property] then
				depthEffect[property] = value
			end
		end
	end
end

DynamicDepth:Init()


batches));
  }
  ASSERT_OK(log_->Close());
  LOG(INFO) << "Done writing";

  LOG_TIMING(INFO, "Read all entries from Log") {
    LOG(INFO) << "Starting to read log";
    uint32_t num_entries = 0;

    vector<scoped_refptr<ReadableLogSegment> > segments;

    shared_ptr<LogReader> reader;
    ASSERT_OK(LogReader::Open(fs_manager_.get(),
                              /*index*/nullptr,
                              kTestTablet,
                              metric_entity_tablet_,
                              file_cache_.get(),
                              &reader));
    reader->GetSegmentsSnapshot(&segments);

    for (const scoped_refptr<ReadableLogSegment>& entry : segments) {
      entries_.clear();
      ASSERT_OK(entry->ReadEntries(&entries_));
      num_entries += entries_.size();
    }
    ASSERT_EQ(num_entries, num_batches * 2);
    LOG(INFO) << "End readfile";
  }
}

// This tests that querying LogReader works.
// This sets up a reader with some segments to query which amount to the
// following:
// seg002: 0.10 through 0.19
// seg003: 0.20 through 0.29
// seg004: 0.30 through 0.39
TEST_P(LogTestOptionalCompression, TestLogReader) {
  LogReader reader(env_,
                   /*index*/nullptr,
                   kTestTablet,
                   metric_entity_tablet_,
                   file_cache_.get());
  reader.InitEmptyReaderForTests();
  ASSERT_OK(AppendNewEmptySegmentToReader(2, 10, &reader));
  ASSERT_OK(AppendNewEmptySegmentToReader(3, 20, &reader));
  ASSERT_OK(AppendNewEmptySegmentToReader(4, 30, &reader));

  OpId op;
  op.set_term(0);
  SegmentSequence segments;

  // Queries for specific segment sequence numbers.
  scoped_refptr<ReadableLogSegment> segment = reader.GetSegmentBySequenceNumber(2);
  ASSERT_EQ(2, segment->header().sequence_number());
  segment = reader.GetSegmentBySequenceNumber(3);
  ASSERT_EQ(3, segment->header().sequence_number());

  segment = reader.GetSegmentBySequenceNumber(4);
  ASSERT_EQ(4, segment->header().sequence_number());

  segment = reader.GetSegmentBySequenceNumber(5);
  ASSERT_TRUE(segment.get() == nullptr);
}

// Test that, even if the LogReader's index is empty because no segments
// have been properly closed, we can still read the entries as the reader
// returns the current segment.
TEST_P(LogTestOptionalCompression, TestLogReaderReturnsLatestSegmentIfIndexEmpty) {
  ASSERT_OK(BuildLog());

  OpId opid = MakeOpId(1, 1);
  ASSERT_OK(AppendCommit(opid, APPEND_ASYNC));
  ASSERT_OK(AppendReplicateBatch(opid, APPEND_SYNC));

  SegmentSequence segments;
  log_->reader()->GetSegmentsSnapshot(&segments);
  ASSERT_EQ(segments.size(), 1);

  LogEntries entries;
  ASSERT_OK(segments[0]->ReadEntries(&entries));
  ASSERT_EQ(2, entries.size());
}

TEST_F(LogTest, TestOpIdUtils) {
  OpId id = MakeOpId(1, 2);
  ASSERT_EQ("1.2", consensus::OpIdToString(id));
  ASSERT_EQ(1, id.term());
  ASSERT_EQ(2, id.index());
}

std::ostream& operator<<(std::ostream& os, const TestLogSequenceElem& elem) {
  switch (elem.type) {
    case TestLogSequenceElem::ROLL:
      os << "ROLL";
      break;
    case TestLogSequenceElem::REPLICATE:
      os << "R" << elem.id;
      br


parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?id, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");

        assertThat(query3.hashCode()).isEqualTo(query4.hashCode());
        assertThat(query1.hashCode()).isNotEqualTo(query3.hashCode());

        Query query5 = Query.parse("INSERT INTO `user` (`id`, `name`) VALUES (1, 'hello')");
        Query query6 = Query.parse("INSERT INTO `user` (`id`, `name`) VALUES (1, 'hello')");

        assertThat(query5.hashCode()).isEqualTo(query6.hashCode());
        assertThat(query1.hashCode()).isNotEqualTo(query5.hashCode());
        assertThat(query3.hashCode()).isNotEqualTo(query5.hashCode());

        Query query7 = Query.parse("SELECT * FROM `user ? hello` WHERE `id` = '?' AND `name` /* ??? */ " +
            "LIKE '?name' AND `good` = \"dsa?\" -- ??");
        Query query8 = Query.parse("SELECT * FROM `user ? hello` WHERE `id` = '?' AND `name` /* ??? */ " +
            "LIKE '?name' AND `good` = \"dsa?\" -- ??");

        assertThat(query7.hashCode()).isEqualTo(query8.hashCode());
        assertThat(query1.hashCode()).isNotEqualTo(query7.hashCode());
        assertThat(query3.hashCode()).isNotEqualTo(query7.hashCode());
        assertThat(query5.hashCode()).isNotEqualTo(query7.hashCode());

        Query query9 = Query.parse("SELECT * FROM `user ? hello` WHERE `id` = '?' AND " +
            "`name` LIKE '?name' AND `good` = \"dsa?\" -- ??");

        assertThat(query7.hashCode()).isNotEqualTo(query9.hashCode());
    }

    @Test
    void selfEquals() {
        Query query1 = Query.parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");
        Query query2 = Query.parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");

        assertThat(query1).isEqualTo(query2);

        query1 = Query.parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?id, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");
        query2 = Query.parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?id, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");

        assertThat(query1).isEqualTo(query2);

        query1 = Query.parse("UPDATE `user` SET `name` = ?name, `good` = ?");
        assertThat(query1).isNotEqualTo(query2);

        query1 = Query.parse("UPDATE `user` SET `name` = ?, `good` = ?, `age` = ?, `data` = ?," +
            "`content` = ?");
        assertThat(query1).isNotEqualTo(query2);

        query1 = Query.parse("INSERT INTO `user` (`id`, `name`, `age`) VALUE (?, ?name, ?age) " +
            "ON DUPLICATE KEY UPDATE `name` = ?name, `age` = ?age");
        assertThat(query1).isNotEqualTo(query2);

        query1 = Query.parse("INSERT INTO `user` (`id`, `name`) VALUES (1, 'hello')");
        query2 = Query.parse("INSERT INTO `user` (`id`, `name`) VALUES (1, 'hello')");

        assertThat(query1).isEqualTo(query2);

        query1 = Query.parse("SEL


    output = [[['a1', 'b1'], ['c1', 'd1']]]

    indices = [[0, 1], [1, 0]]
    params = [[['a0', 'b0'], ['c0', 'd0']],
              [['a1', 'b1'], ['c1', 'd1']]]
    output = [['c0', 'd0'], ['a1', 'b1']]

    indices = [[0, 0, 1], [1, 0, 1]]
    params = [[['a0', 'b0'], ['c0', 'd0']],
              [['a1', 'b1'], ['c1', 'd1']]]
    output = ['b0', 'b1']
```

Batched indexing into a matrix:

```python
    indices = [[[0, 0]], [[0, 1]]]
    params = [['a', 'b'], ['c', 'd']]
    output = [['a'], ['b']]
```

Batched slice indexing into a matrix:

```python
    indices = [[[1]], [[0]]]
    params = [['a', 'b'], ['c', 'd']]
    output = [[['c', 'd']], [['a', 'b']]]
```

Batched indexing into a 3-tensor:

```python
    indices = [[[1]], [[0]]]
    params = [[['a0', 'b0'], ['c0', 'd0']],
              [['a1', 'b1'], ['c1', 'd1']]]
    output = [[[['a1', 'b1'], ['c1', 'd1']]],
              [[['a0', 'b0'], ['c0', 'd0']]]]

    indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]]
    params = [[['a0', 'b0'], ['c0', 'd0']],
              [['a1', 'b1'], ['c1', 'd1']]]
    output = [[['c0', 'd0'], ['a1', 'b1']],
              [['a0', 'b0'], ['c1', 'd1']]]

    indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]]
    params = [[['a0', 'b0'], ['c0', 'd0']],
              [['a1', 'b1'], ['c1', 'd1']]]
    output = [['b0', 'b1'], ['d0', 'c1']]
```

params: The tensor from which to gather values.
indices: Index tensor.
output: Values from `params` gathered from indices given by `indices`, with
  shape `indices.shape[:-1] + params.shape[indices.shape[-1]:]`.
)doc");

// --------------------------------------------------------------------------
REGISTER_OP("Identity")
    .Input("input: T")
    .Output("output: T")
    .Attr("T: type")
    .SetShapeFn([](shape_inference::InferenceContext* c) {
      c->set_output(0, c->input(0));
      auto* handle_data = c->input_handle_shapes_and_types(0);
      if (handle_data != nullptr) {
        c->set_output_handle_shapes_and_types(0, *handle_data);
      }
      return Status::OK();
    })
    .Doc(R"Doc(
Return a tensor with the same shape and contents as the input tensor or value.
)Doc");

#ifdef INTEL_MKL
REGISTER_OP("_MklIdentity")
    .Input("input: T")
    .Input("mkl_input: uint8")
    .Output("output: T")
    .Output("mkl_output: uint8")
    .Attr("T: type")
    .SetShapeFn([](shape_inference::InferenceContext* c) {
      c->set_output(0, c->input(0));
      auto* handle_data = c->input_handle_shapes_and_types(0);
      if (handle_data != nullptr) {
        c->set_output_handle_shapes_and_types(0, *handle_data);
      }
      return Status::OK();
    })
    .Doc(R"Doc( Mkl implementation of IdentityOp
)Doc");
#endif

REGISTER_OP("IdentityN")
    .Input("input: T")
    .Output("output: T")
    .Attr("T: list(type)")
    .SetShapeFn([](shape_inference::InferenceContext* c) {
      std::vector<ShapeHandle> input;
      TF_RETURN_IF_ERROR(c->input("input", &input));
      TF_RETURN_IF_ERROR(c->set_output("output", input));
      return Status::OK();
    })


 دسترس است. سفارش محدود، معاملات دائمی (perpetuals)، معاملات حاشیه‌ای (margin trading) و موارد دیگر امکان‌پذیر است. با مبادله‌ی غیرمتمرکز به نقدینگی جهانی متصل خواهید شد، بازار هرگز بسته نخواهد شد و همواره کنترل دارایی‌تان را در دست خواهید داشت.

وقتی از صرافی‌های متمرکز استفاده می‌کنید مجبور هستید که دارایی‌تان را پیش از معامله به آن‌ها منتقل کنید و برای نگه‌داری دارایی‌تان به آن‌ها اعتماد کنید. دارایی‌های شما وقتی به صرافی‌های متمرکز منتقل شده‌اند در خطر هستند، چون صرافی‌های متمرکز اهداف جذابی برای هکرها هستند.

<ButtonLink href="/apps/categories/defi">
  مشاهده‌ی برنامه‌های غیرمتمرکز معامله
</ButtonLink>

<Divider />

### سبد خود را بزرگ کنید {#investing}

محصولات مدیریت سرمایه‌ای روی اتریوم وجود دارد که سعی می‌کنند سبد سرمایه‌ای شما را بر اساس راهبرد انتخابی‌تان بزرگ کنند. این کار به‌صورت خودکار انجام می‌شود، برای همه آزاد است و نیازی به مدیریت انسانی ندارد که بخشی از سود را از آن خود کند.

یک مثال خوب برای این موضوع [صندوق مبتنی بر شاخص DeFi Pulse (DPI)](https://defipulse.com/blog/defi-pulse-index/) است. این صندوق به‌طور خودکار در موجودی خود تغییر ایجاد می‌کند تا مطمئن شود که سبد دارایی‌های شما همواره شامل بهترین توکن‌های DeFi از نظر ارزش بازار است. شما هیچ گاه نیاز به مدیریت هیچ یک از جزییات ندارید و هر زمان بخواهید می‌توانید سرمایه‌ی خود را خارج کنید.

<ButtonLink href="/apps/categories/defi">
  مشاهده‌ی برنامه‌های غیرمتمرکز سرمایه‌گذاری
</ButtonLink>

<Divider />

### جذب سرمایه


Indent()

        val e = shouldThrow<LoadFailedException> { load(thrift) }
        e.message shouldContain "'Membership.WRONG' is not a member of enum type Membership: members=[MEMBER, NON_MEMBER, UNDER_REVIEW]"
    }

    @Test
    fun `struct const with reference to another const`() {
        val thrift = """
            |struct Example {
            |  1: required string text
            |}
            |
            |struct Container {
            |  1: required Example example
            |}
            |
            |const Example THE_EXAMPLE = {"text": "this is some text"}
            |
            |const Container THE_CONTAINER = {"example": THE_EXAMPLE}
        """.trimMargin()

        val schema = load(thrift)
        val consts = schema.constants
        val theContainer = consts.find { it.name == "THE_CONTAINER" } ?: error("Expected a constant named THE_CONTAINER")

        val elements = (theContainer.value as MapValueElement).value
        val singleValue = elements.values.single()
        singleValue should beInstanceOf<IdentifierValueElement>()

        (singleValue as IdentifierValueElement).value shouldBe "THE_EXAMPLE"
    }

    @Test
    fun `struct references are deduplicated`() {
        val thrift = """
            |const string STR = "foo"
            |
            |const list<string> STRS = [STR, STR]
        """.trimMargin()

        val schema = load(thrift)
        val (str, strs) = schema.constants

        strs.referencedConstants shouldBe listOf(str)
    }

    @Test
    fun `struct constants can omit fields with default values`() {
        val baseThrift = """
            |namespace java foo;
            |
            |struct Foo {
            |  1: required string TEXT;
            |  2: required string TEXT_WITH_DEFAULT = "foo";
            |  3: optional string OPTIONAL_TEXT;
            |}
        """.trimMargin()

        val goodThrift = """
            |namespace java bar;
            |
            |include "foo.thrift"
            |
            |const foo.Foo THE_FOO = {"TEXT": "some text"}
        """.trimMargin()

        val badThrift = """
            |namespace java baz;
            |
            |include "foo.thrift"
            |
            |const foo.Foo NOT_THE_FOO = {"OPTIONAL_TEXT": "t"}
        """.trimMargin()

        val baseFile = File(tempDir, "foo.thrift")
        val goodFile = File(tempDir, "good.thrift")
        val badFile = File(tempDir, "bad.thrift")

        baseFile.writeText(baseThrift)
        goodFile.writeText(goodThrift)
        badFile.writeText(badThrift)

        val err = shouldThrow<LoadFailedException> { load(baseFile, badFile) }
        err.message shouldContain "Some required fields are unset"

        shouldNotThrowAny { load(baseFile, goodFile) }
    }

    private fun load(thrift: String): Schema {
        val f = File.createTempFile("test", ".thrift", tempDir)
        f.writeText(thrift)

        val loader = Loader()
        loader.addThriftFile(f.toPath())
        return loader.load()
    }

    private fun load(vararg files: File): Schema {
        val loader = Loader()
        for (f in files) {
            loader.addThriftFile(f.toPath())
        }
        return loader.load()
    }

    private fun assertHasError(exception: LoadFailedException, expectedMessage: String) {
        if (exception.errorReporter.reports.none { it.message.contains(expectedMessage) }) {
            throw AssertionError("Expected a reported error containing '$expectedMessage'")
        }
    }

    private val File.nameWithoutExtension: String
        get() {


llvm::Use *> repls;
  for (auto &use : old_c->uses()) {
    repls.emplace_back(&use);
  }

  ValueMap value_map;
  value_map.emplace(old_c, new_c);
  value_map.emplace(new_c, new_c);

  TypeMap type_map;

  auto num_const_uses = 0u;

  while (!repls.empty()) {
    const auto use = repls.back();
    llvm::User *const user = use->getUser();
    repls.pop_back();

    const auto used_c = llvm::dyn_cast<llvm::Constant>(use);
    CHECK_NOTNULL(used_c);

    // Ascend.
    if (auto user_c = llvm::dyn_cast<llvm::Constant>(user)) {
      ++num_const_uses;
      for (auto &user_c_use : user_c->uses()) {
        repls.emplace_back(&user_c_use);
      }

    } else if (auto user_inst = llvm::dyn_cast<llvm::Instruction>(user)) {
      use->set(MoveConstantIntoModule(used_c, module, value_map, type_map));

    } else {
      LOG(ERROR) << "Unrecognized user type";
    }
  }

  return num_const_uses;
}

// Move a function from one module into another module.
//
// TODO(pag): Make this work across distinct `llvm::LLVMContext`s.
void MoveFunctionIntoModule(llvm::Function *func, llvm::Module *dest_module) {
  const auto source_context = &(func->getContext());
  const auto dest_context = &(dest_module->getContext());
  CHECK_EQ(source_context, dest_context)
      << "Cannot move function across two independent LLVM contexts.";

  auto source_module = func->getParent();
  CHECK_NE(source_module, dest_module)
      << "Cannot move function to the same module.";

  const auto func_name = func->getName().str();
  auto existing_decl_in_dest_module = dest_module->getFunction(func_name);
  if (existing_decl_in_dest_module) {
    CHECK_NE(existing_decl_in_dest_module, func);
    CHECK_EQ(existing_decl_in_dest_module->getFunctionType(),
             func->getFunctionType());

    existing_decl_in_dest_module->setName(llvm::Twine::createNull());
    existing_decl_in_dest_module->setLinkage(llvm::GlobalValue::PrivateLinkage);
    existing_decl_in_dest_module->setVisibility(
        llvm::GlobalValue::DefaultVisibility);
  }

  const auto in_same_context = source_context == dest_context;

  // We need to possibly preserve `func` as a declaration in its source module.
  func->setName(llvm::Twine::createNull());
  auto replacement_decl_in_source_module = llvm::Function::Create(
      func->getFunctionType(), func->getLinkage(), func_name, source_module);

  replacement_decl_in_source_module->copyAttributesFrom(func);
  replacement_decl_in_source_module->setVisibility(func->getVisibility());
  replacement_decl_in_source_module->setCallingConv(func->getCallingConv());
  if (func->hasSection()) {
    replacement_decl_in_source_module->setSection(func->getSection());
  }

  ValueMap value_map;
  TypeMap type_map;

  // When mapping in the destination module, we'll reference `func` any time
  // we see the `replacement_decl_in_source_module` or `func`.
  (void) ReplaceAllUsesOfConstant(func, replacement_decl_in_source_module,
                                  source_module);
  value_map.emplace(replacement_decl_in_source_module, func);
  value_map.emplace(func, func);

  // Move `func` into the destination module.
  if (in_same_context) {


.Active) {
				try {
					if (attack.AttackerID != 0) {
						Random random = new();
						string[] messages = _tbotInstance.InstanceSettings.Defender.MessageAttacker.Messages;
						string message = messages.ToList().Shuffle().First();
						DoLog(LogLevel.Information, $"Sending message \"{message}\" to attacker {attack.AttackerName}");
						try {
							await _ogameService.SendMessage(attack.AttackerID, message);
							DoLog(LogLevel.Information, "Message succesfully sent.");
						} catch {
							DoLog(LogLevel.Warning, "Unable send message.");
						}
					} else {
						DoLog(LogLevel.Warning, "Unable send message.");
					}

				} catch (Exception e) {
					Do


 governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: unnecessary_cast, overridden_fields

import 'dart:ffi';
import 'dart:typed_data';

import 'package:ffi/ffi.dart';
import 'package:meta/meta.dart' show internal;

import 'jni.dart';
import 'jobject.dart';
import 'jreference.dart';
import 'third_party/generated_bindings.dart';
import 'types.dart';

@internal
final class $JArray$NullableType$<E extends JObject?>
    extends JType<JArray<E>?> {
  final JType<E> elementType;

  const $JArray$NullableType$(this.elementType);

  @override
  String get signature => '[${elementType.signature}';

  @override
  JArray<E>? fromReference(JReference reference) =>
      reference.isNull ? null : JArray<E>.fromReference(elementType, reference);

  @override
  JType get superType => const $JObject$NullableType$();

  @override
  JType<JArray<E>?> get nullableType => this;

  @override
  final int superCount = 1;

  @override
  int get hashCode => Object.hash($JArray$NullableType$, elementType);

  @override
  bool operator ==(Object other) {
    return other.runtimeType == ($JArray$NullableType$<E>) &&
        other is $JArray$NullableType$<E> &&
        elementType == other.elementType;
  }
}

@internal
final class $JArray$Type$<E extends JObject?> extends JType<JArray<E>> {
  final JType<E> elementType;

  const $JArray$Type$(this.elementType);

  @override
  String get signature => '[${elementType.signature}';

  @override
  JArray<E> fromReference(JReference reference) =>
      JArray<E>.fromReference(elementType, reference);

  @override
  JType get superType => const $JObject$Type$();

  @override
  JType<JArray<E>?> get nullableType => $JArray$NullableType$<E>(elementType);

  @override
  final int superCount = 1;

  @override
  int get hashCode => Object.hash($JArray$Type$, elementType);

  @override
  bool operator ==(Object other) {
    return other.runtimeType == ($JArray$Type$<E>) &&
        other is $JArray$Type$<E> &&
        elementType == other.elementType;
  }
}

class JArray<E extends JObject?> extends JObject with Iterable<E> {
  final JType<E> elementType;

  @internal
  @override
  final JType<JArray<E>> $type;

  /// The type which includes information such as the signature of this class.
  static JType<JArray<E>> type<E extends JObject?>(JType<E> innerType) =>
      $JArray$Type$<E>(innerType);

  /// The type which includes information such as the signature of this class.
  static JType<JArray<E>?> nullableType<E extends JObject?>(
          JType<E> innerType) =>
      $JArray$NullableType$<E>(innerType);

  /// Construct a new [JArray] with [reference] as its underlying reference.
  JArray.fromReference(this.elementType, JReference reference)
      : $type = type<E>(elementType),
        super.fromReference(reference);

  /// Creates a [JArray] of the given length from the given [elementType].
  ///
  /// The [length] must be a non-negative integer.
  /// For objects, [elementType] must be a nullable type as this constructor
  /// initializes all elements with `null`.
  factory JArray(JType<E> elementType, int length) {
    RangeError.checkNotNegative(length);
    if (!elementType.isNullable


WORD PTR [_vmldSinhHATab+1184]
        comisd    xmm1, xmm0
        jbe       _B10_9

_B10_6::

        comisd    xmm0, QWORD PTR [_vmldSinhHATab+1176]
        jb        _B10_8

_B10_7::

        movsd     xmm8, QWORD PTR [_vmldSinhHATab+1112]
        and       r14b, -128
        mulsd     xmm8, xmm0
        movsd     xmm5, QWORD PTR [_vmldSinhHATab+1144]
        mov       rcx, QWORD PTR [_vmldSinhHATab+8]
        mov       r9, rcx
        shr       r9, 48
        addsd     xmm8, QWORD PTR [_vmldSinhHATab+1120]
        movsd     QWORD PTR [48+rsp], xmm8
        and       r9d, -32753
        movsd     xmm10, QWORD PTR [48+rsp]
        mov       r11d, DWORD PTR [48+rsp]
        mov       r8d, r11d
        shr       r8d, 6
        and       r11d, 63
        mov       QWORD PTR [72+rsp], rcx
        subsd     xmm10, QWORD PTR [_vmldSinhHATab+1120]
        mulsd     xmm5, xmm10
        lea       r10d, DWORD PTR [1023+r8]
        xorps     xmm10, XMMWORD PTR [_2il0floatpacket_105]
        add       r8d, 1022
        mulsd     xmm10, QWORD PTR [_vmldSinhHATab+1152]
        subsd     xmm0, xmm5
        movaps    xmm2, xmm0
        movaps    xmm4, xmm0
        movsd     xmm5, QWORD PTR [_vmldSinhHATab+1128]
        and       r8d, 2047
        shl       r8d, 4
        lea       ecx, DWORD PTR [r11+r11]
        or        r9d, r8d
        lea       r8, QWORD PTR [__ImageBase]
        neg       r10d
        lea       r11d, DWORD PTR [1+r11+r11]
        add       r10d, -4
        addsd     xmm2, xmm10
        movsd     QWORD PTR [64+rsp], xmm2
        and       r10d, 2047
        movsd     xmm9, QWORD PTR [64+rsp]
        mov       WORD PTR [78+rsp], r9w
        and       r9d, -32753
        shl       r10d, 4
        subsd     xmm4, xmm9
        movsd     QWORD PTR [32+rsp], xmm4
        or        r9d, r10d
        movsd     xmm3, QWORD PTR [64+rsp]
        movsd     xmm1, QWORD PTR [32+rsp]
        addsd     xmm3, xmm1
        movsd     QWORD PTR [40+rsp], xmm3
        movsd     xmm14, QWORD PTR [32+rsp]
        addsd     xmm10, xmm14
        movsd     xmm14, QWORD PTR [72+rsp]
        movsd     QWORD PTR [32+rsp], xmm10
        movsd     xmm15, QWORD PTR [40+rsp]
        mov       WORD PTR [78+rsp], r9w
        subsd     xmm0, xmm15
        movsd     QWORD PTR [40+rsp], xmm0
        mov


":"L","MEd":"E, M\/d","MMM":"LLL","MMMEd":"E, MMM d","MMMMW-count-one":"'week' W 'of' MMMM","MMMMW-count-other":"'week' W 'of' MMMM","MMMMd":"MMMM d","MMMd":"MMM d","Md":"M\/d","d":"d","h":"h\u202fa","h-alt-ascii":"h a","hm":"h:mm\u202fa","hm-alt-ascii":"h:mm a","hms":"h:mm:ss\u202fa","hms-alt-ascii":"h:mm:ss a","hmsv":"h:mm:ss\u202fa v","hmsv-alt-ascii":"h:mm:ss a v","hmv":"h:mm\u202fa v","hmv-alt-ascii":"h:mm a v","ms":"mm:ss","y":"y","yM":"M\/y","yMEd":"E, M\/d\/y","yMMM":"MMM y","yMMMEd":"E, MMM d, y","yMMMM":"MMMM y","yMMMd":"MMM d, y","yMd":"M\/d\/y","yQQQ":"QQQ y","yQQQQ":"QQQQ y","yw-count-one":"'week' w 'of' Y","yw-count-other":"'week' w 'of' Y"}},"CLDRRegionalConfigeratorFormats":{"dateFormats":{"full":"EEEE, MMMM d, y","long":"MMMM d, y","medium":"MMM d, y","short":"M\/d\/yy"},"timeFormats":{"full":"h:mm:ss\u202fa zzzz","long":"h:mm:ss\u202fa z","medium":"h:mm:ss\u202fa","short":"h:mm\u202fa"},"dateTimeFormats":{"full":"{1}, {0}","long":"{1}, {0}","medium":"{1}, {0}","short":"{1}, {0}"},"availableFormats":{"Bh":"h B","Bhm":"h:mm B","Bhms":"h:mm:ss B","E":"ccc","EBhm":"E h:mm B","EBhms":"E h:mm:ss B","EHm":"E HH:mm","EHms":"E HH:mm:ss","Ed":"d E","Ehm":"E h:mm\u202fa","Ehm-alt-ascii":"E h:mm a","Ehms":"E h:mm:ss\u202fa","Ehms-alt-ascii":"E h:mm:ss a","Gy":"y G","GyMMM":"MMM y G","GyMMMEd":"E, MMM d, y G","GyMMMd":"MMM d, y G","GyMd":"M\/d\/y G","H":"HH","Hm":"HH:mm","Hms":"HH:mm:ss","Hmsv":"HH:mm:ss v","Hmv":"HH:mm v","M":"L","MEd":"E, M\/d","MMM":"LLL","MMMEd":"E, MMM d","MMMMW-count-one":"'week' W 'of' MMMM","MMMMW-count-other":"'week' W 'of' MMMM","MMMMd":"MMMM d","MMMd":"MMM d","Md":"M\/d","d":"d","h":"h\u202fa","h-alt-ascii":"h a","hm":"h:mm\u202fa","hm-alt-ascii":"h:mm a","hms":"h:mm:ss\u202fa","hms-alt-ascii":"h:mm:ss a","hmsv":"h:mm:ss\u202fa v","hmsv-alt-ascii":"h:mm:ss a v","hmv":"h:mm\u202fa v","hmv-alt-ascii":"h:mm a v","ms":"mm:ss","y":"y","yM":"M\/y","yMEd":"E, M\/d\/y","yMMM":"MMM y","yMMMEd":"E, MMM d, y","yMMMM":"MMMM y","yMMMd":"MMM d, y","yMd":"M\/d\/y","yQQQ":"QQQ y","yQQQQ":"QQQQ y","yw-count-one":"'week' w 'of' Y","yw-count-other":"'week' w 'of' Y"}},"CLDRToPHPSymbolConversion":{"G":"","yyyy":"Y","yy":"y","y":"Y","LLLLL":"M","LLLL":"f","LLL":"M","LL":"m","L":"n","MMMMM":"M","MMMM":"F","MMM":"M","MM":"m","M":"n","dd":"d","d":"j"


.removeConnection(toBeAdded), isTrue);
    expect(toBeAdded.incomingVertices.isEmpty, isTrue);
  });

  test('Unsuccessfully remove a vertex', () {
    expect(connectedVertex.removeConnection(a), isFalse);
  });

  test('Check for vertex containment', () {
    var newVertex = Vertex('DISCONNECTED');
    expect(connectedVertex.containsConnectionTo(toBeAdded), isTrue);
    expect(connectedVertex.containsConnectionTo(newVertex), isFalse);
  });

  test('Get a list of vertices', () {
    root.addConnection(a);
    root.addConnection(b);
    root.addConnection(c);
    expect(root.outgoingVertices, equals(<Vertex>{a, b, c}));
    expect(a.incomingVertices, equals(<Vertex>{root}));
    expect(b.incomingVertices, equals(<Vertex>{root}));
    expect(c.incomingVertices, equals(<Vertex>{root}));
  });

  test('Check for isolated vertex', () {
    expect(root.isIsolated, isTrue);
    expect(connectedVertex.isIsolated, isFalse);
  });

  test('Get out degree for vertex', () {
    expect(root.outDegree, equals(0));
    connectedVertex.addConnection(c);
    expect(connectedVertex.outDegree, equals(3));
  });

  test('Get in degree for vertex', () {
    expect(root.inDegree, equals(0));
    connectedVertex.addConnection(root);
    expect(root.inDegree, equals(1));
  });

  test('String representation of a vertex', () {
    expect(connectedVertex.toString(), equals('0'));
    expect(root.toString(), equals('A'));
  });
}
import '../heaps/base.dart';

/// The DoublyLinkedList Node.
///
/// It has both previous and next references.
class Node<T> {
  /// The data [this] contains
  T data;

  /// Reference to previous [Node]
  Node<T>? previous;

  /// Reference to next [Node]
  Node<T>? next;

  /// Initialize [Node] with data.
  Node(this.data);
}

/// DoubleLinkedList ADT
class DoublyLinkedList<T> {
  /// First node of the list
  Node<T>? head;

  /// Last node of the list
  Node<T>? tail;

  /// Size of the list
  int length;

  /// Constructor
  DoublyLinkedList() : length = 0;

  /// Creates DoublyLinkedList from [list]
  DoublyLinkedList.fromList(List<T> list) : length = 0 {
    for (var item in list) {
      append(item);
    }
  }

  /// Checks if [this] is empty
  bool get isEmpty => length == 0;

  /// Converts [this] into a [List]
  List<T> get toList {
    var asList = <T>[];

    var current = head;
    while (current != null) {
      asList.add(current.data);
      current = current.next;
    }

    return asList;
  }

  /// Show the [n]th element of the list.
  ///
  /// The list remains unmodified. `null` when index is out of bounds
  Node<T> at(int n) {
    if (n >= length || n < 0) throw InvalidIndexError();

    var current = head;
    for (var index = 0; index != n; index++) {
      current = current!.next;
    }

    return current!;
  }

  /// Add something to the beginning of [this]
  void prepend(T data) {
    var newNode = Node(data);

    if (isEmpty) {
      _setOnlyNode(newNode);
    } else {
      newNode.next = head;
      head!.previous = newNode;
      head =


ready))
			ret |= DVB_CA_EN50221_POLL_CAM_READY;
	}

	return ret;
}

static int anysee_ci_init(struct dvb_usb_device *d)
{
	struct anysee_state *state = d_to_priv(d);
	int ret;

	state->ci.owner               = THIS_MODULE;
	state->ci.read_attribute_mem  = anysee_ci_read_attribute_mem;
	state->ci.write_attribute_mem = anysee_ci_write_attribute_mem;
	state->ci.read_cam_control    = anysee_ci_read_cam_control;
	state->ci.write_cam_control   = anysee_ci_write_cam_control;
	state->ci.slot_reset          = anysee_ci_slot_reset;
	state->ci.slot_shutdown       = anysee_ci_slot_shutdown;
	state->ci.slot_ts_enable      = anysee_ci_slot_ts_enable;
	state->ci.poll_slot_status    = anysee_ci_poll_slot_status;
	state->ci.data                = d;

	ret = anysee_wr_reg_mask(d, REG_IOA, (1 << 7), 0x80);
	if (ret)
		return ret;

	ret = anysee_wr_reg_mask(d, REG_IOD, (0 << 2)|(0 << 1)|(0 << 0), 0x07);
	if (ret)
		return ret;

	ret = anysee_wr_reg_mask(d, REG_IOD, (1 << 2)|(1 << 1)|(1 << 0), 0x07);
	if (ret)
		return ret;

	ret = dvb_ca_en50221_init(&d->adapter[0].dvb_adap, &state->ci, 0, 1);
	if (ret)
		return ret;

	state->ci_attached = true;

	return 0;
}

static void anysee_ci_release(struct dvb_usb_device *d)
{
	struct anysee_state *state = d_to_priv(d);

	/* detach CI */
	if (state->ci_attached)
		dvb_ca_en50221_release(&state->ci);

	return;
}

static int anysee_init(struct dvb_usb_device *d)
{
	struct anysee_state *state = d_to_priv(d);
	int ret;

	/* There is one interface with two alternate settings.
	   Alternate setting 0 is for bulk transfer.
	   Alternate setting 1 is for isochronous transfer.
	   We use bulk transfer (alternate setting 0). */
	ret = usb_set_interface(d->udev, 0, 0);
	if (ret)
		return ret;

	/* LED light */
	ret = anysee_led_ctrl(d, 0x01, 0x03);
	if (ret)
		return ret;

	/* enable IR */
	ret = anysee_ir_ctrl(d, 1);
	if (ret)
		return ret;

	/* attach CI */
	if (state->has_ci) {
		ret = anysee_ci_init(d);
		if (ret)
			return ret;
	}

	return 0;
}

static void anysee_exit(struct dvb_usb_device *d)
{
	struct anysee_state *state = d_to_priv(d);

	if (state->i2c_client[0])
		anysee_del_i2c_dev(d);

	return anysee_ci_release(d);
}

/* DVB USB Driver stuff */
static struct dvb_usb_device_properties anysee_props = {
	.driver_name = KBUILD_MODNAME,
	.owner = THIS_MODULE,
	.adapter_nr = adapter_nr,
	.size_of_priv = sizeof(struct anysee_state),

	.generic_bulk_ctrl_endpoint = 0x01,
	.generic_bulk_ctrl_endpoint_response = 0x81,

	.i2c_algo         = &anysee_i2c_algo,
	.read_config      = anysee_read_config,
	.frontend_attach  = anysee_frontend_attach,
	.tuner_attach     = anysee_tuner_attach,
	.init             = anysee_init,
	.get_rc_config    = anysee_get_rc_config,
	.frontend_ctrl    = anysee_frontend_ctrl,
	.streaming_ctrl   = anysee_streaming_ctrl,
	.exit             = anysee_exit,

	.num_adapters = 1,
	.adapter = {
		{
			.stream = DVB_USB_STREAM_BULK(0x82, 8, 16 * 512),
		}
	}
};

static const struct usb_device_id anysee_id_table[] = {
	{ DVB_USB_DEVICE(USB_VID_CYPRESS, USB_PID_ANYSEE,
		&anysee_props, "Anysee", RC_MAP_ANYSEE) },
	{ DVB_USB_DEVICE(USB_VID_AMT, USB_PID_ANYSEE,
		&anysee_props, "Anysee", RC_MAP_ANYSEE) },
	{ }
};
MODULE_DEVICE_TABLE(usb, anysee_id_table);

static struct usb_driver anysee_usb_driver = {
	.name = KBUILD_MODNAME,
	.id_table = anysee_id_table,
	.probe = dvb_usbv2_probe,
	.disconnect = dvb_usbv2_disconnect,
	.suspend = dvb_usbv2_suspend,
	.resume = dvb_usbv2_resume,
	.reset_resume = dvb_usbv2_reset_resume,
	.no_dynamic_id = 1,
	.soft_unbind = 1,
};

module_usb_driver(anysee_usb_driver);

MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0");
MODULE_LICENSE("GPL");