<cmp::Ordering> {
        let value: &T = &self;
        return cmp::PartialOrd::partial_cmp(value, &other);
    }
}
impl<T> cmp::Ord for FeShareable<T>
where
    T: fmt::Debug + cmp::Ord,
{
    fn cmp(&self, other: &Self) -> cmp::Ordering {
        let value: &T = &self;
        return cmp::Ord::cmp(value, &other);
    }
}
impl<T> hash::Hash for FeShareable<T>
where
    T: fmt::Debug + hash::Hash,
{
    fn hash<H: hash::Hasher>(&self, state: &mut H) {
        let value: &T = &self;
        return value.hash(state);
    }
}

pub trait ShareSub {
    fn on_share(&self);
}
impl<T> ShareSub for FeShareable<T>
where
    T: fmt::Debug + ShareSub,
{
    fn on_share(&self) {
        let value: &T = &self;
        value.on_share();
    }
}

#[derive(Debug)]
enum FeMutFieldValue<T: fmt::Debug> {
    Mut(T),
    Immut(FeShareable<T>),
}

#[derive(Debug)]
pub struct FeMutField<T: fmt::Debug> {
    value: FeMutFieldValue<T>,
}
impl<T: fmt::Debug> FeMutField<T> {
    pub fn new(value: T) -> Self {
        return Self {
            value: FeMutFieldValue::Mut(value),
        };
    }

    pub fn try_mutable(self) -> Result<T, Self> {
        return match self.value {
            FeMutFieldValue::Mut(value) => Ok(value),
            FeMutFieldValue::Immut(value) => match value.try_mutable() {
                Ok(value) => Ok(value),
                Err(this) => Err(Self::from(this)),
            },
        };
    }

    pub fn take(self) -> T {
        return match self.value {
            FeMutFieldValue::Mut(value) => value,
            FeMutFieldValue::Immut(value) => value.take(),
        };
    }
}
impl<T: fmt::Debug> ops::Deref for FeMutField<T> {
    type Target = T;

    fn deref(&self) -> &T {
        return match &self.value {
            FeMutFieldValue::Mut(value) => value,
            FeMutFieldValue::Immut(value) => value,
        };
    }
}
impl<T: fmt::Debug> ops::DerefMut for FeMutField<T> {
    fn deref_mut(&mut self) -> &mut Self::Target {
        return match &mut self.value {
            FeMutFieldValue::Mut(value) => value,
            _ => panic!("Cannot mutably borrow immutable data!"),
        };
    }
}
impl<T> clone::Clone for FeMutField<T>
where
    T: fmt::Debug + clone::Clone,
{
    fn clone(&self) -> Self {
        let value: &T = &self;
        return Self::new(value.clone());
    }
}
impl<T: fmt::Debug> From<FeShareable<T>> for FeMutField<T> {
    fn from(shareable: FeShareable<T>) -> Self {
        return Self {
            value: FeMutFieldValue::Immut(shareable),
        };
    }
}
<filename>core/src/scope.rs
use proc_macro2::TokenStream;
use quote::quote;

#[derive(Clone, Debug)]
pub struct Scope {
    before: Vec<syn::Stmt>,
    inner: Option<Box<Scope>>,
    after: Vec<syn::Stmt>,
}

impl Scope {
    pub fn empty() -> Self {
        Self {
            before: vec![],
            inner: None,
            after: vec![],
        }
    }

    pub fn new(before: &[syn::Stmt], after: &[syn::Stmt]) -> Self {
        Self {
            before: Vec::from(before),
            inner: None,
            af


, 0);
    replaceRegWith(MRI, Dst, Zero->getOperand(0).getReg());
  };
  return true;
}

bool CombinerHelper::matchRedundantAnd(MachineInstr &MI,
                                       Register &Replacement) {
  // Given
  //
  // %y:_(sN) = G_SOMETHING
  // %x:_(sN) = G_SOMETHING
  // %res:_(sN) = G_AND %x, %y
  //
  // Eliminate the G_AND when it is known that x & y == x or x & y == y.
  //
  // Patterns like this can appear as a result of legalization. E.g.
  //
  // %cmp:_(s32) = G_ICMP intpred(pred), %x(s32), %y
  // %one:_(s32) = G_CONSTANT i32 1
  // %and:_(s32) = G_AND %cmp, %one
  //
  // In this case, G_ICMP only produces a single bit, so x & 1 == x.
  assert(MI.getOpcode() == TargetOpcode::G_AND);
  if (!KB)
    return false;

  Register AndDst = MI.getOperand(0).getReg();
  Register LHS = MI.getOperand(1).getReg();
  Register RHS = MI.getOperand(2).getReg();

  // Check the RHS (maybe a constant) first, and if we have no KnownBits there,
  // we can't do anything. If we do, then it depends on whether we have
  // KnownBits on the LHS.
  KnownBits RHSBits = KB->getKnownBits(RHS);
  if (RHSBits.isUnknown())
    return false;

  KnownBits LHSBits = KB->getKnownBits(LHS);

  // Check that x & Mask == x.
  // x & 1 == x, always
  // x & 0 == x, only if x is also 0
  // Meaning Mask has no effect if every bit is either one in Mask or zero in x.
  //
  // Check if we can replace AndDst with the LHS of the G_AND
  if (canReplaceReg(AndDst, LHS, MRI) &&
      (LHSBits.Zero | RHSBits.One).isAllOnes()) {
    Replacement = LHS;
    return true;
  }

  // Check if we can replace AndDst with the RHS of the G_AND
  if (canReplaceReg(AndDst, RHS, MRI) &&
      (LHSBits.One | RHSBits.Zero).isAllOnes()) {
    Replacement = RHS;
    return true;
  }

  return false;
}

bool CombinerHelper::matchRedundantOr(MachineInstr &MI, Register &Replacement) {
  // Given
  //
  // %y:_(sN) = G_SOMETHING
  // %x:_(sN) = G_SOMETHING
  // %res:_(sN) = G_OR %x, %y
  //
  // Eliminate the G_OR when it is known that x | y == x or x | y == y.
  assert(MI.getOpcode() == TargetOpcode::G_OR);
  if (!KB)
    return false;

  Register OrDst = MI.getOperand(0).getReg();
  Register LHS = MI.getOperand(1).getReg();
  Register RHS = MI.getOperand(2).getReg();

  KnownBits LHSBits = KB->getKnownBits(LHS);
  KnownBits RHSBits = KB->getKnownBits(RHS);

  // Check that x | Mask == x.
  // x | 0 == x, always
  // x | 1 == x, only if x is also 1
  // Meaning Mask has no effect if every bit is either zero in Mask or one in x.
  //
  // Check if we can replace OrDst with the LHS of the G_OR
  if (canReplaceReg(OrDst, LHS, MRI) &&
      (LHSBits.One | RHSBits.Zero).isAllOnes()) {
    Replacement = LHS;
    return true;
  }

  // Check if we can replace OrDst with the RHS of the G_OR
  if (canReplaceReg(OrDst,


 19 45 45.5 18.5 45-18.5 18.5-45-18.5-45.5-45-19zm-.5-192q-53 0-90.5-37.5T0 512t37.5-90.5T128 384t90.5 37.5T256 512t-37.5 90.5T128 640zm.5-192Q102 448 83 467t-19 45.5 19 45 45.5 18.5 45-18.5T192 512t-18.5-45.5-45-18.5zm-.5-192q-53 0-90.5-37.5T0 128t37.5-90.5T128 0t90.5 37.5T256 128t-37.5 90.5T128 256zm512 512q53 0 90.5 37.5T768 896t-37.5 90.5T640 1024t-90.5-37.5T512 896t37.5-90.5T640 768zm-.5 192q26.5 0 45.5-19t19-45.5-19-45-45.5-18.5-45 18.5T576 896t18.5 45.5 45 18.5z"/></svg>';
  static const String brailleb =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="768" height="1024" preserveAspectRatio="xMidYMid meet" viewBox="0 0 768 1024"><path fill="currentColor" d="M640 640q-53 0-90.5-37.5T512 512t37.5-90.5T640 384t90.5 37.5T768 512t-37.5 90.5T640 640zm-.5-192q-26.5 0-45 19T576 512.5t18.5 45T640 576t45.5-18.5T704 512t-19-45.5-45.5-18.5zm.5-192q-53 0-90.5-37.5T512 128t37.5-90.5T640 0t90.5 37.5T768 128t-37.5 90.5T640 256zm-.5-192q-26.5 0-45 19T576 128.5t18.5 45T640 192t45.5-18.5 18.5-45T685 83t-45.5-19zM128 1024q-53 0-90.5-37.5T0 896t37.5-90.5T128 768t90.5 37.5T256 896t-37.5 90.5T128 1024zm.5-192Q102 832 83 851t-19 45.5 18.5 45T128 960t45.5-18.5 18.5-45-18.5-45.5-45-19zm-.5-192q-53 0-90.5-37.5T0 512t37.5-90.5T128 384t90.5 37.5T256 512t-37.5 90.5T128 640zm0-384q-53 0-90.5-37.5T0 128t37.5-90.5T128 0t90.5 37.5T256 128t-37.5 90.5T128 256zm512 512q53 0 90.5 37.5T768 896t-37.5 90.5T640 1024t-90.5-37.5T512 896t37.5-90.5T640 768zm-.5 192q26.5 0 45.5-19t19-45.5-19-45-45.5-18.5-45 18.5T576 896t18.5 45.5 45 18.5z"/></svg>';
  static const String braillec =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="768" height="1024" preserveAspectRatio="xMidYMid meet" viewBox="0 0 768 1024"><path fill="currentColor" d="


 Math.PI * 0.4f + 0.2f, -1.0F * globalDegree, limbSwing, limbSwingAmount);
			walk(right_ankel_joint, 0.75F * chargeSpeed, 1.2F * globalDegree, false, (float) Math.PI * 1.4f + 0.2f, -1.0F * globalDegree, limbSwing, limbSwingAmount);

			walk(left_foot, 0.75F * chargeSpeed, 1F * globalDegree, true, (float) Math.PI * 0.4f + 0.3f, -globalDegree * 1F, limbSwing, limbSwingAmount);
			walk(right_foot, 0.75F * chargeSpeed, 1F * globalDegree, true, (float) Math.PI * 1.4f + 0.3f, -globalDegree * 1F, limbSwing, limbSwingAmount);

			this.walk(neck1, 0.6F * chargeSpeed, globalDegree * 0.1F, false, 0.0f, -globalDegree * 0.1F, limbSwing, limbSwingAmount);
			this.walk(neck2, 0.6F * chargeSpeed, globalDegree * 0.2F, true, 0.1f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);
			this.walk(head, 0.6F * chargeSpeed, globalDegree * 0.1F, true, 0.2f, -globalDegree * 0.1F, limbSwing, limbSwingAmount);

			this.walk(right_arm, 2f * chargeSpeed, 0.05f, true, 0, -0.05f, limbSwing, limbSwingAmount);
			this.walk(left_arm, 2f * chargeSpeed, 0.05f, true, 0, -0.05f, limbSwing, limbSwingAmount);

			this.walk(right_front_arm, 2f * chargeSpeed, 0.125f, false, 0.1f, -0.125f, limbSwing, limbSwingAmount);

			this.walk(left_front_arm, 2f * chargeSpeed, 0.125f, false, 0.1f, -0.125f, limbSwing, limbSwingAmount);

			this.walk(right_hand, 2f * chargeSpeed, 0.125f, true, 0.1f, -0.125f, limbSwing, limbSwingAmount);

			this.walk(left_hand, 2f * chargeSpeed, 0.125f, true, 0.1f, -0.125f, limbSwing, limbSwingAmount);

			this.walk(right_finger1, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(right_finger2, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(right_finger3, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(left_finger1, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(left_finger2, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(left_finger3, 0.6F * chargeSpeed, globalDegree * 0.2F, false, 0.125f, -globalDegree * 0.2F, limbSwing, limbSwingAmount);

			this.walk(spine1, 2F * chargeSpeed, globalDegree * 0.05F, false, 0


HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC");
}
$actions-vertical-spacing: spacing(tight);

@mixin page-layout {
  margin: 0 auto;
  padding: 0;
  max-width: layout-width(primary, max) + layout-width(secondary, max) + layout-width(inner-spacing);

  @include page-content-when-not-fully-condensed {
    padding: 0 spacing(loose);
  }

  @include page-content-when-not-partially-condensed {
    padding: 0 spacing(extra-loose);
  }
}

@mixin page-content-layout {
  margin: spacing(loose) 0;

  @include page-content-when-not-partially-condensed {
  margin-top: spacing(loose);
  }
}

@mixin page-header-layout {
  padding: spacing(loose) spacing(loose) 0;

  @include page-content-when-not-fully-condensed {
    padding-left: 0;
    padding-right: 0;
  }

  @include page-content-when-not-partially-condensed {
    padding-top: spacing(extra-loose);
  }
}

@mixin page-header-has-secondaryactions {
  padding-top: rem(24px);
}

@mixin page-actions-layout {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  margin-top: 2 * $actions-vertical-spacing;

  @include page-content-when-not-fully-condensed {
    margin-top: $actions-vertical-spacing;
  }
}
/**
 * Any CSS included here will be global. The classic template
 * bundles Infima by default. Infima is a CSS framework designed to
 * work well for content-centric websites.
 */

/* You can override the default Infima variables here. */
:root {
  --ifm-color-primary: #00a700;
  --ifm-color-primary-dark: #009600;
  --ifm-color-primary-darker: #008e00;
  --ifm-color-primary-darkest: #007500;
  --ifm-color-primary-light: #00b800;
  --ifm-color-primary-lighter: #00c000;
  --ifm-color-primary-lightest: #00d900;
  --ifm-code-font-size: 95%;
  --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme="dark"] {
  --ifm-color-primary: #20ff00;
  --ifm-color-primary-dark: #1de600;
  --ifm-color-primary-darker: #1bd900;
  --ifm-color-primary-darkest: #16b300;
  --ifm-color-primary-light: #36ff1a;
  --ifm-color-primary-lighter: #41ff26;
  --ifm-color-primary-lightest: #63ff4d;
  --docsearch-highlight-color: #16b300 !important;
  --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}


ecord

  Parameters
  ------------------------------------------------------------------------------
  separator: the separator between serial data words
  numberOfReadings: Default: 256. Maximum of 1024
  lidarliteAddress: Default 0x62. Fill in new address here if changed. See
    operating manual for instructions.
------------------------------------------------------------------------------*/
void LIDARLite::correlationRecordToSerial(char separator, int numberOfReadings, char lidarliteAddress)
{

  // Array to store read values
  byte correlationArray[2];
  // Var to store value of correlation record
  int correlationValue = 0;
  //  Selects memory bank
  write(0x5d,0xc0,lidarliteAddress);
  // Test mode enable
  write(0x40, 0x07,lidarliteAddress);
  for(int i = 0; i<numberOfReadings; i++){
    // Select single byte
    read(0xd2,2,correlationArray,false,lidarliteAddress);
    //  Low byte is the value of the correlation record
    correlationValue = correlationArray[0];
    // if upper byte lsb is set, the value is negative
    if((int)correlationArray[1] == 1){
      correlationValue |= 0xff00;
    }
    Serial.print((int)correlationValue);
    Serial.print(separator);
  }
  // test mode disable
  write(0x40,0x00,lidarliteAddress);
} /* LIDARLite::correlationRecordToSerial */
/*************************************************************************************
    garlic-player: SMIL Player for Digital Signage
    Copyright (C) 2016 Nikolaos Saghiadinos <ns@smil-control.com>
    This file is part of the garlic-player source code

    This program is free software: you can redistribute it and/or  modify
    it under the terms of the GNU Affero General Public License, version 3,
    as published by the Free Software Foundation.

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

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*************************************************************************************/

#include "mainwindow.h"
#include "qdialog.h"
#include "../player-common/debug_infos.h"
#include "../player-common/configdialog.h"

MainWindow::MainWindow(TScreen *screen, LibFacade *lib_facade, PlayerConfiguration *pc)
{
    MyScreen               = screen;
    MyLibFacade            = lib_facade;
    MyPlayerConfiguration  = pc;
    MyRegionsList          = new RegionsList(this);
    MyLauncher.reset(new Launcher());
    MyLauncher.data()->toogleLauncher(MyPlayerConfiguration->hasLauncher());

}

MainWindow::~MainWindow()
{
    delete MyRegionsList; // region must be deleted at last, cause media pointer had to be deleted
}

void MainWindow::init()
{
    connect (this, SIGNAL(statusChanged(QQuickView::Status)), this, SLOT(doStatusChanged(QQuickView::Status)));
    connect(MyLibFacade, SIGNAL(startShowMedia(BaseMedia*)), this, SLOT(startShowMedia(BaseMedia*)));
    connect(MyLibFacade, SIGNAL(stopShowMedia(BaseMedia*)), this, SLOT(stopShowMedia(BaseMedia*)));
    connect(MyLibFacade, SIGNAL(resumeShowMedia(BaseMedia*)), this, SLOT(resumeShowMedia(BaseMedia*)));
    connect(MyLibFacade, SIGNAL(pauseShowMedia(BaseMedia*)), this, SLOT(pauseShowMedia(BaseMedia*)));
    connect(MyLibFacade, SIGNAL(readyForPlaying()), this, SLOT(prepareParsing()));

    connect(MyLibFacade, SIGNAL(rebootOS(QString)), this, SLOT(rebootOS(QString)));
    connect(MyLibFacade, SIGNAL(installSoftware(QString)), this, SLOT(installSoftware(QString)));
    connect(MyLibFacade, SIGNAL(screenshot


算Y轴位置
          final adjustedDanmakuHeight = isMerged ? _danmakuHeight * _calcMergedFontSizeMultiplier(mergeCount) : _danmakuHeight;
          final trackHeight = adjustedDanmakuHeight + _verticalSpacing;
          double newYPosition;

          if (type == 'bottom') {
            // 底部弹幕从底部开始计算，确保不会超出窗口
            newYPosition = newSize.height - (track + 1) * trackHeight - adjustedDanmakuHeight;
          } else if (type == 'top') {
            // 顶部弹幕需要减去字体大小以紧贴顶部
            newYPosition = track * trackHeight + _verticalSpacing - widget.fontSize;
          } else {
            // 滚动弹幕保持原有逻辑
            newYPosition = track * trackHeight + _verticalSpacing;
          }

          // 保存新的Y轴位置
          _danmakuYPositions[key] = newYPosition;

          // 添加到轨道系统中，恢复轨道信息
          _trackDanmaku[type]!.add({
            'content': content,
            'time': time,
            'track': track,
            'isMerged': isMerged,
            'mergeCount': mergeCount,
            'width': info['width'],
          });
        }
      }
    }

    // 触发重绘
    WidgetsBinding.instance.addPostFrameCallback((_) {
      setState(() {
        // 更新后强制刷新
      });
    });
  }

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    // 不再在这里监听大小变化，改为在LayoutBuilder中处理
  }

  // 顶部和底部弹幕的重叠检测
  bool _willOverlap(Map<String, dynamic> existingDanmaku, Map<String, dynamic> newDanmaku, double currentTime) {
    final existingTime = existingDanmaku['time'] as double;
    final newTime = newDanmaku['time'] as double;

    // 应用时间偏移计算显示时间范围
    final existingStartTime = existingTime - widget.timeOffset;
    final existingEndTime = existingStartTime + 5; // 顶部和底部弹幕显示5秒

    final newStartTime = newTime - widget.timeOffset;
    final newEndTime = newStartTime + 5;

    // 增加安全时间间隔，避免弹幕过于接近
    const safetyTime = 0.5; // 0.5秒的安全时间

    // 如果两个弹幕的显示时间有重叠，且间隔小于安全时间，则会发生重叠
    return (newStartTime <= existingEndTime + safetyTime && newEndTime + safetyTime >= existingStartTime);
  }

  // 检查顶部/底部弹幕轨道密度
  bool _isStaticTrackFull(List<Map<String, dynamic>> trackDanmaku, double currentTime) {
    // 只统计当前在屏幕内的弹幕，考虑时间偏移
    final visibleDanmaku = trackDanmaku.where((danmaku) {
      final time = danmaku['time'] as double;
      final adjustedTime = time - widget.timeOffset;
      return currentTime - adjustedTime >= 0 && currentTime - adjustedTime <= 5;
    }).toList();

    // 如果当前轨道有弹幕，就认为轨道已满
    return


var s = document.getElementsByTagName("script")[0];
				s.parentNode.insertBefore(wf, s);
			})();</script><link rel="icon" href="/wp-content/uploads/2017/07/cropped-e-QUqNxo-32x32.jpg" sizes="32x32">
<link rel="icon" href="/wp-content/uploads/2017/07/cropped-e-QUqNxo-192x192.jpg" sizes="192x192">
<link rel="apple-touch-icon" href="/wp-content/uploads/2017/07/cropped-e-QUqNxo-180x180.jpg">
<meta name="msapplication-TileImage" content="/wp-content/uploads/2017/07/cropped-e-QUqNxo-270x270.jpg">

			<div class="subheader wrapp


_swapchain_usage_input_attachment_bit_SPEC_VERSION;
        pub const NAME: &'static [u8] =
            sys::MND_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_EXTENSION_NAME;
    }
    #[derive(Copy, Clone)]
    pub struct EglEnableMNDX {}
    impl EglEnableMNDX {
        pub const VERSION: u32 = sys::MNDX_egl_enable_SPEC_VERSION;
        pub const NAME: &'static [u8] = sys::MNDX_EGL_ENABLE_EXTENSION_NAME;
    }
    #[derive(Copy, Clone)]
    pub struct UnboundedReferenceSpaceMSFT {}
    impl UnboundedReferenceSpaceMSFT {
        pub const VERSION: u32 = sys::MSFT_unbounded_reference_space_SPEC_VERSION;
        pub const NAME: &'static [u8] = sys::MSFT_UNBOUNDED_REFERENCE_SPACE_EXTENSION_NAME;
    }
    #[derive(Copy, Clone)]
    pub struct SpatialAnchorMSFT {
        pub create_spatial_anchor: pfn::CreateSpatialAnchorMSFT,
        pub create_spatial_anchor_space: pfn::CreateSpatialAnchorSpaceMSFT,
        pub destroy_spatial_anchor: pfn::DestroySpatialAnchorMSFT,
    }
    impl SpatialAnchorMSFT {
        pub const VERSION: u32 = sys::MSFT_spatial_anchor_SPEC_VERSION;
        pub const NAME: &'static [u8] = sys::MSFT_SPATIAL_ANCHOR_EXTENSION_NAME;
        #[doc = r" Load the extension's function pointer table"]
        #[doc = r""]
        #[doc = r" # Safety"]
        #[doc = r""]
        #[doc = r" `instance` must be a valid instance handle."]
        pub unsafe fn load(entry: &Entry, instance: sys::Instance) -> Result<Self> {
            Ok(Self {
                create_spatial_anchor: mem::transmute(entry.get_instance_proc_addr(
                    instance,
                    CStr::from_bytes_with_nul_unchecked(b"xrCreateSpatialAnchorMSFT\0"),
                )?),
                create_spatial_anchor_space: mem::transmute(entry.get_instance_proc_addr(
                    instance,
                    CStr::from_bytes_with_nul_unchecked(b"xrCreateSpatialAnchorSpaceMSFT\0"),
                )?),
                destroy_spatial_anchor: mem::transmute(entry.get_instance_proc_addr(
                    instance,
                    CStr::from_bytes_with_nul_unchecked(b"xrDestroySpatialAnchorMSFT\0"),
                )?),
            })
        }
    }
    #[derive(Copy, Clone)]
    pub struct SpatialGraphBridgeMSFT {
        pub create_spatial_graph_node_space: pfn::CreateSpatialGraphNodeSpaceMSFT,
    }
    impl SpatialGraphBridgeMSFT {
        pub const VERSION: u32 = sys::MSFT_spatial_graph_bridge_SPEC_VERSION;
        pub const NAME: &'static [u8] = sys::MSFT_SPATIAL_GRAPH_BRIDGE_EXTENSION_NAME;
        #[doc = r" Load the extension's function pointer table"]
        #[doc = r""]
        #[doc = r" # Safety"]
        #[doc = r""]
        #[doc = r" `instance` must be a valid instance handle."]
        pub unsafe fn load(entry: &Entry, instance: sys::Instance) -> Result<Self> {
            Ok(Self {
                create_spatial_graph_node_space: mem::transmute(entry.get_instance_proc_addr(
                    instance,
                    CStr::from_bytes_with_nul_unchecked(b"xrCreateSpatialGraphNodeSpaceMSFT\0"),
                )?),
            })
        }
    }
    #[derive(Copy, Clon


l = {
            let mean = f64::from(run_env.block_interval);
            let std_dev = mean / 4.0;
            Normal::new(mean, std_dev).map_err(Error::runtime)
        }?;
        Ok(Self {
            rng,
            block_interval,
        })
    }

    fn rng(&self) -> RefMut<ThreadRng> {
        self.rng.borrow_mut()
    }

    pub(crate) fn block_interval(&self) -> u32 {
        let mut ret;
        loop {
            ret = self.block_interval.sample(self.rng().deref_mut());
            if ret > 0.0 {
                break;
            }
        }
        ret.ceil() as u32
    }

    pub(crate) fn random_hash(&self) -> [u8; 32] {
        let mut hash = [0u8; 32];
        self.rng().deref_mut().fill(&mut hash[..]);
        hash
    }

    // 9/10 chance to add another tx.
    pub(crate) fn has_next_transaction(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..10) > 0
    }

    // 1/1000 chance to generate an empty inputs transaction.
    pub(crate) fn no_inputs(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..1000) == 0
    }

    // 1/1000 chance to generate an empty outputs transaction.
    pub(crate) fn no_outputs(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..1000) == 0
    }

    // 1/1000 chance to overflow the total capacity
    pub(crate) fn allow_capacity_overflow(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..1000) == 0
    }

    // 7/8 chance to add another input cell.
    pub(crate) fn has_next_input(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..7) > 0
    }

    // 1/200 chance to add a burned cell as input.
    pub(crate) fn could_has_burned_input(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..200) == 0
    }

    // 1/200 chance to add a dead cell as input.
    pub(crate) fn could_has_dead_input(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..200) == 0
    }

    // 1/200 chance to add a cell from a failed transaction.
    pub(crate) fn could_be_from_failed_tx(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..200) == 0
    }

    // 1/200 chance to allow duplicated cell.
    pub(crate) fn allow_duplicated(&self) -> bool {
        self.rng().deref_mut().gen_range::<u32, _>(0..200) == 0
    }

    // Lock Script:
    // - 1/100 chance: no lock script
    // - 10/100 chance: failed lock script
    pub(crate) fn lock_status(&self) -> Option<bool> {
        let tmp = self.rng().deref_mut().gen_range::<u32, _>(0..100);
        if tmp == 0 {
            None
        } else if tmp < 10 {
            Some(false)
        } else {
            Some(true)
        }
    }

    // Type Script:
    // - 40/100 chance: no type script
    // - 10/100 chance: failed type script
    pub(crate) fn type_status(&self) -> Option<bool> {
        let tmp = self.rng().deref_


{
					p_base_freq=0.2f+frnd(0.3f);
					p_freq_ramp=0.1f+frnd(0.4f);
					p_repeat_speed=0.4f+frnd(0.4f);
				}
				else
				{
					p_base_freq=0.2f+frnd(0.3f);
					p_freq_ramp=0.05f+frnd(0.2f);
					if(rnd(1))
					{
						p_vib_strength=frnd(0.7f);
						p_vib_speed=frnd(0.6f);
					}
				}
				p_env_attack=0.0f;
				p_env_sustain=frnd(0.4f);
				p_env_decay=0.1f+frnd(0.4f);
				break;
			case 4: // hit/hurt
				ResetParams();
				wave_type=rnd(2);
				if(wave_type==2)
					wave_type=3;
				if(wave_type==0)
					p_duty=frnd(0.6f);
				p_base_freq=0.2f+frnd(0.6f);
				p_freq_ramp=-0.3f-frnd(0.4f);
				p_env_attack=0.0f;
				p_env_sustain=frnd(0.1f);
				p_env_decay=0.1f+frnd(0.2f);
				if(rnd(1))
					p_hpf_freq=frnd(0.3f);
				break;
			case 5: // jump
				ResetParams();
				wave_type=0;
				p_duty=frnd(0.6f);
				p_base_freq=0.3f+frnd(0.3f);
				p_freq_ramp=0.1f+frnd(0.2f);
				p_env_attack=0.0f;
				p_env_sustain=0.1f+frnd(0.3f);
				p_env_decay=0.1f+frnd(0.2f);
				if(rnd(1))
					p_hpf_freq=frnd(0.3f);
				if(rnd(1))
					p_lpf_freq=1.0f-frnd(0.6f);
				break;
			case 6: // blip/select
				ResetParams();
				wave_type=rnd(1);
				if(wave_type==0)
					p_duty=frnd(0.6f);
				p_base_freq=0.2f+frnd(0.4f);
				p_env_attack=0.0f;
				p_env_sustain=0.1f+frnd(0.1f);
				p_env_decay=frnd(0.2f);
				p_hpf_freq=0.1f;
				break;
			default:
				break;
			}

			PlaySample();
		}
	}
	DrawBar(110, 0, 2, 480, 0x000000);
	DrawText(120, 10, 0x504030, "MANUAL SETTINGS");
	DrawSprite(ld48, 8, 440, 0, 0xB0A080);

	if(Button(130, 30, wave_type==0, "SQUAREWAVE", 10))
		wave_type=0;
	if(Button(250, 30, wave_type==1, "SAWTOOTH", 11))
		wave_type=1;
	if(Button(370, 30, wave_type==2, "SINEWAVE", 12))
		wave_type=2;
	if(Button(490, 30, wave_type==3, "NOISE", 13))
		wave_type=3;

	bool do_play=false;

	DrawBar(5


ec![("root", Trace), ("rootay", Info)]
                .into_iter()
                .map(|(k, v)| (k.into(), v))
                .collect(),
        );

        assert_eq!(config.find_module("root"), Some(Trace));
        assert_eq!(config.find_module("root::sub"), Some(Trace));
        assert_eq!(config.find_module("rooty"), None);
        assert_eq!(config.find_module("rooty::sub"), None);
        assert_eq!(config.find_module("rootay"), Some(Info));
        assert_eq!(config.find_module("rootay::sub"), Some(Info));
    }

    #[test]
    fn test_level_config_single_colon_is_not_double_colon() {
        let config = LevelConfiguration::Minimal(
            vec![
                ("root", Trace),
                ("root::su", Debug),
                ("root::su:b2", Info),
                ("root::sub2", Warn),
            ].into_iter()
                .map(|(k, v)| (k.into(), v))
                .collect(),
        );

        assert_eq!(config.find_module("root"), Some(Trace));

        assert_eq!(config.find_module("root::su"), Some(Debug));
        assert_eq!(config.find_module("root::su::b2"), Some(Debug));

        assert_eq!(config.find_module("root::su:b2"), Some(Info));
        assert_eq!(config.find_module("root::su:b2::b3"), Some(Info));

        assert_eq!(config.find_module("root::sub2"), Some(Warn));
        assert_eq!(config.find_module("root::sub2::b3"), Some(Warn));
    }

    #[test]
    fn test_level_config_all_chars() {
        let config = LevelConfiguration::Minimal(
            vec![
                ("♲", Trace),
                ("☸", Debug),
                ("♲::☸", Info),
                ("♲::\t", Debug),
            ].into_iter()
                .map(|(k, v)| (k.into(), v))
                .collect(),
        );

        assert_eq!(config.find_module("♲"), Some(Trace));
        assert_eq!(config.find_module("♲::other"), Some(Trace));

        assert_eq!(config.find_module("☸"), Some(Debug));
        assert_eq!(config.find_module("☸::any"), Some(Debug));

        assert_eq!(config.find_module("♲::☸"), Some(Info));
        assert_eq!(config.find_module("♲☸"), None);

        assert_eq!(config.find_module("♲::\t"), Some(Debug));
        assert_eq!(config.find_module("♲::\t::\n\n::\t"), Some(Debug));
        assert_eq!(config.find_module("♲::\t\t"), Some(Trace));
    }
}
use std::convert::TryInto;
use std::num::NonZeroU8;
use std::ops::{Div, Mul, Sub};

use nalgebra::{distance_squared, Point2, RealField, Scalar, distance};
use num_traits::{CheckedSub, Zero};
use num_traits::{FromPrimitive, ToPrimitive};
use wasm_bindgen::UnwrapThrowExt;

use super::node::Node;

#[derive(Clone, Debug, Hash)]
pub struct Line<Coord: Scalar> {
    start: Point2<Coord>,
    end: Point2<Coord>,
    strength: NonZeroU8,
}

impl<Coord: Scalar> Line<Coord> {
    pub fn start(&self) -> &Point2<Coord> {
        &self.start
    }
    pub fn end(&self) -> &Point2<Coord> {
        &self.end
    }

    pub fn endpoints(&self) -> (&Point2<Coord>, &Point2<Coord>) {
        (&self.start(), &self.end())
    }
    pub fn get_strength(&self) -> NonZeroU8 {
        self.strength
    }
}

impl<Coord: Scalar> Line<Coord


)? struct,
    TResult Function(EnumOpaqueTwinRustAsyncMoi_Primitive value)? primitive,
    TResult Function(EnumOpaqueTwinRustAsyncMoi_TraitObj value)? traitObj,
    TResult Function(EnumOpaqueTwinRustAsyncMoi_Mutex value)? mutex,
    TResult Function(EnumOpaqueTwinRustAsyncMoi_RwLock value)? rwLock,
    TResult Function(EnumOpaqueTwinRustAsyncMoi_Nothing value)? nothing,
    required TResult orElse(),
  }) {
    if (mutex != null) {
      return mutex(this);
    }
    return orElse();
  }
}

abstract class EnumOpaqueTwinRustAsyncMoi_Mutex
    extends EnumOpaqueTwinRustAsyncMoi {
  const factory EnumOpaqueTwinRustAsyncMoi_Mutex(
          final MutexHideDataTwinRustAsyncMoi field0) =
      _$EnumOpaqueTwinRustAsyncMoi_MutexImpl;
  const EnumOpaqueTwinRustAsyncMoi_Mutex._() : super._();

  MutexHideDataTwinRustAsyncMoi get field0;

  /// Create a copy of EnumOpaqueTwinRustAsyncMoi
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$EnumOpaqueTwinRustAsyncMoi_MutexImplCopyWith<
          _$EnumOpaqueTwinRustAsyncMoi_MutexImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWith<$Res> {
  factory _$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWith(
          _$EnumOpaqueTwinRustAsyncMoi_RwLockImpl value,
          $Res Function(_$EnumOpaqueTwinRustAsyncMoi_RwLockImpl) then) =
      __$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWithImpl<$Res>;
  @useResult
  $Res call({RwLockHideDataTwinRustAsyncMoi field0});
}

/// @nodoc
class __$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWithImpl<$Res>
    extends _$EnumOpaqueTwinRustAsyncMoiCopyWithImpl<$Res,
        _$EnumOpaqueTwinRustAsyncMoi_RwLockImpl>
    implements _$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWith<$Res> {
  __$$EnumOpaqueTwinRustAsyncMoi_RwLockImplCopyWithImpl(
      _$EnumOpaqueTwinRustAsyncMoi_RwLockImpl _value,
      $Res Function(_$EnumOpaqueTwinRustAsyncMoi_RwLockImpl) _then)
      : super(_value, _then);

  /// Create a copy of EnumOpaqueTwinRustAsyncMoi
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? field0 = null,
  }) {
    return _then(_$EnumOpaqueTwinRustAsyncMoi_RwLockImpl(
      null == field0
          ? _value.field0
          : field0 // ignore: cast_nullable_to_non_nullable
              as RwLockHideDataTwinRustAsyncMoi,
    ));
  }
}

/// @nodoc

class _$EnumOpaqueTwinRustAsyncMoi_RwLockImpl
    extends EnumOpaqueTwinRustAsyncMoi_RwLock {
  const _$EnumOpaqueTwinRustAsyncMoi_RwLockImpl(this.field0) : super._();

  @override
  final RwLockHideDataTwinRustAsyncMoi field0;

  @override
  String toString() {
    return 'EnumOpaqueTwinRustAsyncMoi.rwLock(field0: $field0)';
  }

  @override
  bool o


$c$ 是可逆元，故而 $p_1$ 与 $q_j$ 相伴。这样就可以利用消去律在左右两侧分别消去 $p_1$ 和 $q_j$，并将两者相差的相伴元乘到任意一个剩余元素上。根据归纳假设，必然有 $p_2\cdots p_n$ 和 $q_1\cdots q_{j-1}q_{j+1}\cdots q_m$ 中不可约元个数相等，且在相伴意义下是一样的。定理得证。

最后，最大公因子的存在性在唯一分解整环上依然成立。

???+ note "定理"
    设唯一分解整环 $R$ 有非零元素 $a,b\in R$，且它们可以分解成 $a=up_1^{r_1}\cdots p_n^{r_n}$ 和 $b=vp_1^{s_1}\cdots p_n^{s_n}$ 的形式，其中，$u,v$ 是可逆元，$p_1,\cdots,p_n$ 是各不相同的不可约元，$r_i,s_i$ 都是自然数，那么，它们的一个最大公约数是 $d=p_1^{\min\{r_1,s_1\}}\cdots p_n^{\min\{r_n,s_n\}}$。

这其实说明，最大公因子存在这个性质比唯一分解定理成立还要弱[^gcd-domain]。

### 例子：二次整数环

相关阅读：[二次域](../number-theory/quadratic.md)

抽象代数的理解不能离开例子。正是因为费马大定理的研究过程需要研究一类代数整数的性质，才逐渐发展出了今天的环论[^ring-theory-history]。这里讨论最简单的代数整数，即二次整数。这部分的很多结论的证明需要用到复杂的代数数论知识，故而略去。

**二次整数**（quadratic integer）指的是二次项系数为一的整系数二次方程 $\alpha^2+b\alpha+c=0$ 的复根。所有二次整数能且仅能有形式

$$
\alpha=a+b\omega,~(a,b\in\mathbf Z)
$$

这里，

$$
\omega=\begin{cases}
\dfrac{1+\sqrt{D}}{2},& D\equiv 1\pmod 4,\\
\sqrt D,& D\equiv 2,3\pmod 4,
\end{cases}
$$

其中，$D$ 没有平方因子。

??? note "分析"
    根据二次方程求根公式，可以知道这个方程的根一定可以写成

    $$
    \alpha=\frac{-b\pm\sqrt{b^2-4c}}{2}.
    $$

    当 $b=2k+1$ 是奇数时，这个根可以写作

    $$
    \alpha=-k-\frac{1\pm\sqrt{4(k^2+k-c)+


CENTRE TANK INSTALLED
FCTI_2				= true			-- CENTRE TANK INSTALLED
FCTP1COF			= false			-- CTR TK PUMP1 CNTOR OFF
FCTP1COF_INV		= false			-- CTR TK PUMP1 CNTOR OFF  DATA FAIL
FCTP12F				= false			-- CTR TK PUMP 1+2 FAULT
FCTP2COF			= false			-- CTR TK PUMP2 CNTOR OFF
FCTP2COF_INV		= false			-- CTR TK PUMP2 CNTOR OFF  DATA FAIL
FLGFEED				= false			-- L GRVTY FEED
FLRGFEED			= false			-- L+R GRVTY FEED
FLRWLL				= false			-- L+R WING LO LEVEL
FLTP1COF			= false			-- LH TK PUMP1 CNTOR OFF
FLTP1LP				= 0				-- LH TK PUMP1 LO PR
FLTP12F				= false			-- L TK PUMP 1+2 FAULT
FLTP2COF			= false			-- LH TK PUMP2 CNTOR OFF
FLTP2LP				= 0				-- LH TK PUMP2 LO PR
FLTP1LP				= 0				-- LH TK PUMP1 LO PR
FLWLL				= false			-- L WING LO LVL
FMITD				= false			-- FUEL MOD INSTALLED
FMNITD				= true			-- FUEL MOD NOT INSTALLED
FRGFEED				= false			-- R GRVTY FEED
FRWLL				= false			-- R WING LO LVL
FLWTLLA				= false			-- RH WING TK LO LEVEL CH.A
FLWTLLB				= false			-- RH WING TK LO LEVEL CH.B
FRTP1COF			= false			-- RH TK PUMP1 CNTOR OFF
FLTP12F				= false 		-- R TK PUMP 1+2 FAULT
FRTP2COF			= false			-- RH TK PUMP2 CNTOR OFF
FRWTLLA				= false			-- RH WING TK LO LEVEL CH.A
FRWTLLB				= false			-- RH WING TK LO LEVEL CH.B
FXFVFC 				= false			-- FUEL XFEED VALVE FC
FXFVPBON			= false			-- FUEL XFEED VALVE P/B ON

GABRKF_1			= false			-- AUTOBRAKE FAULT
GABRKF_2			= false			-- AUTOBRAKE FAULT
GASF                = false         -- ANTI SKID FAULT
GASKDOFF			= false			-- ANTI SKID OFF
GBFANCON_1			= false			-- BRK FAN CTL ON
GBFANCON_1_NCD		= false			-- BRK FAN CTL ON DATA OUT-OF-RANGE
GBFANCON_2			= false			-- BRK FAN CTL ON
GBFANCON_2_NCD		= false			-- BRK FAN CTL ON DATA OUT-OF-RANGE
GBGFT				= false			-- BOGIE FAULT
GBFI_1				= true			-- BRAKES FAN INSTALLED
GBFI_2				= true			-- BRAKES FAN INSTALLED
GBI_1				= true			-- BOGGIE INSTALLED
GBI_2				= true			-- BOGGIE INSTALLED
GBRKOVHT			= false			-- BRAKE OVHT
GBRK1OVHT			= false			-- BRAKE 1 OVHT
GBRK2OVHT			= false			-- BRAKE 2 OVHT
GBRK3OVHT			= false			-- BRAKE 3 OVHT
GBRK4OVHT			= false			-- BRAKE 4 OVHT
GBRK5OVHT			= false			-- BRAKE 5 OVHT
GBRK6OVHT			= false			-- BRAKE 6 OVHT
G


SweepStatus) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}

	enumTypeValue := TransferSweepStatus(value)

	*v = enumTypeValue
	return nil
}

// NewTransferSweepStatusFromValue returns a pointer to a valid TransferSweepStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTransferSweepStatusFromValue(v string) (*TransferSweepStatus, error) {
	ev := TransferSweepStatus(v)

	return &ev, nil
}

// IsValid return true if the value is valid for the enum, false otherwise
func (v TransferSweepStatus) IsValid() bool {
	for _, existing := range allowedTransferSweepStatusEnumValues {
		if existing == v {
			return true
		}
	}
	return false
}

// Ptr returns reference to TransferSweepStatus value
func (v TransferSweepStatus) Ptr() *TransferSweepStatus {
	return &v
}

type NullableTransferSweepStatus struct {
	value *TransferSweepStatus
	isSet bool
}

func (v NullableTransferSweepStatus) Get() *TransferSweepStatus {
	return v.value
}

func (v *NullableTransferSweepStatus) Set(val *TransferSweepStatus) {
	v.value = val
	v.isSet = true
}

func (v NullableTransferSweepStatus) IsSet() bool {
	return v.isSet
}

func (v *NullableTransferSweepStatus) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableTransferSweepStatus(val *TransferSweepStatus) *NullableTransferSweepStatus {
	return &NullableTransferSweepStatus{value: val, isSet: true}
}

func (v NullableTransferSweepStatus) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableTransferSweepStatus) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}

/*
 * The Plaid API
 *
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * API version: 2020-09-14_1.667.0
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package plaid

import (
	"encoding/json"
)

// PartnerEndCustomerAssetsUnderManagement Assets under management for the given end customer. Required for end customers with monthly service commitments.
type PartnerEndCustomerAssetsUnderManagement struct {
	Amount float64 `json:"amount"`
	IsoCurrencyCode string `json:"iso_currency_code"`
	AdditionalProperties map[string]interface{}
}

type _PartnerEndCustomerAssetsUnderManagement PartnerEndCustomerAssetsUnderManagement

// NewPartnerEndCustomerAssetsUnderManagement instantiates a new PartnerEndCustomerAssetsUnderManagement object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPartnerEndCustomerAssetsUnderManagement(amount float64, isoCurrencyCode string) *PartnerEndCustomerAssetsUnderManagement {
	this := PartnerEndCustomerAssetsUnderManagement{}
	this.Amount = amount
	this.IsoCurrencyCode = isoCurrencyCode
	return &this
}

// NewPartnerEndCustomerAssetsUnderManagementWithDefaults instantiates a new PartnerEndCustomerAssetsUnderManagement object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPartnerEndCustomerAssetsUnderManagementWithDef


              result.push(element);
                    }
                }
            }
        }
        else
        {
            console.error("GetSpecifiedInstances With Invalid Range:" + startX + "," + startY + "," + endX + "," + endY);
        }

        return result;
    }

    //#####Boss技能相关###### Begin
    public TriggerBossSkill(skillInfo: BossSkillInfo)
    {
        this.bossSkillInfo.hasInfo = true;
        this.bossSkillInfo.skillCaster = skillInfo.skillCaster;
        this.bossSkillInfo.addHealthElement = skillInfo.addHealthElement;
        this.AddShield(this.bossSkillInfo.addHealthElement);
        this.bossSkillInfo.elementTransList = skillInfo.elementTransList;
        this.ChangeElements(this.bossSkillInfo.elementTransList);
        this.bossSkillInfo.elementChangeColorList = skillInfo.elementChangeColorList;
        this.ChangElementsColor(this.bossSkillInfo.elementChangeColorList);
    }

    // 添加护盾
    private AddShield(elementList: SceneElementBase[])
    {
        if (elementList != null)
        {
            for (var i = 0; i < elementList.length; ++i)
            {
                elementList[i].AddShield(1);
            }
        }
    }

    // 替换场景中的元素
    private ChangeElements(elementTransList: ElementTransInfo[])
    {
        if (elementTransList != null)
        {
            for (var i = 0; i < elementTransList.length; ++i)
            {
                var transInfo = elementTransList[i];
                if (transInfo != null
                    && transInfo.fromElement != null
                    && transInfo.toElement != null)
                {
                    transInfo.toElement.posx = transInfo.fromElement.posx;
                    transInfo.toElement.posy = transInfo.fromElement.posy;
                    transInfo.toElement.dirty = true;
                    transInfo.fromElement.UnbindAllElement();
                    this.RemoveElement(transInfo.fromElement);
                    this.AddElement(transInfo.toElement);
                }
            }
        }
    }

    // 替换元素颜色
    private ChangElementsColor(elementChangeColorList: ElementChangeColorInfo[])
    {
        if (elementChangeColorList != null)
        {
            for (var i = 0; i < elementChangeColorList.length; ++i)
            {
                var changeColorElement = elementChangeColorList[i];
                if (changeColorElement != null
                    && changeColorElement.element != null)
                {
                    changeColorElement.element.color = changeColorElement.targetColor;
                    changeColorElement.element.dirty = true;
                }
            }
        }
    }
    //#####Boss技能相关###### end
}

enum SceneElementControlType
{
    Add,
    Move,
    Rotation,
}

enum Direction
{
    Right,
    Up,
    Left,
    Down,
}

enum AnchorType
{
    Center,
    Right,
    Up,
    Left,
    Down,
}import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {environment} from '../environments/environment';

@Injectable({
  providedIn: 'root'
})
export class UserService {
  // This User Service allows us to do actions based on authentication such as registering, logging in, storing tokens,
  // etc.

  // Http Options used for making API calls such as content-type and authorization.
  private httpOptions: any;

  // The access token.
  token: string;

  // The refresh token
  refreshToken: string;

  // Token expiration date
  tokenExpires: Date;

  // When we got the token
  tokenRetrieved: Date;

  // Username of the logged in user.
  username: string;

  // Error messages received from the login attempt.
  errors: any = [];

  // The


Ahref struct {
	e.Element
	a e.Element
}

func (m *menuAhref) With(children ...any) e.Element {
	for _, c := range children {
		switch c := c.(type) {
		case onLi:
			m.Element.With(c...)
		case onA:
			m.a.With(c...)
		case e.Class:
			if c == Active {
				m.a.With(c)
			} else {
				m.Element.With(c)
			}
		case e.Classer, e.Classeser, e.Styles:
			m.Element.With(c)
		case gomponents.Node:
			if e.IsAttribute(c) {
				m.Element.With(c)
			} else {
				m.a.With(c)
			}
		case []any:
			m.With(c...)
		default:
			m.a.With(c)
		}
	}

	return m
}

func (m *menuAhref) Clone() e.Element {
	return &menuAhref{
		Element: m.Element.Clone(),
		a:       m.a.Clone(),
	}
}

// MenuSublist creates a menu sublist.
//
// https://willoma.github.io/bulma-gomponents/menu.html
func MenuSublist(children ...any) e.Element {
	m := &menuSublist{e.Ul()}
	m.With(children...)
	return m
}

type menuSublist struct {
	e.Element
}

func (m *menuSublist) Clone() e.Element {
	return &menuSublist{m.Element.Clone()}
}
package cmd

import (
	"fmt"
	"log"
	"os"
	"path/filepath"
	"runtime"
	"time"

	"github.com/pkg/profile"
	"github.com/spf13/cobra"
	"github.com/will-rowe/hulk/src/helpers"
	"github.com/will-rowe/hulk/src/pipeline"
	"github.com/will-rowe/hulk/src/version"
)

// the command line arguments
var (
	fastq       *[]string // list of FASTQ files to sketch
	fasta       *bool     // tells HULK that the input file is actually in FASTA format
	windowSize  *uint     // minimizer window size [2/3 of k-mer length]. A minimizer is the smallest k-mer in a window of w consecutive k-mers.
	interval    *uint     // size of k-mer sampling interval (0 == no interval)
	sketchSize  *uint     // size of sketch
	decayRatio  *float64  // the decay ratio used for concept drift (1.00 = concept drift disabled)
	streaming   *bool     // writes the sketches to STDOUT (as well as to disk)
	bannerLabel *string   // adds a label to the saved sketch, for use with banner
	addKHF      *bool     // HULK will also produce a MinHash KHF sketch
	addKMV      *bool     // HULK will also produce a MinHash KMV sketch
)

// sketchCmd is used by cobra
var sketchCmd = &cobra.Command{
	Use:   "sketch",
	Short: "Create a sketch from a set of reads",
	Long: `
		Create a sketch from a set of reads.

		The sketch subcommand can be used to create a histosketch, minhash or count min sketch.`,
	Run: func(cmd *cobra.Command, args []string) {
		runSketch()
	},
	PreRunE: func(cmd *cobra.Command, args []string) error {
		return helpers.CheckRequiredFlags(cmd.Flags())
	},
}

// init the command line arguments
func init() {
	fastq = sketchCmd.Flags().StringSliceP("fastq", "f", []string{}, "FASTQ file(s) to sketch (can also pipe in STDIN)")
	fasta = sketchCmd.Flags().Bool("fasta", false, "tells HULK that the input file is actually FASTA f


arams string[] parameters)
    {
        parameters.Requires(out var valueExpr);
        dm.RequiresActor(out var actor);

        var match = Regex.Match(valueExpr, @"(\S*?)\s*(\S+)$");
        if (!match.Success) {
            throw new DramaActionInvokeException($"invalid expression {valueExpr}");
        }

        var expr = match.Groups[1].Value;
        if (!Enum.TryParse(match.Groups[2].Value, out Hostility hostility)) {
            throw new DramaActionInvokeException($"invalid hostility {match.Groups[2].Value}");
        }

        return Compare(actor._cints[4], $"{expr}{(int)hostility}");
    }

    [CwlNodiscard]
    public static bool if_in_party(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        dm.RequiresActor(out var actor);

        return actor.IsPCParty;
    }

    [CwlNodiscard]
    public static bool if_keyitem(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.RequiresAtLeast(1);
        parameters.RequiresOpt(out var keyId, out var optExpr);

        return sources.keyItems.alias.TryGetValue(keyId.Value, out var key) &&
               player.keyItems.TryGetValue(key.id, out var keyCount) && Compare(keyCount, optExpr.Get(">0"));
    }

    [CwlNodiscard]
    public static bool if_lv(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.Requires(out var expr);
        dm.RequiresActor(out var actor);

        return Compare(actor.LV, expr);
    }

    [CwlNodiscard]
    public static bool if_race(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.Requires(out var race);
        dm.RequiresActor(out var actor);

        return actor.race.id == race;
    }

    [CwlNodiscard]
    public static bool if_stat(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.Requires(out var stat, out var valueExpr);
        dm.RequiresActor(out var actor);

        var value = stat.ToLowerInvariant() switch {
            "hunger" => actor.hunger.value,
            "burden" => actor.burden.value,
            "depression" => actor.depression.value,
            "hygiene" => actor.hygiene.value,
            "bladder" => actor.bladder.value,
            "sleepiness" => actor.sleepiness.value,
            "san" => actor.SAN.value,
            "stamina" => actor.stamina.value,
            "hp" => actor.hp,
            "mana" => actor.mana.value,
            _ => throw new DramaActionInvokeException($"invalid stat name {stat}"),
        };

        return Compare(value, valueExpr);
    }

    [CwlNodiscard]
    public static bool if_tag(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.Requires(out var tag);
        dm.RequiresActor(out var actor);

        return actor.source.tag.Contains(tag);
    }

    [CwlNodiscard]
    public static bool if_zone(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
    {
        parameters.RequiresAtLeast(1);
        parameters.RequiresOpt(out var zoneId, out var optLevel);
        dm.RequiresActor(out var actor);

        var zone = actor.currentZone;

        return zone.id == zoneId.Value && (!optLevel.Provided || zone.lv.ToString() == optLevel.Get("0"));
    }
}


 check [.count], which if zero indicates that the [.value] is undefined
 * (e.g. NaN).
 *
 * @author udoprog
 */
data class SumBucket(override val timestamp: Long) : AbstractBucket(), DoubleBucket {

    /* the sum of seen values */
    private val sum = AtomicDouble()

    /* if the sum is valid (e.g. has at least one value) */
    @Volatile
    private var valid = false

    override fun updatePoint(key: Map<String, String>, sample: Point) {
        valid = true
        sum.addAndGet(sample.value)
    }

    override fun updateSpread(key: Map<String, String>, sample: Spread) {
        valid = true
        sum.addAndGet(sample.sum)
    }

    override fun value(): Double {
        return if (!valid) {
            java.lang.Double.NaN
        } else sum.get()

    }
}
/*
 * -\-\-
 * Mobius
 * --
 * Copyright (c) 2017-2020 Spotify AB
 * --
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * -/-/-
 */
package com.spotify.mobius.coroutines

import com.google.common.truth.Ordered
import com.google.common.truth.Truth.assertThat
import com.spotify.mobius.functions.Consumer
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.*
import org.junit.Test

@OptIn(ExperimentalCoroutinesApi::class)
class MobiusCoroutinesTest {

    @Test
    @Requirement(
        given = "an effect handler created from MobiusCoroutines.effectHandler",
        `when` = "an effect is dispatched",
        then = "the effect is processed"
    )
    fun effectHandlerProcessEffects() = runTest {
        val testEventConsumer = TestEventConsumer()

        val connection = createEffectHandler().connect(testEventConsumer)
        connection.accept(Effect.ComputeSuccess("success1", 100))
        advanceUntilIdle()

        testEventConsumer.assertConsumedEvents(
            Event.Loading("success1"),
            Event.Success("success1"),
        ).inOrder()
    }

    @Test
    @Requirement(
        given = "an effect handler created from MobiusCoroutines.effectHandler",
        `when` = "an effect is dispatched AND the effect handler is disposed before the effect processing completes",
        then = "the effect is cancelled"
    )
    fun effectHandlerCancelsEffects() = runTest {
        val testEventConsumer = TestEventConsumer()

        val connection = createEffectHandler().connect(testEventConsumer)
        connection.accept(Effect.ComputeSuccess("success1", 100))

        advanceTimeBy(50)
        testEventConsumer.assertConsumedEvents(
            Event.Loading("success1"),
        )

        connection.dispose()
        advanceUntilIdle()
        testEventConsumer.assertConsumedEvents(
            Event.Loading("success1"),
        )
    }

    @Test
    @Requirement(
        given = "an effect handler created from MobiusCoroutines.effectHandler",
        `when` = "several effects are dispatched",
        then = "the effects are processed concurrently"
    )
    fun effectHandlerProcessEffectsConcurrently() = runTest {
        val testEventConsumer = TestEventConsumer()

        val connection = createEffectHandler().connect(testEventConsumer)
        connection.accept(Effect.ComputeSuccess("success1", 100))
        connection.accept(Effect.ComputeFailure("failure1", 150))

        advanceTimeBy(


lTextView>(Resource.Id.textCounter);
                counterText.Text = _counter.ToString();

                view.FindViewById<LinearLayout>(Resource.Id.layoutCounter).Visibility = ViewStates.Visible;
            }

            var preferences = new PreferenceWrapper(RequireContext());

            if (preferences.SortMode is SortMode.CopyCountAscending or SortMode.CopyCountDescending)
            {
                var copyCountText = view.FindViewById<MaterialTextView>(Resource.Id.textCopyCount);
                copyCountText.Text = _copyCount.ToString();

                view.FindViewById<LinearLayout>(Resource.Id.layoutCopyCount).Visibility = ViewStates.Visible;
            }

            var menu = view.FindViewById<RecyclerView>(Resource.Id.listMenu);
            SetupMenu(menu,
            [
                new SheetMenuItem(Resource.Drawable.baseline_edit_24, Resource.String.editDetails, EditClicked),
                new SheetMenuItem(Resource.Drawable.baseline_image_24, Resource.String.changeIcon,
                    ChangeIconClicked),
                new SheetMenuItem(Resource.Drawable.baseline_category_24, Resource.String.assignCategories,
                    AssignCategoriesClicked),
                new SheetMenuItem(Resource.Drawable.baseline_qr_code_24, Resource.String.showQrCode,
                    ShowQrCodeClicked),
                new SheetMenuItem(Resource.Drawable.baseline_delete_24, Resource.String.delete, DeleteClicked, null,
                    true)
            ]);

            return view;
        }
    }
}


1 do
    local new_byte = line2byte(i)
    res = math.max(res, new_byte - cur_byte)
    cur_byte = new_byte
  end
  return res - 1
end

-- Step two ===================================================================
later(function() require('mini.extra').setup() end)

later(function()
  local ai = require('mini.ai')
  ai.setup({
    custom_textobjects = {
      B = MiniExtra.gen_ai_spec.buffer(),
      F = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }),
      o = ai.gen_spec.treesitter({ a = '@block.outer', i = '@block.inner' }),
    },
  })
end)

later(function() require('mini.align').setup() end)

-- later(function() require('mini.animate').setup({ scroll = { enable = false } }) end)

later(function() require('mini.bracketed').setup() end)

later(function() require('mini.bufremove').setup() end)

later(function()
  local miniclue = require('mini.clue')
  --stylua: ignore
  miniclue.setup({
    clues = {
      Config.leader_group_clues,
      miniclue.gen_clues.builtin_completion(),
      miniclue.gen_clues.g(),
      miniclue.gen_clues.marks(),
      miniclue.gen_clues.registers(),
      miniclue.gen_clues.windows({ submode_resize = true }),
      miniclue.gen_clues.z(),
    },
    triggers = {
      { mode = 'n', keys = '<Leader>' }, -- Leader triggers
      { mode = 'x', keys = '<Leader>' },
      { mode = 'n', keys = [[\]] },      -- mini.basics
      { mode = 'n', keys = '[' },        -- mini.bracketed
      { mode = 'n', keys = ']' },
      { mode = 'x', keys = '[' },
      { mode = 'x', keys = ']' },
      { mode = 'i', keys = '<C-x>' },    -- Built-in completion
      { mode = 'n', keys = 'g' },        -- `g` key
      { mode = 'x', keys = 'g' },
      { mode = 'n', keys = "'" },        -- Marks
      { mode = 'n', keys = '`' },
      { mode = 'x', keys = "'" },
      { mode = 'x', keys = '`' },
      { mode = 'n', keys = '"' },        -- Registers
      { mode = 'x', keys = '"' },
      { mode = 'i', keys = '<C-r>' },
      { mode = 'c', keys = '<C-r>' },
      { mode = 'n', keys = '<C-w>' },    -- Window commands
      { mode = 'n', keys = 'z' },        -- `z` key
      { mode = 'x', keys = 'z' },
    },
  })
end)

-- Don't really need it on daily basis
-- later(function() require('mini.colors').setup() end)

later(function() require('mini.comment').setup() end)

later(function()
  -- Don't show 'Text' suggestions
  local process_items_opts = { kind_priority = { Text = -1, Snippet = 99 } }
  local process_items = function(items, base)
    return MiniCompletion.default_process_items(items, base, process_items_opts)
  end
  require('mini.completion').setup({
    lsp_completion = { source_func = 'omnifunc', auto_setup = false, process_items = process_items },
  })

  -- Set up LSP p


EE648 8E230000 */  lw    $v1, ($s1)
/* 19C69C 801EE64C 3C01800F */ lui $at, 0x800f
/* 19C6A0 801EE650 3C10800E */ lui $s0, 0x800e
/* 19C6A4 801EE654 8C670000 */  lw    $a3, ($v1)
/* 19C6A8 801EE658 26102790 */ addiu $s0, 0x2790
/* 19C6AC 801EE65C 24090010 */  li    $t1, 16
/* 19C6B0 801EE660 00073880 */  sll   $a3, $a3, 2
/* 19C6B4 801EE664 00270821 */  addu  $at, $at, $a3
/* 19C6B8 801EE668 C430A6E0 */ lwc1 $f16, -0x5920($at)
/* 19C6BC 801EE66C 3C01800E */ lui $at, 0x800e
/* 19C6C0 801EE670 00270821 */  addu  $at, $at, $a3
/* 19C6C4 801EE674 E43025D0 */ swc1 $f16, 0x25d0($at)
/* 19C6C8 801EE678 8C6A0000 */  lw    $t2, ($v1)
/* 19C6CC 801EE67C 3C01800F */ lui $at, 0x800f
/* 19C6D0 801EE680 240E0001 */  li    $t6, 1
/* 19C6D4 801EE684 000A5880 */  sll   $t3, $t2, 2
/* 19C6D8 801EE688 020B1021 */  addu  $v0, $s0, $t3
/* 19C6DC 801EE68C C4520000 */  lwc1  $f18, ($v0)
/* 19C6E0 801EE690 3C0B800F */ lui $t3, 0x800f
/* 19C6E4 801EE694 256B8AE0 */ addiu $t3, -0x7520
/* 19C6E8 801EE698 46149100 */  add.s $f4, $f18, $f20
/* 19C6EC 801EE69C 8FBF0024 */  lw    $ra, 0x24($sp)
/* 19C6F0 801EE6A0 D7B40010 */  ldc1  $f20, 0x10($sp)
/* 19C6F4 801EE6A4 8FB0001C */  lw    $s0, 0x1c($sp)
/* 19C6F8 801EE6A8 E4440000 */  swc1  $f4, ($v0)
/* 19C6FC 801EE6AC 8C670000 */  lw    $a3, ($v1)
/* 19C700 801EE6B0 8FB10020 */  lw    $s1, 0x20($sp)
/* 19C704 801EE6B4 00073880 */  sll   $a3, $a3, 2
/* 19C708 801EE6B8 00270821 */  addu  $at, $at, $a3
/* 19C70C 801EE6BC C426A8A0 */ lwc1 $f6, -0x5760($at)
/* 19C710 801EE6C0 3C01800E */ lui $at, 0x800e
/* 19C714 801EE6C4 00270821 */  addu  $at, $at, $a3
/* 19C718 801EE6C8 E4262950 */ swc1 $f6, 0x2950($at)
/* 19C71C 801EE6CC 8C6C0000 */  lw    $t4, ($v1)
/* 19C720 801EE6D0 3C01800F */ lui $at, 0x800f
/* 19C724 801EE6D4 000C6880 */  sll   $t5, $t4, 2
/* 19C728 801EE6D8 002D0821 */  addu  $at, $at, $t5
/* 19C72


	IGardeningManager gardening = BotanyCore.getGardening();
		for (int i = 0; i < extent; ++i) {
			BlockPos position = pos.offset(direction.getFacing(), i);
			if (isAirBlock(world, position) || BlockUtil.isReplaceableBlock(getBlockState(world, position), world, position)) {
				ItemStack below = getAsItemStack(world, position.down());
				if (gardening.isSoil(below.getItem())) {
					return trySetCrop(world, position, direction, housing);
				}
			}
		}
		return false;
	}

	private boolean trySetCrop(World world, BlockPos position, FarmDirection direction, IFarmHousing housing) {
		for (IFarmable farmable : farmables) {
			if (!housing.plantGermling(farmable, world, position, direction)) {
				continue;
			}

			if (housing instanceof IOwnedTile) {
				TileEntity tile = world.getTileEntity(position);
				if (tile instanceof TileEntityFlower) {
					TileEntityFlower flower = (TileEntityFlower) tile;
					IOwnedTile owned = (IOwnedTile) housing;

					flower.setOwner(owned.getOwnerHandler().getOwner());
				}
			}
			return true;
		}
		return false;
	}

	public ItemStack getAvailableFertiliser(IFarmHousing housing, EnumFertiliserType type) {
		for (ItemStack stack : BotanyCore.getGardening().getFertilisers(type)) {
			if (!stack.isEmpty()) {
				NonNullList<ItemStack> resources = NonNullList.create();
				resources.add(stack);
				if (housing.getFarmInventory().hasResources(resources)) {
					return stack;
				}
			}
		}
		return ItemStack.EMPTY;
	}
}
package binnie.botany.gui.database;

import binnie.botany.api.genetics.IFlowerColor;
import binnie.core.api.gui.IWidget;
import binnie.core.gui.Attribute;
import binnie.core.gui.ITooltip;
import binnie.core.gui.Tooltip;
import binnie.core.gui.controls.core.Control;
import binnie.core.gui.controls.core.IControlValue;
import binnie.core.gui.renderer.RenderUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ControlColorDisplay extends Control implements IControlValue<IFlowerColor>, ITooltip {
	private IFlowerColor value;

	public ControlColorDisplay(IWidget parent, int x, int y, IFlowerColor value) {
		super(parent, x, y, 16, 16);
		this.value = value;
		addAttribute(Attribute.MOUSE_OVER);
	}

	@Override
	public IFlowerColor getValue() {
		return value;
	}

	@Override
	public void setValue(IFlowerColor value) {
		this.value = value;
	}

	@Override
	@SideOnly(Side.CLIENT)
	public void onRenderBackground(int guiWidth, int guiHeight) {
		RenderUtil.drawSolidRect(getArea(), -1);
		RenderUtil.drawSolidRect(getArea().inset(1), 0xff000000 + getValue().getColor(false));
	}

	@Override
	@SideOnly(Side.CLIENT)
	public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) {
		super.getTooltip(tooltip, tooltipFlag);
		tooltip.add(value.getColorName());
	}
}
package binnie.design;

import bi


/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_TEESURFACE_H
#define GFX_TEESURFACE_H

#include "gfxASurface.h"
#include "nsTArray.h"

/**
 * Wraps a cairo_tee_surface. The first surface in the surface list is the
 * primary surface, which answers all surface queries (including size).
 * All drawing is performed on all the surfaces.
 *
 * The device transform of a tee surface is applied before drawing to the
 * underlying surfaces --- which also applies the device transforms of the
 * underlying surfaces.
 */
class THEBES_API gfxTeeSurface : public gfxASurface {
public:
    gfxTeeSurface(cairo_surface_t *csurf);
    gfxTeeSurface(gfxASurface **aSurfaces, int32_t aSurfaceCount);

    virtual const gfxIntSize GetSize() const;

    /**
     * Returns the list of underlying surfaces.
     */
    void GetSurfaces(nsTArray<nsRefPtr<gfxASurface> > *aSurfaces);
};

#endif /* GFX_TEESURFACE_H */


        for ((i, k) in parkingTimesByKey.withIndex()) {
            // 기본 시간 이내인 경우 기본 요금
            val fee = if (parkingTimes[k]!! <= fees[0])
                fees[1]
            else {
                // 초과분은 단위 시간당 단위 요금으로 계산
                fees[1] +
                        ceil((parkingTimes[k]!! - fees[0]) / fees[2].toDouble()).toInt() * fees[3]
            }
            answer[i] = fee
        }
        return answer
    }
}package ch12

import java.util.*

class P39_2 {
    fun combinationSum(candidates: IntArray, target: Int): List<List<Int>> {
        // 결과 저장 리스트 선언
        val results: MutableList<List<Int>> = mutableListOf()

        fun dfs(target: Int, index: Int, path: Deque<Int>) {
            // 0 보다 작다면 목푯값을 넘어섰으므로 리턴
            if (target < 0) return
            // 0이면 목푯값에 도달했으므로 결과에 추가하고 리턴
            if (target == 0) {
                // 이전 경로를 저장해둔 path를 결과에 삽입
                results.add(ArrayList(path))
                return
            }
            // 자기 자신보다 큰 숫자를 DFS 진행
            for (i in index until candidates.size) {
                // path에 현재 엘리먼트 추가
                path.add(candidates[i])
                // 재귀 DFS
                dfs(target - candidates[i], i, path)
                // 돌아온 이후에는 현재 엘리먼트 삭제
                path.removeLast()
            }
        }

        // DFS 시작
        dfs(target, 0, ArrayDeque())
        return results
    }
}package ch10

class P26_2(k: Int) {
    // 이중 연결 리스트로 사용할 클래스 선언
    data class DoublyLinkedList(var `val`: Int) {
        // 왼쪽으로 연결할 이중 연결 리스트
        var left: DoublyLinkedList? = null

        // 오른쪽으로 연결할 이중 연결 리스트
        var right: DoublyLinkedList? = null
    }

    // 현재 큐의 크기
    var len = 0

    // 전체 큐의 크기
    var k = 0

    // 이중 연결 리스트 head 노드
    var head: DoublyLinkedList? = null

    // 이중 연결 리스트 tail 노드
    var tail: DoublyLinkedList? = null

    // 초기화 블록
    init {
        // 이중 연결 리스트 2개 생성
        head = DoublyLinkedList(0)
        tail = DoublyLinkedList(0)
        // 서로 연결
        head!!.right = tail
        tail!!.left = head
        //


  'titleStart',
  'artistIdStart',
  'artistNameStart',
  'releasedStart',
  'masterIdStart',
  'isMainReleaseStart',
]

export const states: States<Events> = {
  releases: {
    minLength: 0,
    pattern: /$/,
    next: ['releaseStart'],
  },
  releaseStart: {
    minLength: '<release '.length,
    pattern: /<release\s+/,
    next: [/*'releaseIdFull',*/ 'releaseIdStart', 'releaseEnd'],
  },
  releaseEnd: {
    minLength: '</release>'.length,
    pattern: /<\/release>/,
    next: ['releaseStart'],
  },
  releaseIdFull: {
    minLength: 'id=""'.length,
    pattern: /id="([^"]*)"/,
    next: releaseChildren,
  },
  releaseIdStart: {
    minLength: 'id="'.length,
    pattern: /id="([^"]*)/,
    next: ['releaseIdEnd', 'releaseIdValue'],
  },
  releaseIdValue: {
    minLength: 1,
    pattern: /^([^"]+)/,
    next: ['releaseIdEnd', 'releaseIdValue'],
  },
  releaseIdEnd: {
    minLength: 1,
    pattern: /^([^"]*)"/,
    next: releaseChildren,
  },

  identifiersStart: {
    minLength: '<identifiers>'.length,
    pattern: /<identifiers>/,
    next: ['identifierStart', 'identifiersEnd'],
  },
  identifiersEnd: {
    minLength: '</identifiers>'.length,
    pattern: /<\/identifiers>/,
    next: releaseChildren,
  },

  identifierStart: {
    minLength: '<identifier '.length,
    pattern: /<identifier\s+/,
    next: ['identifierBarcodeType', 'identifierEnd'],
  },
  identifierEnd: {
    minLength: '/>'.length,
    pattern: /\/>/,
    next: ['identifierStart', 'identifiersEnd'],
  },
  identifierBarcodeType: {
    minLength: 'type="Barcode"'.length,
    pattern: /type="Barcode"/,
    next: ['barcodeValueFull', 'barcodeValueStart', 'identifierEnd'],
  },

  barcodeValueFull: {
    minLength: 'value=""'.length,
    pattern: /value="([^"]*)"/,
    next: ['identifierEnd'],
  },
  barcodeValueStart: {
    minLength: 'value="'.length,
    pattern: /value="([^"]*)/,
    next: ['barcodeValueEnd', 'barcodeValueStart'],
  },
  barcodeValue: {
    minLength: 1,
    pattern: /^([^"]+)/,
    next: ['barcodeValueEnd', 'barcodeValue'],
  },
  barcodeValueEnd: {
    minLength: 1,
    pattern: /^([^"]*)"/,
    next: ['identifierEnd'],
  },

  titleFull: {
    minLength: '<title></title>'.length,
    pattern: /<title>([^<]*)<\/title>/,
    next: releaseChildren,
  },
  titleStart: {
    minLength: '<title>'.length,
    pattern: /<title>([^<]*)/,
    next: ['titleEnd', 'titleValue'],
  },
  titleValue: {
    minLength: 1,
    pattern: /^([^<]+)/,
    next: ['titleEnd', 'titleValue'],
  },
  titleEnd: {
    minLength: '</title>'.length,
    pattern: /^([^<]*)<\/title>/,
    next: releaseChildren,
  },

  tracklistStart: {
    minLength: '<tracklist>'.length,
    pattern: /<tracklist>/,
    next: ['tracklistEnd'],
  },
  tracklistEnd: {


to take.\n     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.takeRight([1, 2, 3]);\n     * // => [3]\n     *\n     * _.takeRight([1, 2, 3], 2);\n     * // => [2, 3]\n     *\n     * _.takeRight([1, 2, 3], 5);\n     * // => [1, 2, 3]\n     *\n     * _.takeRight([1, 2, 3], 0);\n     * // => []\n     */\n    function takeRight(array, n, guard) {\n      var length = array == null ? 0 : array.length;\n      if (!length) {\n        return [];\n      }\n      n = (guard || n === undefined) ? 1 : toInteger(n);\n      n = length - n;\n      return baseSlice(array, n < 0 ? 0 : n, length);\n    }\n\n    /**\n     * Creates a slice of `array` with elements taken from the end. Elements are\n     * taken until `predicate` returns falsey. The predicate is invoked with\n     * three arguments: (value, index, array).\n     *\n     * @static\n     * @memberOf _\n     * @since 3.0.0\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function} [predicate=_.identity] The function invoked per iteration.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': true },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': false }\n     * ];\n     *\n     * _.takeRightWhile(users, function(o) { return !o.active; });\n     * // => objects for ['fred', 'pebbles']\n     *\n     * // The `_.matches` iteratee shorthand.\n     * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n     * // => objects for ['pebbles']\n     *\n     * // The `_.matchesProperty` iteratee shorthand.\n     * _.takeRightWhile(users, ['active', false]);\n     * // => objects for ['fred', 'pebbles']\n     *\n     * // The `_.property` iteratee shorthand.\n     * _.takeRightWhile(users, 'active');\n     * // => []\n     */\n    function takeRightWhile(array, predicate) {\n      return (array && array.length)\n        ? baseWhile(array, getIteratee(predicate, 3), false, true)\n        : [];\n    }\n\n    /**\n     * Creates a slice of `array` with elements taken from the beginning. Elements\n     * are taken until `predicate` returns falsey. The predicate is invoked with\n     * three arguments: (value, index, array).\n     *\n     * @static\n     * @memberOf _\n     * @since 3.0.0\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function} [predicate=_.identity] The function invoked per iteration.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': false },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': true }\n     * ];\n     *\n     * _.takeWhile(users, function(o) { return !o.active; });\n     * // => objects for ['barney', 'fred']\n     *\n     * // The `_.matches` iteratee shorthand.\n     * _.takeWhile(users, { 'user': 'barney', '


    pending: pending.map(clean),
      failures: failures.map(clean),
      passes: passes.map(clean)
    };

    runner.testResults = obj;

    process.stdout.write(JSON.stringify(obj, null, 2));
  });
}

/**
 * Return a plain-object representation of `test`
 * free of cyclic properties etc.
 *
 * @param {Object} test
 * @return {Object}
 * @api private
 */

function clean(test) {
  return {
    title: test.title,
    fullTitle: test.fullTitle(),
    duration: test.duration,
    err: errorJSON(test.err || {})
  }
}

/**
 * Transform `error` into a JSON object.
 * @param {Error} err
 * @return {Object}
 */

function errorJSON(err) {
  var res = {};
  Object.getOwnPropertyNames(err).forEach(function(key) {
    res[key] = err[key];
  }, err);
  return res;
}

}); // module: reporters/json.js

require.register("reporters/landing.js", function(module, exports, require){
/**
 * Module dependencies.
 */

var Base = require('./base')
  , cursor = Base.cursor
  , color = Base.color;

/**
 * Expose `Landing`.
 */

exports = module.exports = Landing;

/**
 * Airplane color.
 */

Base.colors.plane = 0;

/**
 * Airplane crash color.
 */

Base.colors['plane crash'] = 31;

/**
 * Runway color.
 */

Base.colors.runway = 90;

/**
 * Initialize a new `Landing` reporter.
 *
 * @param {Runner} runner
 * @api public
 */

function Landing(runner) {
  Base.call(this, runner);

  var self = this
    , stats = this.stats
    , width = Base.window.width * .75 | 0
    , total = runner.total
    , stream = process.stdout
    , plane = color('plane', '✈')
    , crashed = -1
    , n = 0;

  function runway() {
    var buf = Array(width).join('-');
    return '  ' + color('runway', buf);
  }

  runner.on('start', function(){
    stream.write('\n\n\n  ');
    cursor.hide();
  });

  runner.on('test end', function(test){
    // check if the plane crashed
    var col = -1 == crashed
      ? width * ++n / total | 0
      : crashed;

    // show the crash
    if ('failed' == test.state) {
      plane = color('plane crash', '✈');
      crashed = col;
    }

    // render landing strip
    stream.write('\u001b['+(width+1)+'D\u001b[2A');
    stream.write(runway());
    stream.write('\n  ');
    stream.write(color('runway', Array(col).join('⋅')));
    stream.write(plane)
    stream.write(color('runway', Array(width - col).join('⋅') + '\n'));
    stream.write(runway());
    stream.write('\u001b[0m');
  });

  runner.on('end', function(){
    cursor.show();
    console.log();
    self.epilogue();
  });
}

/**
 * Inherit from `Base.prototype`.
 */

function F(){};
F.prototype = Base.prototype;
Landing.prototype = new F;
Landing.prototype.constructor = Landing;

}); // module: reporters/landing.js

require.register("reporters/list.js", function(module, exports, require){
/**
 * Module dependencies.
 */

var Base = require('./base')
  , cursor = Base.cursor
  , color = Base.color;

/**
 * Expose `List`.
 */

exports = module.exports = List;

/**
 * Initialize a new `List


        assertThat(exprConstraintDescr.isNegated()).isFalse();
        assertThat(exprConstraintDescr.getType()).isEqualTo(ExprConstraintDescr.Type.NAMED);
        expected = "value > 91";
        assertThat(exprConstraintDescr.getExpression()).isEqualTo(expected);
    }

    @Test
    void declareConstraintsOr() {
        String temperatureField = "TEMPERATURE";
        String humidityField = "HUMIDITY";
        List<KiePMMLFieldOperatorValue> kiePMMLOperatorValues =
                Arrays.asList(new KiePMMLFieldOperatorValue(temperatureField, BOOLEAN_OPERATOR.AND,
                                Collections.singletonList(new KiePMMLOperatorValue(OPERATOR.LESS_THAN, 35)), null),
                        new KiePMMLFieldOperatorValue(humidityField, BOOLEAN_OPERATOR.OR, Collections.singletonList(new KiePMMLOperatorValue(OPERATOR.GREATER_THAN, 85)), null));
        KiePMMLDescrLhsFactory.factory(lhsBuilder).declareConstraintsAndOr(kiePMMLOperatorValues, lhsBuilder.or());
        assertThat(lhsBuilder.getDescr()).isNotNull();
        assertThat(lhsBuilder.getDescr().getDescrs()).hasSize(1);
        assertThat(lhsBuilder.getDescr().getDescrs().get(0)).isInstanceOf(OrDescr.class);
        OrDescr baseOrDescr = (OrDescr) lhsBuilder.getDescr().getDescrs().get(0);
        final List<BaseDescr> descrs = baseOrDescr.getDescrs();
        assertThat(descrs).isNotNull();
        assertThat(descrs).hasSize(2);
        // First KiePMMLFieldOperatorValue
        assertThat(descrs.get(0)).isInstanceOf(PatternDescr.class);
        PatternDescr patternDescr = (PatternDescr) descrs.get(0);
        assertThat(patternDescr.getObjectType()).isEqualTo(temperatureField);
        assertThat(patternDescr.getIdentifier()).isNull();
        assertThat(patternDescr.getConstraint()).isInstanceOf(AndDescr.class);
        AndDescr andDescr = (AndDescr) patternDescr.getConstraint();
        assertThat(andDescr.getDescrs()).hasSize(1);
        assertThat(andDescr.getDescrs().get(0)).isInstanceOf(ExprConstraintDescr.class);
        ExprConstraintDescr exprConstraintDescr = (ExprConstraintDescr) andDescr.getDescrs().get(0);
        assertThat(exprConstraintDescr.isNegated()).isFalse();
        assertThat(exprConstraintDescr.getType()).isEqualTo(ExprConstraintDescr.Type.NAMED);
        String expected = "value < 35";
        assertThat(exprConstraintDescr.getExpression()).isEqualTo(expected);
        // Second KiePMMLFieldOperatorValue
        assertThat(descrs.get(1)).isInstanceOf(PatternDescr.class);
        patternDescr = (PatternDescr) descrs.get(1);
        assertThat(patternDescr.getObjectType()).isEqualTo(humidityField);
        assertThat(patternDescr.getIdentifier()).isNull();
        assertThat(patternDescr.getConstraint()).isInstanceOf(AndDescr.class);
        andDescr = (AndDescr) patternDescr.getConstraint();
        assertThat(andDescr.getDescrs()).hasSize(1);
        assertThat(andDescr.getDescrs().get(0)).isInstanceOf(ExprConstraintDescr.class);
        exprConstraintDescr = (ExprConstraintDescr) andDescr.getDescrs().get(0);
        assertThat(exprConstraintDescr.isNegated()).isFalse();
        assertThat(exprConstraintDescr.getType()).isEqualTo(ExprConstraintDescr.Type.NAMED);
        expected = "value > 85";
        assertThat(exprConstraintDescr.getExpression()).isEqualTo(expected);
    }

    @Test
    void declareConstraintsXorWrongInput() {


default;

$pre-color:                         $gray-900 !default;
$pre-scrollable-max-height:         340px !default;

// Utilities

$displays: none, inline, inline-block, block, table, table-row, table-cell, flex, inline-flex !default;
$overflows: auto, hidden !default;
$positions: static, relative, absolute, fixed, sticky !default;

// Printing

$print-page-size:                   a3 !default;
$print-body-min-width:              map-get($grid-breakpoints, "lg") !default;
/* TinyMCE Editor */

.mce-tinymce {
  &.mce-panel,
  .mce-panel {
    border-color: $border-color;
  }
}
/* Chartist */

// Line Charts Starts
// Data -1

.ct-series-a .ct-line {
  stroke: lighten($blue, 15);
  stroke-width: 3px;
  stroke-dasharray: 10px 20px;
}

.ct-series-a .ct-point {
  stroke: lighten($blue, 1);
  stroke-width: 10px;
  stroke-linecap: round;
}
// Data -2

.ct-series-b .ct-line {
  stroke: lighten($green, 15);
  stroke-width: 3px;
  stroke-dasharray: 10px 20px;
}

.ct-series-b .ct-point {
  stroke: lighten($green, 1);
  stroke-width: 10px;
  stroke-linecap: round;
}
// Data -3

.ct-series-c .ct-line {
  stroke: lighten($orange, 15);
  stroke-width: 3px;
  stroke-dasharray: 10px 20px;
}

.ct-series-c .ct-point {
  stroke: lighten($orange, 1);
  stroke-width: 10px;
  stroke-linecap: round;
}
// Line Charts Ends
// Bar Charts Starts
// Data -1

.ct-series-a .ct-bar {
  stroke: lighten($blue, 15);
  stroke-width: 20px;
  stroke-dasharray: 0;
  stroke-linecap: squre;
}
// Data -2

.ct-series-b .ct-bar {
  stroke: lighten($green, 15);
  stroke-width: 20px;
  stroke-dasharray: 0;
  stroke-linecap: squre;
}
// Data -3

.ct-series-c .ct-bar {
  stroke: lighten($orange, 15);
  stroke-width: 20px;
  stroke-dasharray: 0;
  stroke-linecap: squre;
}
// Data -4

.ct-series-d .ct-bar {
  stroke: lighten($red, 15);
  stroke-width: 20px;
  stroke-dasharray: 0;
  stroke-linecap: squre;
}
// Bar Charts Ends
// Pie Chart Starts
// Data -1
.ct-series-a .ct-slice-pie {
  fill: lighten($blue, 15);
  stroke-width: 4px;
}
// Data -2

.ct-series-b .ct-slice-pie {
  fill: lighten($green, 15);
  stroke-width: 4px;
}
// Data 3

.ct-series-c .ct-slice-pie {
  fill: lighten($red, 15);
  stroke-width: 4px;
}
// Data -4

.ct-series-d .ct-slice-pie {
  fill: lighten($orange, 15);
  stroke-width: 4px;
}
// Pie Chart Starts
// Donut chart Starts
// Data -1
.ct-series-a .ct-slice-donut-solid {
  fill: lighten($blue, 15);
}

// Data -2
.ct-series-b .ct-slice-d


акций, который можно получить функцией `txid_current()`. При выполнении транзакции этот счетчик увеличивается. Каждая запись в отношении имеет системные атрибуты `xmin` и `xmax`

* Когда запись создается, ей присваивается значение счетчика в поле `xmin`
* Когда запись удаляется, она не удаляется, а просто присваивается значение счетчика в ее поле `xmax`
* Когда запись изменяется, на самом деле создается ее копия с изменными атрибутами, старой записи присваивается значение счетчика в поле `xmax`, а новой присваивается в поле `xmin`

Таким образом, эти атрибуты задают жизненный цикл каждого снимка каждой записи, чтобы соблюдать целостность данных.
Помимо них есть еще `cmin` и `cmax`. Они обозначают жизненный цикл самой записи и не затрагиваются при обновлении записи

### Vacuum и Autovacuum

Так как MVCC требует очень много памяти на диске, нужны инструменты, очищающие неактуальные данные. В PostgreSQL есть:

* **Vacuum** - команда для очистки базы данных, которая удаляет "мертвые" строки (устаревшие версии записей, помеченные как удаленные) и сбрасывает счетчик транзакций, участвующий в механизме MVCC, тем самым предотвращая его переполнение

* **Autovacuum** - автоматическая версия процесса очистки, которая определяет необходимость очистки таблиц на основании внутренней статистики и автоматически запускает процесс Vacuum для удаления устаревших данных и реорганизации таблиц, что помогает поддерживать оптимальную производительность базы данных

## Лекция 11. Общение в распределенных хранилищах

В распределённых хранилищах данных ключевую роль играют **брокеры сообщений** — специализированные компоненты, которые получают, хранят и пересылают сообщения между производителями (producers) и потребителями (consumers)

У каждого сообщения, передаваемого через брокер, как правило, есть идентификатор, время отправки и топик (topic).
**Топик** — это логическая категория или канал, через который сообщения публикуются и читаются. Он помогает организовать данные по смыслу. Например, можно создать отдельные топики для логов, заказов или уведо


取Texture上的某个区域的像素点
		 * @param x
		 * @param y
		 * @param width
		 * @param height
		 * @return 返回像素点集合
		 */
		getPixels(x: number, y: number, width: number, height: number): Uint8Array;

		/**
		 * 通过url强制恢复bitmap。Uint8Array
		 */
		recoverBitmap(onok?: Function): void;

		/**
		 * 强制释放Bitmap,无论是否被引用。
		 */
		disposeBitmap(): void;

		/**
		 * 销毁纹理。
		 */
		destroy(force?: boolean): void;
	}

}

declare module laya.resource {

	/**
	 * Texture2D 类用于生成2D纹理。
	 */
	class Texture2D extends laya.resource.BaseTexture {

		/**
		 * Texture2D资源。
		 */
		static TEXTURE2D: string;

		/**
		 * 纯灰色纹理。
		 */
		static grayTexture: Texture2D;

		/**
		 * 纯白色纹理。
		 */
		static whiteTexture: Texture2D;

		/**
		 * 纯黑色纹理。
		 */
		static blackTexture: Texture2D;

		/**
		 * 加载Texture2D。
		 * @param url Texture2D地址。
		 * @param complete 完成回掉。
		 */
		static load(url: string, complete: laya.utils.Handler): void;

		/**
		 * @inheritDoc
		 * @override
		 */
		readonly defaulteTexture: laya.resource.BaseTexture;

		/**
		 * 创建一个 Texture2D 实例。
		 * @param width 宽。
		 * @param height 高。
		 * @param format 贴图格式。
		 * @param mipmap 是否生成mipmap。
		 * @param canRead 是否可读像素,如果为true,会在内存保留像素数据。
		 */

		constructor(width?: number, height?: number, format?: laya.resource.TextureFormat, mipmap?: boolean, canRead?: boolean);

		/**
		 * 通过图片源填充纹理,可为HTMLImageElement、HTMLCanvasElement、HTMLVideoElement、ImageBitmap、ImageData,
		 * 设置之后纹理宽高可能会发生变化。
		 */
		loadImageSource(source: any, premultiplyAlpha?: boolean): void;

		/**
		 * 通过像素填充纹理。
		 * @param pixels 像素。
		 * @param miplevel 层级。
		 */
		setPixels(pixels: Uint8Array | Float32Array, miplevel?: number): void;

		/**
		 * 通过像素填充部分纹理。
		 * @param x X轴像素起点。
		 * @param y Y轴像素起点。
		 * @param width 像素宽度。
		 * @param height 像素高度。
		 * @param pixels 像素数组。
		 * @param miplevel 层级。
		 */
		setSubPixels(x: number, y: number, width: number, height: number, pixels: Uint8Array | Float32Array, miplevel?: number): void;

		/**
		 * 通过压缩数据填充纹理。
		 * @param data 压缩数据。
		 * @param miplevel 层级。
		 */
		setCompressData(data: Ar


// Bahasa Anak Indonesia untuk Komputer - BAIK
// Copyright Haris Hasanudin -  2005 - 2011
//
// Kupersembahkan untuk istriku tercinta Masako, anakku tersayang Takumi
// dan Tomoki serta seluruh putra putri Indonesia

void keyTambahAkselerasi ()
{

  int  i=0, j=0;

  GtkAccelGroup *accel_group;

  VAL_LABEL valdat,tmpdat, tmpdat2;

  // var list for class params
  char    class_tmpvar[MAX_STRING_LEN];

  memset(&valdat, '\0', sizeof(valdat));
  memset(&tmpdat, '\0', sizeof(tmpdat));
  memset(&tmpdat2, '\0', sizeof(tmpdat2));

  memset(&class_tmpvar, '\0', sizeof(class_tmpvar));

  	  getlex();

	  switch( lex.type )
	    {

	    case TYPE_OBJECT:
              checkObjectValidation(lex.detail.object_str);
	    case TYPE_IDENT:

              if(currentClass != NULL && strlen(currentClass) > 0) {
               #ifdef WIN32
                #ifndef S_SPLINT_S
                sprintf_s(class_tmpvar, sizeof(class_tmpvar),"%s->%s", currentClass, lex.detail.ident);
                #else
                snprintf(class_tmpvar, sizeof(class_tmpvar),"%s->%s", currentClass, lex.detail.ident);
                #endif
               #else
               snprintf(class_tmpvar, sizeof(class_tmpvar),"%s->%s", currentClass, lex.detail.ident);
               #endif
                //printf("construct class var: %s\n", class_tmpvar);
                valdat = ValLabel( class_tmpvar, class_sub_deep, tmpdat, VAL_FLAG_SEARCH_R );
              } else {
		valdat = ValLabel( lex.detail.ident, sub_deep, tmpdat, VAL_FLAG_SEARCH_R );
              }

              // printf("datatype %d\n", valdat.datatype);

              if(valdat.datatype == 40) {
				  tmpdat.widget   = valdat.widget;
                  tmpdat.datatype = 40;
				  tmpdat.GUItype  = valdat.GUItype;
			  } else {
                Error("bentuk perintah Tambah_Akaselerasi salah");
			  }

	      break;

	    default:
	      Error("bentuk perintah Tambah_Akaselerasi salah");
	    }

   accel_group = gtk_accel_group_new();
   gtk_window_add_accel_group(GTK_WINDOW(tmpdat.widget), accel_group);

}


ionAssignableActionBar_GamepadQuickMenu:OnHide()
    ZO_Gamepad_ParametricList_Screen.OnHide(self)
    self.editor:UnfocusBar()
    self:RefreshKeybinds()
end

-- Button XML
function ZO_ChampionAssignableActionSlot_OnMouseEnter(control)
    control.owner:OnMouseEnter()
end

function ZO_ChampionAssignableActionSlot_OnMouseExit(control)
    control.owner:OnMouseExit()
end

function ZO_ChampionAssignableActionSlot_OnMouseClicked(control, button)
    if button == MOUSE_BUTTON_INDEX_LEFT then
        if GetCursorContentType() ~= MOUSE_CONTENT_EMPTY the


operator fun invoke(vararg ps: FunToAny<X>): VFun<X, E> =
    invoke(ps.toList().bind())

  companion object {
    const val KG_IT = "it"
  }

  val mapInput = SVar<X>(KG_IT)
  open fun map(ef: (SFun<X>) -> SFun<X>): VFun<X, E> =
    VMap(this, ef(mapInput), mapInput)

  open fun <C: D1> vMap(ef: (SFun<X>) -> VFun<X, C>): MFun<X, E, C> =
    VVMap(this, ef(mapInput), mapInput)

  fun <Q: D1> d(v1: VVar<X, Q>): MFun<X, E, Q> = Jacobian(this, v1)

  fun d(v1: SVar<X>) = VDerivative(this, v1)

  fun d(vararg vars: SVar<X>): Map<SVar<X>, VFun<X, E>> = vars.associateWith { d(it) }

  fun grad(): Map<SVar<X>, VFun<X, E>> =
    bindings.sVars.associateWith { d(it) }

  open operator fun unaryMinus(): VFun<X, E> = VNegative(this)
  open operator fun plus(addend: VFun<X, E>): VFun<X, E> = VSum(this, addend)
  open operator fun minus(subtrahend: VFun<X, E>): VFun<X, E> = VSum(this, -subtrahend)
  open infix fun ʘ(multiplicand: VFun<X, E>): VFun<X, E> = VVProd(this, multiplicand)
  open operator fun times(multiplicand: SFun<X>): VFun<X, E> = VSProd(this, multiplicand)
  open operator fun <Q: D1> times(multiplicand: MFun<X, Q, E>): VFun<X, Q> = VMProd(this, multiplicand)
  open infix fun dot(multiplicand: VFun<X, E>): SFun<X> = DProd(this, multiplicand)

  operator fun times(multiplicand: Number): VFun<X, E> = this * wrap(multiplicand)

  fun magnitude() = (this ʘ this).sum().sqrt()
  open fun sum(): SFun<X> = VSumAll(this)

  override fun toString() = when (this) {
    is Vec -> contents.joinToString(", ", "[", "]")
    is VMap -> "$input.map { $ssMap }"
    is VVar -> "$name: Var$length"
    is VComposition -> "($input)$bindings"
    else -> asString()
  }

  override val op: Op = when (this) {
    is VNegative<X, *> -> Ops.sub
    is VMap<X, *> -> Ops.map
    is VSum<X, *> -> Ops.sum
    is Gradient<X, *> -> Ops.d
    is VDerivative<X, *> -> Ops.d
    is VVProd<X, *> -> Ops.prod
    is SVProd<X, *> -> Ops.prod
    is VSProd<X, *> -> Ops.prod
    is MVProd<X, *, *> -> Ops.dot
    is VMProd<X, *, *> -> Ops.dot
    is VComposition<X, *> -> Ops.λ
    is MSumRows<X, *, *> -> Ops.Σ
    else -> Ops.id
  }
}

class VNegative<X: SFun<X>, E: D1>(override val input: VFun<X, E>): VFun<X, E>(input), UnFun<X>

class VMap<X: SFun<X>, E: D1>(
  val input: VFun<X, E>,
  val ssMap: SFun<X>, placeholder: SVar<X>
): VFun<X, E>(input, ssMap), BiFun<X> {
  override val left = input
  override val right = ssMap
  override val bindings: Bindings<X> = input.bindings + ssMap.bindings - placeholder
}

class VVMap<X: SFun<X>, R: D1, C: D1>(
  val input: VFun<X, R>,
  val svMap: VFun<X, C>,


/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2004 Cavium Networks
 */
#ifndef __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H
#define __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H

#include <linux/types.h>
#include <asm/mipsregs.h>

/*
 * Cavium Octeons are MIPS64v2 processors
 */
#define cpu_dcache_line_size()	128
#define cpu_icache_line_size()	128

#define cpu_has_4kex		1
#define cpu_has_3k_cache	0
#define cpu_has_4k_cache	0
#define cpu_has_tx39_cache	0
#define cpu_has_fpu		0
#define cpu_has_counter		1
#define cpu_has_watch		1
#define cpu_has_divec		1
#define cpu_has_vce		0
#define cpu_has_cache_cdex_p	0
#define cpu_has_cache_cdex_s	0
#define cpu_has_prefetch	1

#define cpu_has_llsc		1
/*
 * We Disable LL/SC on non SMP systems as it is faster to disable
 * interrupts for atomic access than a LL/SC.
 */
#ifdef CONFIG_SMP
# define kernel_uses_llsc	1
#else
# define kernel_uses_llsc	0
#endif
#define cpu_has_vtag_icache	1
#define cpu_has_dc_aliases	0
#define cpu_has_ic_fills_f_dc	0
#define cpu_has_64bits		1
#define cpu_has_octeon_cache	1
#define cpu_has_saa		octeon_has_saa()
#define cpu_has_mips32r1	0
#define cpu_has_mips32r2	0
#define cpu_has_mips64r1	0
#define cpu_has_mips64r2	1
#define cpu_has_mips_r2_exec_hazard 0
#define cpu_has_dsp		0
#define cpu_has_mipsmt		0
#define cpu_has_userlocal	0
#define cpu_has_vint		0
#define cpu_has_veic		0
#define cpu_hwrena_impl_bits	0xc0000000
#define ARCH_HAS_READ_CURRENT_TIMER 1
#define ARCH_HAS_IRQ_PER_CPU	1
#define ARCH_HAS_SPINLOCK_PREFETCH 1
#define spin_lock_prefetch(x) prefetch(x)
#define PREFETCH_STRIDE 128

static inline int read_current_timer(unsigned long *result)
{
	asm volatile ("rdhwr %0,$31\n"
#ifndef CONFIG_64BIT
		      "\tsll %0, 0"
#endif
		      : "=r" (*result));
	return 0;
}

static inline int octeon_has_saa(void)
{
	int id;
	asm volatile ("mfc0 %0, $15,0" : "=r" (id));
	return id >= 0x000d0300;
}

#endif


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Loyc.MiniTest;

namespace Loyc.LLParserGenerator
{
	class LlpgAutoValueSaverVisitorTests : LlpgGeneralTestsBase
	{
		[Test] public void TestExplicitLabels()
		{
			// Two explicit labels
			Test(@"LLLPG (parser(terminalType: Symbol)) {
					rule Foo() @{ a:A a2:A {Checkpoint($a); Checkpoint($a2);} };
				};", @"
					void Foo()
					{
						Symbol a = default(Symbol);
						Symbol a2 = default(Symbol);
						a = Match(A);
						a2 = Match(A);
						Checkpoint(a);
						Checkpoint(a2);
					}");
			// Explicit label for list type
			Test(@"LLLPG (lexer) {
					rule CountHashes()::int @{ h+:'#'* {return $h.Count;} };
				};", @"
					int CountHashes()
					{
						int la0;
						List<int> h = new List<int>();
						// Line 2: ([#])*
						 for (;;) {
							la0 = LA0;
							if (la0 == '#')
								h.Add(MatchAny());
							else
								break;
						}
						return h.Count;
					}");
		}
		[Test] public void TestImplicitRuleRefs()
		{
			// Implicit rule reference
			Test(@"LLLPG (lexer) {
					rule Start @{ Foo(7) {f($Foo);} };
					rule Foo(x::int)::int @{ {return x;} };
				};", @"
					void Start()
					{
						int got_Foo = 0;
						got_Foo = Foo(7);
						f(got_Foo);
					}
					int Foo(int x)
					{
						return x;
					}");
			// Implicit rule references
			Test(@"LLLPG (parser(terminalType: Token)) {
					rule Foo() @{ (A C | B C) {Blah($B, $C);} };
				};", @"
					void Foo()
					{
						int la0;
						Token tok_B = default(Token);
						Token tok_C = default(Token);
						// Line 2: (A C | B C)
						la0 = (int)LA0;
						if (la0 == A) {
							Skip();
							tok_C = Match(C);
						} else {
							tok_B = Match(B);
							tok_C = Match(C);
						}
						Blah(tok_B, tok_C);
					}");
		}
		[Test] public void TestImplicitTerminalRefs()
		{
			// Implicit terminal reference in semantic predicate
			Test(@"LLLPG (parser(terminalType: char)) {
					token Foo() @{ Op (&{$Op == '$'} '$')? };
				};", @"
					void Foo()
					{
						int la0;
						char tok_Op = default(char);
						tok_Op = Match(Op);
						// Line 2: (&{tok_Op == '$'} '$')?
						la0 = (int)LA0;
						if (la0 == '$') {
							if (tok_Op == '$')
								Skip();
						}
					}");
			// Implicit terminal reference
			Test(@"LLLPG (lexer) {
					rule Foo() @{ _ (&{$_ == '$'} '$')? };
				};", @"
					void Foo()
					{
						int la0;
						int tok__ = 0;
						tok__ = MatchExcept();
						// Line 2: (&{tok__ == '$'} [$])?
						la0 = LA0;
						if (la0 == '$') {
							Check(tok__ == '$', ""Expected tok__ == '$'"");
							Skip();
						}
					}");
			// I


> for TreasuryTransactionPayloadDto {
    type Error = String;

    fn try_from(value: &TreasuryTransactionPayload) -> Result<Self, Self::Error> {
        Ok(TreasuryTransactionPayloadDto {
            kind: TreasuryTransactionPayload::KIND,
            input: value.input().try_into()?,
            output: value.output().try_into()?,
        })
    }
}

// &TreasuryTransactionDto -> TreasuryTransactionPayload
impl TryFrom<&TreasuryTransactionPayloadDto> for TreasuryTransactionPayload {
    type Error = String;

    fn try_from(value: &TreasuryTransactionPayloadDto) -> Result<Self, Self::Error> {
        let input: Input = (&value.input)
            .try_into()
            .map_err(|_| "invalid input in treasury transaction payload: expected a treasury input")?;
        let output: Output = (&value.output)
            .try_into()
            .map_err(|_| "invalid output in treasury transaction payload: expected a treasury output")?;

        TreasuryTransactionPayload::new(input, output)
            .map_err(|e| format!("invalid treasury transaction payload: {}", e))
    }
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct PeerDto {
    pub id: String,
    #[serde(rename = "multiAddresses")]
    pub multi_addresses: Vec<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
    pub relation: RelationDto,
    pub connected: bool,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gossip: Option<GossipDto>,
}

#[derive(Clone, Debug, Serialize, Deserialize, Default)]
pub struct GossipDto {
    pub heartbeat: HeartbeatDto,
    pub metrics: MetricsDto,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum RelationDto {
    #[serde(rename = "known")]
    Known,
    #[serde(rename = "unknown")]
    Unknown,
    #[serde(rename = "discovered")]
    Discovered,
}

#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct HeartbeatDto {
    #[serde(rename = "solidMilestoneIndex")]
    pub solid_milestone_index: u32,
    #[serde(rename = "prunedMilestoneIndex")]
    pub pruned_milestone_index: u32,
    #[serde(rename = "latestMilestoneIndex")]
    pub latest_milestone_index: u32,
    #[serde(rename = "connectedNeighbors")]
    pub connected_neighbors: u8,
    #[serde(rename = "syncedNeighbors")]
    pub synced_neighbors: u8,
}

#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct MetricsDto {
    #[serde(rename = "newMessages")]
    pub new_messages: u64,
    #[serde(rename = "receivedMessages")]
    pub received_messages: u64,
    #[serde(rename = "knownMessages")]
    pub known_messages: u64,
    #[serde(rename = "receivedMessageRequests")]
    pub received_message_requests: u64,
    #[serde(rename = "receivedMilestoneRequests")]
    pub received_milestone_requests: u64,
    #[serde(rename = "receivedHeartbeats")]
    pub received_heartbeats: u64,
    #[serde(rename = "sentMessages")]
    pub sent_messages: u64,
    #[serde(rename = "sentMessageRequests")]
    pub sent_message_requests: u64,
    #[serde(rename = "sentMilestoneRequests")]
    pub sent_milestone_requests: u64,
    #[serde(rename = "sentHeartbeats")]
    pub sent_heartbeats: u64,
    #[serde(rename = "droppedPackets")]
    pub dropped_packets


0'):
  sum = tf.add_n(c)
# log_device_placement을 True로 설정하여 세션을 만듭니다.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# op를 실행합니다.
print sess.run(sum)
```

다음의 결과를 얻을 수 있습니다.

```
Device mapping:
/job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: Tesla K20m, pci bus
id: 0000:02:00.0
/job:localhost/replica:0/task:0/gpu:1 -> device: 1, name: Tesla K20m, pci bus
id: 0000:03:00.0
/job:localhost/replica:0/task:0/gpu:2 -> device: 2, name: Tesla K20m, pci bus
id: 0000:83:00.0
/job:localhost/replica:0/task:0/gpu:3 -> device: 3, name: Tesla K20m, pci bus
id: 0000:84:00.0
Const_3: /job:localhost/replica:0/task:0/gpu:3
Const_2: /job:localhost/replica:0/task:0/gpu:3
MatMul_1: /job:localhost/replica:0/task:0/gpu:3
Const_1: /job:localhost/replica:0/task:0/gpu:2
Const: /job:localhost/replica:0/task:0/gpu:2
MatMul: /job:localhost/replica:0/task:0/gpu:2
AddN: /job:localhost/replica:0/task:0/cpu:0
[[  44.   56.]
 [  98.  128.]]
```

여러 개의 GPU를 사용하여 모델을 훈련하는 과정의 좋은 예시로 [cifar10 튜토리얼](../../tutorials/deep_cnn/index.md)이 있습니다.
# 텐서플로우 선형 모델 튜토리얼
(v1.0)

이번 강의에서 우리는 이진 분류 문제를 사람에 나이, 성별, 교육, 그리고 직업(특성들)에 관한 인구조사 데이터를 가지고 한 사람의 연봉이 50,000불이 넘는지를 TensorFlow에 TF.Learn API를 사용해서 풀어 볼 것이다(목표 레이블). 우리는 **로지스틱 회귀** 모델을 주어진 개인들에 정보를 가지고 교육 할 것이고 모델은 개인의 연봉이 50,000달러 이상일 가능성으로 해석 될 수 있는 0과1 사이의 숫자를 출력한다.

## 설치

이번 튜토리얼 코드를 실행해보기 위해서:

1.  텐서플로우를 설치하지 않았다면 [텐서플로 설치](../../get_started/os_setup.md)

2.  [튜토리얼 코드](
    https://www.tensorflow.org/code/tensorflow/examples/learn/wide_n_deep_tutorial.py) �