splay: inline-block;
  width: 10px;
  height: 10px;
  margin: 1px;
  text-indent: -999px;
  border: 1px solid #fff;
  border-radius: 10px;
  cursor: pointer;
  background-color: #000 \9;
  background-color: rgba(0, 0, 0, 0);
}
.carousel-indicators .active {
  margin: 0;
  width: 12px;
  height: 12px;
  background-color: #fff;
}
.carousel-caption {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 20px;
  z-index: 10;
  padding-top: 20px;
  padding-bottom: 20px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
  text-shadow: none;
}
@media screen and (min-width: 768px) {
  .carousel-control .glyphicon-chevron-left,
  .carousel-control .glyphicon-chevron-right,
  .carousel-control .icon-prev,
  .carousel-control .icon-next {
    width: 30px;
    height: 30px;
    margin-top: -10px;
    font-size: 30px;
  }
  .carousel-control .glyphicon-chevron-left,
  .carousel-control .icon-prev {
    margin-left: -10px;
  }
  .carousel-control .glyphicon-chevron-right,
  .carousel-control .icon-next {
    margin-right: -10px;
  }
  .carousel-caption {
    left: 20%;
    right: 20%;
    padding-bottom: 30px;
  }
  .carousel-indicators {
    bottom: 20px;
  }
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
.dl-horizontal dd:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-header:before,
.modal-header:after,
.modal-footer:before,
.modal-footer:after,
.item_buttons:before,
.item_buttons:after {
  content: " ";
  display: table;
}
.clearfix:after,
.dl-horizontal dd:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-header:after,
.modal-footer:after,
.item_buttons:after {
  clear: both;
}
.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.pull-right {
  float: right !important;
}
.pull-left {
  float: left !important


    HUART2().Transmit_IT("ok1");

    loop {
        match event::catch(MASK_MAIN) {
            Some(EVENT_BUTTON) => {
                if mode == 1000 {
                    mode = 200;
//                    HUART2().SetBuffer();
//                    HUART2().Transmit_Q("OK2".as_bytes());
                } else {
                    mode = 1000;
                    HUART2().Transmit_IT("mode = 1000");
                    delay::send(100, MASK_MAIN, EVENT_TX_OKOK);
                    delay::send(200, MASK_MAIN, EVENT_TX_OKOK);
                    delay::send(1100, MASK_MAIN, EVENT_TX_OKOK);
                    delay::send(1200, MASK_MAIN, EVENT_TX_OKOK);
                }
            },
            Some(EVENT_LED_ON) => {
                GPIOA().WritePin(gpio::PIN_5, gpio::Level::High);
                delay::send(mode, MASK_MAIN, EVENT_LED_OFF);
                HUART2().Transmit_IT("ok4");
            },
            Some(EVENT_LED_OFF) => {
                GPIOA().WritePin(gpio::PIN_5, gpio::Level::Low);
                delay::send(mode, MASK_MAIN, EVENT_LED_ON);
                HUART2().Transmit_IT("ok5");
              },
            Some(EVENT_TX_OKOK) => {
                HUART2().Transmit_IT("OKOK");
              },
            _ => {},
        }

        pwr::EnterSLEEPMode(pwr::SLEEPENTRY_WFI);
    }

}

#[no_mangle]
pub extern "C" fn HAL_SYSTICK_Callback() {
    if let Some(ev) = delay::check_event(hal::GetTick()) {
        event::send(ev,ev);
    }
}

#[no_mangle]
pub extern "C" fn HAL_GPIO_EXTI_Callback(gpio_pin: u16) {
    if gpio_pin == gpio::PIN_13 {
        event::send(MASK_MAIN, EVENT_BUTTON);
    }
}

#[lang="panic_fmt"]
pub fn panic_fmt() -> ! {
    loop {}
}

#[lang="eh_personality"]
extern "C" fn eh_personality() {}

#[no_mangle]
pub fn abort() {}
#![feature(test)]

extern crate test;
use give_me_a_diamond::print;
use test::{black_box, Bencher};

#[bench]
fn bench(bencher: &mut Bencher) {
    let n = black_box(101);
    bencher.iter(|| print(n));
}
use base64::{decode, encode};
use basex_rs::{BaseX, Decode, Encode, BITCOIN};
use bitcoin::consensus::encode::{serialize, VarInt};
use ripemd::Ripemd160;
use secp256k1::Secp256k1;
use sha2::{Digest, Sha256};

pub mod error;
pub use error::CryptError as Error;

fn sha256d(input: &[u8]) -> Vec<u8> {
  let mut hasher1 = Sha256::default();
  hasher1.update(input);
  let mut hasher2 = Sha256::default();
  hasher2.update(hasher1.finalize());
  return hasher2.finalize().into_iter().collect();
}

fn hash160(input: &[u8]) -> Vec<u8> {
  let mut hasher1 = Sha256::default();
  hasher1.update(input);
  let mut hasher2 = Ripemd160::default();
  hasher2.update(hasher1.finalize());
  return hasher2.finalize().into_iter().collect();
}

fn serial


mut self,
        mode: DrawMode,
        bounds: Rect,
        radius: f32,
        color: Color,
    ) -> GameResult<&mut Self> {
        {
            let buffers = &mut self.buffer;
            let rect = tess::math::rect(bounds.x, bounds.y, bounds.w, bounds.h);
            let radii = tess::path::builder::BorderRadii::new(radius);
            let vb = VertexBuilder {
                color: LinearColor::from(color),
            };
            let mut path_builder = tess::path::Path::builder();
            path_builder.add_rounded_rectangle(&rect, &radii, tess::path::Winding::Positive);
            let path = path_builder.build();

            match mode {
                DrawMode::Fill(fill_options) => {
                    let builder = &mut tess::BuffersBuilder::new(buffers, vb);
                    let mut tessellator = tess::FillTessellator::new();
                    let _ = tessellator.tessellate_path(&path, &fill_options, builder);
                }
                DrawMode::Stroke(options) => {
                    let builder = &mut tess::BuffersBuilder::new(buffers, vb);
                    let mut tessellator = tess::StrokeTessellator::new();
                    let _ = tessellator.tessellate_path(&path, &options, builder);
                }
            };
        }
        Ok(self)
    }

    /// Create a new [`Mesh`](struct.Mesh.html) from a raw list of triangles.
    /// The length of the list must be a multiple of 3.
    ///
    /// Currently does not support UV's or indices.
    pub fn triangles<P>(&mut self, triangles: &[P], color: Color) -> GameResult<&mut Self>
    where
        P: Into<mint::Point2<f32>> + Clone,
    {
        {
            if (triangles.len() % 3) != 0 {
                return Err(GameError::LyonError(String::from(
                    "Called Mesh::triangles() with points that have a length not a multiple of 3.",
                )));
            }
            let tris = triangles
                .iter()
                .cloned()
                .map(|p| {
                    // Gotta turn ggez Point2's into lyon points
                    let mint_point = p.into();
                    lyon::math::point(mint_point.x, mint_point.y)
                })
                // Removing this collect might be nice, but is not easy.
                // We can chunk a slice, but can't chunk an arbitrary
                // iterator.
                // Using the itertools crate doesn't really make anything
                // nicer, so we'll just live with it.
                .collect::<Vec<_>>();
            let tris = tris.chunks(3);
            let vb = VertexBuilder {
                color: LinearColor::from(color),
            };
            for tri in tris {
                // Ideally this assert makes bounds-checks only happen once.
                assert!(tri.len() == 3);
                let first_index: u32 = self.buffer.vertices.len().try_into().unwrap();
                self.buffer.vertices.push(vb.new_vertex(tri[0]));
                self.buffer.vertices.push(vb.new_vertex(tri[1]));
                self.buffer.vertices.push(vb.new_vertex(tri[2]));
                self.buffer.indices.push(first_index);
                self.buffer.indices.push(first_index + 1);
                self.buffer.indices.pus


using Heroes.Contracts.HeroCategories;
using Heroes.Contracts.Heroes;
using Heroes.Contracts.Stats;

namespace Heroes.Contracts.Mocks;

// todo: perhaps store in json - load and map as needed
public static class MockDataService
{
	private static readonly List<Hero> Heroes = new List<Hero>
	{
		new Hero {Name = "Rengar", Id = "rengar", Role = HeroRoleType.Assassin, Abilities = new HashSet<string> { "savagery", "battle-roar", "bola-strike", "thrill-of-the-hunt"}, Popularity = 6},
		new Hero {Name = "Kha'zix", Id = "kha-zix", Role = HeroRoleType.Assassin, Abilities = new HashSet<string> { "taste-their-fear", "void-spike", "leap", "void-assault"}, Popularity = 4},
		new Hero {Name = "Singed", Id = "singed", Role = HeroRoleType.Tank, Abilities = new HashSet<string> { "poison-trail", "mega-adhesive", "fling", "insanity-potion"}, Popularity = 3},
		new Hero {Name = "Aatrox", Id = "aatrox", Role = HeroRoleType.Fighter, Abilities = new HashSet<string> { "darkin-blade", "infernal-chains", "umbral-dash", "world-ender"}, Popularity = 9},
		new Hero {Name = "Blitzcrank", Id = "blitzcrank", Role = HeroRoleType.Tank, Abilities = new HashSet<string> { "rocket-grab", "overdrive", "power-fist", "static-field"}, Popularity = 6},
		new Hero {Name = "Alistar", Id = "alistar", Role = HeroRoleType.Support, Abilities = new HashSet<string> { "pulverize","headbutt","trample","unbreakable-will"}, Popularity = 3},
		new Hero {Name = "Morgana", Id = "morgana", Role = HeroRoleType.Support, Abilities = new HashSet<string> { "dark-binding","tormented-shadow","black-shield","soul-shackles"}, Popularity = 8},
		new Hero {Name = "Garen", Id = "garen", Role = HeroRoleType.Fighter, Abilities = new HashSet<string> { "decisive-strike", "courage", "judgment","demacian-justice"}, Popularity = 7},
		new Hero {Name = "Ryze", Id = "ryze", Role = HeroRoleType.Mage, Abilities = new HashSet<string> { "overload","rune-prison","spell-flux","realm-warp"}, Popularity = 5},
	};

	private static readonly List<HeroCategory> HeroCategories = new List<HeroCategory>
	{
		new HeroCategory { Id = "featured", Title = "Featured", Heroes = new List<string> { "kha-zix", "aatrox" } },
		new HeroCategory { Id = "recommended", Title = "Recommended", Heroes = new


        // Choose color from palette based on the first level.
        var current = node;
        while (current && current.depth > 1) {
          current = current.parentNode;
        }
        var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);
        if (node.depth > 1 && isString(color)) {
          // Lighter on the deeper level.
          color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);
        }
        return color;
      }
      ecModel.eachSeriesByType('sunburst', function (seriesModel) {
        var data = seriesModel.getData();
        var tree = data.tree;
        tree.eachNode(function (node) {
          var model = node.getModel();
          var style = model.getModel('itemStyle').getItemStyle();
          if (!style.fill) {
            style.fill = pickColor(node, seriesModel, tree.root.height);
          }
          var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');
          extend(existsStyle, style);
        });
      });
    }

    function install$q(registers) {
      registers.registerChartView(SunburstView);
      registers.registerSeriesModel(SunburstSeriesModel);
      registers.registerLayout(curry(sunburstLayout, 'sunburst'));
      registers.registerProcessor(curry(dataFilter, 'sunburst'));
      registers.registerVisual(sunburstVisual);
      installSunburstAction(registers);
    }

    // Also compat with ec4, where
    // `visual('color') visual('borderColor')` is supported.
    var STYLE_VISUAL_TYPE = {
      color: 'fill',
      borderColor: 'stroke'
    };
    var NON_STYLE_VISUAL_PROPS = {
      symbol: 1,
      symbolSize: 1,
      symbolKeepAspect: 1,
      legendIcon: 1,
      visualMeta: 1,
      liftZ: 1,
      decal: 1
    };
    var customInnerStore = makeInner();
    var CustomSeriesModel = /** @class */function (_super) {
      __extends(CustomSeriesModel, _super);
      function CustomSeriesModel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.type = CustomSeriesModel.type;
        return _this;
      }
      CustomSeriesModel.prototype.optionUpdated = function () {
        this.currentZLevel = this.get('zlevel', true);
        this.currentZ = this.get('z', true);
      };
      CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {
        return createSeriesData(null, this);
      };
      CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {
        var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);
        el && (params.info = customInnerStore(el).info);
        return params;
      };
      CustomSeriesModel.type = 'series.custom';
      CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];
      CustomSeriesModel.defaultOption = {
        coordinateSystem: 'cartesian2d',
        // zlevel: 0,
        z: 2,
        legendHoverLink: true,
        // Custom series will not clip by default.
        // Some case will use custom series to draw label
        // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
        clip: false
        // Cartesian coordinate system
        // xAxisIndex: 0,
        // yAxisIndex: 0,
        // Polar coordinate system
        // polarIndex: 0,
        // Geo coordinate system
        // geoIndex: 0,
      };

      return Cu


)><use xlink:href=#C0_0_25f1f45ffa x=-219.800542 y=243.1125 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-219.800542 y=209.1375 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-219.800542 y=175.1625 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-219.800542 y=141.1875 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=379.0125 style="fill: #ebecee; stroke: #ebecee"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=345.0375 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=311.0625 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=277.0875 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=243.1125 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=209.1375 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=175.1625 style="fill: #f0f1f2; stroke: #f0f1f2"/></g><g clip-path=url(#pf14c7965d7)><use xlink:href=#C0_0_25f1f45ffa x=-192.745997 y=141.1875 style="fill: #f0f1f2; stroke: #f0f1f2"/></g></g><g id=patch_3><path d="M 72 346.5
L 72 47.52
" style="fill: none"/></g><g id=patch_4><path d="M 518.4 346.5
L 518.4 47.52
" style="fill: none"/></g><g id=patch_5><path d="M 72 346.5
L 518.4 346.5
" style="fill: none"/></g><g id=patch_6><path d="M 72 47.52
L 518.4 47.52
" style="fill: none"/></g></g></g><defs><clippath id=pf14c7965d7><rect x=72 y=47.52 width=446.4 height=298.98 /></clippath></defs></svg>
<div role=tabpanel class="tab-pane col-sm-12" id=interactions_age-in-days-interactions_age-in-days_income


Element<int> createElement() {
    return _PagePriorityProviderElement(this);
  }

  @override
  bool operator ==(Object other) {
    return other is PagePriorityProvider && other.pageId == pageId;
  }

  @override
  int get hashCode {
    var hash = _SystemHash.combine(0, runtimeType.hashCode);
    hash = _SystemHash.combine(hash, pageId.hashCode);

    return _SystemHash.finish(hash);
  }
}

@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin PagePriorityRef on AutoDisposeProviderRef<int> {
  /// The parameter `pageId` of this provider.
  String get pageId;
}

class _PagePriorityProviderElement extends AutoDisposeProviderElement<int>
    with PagePriorityRef {
  _PagePriorityProviderElement(super.provider);

  @override
  String get pageId => (origin as PagePriorityProvider).pageId;
}

String _$entryPageIdHash() => r'77d5208e639015cb3924cd0f7c418c768960bbfc';

/// See also [entryPageId].
@ProviderFor(entryPageId)
const entryPageIdProvider = EntryPageIdFamily();

/// See also [entryPageId].
class EntryPageIdFamily extends Family<String?> {
  /// See also [entryPageId].
  const EntryPageIdFamily();

  /// See also [entryPageId].
  EntryPageIdProvider call(
    String entryId,
  ) {
    return EntryPageIdProvider(
      entryId,
    );
  }

  @override
  EntryPageIdProvider getProviderOverride(
    covariant EntryPageIdProvider provider,
  ) {
    return call(
      provider.entryId,
    );
  }

  static const Iterable<ProviderOrFamily>? _dependencies = null;

  @override
  Iterable<ProviderOrFamily>? get dependencies => _dependencies;

  static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;

  @override
  Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
      _allTransitiveDependencies;

  @override
  String? get name => r'entryPageIdProvider';
}

/// See also [entryPageId].
class EntryPageIdProvider extends AutoDisposeProvider<String?> {
  /// See also [entryPageId].
  EntryPageIdProvider(
    String entryId,
  ) : this._internal(
          (ref) => entryPageId(
            ref as EntryPageIdRef,
            entryId,
          ),
          from: entryPageIdProvider,
          name: r'entryPageIdProvider',
          debugGetCreateSourceHash:
              const bool.fromEnvironment('dart.vm.product')
                  ? null
                  : _$entryPageIdHash,
          dependencies: EntryPageIdFamily._dependencies,
          allTransitiveDependencies:
              EntryPageIdFamily._allTransitiveDependencies,
          entryId: entryId,
        );

  EntryPageIdProvider._internal(
    super._createNotifier, {
    required super.name,
    required super.dependencies,
    required super.allTransitiveDependencies,
    required super.debugGetCreateSourceHash,
    required super.from,
    required this.entryId,
  }) : super.internal();

  final String entryId;

  @override
  Override overrideWith(
    String? Function(EntryPageIdRef provider) create,
  ) {
    return ProviderOverride(
      origin: this,
      override: EntryPageIdProvider._internal(
        (ref) => create(ref as EntryPageIdRef),
        from: from,
        name: null,
        dependencies: null,
        allTransitiveDependencies: null,
        debugGetCreateSourceHash: null,
        entryId: entryId,
      ),
    );
  }

  @override
  AutoDisposeProviderElement<String?> createElement() {
    return _EntryPageIdProviderElement(this);
  }

  @override
  bool operator ==(Object other) {
    return other is EntryPageIdProvider && other.entryId ==


CCCGTCTCT\n\
ACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGG\n\
GAGGCTGAGGCAGGAGAATC\n\
>TWO IUB ambiguity codes\n\
cttBtatcatatgctaKggNcataaaSatgtaaaDcDRtBggDtctttataattcBgtcg\n\
tactDtDagcctatttSVHtHttKtgtHMaSattgWaHKHttttagacatWatgtRgaaa\n\
NtactMcSMtYtcMgRtacttctWBacgaaatatagScDtttgaagacacatagtVgYgt\n\
cattHWtMMWcStgttaggKtSgaYaaccWStcgBttgcgaMttBYatcWtgacaYcaga\n\
gtaBDtRacttttcWatMttDBcatWtatcttactaBgaYtcttgttttttttYaaScYa\n\
HgtgttNtSatcMtcVaaaStccRcctDaataataStcYtRDSaMtDttgttSagtRRca\n\
tttHatSttMtWgtcgtatSSagactYaaattcaMtWatttaSgYttaRgKaRtccactt\n\
tattRggaMcDaWaWagttttgacatgttctacaaaRaatataataaMttcgDacgaSSt\n\
acaStYRctVaNMtMgtaggcKatcttttattaaaaagVWaHKYagtttttatttaacct\n\
tacgtVtcVaattVMBcttaMtttaStgacttagattWWacVtgWYagWVRctDattBYt\n\
gtttaagaagattattgacVatMaacattVctgtBSgaVtgWWggaKHaatKWcBScSWa\n\
accRVacacaaactaccScattRatatKVtactatatttHttaagtttSKtRtacaaagt\n\
RDttcaaaaWgcacatWaDgtDKacgaacaattacaRNWaatHtttStgttattaaMtgt\n\
tgDcgtMgcatBtgcttcgcgaDWgagctgcgaggggVtaaScNatttacttaatgacag\n\
cccccacatYScaMgtaggtYaNgttctgaMaacNaMRaacaaacaKctacatagYWctg\n\
ttWaaataaaataRattagHacacaagcgKatacBttRttaagtatttccgatctHSaat\n\
actcNttMaagtattMtgRtgaMgcataatHcMtaBSaRattagttgatHtMttaaKagg\n\
YtaaBataSaVatactWtataVWgKgttaaaacagtgcgRatatacatVtHRtVYataSa\n\
KtWaStVcNKHKttactatccctcatgWHatWaRcttactaggatctataDtDHBttata\n\
aaaHgtacVtagaYttYaKcctattcttcttaataNDaaggaaaDYgcggctaaWSctBa\n\
aNtgctggMBaKctaMVKagBaactaWaDaMaccYVtNtaHtVWtKgRtcaaNtYaNacg\n\
gtttNattgVtttctgtBaWgtaattcaagtcaVWtactNggattctttaYtaaagccgc\n\
tcttagHVggaYtgtNcDaVagctctctKgacgtatagYcctRYHDtgBattDaaDgccK\n\
tcHaaStttMcctagtattgcRgWBaVatHaaaataYtgtttagMDMRtaataaggatMt\n\
ttctWgtNtgtgaaaaMaatatRtttMtDgH


y.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.ManualClock
import aws.smithy.kotlin.runtime.time.epochMilliseconds
import aws.smithy.kotlin.runtime.util.TestPlatformProvider
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

class SsoCredentialsProviderTest {

    @Test
    fun testCacheFilename() {
        val expected = "13f9d35043871d073ab260e020f0ffde092cb14b.json"
        val actual = getCacheFilename("https://d-92671207e4.awsapps.com/start")
        assertEquals(expected, actual)
    }

    @Test
    fun testDeserializeToken() {
        val ts = Instant.fromIso8601("2020-10-16T03:56:45Z")

        val t1 = """
        {
            "accessToken": "a-token",
            "expiresAt": "2020-10-16T03:56:45Z"
        }
        """.encodeToByteArray()
        assertEquals(SsoToken("a-token", ts), deserializeSsoToken(t1))

        val t2 = """
        {
            "accessToken": "a-token",
            "expiresAt": "2020-10-16T03:56:45Z",
            "region": "us-west-2",
            "startUrl": "https://start-url"
        }
        """.encodeToByteArray()
        assertEquals(
            SsoToken("a-token", ts, region = "us-west-2", startUrl = "https://start-url"),
            deserializeSsoToken(t2),
        )

        val t3 = """
        {
            "expiresAt": "2020-10-16T03:56:45Z"
        }
        """.encodeToByteArray()
        assertFailsWith<InvalidSsoTokenException> {
            deserializeSsoToken(t3)
        }.message.shouldContain("missing `accessToken`")

        val t4 = """
        {
            "accessToken": "a-token"
        }
        """.encodeToByteArray()
        assertFailsWith<InvalidSsoTokenException> {
            deserializeSsoToken(t4)
        }.message.shouldContain("missing `expiresAt`")
    }

    @Test
    fun testExpiredToken() = runTest {
        val engine = TestConnection()

        val epoch = "2020-10-16T03:56:00Z"
        val testClock = ManualClock(epoch = Instant.fromIso8601(epoch))
        val contents = """
        {
            "accessToken": "a-token",
            "expiresAt": "2020-10-16T03:51:00Z"
        }
        """

        val key = getCacheFilename("https://expired-token")

        val testPlatform = TestPlatformProvider(
            env = mapOf("HOME" to "/home"),
            fs = mapOf("/home/.aws/sso/cache/$key" to contents),
        )

        val provider = SsoCredentialsProvider(
            accountId = "123456789",
            roleName = "TestRole",
            startUrl = "https://expired-token",
            ssoRegion = "us-east-2",
            httpClient = engine,
            platformProvider = testPlatform,
            clock = testClock,
        )

        assertFailsWith<ProviderConfigurationException> {
            provider.resolve()
        }.message.shouldContain("The SSO session has expired")
    }

    @Test
    fun testErrorResponse() = runTest {
        val engine = buildTestConnection {
            expect(
                HttpResponse(HttpStatusCode.Unauthorized, Headers.Empty, HttpBody.Empty),
            )
        }

        val epoch = "2020-10-16T03:56:00Z"
        val testClock = ManualClock(epoch = Instant.fromIso8601(epoch))
        val contents = """
        {
            "accessToken": "a-token",
            "expiresAt": "2020-10-16T05:20:00Z",
            "start


7.69|L|28552|ITEM|28552|N|Unyielding Knights at the Expedition Armory|US|
R Valley of Bones|ACTIVE|9356|M|55.82,73.51|Z|1944|QO|1|
C Smooth as Butter|QID|9356|M|65.57,62.43|L|23239 12|ITEM|23239|N|Bonestripper Buzzard\nIf needed, head back the other way until you're done.|
C Burn It Up... For the Horde!|QID|10087|M|60.90,52.50|QO|1|N|Head to the Eastern Cannon and burn it.|U|27479|NC|
C Burn It Up... For the Horde!|QID|10087|M|54.67,54.10|QO|2|N|Find the Western Cannon further west along the Path of Glory and burn it.|U|27479|NC|
R Thrallmar|ACTIVE|10087|M|56.69,37.50|N|Sprint across the Path of Glory or hearth if you can.|
T Burn It Up... For the Horde!|QID|10087|M|55.17,38.79|N|To Megzeg Nukklebust.|
A The Agony and the Darkness|QID|10389|M|55.12,36.02|N|From Magister Bloodhawk.|;this is available earlier if anyone wants to move it.
T A Strange Weapon|QID|9401|M|55.02,35.96|N|To Nazgrel.|
A The Warchief's Mandate|QID|9405|M|55.02,35.96|N|From Nazgrel.|PRE|9401|
T The Warchief's Mandate|QID|9405|M|54.23,37.90|N|To Far Seer Regulkut.|
A A Spirit Guide|QID|9410|M|54.23,37.90|N|From Far Seer Regulkut.|PRE|9405|
F Spinebreaker Ridge|ACTIVE|10229|M|56.28,36.25|
T Decipher the Tome|QID|10229|M|61.74,81.79|N|To Althen the Historian.|
A The Battle Horn|QID|10230|M|61.74,81.79|N|From Althen the Historian.|PRE|10229|
T Make Them Listen|QID|10220|M|61.78,81.71|N|To Emissary Mordiba.|
C The Battle Horn|QID|10230|M|54.8,83.7|L|28562|ITEM|28562|N|Lieutenant Commander Thalvos\nHead south to the Expedition Armory.|T|Lieutenant Commander Thalvos|
T Smooth as Butter|QID|9356|M|49.24,74.84|N|To Legassi.|
T In Case of Emergency...|QID|10161|M|49.15,74.87|N|To "Screaming" Screed Luckheed.|
A Voidwalkers Gone Wild|QID|9351|M|49.15,74.87|N|From "Screaming" Screed Luckheed.|PRE|10161|
C Voidwalkers Gone Wild|QID|9351|M|49.5,82.0|L|23218 10|ITEM|23218|N|Uncontrolled Voidwalker|S|
C The Warp Rifts|QID|10278|M|50,82|L|29051 3|ITEM|29051|N|Unstable Voidwalkers\nHead south to the Warp Fields and use the Unstable Warp Rift Generator to generate a warp rift. Kill and loot the Voidwalkers that come through.\n[color=FF0000]NOTE: [/color]The other Voidwalkers don't drop the item.|U|29027|
C Voidwalkers Gone Wild|QID|9351|M|49.5,82.0|L|23218 10|ITEM|23218|N|Uncontrolled Voidwalker\n[color=FF0000]NOTE: [/color]Unstable Voidwalkers do not drop the item.|US|
T Void


xecute("drop procedure if exists test60816_2");
            this.stmt.execute("drop procedure if exists test60816_3");
        }
    }

}package var;

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

import dna.Data;
import fileIO.TextStreamWriter;
import shared.PreParser;
import shared.Shared;
import shared.Timer;
import shared.Tools;

public class StackVariations {

	public static void main(String[] args){
		{//Preparse block for help, config files, and outstream
			PreParser pp=new PreParser(args, new Object() { }.getClass().getEnclosingClass(), false);
			args=pp.args;
			//outstream=pp.outstream;
		}

		Timer t=new Timer();

		String inPattern=args[0];
		String outPattern=args[1];

		assert(!inPattern.equalsIgnoreCase(outPattern));

		int minChrom=-1;
		int maxChrom=-1;

		boolean filter=false;

		for(String arg : args){
			final String s=arg.toLowerCase();
			String[] split=s.split("=");
			String a=split[0];
			String b=split.length>1 ? split[1] : null;

			if(a.equalsIgnoreCase("filter")){filter=true;}
			else if(a.startsWith("filter")){
				if(b.equals("1") || b.startsWith("t")){filter=true;}
				else if(b.equals("0") || b.startsWith("f")){filter=false;}
				else{throw new RuntimeException("Unknown parameter "+arg);}
			}else if(a.equalsIgnoreCase("strict")){
				if(b==null){STRICT=true;}
				else if(b.equals("1") || b.startsWith("t")){STRICT=true;}
				else if(b.equals("0") || b.startsWith("f")){STRICT=false;}
				else{throw new RuntimeException("Unknown parameter "+arg);}
			}else if(a.equals("genome") || a.equals("build")){
				Data.setGenome(Integer.parseInt(b));
				if(minChrom==-1){minChrom=1;}
				if(maxChrom==-1){maxChrom=Data.numChroms;}
			}else if(a.equals("minchrom")){
				minChrom=Integer.parseInt(b);
			}else if(a.equals("maxchrom")){
				maxChrom=Integer.parseInt(b);
			}else if(a.equals("threads") || a.equals("t")){
				THREADS=Integer.parseInt(b);
			}else{
//				System.err.println("************* "+s);
			}
		}

		assert(minChrom>=0 && maxChrom>=minChrom) : "Please set minchrom and maxchrom.";

//		for(byte i=minChrom; i<=maxChrom; i++){
//			String fname1=inPattern.replace("#", i+"");
//			String fname2=outPattern.replace("#", i+"");
//			assert(new File(fname1).exists());
//			assert(!new File(fname2).exists());
//			processFile(fname1, fname2, filter);
//		}

		runThreaded(inPattern, outPattern, minChrom, maxChrom, filter);

		t.stop();
		System.out.println("Input Vars:        \t"+(totalIn_global-totalInNR_global));
		System.out.println("Input No-ref:      \t"+totalInNR_global);
		System.out.println("Input Delta Length:\t"+deltaLenIn_global);
		System.out.println();
		System.out.println("Kept Vars:         \t"+(totalKept_global-totalKeptNR_global));
		System.out.println("Kept No-ref:       \t"+totalKeptNR_global);
		System.out.println("Kept Snp:          \t"+snpKept_global);
		System.out.println("Kept Del:          \t"+delKept_global+"\t\tLength: \t"+delLenKept_global);
		System.out.println("Kept Ins:          \t"+insKept_global+"\t\tLength: \t"+insLenKe


 on a Looper thread");
        checkNotNull(updatable);
        boolean activateNow = false;
        synchronized (token) {
            // 观察者 和 其对应的 WorkerHandler
            add(updatable, workerHandler());
            // 如果 执行 add(...) 成功了
            if (size == 1) {
                /*
                 * 1.如果 执行 BaseObservable.observableDeactivated() 的消息
                 * 还在队列中，则删除
                 *
                 * 2. 判断是否在 主线程
                 * 然后  activateNow = true
                 *
                 * 3. 如果 1. 2. 都不是
                 * 发送 执行 BaseObservable.observableActivated() 的消息
                 */
                if (handler.hasMessages(MSG_LAST_REMOVED, this)) {
                    handler.removeMessages(MSG_LAST_REMOVED, this);
                } else if (Looper.myLooper() == handler.getLooper()) {
                    activateNow = true;
                } else {
                    handler.obtainMessage(WorkerHandler.MSG_FIRST_ADDED, this).sendToTarget();
                }
            }
        }
        /*
         * 如果在主线程
         * 回调 observableActivated()
         */
        if (activateNow) {
            observableActivated();
        }
    }

    /**
     * 删除一个 观察者
     *
     * @param updatable 观察者
     */
    @Override
    public final void removeUpdatable(@NonNull final Updatable updatable) {
        checkState(Looper.myLooper() != null, "Can only be removed on a Looper thread");
        checkNotNull(updatable);
        synchronized (token) {
            // 删除 观察者 和 其对应的 Handler
            remove(updatable);
            // 如果 执行 remove(...) 成功了
            if (size == 0) {
                // 发送 执行  BaseObservable.observableDeactivated() 的 消息
                handler.obtainMessage(MSG_LAST_REMOVED, this).sendToTarget();
                // 删除 执行 BaseObservable.sendUpdate() 的 消息
                handler.removeMessages(MSG_UPDATE, this);
                // 解 dispatchUpdate() 上的 锁
                pendingUpdate = false;
            }
        }
    }

    /**
     * 通知所有观察者
     * Notifies all registered {@link Updatable}s.
     */
    protected final void dispatchUpdate() {
        synchronized (token) {
            // 检查 过程锁
            if (!pendingUpdate) {
                // 锁上
                pendingUpdate = true;
                // 发送 执行 BaseObservable.sendUpdate() 的消息
                handler.obtainMessage(MSG_UPDATE, this).sendToTarget();
            }
        }
    }

    /**
     * 添加 观察者 和 其对应的 WorkerHandler
     *
     * @param updatable 观察者
     * @param handler 观察者 的 WorkerHandler
     */
    private void add(@NonNull final Updatable updatable, @NonNull final Handler handler) {
        int indexToAdd = -1;
        for (int index = 0; index < updatablesAndHandlers.length; index += 2) {
            // 判断是否 添加过 这个 观察者
            if (updatablesAndHandlers[index] == updatable) {
                throw new IllegalStateException("Updatable already added, cannot add.");
            }
            // 存在空位，记录下来，用于添加
            if (updatablesAndHandlers[index] == null) {


onst M2tsAudioStreamType(this.value);

  static M2tsAudioStreamType fromString(String value) => values.firstWhere(
      (e) => e.value == value,
      orElse: () =>
          throw Exception('$value is not known in enum M2tsAudioStreamType'));
}

/// M2ts Buffer Model
enum M2tsBufferModel {
  multiplex('MULTIPLEX'),
  none('NONE'),
  ;

  final String value;

  const M2tsBufferModel(this.value);

  static M2tsBufferModel fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () =>
              throw Exception('$value is not known in enum M2tsBufferModel'));
}

/// M2ts Cc Descriptor
enum M2tsCcDescriptor {
  disabled('DISABLED'),
  enabled('ENABLED'),
  ;

  final String value;

  const M2tsCcDescriptor(this.value);

  static M2tsCcDescriptor fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () =>
              throw Exception('$value is not known in enum M2tsCcDescriptor'));
}

/// M2ts Ebif Control
enum M2tsEbifControl {
  none('NONE'),
  passthrough('PASSTHROUGH'),
  ;

  final String value;

  const M2tsEbifControl(this.value);

  static M2tsEbifControl fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () =>
              throw Exception('$value is not known in enum M2tsEbifControl'));
}

/// M2ts Ebp Placement
enum M2tsEbpPlacement {
  videoAndAudioPids('VIDEO_AND_AUDIO_PIDS'),
  videoPid('VIDEO_PID'),
  ;

  final String value;

  const M2tsEbpPlacement(this.value);

  static M2tsEbpPlacement fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () =>
              throw Exception('$value is not known in enum M2tsEbpPlacement'));
}

/// M2ts Es Rate In Pes
enum M2tsEsRateInPes {
  exclude('EXCLUDE'),
  include('INCLUDE'),
  ;

  final String value;

  const M2tsEsRateInPes(this.value);

  static M2tsEsRateInPes fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () =>
              throw Exception('$value is not known in enum M2tsEsRateInPes'));
}

/// M2ts Klv
enum M2tsKlv {
  none('NONE'),
  passthrough('PASSTHROUGH'),
  ;

  final String value;

  const M2tsKlv(this.value);

  static M2tsKlv fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () => throw Exception('$value is not known in enum M2tsKlv'));
}

/// M2ts Nielsen Id3 Behavior
enum M2tsNielsenId3Behavior {
  noPassthrough('NO_PASSTHROUGH'),
  passthrough('PASSTHROUGH'),
  ;

  final String value;

  const M2tsNielsenId3Behavior(this.value);

  static M2tsNielsenId3Behavior fromString(String value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () => throw Exception(
              '$value is not known in enum M2tsNielsenId3Behavior'));
}

/// M2ts Pcr Control
enum M2tsPcrControl {
  configuredPcrPeriod('CONFIGURED_PCR_PERIOD'),
  pcrEveryPesPacket('PCR_EVERY_PES_PACKET'),
  ;

  final String value;

  const M2tsPcrControl(this.value);

  static M2tsPcrControl fromString(String


ackground-size:cover;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E  %3Cg fill='none' fill-rule='evenodd'%3E    %3Cpath d='M0 0h16v16H0z'/%3E    %3Cpath fill='%23FA9D3B' fill-rule='nonzero' d='M14.163 3.198c.144.364.208.898.207 1.535l-.002.194-.014.37-.026.388-.03.32-.017.163-.04.333-.046.338-.053.343-.06.347-.064.35-.09.437-.096.437-.083.348-.088.344-.092.34-.096.334-.15.487-.104.314-.108.304-.11.293-.055.141-.113.273c-.457 1.063-.958 1.776-1.42 1.776-.508 0-1.024-.432-1.625-1.208a14.532 14.532 0 0 1-.85-1.246c-.234-.38-.464-.778-.686-1.182L8 9.6l-.118.225c-.218.406-.444.807-.674 1.189l-.23.375-.096.15-.187.288-.183.269c-.722 1.035-1.342 1.61-1.923 1.61-.44 0-.916-.646-1.355-1.626l-.066-.149-.169-.414-.11-.293-.08-.227-.08-.232-.102-.319-.1-.327-.095-.334-.092-.34-.088-.344-.083-.348-.097-.437-.122-.613-.062-.348-.056-.345-.05-.341-.043-.335-.037-.329-.03-.32-.025-.388-.014-.37c-.015-.723.046-1.328.205-1.729.32-.806.927-1.084 1.641-.792.523.213 1.104.726 1.753 1.495a19.92 19.92 0 0 1 1.209 1.612c.37.541.733 1.112 1.08 1.69l.368.62.112.194.221-.38c.425-.724.877-1.448 1.34-2.124.416-.61.821-1.154 1.208-1.612.65-.77 1.23-1.282 1.753-1.495.714-.292 1.322-.014 1.641.792zM3.1 3.332c-.156-.064-.202-.066-.28.108l-.053.127c-.086.216-.138.626-.138 1.159l.002.163.013.34.024.365.027.3.034.312.041.318.048.325.053.33.059.329.117.591.094.422.08.333.083.33.088.325.091.32.095.31.098.304.074.22.075.21.1.266.158.39.062.143c.17.377.335.677.482.88l.061.082.017.02a1.12 1.12 0 0 0 .09-.068l.108-.097.125-.127c.067-.071.14-.154.219-.249l.164-.207c.058-.074.117-.154.18-.24l.094-.133.171-.252.18-.277.089-.138.225-.367c.161-.268.324-.551.485-.843l.16-.295.297-.568-.265-.461-.362-.613a34.847 34.


基础。",
      "domain_type": "核心业务域",
      "importance": 8.5,
      "name": "代码智能分析域",
      "sub_modules": [
        {
          "code_paths": [
            "src/generator/preprocess/extractors/language_processors/mod.rs"
          ],
          "description": "统一调度各类语言处理器，根据文件类型动态选择合适的解析策略。",
          "importance": 0.9,
          "key_functions": [
            "管理多语言处理器实例",
            "路由解析请求到具体处理器"
          ],
          "name": "语言处理器管理器"
        },
        {
          "code_paths": [
            "src/generator/preprocess/extractors/language_processors/typescript.rs"
          ],
          "description": "解析TypeScript文件，提取依赖、接口及JSDoc注释。",
          "importance": 0.8,
          "key_functions": [
            "识别import语句",
            "提取类与接口定义"
          ],
          "name": "TypeScript处理器"
        },
        {
          "code_paths": [
            "src/generator/preprocess/extractors/language_processors/rust.rs"
          ],
          "description": "专用于Rust语言的语法分析，识别use/mod语句及文档注释。",
          "importance": 0.8,
          "key_functions": [
            "提取外部依赖",
            "识别函数与结构体"
          ],
          "name": "Rust处理器"
        }
      ]
    },
    {
      "code_paths": [
        "src/config.rs",
        "src/memory/mod.rs"
      ],
      "complexity": 7.0,
      "description": "提供全局配置管理和运行时状态存储能力，支撑系统各组件的协同工作。",
      "domain_type": "基础设施域",
      "importance": 8.0,
      "name": "配置与状态管理域",
      "sub_modules": [
        {
          "code_paths": [
            "src/config.rs"
          ],
          "description": "管理系统所有配置项，支持TOML格式序列化与默认值注入。",
          "importance": 0.9,
          "key_functions": [
            "加载项目配置文件",
            "推断项目名称",
            "提供LLM提供商枚举"
          ],
          "name": "配置管理器"
        },
        {
          "code_paths": [
            "src/memory/mod.rs"
          ],
          "description": "在运行时存储和检索序列化数据，支持作用域隔离与元数据追踪。",
          "importance": 0.8,
          "key_functions": [
            "按作用域组织数据",
            "统计内存使用情况"
          ],
          "name": "内存管理器"
        }
      ]
    },
    {
      "code_paths": [
        "src/llm/client/mod.rs",
        "src/llm/client/providers.rs",
        "src/llm/client/agent_builder.rs",
        "src/llm/client/react_executor.rs",
        "src/llm/client/utils.rs"


ags[index], aCppArg, "Preprocessor argument '" + aCppArg + "'");
        });
        assert.equal(unitUnderTest.cxxFlags.length, 1, "C++ compiler flag count");
        assert.equal(unitUnderTest.cxxFlags[0], "-std=gnu++11", "C++ Compiler flag '-std=gnu++11'");
        assert.equal(unitUnderTest.objcFlags.length, 0, "Objective-C compiler flag count");
        assert.strictEqual(unitUnderTest.language, CmakeCompileCmd.LANG_CXX, "Source file language");
    });

    test("Typical Cross Compile Harvest (GCC, C++)", () => {
        let cmakeCompileCmd = {
            directory: "/home/me/Documents/Projects/MyProject/build",
            command: "armv7-none-linux-gnueabi-g++ -D_DEBUG -D_POSIX_C_SOURCE=200112L --sysroot=/opt/yocto/sysroots/armv7-none-linux-gnueabi -I. -I../src -I/opt/coredx/target/include -std=gnu++11 -g -O2 -c -o main.o main.cxx",
            file: "/home/me/Documents/Projects/MyProject/src/main.cxx"
        };

        let unitUnderTest : CmakeCompileCmd = new CmakeCompileCmd(cmakeCompileCmd);
        assert.equal(unitUnderTest.cFlags.length, 1, "C compiler flag count");
        [
            "--sysroot=/opt/yocto/sysroots/armv7-none-linux-gnueabi"
        ].forEach((aCFlag : string, index : number) => {
            assert.equal(unitUnderTest.cFlags[index], aCFlag, "C Compiler flag '" + aCFlag + "'");
        });
        assert.equal(unitUnderTest.cppFlags.length, 5, "Preprocessor flag count");
        [
            "-D_DEBUG",
            "-D_POSIX_C_SOURCE=200112L",
            "-I/home/me/Documents/Projects/MyProject/build",
            "-I/home/me/Documents/Projects/MyProject/src",
            "-I/opt/coredx/target/include"
        ].forEach((aCppArg : string, index : number) => {
            assert.equal(unitUnderTest.cppFlags[index], aCppArg, "Preprocessor argument '" + aCppArg + "'");
        });
        assert.equal(unitUnderTest.cxxFlags.length, 2, "C++ compiler flag count");
        [
            "-std=gnu++11",
            "--sysroot=/opt/yocto/sysroots/armv7-none-linux-gnueabi"
        ].forEach((aCxxFlag : string, index : number) => {
            assert.equal(unitUnderTest.cxxFlags[index], aCxxFlag, "C++ Compiler flag '" + aCxxFlag + "'");
        });
        assert.equal(unitUnderTest.objcFlags.length, 0, "Objective-C compiler flag count");
        assert.strictEqual(unitUnderTest.language, CmakeCompileCmd.LANG_CXX, "Source file language");
    });

    test("Typical Cross Compile Harvest (CLang, C++)", () => {
        let cmakeCompileCmd = {
            directory: "/home/me/Documents/Projects/MyProject/build",
            command: "clang++ -D_DEBUG -D_POSIX_C_SOURCE=200112L -target armv7-none-linux-gnueabi --sysroot=/opt/yocto/sysroots/armv7-none-linux-gnueabi -I. -I../src -I/opt/coredx/target/include -std=c++11 -g -O2 -c -o main.o main.cc",
            file: "/home/me/Documents/Projects/MyProject/src/main.cc"
        };

        let unitUnderTest : CmakeCompileCmd = new CmakeCompileCmd(cmakeCompileCmd);
        assert.equal(unitUnderTest.cFlags.length, 3, "C compiler flag count");


ide IDeepCloneable Clone(Cloner cloner) {
      return new Problem(this, cloner);
    }
    #endregion

    public Problem()
      : base() {
      Parameters.Add(new FixedValueParameter<IntValue>(LawnWidthParameterName, "Width of the lawn.", new IntValue(8)));
      Parameters.Add(new FixedValueParameter<IntValue>(LawnLengthParameterName, "Length of the lawn.", new IntValue(8)));

      var g = new SimpleSymbolicExpressionGrammar();
      g.AddSymbols(new string[] { "Sum", "Prog" }, 2, 2);
      g.AddSymbols(new string[] { "Frog" }, 1, 1);
      g.AddTerminalSymbols(new string[] { "Left", "Forward" });
      // initialize 20 ephemeral random constants in [0..32[
      var fastRand = new FastRandom(314159);
      for (int i = 0; i < 20; i++) {
        g.AddTerminalSymbol(string.Format("{0},{1}", fastRand.Next(0, 32), fastRand.Next(0, 32)));
      }

      Encoding = new SymbolicExpressionTreeEncoding(g, 1000, 17);
    }

    public override void Analyze(ISymbolicExpressionTree[] trees, double[] qualities, ResultCollection results, IRandom random) {
      const string bestSolutionResultName = "Best Solution";
      var bestQuality = Maximization ? qualities.Max() : qualities.Min();
      var bestIdx = Array.IndexOf(qualities, bestQuality);

      if (!results.ContainsKey(bestSolutionResultName)) {
        results.Add(new Result(bestSolutionResultName, new Solution(trees[bestIdx], LawnLengthParameter.Value.Value, LawnWidthParameter.Value.Value, bestQuality)));
      } else if (((Solution)(results[bestSolutionResultName].Value)).Quality < qualities[bestIdx]) {
        results[bestSolutionResultName].Value = new Solution(trees[bestIdx], LawnLengthParameter.Value.Value, LawnWidthParameter.Value.Value, bestQuality);
      }
    }

    public override double Evaluate(ISymbolicExpressionTree tree, IRandom random) {
      var length = LawnLengthParameter.Value.Value;
      var width = LawnWidthParameter.Value.Value;

      var lawn = Interpreter.EvaluateLawnMowerProgram(length, width, tree);
      // count number of squares that have been mowed
      int numberOfMowedCells = 0;
      for (int i = 0; i < length; i++)
        for (int j = 0; j < width; j++)
          if (lawn[i, j]) {
            numberOfMowedCells++;
          }
      return numberOfMowedCells;
    }
  }
}


pe.SEQUENCE, true, [
    // CertificationRequestInfo
    cri,
    // AlgorithmIdentifier (signature algorithm)
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
      // algorithm
      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
        asn1.oidToDer(csr.signatureOid).getBytes()),
      // parameters
      _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters)
    ]),
    // signature
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
      String.fromCharCode(0x00) + csr.signature)
  ]);
};

/**
 * Creates a CA store.
 *
 * @param certs an optional array of certificate objects or PEM-formatted
 *          certificate strings to add to the CA store.
 *
 * @return the CA store.
 */
pki.createCaStore = function(certs) {
  // create CA store
  var caStore = {
    // stored certificates
    certs: {}
  };

  /**
   * Gets the certificate that issued the passed certificate or its
   * 'parent'.
   *
   * @param cert the certificate to get the parent for.
   *
   * @return the parent certificate or null if none was found.
   */
  caStore.getIssuer = function(cert) {
    var rval = getBySubject(cert.issuer);

    // see if there are multiple matches
    /*if(forge.util.isArray(rval)) {
      // TODO: resolve multiple matches by checking
      // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc.
      // FIXME: or alternatively do authority key mapping
      // if possible (X.509v1 certs can't work?)
      throw new Error('Resolving multiple issuer matches not implemented yet.');
    }*/

    return rval;
  };

  /**
   * Adds a trusted certificate to the store.
   *
   * @param cert the certificate to add as a trusted certificate (either a
   *          pki.certificate object or a PEM-formatted certificate).
   */
  caStore.addCertificate = function(cert) {
    // convert from pem if necessary
    if(typeof cert === 'string') {
      cert = forge.pki.certificateFromPem(cert);
    }

    // produce subject hash if it doesn't exist
    if(!cert.subject.hash) {
      var md = forge.md.sha1.create();
      cert.subject.attributes =  pki.RDNAttributesAsArray(
        _dnToAsn1(cert.subject), md);
      cert.subject.hash = md.digest().toHex();
    }

    if(cert.subject.hash in caStore.certs) {
      // subject hash already exists, append to array
      var tmp = caStore.certs[cert.subject.hash];
      if(!forge.util.isArray(tmp)) {
        tmp = [tmp];
      }
      tmp.push(cert);
    } else {
      caStore.certs[cert.subject.hash] = cert;
    }
  };

  /**
   * Checks to see if the given certificate is in the store.
   *
   * @param cert the certificate to check.
   *
   * @return true if the certificate is in the store, false if not.
   */
  caStore.hasCertificate = function(cert) {
    var match = getBySubject(cert.subject);
    if(!match) {
      return false;
    }
    if(!forge.util.isArray(match)) {
      match = [match];
    }
    // compare DER-encoding of certificates
    var der1


  String debugString(String instance) {
    final sb = StringBuffer();
    sb.write('"');
    var start = 0;
    for (var i = 0; i < instance.length; i++) {
      if (i == 64 && instance.length > 128) {
        sb.write(instance.substring(start, i));
        sb.write('" ... "');
        i = instance.length - 64;
        start = i;
        i--; // Because of i++
        continue;
      }
      final c = instance.codeUnitAt(i);
      if (c < 32 || c == 127) {
        sb.write(instance.substring(start, i));
        start = i + 1;
        sb.write(_escapedChar(c));
      }
    }
    sb.write(instance.substring(start));
    sb.write('"');
    return sb.toString();
  }

  @override
  String decodeJsonTree(Object? json) {
    if (json is String) {
      return json;
    }
    throw JsonDecodingError.expectedString(json);
  }

  @override
  String decodeString(String string) {
    return string;
  }

  @override
  Object? encodeJsonTree(String instance) {
    return instance;
  }

  @override
  String encodeString(String instance) {
    return instance;
  }

  @override
  bool isValid(String instance) {
    final maxLines = this.maxLines;
    if (maxLines != null) {
      var n = maxLines;
      if (n < 1) {
        return false;
      }
      for (var i = 0; i < instance.length; i++) {
        if (instance.codeUnitAt(i) == 10) {
          n--;
          if (n < 1) {
            return false;
          }
        }
      }
    }
    final lengthInUtf16 = this.lengthInUtf16;
    if (lengthInUtf16 != null && !lengthInUtf16.isValid(instance.length)) {
      return false;
    }
    final lengthInUtf8 = this.lengthInUtf8;
    if (lengthInUtf8 != null &&
        !lengthInUtf8.isValid(utf8.encode(instance).length)) {
      return false;
    }
    final regExp = this.regExp;
    if (regExp != null && !regExp.hasMatch(instance)) {
      return false;
    }
    return super.isValid(instance);
  }

  @override
  int memorySize(String value) {
    return 32 + (2 * value.length + 7) ~/ 8 * 8;
  }

  @override
  String newInstance() {
    return '';
  }

  @override
  String permute(String instance) {
    //
    // We use simplified alphabet A-Z
    //
    if (instance.isEmpty) {
      return 'A';
    }
    final runes = instance.runes.toList();
    const A = 0x41;
    const Z = 0x5a;
    for (var i = runes.length - 1; i >= 0; i--) {
      final rune = runes[i];
      if (rune < Z) {
        runes[i] = min<int>(rune + 1, A);
        return String.fromCharCodes(runes);
      }
      runes[i] = A;
    }
    return '${instance}A';
  }

  @override
  String toString() {
    return kindForKind.debugString(this);
  }

  static String _escapedChar(int value) {
    switch (value) {
      case 9:
        return r'\t';
      case 10:
        return r'\n';
      case 11:
        return r'\v';
      case 13:
        return r'\r';
      default:
        return '\\x${value.toRadixString(16).padLeft(2, '0')}';
    }
  }

  static StringKind _kindMapper(Mapper f, StringKind t) {
    final maxLines = f(t.maxLines, 'maxLines');
    final lengthInUtf8 = f(
      t.lengthInUtf8,
      'lengthInUtf8',
      kind: IntKind.kindForKind,
    );
    final lengthInUtf16 = f(
      t.lengthInUtf16,


AAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0}.swagger-ui .border-box,.swagger-ui a,.swagger-ui article,.swagger-ui body,.swagger-ui code,.swagger-ui dd,.swagger-ui div,.swagger-ui dl,.swagger-ui dt,.swagger-ui fieldset,.swagger-ui footer,.swagger-ui form,.swagger-ui h1,.swagger-ui h2,.swagger-ui h3,.swagger-ui h4,.swagger-ui h5,.swagger-ui h6,.swagger-ui header,.swagger-ui html,.swagger-ui input[type=email],.swagger-ui input[type=number],.swagger-ui input[type=password],.swagger-ui input[type=tel],.swagger-ui input[type=text],.swagger-ui input[type=url],.swagger-ui legend,.swagger-ui li,.swagger-ui main,.swagger-ui ol,.swagger-ui p,.swagger-ui pre,.swagger-ui section,.swagger-ui table,.swagger-ui td,.swagger-ui textarea,.swagger-ui th,.swagger-ui tr,.swagger-ui ul{-webkit-box-sizing:border-box;box-sizing:border-box}.swagger-ui .aspect-ratio{height:0;position:relative}.swagger-ui .aspect-ratio--16x9{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1{padding-bottom:100%}.swagger-ui .aspect-ratio--object{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}@media screen and (min-width:30em){.swagger-ui .aspect-ratio-ns{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-ns{padding-bottom:56.


�손을 입수한 후 황천의 폭풍의 중앙 생태지구 내의 중앙 생태지구 주둔지에 있는 휠러 아줌마에게 가져가야 합니다."}},
[10236] = {"지긋지긋한 아웃랜드!", nil, {"절단기 예비 부품 6개를 찾은 후에 스랄마의 북서쪽 광산 옆에 있는 현장감독 라젤크라즈에게 돌아가야 합니다."}},
[10237] = {"52번 구역에 통보!", nil, {"황천의 폭풍의 52번 구역에 있는 로켓발사단장 퓨즐라지에게 지옥절단기 건축 설명서와 함께 좋지 않은 소식을 전해줘야 합니다."}},
[10238] = {"고블린을 돕는 법", nil, {"타락한 오크 야영지에서 만니, 모흐, 자크를 구출한 후에 스랄마의 북서쪽 광산 옆에 있는 현장감독 라젤크라즈에게 돌아가야 합니다."}},
[10239] = {"잠재적인 마력의 원천", nil, {"키린바르 마을의 마술사 부관 모란이 코루 마나괴철로에서 일하는 블러드 엘프로부터 마력 분리 용기 10개를 입수해 달라고 부탁했습니다."}},
[10240] = {"새로운 보호막 만들기", nil, {"키린바르 마을의 마법사 지구와 광장 주변에서 볼 수 있는 동쪽, 북동쪽, 서쪽에 있는 키린바르 룬에 룬 활성화 장치를 사용하여 임무를 완수한 후 마술사 부관 모란에게 돌아가야 합니다."}},
[10241] = {"브나르 마나괴철로 교란", nil, {"성난태양 마법학자 8명과 성난태양 붉은경비병 8명을 처치한 후 52번 구역에 있는 총독 오렐리스에게 돌아가야 합니다.\n


 bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "RTCTIME register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rtctime](index.html) module"]
pub struct RTCTIME_SPEC;
impl crate::RegisterSpec for RTCTIME_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [rtctime::R](R) reader structure"]
impl crate::Readable for RTCTIME_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [rtctime::W](W) writer structure"]
impl crate::Writable for RTCTIME_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets RTCTIME to value 0"]
impl crate::Resettable for RTCTIME_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
use core::cmp::Ordering;
use core::future::Future;
use core::pin::Pin;

use pin_project_lite::pin_project;

use super::fuse::Fuse;
use crate::stream::stream::StreamExt;
use crate::stream::Stream;
use crate::task::{Context, Poll};

pin_project! {
    // Lexicographically compares the elements of this `Stream` with those
    // of another using `Ord`.
    #[doc(hidden)]
    #[allow(missing_debug_implementations)]
    pub struct CmpFuture<L: Stream, R: Stream> {
        #[pin]
        l: Fuse<L>,
        #[pin]
        r: Fuse<R>,
        l_cache: Option<L::Item>,
        r_cache: Option<R::Item>,
    }
}

impl<L: Stream, R: Stream> CmpFuture<L, R> {
    pub(super) fn new(l: L, r: R) -> Self {
        Self {
            l: l.fuse(),
            r: r.fuse(),
            l_cache: None,
            r_cache: None,
        }
    }
}

impl<L: Stream, R: Stream> Future for CmpFuture<L, R>
where
    L: Stream + Sized,
    R: Stream<Item = L::Item> + Sized,
    L::Item: Ord,
{
    type Output = Ordering;

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        let mut this = self.project();
        loop {
            // Stream that completes earliest can be considered Less, etc
            let l_complete = this.l.done && this.l_cache.is_none();
            let r_complete = this.r.done && this.r_cache.is_none();

            if l_complete && r_complete {
                return Poll::Ready(Ordering::Equal);
            } else if l_complete {
                return Poll::Ready(Ordering::Less);
            }


l")
-- Remoר add Start 2025.06.25
local remo_sim_select = get_nv_value("remo_sim_select_display_type")
local remo_root_server_url = get_nv_value("fota_request_host")
local remo_root_server_url2 = get_nv_value("remo_fota_request_host")
local remo_root_server_url3 = get_nv_value("remo_dm_request_host")
local remo_root_server_port3 = get_nv_value("remo_dm_request_port")
local remo_root_server_path3 = get_nv_value("remo_dm_request_path")
local remo_config_server_url = get_nv_value("xinxun_iot_http_get_config_host")
local remo_config_server_path = get_nv_value("xinxun_iot_http_get_config_path")
local remo_led_server_url = get_nv_value("xinxun_iot_http_led_control_host")
local remo_led_server_path = get_nv_value("xinxun_iot_http_led_control_path")
local remo_flow_server_url = get_nv_value("xinxun_iot_http_flow_report_host")
local remo_flow_server_path = get_nv_value("xinxun_iot_http_flow_report_path")
local remo_info_server_url = get_nv_value("xinxun_iot_http_info_report_host")
local remo_info_server_path = get_nv_value("xinxun_iot_http_info_report_path")
-- Remoר add End
local fota_updateMode = get_nv_value("fota_updateMode")
local fota_updateIntervalDay = get_nv_value("fota_updateIntervalDay")
local fota_version_delta_url = get_nv_value("fota_version_delta_url")
local tc_enable = get_nv_value("tc_enable")
local tc_uplink = get_nv_value("tc_uplink")
local tc_downlink = get_nv_value("tc_downlink")

--
os.execute("cls")

-- ʾ
if intype ~= "" then
	print(colors.green .. colors.bright .. "豸: " .. intype .. "          صƽ̨:" .. fota_platform .. colors.reset)
else
	print(colors.cyan .. colors.bright .. "TTTTTT ϵͳϢTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" .. colors.reset)
	print(colors.red .. colors.bright .. "޷ȡ豸صƽ̨" .. colors.reset)
end
if remo_web_sw_version ~= "" then
	print(colors.yellow .. colors.bright .. "汾: " .. remo_web_sw_version .. colors.reset)
elseif cr_version ~= "" then
	print(colors.yellow .. colors.bright .. "汾: " .. cr_version .. colors.reset)
else
	print(colors.red .. colors.bright .. "޷ȡ汾" .. colors.reset)
end
if hw_version ~= "" then
	print(colors.yellow .. colors.bright .. "Ӳ汾: " .. hw_version .. colors.reset)
else
	print(colors.red .. colors.bright .. "޷ȡӲ汾" .. colors.reset)
end
if os_url ~= "" then
	print("ҹ: " .. os_url)
else
	print(colors.red .. colors.bright .. "ҹ:޷ȡ,Ϊ


1 1 1", ""),
            "1 1 1 1 1"
        );
    }
}
<gh_stars>0
use std::fs::{self, File};
use std::io::prelude::*;
use std::thread;

use support::{project, execs, path2url};
use support::COMPILING;
use support::paths::CargoPathExt;
use hamcrest::{assert_that, existing_file};

fn setup() {}

test!(modifying_and_moving {
    let p = project("foo")
        .file("Cargo.toml", r#"
            [package]
            name = "foo"
            authors = []
            version = "0.0.1"
        "#)
        .file("src/main.rs", r#"
            mod a; fn main() {}
        "#)
        .file("src/a.rs", "");

    assert_that(p.cargo_process("build"),
                execs().with_status(0).with_stdout(format!("\
{compiling} foo v0.0.1 ({dir})
", compiling = COMPILING, dir = path2url(p.root()))));

    assert_that(p.cargo("build"),
                execs().with_status(0).with_stdout(""));
    p.root().move_into_the_past().unwrap();
    p.root().join("target").move_into_the_past().unwrap();

    File::create(&p.root().join("src/a.rs")).unwrap()
         .write_all(b"fn main() {}").unwrap();
    assert_that(p.cargo("build"),
                execs().with_status(0).with_stdout(format!("\
{compiling} foo v0.0.1 ({dir})
", compiling = COMPILING, dir = path2url(p.root()))));

    fs::rename(&p.root().join("src/a.rs"), &p.root().join("src/b.rs")).unwrap();
    assert_that(p.cargo("build"),
                execs().with_status(101));
});

test!(modify_only_some_files {
    let p = project("foo")
        .file("Cargo.toml", r#"
            [package]
            name = "foo"
            authors = []
            version = "0.0.1"
        "#)
        .file("src/lib.rs", "mod a;")
        .file("src/a.rs", "")
        .file("src/main.rs", r#"
            mod b;
            fn main() {}
        "#)
        .file("src/b.rs", "")
        .file("tests/test.rs", "");

    assert_that(p.cargo_process("build"),
                execs().with_status(0).with_stdout(format!("\
{compiling} foo v0.0.1 ({dir})
", compiling = COMPILING, dir = path2url(p.root()))));
    assert_that(p.cargo("test"),
                execs().with_status(0));
    thread::sleep_ms(1000);

    assert_that(&p.bin("foo"), existing_file());

    let lib = p.root().join("src/lib.rs");
    let bin = p.root().join("src/b.rs");

    File::create(&lib).unwrap().write_all(b"invalid rust code").unwrap();
    File::create(&bin).unwrap().write_all(b"fn foo() {}").unwrap();
    lib.move_into_the_past().unwrap();

    // Make sure the binary is rebuilt, not the lib
    assert_that(p.cargo("build")
                 .env("RUST_LOG", "cargo::ops::cargo_rustc::fingerprint"),
                execs().with_status(0).with_stdout(format!("\
{compiling} foo v0.0.1 ({dir})
", compiling = COMPILING, dir = path2url(p.root()))));
    assert_that(&p.bin("foo"), existing_file());
});

test!(rebuild_sub_package_then_while_package {
    let p = project("foo")
        .file("Cargo


際量測值：每個內部節點值是子節點的總和。

樹狀目錄的使用允許量測值分成進一步的目錄、次目錄、次次目錄…….如果需要可到任意深度。一個目錄中所有的量測值不會重疊。

樹狀可以用斜線 '/' 作為分隔符號被描寫。 例如， preference/referent/weak/dead 表示上列中到最後枝葉節點的路徑。

次目錄按它可以被縮起或展開。如果你發現任何特別的樹狀目錄，這可以幫你馬上縮起主根下所有分枝，然後慢慢展開感興趣的。

報告區間 Sections

記憶體報告依照每個預處理原則、每個區間一個程序被顯示，在每個程序的量測值中，還有更多小區間。

Explicit Allocations

這個區間包含一個單一樹狀目錄，叫做 "explicit"，量測所有經由表層呼叫(explicit calls)去堆疊配置函數和非堆疊配置函數(例如 mmap and VirtualAlloc)的記憶體。

這裡是瀏覽器區間的例子，分頁打開了 cnn.com、 techcrunch.com、 和 arstechnica.com。不同的次目錄被展開，其他的因展示緣故被縮起。

191.89 MB (100.0%) -- explicit
├───63.15 MB (32.91%) -- window-objects
│   ├──24.57 MB (12.80%) -- top(http://edition.cnn.com/, id=8)
│   │  ├──20.18 MB (10.52%) -- active
│   │  │  ├──10.57 MB (05.51%) -- window(http://edition.cnn.com/)
│   │  │  │  ├───4.55 MB (02.37%) ++ js-compartment(http://edition.cnn.com/)
│   │  │  │  ├───2.60 MB (01.36%) ++ layout
│   │  │  │  ├───1.94 MB (01.01%) ── style-sheets
│   │  │  │  └───1.48 MB (00.77%) -- (2 tiny)
│   │  │  │      ├──1.43 MB (00.75%) ++ dom
�


? fontSize;

  /// Height for the unread count widget.
  final double? height;

  /// Width for the unread count widget.
  final double? width;

  /// Decoration for the unread count widget.
  final BoxDecoration? decoration;

  /// Style for the unread count in the user widget.
  ///
  /// Defaults to `UnreadCountStyle.dot`.
  final UnreadCountStyle style;

  /// Text styles for the unread count widget.
  final TextStyle? textStyle;

  /// Maximum number of lines for the unread count text.
  ///
  /// Defaults to `1`.
  final int? maxLines;

  /// Custom text scaler for the unread count text.
  ///
  /// Defaults to `TextScaler.noScaling`.
  final TextScaler? textScaler;

  /// Custom widget builder for the unread count widget.
  final UnreadCountWidgetBuilder? countWidgetBuilder;
}
// This code is sourced from the timeago package available on pub.dev. link: https://pub.dev/packages/timeago

import 'package:chatview/src/utils/timeago/en_messages.dart';
import 'package:chatview/src/utils/timeago/lookupmessages.dart';
import 'package:flutter/foundation.dart';

String _default = 'en';

Map<String, LookupMessages> _lookupMessagesMap = {
  'en': EnMessages(),
  'en_short': EnShortMessages(),
};

/// Sets the default [locale]. By default it is `en`.
///
/// Example
/// ```
/// setLocaleMessages('fr', FrMessages());
/// setDefaultLocale('fr');
/// ```
void setDefaultLocale(String locale) {
  assert(_lookupMessagesMap.containsKey(locale),
      '[locale] must be a registered locale');
  _default = locale;
}

/// Sets a [locale] with the provided [lookupMessages] to be available when
/// using the [format] function.
///
/// Example:
/// ```dart
/// setLocaleMessages('fr', FrMessages());
/// ```
///
/// If you want to define locale message implement [LookupMessages] interface
/// with the desired messages
///
void setLocaleMessages(String locale, LookupMessages lookupMessages) {
  _lookupMessagesMap[locale] = lookupMessages;
}

/// Formats provided [date] to a fuzzy time like 'a moment ago'
///
/// - If [locale] is passed will look for message for that locale, if you want
///   to add or override locales use [setLocaleMessages]. Defaults to 'en'
/// - If [clock] is passed this will be the point of reference for calculating
///   the elapsed time. Defaults to DateTime.now()
/// - If [allowFromNow] is passed, format will use the From prefix, ie. a date
///   5 minutes from now in 'en' locale will display as "5 minutes from now"
String format(DateTime date,
    {String? locale, DateTime? clock, bool allowFromNow = false}) {
  final locale0 = locale ?? _default;
  if (_lookupMessagesMap[locale0] == null) {
    debugPrint(
        "Locale [$locale0] has not been added, using [$_default] as fallback. To add a locale use [setLocaleMessages]");
  }
  final allowFromNow0 = allowFromNow;
  final messages = _lookupMessagesMap[locale0] ?? EnMessages();
  final clock0 = clock ?? DateTime.now();
  var elapsed = clock0.millisecondsSinceEpoch - date.millisecondsSinceEpoch;

  String prefix, suffix;

  if (allowFromNow0 && elapsed < 0) {
    elapsed = date.isBefore(clock0) ? elapsed : elapsed.abs();
    prefix = messages.prefixFromNow();
    suffix = messages.suffixFromNow();
  } else {
    prefix = messages.prefixAgo();
    suffix = messages.suffixAgo();
  }

  final num seconds = elapsed / 1000;
  final num minutes = seconds / 60;
  final num hours = minutes / 60;
  final num days = hours / 24;
  final num months = days / 30;
  final num years = days / 365;

  String result;
  if (seconds < 45) {
    result = messages.lessThanOneMinute(seconds.round());
  } else if (seconds < 90) {
    result = messages.aboutAMinute(minutes.round


: 0x%x", blockchain.CompactToBig(0x170331db))
}

func TestIndexNoFork(t *testing.T) {
	ctx, cancel := context.WithTimeout(t.Context(), 17*time.Second)
	defer func() {
		cancel()
	}()

	port := testutil.FreePort()
	n, err := newFakeNode(t, port)
	if err != nil {
		t.Fatal(err)
	}

	defer func() {
		err := n.Stop()
		if err != nil {
			t.Logf("node stop: %v", err)
		}
	}()

	go func() {
		if err := n.Run(ctx); !errorIsOneOf(err, []error{net.ErrClosed, context.Canceled, rawpeer.ErrNoConn}) {
			panic(err)
		}
	}()
	time.Sleep(250 * time.Millisecond)

	// Connect tbc service
	cfg := &Config{
		AutoIndex:            false,
		BlockCacheSize:       "10mb",
		BlockheaderCacheSize: "1mb",
		BlockSanity:          false,
		LevelDBHome:          t.TempDir(),
		// LogLevel:                "tbcd=TRACE:tbc=TRACE:level=DEBUG",
		MaxCachedTxs:            1000, // XXX
		Network:                 networkLocalnet,
		PeersWanted:             1,
		PrometheusListenAddress: "",
		Seeds:                   []string{"127.0.0.1:" + port},
	}
	_ = loggo.ConfigureLoggers(cfg.LogLevel)
	s, err := NewServer(cfg)
	if err != nil {
		t.Fatal(err)
	}

	go func() {
		err := s.Run(ctx)
		if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, rawpeer.ErrNoConn) {
			panic(err)
		}
	}()

	time.Sleep(750 * time.Millisecond)

	// creat a linear chain with some tx's
	// g ->  b1 ->  b2 -> b3

	// best chain
	parent := chaincfg.RegressionNetParams.GenesisHash
	address := n.address
	b1, err := n.MineAndSend(ctx, "b1", parent, address, MineNoKeystones)
	if err != nil {
		t.Fatal(err)
	}

	b2, err := n.MineAndSend(ctx, "b2", b1.Hash(), address, MineNoKeystones)
	if err != nil {
		t.Fatal(err)
	}
	b3, err := n.MineAndSend(ctx, "b3", b2.Hash(), address, MineNoKeystones)
	if err != nil {
		t.Fatal(err)
	}

	// make sure tbc downloads blocks
	if err := n.MineAndSendEmpty(ctx); err != nil {
		t.Fatal(err)
	}

	// Wait for tbc to insert all blocks
	var hasBlocks bool
	for !hasBlocks {
		hasBlocks, err = s.hasAllBlocks(ctx, n.blocksAtHeight)
		if err != nil {
			t.Logf("blocks not yet synced: %v", err)
			time.Sleep(50 * time.Millisecond)
		}
	}

	// genesis -> b3 should work with negative direction (cdiff is less than target)
	direction, err := indexIsLinear(ctx, s.g, *s.g.chain.GenesisHash, *b3.Hash())
	if err != nil {
		t.Fatalf("expected success g -> b3, got %v", err)
	}
	if direction <= 0 {
		t.Fatalf("expected 1 going from genesis to b3, got %v", direction)
	}

	// I


perator=(const MSDKEvent&);
};

class MSDKThread: public msdkThreadHandle
{
public:
    MSDKThread(mfxStatus &sts, msdk_thread_callback func, void* arg);
    ~MSDKThread(void);

    mfxStatus Wait(void);
    mfxStatus TimedWait(mfxU32 msec);
    mfxStatus GetExitCode();

#if !defined(_WIN32) && !defined(_WIN64)
    friend void* msdk_thread_start(void* arg);
#endif

private:
    MSDKThread(const MSDKThread&);
    void operator=(const MSDKThread&);
};

mfxU32 msdk_get_current_pid();
mfxStatus msdk_setrlimit_vmem(mfxU64 size);
mfxStatus msdk_thread_get_schedtype(const msdk_char*, mfxI32 &type);
void msdk_thread_printf_scheduling_help();

#endif //__THREAD_DEFS_H__


.Pointer<PTOKEN_GROUPS> NewState,
    int BufferLength,
    ffi.Pointer<PTOKEN_GROUPS> PreviousState,
    ffi.Pointer<ffi.Uint64> ReturnLength,
  ) {
    return (_AdjustTokenGroups ??=
        _dylib.lookupFunction<_c_AdjustTokenGroups, _dart_AdjustTokenGroups>(
            'AdjustTokenGroups'))(
      TokenHandle,
      ResetToDefault,
      NewState,
      BufferLength,
      PreviousState,
      ReturnLength,
    );
  }

  _dart_AdjustTokenGroups? _AdjustTokenGroups;

  int AdjustTokenPrivileges(
    ffi.Pointer<ffi.Void> TokenHandle,
    int DisableAllPrivileges,
    ffi.Pointer<PTOKEN_PRIVILEGES> NewState,
    int BufferLength,
    ffi.Pointer<PTOKEN_PRIVILEGES> PreviousState,
    ffi.Pointer<ffi.Uint64> ReturnLength,
  ) {
    return (_AdjustTokenPrivileges ??= _dylib.lookupFunction<
        _c_AdjustTokenPrivileges,
        _dart_AdjustTokenPrivileges>('AdjustTokenPrivileges'))(
      TokenHandle,
      DisableAllPrivileges,
      NewState,
      BufferLength,
      PreviousState,
      ReturnLength,
    );
  }

  _dart_AdjustTokenPrivileges? _AdjustTokenPrivileges;

  int AllocateAndInitializeSid(
    ffi.Pointer<PSID_IDENTIFIER_AUTHORITY> pIdentifierAuthority,
    int nSubAuthorityCount,
    int nSubAuthority0,
    int nSubAuthority1,
    int nSubAuthority2,
    int nSubAuthority3,
    int nSubAuthority4,
    int nSubAuthority5,
    int nSubAuthority6,
    int nSubAuthority7,
    ffi.Pointer<ffi.Pointer<ffi.Void>> pSid,
  ) {
    return (_AllocateAndInitializeSid ??= _dylib.lookupFunction<
        _c_AllocateAndInitializeSid,
        _dart_AllocateAndInitializeSid>('AllocateAndInitializeSid'))(
      pIdentifierAuthority,
      nSubAuthorityCount,
      nSubAuthority0,
      nSubAuthority1,
      nSubAuthority2,
      nSubAuthority3,
      nSubAuthority4,
      nSubAuthority5,
      nSubAuthority6,
      nSubAuthority7,
      pSid,
    );
  }

  _dart_AllocateAndInitializeSid? _AllocateAndInitializeSid;

  int AllocateLocallyUniqueId(
    ffi.Pointer<PLUID> Luid,
  ) {
    return (_AllocateLocallyUniqueId ??= _dylib.lookupFunction<
        _c_AllocateLocallyUniqueId,
        _dart_AllocateLocallyUniqueId>('AllocateLocallyUniqueId'))(
      Luid,
    );
  }

  _dart_AllocateLocallyUniqueId? _AllocateLocallyUniqueId;

  int AreAllAccessesGranted(
    int GrantedAccess,
    int DesiredAccess,
  ) {
    return (_AreAllAccessesGranted ??= _dylib.lookupFunction<
        _c_AreAllAccessesGranted,
        _dart_AreAllAccessesGranted>('AreAllAccessesGranted'))(
      GrantedAccess,
      DesiredAccess,
    );
  }

  _dart_AreAllAccessesGranted? _AreAllAccessesGranted;

  int AreAnyAccessesGranted(
    int GrantedAccess,
    int DesiredAccess,
  ) {
    return (_AreAnyAccessesGranted ??= _dylib.lookupFunction<
        _c_AreAnyAccessesGranted,
        _dart_AreAnyAccessesGranted>('AreAnyAccessesGranted'))(
      GrantedAccess,
      DesiredAccess,
    );
  }

  _dart_AreAnyA


pen terminals
-- closes all terminal windows but keeps buffers alive
M.hide_all = function()
  for terminal_type, terminal_state in pairs(state) do
    if vim.api.nvim_win_is_valid(terminal_state.win) then
      if terminal_type == "floating" then
        vim.api.nvim_win_hide(terminal_state.win)
      else
        vim.api.nvim_win_close(terminal_state.win, false)
      end
    end
  end
end

-- kill all terminal buffers and close windows
-- completely destroys all terminal buffers and resets state
M.kill_all = function()
  for terminal_type, terminal_state in pairs(state) do
    -- close window if valid
    if vim.api.nvim_win_is_valid(terminal_state.win) then
      if terminal_type == "floating" then
        vim.api.nvim_win_hide(terminal_state.win)
      else
        vim.api.nvim_win_close(terminal_state.win, false)
      end
    end

    -- kill buffer if valid
    if vim.api.nvim_buf_is_valid(terminal_state.buf) then
      vim.api.nvim_buf_delete(terminal_state.buf, { force = true })
    end

    -- reset state
    state[terminal_type] = {
      buf = -1,
      win = -1,
    }
  end
end

-- create user command to toggle based on argument
vim.api.nvim_create_user_command("SelfTerm", function(opts)
  local term_type = opts.args or "floating"

  if term_type == "float" then
    M.toggle_floating()
  elseif term_type == "horizontal" then
    M.toggle_horizontal()
  elseif term_type == "vertical" then
    M.toggle_vertical()
  elseif term_type == "hide_all" then
    M.hide_all()
  elseif term_type == "kill_all" then
    M.kill_all()
  else
    vim.notify("Invalid terminal type: " .. term_type, vim.log.levels.ERROR)
  end
end, {
  nargs = "?", -- optional argument
  complete = function()
    -- provide completion options for the command
    return {
      "float",
      "horizontal",
      "vertical",
      "hide_all",
      "kill_all",
    }
  end,
  desc = "Toggle terminal with specified type or perform hide/kill actions",
})

return M


_scroll_wheel_start_val;

        if (step == (wheel -> gx_scroll_wheel_total_rows - 1))
        {
            step = 1;
        }
        else if (step == (1 - wheel -> gx_scroll_wheel_total_rows))
        {
            step = -1;
        }
        else if (wheel -> gx_scroll_wheel_total_rows > 1)
        {
            step /= (wheel -> gx_scroll_wheel_total_rows - 1);
        }

        val = wheel -> gx_numeric_scroll_wheel_start_val + (step * row);
        _gx_utility_ltoa(val, wheel -> gx_numeric_scroll_wheel_string_buffer, GX_NUMERIC_SCROLL_WHEEL_STRING_BUFFER_SIZE);

        string -> gx_string_ptr = wheel -> gx_numeric_scroll_wheel_string_buffer;
        _gx_utility_string_length_check(string -> gx_string_ptr, &string -> gx_string_length, GX_NUMERIC_SCROLL_WHEEL_STRING_BUFFER_SIZE - 1);
    }
    else
    {
        string -> gx_string_ptr = GX_NULL;
        string -> gx_string_length = 0;
    }

    return(GX_SUCCESS);
}


import pygame
import consts
import screen
import game_field
import soldier
import time

state = {"state": consts.RUNNING_STATE, "is_window_open": True, 'night': False}

def main():
    pygame.init()
    clock = pygame.time.Clock()
    draw_board()
    pygame.image.save(screen.screen,"image.png")
    background=pygame.image.load("image.png")
    screen.screen.blit(background,(0,0))
    add = 0
    while state["is_window_open"]:
        handle_user_events()
        screen.screen.blit(background, (0, 0))
        screen.draw_solider()
        if state['night'] and add == 0:
            screen.draw_night_window()
            pygame.image.save(screen.screen, "image_night.png")
            screen.screen.blit(consts.SOLDIER_NIGHT,(consts.SOLDIER_X, consts.SOLDIER_Y))
            pygame.display.update()
            time.sleep(1)
            screen.screen.blit(background, (0, 0))
            add += 1
            pygame.display.update()
            state['night'] = False
        elif state['night'] and add != 0:
            background_night = pygame.image.load("image_night.png")
            screen.screen.blit(background_night, (0, 0))
            screen.screen.blit(consts.SOLDIER_NIGHT,(consts.SOLDIER_X, consts.SOLDIER_Y))
            pygame.display.update()
            time.sleep(1)
            screen.screen.blit(background, (0, 0))
            pygame.display.update()
            state['night'] = False

        soldier.collision()
        if soldier.collision():
            screen.screen.blit(consts.EXPLOSION, (consts.SOLDIER_X,consts.SOLDIER_Y))
        pygame.display.update()

        if is_lose():
            state["state"] = consts.LOSE_STATE
        elif is_win():
            state["state"] = consts.WIN_STATE
    clock.tick(60)

def draw_board():
    screen.draw_window()
    screen.draw_grass()
    screen.draw_flag()

def handle_user_events():
    for event in pygame.event.get():

        if event.type == pygame.QUIT:
            state["is_window_open"] = False
        elif state != consts.RUNNING_STATE:
            pass
        if event.type == pygame.KEYDOWN:

            if event.key == pygame.K_RETURN:
                state['night'] = True
            else:
                state['night'] = False

        keys = pygame.key.get_pressed()
        if keys[pygame.K_UP]:
            consts.SOLDIER_Y -= 30
        if keys[pygame.K_DOWN]:
            consts.SOLDIER_Y += 30
        if keys[pygame.K_LEFT]:
            consts.SOLDIER_X -= 30
        if keys[pygame.K_RIGHT]:
            consts.SOLDIER_X += 30

def is_lose():
    pass

def is_win():
    pass

if __name__ == '__main__':
    main()


public static CompletableFuture<GetInterRegionTrafficQosPoliciesResult> getInterRegionTrafficQosPoliciesPlain(GetInterRegionTrafficQosPoliciesPlainArgs args, InvokeOptions options) {
        return Deployment.getInstance().invokeAsync("alicloud:cen/getInterRegionTrafficQosPolicies:getInterRegionTrafficQosPolicies", TypeShape.of(GetInterRegionTrafficQosPoliciesResult.class), args, Utilities.withVersion(options));
    }
    /**
     * This data source provides Cen Inter Region Traffic Qos Queue available to the user.
     *
     * > **NOTE:** Available in 1.195.0+
     *
     * ## Example Usage
     *
     *

     * {@code
     * package generated_program;
     *
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.alicloud.cen.CenFunctions;
     * import com.pulumi.alicloud.cen.inputs.GetInterRegionTrafficQosQueuesArgs;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     *
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     *
     *     public static void stack(Context ctx) {
     *         final var default = CenFunctions.getInterRegionTrafficQosQueues(GetInterRegionTrafficQosQueuesArgs.builder()
     *             .ids(defaultAlicloudCenInterRegionTrafficQosQueue.id())
     *             .nameRegex(defaultAlicloudCenInterRegionTrafficQosQueue.name())
     *             .trafficQosPolicyId("qos-xxxxxxx")
     *             .build());
     *
     *         ctx.export("alicloudCenInterRegionTrafficQosQueueExampleId", default_.queues()[0].id());
     *     }
     * }
     * }
     *

     *
     */
    public static Output<GetInterRegionTrafficQosQueuesResult> getInterRegionTrafficQosQueues(GetInterRegionTrafficQosQueuesArgs args) {
        return getInterRegionTrafficQosQueues(args, InvokeOptions.Empty);
    }
    /**
     * This data source provides Cen Inter Region Traffic Qos Queue available to the user.
     *
     * > **NOTE:** Available in 1.195.0+
     *
     * ## Example Usage
     *
     *

     * {@code
     * package generated_program;
     *
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.alicloud.cen.CenFunctions;
     * import com.pulumi.alicloud.cen.inputs.GetInterRegionTrafficQosQueuesArgs;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     *
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     *
     *     public static void stack(Context ctx) {
     *         final var default = CenFunctions.getInterRegionTrafficQosQueues(GetInterRegionTrafficQosQueuesArgs.builder()
     *             .ids(defaultAlicloudCenInter


slot14.BytesEncoder,
	[slot19.TYPE_UINT32] = slot14.UInt32Encoder,
	[slot19.TYPE_ENUM] = slot14.EnumEncoder,
	[slot19.TYPE_SFIXED32] = slot14.SFixed32Encoder,
	[slot19.TYPE_SFIXED64] = slot14.SFixed64Encoder,
	[slot19.TYPE_SINT32] = slot14.SInt32Encoder,
	[slot19.TYPE_SINT64] = slot14.SInt64Encoder
}
slot27 = {
	[slot19.TYPE_DOUBLE] = slot14.DoubleSizer,
	[slot19.TYPE_FLOAT] = slot14.FloatSizer,
	[slot19.TYPE_INT64] = slot14.Int64Sizer,
	[slot19.TYPE_UINT64] = slot14.UInt64Sizer,
	[slot19.TYPE_INT32] = slot14.Int32Sizer,
	[slot19.TYPE_FIXED64] = slot14.Fixed64Sizer,
	[slot19.TYPE_FIXED32] = slot14.Fixed32Sizer,
	[slot19.TYPE_BOOL] = slot14.BoolSizer,
	[slot19.TYPE_STRING] = slot14.StringSizer,
	[slot19.TYPE_GROUP] = slot14.GroupSizer,
	[slot19.TYPE_MESSAGE] = slot14.MessageSizer,
	[slot19.TYPE_BYTES] = slot14.BytesSizer,
	[slot19.TYPE_UINT32] = slot14.UInt32Sizer,
	[slot19.TYPE_ENUM] = slot14.EnumSizer,
	[slot19.TYPE_SFIXED32] = slot14.SFixed32Sizer,
	[slot19.TYPE_SFIXED64] = slot14.SFixed64Sizer,
	[slot19.TYPE_SINT32] = slot14.SInt32Sizer,
	[slot19.TYPE_SINT64] = slot14.SInt64Sizer
}
slot28 = {
	[slot19.TYPE_DOUBLE] = slot15.DoubleDecoder,
	[slot19.TYPE_FLOAT] = slot15.FloatDecoder,
	[slot19.TYPE_INT64] = slot15.Int64Decoder,
	[slot19.TYPE_UINT64] = slot15.UInt64Decoder,
	[slot19.TYPE_INT32] = slot15.Int32Decoder,
	[slot19.TYPE_FIXED64] = slot15.Fixed64Decoder,
	[slot19.TYPE_FIXED32] = slot15.Fixed32Decoder,
	[slot19.TYPE_BOOL] = slot15.BoolDecoder,
	[slot19.TYPE_STRING] = slot15.StringDecoder,
	[slot19.TYPE_GROUP] = slot15.GroupDecoder,
	[slot19.TYPE_MESSAGE] = slot15.MessageDecoder,
	[slot19.TYPE_BYTES] = slot15.BytesDecoder,
	[slot19.TYPE_UINT32] = slot15.UInt32Decoder,
	[slot19.TYPE_ENUM] = slot15.EnumDecoder,
	[slot19.TYPE_SFIXED32] = slot15.SFixed32Decoder,
	[slot19.TYPE_SFIXED64] = slot15.SFixed64Decoder,
	[slot19.TYPE_SINT32] = slot15.SInt32Decoder,
	[slot19.TYPE_SINT64] = slot15.SInt64Decoder
}
slot29 = {
	[slot19.TYPE_DOUBLE] = slot12.WIRETYPE_FIXED64,
	[slot19.TYPE_FLOAT] = slot12.WIRETYPE_FIXED32,
	[slot19.TYPE_INT64] = slot12.WIRETYPE_VARINT,
	[slot19.TYPE_UINT64] = slot12.WIRETYPE_VARINT,
	[slot19.TYPE_INT32] = slot12.WIRETYPE_VARINT,
	[slot19.TYPE_FIXED64] = slot12.WIRETYPE_FIXED64,
	[slot19.TYPE_FIXED32] = slot12.WIRETYPE_FIXED32,
	[slot19.TYPE_BOOL] = slot12.WIRETYPE_VARINT,
	[slot19.TYPE_STRING] = slot12.WIRETYPE_LENGTH


          algorithm=hashes.SHA256(),
                label=None
            )
        )
        return eval(decrypted_share.decode())

    def share_secret(self, secret: int) -> List[bytes]:
        """Share the secret among parties and encrypt the shares."""
        shares = self.sss.share_secret(secret)
        encrypted_shares = []
        for i, share in enumerate(shares):
            public_key = self.keys[i].public_key()
            encrypted_share = self.encrypt_share(share, public_key)
            encrypted_shares.append(encrypted_share)
        logging.info("Shares encrypted and distributed successfully.")
        return encrypted_shares

    def reconstruct_secret(self, encrypted_shares: List[bytes]) -> int:
        """Reconstruct the secret from encrypted shares."""
        decrypted_shares = []
        for i, encrypted_share in enumerate(encrypted_shares):
            decrypted_share = self.decrypt_share(encrypted_share, self.keys[i])
            decrypted_shares.append(decrypted_share)

        reconstructed_secret = self.sss.reconstruct_secret(decrypted_shares)
        return reconstructed_secret

def main():
    # Example usage
    threshold = 3
    total_parties = 5
    secret = 12345  # The secret to be shared

    smpc = SecureMultipartyComputation(threshold, total_parties)
    encrypted_shares = smpc.share_secret(secret)

    print("Encrypted Shares:")
    for i, encrypted_share in enumerate(encrypted_shares):
        print(f"Party {i + 1}: Encrypted Share {encrypted_share}")

    # Simulate parties sending shares
    selected_encrypted_shares = random.sample(encrypted_shares, threshold)
    print("\nSelected Encrypted Shares for Reconstruction:")
    for i, encrypted_share in enumerate(selected_encrypted_shares):
        print(f"Party {i + 1}: Encrypted Share {encrypted_share}")

    reconstructed_secret = smpc.reconstruct_secret(selected_encrypted_shares)
    print(f"\nReconstructed Secret: {reconstructed_secret}")

if __name__ == "__main__":
    main()


/**
         * 是否允许关闭.
         */
        function isAllowClose(id) {
            return !(layui.tabRightMenu.pintabIDs && layui.tabRightMenu.pintabIDs.indexOf(id) !== -1 || id === undefined);
        }

        // 点击右键菜单的功能时.
        $(".rightmenu li").click(function () {
            var event = $(this).attr("data-type");

            var tabs = $(".layui-tab[lay-filter='" + config.filter + "'] li");

            switch (event) {
                case "closeThis":
                    if (isAllowClose(currentActiveTabID)) {
                        element.tabDelete(config.filter, currentActiveTabID);
                    } else {
                        layer.msg("此页不允许关闭");
                    }
                    break;
                case "closeAll":
                    $.each(tabs, function (i) {
                        var id = $(this).attr("lay-id");
                        if (isAllowClose(id)) {
                            element.tabDelete(config.filter, id);
                        }
                    });
                    break;
                case "closeOther":
                    $.each(tabs, function (i) {
                        var id = $(this).attr("lay-id");
                        if (isAllowClose(id) && id !== currentActiveTabID) {
                            element.tabDelete(config.filter, id);
                        }
                    });
                    break;
                case "closeLeft":
                    $.each(tabs, function (i) {
                        var id = $(this).attr("lay-id");
                        if (isAllowClose(id) && id !== currentActiveTabID) {
                            element.tabDelete(config.filter, id);
                        }
                    });
                    break;
                case "closeRight":
                    var flag = false;
                    $.each(tabs, function (i) {
                        var id = $(this).attr("lay-id");
                        if (id === currentActiveTabID) {
                            flag = true;
                            return true;
                        }

                        if (flag && isAllowClose(id)) {
                            element.tabDelete(config.filter, id);
                        }
                    });
                    break;
            }
            $(".rightmenu").hide();
        });
    }

    $(".layui-nav-item").click(function () {
        var elem = $(".layui-layout-admin");
        var flag = elem.hasClass("admin-nav-mini");
        if (flag) {
            $(".layui-nav-item i").css("left", 25)
            elem.removeClass("admin-nav-mini");
            window.lock = true;
        } else {
            window.lock = false;
        }
    })
    TabRightMenu.prototype.render = function (config) {
        if (!config.filter) {
            console.error("[ERROR]使用 tabRightMenu 组件需要指定 'filter' 属性！");
            return;
        }

        this.filter = config.filter;
        this.width = config.width ? config.width : 110;// 右键弹出框的宽度，一般100~110即可

        // 固定的 ID.
        this.pintabIDs = config.pintabIDs;

        var defaultNavArr = [
            { eventName: "closeThis", title: "关闭此页"


]
  (init-state
   [_]
   {:button-presses 1})
  (render-state
   [_ state]
   (dom/div
    (dom/button
     {:on-click (fn [_]
                  (om/update-state! owner
                                    [:button-presses]
                                    inc))}

     "Click Me")
    (dom/br {})
    (str "Button Presses: "
         (:button-presses state)))))

```

8) Alter or replace the `(defn main [] ...)` function so that the local state component is displayed on the webpage.

```clojure
(defn main []
  (om/root
   local-state-counter-view
   {}
   {:target (. js/document (getElementById "app"))}))
```

9) Start a REPL with `lein repl`

```
nREPL server started on port 54879 on host 127.0.0.1 - nrepl://127.0.0.1:54879
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_05-b13
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
```

10) Call `run` to start the back end and compile your ClojureScript.

```
local-state.server=> (run)
Starting figwheel.
Starting web server on port 10555 .
#<clojure.lang.AFunction$1@336fc74>
local-state.server=> Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from '(dev-resources|resources)/public'
Compiling "resources/public/js/app.js" from ("src/cljs" "env/dev/cljs")...
Successfully compiled "resources/public/js/app.js" in 18.01 seconds.
notifying browser that file changed:  /js/out/local_state/core.js
```

11) Point your browser to http://localhost:port. You can find the port in the REPL message output =>  `Starting web server on port ...`
# DataScript Query Browser

![alt text](preview.gif "Preview Image GIF")

1) Create a new Om project using Chestnut

```bash
lein new chestnut datascript-query-browser -- --om-tools --http-kit
```

2) Use your editor of choice to open the file `datascript-query-browser/src/cljs/core.cljs`

3) Your initial app-state should look like this.

```clojure
(ns datascript-query-browser.core
  (:require [om.core :as om :include-macros true]
            [om-tools.dom :as dom :include-macros true]
            [om-tools.core :refer-macros [defcomponent]]
            [datascript :as d]))

(def conn (d/create-conn {}))

(defonce app-state
  (atom
   {:viewing-query 0
    :queries []
    :query-results []}))
```

4) This demo application requires dummy data called fake-people.

```clojure
(def fake-people
  [{:db/id -1 :name/last "Larson" :name/first "Andrew" :amount 10242.94 }
   {:db/id -1 :name/last "Richardson" :name/first "Sarah" :amount


<!DOCTYPE html>

<title>Referensi Perintah GDB - perintah tty</title>

Perintah tty

Menentukan perangkat terminal yang akan digunakan untuk proses yang sedang dideteksi kesalahannya.

Sintaks

tty [Perangkat]

set inferior-tty [Perangkat]

show inferior-tty

Parameter

Perangkat

Menentukan jalur lengkap perangkat terminal yang akan dihubungkan oleh GDB ke program yang sedang dideteksi kesalahannya saat Anda meluncurkannya dengan perintah start atau run.

Catatan

Perintah ini hanya didukung pada sistem Linux. Perintah serupa di Windows adalah set new-console.

Contoh

Pada contoh ini kita akan mendeteksi kesalahan dari program "Hello, World" sederhana:

(gdb) run
Memulai program: /home/testuser/hello
Hello, World
[Inferior 1 (proses 8442) keluar secara normal]
(gdb) tty /dev/pts/11
(gdb) show inferior-tty
Terminal untuk menjalankan program yang sedang dideteksi kesalahannya adalah "/dev/pts/11".
(gdb) run
Memulai program: /home/testuser/hello
[Inferior 1 (proses 8448) keluar secara normal]

Setelah kita menjalankan perintah tty, output dari program "Hello, World" dialihkan ke /dev/pts/11 (nama perangkat didapatkan dengan menjalankan perintah tty di jendela xterm lain).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>Referensi Perintah GDB - Perintah info breakpoints</title>

Perintah info breakpoints

Menampilkan informasi tentang breakpoint.

Sintaks

                        info


/* keydb.h - Key database
 * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 *
 * This file is part of GnuPG.
 *
 * GnuPG is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * GnuPG is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <https://www.gnu.org/licenses/>.
 */

#ifndef GNUPG_KEYDB_H
#define GNUPG_KEYDB_H

#include <ksba.h>

#include "../common/userids.h"

typedef struct keydb_handle *KEYDB_HANDLE;

/* Flag value used with KEYBOX_FLAG_VALIDITY. */
#define VALIDITY_REVOKED (1 << 5)

/*-- keydb.c --*/
gpg_error_t sm_keydb_add_resource(ctrl_t ctrl, const char *url, int force,
                                  int *auto_created);
KEYDB_HANDLE sm_keydb_new(void);
void sm_keydb_release(KEYDB_HANDLE hd);
int sm_keydb_set_ephemeral(KEYDB_HANDLE hd, int yes);
const char *sm_keydb_get_resource_name(KEYDB_HANDLE hd);
gpg_error_t sm_keydb_lock(KEYDB_HANDLE hd);

gpg_error_t sm_keydb_get_flags(KEYDB_HANDLE hd, int which, int idx,
                               unsigned int *value);
gpg_error_t sm_keydb_set_flags(KEYDB_HANDLE hd, int which, int idx,
                               unsigned int value);
void sm_keydb_push_found_state(KEYDB_HANDLE hd);
void sm_keydb_pop_found_state(KEYDB_HANDLE hd);
int sm_keydb_get_cert(KEYDB_HANDLE hd, ksba_cert_t *r_cert);
int sm_keydb_insert_cert(KEYDB_HANDLE hd, ksba_cert_t cert);
int sm_keydb_update_cert(KEYDB_HANDLE hd, ksba_cert_t cert);

int sm_keydb_delete(KEYDB_HANDLE hd, int unlock);

int sm_keydb_locate_writable(KEYDB_HANDLE hd, const char *reserved);

gpg_error_t sm_keydb_search_reset(KEYDB_HANDLE hd);
int sm_keydb_search(ctrl_t ctrl, KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
                    size_t ndesc);
int sm_keydb_search_first(ctrl_t ctrl, KEYDB_HANDLE hd);
int sm_keydb_search_next(ctrl_t ctrl, KEYDB_HANDLE hd);
int sm_keydb_search_kid(ctrl_t ctrl, KEYDB_HANDLE hd, u32 *kid);
int sm_keydb_search_fpr(ctrl_t ctrl, KEYDB_HANDLE hd, const byte *fpr);
int sm_keydb_search_issuer(ctrl_t ctrl, KEYDB_HANDLE hd, const char *issuer);
int sm_keydb_search_issuer_sn(ctrl_t ctrl, KEYDB_HANDLE hd, const char *issuer,
                              const unsigned char *serial);
int sm_keydb_search_subject(ctrl_t ctrl, KEYDB_HANDLE hd, const char *issuer);

int sm_keydb_store_cert(ctrl_t ctrl, ksba_cert_t cert, int ephemeral,
                        int *existed);
gpg_error_t sm_keydb_set_cert_flags(ctrl_t ctrl, ksba_cert_t cert,
                                    int ephemeral, int which, int idx,
                                    unsigned int mask, unsigned int value);

void sm_keydb_clear_some_cert_flags(ctrl_t ctrl, strlist_t names);

#endif /*GNUPG_KEYDB_H*/


[Intersecção](Mesh_Intersection/pt-br.md): Cria um objeto de malha que é a interseção de dois objetos de malha.
    -    [Diferença](Mesh_Difference/pt-br.md): Cria um objeto de malha que é a diferença de dois objetos de malha.

-   Corte
    -    [Policorte em malhas](Mesh_PolyCut/pt-br.md): Corta faces inteiras de objetos de malha.
    -    [Corte curto em malhas](Mesh_PolyTrim/pt-br.md): Apara faces e partes de faces em um lado de um plano a partir de um objeto de malha.
    -    [Corte em malhas com um plano](Mesh_TrimByPlane/pt-br.md): Apara faces e partes de faces em um lado de um plano a partir de um objeto de malha.
    -    [Criar seção a partir de malha e plano](Mesh_SectionByPlane/pt-br.md): Cria uma seção transversal através de um objeto de malha.
    -    [Cortes transversais\...](Mesh_CrossSections/pt-br.md): Cria múltiplas seções transversais através de objetos de malha. (v0.19)

-    [Fundir](Mesh_Merge/pt-br.md): Cria um objeto de malha combinando as malhas de dois ou mais objetos de malha.

-    [Dividido por componentes](Mesh_SplitComponents/pt-br.md): Divide um objeto de malha em seus componentes. (v0.19)

-    [Desembrulhar malha](MeshPart_CreateFlatMesh/pt-br.md): Cria uma representação plana de um objeto de malha. (v0.19)

-    [Face desembrulhada](MeshPart_CreateFlatFace/pt-br.md): Cria uma representação plana de uma face de um objeto de forma. (v0.19)

## Preferências

Existem algumas [preferências de exportação relacionadas aos formatos de malha](Import_Export_Preferences/pt-br#Mesh_Formats.md), mas estas não são utilizadas pelos comandos pertencentes a esta bancada de trabalho. Eles são usados pelo comando [Std Export](Std_Export/pt-br.md).

As preferências da Bancada de Trabalho Mesh podem ser encontradas nas seguintes categorias do [ Editor de Preferências](Preferences_Editor/pt-br.md):

-    [Display](Preferences_Editor/pt-br#Display.md): Na aba [Mesh view](Preferences_Editor/pt-br#Mesh_view.md), várias preferências podem ser definidas.
-   <img alt="" src=images/Preferences-openscad.svg  style="w