);

        should_interrupt
    }

    pub fn tac_write_m_cycle(&mut self, value: u8) -> bool {
        let previous = self.clone();
        let should_interrupt = self.tick_m_cycle();

        // Only the lower 3 bits are (R/W).
        self.tac = TAC(value | 0b1111_1000);

        self.try_increment_tima(&previous);

        should_interrupt
    }

    pub fn tima_write_m_cycle(&mut self, value: u8) -> bool {
        let previous_overflow = self.overflow;
        let should_interrupt = self.tick_m_cycle();

        if !previous_overflow {
            // If you write to TIMA during the cycle that TMA is loaded
            // to it, the write will be ignored
            self.tima = value;
        };

        if self.overflow && !previous_overflow {
            // You can prevent IF being set and prevent the TIMA from
            // being reloaded from TMA by writing a value to TIMA.
            self.overflow = false;
        }

        should_interrupt
    }

    pub fn tma_write_m_cycle(&mut self, value: u8) -> bool {
        let previous_overflow = self.overflow;
        let should_interrupt = self.tick_m_cycle();

        if previous_overflow {
            // If TMA is written the same cycle it is loaded to TIMA,
            // TIMA is also loaded with that value.
            self.tima = value;
        };

        self.tma = value;

        should_interrupt
    }

    fn should_increment_tima(&self) -> bool {
        self.tac.enabled() && (self.counter.0 & self.tac.frequency().into_mask()) > 0
    }

    fn try_increment_tima(&mut self, previous: &Timer) {
        let old_bit = previous.should_increment_tima();
        let new_bit = self.should_increment_tima();

        if old_bit && !new_bit {
            // Increment TIMA on the falling edge
            let (tima, overflow) = self.tima.overflowing_add(1);

            self.tima = tima;
            self.overflow = overflow;
        }
    }

    pub fn tick_m_cycle(&mut self) -> bool {
        let previous = self.clone();
        let should_interrupt = self.overflow;

        if self.overflow {
            self.tima = self.tma;
            self.overflow = false;
        }

        self.counter = Counter(self.counter.0.wrapping_add(4));

        self.try_increment_tima(&previous);

        should_interrupt
    }
}

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

    #[test]
    fn it_should_be_initialised_correctly() {
        let timer = Timer::new();

        assert_eq!(0xAB, timer.div());
        assert_eq!(0x00, timer.tac().0);
        assert_eq!(0x00, timer.tima());
        assert_eq!(0x00, timer.tma());
    }
}
<gh_stars>0
use crate::model::{LastCommandMessages, LastUserPresence};
use regex::Regex;
use serenity::client::Context;
use serenity::framework::standard::CommandResult;
use serenity::http::client::Http;
use serenity::model::{
    channel::Message,
    guild::Member,
    id::{GuildId, MessageId, UserId},
    user::OnlineStatus,
};
use std::collections::HashMap;
use std::str::FromStr;
use std::sync::Arc;

pub struct UserIdName {
    pub id: u64,
    pub name: String,
    pub status: Option<OnlineStatus>,
}

// This feels a little clunky (as its also combined with get_user


peed();
      });

      await scene.preload([birdsRes, birdsJsonUrl]);

      for(let i = 0; i < 10; i++) {
        if(i !== 5 && i !== 9) {
          const bird = new Sprite('bird1.png');
          bird.attr({
            anchor: [0.5, 0.5],
            pos: [-50, 100 + (i % 5) * 80],
            scale: 0.6,
          });
          layer.append(bird);

          bird.animate([
            {texture: 'bird1.png'},
            {texture: 'bird2.png'},
            {texture: 'bird3.png'},
            {texture: 'bird1.png'},
          ], {
            duration: 500,
            iterations: Infinity,
            easing: 'step-end',
          });

          const delay = i < 5 ? Math.abs(2 - i) * 300 : (4 - Math.abs(7 - i)) * 300;
          bird.animate([
            {x: -50},
            {x: 1100},
            {x: -50},
          ], {
            delay,
            duration: 6000,
            // direction: 'alternate',
            iterations: Infinity,
          });

          bird.animate([
            {scale: [0.6, 0.6]},
            {scale: [-0.6, 0.6]},
            {scale: [0.6, 0.6]},
          ], {
            delay,
            duration: 6000,
            iterations: Infinity,
            easing: 'step-end',
          });
        }
      }
    }());
  </script>

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>

    <button id="tweenjs-speed1">原速</button>
    <button id="tweenjs-speed2">2倍速</button>
    <button id="tweenjs-speed4">4倍速</button>
    <button id="tweenjs-halfSpeed">½倍速</button>
    <button id="tweenjs-pause">静止</button>
    <button id="tweenjs-reversePlay">倒放</button>


nce 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n  return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbG9kYXNoL2lzRXF1YWwuanMiLCJtYXBwaW5ncyI6IkFBQUEsa0JBQWtCLG1CQUFPLENBQUMsbUVBQWdCOztBQUUxQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxHQUFHO0FBQ2QsV0FBVyxHQUFHO0FBQ2QsYUFBYSxTQUFTO0FBQ3RCO0FBQ0E7QUFDQSxrQkFBa0I7QUFDbEIsaUJBQWlCO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vbmV4dGVsZXZlbi10YXR0b28tcHJvLy4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc0VxdWFsLmpzPzM3M2EiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VJc0VxdWFsID0gcmVxdWlyZSgnLi9fYmFzZUlzRXF1YWwnKTtcblxuLyoqXG4gKiBQZXJmb3JtcyBhIGRlZXAgY29tcGFyaXNvbiBiZXR3ZWVuIHR3byB2YWx1ZXMgdG8gZGV0ZXJtaW5lIGlmIHRoZXkgYXJlXG4gKiBlcXVpdmFsZW50LlxuICpcbiAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBzdXBwb3J0cyBjb21wYXJpbmcgYXJyYXlzLCBhcnJheSBidWZmZXJzLCBib29sZWFucyxcbiAqIGRhdGUgb2JqZWN0cywgZXJyb3Igb2JqZWN0cywgbWFwcywgbnVtYmVycywgYE9iamVjdGAgb2JqZWN0cywgcmVnZXhlcyxcbiAqIHNldHMsIHN0cmluZ3MsIHN5bWJvbHMsIGFuZCB0eXBlZCBhcnJheXMuIGBPYmplY3RgIG9iamVjdHMgYXJlIGNvbXBhcmVkXG4gKiBieSB0aGVpciBvd24sIG5vdCBpbmhlcml0ZWQsIGVudW1lcmFibGUgcHJvcGVydGllcy4gRnVuY3Rpb25zIGFuZCBET01cbiAqIG5vZGVzIGFyZSBjb21wYXJlZCBieSBzdHJpY3QgZXF1YWxpdHksIGkuZS4gYD09PWAuXG4gKlxuICogQHN0YXRpY


(Cancel->getCalledFunction()->doesNotAccessMemory());
  EXPECT_FALSE(Cancel->getCalledFunction()->doesNotFreeMemory());
  EXPECT_EQ(Cancel->getNumUses(), 1U);
  Instruction *CancelBBTI = Cancel->getParent()->getTerminator();
  EXPECT_EQ(CancelBBTI->getNumSuccessors(), 2U);
  EXPECT_EQ(CancelBBTI->getSuccessor(0), NewIP.getBlock());
  EXPECT_EQ(CancelBBTI->getSuccessor(1)->size(), 3U);
  CallInst *GTID1 = dyn_cast<CallInst>(&CancelBBTI->getSuccessor(1)->front());
  EXPECT_NE(GTID1, nullptr);
  EXPECT_EQ(GTID1->arg_size(), 1U);
  EXPECT_EQ(GTID1->getCalledFunction()->getName(), "__kmpc_global_thread_num");
  EXPECT_FALSE(GTID1->getCalledFunction()->doesNotAccessMemory());
  EXPECT_FALSE(GTID1->getCalledFunction()->doesNotFreeMemory());
  CallInst *Barrier = dyn_cast<CallInst>(GTID1->getNextNode());
  EXPECT_NE(Barrier, nullptr);
  EXPECT_EQ(Barrier->arg_size(), 2U);
  EXPECT_EQ(Barrier->getCalledFunction()->getName(), "__kmpc_cancel_barrier");
  EXPECT_FALSE(Barrier->getCalledFunction()->doesNotAccessMemory());
  EXPECT_FALSE(Barrier->getCalledFunction()->doesNotFreeMemory());
  EXPECT_EQ(Barrier->getNumUses(), 0U);
  EXPECT_EQ(CancelBBTI->getSuccessor(1)->getTerminator()->getNumSuccessors(),
            1U);
  EXPECT_EQ(CancelBBTI->getSuccessor(1)->getTerminator()->getSuccessor(0), CBB);

  EXPECT_EQ(cast<CallInst>(Cancel)->getArgOperand(1), GTID);

  OMPBuilder.popFinalizationCB();

  Builder.CreateUnreachable();
  EXPECT_FALSE(verifyModule(*M, &errs()));
}

TEST_F(OpenMPIRBuilderTest, CreateCancelIfCond) {
  using InsertPointTy = OpenMPIRBuilder::InsertPointTy;
  OpenMPIRBuilder OMPBuilder(*M);
  OMPBuilder.initialize();

  BasicBlock *CBB = BasicBlock::Create(Ctx, "", F);
  new UnreachableInst(Ctx, CBB);
  auto FiniCB = [&](InsertPointTy IP) {
    ASSERT_NE(IP.getBlock(), nullptr);
    ASSERT_EQ(IP.getBlock()->end(), IP.getPoint());
    BranchInst::Create(CBB, IP.getBlock());
  };
  OMPBuilder.pushFinalizationCB({FiniCB, OMPD_parallel, true});

  IRBuilder<> Builder(BB);

  OpenMPIRBuilder::LocationDescription Loc({Builder.saveIP()});
  auto NewIP = OMPBuilder.createCancel(Loc, Builder.getTrue(), OMPD_parallel);
  Builder.restoreIP(NewIP);
  EXPECT_FALSE(M->global_empty());
  EXPECT_EQ(M->size(), 4U);
  EXPECT_EQ(F->size(), 7U);
  EXPECT_EQ(BB->size(), 1U);
  ASSERT_TRUE(isa<BranchInst>(BB->getTerminator()));
  ASSERT_EQ(BB->getTerminator()->getNumSuccessors(), 2U);
  BB = BB->getTerminator()->getSuccessor(0);
  EXPECT_EQ(BB->size(), 4U);

  CallInst *GTID = dyn_cast<CallInst>(&BB->front());
  EXPECT_NE(GTID, nullptr);
  EXPECT_EQ(GTID->arg_size(), 1U);
  EXPECT_EQ(GTID->getCalledFunction()->getName(), "__kmpc_global_thread_num");
  EXPECT_FALSE(GTID->getCalledFunction()->doesNotAccessMemory());
  EXPECT_FALSE(GTID->getCalledFunction()->


/*	$OpenBSD: xordi3.c,v 1.2 1997/11/07 15:56:55 niklas Exp $	*/
/*	$NetBSD: xordi3.c,v 1.5 1995/10/07 09:26:56 mycroft Exp $	*/

/*-
 * Copyright (c) 1992, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This software was developed by the Computer Systems Engineering group
 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
 * contributed to Berkeley.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)xordi3.c	8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$OpenBSD: xordi3.c,v 1.2 1997/11/07 15:56:55 niklas Exp $";
#endif
#endif /* LIBC_SCCS and not lint */

#include "quad.h"

/*
 * Return a ^ b, in quad.
 */
quad_t
__xordi3(a, b)
	quad_t a, b;
{
	union uu aa, bb;

	aa.q = a;
	bb.q = b;
	aa.ul[0] ^= bb.ul[0];
	aa.ul[1] ^= bb.ul[1];
	return (aa.q);
}


/* .cancel can mean anything */

button.cancel {
    --buttonColor: var(--danger);
    --buttonTextColor: var(--white);
}

button.small {
    font-size: var(--smallText);

}

/* elements and layouts */

.layout {
    /* top padding is header height + visual distance we want */
    /* padding: calc(3rem + var(--headerHeight)) var(--containerPadding); */
    padding-top: calc(0rem + var(--headerHeight));
}

.grid {
    --gridCols: 2;
    display: block; /* reset here for mobile override */
    grid-template-columns: repeat(var(--gridCols), 1fr);
}

.cols-3 {
    --gridCols: 3;
}

.cols-4 {
    --gridCols: 4;
}

.flex {
    --justifyContent: space-between;
    display: block; /* reset here for mobile override */
    justify-content: var(--justifyContent);
}

.flex-around {
    --justifyContent: space-around;
}

.card {
    padding: 2em;
    background: var(--cardBg);
    box-shadow: var(--shadow-lg);
    border-radius: var(--borderRadius);
}

/* first item never has margin top */
.card > *:first-child {
    margin-top: 0;
}
/* last item never has margin bottom */
.card > *:last-child {
    margin-bottom: 0;
}

.grid-split {
    display: grid;
    grid-template-columns: 33% 67%;
    gap: 20px;
}

/* make font size larger */
@media only screen and (min-width: 600px) {
    :root {
        /* --baseFontSize: 112.5%; */
        --baseFontSize: 100%;
    }
    .grid {
        display: grid;
    }
    .flex {
        display: flex;
    }

}

.logo {
    font-size: var(--baseFontSize);
    margin: 0;
	margin-left: 8px;
}

/* Theming */
.dark {
    --background: var(--black);
    --textColor: var(--lightGrey);
    --headerBackground: var(--darkGrey);
    --footerBackground: var(--darkGrey);
    --cardBg: var(--darkGrey);
    --buttonTextColor: var(--black);
}

.oled {
    --black: #000;
    --cardBg: var(--darkGrey);
    --headerBackground: var(--darkGrey);
    --footerBackground: var(--darkGrey);
}

.theme {
        /* colors */
        --green: #00ebc7;
        --red: #FF5470;
        --yellow: #fde24f;
        --black: #1b2d45;
        --darkBlue: #00214d;
        --darkGrey: #222;
        --grey: #bfbfbf;
        --lightGrey: #f2f4f6;
        --white: white;

        /* color intentions */
        --primary: var(--green);
        --danger: var(--red);
        --background: var(--lightGrey);
        --textColor: var(--black);
        --lineColor: var(--grey);
        --cardBg: var(--white);
        --headerBackground: var(--darkBlue);
        --footerBackground: var(--darkBlue);
        --footerTextColor: var(--lightGrey);
        --buttonColor: var(--primary);
        --buttonTextColor: var(--textColor);

        /* Styles */
        --line: solid 1px var(--lineColor);

        /* Typograph


--
-- This file is part of Cardpeek, the smartcard reader utility.
--
-- Copyright 2009-2013 by 'L1L1'
--
-- Cardpeek is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- Cardpeek is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with Cardpeek.  If not, see <http://www.gnu.org/licenses/>.
--

require('lib.strict')

SERVICE_PROVIDERS = {
  [5] = "TAM"
}

TRANSPORT_LIST = {
  [1] = "Urban Bus",
  [2] = "Interurban Bus",
  [3] = "Metro",
  [4] = "Tram",
  [5] = "Train",
  [8] = "Parking"
}

TRANSITION_LIST = {
  [1] = "Entry",
  [2] = "Exit",
  [4] = "Inspection",
  [6] = "Interchange (entry)",
  [7] = "Interchange (exit)"
}

function process_events(cardenv,node_label)
    local event_node
    local record_node
    local ref_node

    local code_value
    local code_transport
    local code_transition
    local code_transport_string
    local code_transition_string
    local code_string
    local serv


        *self = I32x1(self.0.wrapping_add(rhs.0));
    }
}

impl AddAssign for I64x1 {
    #[inline(always)]
    fn add_assign(&mut self, rhs: I64x1) {
        *self = I64x1(self.0.wrapping_add(rhs.0));
    }
}

impl AddAssign for F32x1 {
    #[inline(always)]
    fn add_assign(&mut self, rhs: F32x1) {
        *self = F32x1(self.0 + rhs.0);
    }
}

impl AddAssign for F64x1 {
    #[inline(always)]
    fn add_assign(&mut self, rhs: F64x1) {
        *self = F64x1(self.0 + rhs.0);
    }
}

impl Add for I16x1 {
    type Output = I16x1;

    #[inline(always)]
    fn add(self, rhs: I16x1) -> I16x1 {
        I16x1(self.0.wrapping_add(rhs.0))
    }
}

impl Add for I32x1 {
    type Output = I32x1;

    #[inline(always)]
    fn add(self, rhs: I32x1) -> I32x1 {
        I32x1(self.0.wrapping_add(rhs.0))
    }
}

impl Add for I64x1 {
    type Output = I64x1;

    #[inline(always)]
    fn add(self, rhs: I64x1) -> I64x1 {
        I64x1(self.0.wrapping_add(rhs.0))
    }
}

impl Add for F32x1 {
    type Output = F32x1;

    #[inline(always)]
    fn add(self, rhs: F32x1) -> F32x1 {
        F32x1(self.0 + rhs.0)
    }
}

impl Add for F64x1 {
    type Output = F64x1;

    #[inline(always)]
    fn add(self, rhs: F64x1) -> F64x1 {
        F64x1(self.0 + rhs.0)
    }
}
// -- BitAndAssign

impl BitAndAssign for I16x1 {
    #[inline(always)]
    fn bitand_assign(&mut self, rhs: I16x1) {
        *self = I16x1(self.0 & rhs.0);
    }
}

impl BitAndAssign for I32x1 {
    #[inline(always)]
    fn bitand_assign(&mut self, rhs: I32x1) {
        *self = I32x1(self.0 & rhs.0);
    }
}

impl BitAndAssign for I64x1 {
    #[inline(always)]
    fn bitand_assign(&mut self, rhs: I64x1) {
        *self = I64x1(self.0 & rhs.0);
    }
}

impl BitAndAssign for F32x1 {
    #[inline(always)]
    fn bitand_assign(&mut self, rhs: F32x1) {
        let lbits = self.0.to_bits();
        let rbits = rhs.0.to_bits();
        let result = lbits & rbits;
        *self = F32x1(f32::from_bits(result));
    }
}

impl BitAndAssign for F64x1 {
    #[inline(always)]
    fn bitand_assign(&mut self, rhs: F64x1) {
        let lbits = self.0.to_bits();
        let rbits = rhs.0.to_bits();
        let result = lbits & rbits;
        *self = F64x1(f64::from_bits(result));
    }
}

// -- Bitwise And

impl BitAnd for I16x1 {
    type Output = I16x1;

    #[inl


HECK_LE(samples_per_channel, kMaximalNumberOfSamplesPerChannel);

  auto per_sample_scaling_factors = rtc::ArrayView<float>(
      &per_sample_scaling_factors_[0], samples_per_channel);
  ComputePerSampleSubframeFactors(scaling_factors_, samples_per_channel,
                                  per_sample_scaling_factors);
  ScaleSamples(per_sample_scaling_factors, signal);

  last_scaling_factor_ = scaling_factors_.back();

  // Dump data for debug.
  apm_data_dumper_->DumpRaw("agc2_limiter_last_scaling_factor",
                            last_scaling_factor_);
  apm_data_dumper_->DumpRaw(
      "agc2_limiter_region",
      static_cast<int>(interp_gain_curve_.get_stats().region));
}

InterpolatedGainCurve::Stats Limiter::GetGainCurveStats() const {
  return interp_gain_curve_.get_stats();
}

void Limiter::SetSampleRate(size_t sample_rate_hz) {
  CheckLimiterSampleRate(sample_rate_hz);
  level_estimator_.SetSampleRate(sample_rate_hz);
}

void Limiter::Reset() {
  level_estimator_.Reset();
}

float Limiter::LastAudioLevel() const {
  return level_estimator_.LastAudioLevel();
}

}  // namespace webrtc
/*
 *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "modules/audio_processing/agc2/fixed_digital_level_estimator.h"

#include <limits>

#include "common_audio/include/audio_util.h"
#include "modules/audio_processing/agc2/agc2_common.h"
#include "modules/audio_processing/agc2/agc2_testing_common.h"
#include "modules/audio_processing/agc2/vector_float_frame.h"
#include "modules/audio_processing/logging/apm_data_dumper.h"
#include "rtc_base/gunit.h"

namespace webrtc {
namespace {

constexpr float kInputLevel = 10000.f;

// Run audio at specified settings through the level estimator, and
// verify that the output level falls within the bounds.
void TestLevelEstimator(int sample_rate_hz,
                        int num_channels,
                        float input_level_linear_scale,
                        float expected_min,
                        float expected_max) {
  ApmDataDumper apm_data_dumper(0);
  FixedDigitalLevelEstimator level_estimator(sample_rate_hz, &apm_data_dumper);

  const VectorFloatFrame vectors_with_float_frame(
      num_channels, rtc::CheckedDivExact(sample_rate_hz, 100),
      input_level_linear_scale);

  for (int i = 0; i < 500; ++i) {
    const auto level = level_estimator.ComputeLevel(
        vectors_with_float_frame.float_frame_view());

    // Give the estimator some time to ramp up.
    if (i < 50) {
      continue;
    }

    for (const auto& x : level) {
      EXPECT_LE(expected_min, x);
      EXPECT_LE(x, expected_max);
    }
  }
}

// Returns time it takes for the level estimator to decrease its level
// estimate by 'level_reduction_db'.
float TimeMsToDecreaseLevel(int sample_rat


LINE_NUMBER/(.*)/ ${} aaaa/}"
			exec_lua("ls.lsp_expand([[" .. snip .. "]])")
			screen:expect({
				grid = [[
			 ${} aaaa^                                         |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
			})
		end
	)

	it("correctly parses escaped characters.", function()
		-- ls_helpers.session_setup_luasnip()
		local snip = [["\\`\\`\\` `'abc' . '\\`lel'`"]]

		exec_lua("ls.snip_expand(ls.parser.parse_snipmate('', " .. snip .. "))")
		screen:expect({
			grid = [[
			``` abc\`lel^                                      |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
	end)

	it("Correctly parses empty choice.", function()
		-- ls_helpers.session_setup_luasnip()
		exec_lua([[ls.lsp_expand("${1|asdf,zxcv,poiu,qwer|} ${2|,r|} ${3||}")]])
		screen:expect({
			grid = [[
			^asdf                                              |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})

		exec_lua("ls.change_choice(1)")
		screen:expect({
			grid = [[
			^zxcv                                              |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
		exec_lua("ls.change_choice(1)")
		screen:expect({
			grid = [[
			^poiu                                              |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})

		exec_lua("ls.change_choice(1)")
		screen:expect({
			grid = [[
			^qwer                                              |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		exec_lua("ls.change_choice(1)")
		screen:expect({
			grid = [[
			qwer ^r                                            |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		exec_lua("ls.change_choice(1)")
		screen:expect({
			grid = [[
			qwer r ^                                           |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
	end)
end)


/*
    +--------------------------------------------------------------------+
    | PECL :: http                                                       |
    +--------------------------------------------------------------------+
    | Redistribution and use in source and binary forms, with or without |
    | modification, are permitted provided that the conditions mentioned |
    | in the accompanying LICENSE file are met.                          |
    +--------------------------------------------------------------------+
    | Copyright (c) 2004-2005, Michael Wallner <mike@php.net>            |
    +--------------------------------------------------------------------+
*/

/* $Id$ */

#ifndef PHP_HTTP_REQUEST_METHOD_API_H
#define PHP_HTTP_REQUEST_METHOD_API_H

#include "php_http_std_defs.h"
#include "phpstr/phpstr.h"

typedef enum {
	HTTP_NO_REQUEST_METHOD	= 0,
	/* HTTP/1.1 */
	HTTP_GET				= 1,
	HTTP_HEAD				= 2,
	HTTP_POST				= 3,
	HTTP_PUT				= 4,
	HTTP_DELETE				= 5,
	HTTP_OPTIONS			= 6,
	HTTP_TRACE				= 7,
	HTTP_CONNECT			= 8,
	/* WebDAV - RFC 2518 */
	HTTP_PROPFIND			= 9,
	HTTP_PROPPATCH			= 10,
	HTTP_MKCOL				= 11,
	HTTP_COPY				= 12,
	HTTP_MOVE				= 13,
	HTTP_LOCK				= 14,
	HTTP_UNLOCK				= 15,
	/* WebDAV Versioning - RFC 3253 */
	HTTP_VERSION_CONTROL	= 16,
	HTTP_REPORT				= 17,
	HTTP_CHECKOUT			= 18,
	HTTP_CHECKIN			= 19,
	HTTP_UNCHECKOUT			= 20,
	HTTP_MKWORKSPACE		= 21,
	HTTP_UPDATE				= 22,
	HTTP_LABEL				= 23,
	HTTP_MERGE				= 24,
	HTTP_BASELINE_CONTROL	= 25,
	HTTP_MKACTIVITY			= 26,
	/* WebDAV Access Control - RFC 3744 */
	HTTP_ACL				= 27,
	HTTP_MAX_REQUEST_METHOD	= 28
} http_request_method;

#define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD))
#define HTTP_CUSTOM_REQUEST_METHOD(m) (m - HTTP_MAX_REQUEST_METHOD)

extern PHP_MINIT_FUNCTION(http_request_method);
extern PHP_RSHUTDOWN_FUNCTION(http_request_method);

#define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC)
PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC);

#define http_request_method_exists(u, l, c) _http_request_method_exists((u), (l), (c) TSRMLS_CC)
PHP_HTTP_API ulong _http_request_method_exists(zend_bool by_name, ulong id, const char *name TSRMLS_DC);

#define http_request_method_register(m, l) _http_request_method_register((m), (l) TSRMLS_CC)
PHP_HTTP_API ulong _http_request_method_register(const char *method, size_t method_name_len TSRMLS_DC);

#define http_request_method_unregister(mn) _http_request_method_unregister((mn) TSRMLS_CC)
PHP_HTTP_API STATUS _http_request_method_unregister(ulong method TSRMLS_DC);

#endif

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */


 t.Errorf("Reverse: %q, want %q", rev, tc.want)
           }
       }
   }
   ```

### 运行单元测试

使用`go test`命令来运行单元测试

```bash
$ go test
PASS
ok      example/fuzz  0.013s
```

接下来，我们给`Reverse`函数增加模糊测试(fuzz test)代码。

## 增加模糊测试

单元测试有局限性，每个测试输入必须由开发者指定，显式加到单元测试的测试用例里。

fuzzing的优点之一是可以基于开发者代码里指定的测试输入作为基础数据，进一步自动生成新的随机测试数据，用来发现指定测试输入没有覆盖到的边界情况。

在这个章节，我们会把单元测试转换成模糊测试，这样可以更轻松地生成更多的测试输入。

**注意**：你可以把单元测试、性能测试和模糊测试放在同一个`*_test.go`文件里。

### 编写模糊测试

在文本编辑器里把`reverse_test.go`里的单元测试代码`TestReverse`替换成如下的模糊测试代码`FuzzReverse`。

```go
func FuzzReverse(f *testing.F) {
    testcases := []string{"Hello, world", " ", "!12345"}
    for _, tc := range testcases {
        f.Add(tc)  // Use f.Add to provide a seed corpus
    }
    f.Fuzz(func(t *testing.T, orig string) {
        rev := Reverse(orig)
        doubleRev := Reverse(rev)
        if orig != doubleRev {
            t.Errorf("Before: %q, after: %q", orig, doubleRev)
        }
        if utf8.ValidString(orig) && !utf8.ValidString(rev) {
            t.Errorf("Reverse produced invalid UTF-8 string %q", rev)
        }
    })
}
```

Fuzzing也有一定的局限性。

在单元测试里，因为测试输入是固定的，你可以知道调用`Reverse`函数后每个输入字符串得到的反转字符串应该是什么，然后在单元测试的代码里判断`Reverse`的执行结果是否和预期相符。例如，对于测试用例`Reverse("Hello, world")`，单元测试预期的结果是 `"dlrow ,olleH"`。

但是使用fuzzing时，我们没办法预期输出结果是什么，因为测试的输入除了我们代码里指定的用例之外，还有fuzzing随机生成的。对于随机生成的测试输入，我们当然没办法提前知道输出结果是什么。

虽然如此，本文里的`Reverse`函数有几个特性我们还是可以在模糊测试里做验证。

1. 对一个字符串做2次反转，得到的结果和源字符串相同
2. 反转后的字符串也仍然是一个有效的UTF-8编码的字符串

**注意**：fuzzing模糊测试和Go已有的单元测试以及性能测试框架是互为补充的，并不是替代关系。

比如我们实现的`Reverse`函数如果是一个错误的版本，直接return返回输入的字符串，是完全可以通过上面的模糊测试的，但是没法通过我们前面编写的单元测试。因此单元测试和模糊测�


ORT-2, r25  ; clk hi
    brcc bitIn
    ret

; receive-only SPI slave
.global spiSIn
spiSIn:
    ldi r24, 0x01
    clc
bitSIn:
    sbis SPIPORT-2, CLK
    rjmp bitSIn         ; wait for clk hi
    sbic SPIPORT-2, MOSI
    sec
    rol r24             ; shift in data
waitClk:
    sbis SPIPORT-2, CLK
    rjmp waitClk         ; wait for clk lo
    brcc bitSIn
    ret

.global spiFast
spiFast:
    in r25, SPIPORT     ; save port state
    andi r25, ~clkpinmask
    ldi r19, clkpinmask
halfByte:
    bst r24, 7
    bld r25, MOSI
    out SPIPORT, r25    ; clk low + data
    out SPIPORT-2, r19  ; clk hi
    bst r24, 6
    bld r25, MOSI
    out SPIPORT, r25    ; clk low + data
    out SPIPORT-2, r19  ; clk hi
    bst r24, 5
    bld r25, MOSI
    out SPIPORT, r25    ; clk low + data
    out SPIPORT-2, r19  ; clk hi
    bst r24, 4
    bld r25, MOSI
    out SPIPORT, r25    ; clk low + data
    out SPIPORT-2, r19  ; clk hi
    swap r24
    eor r1, r19         ; r1 is zero reg
    brne halfByte
    ret


pe:l(Object)}}),me=_({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:L}}),de=_({onKeydown:{type:l(Function)}}),re=[u.down,u.pageDown,u.home],le=[u.up,u.pageUp,u.end],fe=[...re,...le],{ElCollection:Ee,ElCollectionItem:_e,COLLECTION_INJECTION_KEY:ye,COLLECTION_ITEM_INJECTION_KEY:Ce}=ae("Dropdown");export{Ce as C,pe as E,fe as F,le as L,Ee as a,me as b,ae as c,ue as d,ne as e,_e as f,de as g,ye as h};
import{cT as i,o as r,h as a,i as e,t as s,v as n,x as l}from"./entry.49b00e51.js";import{_ as d}from"./_plugin-vue_export-helper.a1a6add7.js";const c=t=>(n("data-v-73785db7"),t=t(),l(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},m=["textContent"],g=["textContent"],b={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return i({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(x,u)=>(r(),a("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,m),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,g)])]))}},y=d(b,[["__scopeId","data-v-73785db7"]]);export{y as default};
import{bx as C,aB as v,aY as L}


option><option value="gb18030" data-load-encoding="2">gb18030</option><option value="big5" data-load-encoding="2">Big5</option><option value="euc-jp" data-load-encoding="2">EUC-JP</option><option value="iso-2022-jp" data-load-encoding="2">ISO-2022-JP</option><option value="shift_jis" data-load-encoding="2">Shift_JIS</option><option value="euc-kr" data-load-encoding="2">EUC-KR</option><option value="x-user-defined" data-load-encoding="2">x-user-defined</option></optgroup></select>

Key<input type="text" id="hmac-key" data-remember="hmac-key" data-share="hmac_key" data-encoding-from="#hmac-input-type" data-auto-update>

<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="content-language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>SHA3-224 File Hash - Online Tools</title><base href="/online-tools/"><meta name="keywords" content="Sha3,SHA3-224,online,hash,checksum,file,URL"><meta name="author" content="emn178"><meta name="copyright" content="emn178"><meta name="description" content="This SHA3-224 online tool helps you calculate the hash of a file from local or URL using SHA3-224 without uploading the file."><meta property="og:type" content="website"><meta property="og:title" content="SHA3-224 File Hash"><meta property="og:url" content="https://emn178.github.io/online-tools/sha3_224_checksum.html"><meta property="og:site_name" content="Online Tools"><meta property="og:description" content="This SHA3-224 online tool helps you calculate the hash of a file from local or URL using SHA3-224 without uploading the file."><meta property="og:locale" content="en"><meta property="og:image" content="https://emn178.github.io/online-tools/images/logo.svg"><meta property="article:author" content="emn178"><meta property="article:tag" content="Sha3,SHA3-224,online,hash,checksum,file,URL"><meta property="twitter:card" content="summary"><meta property="twitter:image" content="https://emn178.github.


 .097-.005.097-.018 0-.008-.14-.25-.307-.535a5.972 5.972 0 01-.298-.525 1.248 1.248 0 01.133-.073c.234-.12.35-.313.35-.594a.6.6 0 00-.453-.6 3.688 3.688 0 00-.542-.03zm1.947 0v2.373h1.31v-.152h-1.126v-1.037h1.067v-.152h-1.067v-.912h.564c.542 0 .563-.003.563-.06 0-.058-.02-.06-.653-.06zm2.59 0v1.264c0 1.079-.008 1.283-.048 1.368-.066.137-.17.183-.4.177-.172-.004-.193.003-.193.054 0 .084.133.13.33.11.206-.02.334-.097.413-.25.06-.12.064-.17.073-1.427l.01-1.297h-.091zm-12.7.11.33.021c.18.013.373.037.432.055.325.097.44.54.21.8-.129.142-.31.2-.674.2h-.295v-.538zm-3.885.013a4.267 4.267 0 01.376.03c.43.047.667.197.803.498.061.133.07.204.07.52 0 .34-.006.377-.085.54a1.008 1.008 0 01-.21.28c-.182.16-.35.208-.775.222l-.375.016v-1.034c0-.57.01-1.043.022-1.052.013-.015.077-.02.174-.02zm12.387 0c.09 0 .213.01.346.026.295.034.432.107.503.26.12.263.036.556-.196.69-.11.06-.175.072-.483.081l-.36.012v-.515c0-.282.01-.526.023-.536.012-.013.073-.02.165-.018zm-1.858 0a1.197 1.197 0 01.334.044.873.873 0 01.458.472c.058.14.067.23.067.532 0 .401-.045.573-.21.79-.21.274-.703.36-1.06.188-.334-.16-.462-.44-.46-.993 0-.288.014-.38.07-.523.077-.194.296-.42.467-.472a1.14 1.14 0 01.333-.036zm5.352 1.98c-.052 0-.072.018-.097.07-.048.11.01.232.11.232.098 0 .147-.066.134-.19-.01-.087-.02-.1-.107-.11a.379.379 0 00-.04-.001zm-9.082 1.308c-6.59 0-11.99.01-11.999.02a1.2 1.2 0 00-.021.305v.283H24v-.608z"/></svg>';
  static const String undertale =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M3 0v1.5H1.5V3H0v12h3v3h3v3h3v3h6v-3h3v-3h3v-3h3V3h-1.5V1.5H21V0h-3v1.5h-3V3h-1.5v3h-3V3H9V1.5H6V0z"/></svg>';
  static const String unicode =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><pat


条都会走索引扫描，而且都是选择扫描二级索引（index_name），我贴个第二条查询语句的执行计划结果图：

![图片](https://img-blog.csdnimg.cn/img_convert/febffda129751df080f734c1fc7980f1.png)

而第三和第四条会发生索引失效，执行计划的结果 type= ALL，代表了全表扫描。

![图片](https://img-blog.csdnimg.cn/img_convert/52952f616b03318e196b6e1207b888ad.png)

### 题目二

题目 2 的数据库表特别之处在于，只有两个字段，一个是主键索引 id，另外一个是二级索引 name。

![图片](https://img-blog.csdnimg.cn/img_convert/a80a15eb8cd65eec777908282e04be2a.png)

针对题目 2 的数据表，第一条和第二条模糊查询语句也是一样可以走索引扫描，第二条查询语句的执行计划如下，Extra 里的 Using index 说明用上了覆盖索引：

![图片](https://img-blog.csdnimg.cn/img_convert/d250a6ba3068ef41da9039974dad206a.png)

我们来看一下第三条查询语句的执行计划（第四条也是一样的结果）：

![图片](https://img-blog.csdnimg.cn/img_convert/948ac3e63c36a93101860e7da11ddc42.png)

从执行计划的结果中，可以看到 key=index_name，也就是说用上了二级索引，而且从 Extra 里的 Using index 说明用上了覆盖索引。

这是为什么呢？

首先，这张表的字段没有「非索引」字段，所以 `select *` 相当于 `select id,name`，然后**这个查询的数据都在二级索引的 B+ 树，因为二级索引的 B+ 树的叶子节点包含「索引值 + 主键值」，所以查二级索引的 B+ 树就能查到全部结果了，这个就是覆盖索引。**

但是执行计划里的 type 是 `index`，这代表着是通过全扫描二级索引的 B+ 树的方式查询到数据的，也就是遍历了整颗索引树。

而第一和第二条查询语句的执行计划中 type 是 `range`，表示对索引列进行范围查询，也就是利用了索引树的有序性的特点，通过查询比较的方式，快速定位到了数据行。

所以，type=range 的查询效率会比 type=ind


.globl relu

.text
# ==============================================================================
# FUNCTION: Performs an inplace element-wise ReLU on an array of ints
# Arguments:
# 	a0 (int*) is the pointer to the array
#	a1 (int)  is the # of elements in the array
# Returns:
#	None
# Exceptions:
# - If the length of the vector is less than 1,
#   this function terminates the program with error code 78.
# ==============================================================================
relu:
    li t0, 1
    blt


 this file.

@use 'sass:map';
@use 'sass:color';
@use 'sass:math';
@use '@angular/material' as mat;

/// Estimate a hue using the given previous and next hues.
@function _estimate-hue($hues, $hue, $prev-hue, $next-hue) {
  $weight: math.div($next-hue - $hue, $next-hue - $prev-hue) * 100%;
  @return color.mix(map.get($hues, $prev-hue), map.get($hues, $next-hue), $weight);
}

$_neutral_hues: (
  0: #000000,
  10: #1C1B1C,
  20: #313030,
  25: #3C3B3B,
  30: #484646,
  35: #545252,
  40: #605E5E,
  50: #797676,
  60: #939090,
  70: #ADAAAA,
  80: #C9C6C5,
  90: #E5E1E1,
  95: #F4F0EF,
  98: #FDF8F8,
  99: #FFFBFF,
  100: #FFFFFF,
);

// Note: Color palettes are generated from the
$_palettes: (
  primary: (
    0: #000000,
    10: #22005d,
    20: #381e72,
    25: #432b7e,
    30: #4f378a,
    35: #5b4397,
    40: #6750a4,
    50: #8069bf,
    60: #9a83db,
    70: #b69df8,
    80: #cfbcff,
    90: #e9ddff,
    95: #f6eeff,
    98: #fdf7ff,
    99: #fffbff,
    100: #ffffff,
  ),
  secondary: (
    0: #000000,
    10: #1E192B,
    20: #332D41,
    25: #3E384D,
    30: #4A4459,
    35: #564F65,
    40: #625B71,
    50: #7B738B,
    60: #958DA5,
    70: #B0A7C0,
    80: #CCC2DC,
    90: #E8DEF9,
    95: #F6EEFF,
    98: #FDF7FF,
    99: #FFFBFF,
    100: #ffffff,
  ),
  tertiary: (
    0: #000000,
    10: #31101D,
    20: #4A2532,
    25: #56303D,
    30: #633B48,
    35: #704654,
    40: #7E5260,
    50: #996A78,
    60: #B58392,
    70: #D29DAC,
    80: #EFB8C8,
    90: #FFD9E3,
    95: #FFECF0,
    98: #FFF8F8,
    99: #FFFBFF,
    100: #ffffff,
  ),
  neutral: (
    0: #000000,
    10: #1C1B1C,
    20: #313030,
    25: #3C3B3B,
    30: #484646,
    35: #545252,
    40: #605E5E,
    50: #797676,
    60: #939090,
    70: #ADAAAA,
    80: #C9C6C5,
    90: #E5E1E1,
    95: #F4F0EF,
    98: #FDF8F8,
    99: #FEF7FF, // surface
    100: #FFFFFF,
    4: _estimate-hue($_neutral_hues, 4, 0, 10),
    6: _estimate-hue($_neutral_hues, 6, 0, 10),
    12: _estimate-hue($_neutral_hues, 12, 10, 20),
    17: _estimate-hue($_neutral_hues, 17, 10, 20),
    22: _estimate-hue($_neutral_hues, 22, 20, 30),


id B();

void D();

void A();

}  // extern "C"
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
#include <stdint.h>

#if 0
''' '
#endif

typedef uint64_t Option_Foo;

#if 0
' '''
#endif

#if 0
from libc.stdint cimport uint64_t
ctypedef uint64_t Option_Foo
#endif

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct Bar {
  Option_Foo foo;
} Bar;

void root(struct Bar f);
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

extern "C" {

/**
 * The root of all evil.
 */
void root();

}  // extern "C"
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

struct A {
  int32_t x;
  float y;
};

struct B {
  A data;
};
#if 0
''' '
#endif

#ifdef __cplusplus
template <typename T>
using Pin = T;
template <typename T>
using Box = T*;
#endif

#if 0
' '''
#endif

#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

struct PinTest {
  Pin<Box<int32_t>> pinned_box;
  Pin<int32_t*> pinned_ref;
};

extern "C" {

void root(Pin<int32_t*> s, PinTest p);

}  // extern "C"
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

namespace constants {

constexpr static const int32_t FOO = 10;

constexpr static const float ZOM = 3.14;

struct Foo {
  int32_t x[FOO];
};

extern "C" {

void root(Foo x);

}  // extern "C"

}  // namespace constants
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

constexpr static const uint32_t Foo_FOO = 42;
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

constexpr static const uint8_t EXPORT_ME_TOO = 42;

struct ExportMe {
  uint64_t val;
};

extern "C" {

void export_me(ExportMe *val);

}  // extern "C"
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

/// Constants shared by multiple CSS Box Alignment properties
///
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
struct AlignFlags {
  uint8_t bits;

  constexpr explicit operator bool() const {
    return !!bits;
  }
  constexpr AlignFlags operator~() const {
    return AlignFlags { static_cast<decltype(bits)>(~bits) };
  }
  constexpr AlignFlags operator|(const AlignFlags& other) const {
    return AlignFlags { static_cast<decltype(bits)>(this->bits | other.bits) };
  }
  AlignFlags& operator|=(const AlignFlags& other) {
    *this =


'',	'',	''},
{'508033',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'Battle_Boss_MiracleNight',	'14',	'50803311'},
{'508043',	'',	'测试怪物组',	'泛用机动最终决战兵器。',	'',	'300502001',	'50608211',	'0',	'0',	'3',	'',	'',	'',	'1',	'1',	'3',	'999',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'508043',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'Battle_Boss_MiracleNight',	'14',	'50804311'},
{'508053',	'',	'测试怪物组',	'泛用机动最终决战兵器。',	'',	'300502001',	'50608211',	'0',	'0',	'3',	'',	'',	'',	'1',	'1',	'3',	'999',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'508053',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'Battle_Boss_MiracleNight',	'14',	'50805311'},
{'508014',	'',	'测试怪物组',	'泛用机动最终决战兵器。',	'',	'300502001',	'50608211',	'0',	'0',	'3',	'',	'',	'',	'1',	'1',	'3',	'50',	'20716',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'508014',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'Battle_Boss_MiracleNight',	'14',	'50801411'},
{'509011',	'',	'测试怪物组',	'泛用机动最终决战兵器。',	'',	'201000003',	'50902114',	'2',	'2',	'2',	'',	'',	'',	'1',	'1',	'3',	'999',	'20802',	'',	'',	'20804',	'',	'',	'',	'',	'',	''},
{'509011',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'Battle_Normal_Prologue',	'22',	'50901111,50901111,50901112'},
{'509011',	'',	'',	'',	'',	'',


) {
            var d = decodeURIComponent(cx[t]).split(';');
            for(var i=0; i<d.length; i++) {
              var xc = d[i].split('=');
              if(xc.length > 1) {
                v[xc[0]] = xc[1];
              } else {
                v[xc[0]] = '';
              }
            }
          }
        }
      } else {
        if(typeof(document.cookie) != 'undefined' && document.cookie != '') {
          var c = document.cookie.split(/;\s*/);
          for(var i = 0; i < c.length; i++) {
            var d = c[i].split('=');
            if(d.length == 2) {
              v[d[0]] = d[1];
            }
          }
        }
      }
      return v;
    }

    /**
     * Standard cookie saving for use by kernel, OSK, UI etc.
     *
     * @param       {string}      cn            name of cookie
     * @param       {Object}      cv            object with array of named arguments and values
     */
    saveCookie(cn: string, cv) {
      var s='';
      for(var v in cv) {
        s = s + v+'='+cv[v]+";";
      }

      var d = new Date(new Date().valueOf() + 1000 * 60 * 60 * 24 * 30).toUTCString();
      document.cookie = cn+'='+encodeURIComponent(s)+'; path=/; expires='+d;//Fri, 31 Dec 2099 23:59:59 GMT;';
    }

    /**
     * Function     toNumber
     * Scope        Public
     * @param       {string}      s            numeric string
     * @param       {number}      dflt         default value
     * @return      {number}
     * Description  Return string converted to integer or default value
     */
    toNumber(s: string, dflt: number): number {
      var x = parseInt(s,10);
      return isNaN(x) ? dflt : x;
    }

    /**
     * Function     toNumber
     * Scope        Public
     * @param       {string}      s            numeric string
     * @param       {number}      dflt         default value
     * @return      {number}
     * Description  Return string converted to real value or default value
     */
    toFloat(s: string, dflt: number): number {
      var x = parseFloat(s);
      return isNaN(x) ? dflt : x;
    }

    /**
     * Function     toNzString
     * Scope        Public
     * @param       {*}           item         variable to test
     * @param       {?*=}         dflt         default value
     * @return      {*}
     * Description  Test if a variable is null, false, empty string, or undefined, and return as string
     */
    nzString(item: any, dflt: any): string {
      var dfltValue = '';
      if(arguments.length > 1) {
        dfltValue = dflt;
      }

      if(typeof(item) == 'undefined') {
        return dfltValue;
      }

      if(item == null) {
        return dfltValue;
      }

      if(item == 0 || item == '') {
        return dfltValue;
      }

      return ''+item;
    }

    /**
     * Function     deepCopy
     * Scope        Private
     * @param       {Object}      p           object to copy
     * @param       {Array=}      c0          array member being copied
     * @return      {Object}                  clone ('deep copy') of object
     * Description  Makes an actual copy (not a reference) of an object, copying simple members,
     *              arrays and member objects but not functions, so use with care!
     */
    deepCopy<T>(p:T, c0): T {
      var c = c0 ||


Value(frame, startFrame) == 1;
                        paneVisibleChkBox.Checked = visbile;
                        bool keyed = track.IsKeyed(frame - startFrame);

                        if (keyed)
                            paneVisibleChkBox.BackColor = Color.FromArgb(255, 150, 106, 18);
                        else
                            paneVisibleChkBox.BackColor = FormThemes.BaseTheme.CheckBoxBackColor;
                    }
                }
                else if (group is LytVertexColorGroup)
                {
                    var track = ((LytVertexColorGroup)group).GetTrack(16);
                    if (track.HasKeys)
                    {
                        byte alpha = (byte)track.GetFrameValue(frame);
                        alphaUD.Value = alpha;
                        alphaSelectorHorizontalPanel1.Alpha = alpha;
                        bool keyed = track.IsKeyed(frame);

                        SetValue(alphaUD, alpha, keyed);
                    }
                }
            }
        }
    }
}


.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.pharmgkb.common.util.PathUtils;
import org.pharmgkb.pharmcat.BaseConfig;
import org.pharmgkb.pharmcat.Env;
import org.pharmgkb.pharmcat.TestUtils;
import org.pharmgkb.pharmcat.phenotype.Phenotyper;
import org.pharmgkb.pharmcat.reporter.format.HtmlFormat;
import org.pharmgkb.pharmcat.reporter.format.html.ReportHelpers;
import org.pharmgkb.pharmcat.reporter.model.DataSource;
import org.pharmgkb.pharmcat.reporter.model.PrescribingGuidanceSource;
import org.pharmgkb.pharmcat.reporter.model.result.DrugReport;
import org.pharmgkb.pharmcat.reporter.model.result.GeneReport;
import org.pharmgkb.pharmcat.reporter.model.result.GuidelineReport;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Test run the Reporter and check generated data
 *
 * @author Ryan Whaley
 */
class ReporterTest {
  private Env m_env;

  @BeforeEach
  void before() throws Exception {
    ReportHelpers.setDebugMode(true);
    m_env = new Env();
    //TestUtils.setSaveTestOutput(true);
  }

  @AfterEach
  void deleteDirectory(TestInfo testInfo) {
    TestUtils.deleteTestOutputDirectory(testInfo);
  }

  @Test
  void cypc2c9VariantPassthrough() throws Exception {

    Phenotyper phenotyper = Phenotyper.read(PathUtils.getPathToResource("org/pharmgkb/pharmcat/reporter/ReporterTest-cypc2c9VariantPassthrough.json"));
    ReportContext reportContext = new ReportContext(m_env, phenotyper, null);

    // test the CYP2C9 data
    GeneReport geneReport = reportContext.getGeneReport(DataSource.CPIC, "CYP2C9");
    assertNotNull(geneReport);
    assertTrue(geneReport.isReportable());
    assertTrue(geneReport.isCalled());
    assertFalse(geneReport.isOutsideCall());
    assertNotNull(geneReport.getVariantReports());
    assertTrue(
        geneReport.getVariantOfInterestReports().stream()
            .anyMatch(r -> r.getDbSnpId() != null && r.getDbSnpId().equals("rs12777823")),
        "Exemption variant not included in gene report"
    );

    // test that messages were applied for a drug
    DrugReport warfarinReport = reportContext.getDrugReports().get(PrescribingGuidanceSource.CPIC_GUIDELINE).get("warfarin");
    assertNotNull(warfarinReport, "Missing warfarin drug report");
    assertEquals(2, warfarinReport.getMessages().size());
    assertEquals(1, warfarinReport.getGuidelines().size());
    GuidelineReport guidelineReport = warfarinReport.getGuidelines().first();
    assertEquals(1, guidelineReport.getAnnotations().size());
    assertEquals(0, guidelineReport.getAnnotations().first().getMessages().size());

    // test that recommendations were matched
    DrugReport desfluraneReport = reportContext.getDrugReport(PrescribingGuidanceSource.CPIC_GUIDELINE, "desflurane");
    assertNotNull(desfluraneReport);
    assertEquals(1, desfluraneReport.getGuidelines().stream().filter(GuidelineReport::isMatched).count());
  }

  @Test
  void multipleActivityScores(TestInfo testInfo) throws Exception {

    Phenotyper phenotyper = Phenotyper.read(
        PathUtils.getPathToResource("org/pharmgkb/pharmcat/reporter/ReporterTest-multipleActivityScores.json"));
    ReportContext reportContext = new ReportContext(new Env(), phenotyper, null);

    // test the CYP2C9 data
    GeneReport geneReport = reportContext.getGeneRepo


[] args) {

		System.out.println(new Day06_LC26_RemoveDuplicates().new Solution().removeDuplicates(new int[]{1,1,2}));;
		System.out.println(new Day06_LC26_RemoveDuplicates().new Solution().removeDuplicates(new int[]{0,0,1,1,1,2,2,3,3,4}));;
	}
	class Solution {
	    public int removeDuplicates(int[] nums) {
	        if(nums.length <2)
	            return nums.length;

	        int i=0, j=1;

	        while(j<nums.length){
	            if(nums[i]!=nums[j]){
	                i++;
	                nums[i]=nums[j];
	            }
	            j++;
	        }
	        return i+1;
	    }
	}
}
import java.util.Arrays;

/*
 *
 * 75. Sort Colors
Solved
Medium
Topics
Companies
Hint
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.

You must solve this problem without using the library's sort function.

Example 1:

Input: nums = [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Example 2:

Input: nums = [2,0,1]
Output: [0,1,2]

Constraints:

n == nums.length
1 <= n <= 300
nums[i] is either 0, 1, or 2.

Follow up: Could you come up with a one-pass algorithm using only constant extra space?
 */
public class Day15_LC75_SortColors {

	public static void main(String[] args) {

//		int[] arr = { 2, 0, 2, 1, 1, 0 };
		int[] arr = { 2, 0, 1,2,1,0,0,2, 1, 1, 0 };
//		int[] arr = { 2, 0, 2 };

		new Day15_LC75_SortColors().new Solution().sortColors(arr);
		System.out.println(Arrays.toString(arr));

	}

// Using three pointers
	class Solution3 {
		public void sortColors(int[] nums) {
			int low = 0, mid = 0, high = nums.length - 1;

			while (mid < high) {
				if (nums[mid] == 0) {
					swap(nums, low, mid);
					low++;
					mid++;
				} else if (nums[mid] == 2) {
					swap(nums, mid, high);
					high--;
				} else {
					mid++;
				}
			}

		}

		public void swap(int[] nums, int l, int r) {
			int temp = nums[l];
			nums[l] = nums[r];
			nums[r] = temp;
		}

	}

// Using brute force approach
	class Solution2 {
		public void sortColors(int[] nums) {

			for (int i = 0; i < nums.length; i++) {

				for (int j = i + 1; j < nums.length; j++) {

					if (nums[i] > nums[j]) {
						int temp = nums[i];
						nums[i] = nums[j];
						nums[j] = temp;
					}
				}
			}
		}
	}

// Using Recursion
	class Solution {
		public void sortColors(int[] nums) {
			sortHelper(nums, nums.length);

		}

		public void sortHelper(int[] nums, int n) {
			if (n == 1)
				return;

			for (int i = 0; i < nums.length - 1; i++) {
				if (nums[i] > nums[i + 1]) {
					int tmp = nums[i];
					nums[i] = nums[i + 1];
					nums[i + 1] = tmp;
				}
			}
			sortHelper(nums, n - 1);
		}
	}

}
package MyPackage;

import jakarta.servlet.ServletException;
import jakarta.servlet.ann


ese users' demand. They don't want to use TC fonts for
// rendering Latin letters. (bug 88579)
pref("font.name.serif.zh-TW", "Times New Roman");
pref("font.name.sans-serif.zh-TW", "Arial");
pref("font.name.monospace.zh-TW", "細明體");  // MingLiU
pref("font.name-list.serif.zh-TW", "新細明體,PMingLiu,細明體,MingLiU");
pref("font.name-list.sans-serif.zh-TW", "新細明體,PMingLiU,細明體,MingLiU");
pref("font.name-list.monospace.zh-TW", "MingLiU,細明體");

// hkscsm3u.ttf (HKSCS-2001) :  http://www.microsoft.com/hk/hkscs
// Hong Kong users have the same demand about glyphs for Latin letters (bug 88579)
pref("font.name.serif.zh-HK", "Times New Roman");
pref("font.name.sans-serif.zh-HK", "Arial");
pref("font.name.monospace.zh-HK", "細明體_HKSCS");
pref("font.name-list.serif.zh-HK", "細明體_HKSCS, MingLiu_HKSCS, Ming(for ISO10646), MingLiU, 細明體");
pref("font.name-list.sans-serif.zh-HK", "細明體_HKSCS, MingLiU_HKSCS, Ming(for ISO10646), MingLiU, 細明體");
pref("font.name-list.monospace.zh-HK", "MingLiU_HKSCS,  細明體_HKSCS, Ming(for ISO10646), MingLiU, 細明體");

pref("font.name.serif.x-devanagari", "Mangal");
pref("font.name.sans-serif.x-devanagari", "Raghindi");
pref("font.name.monospace.x-devanagari", "Mangal");
pref("font.name-list.serif.x-devanagari", "Mangal, Raghindi");
pref("font.name-list.monospace.x-devanagari", "Mangal, Raghindi");

pref("font.name.serif.x-tamil", "Latha");
pref("font.name.sans-serif.x-tamil", "Code2000");
pref("font.name.monospace.x-tamil", "Latha");
pref("font.name-list.serif.x-tamil", "Latha, Code2000");
pref("font.name-list.monospace.x-tamil", "Latha, Code2000");

//@line 1250 "e:\xr19rel\WINNT_5.2_Depend\mozilla\modules\libpref\src\init\all.js"

pref("font.name.serif.x-armn", "Sylfaen");
pref("font.name.sans-serif.x-armn", "Arial AMU");
pref("font.name.monospace.x-armn", "Arial AMU");
pref("font.name-list.serif.x-armn", "Sylfaen,Arial Unicode MS, Code2000");
pref("font.name-list.monospace.x-armn", "Arial AMU, Arial Unicode MS, Code2000");

pref("font.name.serif.x-beng", "Vrinda");
pref("font.name.sans-serif.x-beng", "Vrinda");
pref("font.name.monospace.x-beng", "Mitra Mono");
pref("font.name-list.serif.x-beng", "Vrinda, Akaash, Likhan, Ekushey Punarbhaba, Code2000, Arial Unicode MS");
pref("font.name-list.sans-serif.x-beng", "Vrinda, Akaash, Likhan, Ekushey Punarbhaba, Code2000, Arial Unicode MS")


MainBinding get() = _binding!!

	private val settingsRepository: SettingsRepository by inject()

	override fun onCreateView(
		inflater: LayoutInflater,
		container: ViewGroup?,
		savedInstanceState: Bundle?
	): View {
		_binding = TvFragmentMainBinding.inflate(inflater, container, false)

		binding.viewpager.adapter = MainNavPagerAdapter(requireContext(), parentFragmentManager)
		binding.tabs.setupWithViewPager(binding.viewpager)

		val selectedTabIndex = when (settingsRepository.startFragment) {
			R.id.mediathekListFragment -> 1
			else -> 0
		}
		val selectedTab = binding.tabs.getTabAt(selectedTabIndex)
		binding.tabs.selectTab(selectedTab)
		selectedTab?.view?.requestFocus()

		return binding.root
	}

	override fun onDestroyView() {
		super.onDestroyView()
		_binding = null
	}

	fun onBackPressed(): Boolean {
		return if (binding.tabs.hasFocus()) {
			// tabs have already focus - let parent handle back press
			false
		} else {
			// focus tabs before doing any other back press action
			binding.tabs.requestFocus()
			true
		}
	}
}
package de.christinecoenen.code.zapp.app.player

import android.text.TextUtils
import androidx.annotation.DrawableRes
import de.christinecoenen.code.zapp.app.settings.repository.StreamQualityBucket
import de.christinecoenen.code.zapp.models.channels.ChannelModel
import de.christinecoenen.code.zapp.models.shows.PersistedMediathekShow
import de.christinecoenen.code.zapp.models.shows.Quality
import java.io.Serializable

data class VideoInfo(
	var id: Int = 0,
	var title: String,
	var url: String,
	var urlLowestQuality: String? = null,
	var urlHighestQuality: String? = null,
	var subtitle: String? = null,
	var subtitleUrl: String? = null,
	var filePath: String? = null,
	var hasDuration: Boolean = false,
	@DrawableRes var artworkVectorDrawableResId: Int = 0
) : Serializable {

	companion object {

		@JvmStatic
		fun fromShow(persistedShow: PersistedMediathekShow): VideoInfo {
			val show = persistedShow.mediathekShow

			return VideoInfo(
				title = show.title,
				url = show.videoUrl
			).apply {
				id = persistedShow.id
				urlHighestQuality = show.getVideoUrl(Quality.High)
				urlLowestQuality = show.getVideoUrl(Quality.Low)
				filePath = persistedShow.downloadedVideoPath
				subtitle = show.topic
				subtitleUrl = show.subtitleUrl
				hasDuration = true
			}
		}

		@JvmStatic
		fun fromChannel(channel: ChannelModel): VideoInfo {
			return VideoInfo(
				title = channel.name,
				url = channel.streamUrl
			).apply {
				url = channel.streamUrl
				hasDuration = false
				artworkVectorDrawableResId = channel.drawableId
			}
		}

	}

	val hasSubtitles: Boolean
		// no subtitle support for downloaded videos yet
		get() = !TextUtils.isEmpty(subtitleUrl) && !isOfflineVideo

	val isOfflineVideo: Boolean
		get() = filePath != null

	val hasArtwork: Boolean
		get() = artworkVectorDrawableResId != 0

	fun getPlaybackUrlOrFilePath(quality: StreamQualityBucket): String {
		return if (isOfflineVideo) {
			filePath!!
		} else when (quality) {
			StreamQualityBucket.MEDIUM -> url
			StreamQualityBucket.HIGHEST -> urlHighestQuality ?: url
			else -> urlLowestQuality ?: url
		}
	}
}
package de.christinecoenen.code.zapp.app.search.suggestions.text

import android.view.LayoutInflater
import android.


_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("column_name", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.OP, new org.apache.thrift.meta_data.FieldMetaData("op", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, IndexOperator.class)));
    tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IndexExpression.class, metaDataMap);
  }

  public IndexExpression() {
  }

  public IndexExpression(
    java.nio.ByteBuffer column_name,
    IndexOperator op,
    java.nio.ByteBuffer value)
  {
    this();
    this.column_name = org.apache.thrift.TBaseHelper.copyBinary(column_name);
    this.op = op;
    this.value = org.apache.thrift.TBaseHelper.copyBinary(value);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public IndexExpression(IndexExpression other) {
    if (other.isSetColumn_name()) {
      this.column_name = org.apache.thrift.TBaseHelper.copyBinary(other.column_name);
    }
    if (other.isSetOp()) {
      this.op = other.op;
    }
    if (other.isSetValue()) {
      this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
    }
  }

  public IndexExpression deepCopy() {
    return new IndexExpression(this);
  }

  @Override
  public void clear() {
    this.column_name = null;
    this.op = null;
    this.value = null;
  }

  public byte[] getColumn_name() {
    setColumn_name(org.apache.thrift.TBaseHelper.rightSize(column_name));
    return column_name == null ? null : column_name.array();
  }

  public java.nio.ByteBuffer bufferForColumn_name() {
    return org.apache.thrift.TBaseHelper.copyBinary(column_name);
  }

  public IndexExpression setColumn_name(byte[] column_name) {
    this.column_name = column_name == null ? (java.nio.ByteBuffer)null   : java.nio.ByteBuffer.wrap(column_name.clone());
    return this;
  }

  public IndexExpression setColumn_name(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer column_name) {
    this.column_name = org.apache.thrift.TBaseHelper.copyBinary(column_name);
    return this;
  }

  public void unsetColumn_name() {
    this.column_name = null;
  }

  /** Returns true if field column_name is set (has been assigned a value) and false otherwise */
  public boolean isSetColumn_name() {
    return this.column_name != null;
  }

  public void setColumn_nameIsSet(boolean value) {
    if (!value) {
      this.column_name = null;
    }
  }

  /**
   *
   * @see IndexOperator
   */
  @org.apache.thrift.annotation.Nullable
  public IndexOperator getOp() {
    return


Y(MotionEvent ev, int activePointerId) {
        final int index = MotionEventCompat.findPointerIndex(ev,
                activePointerId);
        if (index < 0) {
            return -1;
        }
        return MotionEventCompat.getY(ev, index);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        final int action = MotionEventCompat.getActionMasked(ev);

        if (mReturningToStart && action == MotionEvent.ACTION_DOWN) {
            mReturningToStart = false;
        }
        if (!isEnabled() || mReturningToStart || !isChildScrollToTop()) {
            // 如果子View可以滑动，不拦截事件，交给子View处理
            return false;
        }

        return handlerPullTouchEvent(ev, action);
    }

    private boolean handlerPullTouchEvent(MotionEvent ev, int action) {
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
                mIsBeingDragged = false;
                break;

            case MotionEvent.ACTION_MOVE: {
                final int pointerIndex = MotionEventCompat.findPointerIndex(ev,
                        mActivePointerId);
                if (pointerIndex < 0) {
                    return false;
                }

                final float y = MotionEventCompat.getY(ev, pointerIndex);
                final float overscrollTop = (y - mInitialMotionY) * DRAG_RATE;
                if (mIsBeingDragged) {
                    float originalDragPercent = overscrollTop / mTotalDragDistance;
                    if (originalDragPercent < 0) {
                        return false;
                    }
                    float dragPercent = Math.min(1f, Math.abs(originalDragPercent));
                    float extraOS = Math.abs(overscrollTop) - mTotalDragDistance;
                    float slingshotDist = mSpinnerFinalOffset;
                    float tensionSlingshotPercent = Math.max(0,
                            Math.min(extraOS, slingshotDist * 2) / slingshotDist);
                    float tensionPercent = (float) ((tensionSlingshotPercent / 4) - Math.pow((tensionSlingshotPercent / 4), 2)) * 2f;
                    float extraMove = (slingshotDist) * tensionPercent * 2;

                    int targetY = mOriginalOffsetTop + (int) ((slingshotDist * dragPercent) + extraMove);
                    if (overscrollTop < mTotalDragDistance) {
                        if (mListener != null) {
                            mListener.onPullEnable(false);
                        }
                    } else {
                        if (mListener != null) {
                            mListener.onPullEnable(true);
                        }
                    }
                    setTargetOffsetTopAndBottom(targetY - mCurrentTargetOffsetTop, true);
                }
                break;
            }
            case MotionEventCompat.ACTION_POINTER_DOWN: {
                final int index = MotionEventCompat.getActionIndex(ev);
                mActivePointerId = MotionEventCompat.getPointerId(ev, index);
                break;
            }

            case MotionEventCompat.ACTION_POINTER_UP:
                onSecondaryPointerUp(ev);
                break;

            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL: {
                if (mActivePointerId == INVALID_POINTER) {
                    return false;
                }
                final int pointerIndex = MotionEventCompat.findPointerIndex(ev,
                        mActivePointerId);
                final float y = MotionEventCompat.getY(ev, pointerIndex);
                final float overscrollTop = (y - mInitialMotionY) * DRAG_RATE;
                mIsBeingDragged = false;
                if (overscrollTop > mTotalDragDistance) {
                    setRefreshing(true, true /* notify */);
                } else {
                    mRefreshing = false;
                    AnimationListener listener = null;
                    animateOffsetToStartPosition(m


   assert_equal([9, 9, 4, 5, 6, 7, 8, 9, 9, 9], out)

def test_uniform_filter1d_roundoff_errors():
    # gh-6930
    in_ = numpy.repeat([0, 1, 0], [9, 9, 9])
    for filter_size in range(3, 10):
        out = ndimage.uniform_filter1d(in_, filter_size)
        assert_equal(out.sum(), 10 - filter_size)

def test_footprint_all_zeros():
    # regression test for gh-6876: footprint of all zeros segfaults
    arr = numpy.random.randint(0, 100, (100, 100))
    kernel = numpy.zeros((3, 3), bool)
    with assert_raises(ValueError):
        ndimage.maximum_filter(arr, footprint=kernel)

def test_gaussian_filter():
    # Test gaussian filter with numpy.float16
    # gh-8207
    data = numpy.array([1], dtype=numpy.float16)
    sigma = 1.0
    with assert_raises(RuntimeError):
        ndimage.gaussian_filter(data, sigma)

def test_rank_filter_noninteger_rank():
    # regression test for issue 9388: ValueError for
    # non integer rank when performing rank_filter
    arr = numpy.random.random((10, 20, 30))
    assert_raises(TypeError, rank_filter, arr, 0.5,
                  footprint=numpy.ones((1, 1, 10), dtype=bool))

def test_size_footprint_both_set():
    # test for input validation, expect user warning when
    # size and footprint is set
    with suppress_warnings() as sup:
        sup.filter(UserWarning,
                   "ignoring size because footprint is set")
        arr = numpy.random.random((10, 20, 30))
        rank_filter(arr, 5, size=2, footprint=numpy.ones((1, 1, 10),
                    dtype=bool))

def test_byte_order_median():
    """Regression test for #413: median_filter does not handle bytes orders."""
    a = numpy.arange(9, dtype='<f4').reshape(3, 3)
    ref = ndimage.filters.median_filter(a, (3, 3))
    b = numpy.arange(9, dtype='>f4').reshape(3, 3)
    t = ndimage.filters.median_filter(b, (3, 3))
    assert_array_almost_equal(ref, t)


c char	*putspice_err[] = {
	"ZPUTGLLSPICE: Success",				/*  0  */
	"ZPUTGLLSPICE: Unrecognizable Project Id",		/* -1  */
	"ZPUTGLLSPICE: Error Opening Kernel File",		/* -2  */
	"ZPUTGLLSPICE: Cannot Update NAIF KERNEL",		/* -3  */
        "ZPUTGLLSPICE: Error Packing Seg. Descrptr",		/* -4  */
        "ZPUTGLLSPICE: Error Starting New Array", 		/* -5  */
        "ZPUTGLLSPICE: Error Adding New Array",			/* -6  */
        "ZPUTGLLSPICE: Daf-file Not Close Properly",            /* -7  */
	"ZPUTGLLSPICE: Bad User Input Data",			/* -8  */
	 NULL
	};
/*--------------------------------
 | Return codes for spice95()    |
 ---------------------------------
*/
static char     *spice95_err[] = {
        "SPICE95::Success",                                             /* 0    */
        "SPICE95::Please Check User Input",                             /* -1   */
        "SPICE95::Invalid User's Kernel Id",                            /* -2   */
        "SPICE95::buf2scet() Failed:Invalid SCET Data",                 /* -3   */
        "SPICE95::zutc2et() Failed:Invalid SCET Data",                  /* -4   */
        "SPICE95::zsctik() Failed:Invalid SCLK Tolerance",              /* -5   */
        "SPICE95::GetIds95() Failed:Unknown SC instrument",             /* -6   */
        "SPICE95::zpbid() Failed: Unknown Target",                      /* -7   */
        "SPICE95::zbodvar() Failed:Invalid Radii Returned",             /* -8   */
        "SPICE95::Cmatrix95() Failed:Invalid C Matrix Returned",        /* -9   */
        "SPICE95::LoadSpk95() Failed:Cannot Load SPK Files",            /* -10  */
        "SPICE95::zspkssb() Failed:Error Getting SC Pos Vel Vector",    /* -11  */
        "SPICE95::zspkssb() Failed:Cannot Get Target Pos Vel Vector",   /* -12  */
        "SPICE95::zspkssb() Failed:Cannot Get Center Pos Vel Vector",   /* -13  */
        "SPICE95::zspkapp() Failed:Cannot Get SC Relative Position",    /* -14  */
        "SPICE95::zspkapp() Failed:Cannot Get Target Reltv Pstn",       /* -15  */
        "SPICE95::zspkapp() Failed:Cannot Get Sun Reltv Pstn",          /* -16  */
        "SPICE95::zbodeul() Failed:Cannot Get Euler Angle",             /* -17  */
	"SPICE95::zeul2m() Failed:Bad ME-MATRIX Returned",		/* -18	*/
	"SPICE95::zmxmt() Failed:Bad OM-MATRIX Returned",		/* -19	*/
	"SPICE95::zminus() Failed:Bad Target2Sc State returned",	/* -20	*/
	"SPICE95::zreclat() Failed:Bad TCB Lon & Lat",			/* -21	*/
	"SPICE95::zgetcamcon() Failed:Bad Camera Constant",		/* -22	*/
	"SPICE95::zcorcav() Failed:Abnormal Return Status(99, -1)",	/* -24	*/
	"SPICE95::zvadd() Failed:Error Adding Matrix",			/* -25	*/
	"SPICE95::zmxv() Failed:Error Multiplying Matrix",		/* -26	*/
	"SPICE95::zreclat(): Error Getting TSB Lat & Lon",		/* -27	*/
	NULL
	};


是 $s$ 和 $a$ 的一个很长的序列。也许就向它输入一个 $s$ 和 $a$ 的对，它会输出一个实数。把整个 $\tau$ 会得到的实数加起来就得到 $R(\tau)$。在训练的时候，对于 $\left\{\hat{\tau}_{1}, \hat{\tau}_{2}, \cdots, \hat{\tau}_{N}\right\}$，我们希望它输出的 $R$ 值越大越好。对于 $\left\{\tau_{1}, \tau_{2}, \cdots, \tau_{N}\right\}$，我们就希望 $R$ 值越小越好。

什么可以被称为一个最好的奖励函数呢？最后我们学习出来的奖励函数应该是专家和演员在这个奖励函数上都会得到一样高的分数。最终的奖励函数无法分辨出谁应该会得到比较高的分数。通常在训练的时候，我们会迭代地去做。最早的逆强化学习对奖励函数有些限制，它是假设奖励函数是线性的（linear） 。如果奖励函数是线性，我们可以证明这个算法会收敛（converge）。但是如果奖励函数不是线性的，我们就无法证明它会收敛。

其实我们只要把逆强化学习中的演员看成生成器，把奖励函数看成判别器，它就是 生成对抗网络。所以逆强化学习会不会收敛就等于 生成对抗网络 会不会收敛。如果我们已经实现过，就会知道逆强化学习不一定会收敛。但除非我们对 $R$ 执行一个非常严格的限制，否则如果 $R$ 是一个一般的网络，我们就会有很大的麻烦。

图 11.7 逆强化学习的框架

我们可以把逆强化学习与 生成对抗网络 详细地比较一下。如图 11.8 所示，在生成对抗网络 里面，我们有一系列很好的图、一个生成器和一个判别器。一开始，生成器不知道要产生什么样的图，它就会乱画。判别器的工作就是给画的图打分，专家画的图得高分，生成器画的图得低分。生成器会想办法去骗过判别器，生成器希望判别器也给它画的图打高分。整个过程与逆强化学习是一模一样的。专家画的图就是专家的示范。生成器就是


-- Global variables.
vim.g.projects_dir = vim.env.HOME .. '/Code'
vim.g.work_projects_dir = '/Volumes/git'

-- Set my colorscheme.
vim.cmd.colorscheme 'miss-dracula'

-- Install Lazy.
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.uv.fs_stat(lazypath) then
    vim.fn.system {
        'git',
        'clone',
        '--filter=blob:none',
        'https://github.com/folke/lazy.nvim.git',
        '--branch=stable',
        lazypath,
    }
end
vim.opt.rtp = vim.opt.rtp ^ lazypath

---@type LazySpec
local plugins = 'plugins'

-- General setup and goodies (order matters here).
require 'settings'
require 'keymaps'
require 'commands'
require 'autocmds'
require 'statusline'
require 'winbar'
require 'marks'
require 'lsp'

-- Configure plugins.
require('lazy').setup(p


// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System.Diagnostics.Contracts;
using System.Net.Http.Headers;

namespace System.Net.Http.Formatting
{
    internal class ParsedMediaTypeHeaderValue
    {
        private const string MediaRangeAsterisk = "*";
        private const char MediaTypeSubtypeDelimiter = '/';

        private string _type;
        private string _subType;
        private bool? _isAllMediaRange;
        private bool? _isSubtypeMediaRange;

        public ParsedMediaTypeHeaderValue(MediaTypeHeaderValue mediaType)
        {
            Contract.Assert(mediaType != null, "The 'mediaType' parameter should not be null.");

            string[] splitMediaType = mediaType.MediaType.Split(MediaTypeSubtypeDelimiter);

            Contract.Assert(splitMediaType.Length == 2, "The constructor of the MediaTypeHeaderValue would have failed if there wasn't a type and subtype.")


);
        }

        CPPUNIT_ASSERT_NO_THROW(leafIter->validateOffsets());

        // manually modify offsets so one of the points is marked as inactive

        std::vector<ValueType> offsets, modifiedOffsets;
        offsets.resize(PointDataTree::LeafNodeType::SIZE);
        modifiedOffsets.resize(PointDataTree::LeafNodeType::SIZE);

        for (Index n = 0; n < PointDataTree::LeafNodeType::NUM_VALUES; n++) {
            const unsigned offset = leafIter->getValue(n);
            offsets[n] = offset;
            modifiedOffsets[n] = offset > 0 ? offset - 1 : offset;
        }

        leafIter->setOffsets(modifiedOffsets);

        // confirm that validation fails

        CPPUNIT_ASSERT_THROW(leafIter->validateOffsets(), openvdb::ValueError);

        // replace offsets with original offsets but leave value mask

        leafIter->setOffsets(offsets, /*updateValueMask=*/ false);

        // confirm that validation now succeeds

        CPPUNIT_ASSERT_NO_THROW(leafIter->validateOffsets());

        // ensure active / inactive point counts are correct

        CPPUNIT_ASSERT_EQUAL(pointCount(tree, GroupFilter("test", firstAttributeSet)), Index64(2));
        CPPUNIT_ASSERT_EQUAL(leafIter->groupPointCount("test"), Index64(2));
        CPPUNIT_ASSERT_EQUAL(pointCount(tree, BinaryFilter<GroupFilter, ActiveFilter>(
            firstGroupFilter, ActiveFilter())), Index64(1));
        CPPUNIT_ASSERT_EQUAL(pointCount(tree, BinaryFilter<GroupFilter, InactiveFilter>(
            firstGroupFilter, InactiveFilter())), Index64(1));

        CPPUNIT_ASSERT_EQUAL(pointCount(tree), Index64(4));
        CPPUNIT_ASSERT_EQUAL(pointCount(tree, ActiveFilter()), Index64(3));
        CPPUNIT_ASSERT_EQUAL(pointCount(tree, InactiveFilter()), Index64(1));

        // write out grid to a temp file
        {
            filename = tempDir + "/openvdb_test_point_load";

            io::File fileOut(filename);

            GridCPtrVec grids{grid};

            fileOut.write(grids);
        }

        // test point count of a delay-loaded grid
        {
            io::File fileIn(filename);
            fileIn.open();

            GridPtrVecPtr grids = fileIn.getGrids();

            fileIn.close();

            CPPUNIT_ASSERT_EQUAL(grids->size(), size_t(1));

            PointDataGrid::Ptr inputGrid = GridBase::grid<PointDataGrid>((*grids)[0]);

            CPPUNIT_ASSERT(inputGrid);

            PointDataTree& inputTree = inputGrid->tree();
            const auto& attributeSet = inputTree.cbeginLeaf()->attributeSet();

            GroupFilter groupFilter("test", attributeSet);

            bool inCoreOnly = true;

            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, NullFilter(), inCoreOnly), Index64(0));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, ActiveFilter(), inCoreOnly), Index64(0));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, InactiveFilter(), inCoreOnly), Index64(0));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, groupFilter, inCoreOnly), Index64(0));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, BinaryFilter<GroupFilter, ActiveFilter>(
                groupFilter, ActiveFilter()), inCoreOnly), Index64(0));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, BinaryFilter<GroupFilter, InactiveFilter>(
                groupFilter, InactiveFilter()), inCoreOnly), Index64(0));

            inCoreOnly = false;

            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, NullFilter(), inCoreOnly), Index64(4));
            CPPUNIT_ASSERT_EQUAL(pointCount(inputTree, ActiveFilter(), inCoreOnly), Index64(3));
            CPPUNIT_ASSERT_EQUAL(point


    checkAll(
      Arb.nonEmptyList(Arb.int()),
    ) { a ->
      val result = a.extract()
      val expected = a.head
      result shouldBe expected
    }
  }

  @Test
  fun plus() = runTest {
    checkAll(
      Arb.nonEmptyList(Arb.int()),
      Arb.int(),
    ) { a, b ->
      val result = a + b
      val expected = a.all + b
      result shouldBe expected
    }
  }

  @Test
  fun coflatMapKeepsLength() = runTest {
    checkAll(
      Arb.nonEmptyList(Arb.int()),
    ) { a ->
      val result = a.coflatMap { it.all }
      val expected = a.all
      result.size shouldBe expected.size
    }
  }

  @Test
  fun foldLeftAddition() = runTest {
    checkAll(
      Arb.nonEmptyList(Arb.int()),
      Arb.int(),
    ) { list, initial ->
      val result = list.foldLeft(initial) { acc, i -> acc + i }
      val expected = initial + list.all.sum()
      result shouldBe expected
    }
  }

  @Test
  fun hashCodeConsistent() = runTest {
    checkAll(Arb.nonEmptyList(Arb.int(), range = 0..10)) { a ->
      buildSet {
        repeat(3) {
          add(a.hashCode())
        }
      }.size shouldBe 1
    }
  }

  @Test
  fun toList() = runTest {
    checkAll(Arb.list(Arb.int(), range = 0..20)) { a ->
      a.toNonEmptyListOrNull()
        ?.toList()
        ?.shouldBe(a)
    }
  }

  @Test
  fun distinct() = runTest {
    val ex = listOf(1, 2, 3, 4, 5).exhaustive()
    checkAll(Arb.list(ex, range = 0..20)) { a ->
      val expected = a.distinct()

      a.toNonEmptyListOrNull()
        ?.distinct()
        ?.shouldBe(expected)
    }
  }

  @Test
  fun distinctBy() = runTest {
    val ex = listOf(1, 2, 3, 4, 5).exhaustive()
    fun selector(i: Int) = i % 2 == 0

    checkAll(Arb.list(ex, range = 0..20)) { a ->
      val expected = a.distinctBy(::selector)

      a.toNonEmptyListOrNull()
        ?.distinctBy(::selector)
        ?.shouldBe(expected)
    }
  }

  @Test
  fun flatMap() = runTest {
    fun transform(i: Int) = listOf(i) + 1

    checkAll(Arb.list(Arb.int(), range = 0..20)) { a ->
      val expected = a.flatMap(::transform)

      a.toNonEmptyListOrNull()
        ?.flatMap {
          transform(it).let(::NonEmptyList)
        }
        ?.shouldBe(expected)
    }
  }

  @Test
  fun plusIterable() = runTest {
    checkAll(
      Arb.list(Arb.int(), range = 0..10),
      Arb.list(Arb.int(), range = 0..10),
    ) { a, b ->
      a.toNonEmptyListOrNull()
        ?.also {
          it + b shouldBe (a + b)
        }
    }
  }

  @Test
  fun toStringContainsNelValues() = runTest {
    checkAll(20, Arb.set(Arb.int(0..9), 0..10)) { a ->
      a.toNonEmptyListOrNull().toString().let { s ->
        a.forEach {
          s shouldContainOnlyOnce it.toString()
        }
      }
    }
  }


    #[inline(always)]
    pub fn ahbbrst_0(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_0)
    }
    #[doc = "INCR4 burst, then single transfer"]
    #[inline(always)]
    pub fn ahbbrst_1(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_1)
    }
    #[doc = "INCR8 burst, INCR4 burst, then single transfer"]
    #[inline(always)]
    pub fn ahbbrst_2(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_2)
    }
    #[doc = "INCR16 burst, INCR8 burst, INCR4 burst, then single transfer"]
    #[inline(always)]
    pub fn ahbbrst_3(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_3)
    }
    #[doc = "INCR4 burst, then incremental burst of unspecified length"]
    #[inline(always)]
    pub fn ahbbrst_5(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_5)
    }
    #[doc = "INCR8 burst, INCR4 burst, then incremental burst of unspecified length"]
    #[inline(always)]
    pub fn ahbbrst_6(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_6)
    }
    #[doc = "INCR16 burst, INCR8 burst, INCR4 burst, then incremental burst of unspecified length"]
    #[inline(always)]
    pub fn ahbbrst_7(self) -> &'a mut W {
        self.variant(AHBBRST_A::AHBBRST_7)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:2 - AHB master interface Burst configuration These bits control AHB master transfer type sequence (or priority)"]
    #[inline(always)]
    pub fn ahbbrst(&self) -> AHBBRST_R {
        AHBBRST_R::new((self.bits & 0x07) as u8)
    }
}
impl W {
    #[doc = "Bits 0:2 - AHB master interface Burst configuration These bits control AHB master transfer type sequence (or priority)"]
    #[inline(always)]
    pub fn ahbbrst(&mut self) -> AHBBRST_W {
        AHBBRST_W { w: self }
    }
}
/*
 * // Copyright 2021 BlockPuppets.
 * //
 * // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 * // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 * // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
 * // option. This file may not be copied, modified, or distributed
 * // except according to those terms.
 */

use std::fmt;

use crate::Uint64;
use anyhow::{anyhow, Result};
use std::any::Any;

/// An `trait` is used to define mosaicIds and namespaceIds
#[typetag::serde]
pub trait UnresolvedMosaicId: Send + Sync {
    fn to_uint64(&self) -> U


important}.form-selector input[disabled]+i,.form-selector input[disabled]+span{background-color:#f1f4f8!important;cursor:auto;opacity:.6}.form-selector input[disabled]+i:before{background-color:#fff;opacity:.5!important}nav.navbar-light a.nav-link:not(.active):not(:hover){color:#1c0950}.navbar-light .navbar-nav .nav-item:hover>.nav-link,.navbar-light .navbar-nav .nav-link[aria-expanded=true]{color:#574fec!important}.navbar-dark .navbar-nav .nav-item:hover>.nav-link,.navbar-dark .navbar-nav .nav-link[aria-expanded=true]{color:#fff!important}nav.nav-deep{font-size:.92rem}nav.nav-deep .nav-item .group-icon{font-size:10px;margin-top:3px}nav.nav-deep-dark .nav-item .group-icon{color:#bfc6d7!important}nav.nav-deep-dark-contrast .nav-item .group-icon{color:#fff!important}nav.nav-deep-light .nav-item .group-icon{color:#1c0950!important}nav.nav-deep-light .nav-item>a.nav-link{color:#1c0950}nav.nav-deep-light .nav-item.active>.nav-link,nav.nav-deep-light .nav-item:hover>.nav-link{color:#574fec}nav.nav-deep-light.nav-deep-hover>ul>li.nav-item.active,nav.nav-deep-light.nav-deep-hover>ul>li.nav-item:hover{background-color:rgba(0,0,0,.05)}nav.nav-deep-dark .nav-item>a.nav-link{color:#bfc6d7}nav.nav-deep-dark-contrast .nav-item>a.nav-link,nav.nav-deep-dark .nav-item.active>.nav-link,nav.nav-deep-dark .nav-item:hover>.nav-link{color:#fff}nav.nav-deep-dark .nav-item.active>.nav-link,nav.nav-deep-light .nav-item.active>.nav-link{font-weight:500}nav.nav-deep-dark.nav-deep-hover>ul>li.nav-item.active,nav.nav-deep-dark.nav-deep-hover>ul>li.nav-item:hover{background-color:rgba(0,0,0,.05)}aside nav.nav-deep-indicator-dot ul li .nav-item.active>.nav-link{position:relative}aside nav.nav-deep-dark.nav-deep-indicator-dot ul li .nav-item.active>.nav-link:before,aside nav.nav-deep-light.nav-deep-indicator-dot ul li .nav-item.active>.nav-link:before{background-color:#fff;border-radius:100%;content:"";height:4px;left:0;margin-top:-2px;position:absolute;top:50%;width:4px}aside nav.nav-deep-light.nav-deep-indicator-dot ul li .nav-item.active>.nav-link:before{background-color:#1c0950}.nav-deep-bordered>ul>li{border-bottom:1px solid rgba(0,0,0,.1)}nav.nav-deep>ul>li>a.nav-link>i.nav-icon{float:left;font-size:16px;margin-right:10px;margin-top:-.2rem;text-align:left;width:20px}nav.nav-deep>ul>li>a.nav-link>i:not(.nav-icon),nav.nav-deep>ul ul>li>a.nav-link>i{margin-right:10px}nav.nav-deep>ul>li>a.nav-link>svg{margin-right:10px;margin-top:-4px}.nav-deep ul>li:not(.active)>ul{display:none}.nav-deep>ul ul{display:block}.nav-deep>ul>li>ul{padding-left:30px}.nav-deep>ul>li>ul>li>a>i{margin-left:-27px;margin-r


local T = ...
local usage = 'Usage: issecurevariable([table,] "variable")'
return {
  ['fails with nil table'] = function()
    return T.match(2, false, usage, pcall(T.env.issecurevariable, nil, 'moo'))
  end,
  ['fails with nil variable name'] = function()
    return T.match(2, false, usage, pcall(T.env.issecurevariable, nil))
  end,
  ['global wow apis are secure'] = function()
    return T.match(2, true, nil, T.env.issecurevariable('issecurevariable'))
  end,
  ['local table values are insecure'] = function()
    return T.match(2, false, T.addonName, T.env.issecurevariable(T, 'match'))
  end,
  ['local table values from loadst


,
};
use feather_core::level::{deserialize_level_file, save_level_file, LevelData, LevelGeneratorType};
use feather_core::world::ChunkMap;
use feather_core::{level, ChunkPosition};
use fecs::{EntityBuilder, Executor, Resources, World};
use jemallocator::Jemalloc;
use rand::Rng;
use std::collections::hash_map::DefaultHasher;
use std::fs::File;
use std::hash::{Hash, Hasher};
use std::io::{Read, Write};
use std::path::Path;
use std::process::exit;
use thread_local::CachedThreadLocal;

#[global_allocator]
static ALLOC: Jemalloc = Jemalloc;

mod block;
mod broadcasters;
mod chat;
mod chunk_entities;
pub mod chunk_logic;
pub mod chunk_worker;
pub mod config;
pub mod entity;
pub mod game;
pub mod io;
mod join;
mod lighting;
mod load;
pub mod network;
pub mod p_inventory; // Prefixed to avoid conflict with inventory crate
pub mod packet_buffer;
mod packet_handlers;
pub mod physics;
pub mod player;
mod save;
pub mod shutdown;
mod systems;
mod time;
pub mod util;
mod view;
mod weather;
pub mod worldgen;

pub type BumpVec<'a, T> = bumpalo::collections::Vec<'a, T>;

pub const TPS: u64 = 20;
pub const PROTOCOL_VERSION: u32 = 404;
pub const SERVER_VERSION: &str = "Feather 1.13.2";
pub const TICK_TIME: u64 = 1000 / TPS;

pub fn main() {
    let config = Arc::new(load_config());
    init_log(&config);

    info!("Starting Feather; please wait...");

    let server_icon = Arc::new(load_server_icon());

    let player_count = Arc::new(AtomicU32::new(0));

    let packet_buffers = Arc::new(PacketBuffers::new());

    let io_handle = init_io_manager(
        Arc::clone(&config),
        Arc::clone(&player_count),
        Arc::clone(&server_icon),
        Arc::clone(&packet_buffers),
    );

    let world_name = &config.world.name;
    let world_dir = Path::new(world_name.as_str());
    let level_file = &world_dir.join("level.dat");
    if !world_dir.is_dir() {
        info!(
            "World directory '{}' not found, creating it",
            world_dir.display()
        );
        // Create directory
        std::fs::create_dir(world_dir).unwrap();

        let level = create_level(&config);
        let root = level::Root { data: level };
        let mut level_file = File::create(level_file).unwrap();
        save_level_file(&root, &mut level_file).unwrap();
    }

    info!("Loading {}", level_file.to_str().unwrap());
    let level = load_level(level_file).unwrap_or_else(|e| {
        error!("Error occurred while loading level.dat: {}", e);
        error!("Please ensure that the world directory exists and is not corrupt.");
        exit(1)
    });

    let chunk_worker_handle = init_chunk_worker(world_dir, &level);

    let time = Time(level.time as u64);

    let game = Game {
        io_handle,
        config,
        tick_count: 0,
        player_count,
        level,
        chunk_map: ChunkMap::new(),
        bump: CachedThreadLocal::new(),
        chunk_worker_handle,
        chunk_unload_queue: Default::default(),
        chunk_holders: Default::default(),
        chunks_to_send: Default::default(),
        chunk_entities: Default::default(),
        rng: CachedThreadLocal::new(),
        time,
        save_queue: Default::default(),
        lighting_worker_handle: lighting::start_worker(),
    };

    let (executor, resources) = init_executor(game, packet_buffers);
    let mut world = World::new();

    // Channel used by the shutdown handler to notify the server thread.
    let (shutdown_tx, shutdown_rx) = crossbeam::bounded(1);

    shutdown::init(shutdown_tx);

    info!("


0)+,(a1)+
	subq.l #1,d6
	bne.s .copy_ram
	move.l d3,d6			; size
	bra.s .comload
.from_file:
	SEEK a5,0
	move.l d3,d6			; size
	move.l a4,-(sp)
	move.l d6,-(sp)
	move mov_h,-(sp)
	GEMDOS 63,12
	tst.l d0
	bmi .end
.comload:
	lea 3(a4),a3
	tst.b (a3)+
	beq.s .lb_3
	tst.b mvi_rem
	beq.s .lb_3
	bpl.s .lb_2
	subq.l #1,d6
	subq.l #1,a5
	clr.b -(a6)
	subq.l #1,a3
	bra.s .lb_3
.lb_2:
	addq.l #1,d6
	addq.l #1,a5
	addq.l #1,a3
	move.b -1(a6),(a6)+
	clr.b (a6)
.lb_3:
	subq.l #5,d6
	sub.l d6,d7
	bsr treat_sound
	subq.l #3,a3
	move.l (a3),d0
	clr.b d0
	INTEL d0
	add.l d3,a5
	add.l d0,a5				; next position
	subq.l #2,a5
	tst.b mvi_flag
	beq.s .lb_1
	sf mvi_flag
	move.l mvi_next_size,d3
.lb_1:
	cmp.l d3,d7
	bpl .lb_0
	bra.s .common
.lb0:
	SEEK (a5)+,0			; to the good position
	move.l (a5)+,d6
	move.l a3,d0
	add.l ima4_offs,d0	; 0 if uncompressed
	move.l d0,-(sp)		; into the temporary buffer
	move.l d6,-(sp)
	move mov_h,-(sp)
	GEMDOS 63,12
	tst.l d0
	bmi.s .end				; an error
	bsr.s treat_sound		; copies temp into the real buffer, updates a6
								; or (step mode) saves it into file!
	move.l _reference,d0
	subq.l #1,d7
	sub.l d7,d0
	bsr.l update_loading_sound
	tst.l d7
	bne.s .lb0
.common:
	tst.b step_mode
	bne.s .just_save2
	move.l a6,d0
	bclr #0,d0
	move.l d0,a6			; turns A6 into an even address
	moveq #0,d0
	tst.b ttram_sound
	beq.s .lb1
	move.l a6,snd_tt_end
	sub.l s_buffer_2,a6
	move.l a6,ttram_size
	move.l a6,d0
	move.l snd_end,a6	; *
	bra.s .lb2
.lb1:
	move.l a6,snd_end
.lb2:						; *
	sub.l s_buffer,a6
	move.l a6,stram_size
	add.l a6,d0
; .lb2:					; *
	move.l d0,snd_size
.just_save2:
	movem.l d2-d7/a2-a6,-(sp)
	moveq #1,d6
	moveq #-1,d7
	bsr manage_tree
	movem.l (sp)+,d2-d7/a2-a6
	st playing				; ok for playing the sound!
.end:
	rts

; converting 8 bytes into 9 bytes is equal to converting
; 11025 Hz


uyên tròn","decimal":"Kiểu số (1, 2, 3 ...)","decimalLeadingZero":"Kiểu số (01, 02, 03...)","disc":"Hình đĩa","georgian":"Số theo kiểu Georgian (an, ban, gan...)","lowerAlpha":"Kiểu abc thường (a, b, c, d, e...)","lowerGreek":"Kiểu Hy Lạp (alpha, beta, gamma...)","lowerRoman":"Số La Mã kiểu thường (i, ii, iii, iv, v...)","none":"Không gì cả","notset":"<không thiết lập>","numberedTitle":"Thuộc tính danh sách có thứ tự","square":"Hình vuông","start":"Bắt đầu","type":"Kiểu loại","upperAlpha":"Kiểu ABC HOA (A, B, C, D, E...)","upperRoman":"Số La Mã kiểu HOA (I, II, III, IV, V...)","validateStartNumber":"Số bắt đầu danh sách phải là một số nguyên."},"magicline":{"title":"Chèn đoạn vào đây"},"maximize":{"maximize":"Phóng to tối đa","minimize":"Thu nhỏ"},"newpage":{"toolbar":"Trang mới"},"pagebreak":{"alt":"Ngắt trang","toolbar":"Chèn ngắt trang"},"pastetext":{"button":"Dán theo định dạng văn bản thuần","pasteNotification":"Press %1 to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.","title":"Dán theo định dạng văn bản thuần"},"pastefromword":{"confirmCleanup":"Văn bản bạn muốn dán có kèm định dạng của Word. Bạn có muốn loại bỏ định dạng Word trước khi dán?","error":"Không thể để làm sạch các dữ liệu dán do một lỗi nội bộ","title":"Dán với định dạng Word","toolbar":"Dán với định dạng Word"},"preview":{"preview":"Xem trước"},"print":{"toolbar":"In"},"removeformat":{"toolbar":"Xoá định dạng"},"save":{"toolbar":"Lưu"},"selectall":{"toolbar":"Chọn tất cả"},"showblocks":{"toolbar":"Hiển thị các khối"},"sourcearea":{"toolbar":"Mã HTML"},"specialchar":{"options":"Tùy chọn các ký tự đặc biệt","title":"Hãy chọn ký tự đặc biệt","toolbar":"Chèn ký tự đặc biệt"},"scayt":{"btn_about":"Thông tin về SCAYT","btn_dictionaries":"Từ điển","btn_disable":"Tắt SCAYT","btn_enable":"Bật SCAYT","btn_langs":"Ngôn ngữ","btn_options":"Tùy chọn","text_title":"Kiểm tra chính tả ngay khi gõ chữ (SCAYT)"},"stylescombo":{"label":"Kiểu","panelTitle":"Phong cách định dạng","panelTitle1":"Kiểu khối","panelTitle2":"Kiểu trực tiếp","panelTitle3":"Kiểu đối tượng"},"table":{"border":"Kích thước đường viền","caption":"Đầu đề","cell":{"menu":"Ô","insertBefore":"Chèn ô Phía trước","insertAfter


oogle.gson.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;

import com.facebook.ads.sdk.APIException.MalformedResponseException;

/**
 * This class is auto-generated.
 *
 * For any issues or feature requests related to this class, please let us know
 * on github and we'll fix in our codegen framework. We'll not be able to accept
 * pull request for this class.
 *
 */
public class AdCreativeFeatureDetails extends APINode {
  @SerializedName("customizations")
  private AdCreativeFeatureCustomizations mCustomizations = null;
  @SerializedName("enroll_status")
  private String mEnrollStatus = null;
  protected static Gson gson = null;

  public AdCreativeFeatureDetails() {
  }

  public String getId() {
    return null;
  }
  public static AdCreativeFeatureDetails loadJSON(String json, APIContext context, String header) {
    AdCreativeFeatureDetails adCreativeFeatureDetails = getGson().fromJson(json, AdCreativeFeatureDetails.class);
    if (context.isDebug()) {
      JsonParser parser = new JsonParser();
      JsonElement o1 = parser.parse(json);
      JsonElement o2 = parser.parse(adCreativeFeatureDetails.toString());
      if (o1.getAsJsonObject().get("__fb_trace_id__") != null) {
        o2.getAsJsonObject().add("__fb_trace_id__", o1.getAsJsonObject().get("__fb_trace_id__"));
      }
      if (!o1.equals(o2)) {
        context.log("[Warning] When parsing response, object is not consistent with JSON:");
        context.log("[JSON]" + o1);
        context.log("[Object]" + o2);
      }
    }
    adCreativeFeatureDetails.context = context;
    adCreativeFeatureDetails.rawValue = json;
    adCreativeFeatureDetails.header = header;
    return adCreativeFeatureDetails;
  }

  public static APINodeList<AdCreativeFeatureDetails> parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
    APINodeList<AdCreativeFeatureDetails> adCreativeFeatureDetailss = new APINodeList<AdCreativeFeatureDetails>(request, json, header);
    JsonArray arr;
    JsonObject obj;
    JsonParser parser = new JsonParser();
    Exception exception = null;
    try{
      JsonElement result = parser.parse(json);
      if (result.isJsonArray()) {
        // First, check if it's a pure JSON Array
        arr = result.getAsJsonArray();
        for (int i = 0; i < arr.size(); i++) {
          adCreativeFeatureDetailss.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
        };
        return adCreativeFeatureDetailss;
      } else if (result.isJsonObject()) {
        obj = result.getAsJsonObject();
        if (obj.has("data")) {
          if (obj.has("paging")) {
            JsonObject paging = obj.get("paging").getAsJsonObject();
            if (paging.has("cursors")) {
                JsonObject cursors = paging.get("cursors").getAsJsonObject();
                String before = cursors.has("before") ? cursors.get("before").getAsString() : null;
                String after = cursors.has("after") ? cursors.get("after").getAsString() : null;
                adCreativeFeatureDetailss.setCursors(before, after);
            }
            String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
            String next = paging.has("next") ? paging.get("next").getAsString() : null;
            adCreativeFeatureDetailss.setPaging(previous, next);
            if (context.hasAppSecret()) {