   void lista_insere_inicio(Lista l, dado_t d)
   {
     // aloca um nó para conter o novo dado.
     // esse nó estará no início da lista, então o nó seguinte a ele é o nó que
     //   atualmente é o primeiro da lista (mesmo que seja NULL)
     nodo *novo = cria_nodo(d, l->prim);
     // ele é o novo primeiro nó
     l->prim = novo;
   }

   // encontra o último nó da lista (o prox dele é NULL)
   static nodo *lista_ultimo_nodo(Lista l)
   {
     if (lista_vazia(l)) return NULL;
     nodo *no = l->prim;
     while (no->prox != NULL) {
       no = no->prox;
     }
     return no;
   }

   void lista_insere_fim(Lista l, dado_t d)
   {
     // se a lista estiver vazia, insere no início
     if (lista_vazia(l)) {
       lista_insere_inicio(l, d);
     }
     // aloca um nó par conter o novo dado.
     // esse nó estará no final da lista, então o nó seguinte a ele é NULL
     nodo *novo = cria_nodo(d, NULL);
     // o antigo último nó deve apontar para o novo último
     nodo *ult = lista_ultimo_nodo(l);
     ult->prox = novo;
   }

   // retorna o nodo em dada posição da lista (pos 0 é o primeiro)
   // retorna NULL se não existir
   static nodo *lista_nodo_pos(Lista l, int pos)
   {
     if (pos < 0) return NULL;
     nodo *no = l->prim;
     int p = 0;
     while (no != NULL && p < pos) {
       no = no->prox;
       p++;
     }
     return no;
   }

   void lista_insere_pos(Lista l, int pos, dado_t d)
   {
     if (pos < 0) return;
     if (pos == 0) {
       lista_insere_inicio(l, d);
	    return;
     }
     // acha o nó na posição anterior à inserção
     nodo *anterior = lista_nodo_pos(l, pos-1);
     if (anterior == NULL) return;
     // nó na posição seguinte à inserção
     nodo *seguinte = anterior->prox;
     // aloca um nó par conter o novo dado.
     // esse nó estará antes de nó seguinte
     nodo *novo = cria_nodo(d, seguinte);
     // o novo nó está depois do nó anterior
     anterior->prox = novo;
   }
```

#### Exercícios

1. Implementa as funções de remoção da lista acima
2. Teste a lista
3. Implementa uma função para inverter a ordem dos nós de uma lista encadeada.

### Listas duplamente encadeadas

Por vezes (em uma fila do tipo deque, por exemplo), necessitamos de operações de inclusão e remoção em ambas as pontas da lista, e a lista simplesmente encadeada não tem um desempenho bom o suficiente para todas essas operações. Não é muito difícil de se otimizar para se ter um bom desempenho em três dessas operações, mas não nas quatro.
A adição de um segundo encadeamento na lista resolve essa limitação, ao custo de mais memória para armazenar mais um ponteiro em cada nó da lista.
Cada nó passa a ter dois ponteiros: um que aponta par


ultiLRUCache struct {
	buckets uint
	cache   []*lrucache.LRUCache
	hash    hash.Hash
}

// Using this constructor is almost always wrong. Use NewMultiLRUCache instead.
func (m *MultiLRUCache) Init(buckets, bucket_capacity uint) {
	m.buckets = buckets
	m.cache = make([]*lrucache.LRUCache, buckets)
	for i := uint(0); i < buckets; i++ {
		m.cache[i] = lrucache.NewLRUCache(bucket_capacity)
	}
}

func NewMultiLRUCache(buckets, bucket_capacity uint) *MultiLRUCache {
	m := &MultiLRUCache{}
	m.Init(buckets, bucket_capacity)
	return m
}

func (m *MultiLRUCache) bucketNo(key string) uint {
	// Arbitrary choice. Any fast hash will do.
	return uint(crc32.ChecksumIEEE([]byte(key))) % m.buckets
}

func (m *MultiLRUCache) Set(key string, value interface{}, expire time.Time) {
	m.cache[m.bucketNo(key)].Set(key, value, expire)
}

func (m *MultiLRUCache) SetNow(key string, value interface{}, expire time.Time, now time.Time) {
	m.cache[m.bucketNo(key)].SetNow(key, value, expire, now)
}

func (m *MultiLRUCache) Get(key string) (value interface{}, ok bool) {
	return m.cache[m.bucketNo(key)].Get(key)
}

func (m *MultiLRUCache) GetQuiet(key string) (value interface{}, ok bool) {
	return m.cache[m.bucketNo(key)].Get(key)
}

func (m *MultiLRUCache) GetNotStale(key string) (value interface{}, ok bool) {
	return m.cache[m.bucketNo(key)].GetNotStale(key)
}

func (m *MultiLRUCache) GetNotStaleNow(key string, now time.Time) (value interface{}, ok bool) {
	return m.cache[m.bucketNo(key)].GetNotStaleNow(key, now)
}

func (m *MultiLRUCache) Del(key string) (value interface{}, ok bool) {
	return m.cache[m.bucketNo(key)].Del(key)
}

func (m *MultiLRUCache) Clear() int {
	var s int
	for _, c := range m.cache {
		s += c.Clear()
	}
	return s
}

func (m *MultiLRUCache) Len() int {
	var s int
	for _, c := range m.cache {
		s += c.Len()
	}
	return s
}

func (m *MultiLRUCache) Capacity() int {
	var s int
	for _, c := range m.cache {
		s += c.Capacity()
	}
	return s
}

func (m *MultiLRUCache) Expire() int {
	var s int
	for _, c := range m.cache {
		s += c.Expire()
	}
	return s
}

func (m *MultiLRUCache) ExpireNow(now time.Time) int {
	var s int
	for _, c := range m.cache {
		s += c.ExpireNow(now)
	}
	return s
}
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package auto_test

import (
	"context"
	"io"
	"log/slog"
	"net/http"
	"net/http/httptest"
	"os"
	"os/exec"
	"os/signal"
	"path/filepath"
	"runtime"
	"syscall"
	"testing"

	"github.com/cilium/ebpf/rlimit"
	"go.opentelemetry.io/collector/pdata/ptrace"
	"go.uber.org/goleak"

	"go.opentelemetry.io/auto"
)

const (
	batsVerify = "verify.bats"
	tracesOr


t Node
{
    Node() = delete;

    explicit Node(const std::string &name)
    : mParent(NULL)
    , mName(name)
    , mInstanceNumber(0)
    , mHierarchyPos       (0)
    , mHierarchyIndex     (0)
    , mInstanceCount      (1)
    {
        aRotationKeys.reserve (20);
        aPositionKeys.reserve (20);
        aScalingKeys.reserve  (20);
    }

    ~Node()
    {
        for (unsigned int i = 0; i < mChildren.size();++i)
            delete mChildren[i];
    }

    //! Pointer to the parent node
    Node* mParent;

    //! Holds all child nodes
    std::vector<Node*> mChildren;

    //! Name of the node
    std::string mName;

    //! InstanceNumber of the node
    int32_t mInstanceNumber;

    //! Dummy nodes: real name to be combined with the $$$DUMMY
    std::string mDummyName;

    //! Position of the node in the hierarchy (tree depth)
    int16_t mHierarchyPos;

    //! Index of the node
    int16_t mHierarchyIndex;

    //! Rotation keys loaded from the file
    std::vector<aiQuatKey> aRotationKeys;

    //! Position keys loaded from the file
    std::vector<aiVectorKey> aPositionKeys;

    //! Scaling keys loaded from the file
    std::vector<aiVectorKey> aScalingKeys;

    // For target lights (spot lights and directional lights):
    // The position of the target
    std::vector< aiVectorKey > aTargetPositionKeys;

    // For cameras: the camera roll angle
    std::vector< aiFloatKey > aCameraRollKeys;

    //! Pivot position loaded from the file
    aiVector3D vPivot;

    //instance count, will be kept only for the first node
    int32_t mInstanceCount;

    //! Add a child node, setup the right parent node for it
    //! \param pc Node to be 'adopted'
    inline Node& push_back(Node* pc)
    {
        mChildren.push_back(pc);
        pc->mParent = this;
        return *this;
    }
};
// ---------------------------------------------------------------------------
/** Helper structure analogue to aiScene */
struct Scene
{
    //! List of all materials loaded
    //! NOTE: 3ds references materials globally
    std::vector<Material> mMaterials;

    //! List of all meshes loaded
    std::vector<Mesh> mMeshes;

    //! List of all cameras loaded
    std::vector<aiCamera*> mCameras;

    //! List of all lights loaded
    std::vector<aiLight*> mLights;

    //! Pointer to the root node of the scene
    // --- moved to main class
    // Node* pcRootNode;
};

} // end of namespace D3DS
} // end of namespace Assimp

#endif // AI_XFILEHELPER_H_INC


  SqlExFactory.trace( ex, trace );
	throw ex;
    }

    if ( trace.enabled() )  trace.log( title + ".getUnicodeStream: " + value );
    return( value );
} // getUnicodeStream

/*
** Name: getCharacterStream
**
** Description:
**	Retrieve column data as a character stream.  If the column
**	is NULL, null is returned.  If the column can be converted
**	to a character stream, a character Reader is returned.
**	Otherwise, a conversion exception is thrown.
**
** Input:
**	index	Column index.
**
** Output:
**	None.
**
** Returns:
**	Reader	Character stream.
**
** History:
**	 6-Nov-00 (gordy)
**	    Created.
**	31-Oct-02 (gordy)
**	    Encapsulated common BLOB column processing in methods.
**	26-Sep-03 (gordy)
**	    Raw data values replaced with SqlData objects.
**	14-Sep-05 (gordy)
**	    Trace exceptions.
*/

public Reader
getCharacterStream( int index )
    throws SQLException
{
    SqlData	data;
    Reader	value;

    if ( trace.enabled() )
	trace.log( title + ".getCharacterStream( " + index + " )" );

    data = columnDataValue( index );

    try { value = data.isNull() ? null : data.getCharacterStream(); }
    catch( SQLException ex )
    {
	if ( trace.enabled() )
	    trace.log(title + ".getCharacterStream: error accessing BLOB data");
	if ( trace.enabled( 1 ) )  SqlExFactory.trace( ex, trace );
	throw ex;
    }

    if ( trace.enabled() )  trace.log(title + ".getCharacterStream: " + value);
    return( value );
} // getCharacterStream

/*
** Name: getBlob
**
** Description:
**	Retrieve column data as a Blob object.  If the column is
**	NULL, null is returned.
**
** Input:
**	index	Column index.
**
** Output:
**	None.
**
** Returns:
**	Blob	Binary Large Object
**
** History:
**	15-Nov-06 (gordy)
**	    Implemented.
*/

public Blob
getBlob( int index )
    throws SQLException
{
    if ( trace.enabled() )  trace.log( title + ".getBlob( " + index + " )" );

    SqlData	data = columnDataValue( index );
    Blob	value;

    if ( data.isNull() )
	value = null;
    else
	value = data.getBlob();

    if ( trace.enabled() )  trace.log( title + ".getBlob: " + value );
    return( value );
} // getBlob

/*
** Name: getClob
**
** Description:
**	Retrieve column data as a Clob object.  If the column is
**	NULL, null is returned.
**
** Input:
**	index	Column index.
**
** Output:
**	None.
**
** Returns:
**	Clob	Character Large Object
**
** History:
**	15-Nov-06 (gordy)
**	    Implemented.
*/

public Clob
getClob( int index )
    throws SQLException
{
    if ( trace.enabled() )  trace.log( title + ".getClob( " + index + " )" );

    SqlData	data = columnDataValue( index );
    Clob	value;

    if ( data.isNull() )
	value = null;
    else
	value = data.getClob();

    if ( trace.enabled() )  trace.log( title + ".getClob: " + value );
    return( value );
} // getClob

/*
** Name: getNClob
**
** Description:
**	Retrieve column data as a NClob object.  If the column is


ClientsAllowed = [
  repo.SourceStat(source: 'raspberrypi.lan|192.168.0.44', count: 5896),
];

final kRepoFetchOverTime = repo.OverTime(
  domainsOverTime: [
    repo.HistoryEntry(
      timestamp: DateTime.fromMillisecondsSinceEpoch(1511819900 * 1000),
      count: 2134,
    ),
    repo.HistoryEntry(
      timestamp: DateTime.fromMillisecondsSinceEpoch(1511820500 * 1000),
      count: 2014,
    ),
  ],
  adsOverTime: [
    repo.HistoryEntry(
      timestamp: DateTime.fromMillisecondsSinceEpoch(1511819900 * 1000),
      count: 413,
    ),
    repo.HistoryEntry(
      timestamp: DateTime.fromMillisecondsSinceEpoch(1511820500 * 1000),
      count: 43,
    ),
  ],
  clients: const [
    repo.Client(ip: '127.0.0.1', name: 'localhost'),
    repo.Client(ip: '::1', name: 'ip6-localnet'),
    repo.Client(ip: '192.168.1.1', name: ''), // TODO: name null
    repo.Client(ip: '::', name: 'pi.hole'),
    repo.Client(ip: '0.0.0.0', name: 'other clients'),
  ],
  overTime: [
    repo.ClientOverTimeEntry(
      time: DateTime.fromMillisecondsSinceEpoch(1511819900 * 1000),
      values: [35, 63, 20, 9, 0],
    ),
    repo.ClientOverTimeEntry(
      time: DateTime.fromMillisecondsSinceEpoch(1511820500 * 1000),
      values: [10, 44, 56, 0, 52],
    ),
  ],
);
import 'dart:convert';
import 'package:shelf/shelf.dart';
import 'package:shelf_router/shelf_router.dart';

class ListsHandler {
  Router get router {
    final router = Router();

    router.get('/', (Request request) {
      final mockResponse = {
        "lists": [
          {
            "address":
                "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts",
            "comment": "Migrated from /etc/pihole/adlists.list",
            "groups": [0],
            "enabled": true,
            "id": 1,
            "date_added": 1718567751,
            "date_modified": 1744385690,
            "type": "block",
            "date_updated": 1744481762,
            "number": 135865,
            "invalid_domains": 0,
            "abp_entries": 0,
            "status": 1,
          },
          {
            "address":
                "https://raw.githubusercontent.com/Ultimate-Hosts-Blacklist/pl-host-file/master/domains.list",
            "comment": "Oisd Big includes many blocklists",
            "groups": [0],
            "enabled": true,
            "id": 29,
            "date_added": 1730990033,
            "date_modified": 1731059372,
            "type": "block",
            "date_updated": 1739648584,
            "number": 412,
            "invalid_domains": 0,
            "abp_entries": 0,
            "status": 2,
          },
          {
            "address": "https://blocklistproject.github.io/Lists/malware.txt",
            "comment": null,
            "groups": [5],
            "enabled": true,
            "id": 30,
            "date_added": 1730990066,
            "date_modified": 1740562954,
            "type": "block",
            "date_updated": 1739648586,
            "number": 435221,
            "invalid_domains": 0,
            "abp_entries": 0,
            "status": 2,
          },
          {
            "address":
                "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt",
            "comment": null,
            "group


/*
 *
 * Copyright 2021-2025 Software Radio Systems Limited
 *
 * This file is part of srsRAN.
 *
 * srsRAN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * srsRAN is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#pragma once

#include "apps/units/flexible_o_du/o_du_high/o_du_high_unit_logger_registrator.h"
#include "apps/units/flexible_o_du/o_du_low/du_low_logger_registrator.h"
#include "apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_logger_registrator.h"
#include "apps/units/flexible_o_du/split_8/helpers/ru_sdr_logger_registrator.h"
#include "dynamic_o_du_unit_config.h"

namespace srsran {

/// Registers all the loggers for the O-RAN DU split dynamic.
inline void register_dynamic_o_du_loggers(const dynamic_o_du_unit_config& config)
{
  register_o_du_high_loggers(config.odu_high_cfg);
  register_du_low_loggers(config.du_low_cfg.loggers);

  if (std::holds_alternative<ru_sdr_unit_config>(config.ru_cfg)) {
    register_ru_sdr_logs(std::get<ru_sdr_unit_config>(config.ru_cfg).loggers);
  } else if (std::holds_alternative<ru_ofh_unit_parsed_config>(config.ru_cfg)) {
    register_ru_ofh_loggers(std::get<ru_ofh_unit_parsed_config>(config.ru_cfg).config.loggers);
  }
}

} // namespace srsran


(module.InterfaceRegistry)

	appModule := sending.NewAppModuleBasic(appCodec)
	require.NotNil(t, appModule)

	return appModule
}

func TestAppModuleBasic_Name(t *testing.T) {
	am := createAppModuleBasic(t)

	require.Equal(t, "sending", am.Name())
}

func TestAppModuleBasic_RegisterCodecLegacyAmino(t *testing.T) {
	am := createAppModuleBasic(t)

	cdc := codec.NewLegacyAmino()
	am.RegisterLegacyAminoCodec(cdc)

	var buf bytes.Buffer
	err := cdc.Amino.PrintTypes(&buf)
	require.NoError(t, err)
}

func TestAppModuleBasic_RegisterInterfaces(t *testing.T) {
	am := createAppModuleBasic(t)

	registry := types.NewInterfaceRegistry()
	am.RegisterInterfaces(registry)
	// implInterfaces is a map[reflect.Type]reflect.Type that isn't exported and can't be mocked
	// due to it using an unexported method on the interface thus we use reflection to access the field
	// directly that contains the registrations.
	fv := reflect.ValueOf(registry).Elem().FieldByName("implInterfaces")
	require.Len(t, fv.MapKeys(), 8)
}

func TestAppModuleBasic_DefaultGenesis(t *testing.T) {
	am := createAppModuleBasic(t)

	cdc := codec.NewProtoCodec(module.InterfaceRegistry)

	result := am.DefaultGenesis(cdc)
	json, err := result.MarshalJSON()
	require.NoError(t, err)
	require.Equal(t, `{}`, string(json))
}

func TestAppModuleBasic_ValidateGenesisErrInvalidJSON(t *testing.T) {
	am := createAppModuleBasic(t)

	cdc := codec.NewProtoCodec(module.InterfaceRegistry)

	h := json.RawMessage(`{"missingClosingQuote: true}`)

	err := am.ValidateGenesis(cdc, nil, h)
	require.EqualError(t, err, "failed to unmarshal sending genesis state: unexpected EOF")
}

func TestAppModuleBasic_ValidateGenesis(t *testing.T) {
	am := createAppModuleBasic(t)

	cdc := codec.NewProtoCodec(module.InterfaceRegistry)

	h := json.RawMessage(`{}`)

	err := am.ValidateGenesis(cdc, nil, h)
	require.NoError(t, err)
}

func TestAppModuleBasic_RegisterGRPCGatewayRoutes(t *testing.T) {
	am := createAppModuleBasic(t)

	router := runtime.NewServeMux()

	am.RegisterGRPCGatewayRoutes(client.Context{}, router)

	// Sending currently does not have any routes registered, so expect no routes.
	recorder := httptest.NewRecorder()
	req, err := http.NewRequest("GET", "/dydxprotocol/sending/", nil)
	require.NoError(t, err)
	router.ServeHTTP(recorder, req)
	require.Equal(t, 404, recorder.Code)
}

func TestAppModuleBasic_GetTxCmd(t *testing.T) {
	am := createAppModuleBasic(t)

	cmd := am.GetTxCmd()
	require.Equal(t, "sending", cmd.Use)
	require.Equal(t, 3, len(cmd.Commands()))
	require.Equal(t, "create-transfer", cmd.Commands()[0].Name())
	require.Equal(t, "deposit-to-subaccount", cmd.Commands()[1].Name())
	require.Equal(t, "withdraw-from-subaccount", cmd.Commands()[2].Name())
}

func TestAppModuleBasic_GetQueryCmd(t *testing.T) {
	am := createAppModuleBasic(t


scale = N / (K_source * correction)

        if scale != 1:
            for v in betweenness:
                betweenness[v] *= scale
        return betweenness

    # Sampling adjustment needed when excluding endpoints when using k. In this
    # case, we need to handle source nodes differently from non-source nodes,
    # because source nodes can't include themselves since endpoints are excluded.
    # Without this, k == n would be a special case that would violate the
    # assumption that node `v` is not one of the (s, t) node pairs.
    if normalized:
        # NaN for undefined 0/0; there is no data for source node when k=1
        scale_source = 1 / ((K_source - 1) * (N - 1)) if K_source > 1 else math.nan
        scale_nonsource = 1 / (K_source * (N - 1))
    else:
        correction = 1 if directed else 2
        scale_source = N / ((K_source - 1) * correction) if K_source > 1 else math.nan
        scale_nonsource = N / (K_source * correction)

    sampled_nodes = set(sampled_nodes)
    for v in betweenness:
        betweenness[v] *= scale_source if v in sampled_nodes else scale_nonsource
    return betweenness

def _rescale_e(betweenness, n, normalized, directed=False, k=None):
    if normalized:
        if n <= 1:
            scale = None  # no normalization b=0 for all nodes
        else:
            scale = 1 / (n * (n - 1))
    else:  # rescale by 2 for undirected graphs
        if not directed:
            scale = 0.5
        else:
            scale = None
    if scale is not None:
        if k is not None:
            scale = scale * n / k
        for v in betweenness:
            betweenness[v] *= scale
    return betweenness

@not_implemented_for("graph")
def _add_edge_keys(G, betweenness, weight=None):
    r"""Adds the corrected betweenness centrality (BC) values for multigraphs.

    Parameters
    ----------
    G : NetworkX graph.

    betweenness : dictionary
        Dictionary mapping adjacent node tuples to betweenness centrality values.

    weight : string or function
        See `_weight_function` for details. Defaults to `None`.

    Returns
    -------
    edges : dictionary
        The parameter `betweenness` including edges with keys and their
        betweenness centrality values.

    The BC value is divided among edges of equal weight.
    """
    _weight = _weight_function(G, weight)

    edge_bc = dict.fromkeys(G.edges, 0.0)
    for u, v in betweenness:
        d = G[u][v]
        wt = _weight(u, v, d)
        keys = [k for k in d if _weight(u, v, {k: d[k]}) == wt]
        bc = betweenness[(u, v)] / len(keys)
        for k in keys:
            edge_bc[(u, v, k)] = bc

    return edge_bc


SERVER
      await commander.getReplyFunction(textEvent)("foo")
      expect(sendTextMessageMock).toHaveBeenCalledTimes(1)
      expect(sendTextMessageMock).toBeCalledWith(0, TextMessageTargetMode.SERVER, "foo")
    })
  })

  describe("addInstance()", () => {
    let teamspeak: any = {
      on: jest.fn(),
      registerEvent: jest.fn()
    }

    beforeEach(() => {
      teamspeak.on.mockClear()
      teamspeak.registerEvent.mockClear()
      teamspeak.registerEvent.mockResolvedValue(0)
    })

    it("should add a teamspeak instance without registering commands", async () => {
      expect.assertions(2)
      await commander.addInstance(teamspeak, false)
      expect(teamspeak.on).toBeCalledTimes(1)
      expect(teamspeak.registerEvent).toBeCalledTimes(0)
    })

    it("should add a teamspeak instance with registering commands", async () => {
      expect.assertions(2)
      await commander.addInstance(teamspeak)
      expect(teamspeak.on).toBeCalledTimes(1)
      expect(teamspeak.registerEvent).toBeCalledTimes(3)
    })
  })
})/// <reference path="ParserContext.ts" />
/// <reference path="SyntaxTree/SpanBuilder.ts" />
/// <reference path="../SourceLocation.ts" />
/// <reference path="../Internals/Tuple.ts" />

namespace Razor.Parser
{
  import SpanBuilder = Razor.Parser.SyntaxTree.SpanBuilder;
  import SourceLocation = Razor.SourceLocation;
  import Tuple = Razor.Tuple;

  /**
   * Provides a base implementation of a parser
   * @class
   */
  export class ParserBase
  {
    /**
     * Gets or sets the parser context
     * @property
     * @type {ParserContext}
     */
    public context: ParserContext;

    /**
     * Gets whether the parser is a markup parser.
     * @property
     * @readonly
     * @returns {boolean}
     */
    public get isMarkupParser(): boolean
    {
      return false;
    }

    /**
     * Gets the other parser instance.
     * @property
     * @readonly
     * @returns {ParserBase}
     */
    public get otherParser(): ParserBase
    {
      return null;
    }

    /**
     * Builds a span using the given builder, source location and content.
     * @function
     * @param {SpanBuilder} span - The span builder
     * @param {SourceLocation} start - The start location
     * @param {string} content - The content of the span
     */
    public buildSpan(span: SpanBuilder, start: SourceLocation, content: string): void
    {
      return null;
    }

    /**
     * Parses a block
     */
    public parseBlock(): void { }

    /**
     * Parses a document
     * @function
     */
    public parseDocument(): void
    {
      throw "Not a markup parser";
    }

    /**
     * Parses a section
     * @function
     * @param {Tuple<string, string>} nestingSequences - The nesting sequences
     * @param {boolean} - caseSensitive - Case sensitive parse?
     */
    public parseSection(nestingSequences: Tuple<string, string>, caseSensitive: boolean): void
    {
      throw "Not a markup parser";
    }
  }
}import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';

export interface CCKContext {
  /**
   * Full identifier path from root, including the context identifier itself..
   */
  identifierPath: string[];
  /**
   * Title of the context.
   */
  title: string;
  /**
   * Optional. Type value for the context.


dd r3, r0, #0
	ldr r1, _022174E4 ; =0x0000201C
	add r3, #0x12
	lsl r3, r3, #0x18
	ldr r1, [r7, r1]
	ldr r2, _022174E8 ; =0x0000B014
	add r0, r7, #0
	lsr r3, r3, #0x18
	bl ov09_02216C10
	ldr r0, _022174E4 ; =0x0000201C
	mov r1, #0x58
	ldr r0, [r7, r0]
	mov r2, #0xb0
	bl ov09_02216BB0
_022174D6:
	pop {r3, r4, r5, r6, r7, pc}
	.align 2, 0
_022174D8: .word 0x0000200C
_022174DC: .word 0x0000B010
_022174E0: .word ov09_0221B5A8
_022174E4: .word 0x0000201C
_022174E8: .word 0x0000B014

	thumb_func_start ov09_022174EC
ov09_022174EC: ; 0x022174EC
	push {r3, lr}
	ldr r1, _02217504 ; =0x00002077
	ldrb r1, [r0, r1]
	lsl r1, r1, #0x1c
	lsr r1, r1, #0x1c
	bne _022174FE
	bl ov09_022173B8
	pop {r3, pc}
_022174FE:
	bl ov09_0221744C
	pop {r3, pc}
	.align 2, 0
_02217504: .word 0x00002077

	thumb_func_start ov09_02217508
ov09_02217508: ; 0x02217508
	push {r3, r4, r5, lr}
	add r5, r0, #0
	add r4, r1, #0
	bl sub_0200C5CC
	cmp r4, r0
	beq _02217526
	add r0, r5, #0
	mov r1, #0
	bl sub_0200C61C
	add r0, r5, #0
	add r1, r4, #0
	bl sub_0200C5C0
_02217526:
	pop {r3, r4, r5, pc}

	thumb_func_start ov09_02217528
ov09_02217528: ; 0x02217528
	push {r3, lr}
	add r2, r0, #0
	ldrh r0, [r2, #0x10]
	cmp r0, #0
	bne _02217536
	mov r0, #0
	pop {r3, pc}
_02217536:
	ldrb r1, [r2, #0x17]
	lsl r1, r1, #0x19
	lsr r1, r1, #0x1c
	cmp r1, #7
	beq _02217548
	cmp r1, #6
	beq _02217548
	mov r0, #5
	pop {r3, pc}
_02217548:
	ldrh r1, [r2, #0x12]
	mov r2, #0x30
	bl sub_02079A54
	cmp r0, #4
	bhi _0221757A
	add r0, r0, r0
	add r0, pc
	ldrh r0, [r0, #6]
	lsl r0, r0, #0x10
	asr r0, r0, #0x10
	add pc, r0
_02217560: ; jump table
	.short _0221757A


745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.form-row>.col>.invalid-tooltip,.form-row>[class*=col-]>.invalid-tooltip{left:5px}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem)!important;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated select.form-control:invalid,select.form-control.is-invalid{padding-right:3rem!important;background-position:right 1.5rem center}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem)!important;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right .75rem center/8px 10px no-repeat,#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) no-repeat}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-


 vtype.v

        // weights, texture, color, normal, position
        for (n in 0 until verticesCount) {
            val vertex = vertices[n]
            if (hasWeights) {
                TODO("weights")
            }
            if (hasTexture) {
                ff[vpos++] = vertex.tex[0]
                ff[vpos++] = vertex.tex[1]
            }
            if (hasColor) {
                ii[vpos++] = vertex.color
            }
            if (hasNormal) {
                ff[vpos++] = vertex.normal[0]
                ff[vpos++] = vertex.normal[1]
                ff[vpos++] = vertex.normal[2]
            }
            if (hasPosition) {
                ff[vpos++] = vertex.pos[0]
                ff[vpos++] = vertex.pos[1]
                ff[vpos++] = vertex.pos[2]
            }
        }
        ge.emitBatch(
            GeBatchData(
                stateData,
                primitiveType,
                indexCount,
                vertexData.copyOf(vpos * 4),
                indices.copyOf(),
                texVersion
            )
        )
    }
}
package com.soywiz.kpspemu.format

import com.soywiz.korio.file.*
import com.soywiz.korio.lang.*
import com.soywiz.korio.stream.*

enum class PspFileFormat(val fileContainer: Boolean = false) {
    ELF, ENCRYPTED_ELF, PBP,
    CSO(fileContainer = true),
    ISO(fileContainer = true),
    ZIP(fileContainer = true),
    ;

    companion object {
        suspend fun detect(file: VfsFile): PspFileFormat? = detect(file.open(), file.basename)
        suspend fun detect(stream: AsyncStream, name: String = "unknown.bin"): PspFileFormat? =
            detect(stream.duplicate().readBytesExact(4).openSync(), name)

        fun detect(header: ByteArray, name: String = "unknown.bin"): PspFileFormat? = detect(header.openSync(), name)
        fun detect(stream: SyncStream, name: String = "unknown.bin"): PspFileFormat? {
            val magicId = stream.clone().readString(4, ASCII)
            val file = PathInfo(name)
            //println("magicId == '$magicId'")
            return when {
                magicId == "\u007fELF" -> ELF
                magicId == "\u007ePSP" -> ENCRYPTED_ELF
                magicId == "\u0000PBP" -> PBP
                magicId == "PK\u0003\u0004" -> ZIP
                magicId == "CISO" -> CSO
                file.extensionLC == "iso" -> ISO
                magicId == "\u0000\u0000\u0000\u0000" -> ISO // CD001 at sector 0x10
                else -> null
            }
        }
    }
}

fun ByteArray.detectPspFormat() = PspFileFormat.detect(this)
suspend fun VfsFile.detectPspFormat() = PspFileFormat.detect(this)
suspend fun AsyncStream.detectPspFormat(name: String = "unknown.bin") = PspFileFormat.detect(this, name)
package com.soywiz.kpspemu.format

import com.soywiz.kds.*
import com.soywiz.kmem.*
import com.soywiz.korio.compression.*
import com.soywiz.korio.compression.deflate.*
import com.soywiz.korio.error.*
import com.soywiz.korio.file.*
import com.soywiz.korio.stream.*
import kotlin.math.*

class Cso private constructor() {
    val CACHED_BLOCKS = 0x10

    lateinit var s: AsyncStream
    var magic: String = ""
    var headerSize: Int = 0
    var totalBytes: Long = 0L
    var blockSize: Int = 0
    var version: Int = 0
    var alignment: Int = 0
    var reserved: Int = 0
    var offsets = IntArray(0)
    var numberOfBlocks: Int = 0

    suspend private fun init(s: AsyncStream) {
        this.s = s
        magic = s.readStringz(4)
        if (magic != "CISO")


 ["㥵"] = "忄囗豕",
    ["㥶"] = "宀心",
    ["㥷"] = "广大人心",
    ["㥸"] = "民田心",
    ["㥹"] = "米八刀心",
    ["㥺"] = "忄土厶皿",
    ["㥻"] = "戊禾心",
    ["㥼"] = "忄一止灬",
    ["㥽"] = "忄龶貝",
    ["㥾"] = "忄匸艹口",
    ["㥿"] = "龶攵心",
    ["㦀"] = "忄夂丰辶",
    ["㦁"] = "車辶心",
    ["㦂"] = "巾心",
    ["㦃"] = "忄厂生",
    ["㦄"] = "麻心",
    ["㦅"] = "忄艹冖巾",
    ["㦆"] = "忄虍丿",
    ["㦇"] = "忄鹿",
    ["㦈"] = "忄⺷皿",
    ["㦉"] = "忄士冖豆",
    ["㦊"] = "忄艹一",
    ["㦋"] = "忄大耂日",
    ["㦌"] = "毛毛心",
    ["㦍"] = "忄口口",
    ["㦎"] = "忄田一",
    ["㦏"] = "忄巳巳八",
    ["㦐"] = "忄弋二貝",
    ["㦑"] = "忄乛耳攵",
    ["㦒"] = "忄罒言",
    ["㦓"] = "忄犬灬",
    ["㦔"] = "日月犬心",
    ["㦕"] = "忄阝夂生",
    ["㦖"] = "忄門心",
    ["㦗"] = "忄木木示",
    ["㦘"] = "白方攵心",
    ["㦙"] = "忄田⽱心",
    ["㦚"] = "心辛",
    ["㦛"] = "一ㄅ心",
    ["㦜"] = "忄艹隹又",
    ["㦝"] = "豸白儿心",
    ["㦞"] = "士乛工心",
    ["㦟"] = "豸里心",
    ["㦠"] = "忄业⺷寸",
    ["㦡"] = "忄白幺木",
    ["㦢"] = "忄⺮卩",
    ["㦣"] = "行韋心",
    ["㦤"] = "士冖豆心",
    ["㦥"] = "忄宀丰心",
    ["㦦"] = "忄門臼儿",
    ["㦧"] = "忄⺧儿曰",
    ["㦨"] = "忄門束丷",
    ["㦩"] = "忄阝爫心",
    ["㦪"] = "忄言火又",
    ["㦫"] = "忄⺧貝",
    ["㦬"] = "忄罒糹隹",
    ["㦭"] = "忄⻗口人",
    ["㦮"] = "二戈",
    ["㦯"] = "戈厶一",
    ["㦰"] = "人人


    EnableWriteNullValueCell = false // Default value is true.
};

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
```
![immagine](https://user-images.githubusercontent.com/31481586/241419441-c4f27e8f-3f87-46db-a10f-08665864c874.png)

```xml
<x:row r="2">
    <x:c r="A2" t ="str" s="2">
        <x:v>Somebody once</x:v>
    </x:c>
    <x:c r="B2" t ="str" s="2">
        <x:v></x:v>
    </x:c>
    <x:c r="C2" t ="str" s="2">
        <x:v>told me.</x:v>
    </x:c>
</x:row>
```
Funziona per valori null e DBNull.

#### 14. Blocca riquadri

```csharp
/* ... */

OpenXmlConfiguration configuration = new OpenXmlConfiguration()
{
    FreezeRowCount = 1,     // default is 1
    FreezeColumnCount = 2   // default is 0
};

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
```
![image](https://raw.githubusercontent.com/mini-software/MiniExcel/master/docs/images/freeze-pane-1.png)

### Compilare i Dati nel Modello Excel <a name="getstart3"></a>

- La dichiarazione è simile al template Vue `{{nome variabile}}`, oppure al rendering di una collezione `{{nome collezione.nome campo}}`
- Il rendering delle collezioni supporta IEnumerable/DataTable/DapperRow

#### 1. Compilazione Base

Modello:
![image](https://user-images.githubusercontent.com/12729184/114537556-ed8d2b00-9c84-11eb-8303-a69f62c41e5b.png)

Risultato:
![image](https://user-images.githubusercontent.com/12729184/114537490-d8180100-9c84-11eb-8c69-db58692f3a85.png)

Codice:

```csharp
// 1. By POCO
var value = new
{
    Name = "Jack",
    CreateDate = new DateTime(2021, 01, 01),
    VIP = true,
    Points = 123
};
MiniExcel.SaveAsByTemplate(path, templatePath, value);

// 2. By Dictionary
var value = new Dictionary<string, object>()
{
    ["Name"] = "Jack",
    ["CreateDate"] = new DateTime(2021, 01, 01),
    ["VIP"] = true,
    ["Points"] = 123
};
MiniExcel.SaveAsByTemplate(path, templatePath, value);
```
#### 2. Riempimento Dati IEnumerable

> Nota1: Utilizzare il primo IEnumerable della stessa colonna come base per riempire la lista

Template:
![image](https://user-images.githubusercontent.com/12729184/114564652-14f2f080-9ca3-11eb-831f-09e3fedbc5fc.png)

Risultato:
![image](https://user-images.githubusercontent.com/12729184/114564204-b2015980-9ca2-11eb-900d-e21249f93f7c.png)

Codice:

```csharp
//1. By POCO
var value = new
{
    employees = new[] {
        new {name="Jack",department="HR"},
        new {name="Lisa",department="HR"},
        new {name="John",department="HR"},
        new {name="Mike",department="IT"},


eSymbols = goog.i18n.DateTimeSymbols_ca_ES;
    break;
  case 'ca_FR':
  case 'ca-FR':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ca_FR;
    break;
  case 'ca_IT':
  case 'ca-IT':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ca_IT;
    break;
  case 'ccp':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ccp;
    break;
  case 'ccp_BD':
  case 'ccp-BD':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ccp_BD;
    break;
  case 'ccp_IN':
  case 'ccp-IN':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ccp_IN;
    break;
  case 'ce':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ce;
    break;
  case 'ce_RU':
  case 'ce-RU':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ce_RU;
    break;
  case 'ceb':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ceb;
    break;
  case 'ceb_PH':
  case 'ceb-PH':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ceb_PH;
    break;
  case 'cgg':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_cgg;
    break;
  case 'cgg_UG':
  case 'cgg-UG':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_cgg_UG;
    break;
  case 'chr_US':
  case 'chr-US':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_chr_US;
    break;
  case 'ckb':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb;
    break;
  case 'ckb_Arab':
  case 'ckb-Arab':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb_Arab;
    break;
  case 'ckb_Arab_IQ':
  case 'ckb-Arab-IQ':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb_Arab_IQ;
    break;
  case 'ckb_Arab_IR':
  case 'ckb-Arab-IR':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb_Arab_IR;
    break;
  case 'ckb_IQ':
  case 'ckb-IQ':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb_IQ;
    break;
  case 'ckb_IR':
  case 'ckb-IR':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_ckb_IR;
    break;
  case 'cs_CZ':
  case 'cs-CZ':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_cs_CZ;
    break;
  case 'cy_GB':
  case 'cy-GB':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_cy_GB;
    break;
  case 'da_DK':
  case 'da-DK':
    goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_da_DK;
    break;
  case 'da_GL':
  case 'da-GL':
    goog.i18


astered Original Album Mix)
        (r"\([^(]*Remaster[^)]*\)$", ""),
    ]
);

filter_rules!(
    /// Filter rules to remove "Live..."-like strings from a text.
    live_filter_rules,
    [
        // Track - Live
        (r"-\sLive?$", ""),
        // Track - Live at
        (r"-\sLive\s.+?$", ""),
        // (Live) or [Live]
        (r"(?i)[(\[]Live[)\]]", ""),
    ]
);

filter_rules!(
    /// Filter rules to remove "Explicit" and "Clean" from a text.
    clean_explicit_filter_rules,
    [
        // (Explicit) or [Explicit]
        (r"(?i)\s[(\[]Explicit[)\]]", ""),
        // (Clean) or [Clean]
        (r"(?i)\s[(\[]Clean[)\]]", ""),
    ]
);

filter_rules!(
    /// Filter rules to remove feature information from a text.
    feature_filter_rules,
    [
        // [Feat. Artist] or (Feat. Artist)
        (r"(?i)\s[(\[]feat. .+[)\]]", ""),
    ]
);

filter_rules!(
    /// Filter rules to normalize feature information to "Feat. Artist".
    normalize_feature_filter_rules,
    [
        // [Feat. Artist] or (Feat. Artist) -> Feat. Artist
        (r"(?i)\s[(\[](feat. .+)[)\]]", " $1"),
    ]
);

filter_rules!(
    /// Filter rules to remove version information (eg. "Album Version" or "Deluxe Edition")
    /// from a text.
    version_filter_rules,
    [
        // Love Will Come To You (Album Version)
        (r"[(\[]Album Version[)\]]$", ""),
        // I Melt With You (Rerecorded)
        // When I Need You [Re-Recorded]
        (r"[(\[]Re-?[Rr]ecorded[)\]]$", ""),
        // Your Cheatin' Heart (Single Version)
        (r"[(\[]Single Version[)\]]$", ""),
        // All Over Now (Edit)
        (r"[(\[]Edit[)\]]$", ""),
        // (I Can't Get No) Satisfaction - Mono Version
        (r"-\sMono Version$", ""),
        // Ruby Tuesday - Stereo Version
        (r"-\sStereo Version$", ""),
        // Pure McCartney (Deluxe Edition)
        (r"\(Deluxe Edition\)$", ""),
        // 6 Foot 7 Foot (Explicit Version)
        (r"(?i)[(\[]Explicit Version[)\]]", ""),
    ]
);

filter_rules!(
    /// Filter rules to normalize "- suffix" to "(suffix)" in a text.
    suffix_filter_rules,
    [
        // "- X Remix" -> "(X Remix)" and similar
        (
            r"(?i)-\s(.+?)\s((Re)?mix|edit|dub|mix|vip|version)$",
            "($1 $2)"
        ),
        (r"(?i)-\s(Remix|VIP)$", "($1)"),
    ]
);

filter_rules!(
    /// Filter rules to remove leading and trailing whitespace from a text.
    trim_whitespace_filter_rules,
    [(r"^\s+", ""), (r"\s+$", ""),]
);

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

    fn apply_rules(text: &str, rules: &[FilterRule]) -> String {
        rules.iter().fold(text.to_string(), |mut result, rule| {
            let filtered = rule.apply(&result);
            if let Cow::Owned(filtered) = filtered {
                result.clear();
                result.push_str(&filtered);
            }
            result
        })
    }

    fn test_rules(values: &[(&str, &str)], rules: &[FilterRule]) {
        for value in values {
            let filtered = apply_rules(value.0, rules);
            println!("value: {:?}\nexpected: {:?}\nactual: {:?}\n-----", value.0, value.1, filtered);
            assert_eq!(filtered, value.1);
        }
    }

    #[test]
    fn test_youtube_track_filter_rules() {
        let titles = [


)

        if (hero.isAlive && ratio < 0.15f) {
            hero.sayShort(HeroLines.SAVED_ME)
            hero.recoverSanity(Random.Float(2f, 6f - ratio / 0.05f)) // 2~3 +
        }
    }
}package com.egoal.darkestpixeldungeon.items.bags

import com.egoal.darkestpixeldungeon.Dungeon
import com.egoal.darkestpixeldungeon.actors.buffs.Buff
import com.egoal.darkestpixeldungeon.actors.hero.Belongings
import com.egoal.darkestpixeldungeon.items.Item
import com.egoal.darkestpixeldungeon.items.specials.Special
import com.egoal.darkestpixeldungeon.sprites.ItemSpriteSheet

class SkillTree : Bag() {
    init {
        image = ItemSpriteSheet.SKILL_TREE

        size = Belongings.BACKPACK_SIZE + 2
    }

    override fun canHold(item: Item): Boolean = super.canHold(item) && item is Special

    override fun price(): Int = 0

    class Updater : Buff() {
        lateinit var skills: SkillTree

        init {
            actPriority = -1 // before hero.
        }

        override fun act(): Boolean {
            if (!::skills.isInitialized)
                skills = Dungeon.hero.belongings.getItem(SkillTree::class.java)!!

            for (i in skills.items) (i as Special).tick()

            spend(1f)
            return true
        }
    }
}/*
 * Pixel Dungeon
 * Copyright (C) 2012-2015  Oleg Dolya
 *
 * Shattered Pixel Dungeon
 * Copyright (C) 2014-2016 Evan Debenham
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
package com.egoal.darkestpixeldungeon.items.bags

import com.egoal.darkestpixeldungeon.actors.hero.Belongings
import com.egoal.darkestpixeldungeon.items.scrolls.Scroll
import com.egoal.darkestpixeldungeon.sprites.ItemSpriteSheet
import com.egoal.darkestpixeldungeon.items.Item
import com.egoal.darkestpixeldungeon.items.potions.Potion

class ScrollHolder : Bag() {
    init {
        image = ItemSpriteSheet.HOLDER

        size = Belongings.BACKPACK_SIZE
    }

    override fun canHold(item: Item): Boolean = item is Scroll && super.canHold(item)

    override fun price(): Int = 40
}
/*
 * Pixel Dungeon
 * Copyright (C) 2012-2015  Oleg Dolya
 *
 * Shattered Pixel Dungeon
 * Copyright (C) 2014-2016 Evan Debenham
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
package com.


#region BSD License
/*
 *
 * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
 *  © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
 *
 *  New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
 *  Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
 *
 */
#endregion

namespace Krypton.Toolkit
{
    /// <summary>
    /// Storage for button content value information.
    /// </summary>
    public class ButtonImageStates : Storage
    {
        #region Instance Fields
        private Image? _imageNormal;
        private Image? _imageDisabled;
        private Image? _imagePressed;
        private Image? _imageTracking;
        #endregion

        #region IsDefault
        /// <summary>
        /// Gets a value indicating if all values are default.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override bool IsDefault => (ImageNormal == null) &&
                                            (ImageDisabled == null) &&
                                            (ImagePressed == null) &&
                                            (ImageTracking == null);

        #endregion

        #region ImageNormal
        /// <summary>
        /// Gets and sets the button image for normal state.
        /// </summary>
        [KryptonPersist(false)]
        [Localizable(true)]
        [Category(@"Visuals")]
        [Description(@"Button image for normal state.")]
        [RefreshProperties(RefreshProperties.All)]
        [DefaultValue(null)]
        public Image? ImageNormal
        {
            get => _imageNormal;

            set
            {
                if (_imageNormal != value)
                {
                    _imageNormal = value;
                    PerformNeedPaint(true);
                }
            }
        }

        private bool ShouldSerializeImageNormal() => ImageNormal != null;

        /// <summary>
        /// Resets the ImageNormal property to its default value.
        /// </summary>
        public void ResetImageNormal() => ImageNormal = null;
        #endregion

        #region ImageDisabled
        /// <summary>
        /// Gets and sets the button image for disabled state.
        /// </summary>
        [KryptonPersist(false)]
        [Localizable(true)]
        [Category(@"Visuals")]
        [Description(@"Button image for disabled state.")]
        [RefreshProperties(RefreshProperties.All)]
        [DefaultValue(null)]
        public Image? ImageDisabled
        {
            get => _imageDisabled;

            set
            {
                if (_imageDisabled != value)
                {
                    _imageDisabled = value;
                    PerformNeedPaint(true);
                }
            }
        }

        private bool ShouldSerializeImageDisabled() => ImageDisabled != null;

        /// <summary>
        /// Resets the ImageDisabled property to its default value.
        /// </summary>
        public void ResetImageDisabled() => ImageDisabled = null;
        #endregion

        #region ImagePressed
        /// <summary>
        /// Gets and sets the button image for pres


ectorSourcePropertiesDataTransferApiProperties
    {
        public readonly string Name;
        public readonly Pulumi.AwsNative.AppFlow.FlowCustomConnectorSourcePropertiesDataTransferApiPropertiesType Type;

        [OutputConstructor]
        private FlowCustomConnectorSourcePropertiesDataTransferApiProperties(
            string name,

            Pulumi.AwsNative.AppFlow.FlowCustomConnectorSourcePropertiesDataTransferApiPropertiesType type)
        {
            Name = name;
            Type = type;
        }
    }
}


 "a1");
		GET_ARG(a2, argv[6], "a2");
		break;
	default:
		LOG_FMT(LL_ERROR, "%s: BUG: unknown filter type: %s (%d)", __FILE__, argv[0], ei->effect_number);
		return NULL;
	}

	e = calloc(1, sizeof(struct effect));
	e->name = ei->name;
	e->istream.fs = e->ostream.fs = istream->fs;
	e->istream.channels = e->ostream.channels = istream->channels;
	e->channel_selector = NEW_SELECTOR(istream->channels);
	COPY_SELECTOR(e->channel_selector, channel_selector, istream->channels);
	e->flags |= EFFECT_FLAG_OPT_REORDERABLE;
	biquad_effect_set_run_func(e);
	e->reset = biquad_effect_reset;
	e->plot = biquad_effect_plot;
	e->destroy = biquad_effect_destroy;
	e->merge = biquad_effect_merge;
	state = calloc(istream->channels, sizeof(struct biquad_state));
	for (i = 0; i < istream->channels; ++i) {
		if (GET_BIT(channel_selector, i)) {
			if (type == BIQUAD_BIQUAD)
				biquad_init(&state[i], b0, b1, b2, a0, a1, a2);
			else
				biquad_init_using_type(&state[i], type, istream->fs, arg0, arg1, arg2, arg3, width_type);
		}
	}
	e->data = state;
	return e;
}


area {
  background: transparent;
  color: inherit;
  border: 1px solid #666666;
  background: #10101a;
  padding: 0 2px;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
}
textarea {
  vertical-align: top;
}

label img {
  vertical-align: bottom;
  position: relative;
  top: -3px;
  margin-right: .3em;
}
input[type="radio"] { display: none; }
input[type="radio"] ~ span {
  cursor: pointer;
  display: inline-block;
}
input[type="radio"] ~ span:before {
  content: "( ) ";
}
input[type="radio"] ~ span:hover, input[type="radio"] ~ span:focus {
  background-color: #19193b;
}
input[type="radio"]:checked ~ span {
  color: #ffffff;
}
input[type="radio"]:checked ~ span:before {
  content: "(O) ";
}
input[type="checkbox"] { display: none; }
input[type="checkbox"] ~ span {
  cursor: pointer;
  display: inline-block;
}
input[type="checkbox"] ~ span:before {
  content: "[ ] ";
}
input[type="checkbox"] ~ span:hover, input[type="checkbox"] ~ span:focus {
  background-color: #19193b;
}
input[type="checkbox"]:checked ~ span {
  color: #ffffff;
}
input[type="checkbox"]:checked ~ span:before {
  content: "[X] ";
}
input[type="checkbox"]:disabled ~ span {
  opacity: .3;
  cursor: default;
}
input[type="checkbox"]:disabled ~ span:before {
  content: "[-] ";
}
input[type="checkbox"]:disabled ~ span:hover {
  background-color: transparent;
}

input[type="submit"] {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
  padding: 0;
  color: #009900;
  cursor: pointer;
}
input[type="submit"]:hover, input[type="submit"]:focus {
  color: #99ff99;
}
*::-moz-focus-inner {
  padding: 0;
  border: 0
}

article {
  width: 45em;
  margin-bottom: 2em;
  margin-top: 2em;
}
article:first-of-type {
  margin-top: 0;
}
article h2 {
  color: #ffffff;
  margin-top: 1em;
  margin-bottom: 1em;
  white-space: nowrap;
}
article h2 + * {
  margin-top: 0;
}
article em {
  color: #ffffff;
  font-style: normal;
  text-shadow: 0 0 5px #ffffff;
}
article em.star {
  color: #ffff66;
  font-style: normal;
  text-shadow: 0 0 5px #ffff66;
}
article a {
  white-space: nowrap;
}
article .aside {
  opacity: .6;
}
article ul {
  list-style-type: none;
  padding: 0;
}
article li {
  padding-left: 2.5em;
  position: relative;
}
article li:before {
  content: "\00a0\00a0-\00a0";
  position: absolute;
  left: 0;
  top: 0;
}
.day-success {
  color: #ffff66;
  text-shadow: 0 0 5px #ffff66;
}

form#settings input[type="radio"] ~ span {
  min-width: 30em;
}
form#settings input[type="checkbox"] ~ span {
  min-width: 30em;
}

.share {
  color: #009900;
  cursor: default;
  transition: color .2s 1s;
  /*position: relative;


filter tf.Output, max_filter tf.Output, strides []int64, padding string, optional ...QuantizedDepthwiseConv2DAttr) (output tf.Output, min_output tf.Output, max_output tf.Output) {
	if scope.Err() != nil {
		return
	}
	attrs := map[string]interface{}{"strides": strides, "padding": padding}
	for _, a := range optional {
		a(attrs)
	}
	opspec := tf.OpSpec{
		Type: "QuantizedDepthwiseConv2D",
		Input: []tf.Input{
			input, filter, min_input, max_input, min_filter, max_filter,
		},
		Attrs: attrs,
	}
	op := scope.AddOperation(opspec)
	return op.Output(0), op.Output(1), op.Output(2)
}

// DecodeAndCropJpegAttr is an optional argument to DecodeAndCropJpeg.
type DecodeAndCropJpegAttr func(optionalAttr)

// DecodeAndCropJpegChannels sets the optional channels attribute to value.
//
// value: Number of color channels for the decoded image.
// If not specified, defaults to 0
func DecodeAndCropJpegChannels(value int64) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["channels"] = value
	}
}

// DecodeAndCropJpegRatio sets the optional ratio attribute to value.
//
// value: Downscaling ratio.
// If not specified, defaults to 1
func DecodeAndCropJpegRatio(value int64) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["ratio"] = value
	}
}

// DecodeAndCropJpegFancyUpscaling sets the optional fancy_upscaling attribute to value.
//
// value: If true use a slower but nicer upscaling of the
// chroma planes (yuv420/422 only).
// If not specified, defaults to true
func DecodeAndCropJpegFancyUpscaling(value bool) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["fancy_upscaling"] = value
	}
}

// DecodeAndCropJpegTryRecoverTruncated sets the optional try_recover_truncated attribute to value.
//
// value: If true try to recover an image from truncated input.
// If not specified, defaults to false
func DecodeAndCropJpegTryRecoverTruncated(value bool) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["try_recover_truncated"] = value
	}
}

// DecodeAndCropJpegAcceptableFraction sets the optional acceptable_fraction attribute to value.
//
// value: The minimum required fraction of lines before a truncated
// input is accepted.
// If not specified, defaults to 1
func DecodeAndCropJpegAcceptableFraction(value float32) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["acceptable_fraction"] = value
	}
}

// DecodeAndCropJpegDctMethod sets the optional dct_method attribute to value.
//
// value: string specifying a hint about the algorithm used for
// decompression.  Defaults to "" which maps to a system-specific
// default.  Currently valid values are ["INTEGER_FAST",
// "INTEGER_ACCURATE"].  The hint may be ignored (e.g., the internal
// jpeg library changes to a version that does not have that specific
// option.)
// If not specified, defaults to ""
func DecodeAndCropJpegDctMethod(value string) DecodeAndCropJpegAttr {
	return func(m optionalAttr) {
		m["dct_method"] = value
	}
}

// Decode and Crop a JPEG-encoded image to a uint8 tensor.
//
// The attr `channels` indicates the desired number of color channels for the
// decoded image.
//
// Accepted values are:
//
// *


com/automuteus/automuteus/v8/pkg/settings"
	"github.com/nicksnyder/go-i18n/v2/i18n"
	"log"
	"strconv"
)

func FnMatchSummary(sett *settings.GuildSettings, args []string) (interface{}, bool) {
	s := GetSettingByName(MatchSummary)
	if sett == nil {
		return nil, false
	}
	if len(args) == 0 {
		return ConstructEmbedForSetting(fmt.Sprintf("%d", sett.GetDeleteGameSummaryMinutes()), s, sett), false
	}

	num, err := strconv.ParseInt(args[0], 10, 64)
	if err != nil {
		log.Println("error for parseint in MatchSummary: ", err)
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummary.Unrecognized",
			Other: "{{.Minutes}} is not a valid number. See `/settings match-summary` for usage",
		},
			map[string]interface{}{
				"Minutes": args[0],
			}), false
	}
	if num > 60 || num < -1 {
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummary.OutOfRange",
			Other: "You provided a number too high or too low. Please specify a number between [0-60], or -1 to never delete match summaries",
		}), false
	}

	sett.SetDeleteGameSummaryMinutes(int(num))
	switch {
	case num == -1:
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummary.Success-1",
			Other: "From now on, I'll never delete match summary messages.",
		}), true
	case num == 0:
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummary.Success0",
			Other: "From now on, I'll delete match summary messages immediately.",
		}), true
	default:
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummary.Success",
			Other: "From now on, I'll delete match summary messages after {{.Minutes}} minutes.",
		},
			map[string]interface{}{
				"Minutes": num,
			}), true
	}
}

func FnMatchSummaryChannel(sett *settings.GuildSettings, args []string) (interface{}, bool) {
	s := GetSettingByName(MatchSummaryChannel)
	if sett == nil {
		return nil, false
	}
	if len(args) == 0 {
		return ConstructEmbedForSetting(discord.MentionByChannelID(sett.GetMatchSummaryChannelID()), s, sett), false
	}

	channelID, err := discord.ExtractChannelIDFromText(args[0])
	if err != nil {
		return sett.LocalizeMessage(&i18n.Message{
			ID:    "settings.SettingMatchSummaryChannel.invalidChannelID",
			Other: "{{.channelID}} is not a valid text channel ID or mention!",
		},
			map[string]interface{}{
				"channelID": args[0],
			}), false
	}

	sett.SetMatchSummaryChannelID(channelID)
	return sett.LocalizeMessage(&i18n.Message{
		ID:    "settings.SettingMatchSummaryChannel.withChannelID",
		Other: "Match Summary text channel ID changed to {{.channelID}}!",
	},
		map[string]interface{}{
			"channelID": discord.MentionByChannelID(channelID),
		}), true
}
package command

import (
	"github.com/automuteus/automuteus/v8/bot/setting"
	"github.com/bwmarrin/discordgo"
)

const (
	Match = "match"
	Guild = "guild"
)

var Stats = discordgo.ApplicationCommand{
	Name:        "stats",
	Description: "View or clear stats from games played with AutoMuteUs",
	Options: []*discordgo.ApplicationCommandOption{
		{


GPUs", assignedGpus);
	if (assignedGpus.length() > 0) {
		sing_args.AppendArg("--nv");
		static const char* open_cl_path = "/etc/OpenCL/vendors";
		if (IsDirectory(open_cl_path)) {
			additional_bind_mounts.emplace_back(open_cl_path);
		}
	}

	// Now handle requested bind-mounts.  We will mount everything specified with
	// SINGULARITY_BIND_EXPR, plus any mounts in additional_bind_mounts list.
	if (param_eval_string(bind_spec, "SINGULARITY_BIND_EXPR", "SingularityBind", &machineAd, &jobAd)) {
		dprintf(D_FULLDEBUG, "Parsing bind mount specification for singularity: %s\n", bind_spec.c_str());
		std::vector<std::string> binds = split(bind_spec);
		// Singularity outputs warnings about duplicate mounts to stderr, so
		// let's try to avoid that.
		for (const auto& tmp: additional_bind_mounts) {
			if (!contains(binds, tmp)) {
				binds.emplace_back(tmp);
			}
		}
		for (const auto& next_bind: binds) {
			std::string bind_src_dir(next_bind);
			// BIND exprs can be src:dst:ro
			size_t colon = bind_src_dir.find(':');
			if (colon != std::string::npos) {
				bind_src_dir = bind_src_dir.substr(0, colon);
			}
			struct stat sw;
			if (stat(bind_src_dir.c_str(), &sw) != 0) {
				dprintf(D_ALWAYS, "Skipping invalid singularity bind source directory %s\n", next_bind.c_str());
				continue;
			}

			// Older singularity versions that do not support underlay
			// may require the target directory to exist.  OSG wants
			// to ignore mount requests where this is the case.
			if (param_boolean("SINGULARITY_IGNORE_MISSING_BIND_TARGET", false)) {
				// We an only check this when the image format is a directory
				// That's OK for OSG, that's all they use
				struct stat si = {};
				stat(image.c_str(), &si);
				if (si.st_mode & S_IFDIR) {
					// target dir is after the colon, if it exists
					std::string target_dir;
					const char *colon = strchr(next_bind.c_str(),':');
					if (colon == nullptr) {
						// "/dir"
						target_dir = next_bind;
					} else {
						// "/dir:dir2"
						target_dir = colon + 1;
					}
					size_t colon_pos = target_dir.find(':');
					if (colon_pos != std::string::npos) {
						target_dir = target_dir.substr(0, colon_pos);
					}

					std::string abs_target_dir = image + "/" + target_dir;
					struct stat td = {};
					stat(abs_target_dir.c_str(), &td);
					if ( !(td.st_mode & S_IFDIR) ) {
						dprintf(D_ALWAYS, "Target directory %s does not exist in image, skipping mount\n", abs_target_dir.c_str());
						continue;
					}

				} else {
					dprintf(D_ALWAYS, "Image %s is NOT directory, skipping test for missing bind target for %s\n", image.c_str(), next_bind.c_str());
				}
			}
			sing_args.AppendArg("-B");
			sing_args.AppendArg(next_bind);
		}
	}

	// If file xfer is on...
	// pass --home <scratch_dir>
	// 1) bind_mounts /home/<user_name> onto <scratch_dir>
	// 2) sets $HOME to /home/<user_name>


/// </summary>
        public const int CS_MAX_WEATHER_NAME_LEN = 25;

        /// <summary>
        /// 最大公告字符串长度
        /// </summary>
        public const int CS_MAX_NOTICE_CONTENT_LEN = 2048;

        /// <summary>
        /// 怪物尺寸信息最大数量
        /// </summary>
        public const int MAX_MONSTER_SIZE_INFO_COUNT = 10;

        /// <summary>
        /// 最大弹窗信息长度
        /// </summary>
        public const int CS_MAX_NOTIFY_INFO_LEN = 2048;

        /// <summary>
        /// 异常状态buff列表长度
        /// </summary>
        public const int CS_STATE_BUFF_COUNT = 17;

        /// <summary>
        /// 缴纳箱数据最大数量
        /// </summary>
        public const int CS_MAX_PAID_BOX_DATA_COUNT = 100;

        /// <summary>
        /// 房间最大人数
        /// </summary>
        public const int CS_MAX_ROOM_MEMBER_COUNT = 32;

        /// <summary>
        /// 匹配最大信息数量
        /// </summary>
        public const int CS_MAX_MATCH_INFO_COUNT = 10;

        /// <summary>
        /// 任务属性数据长度
        /// </summary>
        public const int CS_MAX_QUEST_DATA_LEN = 1024;

        /// <summary>
        /// 历史任务属性数据长度
        /// </summary>
        public const int CS_MAX_QUEST_HISTORY_DATA_LEN = 1024;

        /// <summary>
        /// BUFF数据长度
        /// </summary>
        public const int CS_MAX_BUFF_DATA_LEN = 10240;

        /// <summary>
        /// BUFF动态数据长度
        /// </summary>
        public const int CS_MAX_BUFF_PARAM_LEN = 100;

        /// <summary>
        /// SKILL数据长度
        /// </summary>
        public const int CS_MAX_SKILL_DATA_LEN = 10240;

        /// <summary>
        /// 宠物数据长度
        /// </summary>
        public const int CS_MAX_PET_DATA_LEN = 10240;

        /// <summary>
        /// 宠物装备最大数目
        /// </summary>
        public const int CS_MAX_PET_EQUIP_NUM = 10;

        /// <summary>
        /// CD数据长度
        /// </summary>
        public const int CS_MAX_CD_DATA_LEN = 1024;

        /// <summary>
        /// 玩家最多拥有的好友数量
        /// </summary>
        public const int CS_FRIEND_MAX = 500;

        /// <summary>
        /// 玩家最多拥有的路人数量
        /// </summary>
        public const int CS_PASSERBY_MAX = 20;

        /// <summary>
        /// 玩家最多拥有的黑名单数量
        /// </summary>
        public const int CS_BLACKLIST_MAX = 20;

        /// <summary>
        /// 玩家最多拥有的好友分组数量
        /// </summary>
        public const int CS_FRIENDGROUP_MAX = 10;

        /// <summary>
        /// 数据长度
        /// </summary>
        public const int CS_MAX_ROMTE_DATA_LEN = 61440;

        /// <summary>
        /// 属性数据长度
        /// </summary>
        public const int CS_MAX_ATTR_DATA_LEN = 20480;

        /// <summary>
        /// 任务数据长度
        /// </summary>
        public const int CS_MAX_TASK_DATA_LEN = 10240;

        /// <summary>
        /// 猎团数据长度


                                mc.fontRendererObj.drawStringWithShadow(
                                    entityLiving.displayName.formattedText,
                                    minX + (maxX - minX) / 2 - stringWidth / 2, minY - 12, -1
                                )
                                GL11.glDisable(GL11.GL_TEXTURE_2D)
                                GL11.glDisable(GL11.GL_DEPTH_TEST)
                            }
                        }
                    }
                }
            }
        }
        if (real2d) {
            GL11.glEnable(GL11.GL_DEPTH_TEST)
            GL11.glMatrixMode(GL11.GL_PROJECTION)
            GL11.glPopMatrix()
            GL11.glMatrixMode(GL11.GL_MODELVIEW)
            GL11.glPopMatrix()
            GL11.glPopAttrib()
        }
    }

    @EventTarget
    fun onRender2D(event: Render2DEvent) {
        val mode = modeValue.get().lowercase(Locale.getDefault())
        val shader = (if (mode.equals(
                "shaderoutline",
                ignoreCase = true
            )
        ) OutlineShader.OUTLINE_SHADER else if (mode.equals(
                "shaderglow",
                ignoreCase = true
            )
        ) GlowShader.GLOW_SHADER else null)
            ?: return
        shader.startDraw(event.partialTicks)
        renderNameTags = false
        try {
            for (entity in mc.theWorld.loadedEntityList) {
                if (!EntityUtils.isSelected(entity, false)) continue
                mc.renderManager.renderEntityStatic(entity, mc.timer.renderPartialTicks, true)
            }
        } catch (ex: Exception) {
            ClientUtils.logger.error("An error occurred while rendering all entities for shader esp", ex)
        }
        renderNameTags = true
        val radius = if (mode.equals(
                "shaderoutline",
                ignoreCase = true
            )
        ) shaderOutlineRadius.get() else if (mode.equals(
                "shaderglow",
                ignoreCase = true
            )
        ) shaderGlowRadius.get() else 1f
        shader.stopDraw(getColor(null)!!, radius, 1f)
    }

    fun getColor(entity: Entity?): Color? {
        if (entity is EntityLivingBase) {
            if (colorModeValue.get().equals("Health", ignoreCase = true)) return BlendUtils.getHealthColor(
                entity.health,
                entity.maxHealth
            )
            if (entity.hurtTime > 0) return Color.RED
            if (colorTeam.get()) {
                val chars = entity.displayName.formattedText.toCharArray()
                var color = Int.MAX_VALUE
                for (i in chars.indices) {
                    if (chars[i] != '§' || i + 1 >= chars.size) continue
                    val index = getColorIndex(chars[i + 1])
                    if (index < 0 || index > 15) continue
                    color = ColorUtils.hexColors[index]
                    break
                }
                return Color(color)
            }
        }
        return when (colorModeValue.get()) {
            "Custom" -> Color(colorRedValue.get(), colorGreenValue.get(), colorBlueValue.get())
            "Rainbow" -> Color(
                getRainbowOpaque(
                    mixerSecondsValue.get(),
                    saturationValue.get(),
                    brightnessValue.get(),
                    0
                )
            )

            "Sky" -> skyRainbow(0, saturationValue.get(), brightnessValue.get())
            "LiquidSlowly" -> LiquidSlowly(System.nano


package:flutter/material.dart';
import 'package:just_audio/just_audio.dart';
import 'package:demo/views/chat/chat_message_card.dart';
import 'package:demo/views/chat/chat_message_file.dart';
import 'package:demo/views/chat/chat_message_image.dart';
import 'package:demo/views/chat/chat_message_other.dart';
import 'package:demo/views/chat/chat_message_text.dart';
import 'package:demo/views/chat/chat_message_tips.dart';
import 'package:demo/views/chat/chat_message_video.dart';
import 'package:demo/views/chat/chat_message_voice.dart';
import 'package:demo/tools/tools_enum.dart';
import 'package:demo/tools/tools_sqlite.dart';

// 聊天=消息
class ChatMessage extends StatefulWidget {
  final ChatHis chatHis;
  final AudioPlayer audioPlayer;

  const ChatMessage(
    this.chatHis,
    this.audioPlayer, {
    super.key,
  });

  @override
  createState() => _ChatMessageState();
}

class _ChatMessageState extends State<ChatMessage> {
  @override
  Widget build(BuildContext context) {
    // 历史消息
    ChatHis chatHis = widget.chatHis;
    // 消息类型
    MsgType msgType = chatHis.msgType;
    // 消息内容
    Map<String, dynamic> content = chatHis.content;
    // 结果
    Widget result;
    switch (msgType) {
      // 提示消息
      case MsgType.tips:
        result = ChatMessageTips(content);
        break;
      // 文本消息
      case MsgType.text:
        result = ChatMessageText(content);
        break;
      // 图片消息
      case MsgType.image:
        result = ChatMessageImage(
          chatHis.content,
        );
        break;
      // 视频消息
      case MsgType.video:
        result = ChatMessageVideo(
          content,
        );
        break;
      // 文件消息
      case MsgType.file:
        result = ChatMessageFile(content);
        break;
      // 声音消息
      case MsgType.voice:
        result = ChatMessageVoice(chatHis, widget.audioPlayer);
        break;
      // 名片消息
      case MsgType.card:
        result = ChatMessageCard(content);
        break;
      // 其他消息
      default:
        result = const ChatMessageOther();
        break;
    }
    return result;
  }
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:demo/config/app_fonts.dart';
import 'package:demo/event/event_setting.dart';
import 'package:demo/views/msg/msg_forward_controller.dart';
import 'package:demo/views/msg/msg_forward_view.dart';
import 'package:demo/tools/tools_enum.dart';
import 'package:demo/tools/tools_perms.dart';
import 'package:demo/tools/tools_scan.dart';
import 'package:demo/tools/tools_sqlite.dart';
import 'package:demo/component/component_common.dart';

// 聊天=消息=弹窗
class ChatMessageBubble extends StatelessWidget {
  final ChatHis chatHis;
  final double height;
  final RxBool configCheckBox;

  const ChatMessageBubble({
    super.key,
    required this.chatHis,
    required this.height,


r0, #0x0
	movne   r0, #0x0
	ldmnefd sp!, {r3-r5,pc}
	ldr     r1, [pc, #0x2c] @ [0x22443e8] (=0x22443ec)
	mov     r2, r4
	mov     r0, #0x1
	mov     r3, #0xc8
	bl      Function_2246304
	str     r0, [r4]
	mov     r0, #0x0
	strh    r0, [r4, #0x4]
	strh    r5, [r4, #0x6]
	mov     r0, #0x1
	strb    r0, [r4, #0x9]
	ldmfd   sp!, {r3-r5,pc}
@ 0x22443e4

.word 0x22533bc @ 0x22443e4
.word 0x22443ec @ 0x22443e8
.arm
Function_22443ec: @ 22443ec :arm
	stmfd   sp!, {r3,lr}
	ldrsh   r2, [r1, #0x4]
	add     r2, r2, #0x1
	strh    r2, [r1, #0x4]
	ldrsh   r3, [r1, #0x4]
	ldrh    r2, [r1, #0x6]
	cmp     r3, r2
	ldmltfd sp!, {r3,pc}
	mov     r2, #0x0
	strb    r2, [r1, #0x9]
	mov     r1, r0
	mov     r0, #0x1
	bl      Function_22463ac
	ldmfd   sp!, {r3,pc}
@ 0x2244424

.arm
Function_2244424: @ 2244424 :arm
	stmfd   sp!, {r3-r9,lr}
	mov     r0, #26, 26 @ #0x680
	mov     r1, #0x4
	bl      Function_2245068
	mov     r4, r0
	ldr     r3, [pc, #0xdc] @ [0x224451c] (=0x22533c0)
	add     r1, r4, #0x10
	mov     r0, #0x20
	mov     r2, #0x30
	str     r4, [r3]
	bl      Function_2244008
	ldr     r1, [pc, #0xc4] @ [0x224451c] (=0x22533c0)
	ldr     r1, [r1]
	str     r0, [r1, #0x670]
	bl      Function_222f74c
	cmp     r0, #0x6
	mov     r4, #0x4
	bne     branch_22444c4
	mov     r7, #0x0
	ldr     r6, [pc, #0xa8] @ [0x2244520] (=0x224b210)
	ldr     r9, [pc, #0xa0] @ [0x224451c] (=0x22533c0)
	mov     r8, r7
	mov     r5, r7
.arm
branch_2244480: @ 2244480 :arm
	ldr     r0, [r6, r7, lsl #0x2]
	mov     r1, r5
	mov     r2, r4
	bl      Function_2243738
	ldr     r1, [r9]
	add     r1, r1, r7, lsl #2
	str     r0, [r1, #0x674]
	ldr     r2, [r9]
	add     r0, r2, r7, lsl #2
	ldr     r1, [r0, #0x674]
	add     r0, r2, r8
	bl      Function_20ac86c
	add     r7, r7, #


nt);

        final plus = MockPlusActor();
        Core.register<PlusActor>(plus);

        final subject = KeypairActor();

        await subject.load(m);
        verify(ops.doGenerateKeypair()).called(1);
      });
    });
  });
}
part of 'core.dart';

class Job {
  final String name;
  final DateTime? before;
  final Duration? every;
  final List<Condition> when;
  final bool Function()? skip;
  final Future<bool> Function(Marker) callback;
  final Marker marker;

  late DateTime next;

  Job(
    this.name,
    this.marker, {
    this.before,
    this.every,
    this.when = const [],
    this.skip,
    required this.callback,
  });

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

  @override
  int get hashCode => name.hashCode;
}

enum Event {
  appForeground;
}

class Condition {
  final Event event;
  final String? value;

  Condition(this.event, {this.value});

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

  @override
  int get hashCode => event.hashCode;
}

class Conditions {
  // App must be in foreground to execute this job
  static final foreground = Condition(Event.appForeground, value: "1");
}

class JobOrder implements Comparable<JobOrder> {
  final DateTime when;
  final Job job;

  JobOrder(this.when, this.job);

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

  @override
  int get hashCode => job.hashCode;

  @override
  int compareTo(JobOrder other) {
    return when.compareTo(other.when);
  }
}

class SchedulerException implements Exception {
  final bool canRetry;
  final Object cause;

  SchedulerException(this.cause, {this.canRetry = false});

  @override
  String toString() {
    return "SchedulerException: $cause";
  }
}

class Scheduler with Logging {
  final List<Condition> _conditions = [];
  final List<Job> _jobs = [];
  final List<JobOrder> _next = [];
  final Map<Job, int> _failures = {};

  final SchedulerTimer timer;

  Scheduler({required this.timer}) {
    timer.callback = _timerCallback;
  }

  addOrUpdate(Job job, {bool immediate = false}) async {
    await log(job.marker).trace("addOrUpdate", (m) async {
      log(m).pair("job", job.name);
      log(m).pair("immediate", immediate);

      _jobs.removeWhere((j) => j == job);
      _jobs.add(job);
      _next.removeWhere((o) => o.job == job);
      _reschedule(job.marker, job, immediate: immediate);
      _setTimer(m);
    });
  }

  // think about if its necessary, the return bool from callback may be enough
  stop(Marker m, String jobName) async {
    await log(m).trace("stop", (m) async {
      log(m).pair("job", jobName);

      _jobs.removeWhere((j) => j.name == jobName);
      _next.removeWhere((o) => o.job.name == jobName);
      _setTimer(m);
    });
  }

  eventTriggered(Marker m, Event event, {String? value}) async {
    await log(m).trace(event.name, (m) async {
      log(m).t("Event triggered: $event, now: $value");

      final c = Condition(event, value: value);
      _conditions.remove(c);
      _conditions.add(c);

      for (final job in _jobs.toList()) {
        final when = job.when.indexOf(c);
        log(m).t("Analyze job: ${job.name}, when: $when");
        if (when == -1) continue;
        _next.removeWhere((o) => o.job == job);
        _reschedule


message = obj["error"]
        else:
            error_message = resp.text
        _LOGGER.error("Error %s: %s", resp.status_code, error_message)

    @staticmethod
    def log_error_resp_append(resp):
        """Log error response, during upload append phase."""
        obj = json.loads(resp.text)
        error_message = obj["errors"][0]["message"]
        error_code = obj["errors"][0]["code"]
        _LOGGER.error(
            "Error %s: %s (Code %s)", resp.status_code, error_message, error_code
        )


IXME: either this is not possible (assert?)
   * or it should be handled */
  if (lm != NULL) {
    switch (lm->lm_msgtype) {
    case LDAP_RES_SEARCH_ENTRY:
    case LDAP_RES_SEARCH_REFERENCE:
    case LDAP_RES_INTERMEDIATE:
      lm = NULL;
      break;

    default:
      break;
    }
  }

  if (lm == NULL) {
    errcode = ld->ld_errno = LDAP_NO_RESULTS_RETURNED;
    LDAP_MUTEX_UNLOCK(&ld->ld_res_mutex);
    goto done;
  }

  if (ld->ld_error) {
    LDAP_FREE(ld->ld_error);
    ld->ld_error = NULL;
  }
  if (ld->ld_matched) {
    LDAP_FREE(ld->ld_matched);
    ld->ld_matched = NULL;
  }
  if (ld->ld_referrals) {
    LDAP_VFREE(ld->ld_referrals);
    ld->ld_referrals = NULL;
  }

  /* parse results */

  ber = ber_dup(lm->lm_ber);

  if (ld->ld_version < LDAP_VERSION2) {
    tag = ber_scanf(ber, "{iA}", &ld->ld_errno, &ld->ld_error);

  } else {
    ber_len_t len;

    tag = ber_scanf(ber, "{iAA" /*}*/, &ld->ld_errno, &ld->ld_matched, &ld->ld_error);

    if (tag != LBER_ERROR) {
      /* peek for referrals */
      if (ber_peek_tag(ber, &len) == LDAP_TAG_REFERRAL) {
        tag = ber_scanf(ber, "v", &ld->ld_referrals);
      }
    }

    /* need to clean out misc items */
    if (tag != LBER_ERROR) {
      if (lm->lm_msgtype == LDAP_RES_BIND) {
        /* look for sasl result credentials */
        if (ber_peek_tag(ber, &len) == LDAP_TAG_SASL_RES_CREDS) {
          /* skip 'em */
          tag = ber_scanf(ber, "x");
        }

      } else if (lm->lm_msgtype == LDAP_RES_EXTENDED) {
        /* look for exop result oid or value */
        if (ber_peek_tag(ber, &len) == LDAP_TAG_EXOP_RES_OID) {
          /* skip 'em */
          tag = ber_scanf(ber, "x");
        }

        if (tag != LBER_ERROR && ber_peek_tag(ber, &len) == LDAP_TAG_EXOP_RES_VALUE) {
          /* skip 'em */
          tag = ber_scanf(ber, "x");
        }
      }
    }

    if (tag != LBER_ERROR) {
      int rc = ldap_pvt_get_controls(ber, serverctrls);

      if (rc != LDAP_SUCCESS) {
        tag = LBER_ERROR;
      }
    }

    if (tag != LBER_ERROR) {
      tag = ber_scanf(ber, /*{*/ "}");
    }
  }

  if (tag == LBER_ERROR) {
    ld->ld_errno = errcode = LDAP_DECODING_ERROR;
  }

  if (ber != NULL) {
    ber_free(ber, 0);
  }

  /* return */
  if (errcodep != NULL) {
    *errcodep = ld->ld_errno;
  }
  if (errcode == LDAP_SUCCESS) {
    if (matcheddnp != NULL) {
      if (ld->ld_matched) {
        *matcheddnp = LDAP_STRDUP(ld->ld_matched);
      }
    }
    if (errmsgp != NULL) {
      if (ld->ld_error) {
        *errmsgp = LDAP_STRDUP(ld->ld_error);
      }
    }

    if (referralsp != NULL) {
      *referralsp = ldap_value_dup(ld->ld_referrals);
    }
  }
  LDAP_MUTEX_UNLOCK(&ld->ld_res_mutex);

done:
  if (freeit) {
    ldap_msgfree(r);
  }

  return errcode;
}


5,3",
				"mouse,rightx5, 7,3",
				"mouse,rightx6, 9,3"
			],
			result:
				"pzprv3/hakoiri/2/5/1/0 0 0 0 0 /0 0 0 0 0 /. . . . . /. . . . . /1 2 3 + . /+ 3 2 1 . /"
		},
		{
			input: [
				"cursor,0,0",
				"mouse,right, 7,1, 1,1",
				"mouse,right, 7,3, 1,3",
				"mouse,right, 9,1, 5,1"
			],
			result:
				"pzprv3/hakoiri/2/5/1/0 0 0 0 0 /0 0 0 0 0 /. . . . . /. . . . . /. . + + + /+ + + + . /"
		}
	]
});
/* akichi.js */

ui.debug.addDebugData("akichi", {
	url: "6/6/lll199007rs11434g1g0",
	failcheck: [
		[
			"brNoShade",
			"pzprv3/akichi/6/6/8/0 1 1 2 2 3 /0 1 1 2 2 3 /0 1 1 2 2 3 /4 4 4 4 4 3 /5 5 6 6 6 3 /5 5 6 6 6 7 /1 4 . 3 . 4 /. . . . . . /. . . . . . /. . . . . . /1 . . . . . /. . . . . 0 /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /. . . . . . /",
			{ skiprules: true }
		],
		[
			"cuRoomLt",
			"pzprv3/akichi/6/6/8/0 1 1 2 2 3 /0 1 1 2 2 3 /0 1 1 2 2 3 /4 4 4 4 4 3 /5 5 6 6 6 3 /5 5 6 6 6 7 /1 4 . 3 . 4 /. . . . . . /. . . . . . /. . . . . . /1 . . . . . /. . . . . 0 /. . . . . . /. . . . . # /. . . . . . /. . . . . . /. . . . . . /. . . . . . /"
		],
		[
			"cuRoomGt",
			"pzprv3/akichi/6/6/8/0 1 1 2 2 3 /0 1 1 2 2 3 /0 1 1 2 2 3 /4 4 4 4 4 3 /5 5 6 6 6 3 /5 5 6 6 6 7 /1 4 . 3 . 4 /. . . . . . /. . . . . . /. . . . . . /1 . . . . . /. . . . . 0 /# . . . . # /. . . # . . /# . # . # . /. . . . . . /. . . . . . /. . . . . # /"
		],
		[
			"bkUnshadeConsecGt3",
			"pzprv3/akichi/6/6/8/0 1 1 2 2 3 /0 1 1 2 2 3 /0 1 1 2 2 3 /4 4 4 4 4 3 /5 5 6 6 6 3 /5 5 6 6 6 7 /1 4 . 3 . 4 /. . . . . . /. . . . . . /. . . . . . /1 . . . . . /. . . . . 0 /# . # . . # /. . . # . . /# . # . # . /. . . . . . /. # . . . . /# . . . . # /"
		],
		[
			"csAdjacent",
			"pzprv3/akichi/6/6/8/0 1 1 2 2 3 /0 1 1 2 2 3 /0 1 1 2 2 3 /4 4 4 4 4 3 /5 5 6 6 6 3 /5 5 6 6 6 7 /1 4 . 3 . 4 /. . . . . . /. . . . . . /. . . . . . /1 .


exp_token[ii]) {
            VPRINTF(ERROR, "ERROR: mailbox data mismatch actual (0x%x) expected (0x%x)\n", read_TOKEN[ii], exp_token[ii]);
            lsu_write_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP, SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP_MANUF_DBG_UNLOCK_FAIL_MASK);
            status_reg = lsu_read_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP);
            status_reg = status_reg & (SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP_MANUF_DBG_UNLOCK_IN_PROGRESS_MASK ^ 0xFFFFFFFF);
            lsu_write_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP, status_reg);
            SEND_STDOUT_CTRL( 0x1);
        };
    }
    lsu_write_32(CLP_MBOX_CSR_TAP_MODE,0);
    soc_ifc_clear_execute_reg();
    status_reg = lsu_read_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP);
    status_reg = status_reg | SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP_MANUF_DBG_UNLOCK_SUCCESS_MASK;
    lsu_write_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP, status_reg);
    VPRINTF(LOW, "\n\nCLP_CORE: set MANUF_DBG_UNLOCK_SUCCESS high...\n\n");
    status_reg = lsu_read_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP);
    status_reg = status_reg & (SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP_MANUF_DBG_UNLOCK_IN_PROGRESS_MASK ^ 0xFFFFFFFF);
    lsu_write_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_RSP, status_reg);
    // deassert in_progress
    return;
}

void main(void) {
    int argc=0;
    char *argv[1];

    VPRINTF(LOW,"----------------------------------\nCaliptra: Mimicking ROM from Subsystem!!\n----------------------------------\n");
    uint32_t status_reg = 0;
    status_reg = (lsu_read_32(CLP_SOC_IFC_REG_SS_DBG_SERVICE_REG_REQ) & SOC_IFC_REG_SS_DBG_SERVICE_REG_REQ_MANUF_DBG_UNLOCK_REQ_MASK) == SOC_IFC_REG_SS_DBG_SERVICE_REG_REQ_MANUF_DBG_UNLOCK_REQ_MASK;
    if (status_reg){
        mailbox_available();
        wait_for_token();
        compare_token();
        while(1);
    } else {
        VPRINTF(LOW, "CLP_CORE: Error because there is no MANUF DEBUG request...\n");
        SEND_STDOUT_CTRL(0xff); //End the test
    }

}


--[[
	Author: @spotco
	This script runs locally for the player of the given humanoid.
	This script triggers humanoid sound play/pause actions locally.

	The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
	immediately for the player and is replicated to all other players.

	This script is optimized to reduce network traffic through minimizing the amount of property replication.
]]--

--All sounds are referenced by this ID
local SFX = {
	Died = 0;
	Running = 1;
	Swimming = 2;
	Climbing = 3,
	Jumping = 4;
	GettingUp = 5;
	FreeFalling = 6;
	FallingDown = 7;
	Landing = 8;
	Splash = 9;
}

local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")

local Humanoid = nil
local Head = nil
--SFX ID to Sound object
local Sounds = {}
local SoundService = game:GetService("SoundService")
local soundEventFolderName = "DefaultSoundEvents"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AddCharacterLoadedEvent = nil
local RemoveCharacterEvent = nil
local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")

if useSoundDispatcher then
	if not soundEventFolder then
		soundEventFolder = Instance.new("Folder", ReplicatedStorage)
		soundEventFolder.Name = soundEventFolderName
		soundEventFolder.Archivable = false
	end

	-- Load the RemoveCharacterEvent
	RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
	if RemoveCharacterEvent == nil then
		RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
		RemoveCharacterEvent.Name = "RemoveCharacterEvent"
	end

	AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
	if AddCharacterLoadedEvent == nil then
		AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
		AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
	end

	-- Notify the server a new character has been loaded
	AddCharacterLoadedEvent:FireServer()

	-- Notify the sound dispatcher this character has left.
	game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
		RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
	end)
end

do
	local Figure = script.Parent.Parent
	Head = Figure:WaitForChild("Head")
	while not Humanoid do
		for _,NewHumanoid in pairs(Figure:GetChildren()) do
			if NewHumanoid:IsA("Humanoid") then
				Humanoid = NewHumanoid
				break
			end
		end
		if Humanoid then break end
		Figure.ChildAdded:wait()
	end
	Sounds[SFX.Died] = 			Head:WaitForChild("Died")
	Sounds[SFX.Running] = 		Head:WaitForChild("Running")
	Sounds[SFX.Swimming] = 	Head:WaitForChild("Swimming")
	Sounds[SFX.Climbing] = 	Head:WaitForChild("Climbing")
	Sounds[SFX.Jumping] = 		Head:WaitForChild("Jumping")
	Sounds[SFX.GettingUp] = 	Head:WaitForChild("GettingUp")
	Sounds[SFX.FreeFalling] = 	Head:WaitForChild("FreeFalling")
	Sounds[SFX.Landing] = 		Head:WaitForChild("Landing")
	Sounds[SFX.Splash] = 		Head:WaitForChild("Splash")

	local DefaultServerSoundEvent = nil
	if useSoundDispatcher then
		DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
	else
		Defaul


.machine	"any"
.text

.globl	poly1305_init_fpu
.type	poly1305_init_fpu,@function
.section	".opd","aw"
.align	3
poly1305_init_fpu:
.quad	.poly1305_init_fpu,.TOC.@tocbase,0
.previous
.align	6
.poly1305_init_fpu:
	stdu	1,-48(1)
	mflr	6
	std	6,64(1)

	bl	.LPICmeup

	xor	0,0,0
	mtlr	6

	lfd	8,8*0(5)
	lfd	9,8*1(5)
	lfd	10,8*2(5)
	lfd	11,8*3(5)
	lfd	12,8*4(5)
	lfd	13,8*5(5)

	stfd	8,8*0(3)
	stfd	9,8*1(3)
	stfd	10,8*2(3)
	stfd	11,8*3(3)

	cmpld	4,0
	beq-	.Lno_key

	lfd	6,8*13(5)
	mffs	7

	stfd	8,8*4(3)
	stfd	9,8*5(3)
	stfd	10,8*6(3)
	stfd	11,8*7(3)

	li	8,4
	li	9,8
	li	10,12
	lwbrx	7,0,4
	lwbrx	8,8,4
	lwbrx	9,9,4
	lwbrx	10,10,4

	lis	11,0xf000
	ori	12,11,3
	andc	7,7,11
	andc	8,8,12
	andc	9,9,12
	andc	10,10,12

	stw	7,36(3)
	stw	8,44(3)
	stw	9,52(3)
	stw	10,60(3)

	mtfsf	255,6
	stfd	8,8*18(3)
	stfd	9,8*19(3)
	stfd	10,8*20(3)
	stfd	11,8*21(3)
	stfd	12,8*22(3)
	stfd	13,8*23(3)

	lfd	0,8*4(3)
	lfd	2,8*5(3)
	lfd	4,8*6(3)
	lfd	6,8*7(3)

	fsub	0,0,8
	fsub	2,2,9
	fsub	4,4,10
	fsub	6,6,11

	lfd	8,8*6(5)
	lfd	9,8*7(5)
	lfd	10,8*8(5)
	lfd	11,8*9(5)

	fmul	3,2,13
	fmul	5,4,13
	stfd	7,8*15(3)
	fmul	7,6,13

	fadd	1,0,8
	stfd	3,8*12(3)
	fadd	3,2,9
	stfd	5,8*13(3)
	fadd	5,4,10
	stfd	7,8*14(3)
	fadd	7,6,11

	fsub	1,1,8
	fsub	3,3,9
	fsub	5,5,10
	fsub	7,7,11

	lfd	8,8*10(5)
	lfd	9,8*11(5)
	lfd	10,8*12(5)

	fsub	0,0,1
	fsub	2,2,3
	fsub	4,4,5
	fsub	6,6,7

	stfd	1,8*5(


    pub recv_buffer: Vec<u8>,
}

impl TxToken for VirtualTx {
    #[allow(unused_mut)]
    fn consume<R, F>(mut self, _timestamp: Instant, len: usize, f: F) -> NetResult<R>
    where
        F: FnOnce(&mut [u8]) -> NetResult<R>,
    {

        // hold CPU lock, so no events can occur during this time
        // timer::hold_cpu_lock();

        let mut phy_lock = PHY_ETHERNET_DRIVER.lock();
        if phy_lock.is_none() {
            log::error!("no physical interface found.");
            // timer::release_cpu_lock();
            return Err(NetError::Illegal);
        }

        let phy_dev = phy_lock.as_mut().unwrap();
        let buffer_res = phy_dev.get_current_tx_buffer();
        if buffer_res.is_err() {
            log::error!("interface error: {:?}", buffer_res.unwrap_err());
            // timer::release_cpu_lock();
            return Err(NetError::Illegal);
        }

        let buffer = &mut buffer_res.unwrap()[0..len];
        let buffer_copy_res = f(buffer);

        if buffer_copy_res.is_err() {
            log::error!("interface error: failed to copy packet to DMA buffer");
            // timer::release_cpu_lock();
            return Err(NetError::Illegal);
        }

        let transmit_result = phy_dev.transmit_and_wait(buffer, len);
        if transmit_result.is_err() {
            log::error!("interface error: {:?}", transmit_result.unwrap_err());
            // timer::release_cpu_lock();
            return Err(NetError::Illegal);
        }

        // timer::release_cpu_lock();
        Ok(buffer_copy_res.unwrap())
    }
}

impl RxToken for VirtualRx {
    #[allow(unused_mut)]
    fn consume<R, F>(mut self, _timestamp: Instant, f: F) -> NetResult<R>
    where
        F: FnOnce(&mut [u8]) -> NetResult<R>,
    {
        f(&mut self.recv_buffer)
    }
}

impl VirtualNetworkDevice {
    pub fn is_loopback(&self) -> bool {
        self.is_in_loopback
    }
}

impl<'a> Device<'a> for VirtualNetworkDevice {
    type TxToken = VirtualTx;
    type RxToken = VirtualRx;

    fn receive(&'a mut self) -> Option<(Self::RxToken, Self::TxToken)> {
        let mut phy_dev_lock = PHY_ETHERNET_DRIVER.lock();

        if let Some(phy_dev) = phy_dev_lock.as_mut() {
            if let Ok(true) = phy_dev.is_polling_enabled() {
                // poll for frame
                let poll_result = phy_dev.poll_for_frame(MAX_POLL_CYCLES);
                if let Ok(buffer) = poll_result {
                    let recv_buffer = buffer.to_vec();
                    return Some((VirtualRx { recv_buffer }, VirtualTx {}));
                }
            } else {
                if let Ok(recv_buffer) = types::NETWORK_IFACE_QUEUE.lock().pop() {
                    return Some((VirtualRx { recv_buffer }, VirtualTx {}));
                }
            }
        }
        None
    }

    fn transmit(&'a mut self) -> Option<Self::TxToken> {
        Some(VirtualTx {})
    }

    fn capabilities(&self) -> DeviceCapabilities {
        let mut caps = DeviceCapabilities::default();

        let dev_lock = PHY_ETHERNET_DRIVER.lock();

        caps.max_transmission_unit = if dev_lock.is_none() {
            N


_EXT = 0x80E4,
//GL_COLOR_INDEX8_EXT = 0x80E5,
//GL_COLOR_INDEX12_EXT = 0x80E6,
//GL_COLOR_INDEX16_EXT = 0x80E7,
GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED,
//GL_TEXTURE_CUBE_MAP_ARB = 0x8513,
//GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B,
GL_PIXEL_PACK_BUFFER_EXT = 0x88EB,
GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC,
GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED,
GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF,
GL_PIXEL_TRANSFORM_2D_EXT = 0x8330,
GL_PIXEL_MAG_FILTER_EXT = 0x8331,
GL_PIXEL_MIN_FILTER_EXT = 0x8332,
GL_PIXEL_CUBIC_WEIGHT_EXT = 0x8333,
GL_CUBIC_EXT = 0x8334,
GL_AVERAGE_EXT = 0x8335,
GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336,
GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337,
GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338,
GL_POINT_SIZE_MIN_EXT = 0x8126,
GL_POINT_SIZE_MAX_EXT = 0x8127,
GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128,
GL_DISTANCE_ATTENUATION_EXT = 0x8129,
GL_POLYGON_OFFSET_EXT = 0x8037,
GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038,
GL_POLYGON_OFFSET_BIAS_EXT = 0x8039,
GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B,
GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C,
GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D,
GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E,
GL_PROVOKING_VERTEX_EXT = 0x8E4F,
GL_COLOR_SAMPLES_NV = 0x8E20,
GL_RASTER_MULTISAMPLE_EXT = 0x9327,
GL_RASTER_SAMPLES_EXT = 0x9328,
GL_MAX_RASTER_SAMPLES_EXT = 0x9329,
GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A,
GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B,
GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C,
GL_DEPTH_SAMPLES_NV = 0x932D,
GL_STENCIL_SAMPLES_NV = 0x932E,
GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F,
GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330,
GL_COVERAGE_MODULATION_TABLE_NV = 0x9331,
GL_COVERAGE_MODULATION_NV = 0x9332,
GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333,
GL_RESCALE_NORMAL_EXT = 0x803A,
GL_COLOR_SUM_EXT = 0x8458,
GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459,
GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A,
GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B,
GL_SECONDARY_


#!/usr/bin/python
# -*- encoding: utf-8 -*-
# File    :   data_collection.py
# Time    :   2025/06/13 19:57:16
# Author  :   Y.ZHANG (UniOfSurrey)
# Email   :   yu.zhang@surrey.ac.uk

# This code is used to collect data from multiple Excel files and calculate the average improvement of a benchmark function across multiple iterations.

import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
from combine_imp import create_analysis_excel

# load the data from the file
def load_data(file_path, benchmark):
    # load the sheet names of the Excel file
    xls = pd.ExcelFile(file_path)
    sheet_names = xls.sheet_names
    df_list = []
    print(f"Available sheets: {sheet_names}")
    # load the data from the specified sheet and save to a DataFrame
    for sheet in sheet_names:
        print(f"Loading data from sheet: {sheet}")
        df = pd.read_excel(file_path, sheet_name=sheet)
        # select the columns based on the benchmark
        df_list.append(df[benchmark].values)

    return df_list

def run_loop(iter, benchmark, method, dim, file_path_save, path):
    all_dfs = []
    for i in range(1, iter + 1):
        file_path = f"{path}\\RUN-{i}-{method}-{dim}D\\Top-RUN{i}-{method}-{dim}D_{benchmark}_result.xlsx"   # PROPOSED
        # file_path = f"{path}\\RUN-{i}-{method}\\Top-RUN{i}-{method}_{benchmark}_result.xlsx"

        data = load_data(file_path, benchmark)
        data = np.concatenate(data).reshape(-1, 1)
        df = pd.DataFrame(data, columns=[f"iter-{i}"])
        all_dfs.append(df)

    # Merge all df into the same DataFrame, with different columns for different iterations
    result_df = pd.concat(all_dfs, axis=1)
    # Save to the same sheet
    with pd.ExcelWriter(file_path_save, engine='openpyxl', mode='w') as writer:
        result_df.to_excel(writer, sheet_name=method, index=False)
    print(f"All iterations saved to {file_path_save} in sheet '{method}'.")

if __name__ == "__main__":

    path = "Multi-Objective Optimisation\Benchmark\Package Module-III-sphere\Dataset"
    method = "RANDOM"  # or "PROPOSED", depending on the method
    iter = 30
    dim = 5  # Dimensions
    alpha = 0.5
    benchmark = "Ackley"  # or "Zakharov", depending on the benchmark function
    # file_path_save = f"Multi-Objective Optimisation\Benchmark\Package Module-III-sphere\Ave_Improve\\{method}_improvement_analysis_a-{alpha}.xlsx"
    file_path_save = f"Multi-Objective Optimisation\Benchmark\Package Module-III-sphere\Ave_Improve\\{method}_improvement_analysis_a-{alpha}-{dim}D.xlsx"
    # file_path_save = f"Multi-Objective Optimisation\Benchmark\Package Module-III-sphere\Ave_Improve\\{method}_improvement_analysis.xlsx"

    # Run the loop to process data
    run_loop(iter, benchmark, method, dim, file_path_save, path)

    # Create the analysis Excel file with the initial structure
    create_analysis_excel(file_path_save, method, alpha, dim)


.include "source/macros_asm.s"

.word 2 @ # of Furnitures
@ Script, ?, ?, ?, ?, ?, Z, ?, Orientation, ?
.hword 21, 0, 59, 0, 712, 0, 0, 0, 0, 0
.hword 8218, 2, 36, 0, 753, 0, 0, 0, 4, 0

.word 19 @ # of Overworlds
@     ID,        Overworld, Movement, Trainer, Flag, Script, Orientation, Sight, ?, ?, Movement Width, Movement Length, X (Matrix,Map), Y (Matrix,Map), Z, ?
.hword  0,         SPRITE_FATGUY,  3, 0,    0,     8,    ORIENT_UP, 0, 0, 0, 1, 1,  1 << 5 | 26, 23 << 5 | 13, 0, 1
.hword  1,           SPRITE_LASS, 15, 0,    0,    11,  ORIENT_LEFT, 0, 0, 0, 1, 1,  1 << 5 | 20, 22 << 5 | 13, 0, 1
.hword  2,    SPRITE_GENERICMALE,  3, 0,    0,     9, ORIENT_RIGHT, 0, 0, 0, 2, 1,  1 << 5 | 27, 22 << 5 | 24, 0, 1
.hword  3, SPRITE_ACETRAINERFEMALE,  4, 0,    0,    10,  ORIENT_DOWN, 0, 0, 0, 0, 1,  1 << 5 |  1, 22 << 5 | 26, 0, 1
.hword  4,                    93,  0, 0,    0,    16,    ORIENT_UP, 0, 0, 0, 0, 0,  1 << 5 |  3, 22 << 5 | 18, 0, 0
.hword  5,                    95,  0, 0,    0,    15,    ORIENT_UP, 0, 0, 0, 0, 0,  1 << 5 |  4, 22 << 5 | 28, 0, 0
.hword  6,                    93,  0, 0,    0,    18,    ORIENT_UP, 0, 0, 0, 0, 0,  1 << 5 |  9, 23 << 5 | 16, 0, 0
.hword  7,       SPRITE_SIGNPOST,  0, 0,    0,    14,    ORIENT_UP, 9, 0, 0, 0, 0,  1 << 5 | 22, 23 << 5 | 18, 0, 0
.hword  8,                    93,  0, 0,    0,    17,    ORIENT_UP, 0, 0, 0, 0, 0,  1 << 5 |  5, 23 << 5 | 12, 0, 0
.hword  9,                    74,  0, 0,    0,    12,  ORIENT_DOWN, 0, 0, 0, 1, 1,  1 << 5 | 20, 22 << 5 | 14, 0, 1
.hword 10,                   164,  5, 0,    0,    13,  ORIENT_LEFT, 0, 0, 0, 1, 1,  1 << 5 |  9, 22 << 5 | 31, 0, 1


0, 2($a0)
/* 12A4CC 8018305C A4623F02 */  sh    $v0, 0x3f02($v1)
/* 12A4D0 80183060 A4820004 */  sh    $v0, 4($a0)
/* 12A4D4 80183064 A4623F04 */  sh    $v0, 0x3f04($v1)
/* 12A4D8 80183068 A4820006 */  sh    $v0, 6($a0)
/* 12A4DC 8018306C 24630008 */  addiu $v1, $v1, 8
/* 12A4E0 80183070 A4623EFE */  sh    $v0, 0x3efe($v1)
/* 12A4E4 80183074 1465FFF6 */  bne   $v1, $a1, .L80183050_ovl5
/* 12A4E8 80183078 24840008 */   addiu $a0, $a0, 8
/* 12A4EC 8018307C 0C001CE0 */  jal   func_80007380
/* 12A4F0 80183080 00C02025 */   move  $a0, $a2
/* 12A4F4 80183084 8FBF0014 */  lw    $ra, 0x14($sp)
/* 12A4F8 80183088 27BD0018 */  addiu $sp, $sp, 0x18
/* 12A4FC 8018308C 03E00008 */  jr    $ra
/* 12A500 80183090 00000000 */   nop

/* 12A504 80183094 00000000 */  nop
/* 12A508 80183098 00000000 */  nop
/* 12A50C 8018309C 00000000 */  nop

.type func_80182FE8_ovl5, @function
.size func_80182FE8_ovl5, . - func_80182FE8_ovl5