)
  $4.Timestamp ensureReadTime() => $_ensure(4);
}

enum ListCollectionIdsRequest_ConsistencySelector { readTime, notSet }

/// The request for
/// [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
class ListCollectionIdsRequest extends $pb.GeneratedMessage {
  factory ListCollectionIdsRequest({
    $core.String? parent,
    $core.int? pageSize,
    $core.String? pageToken,
    $4.Timestamp? readTime,
  }) {
    final $result = create();
    if (parent != null) {
      $result.parent = parent;
    }
    if (pageSize != null) {
      $result.pageSize = pageSize;
    }
    if (pageToken != null) {
      $result.pageToken = pageToken;
    }
    if (readTime != null) {
      $result.readTime = readTime;
    }
    return $result;
  }
  ListCollectionIdsRequest._() : super();
  factory ListCollectionIdsRequest.fromBuffer($core.List<$core.int> i,
          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(i, r);
  factory ListCollectionIdsRequest.fromJson($core.String i,
          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(i, r);

  static const $core
      .Map<$core.int, ListCollectionIdsRequest_ConsistencySelector>
      _ListCollectionIdsRequest_ConsistencySelectorByTag = {
    4: ListCollectionIdsRequest_ConsistencySelector.readTime,
    0: ListCollectionIdsRequest_ConsistencySelector.notSet
  };
  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'ListCollectionIdsRequest',
      package:
          const $pb.PackageName(_omitMessageNames ? '' : 'google.firestore.v1'),
      createEmptyInstance: create)
    ..oo(0, [4])
    ..aOS(1, _omitFieldNames ? '' : 'parent')
    ..a<$core.int>(2, _omitFieldNames ? '' : 'pageSize', $pb.PbFieldType.O3)
    ..aOS(3, _omitFieldNames ? '' : 'pageToken')
    ..aOM<$4.Timestamp>(4, _omitFieldNames ? '' : 'readTime',
        subBuilder: $4.Timestamp.create)
    ..hasRequiredFields = false;

  @$core.Deprecated('Using this can add significant overhead to your binary. '
      'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
      'Will be removed in next major version')
  ListCollectionIdsRequest clone() =>
      ListCollectionIdsRequest()..mergeFromMessage(this);
  @$core.Deprecated('Using this can add significant overhead to your binary. '
      'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
      'Will be removed in next major version')
  ListCollectionIdsRequest copyWith(
          void Function(ListCollectionIdsRequest) updates) =>
      super.copyWith((message) => updates(message as ListCollectionIdsRequest))
          as ListCollectionIdsRequest;

  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static ListCollectionIdsRequest create() => ListCollectionIdsRequest._();
  ListCollectionIdsRequest createEmptyInstance() => create();
  static $pb.PbList<ListCollectionIdsRequest> createRepeated() =>
      $pb.PbList<ListCollectionIdsRequest>();
  @$core.pragma('dart2js:noInline')
  static ListCollectionIdsRequest getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<ListCollectionIdsRequest


s::load(&decompressed).map_err(|err| eyre::eyre!("{}", err))?;
        assert!(rest.is_empty());
        assert_eq!(state.len(), 1);
        match state.remove(0) {
            luabins::Value::Table(table) => Ok(LuaState(table)),
            _ => Err(eyre::eyre!("Wrong type.")),
        }
    }

    pub fn set_lua_state(&mut self, state: LuaState) {
        let state = vec![luabins::Value::Table(state.0)];
        let bytes = luabins::save(&state);
        let compressed = lz4_flex::block::compress(&bytes);
        self.lua_state_compressed = std::borrow::Cow::Owned(compressed);
    }
}

fn write_pascal_str(result: &mut Vec<u8>, string: &str) {
    result.extend_from_slice(&(string.len() as u32).to_le_bytes());
    result.extend_from_slice(string.as_bytes());
}

fn pascal_str(data: &[u8]) -> nom::IResult<&[u8], &str> {
    nom::combinator::map_res(
        nom::multi::length_data(nom::number::complete::le_u32),
        std::str::from_utf8,
    )(data)
}

type KV = (luabins::Key, luabins::Value);
pub struct LuaState(Vec<KV>);

impl LuaState {
    const DARKNESS: [&'static str; 3] = ["GameState", "Resources", "MetaPoints"];

    pub fn darkness(&self) -> u32 {
        self.deep_find(&Self::DARKNESS)
            .and_then(luabins::Value::get_number)
            .unwrap_or(0.) as _
    }

    pub fn set_darkness(&mut self, darkness: u32) {
        self.deep_find_mut(&Self::DARKNESS).map(|value| {
            if let luabins::Value::Number(inner) = value {
                *inner = darkness as _;
            }
        });
    }

    pub fn to_json(&self) -> serde_json::Value {
        fn is_array(kv: &[KV]) -> bool {
            for index in 1..=kv.len() {
                let is_index = kv.iter().find(|(key, _value)| {
                    key.get_number()
                        .filter(|n| n.into_inner() as usize == index)
                        .is_some()
                });
                if !is_index.is_some() {
                    return false;
                }
            }
            true
        }

        fn json_from_value(value: &luabins::Value) -> serde_json::Value {
            use luabins::Value;
            match value {
                Value::Nil => serde_json::Value::Null,
                Value::Boolean(inner) => serde_json::Value::Bool(*inner),
                Value::Number(inner) => {
                    serde_json::Value::Number(serde_json::Number::from_f64(*inner).unwrap())
                }
                Value::String(inner) => serde_json::Value::String(inner.clone()),
                Value::Table(inner) => {
                    if is_array(inner) {
                        to_array(inner)
                    } else {
                        to_object(inner)
                    }
                }
            }
        }

        fn to_array(kv: &[KV]) -> serde_json::Value {
            let list = kv
                .iter()
                .map(|(_k, v)| json_from_value(v))
                .collect::<Vec<serde_json::Value>>();
            serde_json::Value::Array(list)
        }

        fn to_object(kv: &[KV]) -> serde_json::Value {
            use luabins::Key;
            let map = kv
                .iter()
                .map(|(k


TEST_ADDRESS);
    bundy::asiolink::IOService io_service;
    SimpleSendHandler ncr_handler;

    // Create the sender and put into send mode.
    NameChangeUDPSender sender(ip_address, 0, ip_address, LISTENER_PORT,
                               FMT_JSON, ncr_handler, 100, true);
    ASSERT_NO_THROW(sender.startSending(io_service));
    ASSERT_TRUE(sender.amSending());

    // Build and queue up 2 messages.  No handlers will get called yet.
    for (int i = 0; i < 2; i++) {
        NameChangeRequestPtr ncr;
        ASSERT_NO_THROW(ncr = NameChangeRequest::fromJSON(valid_msgs[i]));
        sender.sendRequest(ncr);
        EXPECT_EQ(i+1, sender.getQueueSize());
    }

    // Fetch the sender's select-fd.
    int select_fd = sender.getSelectFd();

    // Verify that select_fd appears ready.
    ASSERT_TRUE(selectCheck(select_fd) > 0);

    // Interfere by reading part of the marker from the select-fd.
    uint32_t buf = 0;
    ASSERT_EQ((read (select_fd, &buf, 1)), 1);
    ASSERT_NE(WatchSocket::MARKER, buf);

    // Run one handler. This should execute the send completion handler
    // after sending the message.  Duing completion handling clearing the
    // watch socket should fail, which will close the socket, but not
    // result in a throw.
    ASSERT_NO_THROW(sender.runReadyIO());

    // Verify handler got called twice. First request should have be sent
    // without error, second call should have failed to send due to watch
    // socket markReady failure.
    EXPECT_EQ(1, ncr_handler.pass_count_);
    EXPECT_EQ(1, ncr_handler.error_count_);

    // The second request should still be in the queue.
    EXPECT_EQ(1, sender.getQueueSize());
}

} // end of anonymous namespace
// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

#include <datasrc/memory/zone_table_segment_mapped.h>
#include <datasrc/memory/zone_table.h>
#include <datasrc/memory/segment_object_holder.h>
#include <datasrc/memory/logger.h>

#include <memory>

using namespace bundy::data;
using namespace bundy::dns;
using namespace bundy::util;
using bundy::datasrc::memory::detail::SegmentObjectHolder;

namespace bundy {
namespace datasrc {
namespace memory {

namespace { // unnamed namespace

// The name with which the zone table checksum is associated in the segment.
const char* const ZONE_TABLE_CHECKSUM_NAME = "zone_table_checksum";

// The name with which the zone table header is associated in the segment.
const char* const ZONE_TABLE_HEADER_NAME = "zone_table_header";

} // end of unnamed namespace

ZoneTableSegmentMapped::ZoneTableSegmentMapped(const RRClass& rrclass) :
    ZoneTableSegment(rrclass),
    impl_type_("mapped"),
    rrclass_(rrclass),
    current_mode_(CREATE), // not matter until usable, but init it explicitly
    cached_ro_header_(NULL)     // ditto
{
}

ZoneTableSegmentMapped::~ZoneTableSegmentMapped() {
    sync();
}

const std::string&
ZoneTableSegmentMapped::getImplType() const {
    return (impl_type_);
}

bool
ZoneTableSegmentMapped::processChecksum(MemorySegmentMapped& segment,


 = 0

    @Protobuf(order = 9, required = true, fieldType = FieldType.UINT32, description = "文章状态")
    @JsonProperty("state")
    var state: Int = State.NORMAL

    @Protobuf(order = 10, required = true, fieldType = FieldType.UINT64, description = "文章内容")
    @JsonProperty("content_id")
    var contentId: Long = 0

    object State {
        const val NORMAL = 0
        const val BAN = 1
        const val DELETE = 2
        const val FINE = 3
    }
}package tech.kotlin.common.serialize

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.DeserializationFeature.*
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.readValue
import java.lang.reflect.Field

/*********************************************************************
 * Created by chpengzh@foxmail.com
 * Copyright (c) http://chpengzh.com - All Rights Reserved
 *********************************************************************/
object Json {

    @JvmField
    val mapper: ObjectMapper = ObjectMapper()
            .configure(FAIL_ON_UNKNOWN_PROPERTIES, false)
            .registerModule(KotlinModule())

    fun dumps(any: Any): String = mapper.writeValueAsString(any)

    inline fun <reified T : Any> loads(str: String): T = mapper.readValue<T>(str)

    fun <T> loads(str: String, typeRef: TypeReference<T>): T {
        return mapper.readValue(str, typeRef)
    }

    fun <T : Any> copy(data: T): T {
        return mapper.readValue(mapper.writeValueAsString(data), data.javaClass)
    }

    inline fun <reified T : Any> rawConvert(raw: Map<String, Any>): T {
        return loads(dumps(raw))
    }

    inline fun <T : Any> reflect(obj: T, action: (obj: T, name: String, field: Field) -> Unit) {
        obj.javaClass.declaredFields.filter { it.isAnnotationPresent(JsonProperty::class.java) }.forEach {
            val name = it.getAnnotation(JsonProperty::class.java).value
            it.isAccessible = true
            action(obj, name, it)
        }
    }

    inline fun <reified T : Any> reflect(action: (name: String, field: Field) -> Unit) {
        T::class.java.declaredFields.filter { it.isAnnotationPresent(JsonProperty::class.java) }.forEach {
            val name = it.getAnnotation(JsonProperty::class.java).value
            it.isAccessible = true
            action(name, it)
        }
    }
}package tech.kotlin.controller

import spark.Route
import tech.kotlin.common.rpc.Serv
import tech.kotlin.common.utils.dict
import tech.kotlin.service.domain.Article
import tech.kotlin.service.domain.Category
import tech.kotlin.service.domain.UserInfo
import tech.kotlin.service.article.req.QueryLatestArticleReq
import tech.kotlin.service.account.req.QueryUserReq
import tech.kotlin.common.utils.ok
import tech.kotlin.service.ServDef
import tech.kotlin.service.account.UserApi
import tech.kotlin.service.Err
import tech.kotlin.common.utils.check
import tech.kotlin.service.ArticleService
import tech.kotlin.service.ReplyService
import tech.kotlin.service.account.SessionApi
import tech.kotlin.service.article.req.QueryReplyCountByArticleReq
import java.util.*
import kotlin.collections.HashMap

/*********************************************************************
 * Created by chpengzh@foxmail.com
 * Copyright (c) http://chpengzh.com - All Rights Reserved
 *********************************************************************/
object ArticleViewController {

    val userApi by Serv.bind(UserApi::class, ServDef.ACCOUNT)

    val getList = Route { req, _ ->
        val offset = req.queryParams("offset")


u may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package test_test

import (
	"log"
	"reflect"
	"testing"

	. "perkeep.org/pkg/test"
)

type tbLogger struct {
	testing.TB
	log []string
}

func (l *tbLogger) Log(args ...interface{}) {
	l.log = append(l.log, args[0].(string))
}

func TestTLog(t *testing.T) {
	tb := new(tbLogger)
	defer TLog(tb)()
	defer log.SetFlags(log.Flags())
	log.SetFlags(0)

	log.Printf("hello")
	log.Printf("hello\n")
	log.Printf("some text\nand more text\n")
	want := []string{
		"hello",
		"hello",
		"some text\nand more text",
	}
	if !reflect.DeepEqual(tb.log, want) {
		t.Errorf("Got %q; want %q", tb.log, want)
	}
}
/*
Copyright 2013 The Perkeep Authors

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package blobserver_test

import (
	"bytes"
	"context"
	"testing"
	"time"

	"perkeep.org/pkg/blob"
	"perkeep.org/pkg/blobserver"
	"perkeep.org/pkg/test"
)

var ctxbg = context.Background()

func TestReceive(t *testing.T) {
	sto := new(test.Fetcher)
	data := []byte("some blob")
	br := blob.RefFromBytes(data)

	hub := blobserver.GetHub(sto)
	ch := make(chan blob.Ref, 1)
	hub.RegisterListener(ch)

	sb, err := blobserver.Receive(ctxbg, sto, br, bytes.NewReader(data))
	if err != nil {
		t.Fatal(err)
	}
	if sb.Size != uint32(len(data)) {
		t.Errorf("received blob size = %d; want %d", sb.Size, len(data))
	}
	if sb.Ref != br {
		t.Errorf("received blob = %v; want %v", sb.Ref, br)
	}
	select {
	case got := <-ch:
		if got != br {
			t.Errorf("blobhub notified about %v; want %v", got, br)
		}
	case <-time.After(5 * time.Second):
		t.Error("timeout waiting on blobhub")
	}
}

func TestReceiveCorrupt(t *testing.T) {
	sto := new(test.Fetcher)
	data := []byte("some blob")
	br := blob.RefFromBytes(data)
	data[0] = 'X' // corrupt it
	_, err := blobserver.Receive(ctxbg, sto, br, bytes.NewReader(data))
	if err != blobserver.ErrCorruptBlob {
		t.Errorf("Receive = %v; want ErrCorruptBlob", err)
	}
	if len(sto.BlobrefStrings()) > 0 {
		t.Errorf("nothing should be stored. Got %q", sto.BlobrefStrings())
	}
}
/*
Copyright 2011 The Perkeep Authors

Licensed under the Apache License


OGRAM();
	}
      else if (m_voxelType == _Char)
	{
	  char *ptr = (char*) tmp;
	  MINMAXANDHISTOGRAM();
	}
      if (m_voxelType == _UShort)
	{
	  ushort *ptr = (ushort*) tmp;
	  MINMAXANDHISTOGRAM();
	}
      else if (m_voxelType == _Short)
	{
	  short *ptr = (short*) tmp;
	  MINMAXANDHISTOGRAM();
	}
      else if (m_voxelType == _Int)
	{
	  int *ptr = (int*) tmp;
	  MINMAXANDHISTOGRAM();
	}
      else if (m_voxelType == _Float)
	{
	  float *ptr = (float*) tmp;
	  MINMAXANDHISTOGRAM();
	}
    }

  delete [] tmp;

//  while(m_histogram.last() == 0)
//    m_histogram.removeLast();
//  while(m_histogram.first() == 0)
//    m_histogram.removeFirst();

  progress.setValue(100);
  qApp->processEvents();
}

#define FINDMINMAX()					\
  {							\
    for(uint j=0; j<m_width*m_height; j++)		\
      {							\
	float val = ptr[j];				\
	m_rawMin = qMin(m_rawMin, val);			\
	m_rawMax = qMax(m_rawMax, val);			\
      }							\
  }

void
GrdPlugin::findMinMax()
{
  QProgressDialog progress("Finding Min and Max",
			   QString(),
			   0, 100,
			   0);
  progress.setMinimumDuration(0);

  int nbytes = m_width*m_height*m_bytesPerVoxel;
  uchar *tmp = new uchar[nbytes];

  QFile fin(m_fileName[0]);
  fin.open(QFile::ReadOnly);
  fin.seek(m_headerBytes);

  m_rawMin = 10000000;
  m_rawMax = -10000000;
  for(uint i=0; i<m_depth; i++)
    {
      progress.setValue((int)(100.0*(float)i/(float)m_depth));
      qApp->processEvents();

      //----------------------------
      QFile fin(m_imageList[i]);
      fin.open(QFile::ReadOnly);
      fin.seek(m_headerBytes);
      fin.read((char*)tmp, nbytes);
      fin.close();
      //----------------------------

      if (m_voxelType == _UChar)
	{
	  uchar *ptr = tmp;
	  FINDMINMAX();
	}
      else if (m_voxelType == _Char)
	{
	  char *ptr = (char*) tmp;
	  FINDMINMAX();
	}
      if (m_voxelType == _UShort)
	{
	  ushort *ptr = (ushort*) tmp;
	  FINDMINMAX();
	}
      else if (m_voxelType == _Short)
	{
	  short *ptr = (short*) tmp;
	  FINDMINMAX();
	}
      else if (m_voxelType == _Int)
	{
	  int *ptr = (int*) tmp;
	  FINDMINMAX();
	}
      else if (m_voxelType == _Float)
	{
	  float *ptr = (float*) tmp;
	  FINDMINMAX();
	}
    }
  fin.close();

  delete [] tmp;

  progress.setValue(100);
  qApp->processEvents();
}

#define GENHISTOGRAM()					\
  {							\
    for(uint j=0; j<m_width*m_height; j++)		\
      {							\
	float fidx = (ptr[j]-m_rawMin)/rSize;		\
	fidx =


: String) : I()

    @JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
    @JsonSubTypes(
        JsonSubTypes.Type(value = MainData::class, name = "test")
    )
    abstract class I {
        abstract val myId: String?
        abstract val s: String
    }

    data class MainData2(@get:BsonId override val myId: Id<I2>? = null) : I2()

    @JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
    @JsonSubTypes(
        JsonSubTypes.Type(value = MainData2::class, name = "test")
    )
    abstract class I2 {
        abstract val myId: Id<I2>?
    }

    data class MainData3(@get:BsonId override val myId: ObjectId? = null) : I3()

    @JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
    @JsonSubTypes(
        JsonSubTypes.Type(value = MainData3::class, name = "test")
    )
    abstract class I3 {
        abstract val myId: ObjectId?
    }

    @Test
    fun `serialization and deserialization is ok`() {
        //insert an object id
        val document =
            Document.parse("""{ "_id" : { "$oid": "5bb4d3a8d20c290001ac67e9" },"@type":"test", "s":"a"}""")
        col.withDocumentClass<Document>().insertOne(document)

        //load a string
        assertEquals("5bb4d3a8d20c290001ac67e9", col.findOne()!!.myId)
        assertEquals("a", col.findOne()!!.s)
    }

    @Test
    fun `serialization and deserialization is ok with Id`() {
        //insert an object id
        val document =
            Document.parse("""{ "_id" : { "$oid": "5bb4d3a8d20c290001ac67e9" },"@type":"test"}""")
        col.withDocumentClass<Document>().insertOne(document)

        //load an Id
        assertEquals("5bb4d3a8d20c290001ac67e9", col.withDocumentClass<I2>().findOne()!!.myId.toString())
    }

    @Test
    fun `serialization and deserialization is ok with ObjectId`() {
        //insert an object id
        val document =
            Document.parse("""{ "_id" : { "$oid": "5bb4d3a8d20c290001ac67e9" },"@type":"test"}""")
        col.withDocumentClass<Document>().insertOne(document)

        //load an ObjectId
        assertEquals(ObjectId("5bb4d3a8d20c290001ac67e9"), col.withDocumentClass<I3>().findOne()!!.myId)
    }

}package com.displayer.admin

import co.touchlab.kermit.Logger
import com.displayer.config.AdminParameters
import com.displayer.config.ConfigRepo
import com.displayer.display.DisplayRepo
import io.ktor.http.*
import io.ktor.http.content.*
import io.ktor.server.application.*
import io.ktor.server.cio.*
import io.ktor.server.engine.*
import io.ktor.server.plugins.*
import io.ktor.server.request.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch

class HttpAdminServer(
    private val configRepo: ConfigRepo,
    private val displayRepo: DisplayRepo,
) : AdminServer {

    private var state = MutableStateFlow<AdminState>(AdminState.Stopped)
    private var adminEngine: ApplicationEngine? = null

    init {
        GlobalScope.launch {
            configRepo.observeConfig().map { it.adminParameters }.distinctUntilChanged().collect {
                if (it == null) {
                    stop()
                } else {
                    start(it)
                }
            }


Index = iPa;
        m_apkHeap[iPa] = m_apkHeap[iCh];
        iPa = iCh;
        iCh = 2*iCh + 1;
    }

    pkRecord->m_iHIndex = iPa;
    m_apkHeap[iPa] = pkRecord;
    m_iHQuantity--;

    // remove root from the doubly-linked list
    Record* pkLAdj = pkRoot->m_pkLAdj;
    Record* pkRAdj = pkRoot->m_pkRAdj;
    pkLAdj->m_pkRAdj = pkRAdj;
    pkRAdj->m_pkLAdj = pkLAdj;

    // update the weights of the vertices affected by the removal
    int iM, iZ, iP;
    float fWeight;

    if ( pkLAdj->m_fWeight != FLT_MAX )
    {
        iZ = pkLAdj->m_iVIndex;
        iM = pkLAdj->m_pkLAdj->m_iVIndex;
        iP = pkLAdj->m_pkRAdj->m_iVIndex;
        fWeight = GetWeight(iM,iZ,iP,akVertex);

        Update(pkLAdj->m_iHIndex,fWeight);
        assert( IsValid() );
    }

    if ( pkRAdj->m_fWeight != FLT_MAX )
    {
        iZ = pkRAdj->m_iVIndex;
        iM = pkRAdj->m_pkLAdj->m_iVIndex;
        iP = pkRAdj->m_pkRAdj->m_iVIndex;
        fWeight = GetWeight(iM,iZ,iP,akVertex);

        Update(pkRAdj->m_iHIndex,fWeight);
        assert( IsValid() );
    }

    return pkRoot->m_iVIndex;
}
//----------------------------------------------------------------------------
void VertexCollapse::Update (int iHIndex, float fWeight)
{
    Record* pkRecord = m_apkHeap[iHIndex];
    int iPa, iCh, iChP, iMaxCh;

    if ( fWeight > pkRecord->m_fWeight )
    {
        pkRecord->m_fWeight = fWeight;

        // new weight larger than old, propagate it towards the leaves
        iPa = iHIndex;
        iCh = 2*iPa+1;
        while ( iCh < m_iHQuantity )
        {
            // at least one child exists
            if ( iCh < m_iHQuantity-1 )
            {
                // two children exist
                iChP = iCh+1;
                if ( m_apkHeap[iCh]->m_fWeight <= m_apkHeap[iChP]->m_fWeight )
                    iMaxCh = iCh;
                else
                    iMaxCh = iChP;
            }
            else
            {
                // one child exists
                iMaxCh = iCh;
            }

            if ( m_apkHeap[iMaxCh]->m_fWeight >= fWeight )
                break;

            m_apkHeap[iMaxCh]->m_iHIndex = iPa;
            m_apkHeap[iPa] = m_apkHeap[iMaxCh];
            pkRecord->m_iHIndex = iMaxCh;
            m_apkHeap[iMaxCh] = pkRecord;
            iPa = iMaxCh;
            iCh = 2*iPa+1;
        }
    }
    else if ( fWeight < pkRecord->m_fWeight )
    {
        pkRecord->m_fWeight = fWeight;

        // new weight smaller than old, propagate it towards the root
        iCh = iHIndex;
        while ( iCh > 0 )
        {
            // a parent exists
            iPa = (iCh-1)/2;

            if ( m_apkHeap[iPa]->m_fWeight <= fWeight )
                break;

            m_apkHeap[iPa]->m_iHIndex = iCh;
            m_apkHeap[iCh] = m_apkHeap[iPa];
            pkRecord->m_iHIndex = iPa;
            pkRecord->m_fWeight = fWeight;
            m_apk


com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep4
import com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep5
import com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep6
import com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep7
import com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep8
import com.paulrybitskyi.hiltbinder.sample.ksp.kotlin.KspKotlinActivityDep9
import javax.inject.Inject
import javax.inject.Named

internal class KspKotlinActivityDeps @Inject constructor(
    private val kspKotlinActivityDep1: KspKotlinActivityDep1,
    private val kspKotlinActivityDep2: KspKotlinActivityDep2,
    private val kspKotlinActivityDep3: KspKotlinActivityDep3,
    private val kspKotlinActivityDep4: KspKotlinActivityDep4,
    private val kspKotlinActivityDep5: KspKotlinActivityDep5,
    private val kspKotlinActivityDeps6: Set<@JvmSuppressWildcards KspKotlinActivityDep6>,
    private val kspKotlinActivityDeps7: Map<String, @JvmSuppressWildcards KspKotlinActivityDep7>,
    @Named("dep8") private val kspKotlinActivityDep8: KspKotlinActivityDep8,
    private val kspKotlinActivityDep9: KspKotlinActivityDep9<Float>,
    private val kspKotlinActivityDep10: KspKotlinActivityDep10<Float>,
    private val kspKotlinActivityDeps11: Set<@JvmSuppressWildcards KspKotlinActivityDep11<*>>,
) {

    fun check() {
        check(kspKotlinActivityDeps6.size == 3)
        check(kspKotlinActivityDeps7.size == 3)
        check(kspKotlinActivityDeps11.size == 3)
    }
}
/*
 * Copyright 2021 Paul Rybitskyi, oss@paulrybitskyi.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.paulrybitskyi.hiltbinder.sample.fragment

import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep1
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep10
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep11
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep2
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep3
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep4
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep5
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep6
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep7
import com.paulrybitskyi.hiltbinder.sample.ksp.java.fragment.KspJavaFragmentDep8
import com.paulrybitskyi.hiltbinder.sample.ksp.java.


513-157.036-157.11-157.036-55.947 0-89.893 20.26-107.812 36.062 6.722-106.5 61.433-159.882 134.437-159.882 29.77 0 56.976 6.722 71.02 12.882l16.682-90.1c-21.72-5.41-48.925-8.93-78.846-8.93-166.6 0-251.38 125.88-251.38 309.897 0 140.354 50.91 240.34 193.61 240.34 108.92-.02 179.41-77.555 179.41-183.232m-105.83 11.26c0 45.65-26.25 88.44-77.38 88.44-52.59 0-80.96-48.77-80.96-99.1 0-15.65 0-35.98 6-44.97 10.47-16.61 36.79-29.19 69.05-29.19 50.97 0 83.31 35.18 83.31 84.84z"/></svg>')}.metro.ligne17{background-image:url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000"><circle cx="500" cy="500" r="500" fill="#EC7CAE"/><path fill="#fff" d="M381.97 765.05V235.26h-92.42c-23.954 18.717-80.888 54.086-142.52 83.34l-32.297 14.77 35.95 81.19 27.87-14.16c19.374-9.83 72.85-37.443 90.77-51.83v416.46h112.64M822.14 320.687V234.39H451.39v88.563h257.377L579.76 563.143c-46.585 86.522-65.31 131.215-65.31 201.355h120.9c-.02-83.377 70.345-241.724 186.788-443.81"/></svg>')}.metro.ligne18{background-image:url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000"><circle cx="500" cy="500" r="500" fill="#95bf32"/><path fill="#fff" d="M381.97 765.05V235.26h-92.42c-23.954 18.717-80.888 54.086-142.52 83.34l-32.297 14.77 35.95 81.19 27.87-14.16c19.374-9.83 72.85-37.443 90.77-51.83v416.46h112.64m447.01-153.32c0-69.633-42.746-111.837-91.577-134.867C786.94 446.64 812.59 408.39 812.59 358.94c0-90.998-77.385-136.872-170.46-136.872-90.886 0-170.425 60.946-170.425 148.705 0 54.785 28.554 87.028 74.24 115.563-51.023 26.25-90.773 67.724-90.773 138.163 0 80.38 66.694 150.89 184.598 150.89 108.86 0 189.204-62.97 189.204-163.69M711.182 365.58c0 33.14-30.033 63.698-57.82 76.58-33.72-14.267-77.31-37.597-77.31-81.036 0-36.72 26.214-62.316 67.537-62.316 43.51 0 67.59 29.902 67.59 66.77zm8.22 254.456c0 42.056-27.786 77.39-78.116 77.39-51.097 0-79.538-41.475-79.538-84.915 0-


49] = "Heaume planétaire",
[37850] = "Echarpe flottante de l'Ordre",
[37851] = "Stola ornée en laine",
[37852] = "Fendoir colossal orné d'un crâne",
[37853] = "Poignets perfectionnés en cuir ouvragé",
[37854] = "Jambières des braies tissées",
[37855] = "Ceinturon de la terre attentive en mailles",
[37856] = "Coupe-papier du bibliothécaire",
[37857] = "Heaume des salles de la foudre",
[37858] = "Garde-mains éveillés",
[37859] = "Essence d'ambre",
[37860] = "Essence de rubis",
[37861] = "Collier des sphères arcaniques",
[37862] = "Gantelets du revenant d'eau",
[37863] = "Télécommande navrebière",
[37864] = "Médaillon de l'Alliance",
[37865] = "Médaillon de la Horde",
[37867] = "Bottillons de téléportation",
[37868] = "Ceinturon de l'ethéré",
[37869] = "Chevalière au globule",
[37870] = "Bottes à pointes jumelles",
[37871] = "La Clé",
[37872] = "Talisman de Lavanthor",
[37873] = "Marque du prisonnier de guerre",
[37874] = "Gantelets de capture",
[37875] = "Spallières du fort Pourpre",
[37876] = "Jambières de Cyanigosa",
[37877] = "Plume argentée",
[37878] = "Elixir de sang de worg",
[37879] = "Munitions de Garde-Hiver",
[37880] = "La plume d'Alystros",
[37881] = "Mues de serre-du-ciel",
[37882] = "Graine de flagellant",
[37883] = "Bâton de supercherie",
[37884] = "Manchettes en tissu azur",
[37886] = "Manicles de l'émissaire sauvage",
[37887] = "Graines de courroux naturel",
[37888] = "Disrupteur arcanique",
[37889] = "Manifeste de la prison",
[37890] = "Cuissards des enchaînés",
[37891] = "Menottes en fonte",
[37892] = "Bock de la fête des Brasseurs vert",
[37893] = "Bock de la fête des Brasseurs vert plein",
[37894] = "Bock de la fête des Brasseurs vert plein",
[37895] = "Bock de la fête des Brasseurs vert plein",
[37896] = "Bock de la fête des Brasseurs vert plein",
[37897] = "Bock de la fête des Brasseurs vert plein",
[37898] = "Pilsner de l'hiver sauvage",
[37899] = "Saveur suprême d'Izzard",
[37900] = "Bière aromatisée au miel",
[37901] = "Bock pétillant de Metok",
[37902] = "Brune de printemps",
[37903] = "Brune rochenoire",
[37904] = "Bière de Strangleronce",
[37905] = "Bière ambrée draenique",
[37906] = "Bière binaire",
[37907] = "Bière de gland d'automne",
[37908] = "Bière amère de Bartlett",
[37909] = "Cuvée spéciale du seigneur du Givre",
[37910] = "Page 4 du journal de Barbapille",
[37911] = "Page 5 du journ


, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x2f, 0x62,
	0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
	0x3b, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
	0x31, 0xa2, 0x02, 0x03, 0x42, 0x42, 0x58, 0xaa, 0x02, 0x1b, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32,
	0x69, 0x62, 0x63, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x2e, 0x56, 0x31,
	0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62,
	0x63, 0x5c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x5c, 0x56, 0x31, 0x62, 0x65,
	0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x5c,
	0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61,
	0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d,
	0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x69, 0x62, 0x63, 0x3a, 0x3a, 0x42, 0x65, 0x63, 0x68, 0x33,
	0x32, 0x69, 0x62, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70,
	0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescOnce sync.Once
	file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescData = file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDesc
)

func file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescGZIP() []byte {
	file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescOnce.Do(func() {
		file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescData)
	})
	return file_bech32ibc_bech32ibc_v1beta1_genesis_proto_rawDescData
}

var file_bech32ibc_bech32ibc_v1beta1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_bech32ibc_bech32ibc_v1beta1_genesis_proto_goTypes = []interface{}{
	(*GenesisState)(nil), // 0: bech32ibc.bech32ibc.v1beta1.G


recursion_guard_(b, l, "entity_5")) return false;
    entityTableDeclaration(b, l + 1);
    return true;
  }

  // entityBody?
  private static boolean entity_6(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entity_6")) return false;
    entityBody(b, l + 1);
    return true;
  }

  /* ********************************************************** */
  // NEWLINE* LBRACE (NEWLINE | entityElement)* RBRACE
  static boolean entityBody(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityBody")) return false;
    if (!nextTokenIs(b, "", LBRACE, NEWLINE)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_);
    r = entityBody_0(b, l + 1);
    r = r && consumeToken(b, LBRACE);
    p = r; // pin = 2
    r = r && report_error_(b, entityBody_2(b, l + 1));
    r = p && consumeToken(b, RBRACE) && r;
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  // NEWLINE*
  private static boolean entityBody_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityBody_0")) return false;
    while (true) {
      int c = current_position_(b);
      if (!consumeToken(b, NEWLINE)) break;
      if (!empty_element_parsed_guard_(b, "entityBody_0", c)) break;
    }
    return true;
  }

  // (NEWLINE | entityElement)*
  private static boolean entityBody_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityBody_2")) return false;
    while (true) {
      int c = current_position_(b);
      if (!entityBody_2_0(b, l + 1)) break;
      if (!empty_element_parsed_guard_(b, "entityBody_2", c)) break;
    }
    return true;
  }

  // NEWLINE | entityElement
  private static boolean entityBody_2_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityBody_2_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, NEWLINE);
    if (!r) r = entityElement(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  /* ********************************************************** */
  // entityFieldMapping (COMMA|&NEWLINE)
  static boolean entityElement(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityElement")) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_);
    r = entityFieldMapping(b, l + 1);
    p = r; // pin = 1
    r = r && entityElement_1(b, l + 1);
    exit_section_(b, l, m, r, p, JdlParser::notRBraceOrNextOption);
    return r || p;
  }

  // COMMA|&NEWLINE
  private static boolean entityElement_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityElement_1")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, COMMA);
    if (!r) r = entityElement_1_1(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // &NEWLINE
  private static boolean entityElement_1_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "entityElement_1_1")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _AND_);
    r = cons


{

											IToken token = id2 ?? begin2;
											field = new Field(ToLexicalInfo(token));
											field.Name = token.getText();
											field.Modifiers = _modifiers;
											AddAttributes(field.Attributes);
											tm = field;

							}
							{
								{
									switch ( LA(1) )
									{
									case AS:
									{
										match(AS);
										tr=type_reference();
										if (0==inputState.guessing)
										{
											field.Type = tr;
										}
										break;
									}
									case EOL:
									case EOS:
									case ASSIGN:
									{
										break;
									}
									default:
									{
										throw new NoViableAltException(LT(1), getFilename());
									}
									 }
								}
								{
									switch ( LA(1) )
									{
									case ASSIGN:
									{
										{
											match(ASSIGN);
											initializer=declaration_initializer();
											if (0==inputState.guessing)
											{
												field.Initializer = initializer;
											}
										}
										break;
									}
									case EOL:
									case EOS:
									{
										eos();
										break;
									}
									default:
									{
										throw new NoViableAltException(LT(1), getFilename());
									}
									 }
								}
								docstring(field);
							}
						}
					}
					else
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
				}
				if (0==inputState.guessing)
				{

						if (null != nameSplice) {
							tm = new SpliceTypeMember(tm, nameSplice);
						}
						container.Add(tm);

				}
			}
			catch (RecognitionException ex)
			{
				if (0 == inputState.guessing)
				{
					reportError(ex, "field_or_property");
					recover(ex,tokenSet_52_);
				}
				else
				{
					throw ex;
				}
			}
		}

	protected void interface_method(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{

		IToken  begin = null;

				Method m = null;
				TypeReference rt = null;
				Expression nameSplice = null;
				IToken id = null;

		try {      // for error handling
			match(DEF);
			{
				switch ( LA(1) )
				{
				case EVENT:
				case GET:
				case INTERNAL:
				case PUBLIC:
				case PROTECTED:
				case REF:
				case SET:
				case YIELD:
				case ID:
				{
					id=member();
					break;
				}
				case SPLICE_BEGIN:
				{
					{
						begin = LT(1);
						match(SPLICE_BEGIN);
						nameSplice=atom();
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{

						IToken token = id ?? begin;
						m = new Method(ToLexicalInfo(token));
						m.Name = token.getText();
						AddAttributes(m.Attributes);
						if (nameSplice != null) {
							container.Add(new SpliceTypeMember(m, nameSplice));
						} else {
							container.Add(m);
						}

			}
			{
				switch ( LA(1) )
				{
				case LBRACK:
				{
					{
						match(LBRACK);
						{
							swi


'abCD' where Caps = 'C' */
            ? `${ToSnake<Head>}_${ToSnake<Caps>}_${Lowercase<Tail>}` /* aBCD Tail = 'D', Head = 'aB' */
            : Tail extends `${CapitalLetters}${string}` /* is 'aBCd' where Caps = 'B' */
            ? Head extends Numbers
              ? never /* stop union type forming */
              : Head extends `${string}${Numbers}`
              ? never /* stop union type forming */
              : `${Head}_${ToSnake<Caps>}_${ToSnake<Tail>}` /* 'aBCd' => `${'a'}_${Lowercase<'B'>}_${ToSnake<'Cd'>}` */
            : `${ToSnake<Head>}_${Lowercase<Caps>}${ToSnake<Tail>}` /* 'aBcD' where Caps = 'B' tail starts as lowercase */
          : never
        : never
      : never
    : S /* 'abc'  */
  : never;

export type ObjectToSnake<T extends object | undefined | null> =
  T extends undefined
    ? undefined
    : T extends null
    ? null
    : {
        [K in keyof T as ToSnake<K>]: T[K] extends Array<unknown>
          ? T[K] extends Array<infer ArrayType>
            ? ArrayType extends object
              ? Array<ObjectToSnake<ArrayType>>
              : T[K]
            : never
          : T[K] extends object | undefined | null
          ? ObjectToSnake<T[K]>
          : //  Exclude<T[K], undefined> extends object
            //  ? ObjectToSnake<Exclude<T[K], undefined>>
            T[K];
      };

type CapitalLetters =
  | 'A'
  | 'B'
  | 'C'
  | 'D'
  | 'E'
  | 'F'
  | 'G'
  | 'H'
  | 'I'
  | 'J'
  | 'K'
  | 'L'
  | 'M'
  | 'N'
  | 'O'
  | 'P'
  | 'Q'
  | 'R'
  | 'S'
  | 'T'
  | 'U'
  | 'V'
  | 'W'
  | 'X'
  | 'Y'
  | 'Z';

type Numbers = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';

type CapitalChars = CapitalLetters | Numbers;
import { InputReceiver } from "./InputReceiver";
import { Scene } from "./Scene";
import { GameEvent } from "./GameEvent";
import { Rectangle } from "./Rectangle";
import { GameInformation } from "./GameInformation";
import { EventName } from "./EventDispatcher";

export class Game {
  private currentFps = 0;
  public screenCanvas = document.createElement('canvas');
  private _inputReceiver = new InputReceiver();
  private _prevTimestamp = 0;
  private currentScene = new Scene('init', '#fff', this.screenCanvas);

  constructor(private title: string, private width: number, private height: number, private maxFps: number){
    this.screenCanvas.height = height;
    this.screenCanvas.width = width;
    console.log(`${title} is reset`);
  }

  changeScene(newScene: Scene) {
    this.currentScene = newScene;
    this.currentScene.addEventListener(EventName.changeScene, e => {
      this.changeScene(e.target);
    })
    console.log(`Scene is ${newScene.name}`);
  }

  start() {
    requestAnimationFrame(this._loop.bind(this));
  }

  _loop(timestamp: number) {
    const elapsedSec = (timestamp - this._prevTimestamp) / 1000;
    const frameTime = 1 / this.maxFps;

    if (elapsedSec <= frameTime) {
      requestAnimationFrame(this._loop.bind(this));
      return;
    }

    this._prevTimestamp = timestamp;
    this.currentFps = 1 / elapsedSec;


/*
Copyright 2018 Google Inc. All Rights Reserved.

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.
*/

#ifndef RESONANCE_AUDIO_NODE_SOURCE_NODE_H_
#define RESONANCE_AUDIO_NODE_SOURCE_NODE_H_

#include <atomic>
#include <memory>

#include "base/audio_buffer.h"
#include "node/publisher_node.h"

namespace vraudio {

// Audio source node that outputs data via the AudioProcess() method.
class SourceNode : public Node, public PublisherNode<const AudioBuffer*> {
 public:
  typedef PublisherNode<const AudioBuffer*> PublisherNodeType;

  SourceNode();

  // Node implementation.
  void Process() final;
  bool CleanUp() final;

  // PublisherNode<OutputType> implementation.
  std::shared_ptr<Node> GetSharedNodePtr() final;
  Node::Output<const AudioBuffer*>* GetOutput() final;

  // Marks this node as being out of data and to be removed during the next
  // clean-up cycle.
  void MarkEndOfStream();

  // Disable copy constructor.
  SourceNode(const SourceNode& that) = delete;

 protected:
  // Pure virtual method to implement the audio processing method. This method
  // requires to return a single output buffer that can be processed by the node
  // subscribers.
  //
  // @return Returns output data.
  virtual const AudioBuffer* AudioProcess() = 0;

 private:
  // Output stream to write processed data to.
  Node::Output<const AudioBuffer*> output_stream_;

  // Flag indicating if this source node can be removed.
  std::atomic<bool> end_of_stream_;
};

}  // namespace vraudio

#endif  // RESONANCE_AUDIO_NODE_SOURCE_NODE_H_


import * as xjs from 'extrajs'

import Integer from './Integer.class'

/**
 * A rational number is a real number that can be expressed as a ratio of {@link Integer}s.
 *
 * The set of Rationals exhibits the following properties:
 *
 * - Rationals are weakly totally ordered: There exists a weak total order `<=` on the rationals:
 * 	- (Reflexivity) For a rational `a`, `a <= a`.
 * 	- (Antisymmetry) For rationals `a` and `b`, if `a <= b` and `b <= a`, then `a === b`.
 * 	- (Transitivity) For rationals `a`, `b`, and `c`, if `a <= b` and `b <= c`, then `a <= c`.
 * 	- (Comparability) For distinct rationals `a !== b`, at least one of the following statements is guaranteed true:
 * 		- `a <= b`
 * 		- `b <= a`
 * - Rationals are closed under addition, subtraction, multiplication, and division:
 * 	For rationals `a` and `b`, the expressions `a + b`, `a - b`, `a * b`, and `a / b` are guaranteed to also be rationals.
 * - The set of Rationals has a (unique) additive identity and a (unique) multiplicative identity:
 * 	There exist rationals `0` and `1` such that for every rational `a`,
 * 	`a + 0`, `0 + a`, `a * 1`, and `1 * a` are guaranteed to equal `a`, and
 * 	`0` and `1`, respectively, are the only rationals with this property.
 * - The set of Rationals has a (unique) multiplicative absorber:
 * 	A unique rational `0` is guaranteed such that for every rational `a`, `a * 0 === 0 * a === 0`.
 * 	(In general, the multiplicative absorber need not necessarily be the additive identity,
 * 	but in the standard rationals we work with daily, they are one in the same.)
 * - The set of Rationals has no nonzero zero-divisors:
 * 	For rationals `a` and `b`, if `a * b === 0` or if `b * a === 0`, then either `a === 0` or `b === 0`
 * 	(where `0` is the multiplicative absorber).
 * - Rationals have (unique) additive inverses:
 * 	For every rational `a`, a unique rational `-a` is guaranteed such that `a + -a === -a + a === 0`
 * 	(where `0` is the additive identity).
 * - Non-zero Rationals have (unique) multiplicative inverses:
 * 	For every rational `a !== 0` (where `0` is the multiplicative absorber),
 * 	a unique rational `a^` is guaranteed such that `a * a^ === ^a * a === 1`
 * 	(where `1` is the multiplicative identity).
 * - Addition and multiplication are commutative and associative:
 * 	For rationals `a`, `b`, and `c`, the following statements are guaranteed true:
 * 	- `a + b === b + a`
 * 	- `a * b === b * a`
 * 	- `a + (b + c) === (a + b) + c`
 * 	- `a * (b * c) === (a * b) * c`
 * - Multiplication distributes over addition:
 * 	For rationals `a`, `b`, and `c`, we are guaranteed `a * (b + c) === a * b + a * c`.
 */
export default class Rational extends Number {
	/** The additive identity of the group of Rationals. */
	static readonly ADD_IDEN: Rational = new Rational()
	/** The multiplicative identity of the group of Rationals. */
	static readonly MULT_IDEN: Rational = new Rational(1)
	/** The multiplicative absorber of the group of Rationals. */
	static readonly M


using ACBrLib.Core;

namespace ACBrLib.NFe
{
    public enum TipoEventoNFe
    {
        [EnumValue("-99999")]
        teNaoMapeado,

        [EnumValue("110110")]
        teCCe,

        [EnumValue("110111")]
        teCancelamento,

        [EnumValue("110112")]
        teCancSubst,

		[EnumValue("110113")]
        teEPEC,

        [EnumValue("110140")]
        teEPECNFe,

        [EnumValue("111500")]
        tePedProrrog1,

        [EnumValue("111501")]
        tePedProrrog2,

        [EnumValue("111502")]
        teCanPedProrrog1,

        [EnumValue("111503")]
        teCanPedProrrog2,

        [EnumValue("210200")]
        teManifDestConfirmacao,

        [EnumValue("210210")]
        teManifDestCiencia,

        [EnumValue("210220")]
        teManifDestDesconhecimento,

        [EnumValue("210240")]
        teManifDestOperNaoRealizada,

        [EnumValue("610600")]
        teRegistroCTe,

        [EnumValue("610614")]
        teMDFeAutorizadoComCTe,

        [EnumValue("790700")]
        teAverbacaoExportacao,

        [EnumValue("9909


/*
 *  SPDX-FileCopyrightText: 2025 Dmitry Kazakov <dimula73@gmail.com>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */
#ifndef KISWAYLANDOUTPUTCOLORINFO_H
#define KISWAYLANDOUTPUTCOLORINFO_H

#include <surfacecolormanagement/KisOutputColorInfoInterface.h>

#include <unordered_map>

class KisWaylandAPIOutput;
class KisWaylandAPIColorManager;

class KisWaylandOutputColorInfo : public KisOutputColorInfoInterface
{
    Q_OBJECT
public:
    KisWaylandOutputColorInfo(QObject *parent = nullptr);
    ~KisWaylandOutputColorInfo() override;

    bool isReady() const override;
    std::optional<KisSurfaceColorimetry::SurfaceDescription> outputDescription(const QScreen *screen) const override;

private:
    void reinitialize();
    void initScreenConnection(QScreen *screen);
    void slotScreenAdded(QScreen *screen);
    void slotScreenRemoved(QScreen *screen);

    void setReadyImpl(bool value);
    bool checkIfAllReady() const;

private:
    std::shared_ptr<KisWaylandAPIColorManager> m_waylandManager;
    std::unordered_map<const QScreen*, std::unique_ptr<KisWaylandAPIOutput>> m_waylandOutputs;
    bool m_isReady {false};
};

#endif /* KISWAYLANDOUTPUTCOLORINFO_H */


_ptr = spectrogram_ptr.as_mut_ptr();
        unsafe {
            CheapTrick(x.as_ptr(), x_length, fs, temporal_positions.as_ptr(), f0.as_ptr(), f0_length, &option as *const _, spectrogram_ptr);
        }
	assert_eq!(spectrogram.len(), yl);
	assert_eq!(spectrogram[0].len(), xl);
	// assert_eq!(spectrogram[0][0], 0.0000000000000000973637408614245);
    }

    // Codec test
    use crate::{GetNumberOfAperiodicities,
		CodeAperiodicity,
		DecodeAperiodicity,
		CodeSpectralEnvelope,
		DecodeSpectralEnvelope};
    #[test]
    fn test_get_number_of_aperiodicities() {
	let fs = 44100;
	let n_aperiodicities;
	unsafe {
	    n_aperiodicities = GetNumberOfAperiodicities(fs);
	}
	assert_eq!(n_aperiodicities, 5);
    }

    #[test]
    fn test_code_aperiodicity() {
	let fs                         = 44100_i32;
	let f0_length                  = 2_i32;
	let fft_size                   = 2048_i32;
	let aperiodicity               = vec![vec![0.999999999999; (fft_size/2+1) as usize]; f0_length as usize];
	let aperiodicity_ptr           = aperiodicity.iter().map(|inner| inner.as_ptr()).collect::<Vec<_>>();
	let aperiodicity_ptr           = aperiodicity_ptr.as_ptr();
	let n_aperiodicity;
	unsafe {
	    n_aperiodicity             = GetNumberOfAperiodicities(fs);
	}
	let mut coded_aperiodicity     = vec![vec![0.0; n_aperiodicity as usize]; f0_length as usize];
	let mut coded_aperiodicity_ptr = coded_aperiodicity.iter_mut().map(|inner| inner.as_mut_ptr()).collect::<Vec<_>>();
	let coded_aperiodicity_ptr     = coded_aperiodicity_ptr.as_mut_ptr();
	unsafe {
	    CodeAperiodicity(aperiodicity_ptr, f0_length, fs, fft_size, coded_aperiodicity_ptr);
	}
	assert_eq!(coded_aperiodicity.len(), f0_length as usize);
	assert_eq!(coded_aperiodicity[0].len(), n_aperiodicity as usize);
	// assert_eq!(coded_aperiodicity[0][0], -0.0000000000086856974912498);
    }

    #[test]
    fn test_decode_aperiodicity() {
	let fs                         = 44100_i32;
	let f0_length                  = 2_i32;
	let fft_size                   = 2048_i32;
	let mut aperiodicity           = vec![vec![0.0; (fft_size/2+1) as usize]; f0_length as usize];
	let mut aperiodicity_ptr       = aperiodicity.iter_mut().map(|inner| inner.as_mut_ptr()).collect::<Vec<_>>();
	let aperiodicity_ptr           = aperiodicity_ptr.as_mut_ptr();
	let n_aperiodicity;
	unsafe {
	    n_aperiodicity             = GetNumberOfAperiodicities(fs);
	}
	let coded_aperiodicity     = vec![vec![-0.0000000000086856974912498; n_aperiodicity as usize]; f0_length as usize];
	let coded_aperiodicity_ptr = coded_aperiodicity.iter().map(|inner| inner.as_ptr()).collect::<Vec<_>>();
	let coded_aperiodicity_ptr     = coded_aperiodicity_ptr.as_ptr();
	unsafe {
	    DecodeAperiodicity(coded_aper


[Retrive runs from WandB]
    D --> E[Update Google Sheets using new data]
    E --> F[Schedule task to run every 30 minutes]

    F --> |Schedular : 30 min| C
```

## 주요 기능
- W&B에서 가져온 실험 데이터를 Google 스프레드시트에 자동으로 업데이트.
- 기존 데이터와 중복되지 않는 실험 데이터만 추가하여 기록.
- 고정된 헤더 및 동적 헤더를 구성하여 실험 데이터를 시각적으로 깔끔하게 정리.
- NaN 값 처리 및 특수 문자 제거 기능 포함.
- spreadsheet에서 수정한 값이 업데이트에 반영됨

## 요구사항

- **WandB** - W&B API와 관련된 python library 입니다.
- **gspread** - Google Sheets API를 통해 스프레드시트에 접근하고 데이터를 수정하는 python library 입니다.
- **Google Cloud Platform JSON 파일**: Google Sheets API에 접근하기 위해서는 Google Cloud에서 인증 파일(서비스 계정 키 JSON 파일)을 다운로드해야 합니다.
- **W&B login**: 사용자는 모델을 훈련 중이며, WandB에 접속한 상태가 요구됩니다.
- **oauth2client** - Google 서비스 인증과 관련된 python libary 입니다.

다음 명령어를 사용하여 라이브러리를 설치할 수 있습니다.

```bash
pip install wandb gspread oauth2client
```
or
```python
pip install -r requirements.txt
```

## 사용 방법
1. Clone the repository
   ```bash
      git clone https://github.com/taeyoung1005/wandb-spreadsheet-sync.git
   ```

1. **Google Sheets API 설정**
   - [Google Cloud Console](https://console.cloud.google.com/)에서 Google Sheets API를 활성화하고 서비스 계정을 생성한 후 JSON 키 파일을 다운로드합니다.
   - 프로젝트 디렉토리에 JSON 파일을 저장합니다.

2. **config.json 설정**
   - `FIXED_HEADERS` : Spreadsheet에 기록할 header(column)을 지정합니다.
   - `GCP_JSON` : Google Cloud Console에서 다룬도드한 사용자의 API key file 경로를 설정합니다.

3. **Main script


R

	dc.w	PLAY_COPPER_WORD+$5000,$fffe
	if TRACKLOADER=0
	dc.w	COLOR31
quitTopColor:
	dc.w	MENU_TEXT_COLOR
	dc.w	$ffdf,$fffe
	dc.w	$06df,$fffe
	dc.w	COLOR31,MENU_TEXT_BOTTOM_COLOR
	else
	dc.w	$ffdf,$fffe
	dc.w	$06df,$fffe
	endif

	dc.w	$22df,$fffe
	dc.w	COLOR31,$bbb
	dc.w	$26df,$fffe
	dc.w	COLOR31,$999

	dc.l	$fffffffe

selectedPtr:
	dc.l	playTopColor


            ).also { texture ->
                texture.setFilter(false, true)
            }
        )
    }

    return textureLocation
}

fun getNativeImageFromBase64(texture: String): NativeImage {
    val base64string = texture.substringAfter("base64;")
    val base64bytes = Base64.getDecoder().decode(
        base64string.replace("\n".toRegex(), "").toByteArray(Charsets.UTF_8)
    )

    MemoryStack.stackPush().use { memoryStack ->
        val byteBuffer: ByteBuffer = memoryStack.malloc(base64bytes.size)
        byteBuffer.put(base64bytes)
        byteBuffer.rewind()

        return NativeImage.read(byteBuffer)
    }
}
package su.plo.lib.mod.client.render

//#if MC<12105
import com.mojang.blaze3d.systems.RenderSystem
import org.lwjgl.opengl.GL11
import org.lwjgl.opengl.GL14
import su.plo.lib.mod.client.compat.vulkan.VulkanCompat

//#if FABRIC
import su.plo.lib.mod.client.compat.vulkan.VulkanGlState
//#endif

data class GlState(
    var depthFunc: Int?,
    var cull: Boolean,
    var blendFunc: List<Int>?,
    var depthMask: Boolean,
) {
    fun javaCopy() = this.copy()

    fun apply(current: GlState) {
        val depthFunc = depthFunc
        if (current.depthFunc != depthFunc) {
            current.depthFunc = depthFunc
            if (depthFunc != null) {
                RenderSystem.enableDepthTest()
                RenderSystem.depthFunc(depthFunc)
            } else {
                RenderSystem.disableDepthTest()
            }
        }

        if (current.cull != cull) {
            current.cull = cull
            if (cull) {
                RenderSystem.enableCull()
            } else {
                RenderSystem.disableCull()
            }
        }

        val blendFunc = blendFunc
        if (current.blendFunc != blendFunc) {
            current.blendFunc = blendFunc
            if (blendFunc != null) {
                RenderSystem.enableBlend()
                RenderSystem.blendFuncSeparate(
                    blendFunc[0],
                    blendFunc[1],
                    blendFunc[2],
                    blendFunc[3],
                )
            } else {
                RenderSystem.disableBlend()
            }
        }

        if (current.depthMask != depthMask) {
            current.depthMask = depthMask
            RenderSystem.depthMask(depthMask)
        }
    }

    companion object {
        @JvmStatic
        fun current(): GlState {
            //#if FABRIC
            if (VulkanCompat.hasVulkan) {
                return VulkanGlState.current()
            }
            //#endif

            val depthFunc: Int? =
                if (GL11.glIsEnabled(GL11.GL_DEPTH_TEST))
                    GL11.glGetInteger(GL11.GL_DEPTH_FUNC)
                else
                    null

            val cull = GL11.glIsEnabled(GL11.GL_CULL_FACE)

            val blendFunc: List<Int>? =
                if (GL11.glIsEnabled(GL11.GL_BLEND))
                    listOf(
                        GL11.glGetInteger(GL14.GL_BLEND_SRC_RGB),
                        GL11.glGetInteger(GL14.GL_BLEND_DST_RGB),
                        GL11.


entypen data, size_t offset, __global gentype *p)

  void vstoren(gentypen data, size_t offset, __local gentype *p)

  void vstoren(gentypen data, size_t offset, __private gentype *p)

  For OpenCL C 2.0, or OpenCL C 3.0 or newer with the
  __opencl_c_<wbr>generic_<wbr>address_<wbr>space feature:

  void vstoren(gentypen data, size_t offset, gentype *p)

Write n * sizeof(gentype) bytes given by data to the address
      computed as (p +  (offset * n)).
      The computed address must be 8-bit aligned if gentype is char or
      uchar; 16-bit aligned if gentype is
half,
      short or ushort; 32-bit aligned if gentype is int, uint, or
      float; and 64-bit aligned if gentype is long or ulong.

float vload_half(size_t offset, const __global half *p)

  float vload_half(size_t offset, const __local half *p)

  float vload_half(size_t offset, const __constant half *p)

  float vload_half(size_t offset, const __private half *p)

  For OpenCL C 2.0, or OpenCL C 3.0 or newer with the
  __opencl_c_<wbr>generic_<wbr>address_<wbr>space feature:

  float vload_half(size_t offset, const half *p)

Read sizeof(half) bytes of data from the address computed as (p
      +  offset).
      The data read is interpreted as a half value.
      The half value is converted to a float value and the float value
      is returned.
      The computed read address must be 16-bit aligned.

floatn vload_halfn(size


,bv={name:"Notebook"},kv={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Sv=e("path",{fill:"currentColor",d:"M192 128v768h640V128H192zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z"},null,-1),qv=e("path",{fill:"currentColor",d:"M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32z"},null,-1),Fv=[Sv,qv];function Dv(t,a,_,r,l,i){return o(),n("svg",kv,Fv)}var Pv=s(bv,[["render",Dv],["__file","notebook.vue"]]),Rv={name:"Notification"},Tv={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Ov=e("path",{fill:"currentColor",d:"M512 128v64H256a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V512h64v256a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128h256z"},null,-1),Gv=e("path",{fill:"currentColor",d:"M768 384a128 128 0 1 0 0-256 128 128 0 0 0 0 256zm0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384z"},null,-1),Uv=[Ov,Gv];function Wv(t,a,_,r,l,i){return o(),n("svg",Tv,Uv)}var Iv=s(Rv,[["render",Wv],["__file","notification.vue"]]),Ev={name:"Odometer"},Nv={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Zv=e("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),Kv=e("path",{fill:"currentColor",d:"M192 512a320 320 0 1 1 640 0 32 32 0 1 1-64 0 256 256 0 1 0-512 0 32 32 0 0 1-64 0z"},null,-1),Qv=e("path",{fill:"currentColor",d:"M570.432 627.84A96 96 0 1 1 509.568 608l60.992-187.776A32 32 0 1 1 631.424 440l-60.992 187.776zM502.08 734.464a32 32 0 1 0 19.84-60.928 32 32 0 0 0-19.84 60.928z"},null,-1),jv=[Zv,Kv,Qv];function Jv(t,a,_,r,l,i){return o(),n("svg",Nv,jv)}var Xv=s(Ev,[["render",Jv],["__file","odometer.vue"]]),Yv={name:"OfficeBuilding"},ed={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},td=e("path",{fill:"currentColor",d:"M192 128v704h384V128H192zm-32-64h448a32 32 0 0 1 32 32v768a32 32 0 0 1-32


  }

    [Fact]
    public void WhenProviderNameIsEmpty_ThenThrows()
    {
        _dto.ProviderName = string.Empty;

        _validator
            .Invoking(x => x.ValidateAndThrow(_dto))
            .Should().Throw<ValidationException>()
            .WithMessageLike(Resources.MigrateSubscriptionRequestValidator_InvalidProviderName);
    }

    [Fact]
    public void WhenProviderNameIsInvalid_ThenThrows()
    {
        _dto.ProviderName = "^aninvalidplanid";

        _validator
            .Invoking(x => x.ValidateAndThrow(_dto))
            .Should().Throw<ValidationException>()
            .WithMessageLike(Resources.MigrateSubscriptionRequestValidator_InvalidProviderName);
    }

    [Fact]
    public void WhenProviderStateIsEmpty_ThenThrows()
    {
        _dto.ProviderState = new Dictionary<string, string>();

        _validator
            .Invoking(x => x.ValidateAndThrow(_dto))
            .Should().Throw<ValidationException>()
            .WithMessageLike(Resources.MigrateSubscriptionRequestValidator_InvalidProviderState);
    }
}


	// This value, if set, SHALL NOT exceed 100 bytes.
	Metadata []byte `protobuf:"bytes,27,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// *
	// Access Control of metadata update for this token.
	//

	// A transaction to update the `metadata` field of this token MUST be
	// signed by this key.

	// If this token is a non-fungible/unique token type, a transaction to
	// update the `metadata` field of any individual serialized unique token
	// of this type MUST be signed by this key.

	// If this key is not set, the token metadata SHALL NOT be changed after it
	// is created.

	// If this key is not set, the metadata for any individual serialized token
	// of this type SHALL NOT be changed after it is created.

	// This key MAY be set when the token is created, and MAY be set or modified
	// via a token update transaction signed by the `admin_key`.

	// If `admin_key` is not set, this value, whether set or unset,
	// SHALL be immutable.
	MetadataKey   *Key `protobuf:"bytes,28,opt,name=metadata_key,json=metadataKey,proto3" json:"metadata_key,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *TokenInfo) Reset() {
	*x = TokenInfo{}
	mi := &file_token_get_info_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *TokenInfo) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*TokenInfo) ProtoMessage() {}

func (x *TokenInfo) ProtoReflect() protoreflect.Message {
	mi := &file_token_get_info_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use TokenInfo.ProtoReflect.Descriptor instead.
func (*TokenInfo) Descriptor() ([]byte, []int) {
	return file_token_get_info_proto_rawDescGZIP(), []int{1}
}

func (x *TokenInfo) GetTokenId() *TokenID {
	if x != nil {
		return x.TokenId
	}
	return nil
}

func (x *TokenInfo) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *TokenInfo) GetSymbol() string {
	if x != nil {
		return x.Symbol
	}
	return ""
}

func (x *TokenInfo) GetDecimals() uint32 {
	if x != nil {
		return x.Decimals
	}
	return 0
}

func (x *TokenInfo) GetTotalSupply() uint64 {
	if x != nil {
		return x.TotalSupply
	}
	return 0
}

func (x *TokenInfo) GetTreasury() *AccountID {
	if x != nil {
		return x.Treasury
	}
	return nil
}

func (x *TokenInfo) GetAdminKey() *Key {
	if x != nil {
		return x.AdminKey
	}
	return nil
}

func (x *TokenInfo) GetKycKey() *Key {
	if x != nil {
		return x.KycKey
	}
	return nil
}

func (x *TokenInfo) GetFreezeKey() *Key {
	if x != nil {
		return x.FreezeKey
	}
	return nil
}

func (x *TokenInfo) GetWipeKey() *Key {
	if x != nil {
		return x.WipeKey
	}
	return nil
}

func (x *TokenInfo) GetSupplyKey() *Key {
	if x != nil {
		return x.SupplyKey
	}
	return nil
}

func (x *TokenInfo) GetDefaultFreezeStatus() TokenFreezeStatus {


C14, C11

	MOV		C23, C11
	MOV		C24, C11

	MOV		C33, C11
	MOV		C34, C11

	MOV		C43, C11
	blez	L, .L182
	MOV		C44, C11
#endif

	.align	4
.L1810:
	daddiu	L, L, -1
	MADD	C11, C11, A1, B1
	LD		B5, 8 * SIZE(AO)

	MADD	C21, C21, A2, B1
	LD		B6, 9 * SIZE(AO)

	MADD	C31, C31, A3, B1
	LD		B7, 10 * SIZE(AO)

	MADD	C41, C41, A4, B1
	LD		B8, 11 * SIZE(AO)

	MADD	C13, C13, A5, B1
	LD		B2, 1 * SIZE(BO)
	daddiu	BO, BO, 2 * SIZE

	MADD	C23, C23, A6, B1
	LD		A1, 12 * SIZE(AO)

	MADD	C33, C33, A7, B1
	LD		A2, 13 * SIZE(AO)

	MADD	C43, C43, A8, B1
	LD		A3, 14 * SIZE(AO)

	LD		A4, 15 * SIZE(AO)
	daddiu	AO, AO, 16 * SIZE

	MADD	C11, C11, B5, B2
	LD		A5, 4 * SIZE(AO)

	MADD	C21, C21, B6, B2
	LD		A6, 5 * SIZE(AO)

	MADD	C13, C13, A1, B2
	LD		A7, 6 * SIZE(AO)

	MADD	C23, C23, A2, B2
	LD		A8, 7 * SIZE(AO)

	MADD	C33, C33, A3, B2
	LD		B1, 0 * SIZE(BO)

	MADD	C43, C43, A4, B2
	LD		A1, 0 * SIZE(AO)

	MADD	C31, C31, B7, B2
	LD		A2, 1 * SIZE(AO)

	MADD	C41, C41, B8, B2
	LD		A3, 2 * SIZE(AO)

	bgtz	L, .L1810
	LD		A4, 3 * SIZE(AO)

	.align	4
.L182:
#ifndef TRMMKERNEL
	andi	L, K, 1
#else
	andi	L, TEMP, 1
#endif
	blez	L, .L180
	LD		ALPHA, 152($sp)

	MADD	C13, C13, A5, B1
	MADD	C23, C23, A6, B1
	MADD	C33, C33, A7, B1
	MADD	C43, C43, A8, B1
	daddiu	AO, AO, 8 * SIZE

	MADD	C11, C11, A1, B1
	MADD	C21, C21, A2, B1
	MADD	C31, C31, A3, B1
	MADD	C41, C41, A4, B1
	daddiu	BO, BO, 1 * SIZE

	.align	4
.L180:							#	Write Back
#ifndef TRMMKERNEL
	daddiu	I, I, -1

	LD		A1, 0 * SIZE(C)
	LD		A2, 1 * SIZE(C)
	LD		A3, 2 * SIZE(C)
	LD		A4, 3 * SIZE(C)
	LD		A5, 4 * SIZE(C)
	LD		A6, 5 * SIZE(C)
	LD		A7, 6 * SIZE(C)
	LD		A8, 7 * SIZE(C)

	MADD		A1, A1, C11, ALPH


func NewSignatureTable(db ormtable.Schema) (SignatureTable, error) {
	table := db.GetTable(&Signature{})
	if table == nil {
		return nil, ormerrors.TableNotFound.Wrap(string((&Signature{}).ProtoReflect().Descriptor().FullName()))
	}
	return signatureTable{table.(ormtable.AutoIncrementTable)}, nil
}

type AttestationStore interface {
	AttestationTable() AttestationTable
	SignatureTable() SignatureTable

	doNotImplement()
}

type attestationStore struct {
	attestation AttestationTable
	signature   SignatureTable
}

func (x attestationStore) AttestationTable() AttestationTable {
	return x.attestation
}

func (x attestationStore) SignatureTable() SignatureTable {
	return x.signature
}

func (attestationStore) doNotImplement() {}

var _ AttestationStore = attestationStore{}

func NewAttestationStore(db ormtable.Schema) (AttestationStore, error) {
	attestationTable, err := NewAttestationTable(db)
	if err != nil {
		return nil, err
	}

	signatureTable, err := NewSignatureTable(db)
	if err != nil {
		return nil, err
	}

	return attestationStore{
		attestationTable,
		signatureTable,
	}, nil
}
package module

import (
	"context"

	"github.com/omni-network/omni/halo/evmstaking/keeper"
	"github.com/omni-network/omni/halo/evmstaking/types"
	evmenginetypes "github.com/omni-network/omni/octane/evmengine/types"

	"cosmossdk.io/core/appmodule"
	"cosmossdk.io/core/store"
	"cosmossdk.io/depinject"
	"github.com/cosmos/cosmos-sdk/client"
	"github.com/cosmos/cosmos-sdk/codec"
	cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
	"github.com/cosmos/cosmos-sdk/types/module"
	stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
	"github.com/grpc-ecosystem/grpc-gateway/runtime"
)

const (
	ConsensusVersion = 2
)

var (
	_ module.AppModuleBasic   = (*AppModule)(nil)
	_ appmodule.AppModule     = (*AppModule)(nil)
	_ appmodule.HasEndBlocker = (*AppModule)(nil)
)

// ----------------------------------------------------------------------------
// AppModuleBasic
// ----------------------------------------------------------------------------

// AppModuleBasic implements the AppModuleBasic interface that defines the
// independent methods a Cosmos SDK module needs to implement.
type AppModuleBasic struct {
	cdc codec.BinaryCodec
}

func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic {
	return AppModuleBasic{cdc: cdc}
}

// Name returns the name of the module as a string.
func (AppModuleBasic) Name() string {
	return types.ModuleName
}

func (AppModuleBasic) ConsensusVersion() uint64 {
	return ConsensusVersion
}

// RegisterLegacyAminoCodec registers the amino codec for the module, which is used
// to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore.
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}

// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message.
func (AppModuleBasic) RegisterInterfaces(cdctypes.InterfaceRegistry) {}

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
func (AppModuleBasic) RegisterGRPCGa


lAsync(EditCategoryEvent @event, CancellationToken cancellationToken = default)
    {
        _logger?.LogInformation($"cancel edit category log, CategoryId:{@event.CategoryId}, Name:{@event.CategoryName}");
        return Task.CompletedTask;
    }

    [EventHandler(20)]
    public Task HandleAsync(EditCategoryEvent @event, CancellationToken cancellationToken = default)
    {
        _logger?.LogInformation($"edit category log, CategoryId:{@event.CategoryId}, Name:{@event.CategoryName}");
        return Task.CompletedTask;
    }
}


				frame.frameAt(frameIndex++)
					)
				)
			}
			repeat(numLocals)
			{
				entries.add(
					Variable(
						"[local] " + names.next(),
						frame.frameAt(frameIndex++)
					)
				)
			}
			repeat(numConstants)
			{
				entries.add(
					Variable(
						"[const] " + names.next(),
						frame.frameAt(frameIndex++)
					)
				)
			}
			for (i in 1 .. numOuters)
			{
				entries.add(
					Variable(
						"[outer] " + names.next(),
						function.outerVarAt(i)
					)
				)
			}
			for (i in frame.numSlots() downTo frame.stackp())
			{
				// Give the top-of-stack its own name, so that leaving it
				// selected during stepping will continue to re-select it.
				val name =
					if (i == frame.stackp()) "stack top"
					else "stack [$i]"
				entries.add(Variable(name, frame.frameAt(i)))
			}
		}
		val root = variablesPane.model.root as LazyTreeNode
		root.removeAllChildren()
		entries.forEach {
			val node = LazyTreeNode(
				AvailObjectFieldHelper(
					null,
					DebuggerObjectSlots.DUMMY_DEBUGGER_SLOT,
					-1,
					it.value,
					slotName = it.name,
					forcedName = it.presentationString
				)
			)
			node.computeChildren()
			root.add(node)
		}
		val model = variablesPane.model as DefaultTreeModel
		model.nodeStructureChanged(root)
		variablesPane.repaint()

		//TODO Preserve selection based on oldPath
		// variablesPane.selectionPath = oldPath
	}

	/**
	 * A mechanism by which a monotonic [Long] is allocated, to associate with a
	 * variable stringification request; when the stringification completes, the
	 * completion lock is held while the [variableValuePane] is updated, but
	 * only if the associated [Long] is the largest that has been completed.
	 */
	private val paneVersionTracker = object
	{
		val allocator = AtomicLong(0)

		var renderedVersion: Long = -1
	}

	/**
	 * The user has indicated the desire to textually render a variable's value
	 * in the [variableValuePane]. Allow multiple overlapping requests, but only
	 * ever display the most recently allocated request which has completed.  In
	 * theory, we could terminate the stringification fibers corresponding to
	 * values we'll never see (because a newer request has already been
	 * satisfied), but we'll save that for a later optimization.
	 */
	private fun updateVariableValuePane()
	{
		val id = paneVersionTracker.allocator.getAndIncrement()
		val node = variablesPane.lastSelectedPathComponent as? LazyTreeNode
		// Do some trickery to avoid stringifying null or nil.  In either case,
		// just plug in the trueObject instead.
		var v = node?.userObject
		if (v is AvailObjectFieldHelper)
		{
			v = v.value
		}
		if (v is AvailIntegerValueHelper)
		{
			v = v.longValue
		}
		val valueToStringify = when (v)
		{
			null -> trueObject //dummy
			is AvailObject -> v.ifNil { trueObject }
			else -> trueObject //any non-AvailObject
		}
		runtime.stringifyThen(
			valueToStringify,
			setup = {
				// Prevent the debugger from capturing this fiber, or any fibers
				// that it forks.
				heritableFiberGlobals =
					heritableFiberGlobals.mapAtPuttingCanDestroy(
						DONT_DEBUG_KEY.atom, trueObject, true)
			})
		{
			// Undo the above trickery.
			val string = when (v)
			{
				null -> ""
				nil -> "nil\n"
				is AvailObject -> "${v.typeTag}\n\n$it\n"
				else -> "${v.javaClass.simpleName}\n\n$v\n"
			}
			//


fails when properties do not match', () => {
    expect(tsfv.properties({ a: tsfv.not.undefined() }).test({})).to.be.false;
    expect(tsfv.properties({ a: tsfv.number() }).test({ a: '123' })).to.be.false;
    expect(tsfv.properties({ a: tsfv.number(), b: tsfv.string() }).test({ a: 123, b: 456 })).to.be.false;
  });
  it('passes when only with no additional properties', () => {
    expect(tsfv.properties({}, true).test({})).to.be.true;
    expect(tsfv.properties({}, true).test(Object.create(base))).to.be.true;
    expect(tsfv.properties({ a: tsfv.number() }, true).test({ a: 123 })).to.be.true;
  });
  it('fails when only with additional properties', () => {
    expect(tsfv.properties({}, true).test(base)).to.be.false;
    expect(tsfv.properties({ a: tsfv.number() }, true).test({ a: 123, b: 'x' })).to.be.false;
  });
  it('fails when not object', () => {
    expect(tsfv.properties({}).test(null)).to.be.false;
    expect(tsfv.properties({}).test(undefined)).to.be.false;
    expect(tsfv.properties({}).test(false)).to.be.false;
    expect(tsfv.properties({}).test(true)).to.be.false;
    expect(tsfv.properties({}).test(0)).to.be.false;
    expect(tsfv.properties({}).test(1)).to.be.false;
    expect(tsfv.properties({}).test('')).to.be.false;
    expect(tsfv.properties({}).test([])).to.be.false;
  });
});
const WaterMountains = (array) => {
  let i = 0
  let row = 0
  let water = 0
  let no_water = 0
  let nexMountain = 0
  let initialMountain = 0
  while (i < array.length) {
    console.log(`Array number: ${array[i]}`)
    if (array[i] < initialMountain) {
      water = (initialMountain - array[i]) + water
      if (array[i] < nexMountain) {
        no_water = (initialMountain - nexMountain) * row
        row = 0
      }
      nexMountain = array[i]
      row += 1
    }
    console.log(`initialMountain ${initialMountain}, Water gathered: ${water}`)
    if (array[i] >= initialMountain) {
      initialMountain = array[i]
      nexMountain = 0
      no_water = 0
      row = 0
    }
    i++
  }
  no_water = ((initialMountain - nexMountain) * row) + no_water
  return water - no_water
}

const WATER_MOUNTAINS_TEST = [
  [1, 2, 0, 2],
  [3, 1, 3, 0, 3],
  [3, 1, 1, 0, 3],
  [3, 3, 1, 2, 3, 0, 1],
  [3, 3, 1, 2, 2, 0, 1],
  [2, 2, 1, 2, 2, 0, 1],
  [1, 3, 0, 1, 3, 1, 1, 1],
]

console.log(`
        __    __
     __|__|  |__|
  __|__|__|__|__|__
`)
console.log('The water trapped is :', WaterMountains(WATER_MOUNTAINS_TEST[0]))

console.log(`\n
   __    __    __
  |__|  |__|  |__|
  |__|__|__|  |__|
__|__|__|__|__|__|__
`)
console.log('The water trapped is :', WaterMountains(WATER_MOUNTAINS_TEST[1]))

console.log(`\n
   __          __
  |__|        |__|
  |__|__ __   |__|
__|__|__|__|__|__|__
`)
console.log('The water trapped is :', WaterMountains


cChannel#method.new]
    /// - [set()][NcChannel#method.set]
    /// - [set_rgb8()][NcChannel#method.set_rgb8]
    ///
    /// *C style function: [channel_set_not_default()][c_api::ncchannel_set_not_default].*
    //
    // Not in the C API
    fn set_not_default(&mut self) -> Self {
        c_api::ncchannel_set_not_default(self)
    }

    // NcPaletteIndex

    /// Is this NcChannel using palette-indexed color rather than RGB?
    ///
    /// *C style function: [channel_set_default()][c_api::ncchannel_set_default].*
    fn palindex_p(&self) -> bool {
        c_api::ncchannel_palindex_p(*self)
    }
}

// NcChannels ---------------------------------------------------------------

/// # NcChannels Methods
impl NcChannelsApi for NcChannels {
    // Constants

    /// If this bit is set, we are *not* using the default background color.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const BG_DEFAULT_MASK: u32 = super::constants::NC_BGDEFAULT_MASK;

    /// Extract these bits to get the background [`NcAlpha`] mask.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const BG_ALPHA_MASK: u32 = super::constants::NC_BG_ALPHA_MASK;

    /// If this bit *and*
    /// [`BG_DEFAULT_MASK`][NcChannels#associatedconstant.BG_DEFAULT_MASK]
    /// are set, we're using a palette-indexed background color.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const BG_PALETTE_MASK: u32 = super::constants::NC_BG_PALETTE;

    /// Extract these bits to get the background [`NcRgb`][crate::NcRgb] value.
    const BG_RGB_MASK: u32 = super::constants::NC_BG_RGB_MASK;

    /// If this bit is set, we are *not* using the default foreground color.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const FG_DEFAULT_MASK: u64 = super::constants::NC_FGDEFAULT_MASK;

    /// Extract these bits to get the foreground [`NcAlpha`] mask.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const FG_ALPHA_MASK: u64 = super::constants::NC_FG_ALPHA_MASK;

    /// If this bit *and*
    /// [`FG_DEFAULT_MASK`][NcChannels#associatedconstant.FG_DEFAULT_MASK]
    /// are set, we're using a palette-indexed background color.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const FG_PALETTE_MASK: u64 = super::constants::NC_FG_PALETTE;

    /// Extract these bits to get the foreground [`NcRgb`][crate::NcRgb] value.
    ///
    /// See the detailed diagram at [`NcChannels`][crate::NcChannels]
    const FG_RGB_MASK: u64 = super::constants::NC_FG_RGB_MASK;
    // Constructors

    /// New `NcChannels`, set to black and NOT using the "default color".
    fn new() -> Self {
        Self::combine(
            0 as NcChannel | c_api::NC_BGDEFAULT_MASK,
            0 as NcChannel | c_api::NC_BGDEFAULT_MASK,
        )
    }

    /// New `NcChan


:setVisible(not c:isVisible())
                                            end },
            },
            {
                PushButton { text = "OK" },
                PushButton { text = "Cancel", id = "b5" },
                PushButton { text = "OK" ,
                    style = {
                        {"Height",  40}
                    }
                },
            },
            {
                PushButton { text = "OK" },
                PushButton { text = "OK" },
                PushButton { text = "Exit",
                             onClicked = function() app:close() end },
            }
        },
        --Space {}
    }
}

win:show()

app:runEventLoop()


cFlowEntryPusher.COLUMN_HARD_TIMEOUT, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_PRIORITY:
				entry.put(StaticFlowEntryPusher.COLUMN_PRIORITY, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_COOKIE: // set manually, or computed from name
				entry.put(StaticFlowEntryPusher.COLUMN_COOKIE, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_IN_PORT:
				entry.put(StaticFlowEntryPusher.COLUMN_IN_PORT, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_DL_SRC:
				entry.put(StaticFlowEntryPusher.COLUMN_DL_SRC, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_DL_DST:
				entry.put(StaticFlowEntryPusher.COLUMN_DL_DST, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_DL_VLAN:
				entry.put(StaticFlowEntryPusher.COLUMN_DL_VLAN, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_DL_VLAN_PCP:
				entry.put(StaticFlowEntryPusher.COLUMN_DL_VLAN_PCP, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_DL_TYPE:
				entry.put(StaticFlowEntryPusher.COLUMN_DL_TYPE, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_NW_TOS: // only valid for OF1.0; all other should specify specifics (ECN and/or DSCP bits)
				entry.put(StaticFlowEntryPusher.COLUMN_NW_TOS, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_NW_ECN:
				entry.put(StaticFlowEntryPusher.COLUMN_NW_ECN, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_NW_DSCP:
				entry.put(StaticFlowEntryPusher.COLUMN_NW_DSCP, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_NW_PROTO:
				entry.put(StaticFlowEntryPusher.COLUMN_NW_PROTO, jp.getText());
				ipProto = jp.getText();
				break;
			case StaticFlowEntryPusher.COLUMN_NW_SRC:
				entry.put(StaticFlowEntryPusher.COLUMN_NW_SRC, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_NW_DST:
				entry.put(StaticFlowEntryPusher.COLUMN_NW_DST, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_SCTP_SRC:
				entry.put(StaticFlowEntryPusher.COLUMN_SCTP_SRC, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_SCTP_DST:
				entry.put(StaticFlowEntryPusher.COLUMN_SCTP_DST, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_UDP_SRC:
				entry.put(StaticFlowEntryPusher.COLUMN_UDP_SRC, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_UDP_DST:
				entry.put(StaticFlowEntryPusher.COLUMN_UDP_DST, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_TCP_SRC:
				entry.put(StaticFlowEntryPusher.COLUMN_TCP_SRC, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_TCP_DST:
				entry.put(StaticFlowEntryPusher.COLUMN_TCP_DST, jp.getText());
				break;
			case StaticFlowEntryPusher.COLUMN_TP_SRC: // support for OF1.0 generic transport ports
				entry.put(StaticFlowEntryPusher.COLUMN_TP_


ime = (event.time - runStart[pid]) / 1000
                runsliceTime.add(time)

                if pid not in runTimeMap:
                    runTimeMap[pid] = []

                runTimeMap[pid].append(time)

        bpf["events"].open_perf_buffer(metric_record, page_cnt=128)
        while 1:
            runlast = waitlast = sleeplast = 0

            if ctypes.c_uint32(target_pid) in bpf["runlast"]:
                runlast = bpf['runlast'][ctypes.c_uint32(target_pid)].value
            if ctypes.c_uint32(target_pid) in bpf["waitlast"]:
                waitlast = bpf['waitlast'][ctypes.c_uint32(target_pid)].value
            if ctypes.c_uint32(target_pid) in bpf["sleeplast"]:
                sleeplast = bpf['sleeplast'][ctypes.c_uint32(target_pid)].value
            all = runlast + waitlast + sleeplast

            runlast, waitlast, sleeplast, all = deltaMgr.update([runlast, waitlast, sleeplast, all])

            if all != 0:
                # sleepTime/ms  runTime/us  runslice/us  runCount
                print("%8.2f  %9.2f  %9.2f  %10d  %10d  %12.1f  %10.1f  %12.1f  %8.1f" %
                    (runlast / all * 100, waitlast / all * 100, sleeplast / all * 100,
                    int(all / 1000000), 1000,
                    sleepTime.recent()/1000, runTime.recent(),
                    runsliceTime.recent(), runCount.recent() ) )
            else: # 避免除以0
                print("%8.2f  %9.2f  %9.2f  %10d  %10d  %12.1f  %10.1f  %12.1f  %8.1f" %
                    (0, 0, 0, int(all / 1000000), 1000,
                    sleepTime.recent()/1000, runTime.recent(),
                    runsliceTime.recent(), runCount.recent() ) )

            bpf.perf_buffer_poll()
            sleep(1)
            nowtime += 1
            if nowtime % 12 == 0:
                print()
                print(thead)

    # 生成进程的状态切换JSON文件，写入到python_exporter目录下
    elif args.type == "json":
        print("Monitoring process pid = %d" % args.pid)
        waker_comm = ""
        jsonMap = []
        boot_time = psutil.boot_time()  # 系统启动时间戳
        curState = "run"

        def commit_change():
            f = open("../../exporter/metrics.json", "w") # 写死的输出路径，之后可以改
            json_str = json.dumps(jsonMap)
            f.write(json_str)
            f.close()
            print("[ReWrite] Produce %d Records." % len(jsonMap))

        def flame_record(cpu, data, size):
            global waker_comm, curState
            # 成员：pid, comm, type, stackid, waker, waker_comm, time
            event = bpf["events"].event(data)
            if event.pid != args.pid: return
            # event.time是相对于系统启动时间的时间戳

            nowtime = boot_time + event.time / 1000000000
            toAdd = None

            if event.type == BEGIN_RUN:
                curState = "run"
                toAdd = {"time": nowtime, "state": "run-cpu%d" % cpu, "pid": args.pid, "evt_time": event.time}

            elif event.type == BEGIN_SLEEP:
                curState = "sleep"
                wchan = get_sleep_func(bpf, event.stackid)
                toAdd = {"time": nowtime, "state": "sleep-%s" % (wchan,), "pid": args.pid, "evt_time": event.time}

            elif event.type == BEGIN_WAIT:
                info = "" if curState == "run" else waker_comm
                toAdd = {"time": nowtime, "state": "wait-%s" % (info,), "pid": args.pid, "evt_time": event.time}

            if toAdd is not None:
                beginTime = toAdd["time"] - args.time
                # 删除不在[now-args.time, now]范围内的前几条数据
                while len(jsonMap) > 0 and jsonMap[0]["time"] < beginTime:
                    del jsonMap[0]
                jsonMap.append(toAdd)

            if event.type == END_SLEEP:
                waker_comm = event.waker_comm.decode('utf-8')

        bpf["events"].open_perf_buffer(flame_record, page_cnt=128)
        start = time()
        period_time = 0
        while 1:
            bpf.perf_buffer_poll()
            sleep(1)
            period_time += 1
            if period_time >= args.time:
                period_time = 0
                commit_change()


  ["T"] = "学徒的魔法",
  },
  [700] = {
    ["D"] = "啊，洛丹伦的石头真不赖，可惜那儿已经变成一片废墟了。$B$B纪念碑完成了！我想国王陛下一定会满意的。$B$B如果你愿意的话，请替我去告诉国王陛下，纪念碑已经完成了。",
    ["O"] = "向铁炉堡的国王麦格尼·铜须汇报。",
    ["T"] = "国王的礼物",
  },
  [701] = {
    ["D"] = "只要借助一些特别的物品，我就能创造出一件注入了迅猛龙的狡诈力量的东西！这样就应该能让戈穆尔了解到我们新的能量，并重新找回潜藏着的勇士的力量！$B$B我需要迅猛龙的心脏来完成这件物品和法书。",
    ["O"] = "从高地猎兽龙身上获取12颗迅猛龙的心脏，把它们交给托尔甘。",
    ["T"] = "迅猛龙的狡诈",
  },
  [706] = {
    ["D"] = "作为费拉诺·钢趾的学徒，我从他那里学会了赋予武器强力魔法的特殊技能。我最后一次听到他的消息时，他正和从洛丹伦过来的狩猎小队合伙工作。$B$B我不能告诉你关于这种技术的太多细节，但可以告诉你必须要用黑龙血来完成这个附魔过程， 而且一定要是从黑色幼龙那仍在跳动的心脏中涌出的血液。我现在除了等待铁炉堡的消息以外无事可做，所以如果你能从莱瑟罗峡谷帮我带一颗黑色幼龙之心回来，我就向你展示一下我的技术！",
    ["O"] = "为西格鲁·铁斧拿到一颗黑色幼龙之心。",
    ["T"] = "黑龙之火",
  },
  [708] = {
    ["D"] = "这只木桶不大，但非常坚固。木板的接缝处和桶盖边上都用一种味道刺鼻的黄色封蜡封了起来。桶底的标签上写着两行大字：$B$B军需官朗格尔斯$B$B守望堡",
    ["O"] = "把遗失的货物交给军需官朗格尔斯。",
    ["T"] = "黑盒子",
  },
  [717] = {
    ["D"] = "显然，我们不能保证黑龙布莱克拉


'1': 'CHARGING', '2': 1},
    {'1': 'DISCHARGING', '2': 2},
    {'1': 'MOISTURE_DETECTED', '2': 3},
  ],
};

/// Descriptor for `PLCPortStats`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List pLCPortStatsDescriptor = $convert.base64Decode(
    'CgxQTENQb3J0U3RhdHMSFAoFcG93ZXIYASABKA1SBXBvd2VyEkIKBnN0YXR1cxgCIAEoDjIqLl'
    'NwYWNlWC5BUEkuRGV2aWNlLlBMQ1BvcnRTdGF0cy5Qb3J0U3RhdHVzUgZzdGF0dXMiUAoKUG9y'
    'dFN0YXR1cxIMCghJTkFDVElWRRAAEgwKCENIQVJHSU5HEAESDwoLRElTQ0hBUkdJTkcQAhIVCh'
    'FNT0lTVFVSRV9ERVRFQ1RFRBAD');

@$core.Deprecated('Use dishUpsuStatsDescriptor instead')
const DishUpsuStats$json = {
  '1': 'DishUpsuStats',
  '2': [
    {'1': 'app_version', '3': 2, '4': 1, '5': 4, '10': 'appVersion'},
    {'1': 'boot_version', '3': 3, '4': 1, '5': 4, '10': 'bootVersion'},
    {'1': 'rom_version', '3': 4, '4': 1, '5': 4, '10': 'romVersion'},
    {'1': 'uptime', '3': 5, '4': 1, '5': 3, '10': 'uptime'},
    {'1': 'dish_power', '3': 6, '4': 1, '5': 2, '10': 'dishPower'},
    {'1': 'router_power', '3': 7, '4': 1, '5': 2, '10': 'routerPower'},
  ],
};

/// Descriptor for `DishUpsuStats`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dishUpsuStatsDescriptor = $convert.base64Decode(
    'Cg1EaXNoVXBzdVN0YXRzEh8KC2FwcF92ZXJzaW9uGAIgASgEUgphcHBWZXJzaW9uEiEKDGJvb3'
    'RfdmVyc2lvbhgDIAEoBFILYm9vdFZlcnNpb24SHwoLcm9tX3ZlcnNpb24YBCABKARSCnJvbVZl'
    'cnNpb24SFgoGdXB0aW1lGAUgASgDUgZ1cHRpbWUSHQoKZGlzaF9wb3dlchgGIAEoAlIJZGlzaF'
    'Bvd2VyEiEKDHJvdXRlcl9wb3dlchgHIAEoAlILcm91dGVyUG93ZXI=');

@$core.Deprecated('Use dishAuthenticateResponseDescriptor instead')
const DishAuthenticateResponse$json = {
  '1': 'DishAuthenticateResponse',
  '2': [
    {'1': 'dish', '3': 2, '4': 1, '5': 11, '6': '.SpaceX.API.Device.ChallengeResponse', '10': 'dish'},
  ],
};

/// Descriptor for `DishAuthenticate


     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package me.ahoo.wow.saga.annotation

import me.ahoo.test.asserts.assert
import org.junit.jupiter.api.Test

class StatelessSagaMetadataParserTest {

    @Test
    fun statelessSagaMetadata() {
        val metadata = statelessSagaMetadata<TestStatelessSaga>()
        metadata.name.assert().isEqualTo("TestStatelessSaga")
        metadata.processorType.assert().isEqualTo(TestStatelessSaga::class.java)
        metadata.functionRegistry.assert().isEmpty()
    }
}

class TestStatelessSaga
/*
 * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package me.ahoo.wow.serialization

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.ser.std.StdSerializer
import me.ahoo.wow.api.messaging.Header
import me.ahoo.wow.api.messaging.Message
import me.ahoo.wow.api.messaging.NamedMessage
import me.ahoo.wow.api.modeling.NamedAggregate
import me.ahoo.wow.api.naming.NamedBoundedContext
import me.ahoo.wow.serialization.event.JsonDomainEvent

abstract class MessageSerializer<M : Message<*, *>>(messageType: Class<M>) : StdSerializer<M>(messageType) {

    override fun serialize(value: M, generator: JsonGenerator, provider: SerializerProvider) {
        generator.writeStartObject()
        generator.writeStringField(MessageRecords.ID, value.id)
        if (value is NamedBoundedContext) {
            generator.writeStringField(MessageRecords.CONTEXT_NAME, value.contextName)
        }
        if (value is NamedAggregate) {
            generator.writeStringField(MessageRecords.AGGREGATE_NAME, value.aggregateName)
        }
        if (value is NamedMessage<*, *>) {
            generator.writeStringField(MessageRecords.NAME, value.name)
        }
        writeHeader(generator, value.header)
        writeExtendedInfo(generator, value)
        writeBodyType(generator, value)
        writeBody(generator, value)
        generator.writeNumberField(MessageRecords.CREATE_TIME, value.createTime)
        generator.writeEndObject()
    }

    open fun writeExtendedInfo(generator: JsonGenerator, value: M) {
    }

    open fun writeHeader(generator: JsonGenerator, value: Header) {
        generator.writePOJOField(MessageRecords.HEADER, value)
    }

    open fun writeBodyType(generator: JsonGenerator, value: M) {
        if (value is JsonDomainEvent) {
            generator.writeStringField(MessageRecords.BODY_TYPE, value.bodyType)
            return
        }
        generator.writeStringField(MessageRecords.BODY_TYPE, value.body!!.javaClass.name)
    }

    open fun writeBody(generator: JsonGenerator, value: M) {
        generator.writePOJOField(Message


;
    });
  }

  Future<Map<String, dynamic>> getAllApplet(
      String appletId, Map<String, dynamic> defaults) async {
    final result = Map<String, dynamic>.fromEntries(
        (await (db.select(db.appletPreferencesTable)
                  ..where((tbl) => tbl.appletId.equals(appletId)))
                .get())
            .map((e) => MapEntry(
                e.key, e.value != null ? jsonDecode(e.value!)['v'] : null)));
    for (var key in defaults.keys) {
      if (!result.containsKey(key) && defaults.containsKey(key)) {
        result[key] = defaults[key];
      }
    }
    return result;
  }

  Future<void> setAppletValue(
      String appletId, String key, dynamic value) async {
    final insert = jsonEncode({'v': value});
    await db.into(db.appletPreferencesTable).insert(
        AppletPreferencesTableCompanion.insert(
            appletId: appletId, key: key, value: Value(insert)),
        mode: InsertMode.insertOrReplace);
  }

  Future<dynamic> getAppletValue(String appletId, String key) async {
    final val = (await (db.select(db.appletPreferencesTable)
              ..where(
                  (tbl) => tbl.appletId.equals(appletId) & tbl.key.equals(key)))
            .getSingleOrNull())
        ?.value;
    return val != null ? jsonDecode(val)['v'] : null;
  }
}
import 'package:flutter/material.dart';
import 'package:introduction_screen/introduction_screen.dart';
import 'auth.dart';
import 'intro_screen_page_view_models.dart';

class WelcomeLoginScreen extends StatefulWidget {
  const WelcomeLoginScreen({super.key});

  @override
  State<StatefulWidget> createState() => _WelcomeLoginScreenState();
}

enum PageType { intro, login }

class _WelcomeLoginScreenState extends State<WelcomeLoginScreen> {
  PageType currentPage = PageType.intro;
  List<String> schoolList = [];

  @override
  void initState() {
    super.initState();
  }

  Widget buildBody() {
    if (currentPage == PageType.intro) {
      return SafeArea(
        child: IntroductionScreen(
            next: const Icon(Icons.arrow_forward),
            done: const Text("Login"),
            onDone: () {
              setState(() {
                currentPage = PageType.login;
              });
            },
            dotsDecorator: const DotsDecorator(
              spacing: EdgeInsets.all(2.0),
            ),
            pages: intoScreenPageViewModels(context)),
      );
    } else if (currentPage == PageType.login) {
      return Scaffold(
        body: LoginForm(
          showBackButton: false,
        ),
      );
    }

    return const Center(child: Text("This should not happen"));
  }

  @override
  Widget build(BuildContext context) {
    return PopScope(canPop: false, child: buildBody());
  }
}
import 'package:flutter/material.dart';
import 'package:introduction_screen/introduction_screen.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:lanis/generated/l10n.dart';

List<PageViewModel> intoScreenPageViewModels(BuildContext context) => [
      PageViewModel(
        image: SvgPicture.asset("assets/undraw/undraw_welcome_re_h3d9.svg",
            height: 175.0),
        title: AppLocalizations.of(context).introWelcomeTitle,
        body: AppLocalizations.of(context).introWelcome,
      ),
      PageViewModel(
        image: SvgPicture.asset(
            "assets/undraw/undraw_engineering_team_a7n2.svg",
            height: 175.0),
        title: AppLocalizations.of(context).introForStudentsByStudentsTitle,
        body: App