(console,"\x1B[32m",Nn("TRACE")))},Nn=t=>`%c${Xn().format("ss.SSS")} : ${t} : `;var O0={};Object.defineProperty(O0,"__esModule",{value:!0});var ki=O0.sanitizeUrl=void 0,bR=/^([^\w]*)(javascript|data|vbscript)/im,_R=/&#(\w+)(^\w|;)?/g,vR=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,xR=/^([^:]+):/gm,kR=[".","/"];function wR(t){return kR.indexOf(t[0])>-1}function TR(t){return t.replace(_R,function(e,r){return String.fromCharCode(r)})}function ER(t){var e=TR(t||"").replace(vR,"").trim();if(!e)return"about:blank";if(wR(e))return e;var r=e.match(xR);if(!r)return e;var n=r[0];return bR.test(n)?"about:blank":e}ki=O0.sanitizeUrl=ER;function Qe(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function m_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ku(t){let e,r,n;t.length!==2?(e=Qe,r=(o,l)=>Qe(t(o),l),n=(o,l)=>t(o)-l):(e=t===Qe||t===m_?t:CR,r=t,n=t);function i(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<0?u=d+1:h=d}while(u<h)}return u}function a(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<=0?u=d+1:h=d}while(u<h)}return u}function s(o,l,u=0,h=o.length){const d=i(o,l,u,h-1);return d>u&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function CR(){return 0}function b_(t){return t===null?NaN:+t}function*__(t,e){if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of t)(n=e(n,++r,t))!=null&&(n=+n)>=n&&(yield n)}}const v_=ku(Qe),x_=v_.right,SR=v_.left,AR=ku(b_).center,cs=x_;function MR(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let r=t.length;if(!((r=Math.floor(r))>=0))throw new RangeError("invalid length");if(!r||!e)return t;const n=F0(e),i=t.slice();return n(t,i,0,r,1),n(i,t,0,r,1),n(t,i,0,r,1),t}


LID");
//	for (unsigned int i=0x160; i<length; i+=4)
//	{
//		unsigned_int &x = ((unsigned_int *)&header)[i/4];
//		if (x != 0) printf("0x%02X\t%-25s\t0x%08X\n", i, "?", (int)x);
//	}
//}
//
///*
// * HeaderSha1
// */
//void HeaderSha1(FILE *fNDS, unsigned char *header_sha1, int romType)
//{
//	sha1_ctx m_sha1;
//	sha1_begin(&m_sha1);
//	unsigned char buf[32 + 0x200];
//	fseek(fNDS, 0x200, SEEK_SET);		// check for 32 bytes text + alternate header
//	fread(buf, 1, sizeof(buf), fNDS);
//	if (!memcmp(buf, "DS DOWNLOAD PLAY", 16))	// found?
//	{
//		sha1_hash(buf + 0x20, 0x160, &m_sha1);	// alternate header
//		if (verbose >= 2)
//		{
//			printf("{ DS Download Play(TM) / Wireless MultiBoot header information:\n");
//			ShowHeaderInfo(*(Header *)(buf + 0x20), romType, 0x160);
//			printf("}\n");
//		}
//	}
//	else
//	{
//		fseek(fNDS, 0, SEEK_SET);
//		fread(buf, 1, sizeof(buf), fNDS);
//		sha1_hash(buf, 0x160, &m_sha1);
//	}
//	sha1_end(header_sha1, &m_sha1);
//}
//
///*
// * Arm9Sha1Multiboot
// */
//void Arm9Sha1Multiboot(FILE *fNDS, unsigned char *arm9_sha1)
//{
//	sha1_ctx m_sha1;
//	sha1_begin(&m_sha1);
//	fseek(fNDS, header.arm9_rom_offset, SEEK_SET);
//	unsigned int len = header.arm9_size;
//	unsigned char *buf = new unsigned char [len];
//	fread(buf, 1, len, fNDS);
//	//printf("%u\n", len);
//	sha1_hash(buf, len, &m_sha1);
//	delete [] buf;
//	sha1_end(arm9_sha1, &m_sha1);
//}
//
///*
// * Arm9Sha1ClearedOutArea
// */
//void Arm9Sha1ClearedOutArea(FILE *fNDS, unsigned char *arm9_sha1)
//{
//	sha1_ctx m_sha1;
//	sha1_begin(&m_sha1);
//	fseek(fNDS, header.arm9_rom_offset, SEEK_SET);
//	unsigned int len = header.arm9_size;
//	unsigned char *buf = new unsigned char [len];
//
//	int len1 = (0x5000 - header.arm9_rom_offset);		// e.g. 0x5000 - 0x4000 = 0x1000
//	int len3 = header.arm9_size - (0x7000 - header.arm9_rom_offset);	// e.g. 0x10000 - (0x7000 - 0x4000) = 0xD000
//	int len2 = header.arm9_size - len1 - len3;			// e.g. 0x10000 - 0x1000 - 0xD000 = 0x2000
//	if (len1 > 0) fread(buf, 1, len1, fNDS);
//	if (len2 > 0) { memset(buf + len1, 0, len2); fseek(fNDS, len2, SEEK_CUR); }		// gets cleared for security?
//	if (len


rd
    if (hlsl::IsHLSLNodeOutputType(ParamType)) {
      // Node records are template types
      if (RecordDecl *NodeStructDecl =
              hlsl::GetRecordDeclFromNodeObjectType(ParamType)) {
        // Diagnose any SV_DispatchGrid semantics used in record.
        bool OutputFound = false;
        DiagnoseDispatchGridSemantics(S, NodeStructDecl, PD->getLocation(),
                                      OutputFound);
      }
    }
  }

  if (!FD->getReturnType()->isVoidType())
    S.Diag(FD->getLocation(), diag::err_shader_must_return_void) << StageName;

  // Check parameter constraints
  for (unsigned Idx = 0; Idx < FD->getNumParams(); ++Idx) {
    ParmVarDecl *Param = FD->getParamDecl(Idx);
    clang::QualType ParamTy = Param->getType();

    auto *MaxRecordsAttr = Param->getAttr<HLSLMaxRecordsAttr>();
    auto *MaxRecordsSharedWithAttr =
        Param->getAttr<HLSLMaxRecordsSharedWithAttr>();
    auto *AllowSparseNodesAttr = Param->getAttr<HLSLAllowSparseNodesAttr>();
    auto *NodeArraySizeAttr = Param->getAttr<HLSLNodeArraySizeAttr>();
    auto *UnboundedSparseNodesAttr =
        Param->getAttr<HLSLUnboundedSparseNodesAttr>();
    // Check any node input is compatible with the node launch type
    if (hlsl::IsHLSLNodeInputType(ParamTy)) {
      InputCount++;
      if (NodeLaunchTy != DXIL::NodeLaunchType::Invalid &&
          !nodeInputIsCompatible(GetNodeIOType(Param->getType()),
                                 NodeLaunchTy)) {
        const RecordType *RT = Param->getType()->getAs<RecordType>();
        S.Diags.Report(Param->getLocation(), diag::err_hlsl_wg_input_kind)
            << RT->getDecl()->getName()
            << ShaderModel::GetNodeLaunchTypeName(NodeLaunchTy)
            << (static_cast<unsigned>(NodeLaunchTy) - 1)
            << Param->getSourceRange();
        if (NodeLaunchLoc.isValid())
          S.Diags.Report(NodeLaunchLoc, diag::note_defined_here)
              << "Launch type";
      }
      if (InputCount > 1)
        S.Diags.Report(Param->getLocation(),
                       diag::err_hlsl_too_many_node_inputs)
            << FD->getName() << Param->getSourceRange();

      if (MaxRecordsAttr && NodeLaunchTy != DXIL::NodeLaunchType::Coalescing) {
        S.Diags.Report(MaxRecordsAttr->getLocation(),
                       diag::err_hlsl_maxrecord_on_wrong_launch)
            << MaxRecordsAttr->getRange();
      }
    } else if (hlsl::IsHLSLNodeOutputType(ParamTy)) {
      // If node output is not an array, diagnose array only attributes
      if (((uint32_t)GetNodeIOType(ParamTy) &
           (uint32_t)DXIL::NodeIOFlags::NodeArray) == 0) {
        Attr *ArrayAttrs[] = {NodeArraySizeAttr, UnboundedSparseNodesAttr};
        for (auto *A : ArrayAttrs) {
          if (A) {
            S.Diags.Report(A->getLocation(),
                           diag::err_hlsl_wg_attr_only_on_output_array)
                << A << A->getRange();
          }
        }
      }
    } else {
      if (MaxRecordsAttr) {
        S.Diags.Report(MaxRecordsAttr->getLocation(),
                       diag::err_hlsl_wg_attr_only_on_output_or_input_record)
            << MaxRecordsAttr << MaxRecordsAttr->getRange();
      }
    }

    if (!hlsl::IsHLSLNodeOutputType(ParamTy)) {
      Attr *OutputOnly[] = {MaxRecordsSharedWithAttr, AllowSparseNodesAttr,
                            NodeArraySizeAttr, UnboundedSparseNodesAttr};
      for (auto *A : OutputOnly


double m21 = m1.m20 * m2.m10 + m1.m21 * m2.m11 + m1.m22 * m2.m12 + m1.m23 * m2.m13;
            double m22 = m1.m20 * m2.m20 + m1.m21 * m2.m21 + m1.m22 * m2.m22 + m1.m23 * m2.m23;
            double m23 = m1.m20 * m2.m30 + m1.m21 * m2.m31 + m1.m22 * m2.m32 + m1.m23 * m2.m33;
            double m30 = m1.m30 * m2.m00 + m1.m31 * m2.m01 + m1.m32 * m2.m02 + m1.m33 * m2.m03;
            double m31 = m1.m30 * m2.m10 + m1.m31 * m2.m11 + m1.m32 * m2.m12 + m1.m33 * m2.m13;
            double m32 = m1.m30 * m2.m20 + m1.m31 * m2.m21 + m1.m32 * m2.m22 + m1.m33 * m2.m23;
            double m33 = m1.m30 * m2.m30 + m1.m31 * m2.m31 + m1.m32 * m2.m32 + m1.m33 * m2.m33;
            this.m00 = m00;
            this.m01 = m01;
            this.m02 = m02;
            this.m03 = m03;
            this.m10 = m10;
            this.m11 = m11;
            this.m12 = m12;
            this.m13 = m13;
            this.m20 = m20;
            this.m21 = m21;
            this.m22 = m22;
            this.m23 = m23;
            this.m30 = m30;
            this.m31 = m31;
            this.m32 = m32;
            this.m33 = m33;
        }
    }

    public final void mulTransposeLeft(Matrix4d m1, Matrix4d m2) {
        if (this != m1 && this != m2) {
            this.m00 = m1.m00 * m2.m00 + m1.m10 * m2.m10 + m1.m20 * m2.m20 + m1.m30 * m2.m30;
            this.m01 = m1.m00 * m2.m01 + m1.m10 * m2.m11 + m1.m20 * m2.m21 + m1.m30 * m2.m31;
            this.m02 = m1.m00 * m2.m02 + m1.m10 * m2.m12 + m1.m20 * m2.m22 + m1.m30 * m2.m32;
            this.m03 = m1.m00 * m2.m03 + m1.m10 * m2.m13 + m1.m20 * m2.m23 + m1.m30 * m2.m33;
            this.m10 = m1.m01 * m2.m00 + m1.m11 * m2.m10 + m1.m21 * m2.m20 + m1.m31 * m2.m30;
            this.m11 = m1.m01 * m2.m01 + m1.m11 * m2.m11 + m1.m21 * m2.m21 + m1.m31 * m2.m31;
            this.m12 = m1.m01 * m2.m02 + m1.m11 * m2.m12


#!/usr/bin/env python3
# coding: utf-8

# Copyright (C) 2017-present Robert Griesel
# 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/>

from lemma.document_repo.document_repo import DocumentRepo
from lemma.application_state.application_state import ApplicationState
from lemma.use_cases.use_cases import UseCases
import lemma.services.timer as timer

class CursorState():

    def __init__(self, main_window):
        self.toolbar = main_window.toolbar

    @timer.timer
    def update(self):
        self.update_tags_and_link_at_cursor()
        self.update_paragraph_style_at_cursor()
        self.update_tag_toggle(self.toolbar.toolbar_main.bold_button, 'bold')
        self.update_tag_toggle(self.toolbar.toolbar_main.italic_button, 'italic')

    @timer.timer
    def update_tags_and_link_at_cursor(self):
        document = DocumentRepo.get_active_document()

        if document == None:
            UseCases.app_state_set_values({'tags_at_cursor': set(), 'link_at_cursor': None})
        else:
            node = document.cursor.get_insert_node()
            prev_node = node.prev_in_parent()

            if node == None or prev_node == None:
                UseCases.app_state_set_values({'tags_at_cursor': set(), 'link_at_cursor': None})
            else:
                if node.link == prev_node.link:
                    UseCases.app_state_set_values({'tags_at_cursor': prev_node.tags.copy(), 'link_at_cursor': node.link})
                else:
                    UseCases.app_state_set_values({'tags_at_cursor': prev_node.tags.copy(), 'link_at_cursor': None})

    def update_tag_toggle(self, button, tagname):
        document = DocumentRepo.get_active_document()
        if document == None: return

        chars_selected = False
        all_tagged = True
        if document.cursor.has_selection():
            for node in [node for node in document.ast.get_subtree(*document.cursor.get_state()) if node.type == 'char']:
                chars_selected = True
                if tagname not in node.tags:
                    all_tagged = False
                    break

        if chars_selected:
            if all_tagged:
                button.add_css_class('checked')
            else:
                button.remove_css_class('checked')
        else:
            if tagname in ApplicationState.get_value('tags_at_cursor'):
                button.add_css_class('checked')
            else:
                button.remove_css_class('checked')

    @timer.timer
    def update_paragraph_style_at_cursor(self):
        document = DocumentRepo.get_active_document()
        if document == None: return

        current_node = document.cursor.get_first_node()
        paragraph_style_at_cursor = current_node.get_paragraph_style()

        labels_dict = {'p': _('Paragraph'), 'h1': _('Heading 2'), 'h2': _('Heading 2'), 'h3': _('Heading 3'), 'h4': _('Heading 4'), 'h5': _('Heading 5'), 'h6': _('Heading 6')}
        self.toolbar.toolbar_main.paragraph_style_menu_button_label.set_text(labels_dict[paragraph_style_at_cursor])


create_UIBox_HUD(),
            --             config = {align=('cli'), offset = {x=-1.3,y=0},major = G.ROOM_ATTACH}
            --         }
            --         for i, v in pairs(G.hand_text_area) do
            --             G.hand_text_area[i] = G.HUD:get_UIE_by_ID(v.config.id)
            --         end
            --         G.HUD_blind:remove()
            --         G.HUD_blind = UIBox{
            --              definition = create_UIBox_HUD_blind_doc(),
            --              config = {major = G.HUD:get_UIE_by_ID('row_blind'), align = 'cm', offset = {x=0,y=-10}, bond = 'Weak'}
            --         }
            --         G.HUD:recalculate()
            --         G.HUD_blind:recalculate()
            --         return true
            --     end
            -- }))
        end
    end
    if c1.config and c1.config.center and c1.config.center.config and c1.config.center.config and c1.config.center.config.cry_beta then
        local count = G.consumeables.config.card_limit
        local cards = {}
        for i, v in pairs(G.jokers.cards) do
            cards[#cards+1]=v
        end
        for i, v in pairs(G.consumeables.cards) do
            cards[#cards+1]=v
        end
        for i, v in pairs(cards) do
            v.area:remove_card(v)
            v:remove_from_deck()
        end
        G.consumeables:remove()
        count = count + G.jokers.config.card_limit
        G.jokers:remove()
        G.consumeables = nil
        local CAI = {
            discard_W = G.CARD_W,
            discard_H = G.CARD_H,
            deck_W = G.CARD_W*1.1,
            deck_H = 0.95*G.CARD_H,
            hand_W = 6*G.CARD_W,
            hand_H = 0.95*G.CARD_H,
            play_W = 5.3*G.CARD_W,
            play_H = 0.95*G.CARD_H,
            joker_W = 4.9*G.CARD_W,
            joker_H = 0.95*G.CARD_H,
            consumeable_W = 2.3*G.CARD_W,
            consumeable_H = 0.95*G.CARD_H
        }
        G.jokers = CardArea(
            CAI.consumeable_W, 0,
            CAI.joker_W+CAI.consumeable_W,
            CAI.joker_H,
            {card_limit = count, type = 'joker', highlight_limit = 1e100}
        )
        G.consumeables = G.jokers
        for i, v in pairs(cards) do
            v:add_to_deck()
            G.jokers:emplace(v)
        end
    end
    G.GAME.entr_bought_decks = G.GAME.entr_bought_decks or {}
    G.GAME.entr_bought_decks[#G.GAME.entr_bought_decks+1] = c1.config.center.key
    c1:start_dissolve()
    if c1.children.price then c1.children.price:remove() end
    c1.children.price = nil
    if c1.children.buy_button then c1.children.buy_button:remove() end
    c1.children.buy_button = nil


 final value =
            IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53.fromJson(row);
        if (value != null) {
          result.add(value);
        }
      }
    }
    return result.toList(growable: growable);
  }

  static Map<String, IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53>
      mapFromJson(dynamic json) {
    final map = <String, IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53>{};
    if (json is Map && json.isNotEmpty) {
      json = json.cast<String, dynamic>(); // ignore: parameter_assignments
      for (final entry in json.entries) {
        final value =
            IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53.fromJson(
                entry.value);
        if (value != null) {
          map[entry.key] = value;
        }
      }
    }
    return map;
  }

  // maps a json object with a list of IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53-objects as value to a dart map
  static Map<String, List<IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53>>
      mapListFromJson(
    dynamic json, {
    bool growable = false,
  }) {
    final map =
        <String, List<IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53>>{};
    if (json is Map && json.isNotEmpty) {
      // ignore: parameter_assignments
      json = json.cast<String, dynamic>();
      for (final entry in json.entries) {
        map[entry.key] =
            IoCertManagerAcmeV1ChallengeSpecSolverDns01Route53.listFromJson(
          entry.value,
          growable: growable,
        );
      }
    }
    return map;
  }

  /// The list of required keys that must be present in a JSON.
  static const requiredKeys = <String>{
    'region',
  };
}
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18

// ignore_for_file: require_trailing_commas
// ignore_for_file: unused_element
// ignore_for_file: unnecessary_this
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: avoid_function_literals_in_foreach_calls

import 'package:kubenav/models/kubernetes/helpers.dart';

class IoCertManagerV1CertificateStatusConditionsInner {
  /// Returns a new [IoCertManagerV1CertificateStatusConditionsInner] instance.
  IoCertManagerV1CertificateStatusConditionsInner({
    this.lastTransitionTime,
    this.message,
    this.observedGeneration,
    this.reason,
    required this.status,
    required this.type,
  });

  /// LastTransitionTime is the timestamp corresponding to the last status change of this condition.
  ///
  /// Please note: This property should have been non-nullable! Since the specification file
  /// does not include a default value (using the "default:" property), however, the generated
  /// source code must fall back to having a nullable type.
  /// Consider adding a "default:" property in the specification file to hide this note.
  ///
  DateTime? lastTransitionTime;

  /// Message is a human readable description of the details of the last transition, complementing reason.
  ///
  /// Please note: This property should have been non-nullable! Since the specification file
  /// does not include a default value (using the "default:" property), however, the generated
  /// source code must fall back to having a nullable type.
  /// Consider adding a


def delete_null_user_daily_counters(apps, *args):
    """
    Find any DailyXFormCounters without a user, assign them to a user if we can, otherwise delete them
    This function is reused between two migrations, logger.0030 and logger.0031.
    If/when those migrations get squashed, please delete this function
    """
    DailyXFormSubmissionCounter = apps.get_model('logger', 'DailyXFormSubmissionCounter')  # noqa

    counters_without_users = DailyXFormSubmissionCounter.objects.filter(user=None)

    if not counters_without_users.exists():
        return

    # Associate each daily counter with user=None with a user based on its xform
    batch = []
    batch_size = 5000
    for counter in (
            counters_without_users
            .exclude(xform=None)
            .exclude(xform__user=None)
            .iterator(chunk_size=batch_size)
    ):
        counter.user = counter.xform.user
        # don't add a user to duplicate counters, so they get deleted when we're done looping
        if DailyXFormSubmissionCounter.objects.filter(
                date=counter.date, xform=counter.xform
        ).exclude(user=None).exists():
            continue
        batch.append(counter)
        if len(batch) >= batch_size:
            DailyXFormSubmissionCounter.objects.bulk_update(batch, ['user_id'])
            batch = []
    if batch:
        DailyXFormSubmissionCounter.objects.bulk_update(batch, ['user_id'])

    # Delete daily counters without a user to avoid creating invalid monthly counters
    DailyXFormSubmissionCounter.objects.filter(user=None).delete()


nfo(idx);
      if (globalVar && !globalVar->isConst())
      {
        logerr("daScript: Global variable '%s' in script <%s>."
               "This script contains multithreaded systems and shouldn't have global variables",
          globalVar->name, fname.c_str());
        return false;
      }
    }
  }

  if (!script.ctx->persistent)
  {
    const uint64_t heapBytes = script.ctx->heap->bytesAllocated();
    const uint64_t stringHeapBytes = script.ctx->stringHeap->bytesAllocated();
    if (heapBytes > 0)
      logerr("daScript: script <%s> allocated %@ bytes for global variables", fname.c_str(), heapBytes);
    if (stringHeapBytes > 0)
    {
      das::string strings = "";
      script.ctx->stringHeap->forEachString([&](const char *str) {
        if (strings.length() < 250)
          strings.append_sprintf("%s\"%s\"", strings.empty() ? "" : ", ", str);
      });
      logerr("daScript: script <%s> allocated %@ bytes for global strings. Allocated strings: %s", fname.c_str(), stringHeapBytes,
        strings.c_str());
    }
    if (heapBytes > 0 || stringHeapBytes > 0)
      script.ctx->useGlobalVariablesMem();
  }
  return true;
}

void Scripts::unloadAllScripts(UnloadDebugAgents unload_debug_agents)
{
#if DAS_HAS_DIRECTORY_WATCH
  dirsOpened.clear();
#endif
  scripts.clear();
  das::Module::Reset(/*reset_debug_agent*/ unload_debug_agents == UnloadDebugAgents::YES);
  clearStatistics();
  moduleFileAccess.clear();
  sandboxModuleFileAccess.clear();
  scriptsMemory.clear();
  sharedQueries.clear();
  helper.clear();
#if DAGOR_DBGLEVEL > 0
  argStrings.clear();
#endif
}
size_t Scripts::dumpMemory()
{
  size_t globals = 0, stack = 0, code = 0, codeTotal = 0, debugInfo = 0, debugInfoTotal = 0, constStrings = 0, constStringsTotal = 0,
         heap = 0, heapTotal = 0, string = 0, stringTotal = 0, shared = 0, unique = 0;
  for (const auto &sc : scripts)
  {
    auto &s = sc.second;
    // globals += s.ctx->globalsSize;//currently is protected!
    globals = 0;
    stack += s.ctx->stack.size();
    code += s.ctx->code->bytesAllocated();
    codeTotal += s.ctx->code->totalAlignedMemoryAllocated();
    constStrings += s.ctx->constStringHeap->bytesAllocated();
    constStringsTotal += s.ctx->constStringHeap->totalAlignedMemoryAllocated();
    debugInfo += s.ctx->debugInfo->bytesAllocated();
    debugInfoTotal += s.ctx->debugInfo->totalAlignedMemoryAllocated();
    heap += s.ctx->heap->bytesAllocated();
    heapTotal += s.ctx->heap->totalAlignedMemoryAllocated();
    string += s.ctx->stringHeap->bytesAllocated();
    stringTotal += s.ctx->stringHeap->totalAlignedMemoryAllocated();
    shared += s.ctx->getSharedMemorySize();
    unique += s.ctx->getUniqueMemorySize();
  }
  size_t total = stack + globals + codeTotal + constStringsTotal + debugInfoTotal + heapTotal + stringTotal;
  size_t waste = constStringsTotal - constStrings + debugInfoTotal - debugInfo + heapTotal - heap + stringTotal - string;
  G_UNUSED(total);
  G_UNUSED(waste);
  debug("daScript: memory usage total = %d, waste=%d\n"
        "globals=%d, stack=%d, code=%d(%


rdx mulrax = mulrax * *(uint64 *)(qp + 96)
# asm 1: mulq  96(<qp=int64#4)
# asm 2: mulq  96(<qp=%rcx)
mulq  96(%rcx)

# qhasm:   c0 = mulrax
# asm 1: mov  <mulrax=int64#7,>c0=int64#5
# asm 2: mov  <mulrax=%rax,>c0=%r8
mov  %rax,%r8

# qhasm:   mulr01 = mulrdx
# asm 1: mov  <mulrdx=int64#3,>mulr01=int64#6
# asm 2: mov  <mulrdx=%rdx,>mulr01=%r9
mov  %rdx,%r9

# qhasm:   mulrax = *(uint64 *)(pp + 152)
# asm 1: movq   152(<pp=int64#2),>mulrax=int64#3
# asm 2: movq   152(<pp=%rsi),>mulrax=%rdx
movq   152(%rsi),%rdx

# qhasm:   mulrax *= 19
# asm 1: imulq  $19,<mulrax=int64#3,>mulrax=int64#7
# asm 2: imulq  $19,<mulrax=%rdx,>mulrax=%rax
imulq  $19,%rdx,%rax

# qhasm:   mulx419_stack = mulrax
# asm 1: movq <mulrax=int64#7,>mulx419_stack=stack64#9
# asm 2: movq <mulrax=%rax,>mulx419_stack=64(%rsp)
movq %rax,64(%rsp)

# qhasm:   (uint128) mulrdx mulrax = mulrax * *(uint64 *)(qp + 88)
# asm 1: mulq  88(<qp=int64#4)
# asm 2: mulq  88(<qp=%rcx)
mulq  88(%rcx)

# qhasm:   carry? c0 += mulrax
# asm 1: add  <mulrax=int64#7,<c0=int64#5
# asm 2: add  <mulrax=%rax,<c0=%r8
add  %rax,%r8

# qhasm:   mulr01 += mulrdx + carry
# asm 1: adc <mulrdx=int64#3,<mulr01=int64#6
# asm 2: adc <mulrdx=%rdx,<mulr01=%r9
adc %rdx,%r9

# qhasm:   mulrax = *(uint64 *)(pp + 120)
# asm 1: movq   120(<pp=int64#2),>mulrax=int64#7
# asm 2: movq   120(<pp=%rsi),>mulrax=%rax
movq   120(%rsi),%rax

# qhasm:   (uint128) mulrdx mulrax = mulrax * *(uint64 *)(qp + 80)
# asm 1: mulq  80(<qp=int64#4)
# asm 2: mulq  80(<qp=%rcx)
mulq  80(%rcx)

# qhasm:   carry? c0 += mulrax
# asm 1: add  <mulrax=int64#7,<c0=int64#5
# asm 2: add  <mulrax=%rax,<c0=%r8
add  %rax,%r8

# qhasm:   mulr01 += mulrdx + carry
# asm 1: adc <mulrdx=int64#3,<mulr01=int64#6
# asm 2: adc <mulrdx=%rdx,<mulr01=%r9
adc %rdx,%r9

# qhasm:   mulrax = *(uint64 *)(pp + 120)
# asm 1: movq   120(<pp=int64#2),>mulrax=int64#7
# asm 2: movq


sform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}/*!
 * Daemonite Material UI 4.6.0 - RC1 (https://djibe.github.io/material/)
 * Copyright 2011-2021 The Bootstrap Authors
 * Copyright 2011-2021 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * Material UI by djibe, Maya, Geoff Bowers and Alex Skinner
 */
:root {
  --amber: #ffc107;
  --blue: #2196f3;
  --blue-grey: #607d8b;
  --brown: #795548;
  --cyan: #00bcd4;
  --deep-orange: #ff5722;
  --deep-purple: #673ab7;
  --green: #4caf50;
  --grey: #9e9e9e;
  --indigo: #3f51b5;
  --light-blue: #03a9f4;
  --light-green: #8bc34a;
  --lime: #cddc39;
  --orange: #ff9800;
  --pink: #e91e63;
  --purple: #9c27b0;
  --red: #f44336;
  --teal: #009688;
  --yellow: #ffeb3b;
  --primary: #6200ee;
  --primary-dark: #3700b3;
  --primary-light: #bb86fc;
  --secondary: #03dac6;
  --secondary-dark: #018786;
  --secondary-light: #66fff8;
  --danger: #b00020;
  --danger-dark: #d32f2f;
  --danger-light: #c51162;
  --info: #714cfe;
  --info-dark: #021aee;
  --info-light: #d2c2fd;
  --success: #61d800;
  --success-dark: #41c300;
  --success-light: #c6f68d;
  --warning: #ff8d00;
  --warning-dark: #ee6002;
  --warning-light: #ffc77d;
  --dark: #424242;
  --dark-dark: #212121;
  --dark-light: #757575;
  --light: #f5f5f5;
  --light-dark: #e0e0e0;
  --light-light: #fafafa;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --font-family-sans-


ro._samples["Clave"]).then(sp => this.samples[0] = sp);
        samplesService.samplePlayer(Metro._samples["Taktell"]).then(sp => this.samples[1] = sp);
        samplesService.samplePlayer(Metro._samples["DanBeat"]).then(sp => this.samples[2] = sp);

        // this.samples[0] = new SamplePlayer(new Sample(, )
        // this.samples[1] = new SamplePlayer(new Sample(Metro._samples["Taktell"], samplesService))
        // this.samples[2] = new SamplePlayer(new Sample(Metro._samples["DanBeat"], samplesService))
    }

    start() {

    }

    stop() {

    }

    tick() {

        // console.log(this.pulse.time  + " " + audioContext.currentTime)

        if (!this.active) return

        // console.log(this.pulse.beat)
        const pulseNow: number = Math.floor(this.pulse.beat * this.pulse.pulsesPerBeat + TOL);

        const fract = this.pulse.beat * this.pulse.pulsesPerBeat - pulseNow

        if (Math.abs(fract) > 2 * TOL) return

        // tslint:disable-next-line:no-bitwise
        const index = (pulseNow % this.pulse.patternLength) | 0

        const ii = this.pulse.accents[index]

        const sample = this.samples[ii]

        if (sample !== undefined) sample.play(this.pulse.time)

        if (this.monitor) this.monitor.spareTime(this.pulse.time - audioContext.currentTime)

    }

    addPostItems(items: any, saver: any): void {
        console.log(" DO NOTHING ")
    }
}

Metro._samples["Clave"] = "assets/sounds/metro/christeck/Metronom Claves.wav"
Metro._samples["Taktell"] = "assets/sounds/metro/christeck/Metronom Taktell Junior.wav"
Metro._samples["DanBar"] = "assets/sounds/metro/dan/metro_bar.wav"
Metro._samples["DanBeat"] = "assets/sounds/metro/dan/metro_beat.wav"
Metro._samples["FrankBar"] = "assets/sounds/metro/frank/metro_1.wav"
Metro._samples["FrankBeat"] = "assets/sounds/metro/frank/metro_other.wav"

// Keyboard interactions
import { IEntities } from './interfaces';

// wrap event handlers with extra parameters
function eventExtras(handler, ...extras) {
    return evt => handler(evt, ...extras);
}

export class InteractionManager<T> {
    private domHandlers = {};
    private keyboardHandlers = {};
    private mouseHandlers = {}; // not yet used

    constructor(handlers, private state: T) {
        let hasKeyboardHandlers = 0;

        // loop over handlers passed in, and grab the keyboard events out
        Object.keys(handlers).forEach(key => {
            if (/^k/i.test(key)) {
                this.keyboardHandlers[key.substr(1)] = handlers[key];
                hasKeyboardHandlers++;
            } else if (`on${key}` in window) {
                // TODO: make sure this works across browsers
                this.domHandlers[key] = handlers[key];
                window[`on${key}`] = eventExtras(handlers[key], this.state);
            }
        });

        if (hasKeyboardHandlers) {
            // setup keyboard event listeners
            document.onkeydown = evt => {
                if (this.keyboardHandlers[evt.which]) {
                    this.keyboardHandlers[evt.which](evt, this.state);
                }
            };
        }
    }

    update(entities: IEnti


m_normals[3].Set(-1, 0)
    this.m_centroid.SetZero()

    if (center) {
      this.m_centroid.Copy(center)

      const xf: Transform = new Transform()
      xf.SetPosition(center)
      xf.SetRotationAngle(angle)

      // Transform vertices and normals.
      for (let i: number = 0; i < this.m_count; ++i) {
        Transform.MulXV(xf, this.m_vertices[i], this.m_vertices[i])
        Rot.MulRV(xf.q, this.m_normals[i], this.m_normals[i])
      }
    }

    return this
  }
  TestPoint(xf: Transform, p: Vec2): boolean {
    const pLocal: Vec2 = Transform.MulTXV(
      xf,
      p,
      PolygonShape.TestPoint_s_pLocal
    )

    for (let i: number = 0; i < this.m_count; ++i) {
      const dot: number = Vec2.DotVV(
        this.m_normals[i],
        Vec2.SubVV(pLocal, this.m_vertices[i], Vec2.s_t0)
      )
      if (dot > 0) {
        return false
      }
    }

    return true
  }
  ComputeDistance(
    xf: Transform,
    p: Vec2,
    normal: Vec2,
    childIndex: number
  ): number {
    const pLocal = Transform.MulTXV(
      xf,
      p,
      PolygonShape.ComputeDistance_s_pLocal
    )
    let maxDistance = -maxFloat
    const normalForMaxDistance = PolygonShape.ComputeDistance_s_normalForMaxDistance.Copy(
      pLocal
    )

    for (let i = 0; i < this.m_count; ++i) {
      const dot = Vec2.DotVV(
        this.m_normals[i],
        Vec2.SubVV(pLocal, this.m_vertices[i], Vec2.s_t0)
      )
      if (dot > maxDistance) {
        maxDistance = dot
        normalForMaxDistance.Copy(this.m_normals[i])
      }
    }

    if (maxDistance > 0) {
      const minDistance = PolygonShape.ComputeDistance_s_minDistance.Copy(
        normalForMaxDistance
      )
      let minDistance2 = maxDistance * maxDistance
      for (let i = 0; i < this.m_count; ++i) {
        const distance = Vec2.SubVV(
          pLocal,
          this.m_vertices[i],
          PolygonShape.ComputeDistance_s_distance
        )
        const distance2 = distance.LengthSquared()
        if (minDistance2 > distance2) {
          minDistance.Copy(distance)
          minDistance2 = distance2
        }
      }

      Rot.MulRV(xf.q, minDistance, normal)
      normal.Normalize()
      return Math.sqrt(minDistance2)
    } else {
      Rot.MulRV(xf.q, normalForMaxDistance, normal)
      return maxDistance
    }
  }
  RayCast(
    output: RayCastOutput,
    input: RayCastInput,
    xf: Transform,
    childIndex: number
  ): boolean {
    // Put the ray into the polygon's frame of reference.
    const p1: Vec2 = Transform.MulTXV(xf, input.p1, PolygonShape.RayCast_s_p1)
    const p2: Vec2 = Transform.MulTXV(xf, input.p2, PolygonShape.RayCast_s_p2)
    const d: Vec2 = Vec2.SubVV(p2, p1, PolygonShape.RayCast_s_d)

    let lower: number = 0
    let upper = input.maxFraction

    let index: number = -1

    for (let i: number = 0; i < this.m_count; ++i) {
      // p = p1 + a * d
      // dot(normal, p - v) = 0
      // dot(normal, p1 - v) + a * dot(nor


    background: linear-gradient(#f5f5f5, #f0f0f0);
}

.searchresultdialog_subtitle {
	font-size: 7pt;
	font-weight:normal;
	padding:0px;
	margin:0px 0px 0px 4px;
	line-height:10px;
	display:inline-block;
	*display: inline;
	*zoom: 1;
}

.searchresultdialog_ul_frame {
	overflow-y:auto;

}

.searchresultdialog_ul {
	color:#333;
	list-style:none;
	padding:0;
	margin:0;

}

.searchresultdialog_ul li {
	border-bottom: 1px solid #999;
	position:relative;
}

.searchresultdialog_ul li.nodata {
	padding: 8px;
	font-size:95%;
	border-bottom: 0px solid #999;
}

.searchresultdialog_ul li a{
	color:#000;
	text-decoration:none;
	display:block;
	padding: 13px 2px 13px 0px;
	font-size:95%;
	position:relative;
}

.searchresultdialog_ul li a .title{
	padding-left:8px;
	color: #134A63;
}

.searchresultdialog_ul li a .muni{
	padding-left:18px;
	font-size: 80%;
}

.searchresultdialog_select_frame
{
	text-align : center;
	margin-top : 3px;
	margin-bottom : 2px;

}
/*
.searchresultdialog_select_frame select{
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
    width: 48%;
    height: 30px;
    line-height: 30px;
    font-size: 13px;
    text-indent: 1em;
    color: #FFFFFF;
    border: 1px solid #555;
    cursor: pointer;

	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	behavior: url(border-radius.htc);

    background:#333 url(../image/arrow-down.png) no-repeat;
    background-size:20px 20px;
    background-position: right center;
}
*/

/* GSI.LayerTreeDialog
---------------------------------------------------------------------- */
.layertreedialog_control_frame {

	padding: 3px 3px 4px 3px;
	z-index:101;
	position:relative;

	box-shadow: 0px 1px 1px 1px rgba(0, 0, 0, 0.1);
	-moz-box-shadow: 0px 1px 1px 1px  rgba(0, 0, 0, 0.1); /* Firefox */
	-webkit-box-shadow: 0px 1px 1x 1px  rgba(0, 0, 0, 0.1); /* Chrome, Safari */

	border-bottom:1px solid #bbb;

	background:#f4f4f4;
	display:none;

}

.layertreedialog_control_frame label {
	font-size:9pt;
	cursor: pointer;
}

.layertreedialog_control_frame .showallbutton {
	margin-left:1px;
	font-size:9pt;
	padding:0 4px 0 4px;
	float:right;

	border:1px solid #bbb;
	margin-top:1px;

	box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.1);
	-moz-box-shadow: 0px 0px 2px 1px  rgba(0, 0, 0, 0.1); /* Firefox */
	-webkit-box-shadow: 0px 0px 2x 1px  rgba(0, 0, 0


 version: 4, onOpen: (db) async {
        _database = db;
        print(await db.query("sqlite_master"));
      }, onUpgrade: (db, oldVersion, newVersion) async {
        print('upgrading');

        if (oldVersion == 1) {
          db.rawQuery('CREATE TABLE IF NOT EXISTS "IncorrectQuestions" ('
              '"id"	INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,'
              '"kanjiId"	INTEGER NOT NULL,'
              '"choices"	TEXT NOT NULL,'
              '"selectedIndex"	INTEGER NOT NULL,'
              '"rightAnswer"	TEXT NOT NULL,'
              '"questionType" INTEGER NOT NULL DEFAULT 0)');
        }

        if (oldVersion == 2) {
          db.rawQuery(
              "ALTER TABLE IncorrectQuestions ADD questionType INTEGER NOT NULL DEFAULT 0");
          db.rawQuery(
              "ALTER TABLE Kanji ADD studiedTimeStamps TEXT DEFAULT '[]'");
        }

        if (oldVersion == 3) {
          final tempPath = join(appDocDir.path, "temp.db");
          final data = await rootBundle.load("data/dictDB.db");
          final List<int> bytes =
              data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
          await File(path).writeAsBytes(bytes);
          final tempDB = await openDatabase(tempPath);
          final kanjis = await tempDB.query("Kanji");
          await db.delete('Kanji');
          await db.rawQuery('''CREATE TABLE "Kanji" (
              "id"	INTEGER PRIMARY KEY AUTOINCREMENT,
              "grade"	INTEGER,
              "kanji"	TEXT,
              "strokes"	INTEGER,
              "onyomi"	TEXT,
              "meaning"	TEXT,
              "jlpt"	INTEGER,
              "frequency"	INTEGER,
              "jinmeiyo"	INTEGER,
              "faved"	INTEGER,
              "kunyomi"	TEXT,
              "kunyomiWords"	TEXT,
              "parts"	TEXT,
              "onyomiWords"	TEXT,
              "studiedTimeStamps"	TEXT DEFAULT '[]',
              "radicals"	TEXT DEFAULT '',
              "radicalsMeaning"	TEXT DEFAULT ''
          )''');
          for (var kanji in kanjis) {
            db.insert('Kanji', kanji);
          }
        }
      });
    } else {
      print("copying");
      final data = await rootBundle.load("data/dictDB.db");
      final List<int> bytes =
          data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
      await File(path).writeAsBytes(bytes);
      return openDatabase(
        path,
        version: 4,
        onOpen: (db) async {
          _database = db;
          print(await db.query("sqlite_master"));
        },
      );
    }
  }

  static List<Kanji> kanjis = <Kanji>[];

  Future<List<Kanji>> getAllKanjis() async {
    final db = await database;
    final res = await db.query('Kanji').onError((error, stackTrace) {
      print('re-initialize');
      return initDB(needRefresh: true).then((value) => value.query('Kanji'));
    });

    return res.isNotEmpty
        ? res.map((r) {
            return Kanji.fromDBMap(r);
          }).toList()
        : [];
  }

  @Deprecated(
      'Use this only for scripting. Do not use this in the released app.')
  Future<List<Sentence>> getSentencesByKanji(String kanjiStr) async {
    final db = await database;
    final res = await db
        .rawQuery("SELECT * FROM Sentence WHERE kanji = '$kanjiStr' LIMIT 1


tracking-wider text-gray-300">{description}

              {labels.map((tag) => (

                  {tag.split(' ').join('-')}

              ))}

  )
}

export default ToolsCard
// it will pop the card
export const popUp = {
  hidden: { scale: 0, opacity: 0 },
  visible: {
    opacity: 1,
    scale: 1,
  },
  transition: {
    type: 'spring',
  },
}

// Slide from the Bottom animation

export const slideFromBottom = {
  hidden: { y: 100, opacity: 0, scale: 0.8 },
  visible: {
    opacity: 1,
    scale: 1,
    y: 0,
    transition: {
      duration: 0.7,
      ease: 'easeInOut',
    },
  },
}

// Slide from the left animation

export const slideFromLeft = {
  hidden: { x: -200, opacity: 0, scale: 0.8 },
  visible: {
    opacity: 1,
    scale: 1,
    x: 0,
    transition: {
      type: 'spring',
      stiffness: 150,
    },
  },
}

export const popUpFromBottomForText = {
  hidden: { opacity: 0, y: 40 },
  visible: {
    opacity: 1,
    y: 0,
    transition: {
      type: 'spring',
      stiffness: 60,
    },
  },
}

export const pulseOpacity = {
  hidden: { opacity: 0 },
  visible: { opacity: 1 },
}

export const headingFromLeft = {
  hidden: { x: -200, opacity: 0 },
  visible: {
    x: 0,
    opacity: 1,
    transition: {
      duration: 0.1,
      type: 'spring',
      stiffness: 70,
    },
  },
}

export const inputSlideAnimation = {
  hidden: { x: -200, opacity: 0 },
  visible: {
    x: 0,
    opacity: 1,
    transition: {
      // duration: 0.1,
      type: 'spring',
      // stiffness: 70,
    },
  },
}

export const fromBottomVariant = {
  hidden: { y: 100, opacity: 0 },
  visible: {
    y: 0,
    opacity: 1,
    transition: {
      duration: 0.1,
      type: 'spring',
      stiffness: 70,
    },
  },
}

export const cardFromRight = {
  hidden: { x: 100, opacity: 1 },
  visible: {
    x: 0,
    opacity: 1,
    // scale: 1,
    transition: {
      // duration: 0.1,
      type: 'spring',
      // stiffness: 100,
    },
  },
}

export const homeEnterVariant = {
  hidden: { x: '100vw', opacity: 0 },
  visible: {
    x: 0,
    opacity: 1,
    transition: {
      type: 'spring',
      mass: 0.4,
      // damping: 10,
      stiffness: 100,
      // when: "beforeChildren",
      // staggerChildren: 0.6,
    },
  },
  exit: {
    x: '-100vw',
    transition: {
      duration: 0.3,
      delay: 0.3,
      type: 'spring',
      stiffness: 100,
    },
  },
}

export const bounceScale = {
  hidden: { scale: 0, opacity: 0 },
  visible: {


7 0 -9 -4.03223 -9 -9v-30c0 -4.96777 4.03223 -9 9 -9h30c4.96777 0 9 4.03223 9 9zM416 288c17.6641 0 32 -14.3359 32 -32v-288
c0 -17.6641 -14.3359 -32 -32 -32h-384c-17.6641 0 -32 14.3359 -32 32v288c0 17.6641 14.3359 32 32 32h384zM96 224c-17.6641 0 -32 -14.3359 -32 -32s14.3359 -32 32 -32s32 14.3359 32 32s-14.3359 32 -32 32zM384 0v96l-96 96l-128 -128l-32 32l-64 -64v-32h320z" />
    <glyph glyph-name="remove-format" unicode="" horiz-adv-x="640"
d="M336 32c8.83203 0 16 -7.16797 16 -16v-32c0 -8.83203 -7.16797 -16 -16 -16h-128c-8.83203 0 -16 7.16797 -16 16v32c0 8.83203 7.16797 16 16 16h32.4902l26.5098 79.5996l67.0898 -51.8301l-9.25977 -27.7695h11.1699zM633.82 -10.0996
c3.41309 -2.65234 6.18359 -8.3125 6.18359 -12.6357c0 -3.02734 -1.50684 -7.42383 -3.36426 -9.81445l-19.6396 -25.2705c-2.65234 -3.41211 -8.31152 -6.18262 -12.6338 -6.18262c-3.03125 0 -7.43359 1.51172 -9.82617 3.37305l-588.36 454.72
c-3.41016 2.65234 -6.17773 8.31055 -6.17773 12.6309c0 3.02832 1.50879 7.42773 3.36816 9.81934l19.6299 25.2695c2.65234 3.41309 8.31152 6.18262 12.6338 6.18262c3.03125 0 7.43359 -1.51074 9.82617 -3.37207l114.54 -88.5205v43.9004c0 8.83203 7.16797 16 16 16
h416c8.83203 0 16 -7.16797 16 -16v-96c0 -8.83203 -7.16797 -16 -16 -16h-32c-8.83203 0 -16 7.16797 -16 16v32h-117.83l-49.1699 -147.59zM309.91 240.24l31.9199 95.7598h-117.83v-29.3604z" />
    <glyph glyph-name="sort-alpha-down-alt" unicode="" horiz-adv-x="448"
d="M176 96c14.2197 0 21.3496 -17.2598 11.3301 -27.3096l-80 -96c-2.58691 -2.58496 -7.65332 -4.68262 -11.3105 -4.68262c-3.65625 0 -8.72266 2.09766 -11.3096 4.68262l-80 96c-10.0703 10.0693 -2.90039 27.3096 11.29 27.3096h48v304c0 8.83203 7.16797 16 16 16h32
c8.83203 0 16 -7.16797 16 -16v-304h48zM288 224c-8.83203 0 -16 7.16797 -16 16v17.6299v0.00292969c0 7.93262 4.81152 18.6475 10.7402 23.917l61.2598 70.4502h-56c


      return false;
    }

    return true;
}

void
sc_server_stop(struct sc_server *server) {
    sc_mutex_lock(&server->mutex);
    server->stopped = true;
    sc_cond_signal(&server->cond_stopped);
    sc_intr_interrupt(&server->intr);
    sc_mutex_unlock(&server->mutex);
}

void
sc_server_join(struct sc_server *server) {
    sc_thread_join(&server->thread, NULL);
}

void
sc_server_destroy(struct sc_server *server) {
    if (server->video_socket != SC_SOCKET_NONE) {
        net_close(server->video_socket);
    }
    if (server->audio_socket != SC_SOCKET_NONE) {
        net_close(server->audio_socket);
    }
    if (server->control_socket != SC_SOCKET_NONE) {
        net_close(server->control_socket);
    }

    free(server->serial);
    free(server->device_socket_name);
    sc_intr_destroy(&server->intr);
    sc_cond_destroy(&server->cond_stopped);
    sc_mutex_destroy(&server->mutex);

    sc_adb_destroy();
}


lr = 0x0f0f0f0f
		and				r4, lr, r4, lsr #2
		and				r5, lr, r5, lsr #2
		and				lr, lr, lr, lsr #2				@ ; lr = 0x03030303
		add				r4, r4, r6
		add				r5, r5, r7

		stmia			dst, {r4, r5}
		subs			rows, rows, #1
		add				dst, dst, dstStep
		bgt				acc3\align\round

		RETURN
.endm

acc0_align_0:
	COPY 0
acc0_align_1:
	COPY 1
acc0_align_2:
	COPY 2
acc0_align_3:
	COPY 3

acc1_no_round_align_0:
	ACC1 0, 0
acc1_no_round_align_1:
	ACC1 1, 0
acc1_no_round_align_2:
	ACC1 2, 0
acc1_no_round_align_3:
	ACC1 3, 0

acc1_round_align_0:
	ACC1 0, 1
acc1_round_align_1:
	ACC1 1, 1
acc1_round_align_2:
	ACC1 2, 1
acc1_round_align_3:
	ACC


#!/usr/bin/env python3
"""
Helper script to kill any remaining voice demo processes
"""

import os
import subprocess
import sys

def kill_voice_demos():
    """Kill any running voice demo processes"""
    print("🔍 Looking for voice demo processes...")

    try:
        # Find all python processes with voice_demo in the name
        result = subprocess.run(
            ['ps', 'aux'],
            capture_output=True,
            text=True
        )

        killed_count = 0

        for line in result.stdout.split('\n'):
            if 'python' in line and 'voice_demo' in line:
                parts = line.split()
                if len(parts) >= 2:
                    pid = parts[1]
                    process_name = ' '.join(parts[10:])

                    print(f"🎯 Found: PID {pid} - {process_name}")

                    try:
                        # Kill the process
                        os.kill(int(pid), 9)  # SIGKILL
                        print(f"✅ Killed process {pid}")
                        killed_count += 1
                    except ProcessLookupError:
                        print(f"⚠  Process {pid} already terminated")
                    except PermissionError:
                        print(f"❌ Permission denied for process {pid}")
                    except Exception as e:
                        print(f"❌ Error killing {pid}: {e}")

        if killed_count == 0:
            print("✅ No voice demo processes found")
        else:
            print(f"✅ Killed {killed_count} voice demo processes")

    except Exception as e:
        print(f"❌ Error: {e}")

if __name__ == "__main__":
    kill_voice_demos()


] - rs[3];
//  }
.endm

.macro MB_PRED_8BITS_ADD_DCT_16BITS_CLIP arg0, arg1, arg2, arg3, arg4, arg5
//  {   //  input: pred_d[0]/[1](output), dct_q0/1, working_q0/1;
    vmovl.u8        \arg4,\arg0
    vmovl.u8        \arg5,\arg1
    vadd.s16        \arg4,\arg2
    vadd.s16        \arg5,\arg3
    vqmovun.s16 \arg0,\arg4
    vqmovun.s16 \arg1,\arg5
//  }
.endm

.macro ROW_TRANSFORM_1_STEP_TOTAL_16BITS arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7
//  {   //  input: src_d[0]~[3], output: e_d[0]~[3];
    vadd.s16        \arg4, \arg0, \arg2         //int16 e[i][0] = src[0] + src[2];
    vsub.s16        \arg5, \arg0, \arg2         //int16 e[i][1] = src[0] - src[2];
    vshr.s16        \arg6, \arg1, #1
    vshr.s16        \arg7, \arg3, #1
    vsub.s16        \arg6, \arg6, \arg3         //int16 e[i][2] = (src[1]>>1)-src[3];
    vadd.s16        \arg7, \arg1, \arg7         //int16 e[i][3] = src[1] + (src[3]>>1);
//  }
.endm

.macro TRANSFORM_TOTAL_16BITS arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7    // both row & col transform used
//  {   //  output: f_q[0]~[3], input: e_q[0]~[3];
    vadd.s16        \arg0, \arg4, \arg7         //int16 f[i][0] = e[i][0] + e[i][3];
    vadd.s16        \arg1, \arg5, \arg6         //int16 f[i][1] = e[i][1] + e[i][2];
    vsub.s16        \arg2, \arg5, \arg6         //int16 f[i][2] = e[i][1] - e[i][2];
    vsub.s16        \arg3, \arg4, \arg7         //int16 f[i][3] = e[i][0] - e[i][3];
//  }
.endm

.macro ROW_TRANSFORM_0_STEP arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7
//  {   //  input: src_d[0]~[3], output: e_q[0]~[3];
    vaddl.s16       \arg4, \arg0, \arg2         //int32 e[i][0] = src[0] + src[2];
    vsubl.s16       \arg5, \arg0, \arg2         //int32 e[i][1] = src[0] - src[2];
    vsubl.s16       \arg6, \arg1, \arg3         //int32 e[i][2] = src[1] - src[3];
    vaddl.s16       \arg7, \arg1, \arg3         //int32 e[i][3] = src[1] + src[3];
//  }
.endm

.macro ROW_TRANSFORM_1_STEP arg0, arg1, arg2, arg3, arg4, arg5, arg6,


h>
 */
@Component({
  selector: 'ts-search',
  templateUrl: './search.component.html',
  styleUrls: ['./search.component.scss'],
})
export class TsSearchComponent implements OnInit {
  /**
   * Provide access to the form
   */
  @ViewChild('form') form: FormGroup;

  /**
   * Define the button action label
   */
  public buttonAction: ButtonActionTypes = 'Submit';

  /**
   * Define the button type
   */
  public buttonType: ButtonFunctionTypes = 'search';

  /**
   * Define the icon name
   */
  public icon: string = 'search';

  /**
   * Store the search query
   */
  public query: string = '';

  /**
   * Define the primary label for the input
   */
  @Input() inputLabel: string = 'Search';

  /**
   * Define if the user can clear the search input
   */
  @Input() userCanClear: boolean = true;

  /**
   * Define if the search is currently loading results
   */
  @Input() loading: boolean = false;

  /**
   * Define an initial value for the search input
   */
  @Input() initialValue: string;

  /**
   * Define the button style
   */
  @Input() buttonStyle: string = 'primary';

  /**
   * Define the hint text below the input
   */
  @Input() inputHint: string = 'Enter at least two letters.';

  /**
   * Seed the value if needed on initialization
   */
  ngOnInit() {
    if (this.initialValue) {
      this.query = this.initialValue;
    }
  }

  /**
   * Submit a search query
   * TODO: Add a type to the accepted param (need to figure out the type being passed by the form)
   *
   * @param {Object} formValue Value of the search input
   */
  submitSearch(formValue: any): void {
    this.loading = true;

    // NOTE: FOR EXAMPLE ONLY
    setTimeout(() => {
      this.loading = false;
    }, 1000);
  }

}
import { ensureItemIds } from '../../../src/main-process/menu'

describe('main-process menu', () => {
  describe('ensureItemIds', () => {
    it('leaves explicitly specified ids', () => {
      const template: Electron.MenuItemConstructorOptions[] = [
        { label: 'File', id: 'foo' },
      ]

      ensureItemIds(template)

      expect(template[0].id).toBe('foo')
    })

    it('assigns ids to items which lack it', () => {
      const template: Electron.MenuItemConstructorOptions[] = [
        { label: 'File' },
      ]

      ensureItemIds(template)

      expect(template[0].id).toBe('@.File')
    })

    it('assigns ids recursively', () => {
      const template: Electron.MenuItemConstructorOptions[] = [
        {
          label: 'File',
          id: 'foo',
          submenu: [
            { label: 'Open' },
            { label: 'Close' },
            {
              label: 'More',
              submenu: [{ label: 'Even more' }],
            },
          ],
        },
      ]

      ensureItemIds(template)

      expect(template[0].id).toBe('foo')

      const firstSubmenu = template[0]
        .submenu! as Electron.MenuItemConstructorOptions[]

      expect(firstSubmenu[0].id).toBe('foo.Open')
      expect(firstSubmenu[1].id).toBe('foo.Close')
      expect(firstSubmenu[2].id).toBe('foo.More')

      const secondSubmenu = firstSubmenu[2]
        .submenu! as Electron.MenuItemConstructorOptions[]

      expect(secondSubmenu[0].id).toBe('foo.More.Even more')
    })

    it('handles duplicate generated ids', () => {
      const template: Electron.MenuItemConstructorOptions[] = [
        { label: 'foo' },
        { label: 'foo' },
      ]

      ensureItemIds(template)


MermSupplyStructure({
        prefab = "merm_armory",
        build  = "merm_armory",
        bank   = "merm_armory",
        tag    = "merm_armory",
        hiddensymbol = "UPGRADED",
        supplyprefab = "mermarmorhat",
        deployhelperfilter = "mermwatchtower",
        assets = armory_assets,
        prefabs = armnory_prefabs,
    }),

    CreateMermSupplyStructure({
        prefab = "merm_armory_upgraded",
        build  = "merm_armory",
        bank   = "merm_armory",
        tag    = "merm_armory_upgraded",
        hiddensymbol = "NOUPGRADED",
        supplyprefab = "mermarmorupgradedhat",
        deployhelperfilter = "mermwatchtower",
        assets = armory_assets,
        prefabs = armnory_prefabs,
    }),

    CreateMermSupplyStructure({
        prefab = "merm_toolshed",
        build  = "merm_toolshed",
        bank   = "merm_toolshed",
        tag    = "merm_toolshed",
        hiddensymbol = "UPGRADED",
        supplyprefab = "merm_tool",
        deployhelperfilter = "mermhouse_crafted",
        assets = toolshed_assets,
        prefabs = toolshed_prefabs,
    }),

    CreateMermSupplyStructure({


ised
 * @param lang explicit language to be used
 * @param format date specific format for localised
 */
export function formatDateLocale(translate: TranslateService, value: string, lang?: string, format?: DateFormat) {
  if (!value) {
    return null;
  }

  const currentLang = lang ? lang : translate.getBrowserLang();
  if (format !== undefined) {
    return new Date(Number(value))
      .toLocaleDateString(
        currentLang, {
          timeZone: format.timeZone,
          hour12: format.hour12,
          weekday: format.weekday,
          year: format.year,
          era: format.era,
          month: format.month,
          day: format.month,
          hour: format.hour,
          minute: format.minute,
          second: format.second,
          timeZoneName: format.timeZoneName
        });
  } else {
    return new Date(Number(value))
      .toLocaleDateString(
        currentLang, {
          year: 'numeric', month: 'long', day: 'numeric'
        });
  }
}

/**
 *
 * @param translate service {@link TranslateService} to pass in
 * @param value value to be localised
 * @param lang explicit language to be used
 * @param currencyFormat currency specific format for localised
 */
export function formatCurrencyLocale(translate: TranslateService, value: string, lang?: string, currencyFormat?: CurrencyFormat) {
  if (!value) {
    return null;
  }

  const currentLang = lang ? lang : translate.getBrowserLang();
  if (currencyFormat === undefined) {
    return new Promise<string>((resolve, reject) => {
      translate.get('CURRENCY').subscribe((currency: string) => {
        resolve(
          Number(value).toLocaleString(currentLang, {
            style: 'currency', currency: currency
          })
        );
      }, error => reject(error));
    });
  } else {
    return Number(value).toLocaleString(currentLang, {
      style: 'currency',
      currency: currencyFormat.currency,
      currencyDisplay: currencyFormat.currencyDisplay,
      useGrouping: currencyFormat.separators
    });
  }
}

/**
 * Remove symbol of a currency string
 * @param currency string currency that contains symbol
 */
export function removeCurrencySymbol(currency: string) {
  return currency.replace(/[^\d.-]/g, '');
}

/**
 *
 * @param translate service {@link TranslateService} to pass in
 * @param value value to be localised
 * @param lang explicit language to be used
 * @param numberFormat specific number format for localised
 */
export function formatNumberLocale(translate: TranslateService, value: string, lang?: string, numberFormat?: NumberFormat) {
  if (!value) {
    return null;
  }

  const currentLang = lang ? lang : translate.getBrowserLang();
  if (!numberFormat) {
    return Number(value).toLocaleString(currentLang);
  } else {
    return Number(value).toLocaleString(currentLang, {
      style: numberFormat.style,
      useGrouping: numberFormat.separators
    });
  }
}
// TODO: implement district typings.

export type MapType = {
  readonly [key: string]: any;
}
export type ValueType =
  | string
  | number
  | boolean
  | null
  | readonly ValueType[]
  | MapType;

export type NodeType = MapType;
import { addNoteEvent, musicTimeUpdateEvent } from "./mainStage";
import { missLatency, perfectLatency } from "../constants";
import { SingleSprite } from "../components/mainlayer/note/single";
import { FlickSprite } from "../components/mainlayer/note/flick";
import { SlideSprite } from "../components


*R2*RIN;

  const denDRe = (-RIN*RT2) - RB1*RT2 - R1*RT2 - RIN*RT1 - RB1*RT1 - R1*RT1 - RB2*RIN
    - RB1*RIN - R2*RIN - R1*RIN;

  // Transfer function numerator coefficients
  const numXRe = 0;

  const numAIm = CB1*CB2*CT*RB1*RB2*RF*RT1*RT2 + CB1*CB2*CT*R2*RB1*RB2*RT1*RT2
    + CB1*CB2*CT*R3*RB1*RB2*RF*RT2 + CB1*CB2*CT*R1*RB1*RB2*RF*RT2
    + CB1*CB2*CT*R2*R3*RB1*RB2*RT2 + CB1*CB2*CT*R1*R3*RB1*RB2*RT2
    + CB1*CB2*CT*R1*R2*RB1*RB2*RT2 + CB1*CB2*CT*R3*RB1*RB2*RF*RT1
    + CB1*CB2*CT*R2*RB1*RB2*RF*RT1 + CB1*CB2*CT*R2*R3*RB1*RB2*RF
    + CB1*CB2*CT*R1*R3*RB1*RB2*RF + CB1*CB2*CT*R1*R2*RB1*RB2*RF;

  const numBRe = CB2*CT*RB2*RF*RT1*RT2 + CB1*CT*RB1*RF*RT1*RT2 + CB1*CT*RB1*RB2*RT1*RT2
    + CB2*CT*R2*RB2*RT1*RT2 + CB1*CT*R2*RB1*RT1*RT2 + CB2*CT*RB1*RB2*RF*RT2
    + CB1*CB2*RB1*RB2*RF*RT2 + CB2*CT*R3*RB2*RF*RT2 + CB2*CT*R1*RB2*RF*RT2
    + CB1*CT*R3*RB1*RF*RT2 + CB1*CT*R1*RB1*RF*RT2 + CB2*CT*R3*RB1*RB2*RT2
    + CB1*CT*R3*RB1*RB2*RT2 + CB2*CT*R2*RB1*RB2*RT2 + CB1*CB2*R2*RB1*RB2*RT2
    + CB1*CT*R1*RB1*RB2*RT2 + CB2*CT*R2*R3*RB2*RT2 + CB2*CT*R1*R3*RB2*RT2
    + CB2*CT*R1*R2*RB2*RT2 + CB1*CT*R2*R3*RB1*RT2 + CB1*CT*R1*R3*RB1*RT2
    + CB1*CT*R1*R2*RB1*RT2 + CB1*CT*RB1*RB2*RF*RT1 + CB1*CB2*RB1*RB2*RF*RT1
    + CB2*CT*R3*RB2*RF*RT1 + CB2*CT*R2*RB2*RF*RT1 + CB1*CT*R3*RB1*RF*RT1
    + CB1*CT*R2*RB1*RF*RT1 + CB1*CB2*R2*RB1*RB2*RT1 + CB2*CT*R3*RB1*RB2*RF
    + CB1*CT*R3*RB1*RB2*RF + CB2*CT*R2*RB1*RB2*RF + CB1*CB2*R2*RB1*RB2*RF
    + CB1*CT*R1*RB1*RB2*RF + CB1*CB2*R1*RB1*RB2*RF + CB2*CT*R2*R3*RB2*RF
    + CB2*CT*R1*R3*RB2*RF + CB2*CT*R1*R2*RB2*RF + CB1*CT*R2*R3*RB1*RF
    + CB1*CT*R1*R3*RB1*RF + CB1*CT*R1*


      await app.WaitForSignedInAsync();
            await app.UserNameAsync().ShouldBe("John Smith");

            // Arrange - Wait for list to be ready
            await app.WaitForNoItemsAsync();

            // Act - Add an item
            await app.AddItemAsync("Buy cheese");

            // Assert
            var items = await app.GetItemsAsync();
            items.Count.ShouldBe(1);

            await items[0].TextAsync().ShouldBe("Buy cheese");
            await items[0].LastUpdatedAsync().ShouldBe("a few seconds ago");

            // Act - Add another item
            await app.AddItemAsync("Buy eggs");

            // Assert
            items = await app.GetItemsAsync();
            items.Count.ShouldBe(2);

            await items[0].TextAsync().ShouldBe("Buy cheese");
            await items[1].TextAsync().ShouldBe("Buy eggs");

            // Act - Delete an item and complete an item
            await items[0].DeleteAsync();
            await items[1].CompleteAsync();

            await Task.Delay(TimeSpan.FromSeconds(0.5), TestContext.Current.CancellationToken);

            // Assert
            items = await app.GetItemsAsync();
            items.Count.ShouldBe(1);

            await items[0].TextAsync().ShouldBe("Buy eggs");

            // Act - Delete the remaining item
            await items[0].DeleteAsync();

            // Assert
            await app.WaitForNoItemsAsync();

            // Act - Sign out
            await app.SignOutAsync();

            // Assert
            await app.WaitForSignedOutAsync();
        });
    }

    public ValueTask InitializeAsync()
    {
        InstallPlaywright();
        return ValueTask.CompletedTask;
    }

    public ValueTask DisposeAsync()
    {
        GC.SuppressFinalize(this);
        return ValueTask.CompletedTask;
    }

    private static void InstallPlaywright()
    {
        int exitCode = Microsoft.Playwright.Program.Main(["install"]);

        if (exitCode != 0)
        {
            throw new InvalidOperationException($"Playwright exited with code {exitCode}");
        }
    }
}


ups	16(%ebp),%xmm1
	xorps	%xmm0,%xmm6
	xorps	%xmm0,%xmm2
	xorps	%xmm6,%xmm3
	movups	32(%ebp),%xmm0
L035ccm64_dec2_loop:
.byte	102,15,56,220,209
.byte	102,15,56,220,217
	movups	(%edx,%ecx,1),%xmm1
	addl	$32,%ecx
.byte	102,15,56,220,208
.byte	102,15,56,220,216
	movups	-16(%edx,%ecx,1),%xmm0
	jnz	L035ccm64_dec2_loop
	movups	(%esi),%xmm6
	paddq	16(%esp),%xmm7
.byte	102,15,56,220,209
.byte	102,15,56,220,217
.byte	102,15,56,221,208
.byte	102,15,56,221,216
	leal	16(%esi),%esi
	jmp	L033ccm64_dec_outer
.align	4,0x90
L034ccm64_dec_break:
	movl	240(%ebp),%ecx
	movl	%ebp,%edx
	movups	(%edx),%xmm0
	movups	16(%edx),%xmm1
	xorps	%xmm0,%xmm6
	leal	32(%edx),%edx
	xorps	%xmm6,%xmm3
L036enc1_loop_6:
.byte	102,15,56,220,217
	decl	%ecx
	movups	(%edx),%xmm1
	leal	16(%edx),%edx
	jnz	L036enc1_loop_6
.byte	102,15,56,221,217
	movl	48(%esp),%esp
	movl	40(%esp),%edi
	movups	%xmm3,(%edi)
	pxor	%xmm0,%xmm0
	pxor	%xmm1,%xmm1
	pxor	%xmm2,%xmm2
	pxor	%xmm3,%xmm3
	pxor	%xmm4,%xmm4
	pxor	%xmm5,%xmm5
	pxor	%xmm6,%xmm6
	pxor	%xmm7,%xmm7
	popl	%edi
	popl	%esi
	popl	%ebx
	popl	%ebp
	ret
.globl	_aesni_ctr32_encrypt_blocks
.type	_aesni_ctr32_encrypt_blocks,@function
.align	4
_aesni_ctr32_encrypt_blocks:
L_aesni_ctr32_encrypt_blocks_begin:
	pushl	%ebp
	pushl	%ebx
	pushl	%esi
	pushl	%edi
	movl	20(%esp),%esi
	movl	24(%esp),%edi
	movl	28(%esp),%eax
	movl	32(%esp),%edx
	movl	36(%esp),%ebx
	movl	%esp,%ebp
	subl	$88,%esp
	andl	$-16,%esp
	movl	%ebp,80(%esp)
	cmpl	$1,%eax
	je	L037ctr32_one_shortcut
	movdqu	(%ebx),%xmm7
	movl	$202182159,(%esp)
	movl	$134810123,4(%esp)
	movl	$67438087,8(%esp)
	movl	$66051,12(%esp)
	movl	$6,%ecx
	xorl	%ebp,%ebp
	movl	%ecx,16(%esp)
	movl	%ecx,20(%esp)
	movl	%ecx,24(%esp)
	movl	%ebp,28(%esp)
.byte


final List logStaticFinalField = [];

class A {
  List<int> field = [
    for (int i = 0; i < 9; ++i)
      () {
        logField.add(i);
        i += 2;
        return i;
      }(),
  ];

  final List<int> finalField = [
    for (int i = 0; i < 9; ++i)
      () {
        logFinalField.add(i);
        i += 2;
        return i;
      }(),
  ];

  final List<int> constructorInitializedField;

  late List<int> lateField = [
    for (int i = 0; i < 9; ++i)
      () {
        logLateField.add(i);
        i += 2;
        return i;
      }(),
  ];

  late final List<int> lateFinalField = [
    for (int i = 0; i < 9; ++i)
      () {
        logLateFinalField.add(i);
        i += 2;
        return i;
      }(),
  ];

  static List<int> staticField = [
    for (int i = 0; i < 9; ++i)
      () {
        logStaticField.add(i);
        i += 2;
        return i;
      }(),
  ];

  static final List<int> staticFinalField = [
    for (int i = 0; i < 9; ++i)
      () {
        logStaticFinalField.add(i);
        i += 2;
        return i;
      }(),
  ];

  int version = ++_version;
  static int _version = 0;

  A()
    : constructorInitializedField = [
        for (int i = 0; i < 9; ++i)
          () {
            logConstructorInitializedField.add(i);
            i += 2;
            return i;
          }(),
      ] {
    print('A($version)');
    logField.add('c');
    logFinalField.add('c');
    logLateField.add('c');
    logLateFinalField.add('c');
    logConstructorInitializedField.add('c');
    logStaticField.add('c');
    logStaticFinalField.add('c');
  }

  /// Use all the fields to ensure lazy initialization has happened.
  void use() {
    field;
    finalField;
    constructorInitializedField;
    lateField;
    lateFinalField;
    staticField;
    staticFinalField;
  }

  void check() {
    void expect(String expected, List log) {
      Expect.equals(expected, log.join(','));
    }

    expect('2,5,8', field);
    expect('2,5,8', finalField);
    expect('2,5,8', constructorInitializedField);
    expect('2,5,8', lateField);
    expect('2,5,8', lateFinalField);
    expect('2,5,8', staticField);
    expect('2,5,8', staticFinalField);

    expect('0,3,6,c,x,0,3,6,c', logField);
    expect('0,3,6,c,x,0,3,6,c', logFinalField);
    expect('0,3,6,c,x,0,3,6,c', logConstructorInitializedField);
    expect('c,0,3,6,x,c,0,3,6', logLateField);
    expect('c,0,3,6,x,c,0,3,6', logLateFinalField);
    expect('c,0,3,6,x,c', logStaticField);
    expect('c,0,3,6,x,c', logStaticFinalField);
  }
}

void main() {
  final a1 = A();
  a1.use();

  logField.add('x');
  logFinalField.add('x');
  logLateField.add('x');
  logLateFinalField.add('x');
  logConstructorInitializedField.add('x');
  logStaticField.add('x');
  logStaticFinalField.add('x');

  final a2 = A();
  a2.use();
  a2.check();
}
// Copyright (c) 2014, the Dart project authors.  Please see the A


ference findFirstDifference(String actual, String expected) {
  final actualLines = actual.split('\n');
  final expectedLines = expected.split('\n');
  int i = 0;
  for (; i < actualLines.length && i < expectedLines.length; ++i) {
    if (actualLines[i] != expectedLines[i]) {
      return new Difference(i + 1, actualLines[i], expectedLines[i]);
    }
  }
  return new Difference(
      i + 1,
      i < actualLines.length ? actualLines[i] : '<END>',
      i < expectedLines.length ? expectedLines[i] : '<END>');
}

void compareResultWithExpectationsFile(
  Uri source,
  String actual, {
  String expectFilePostfix = '',
}) {
  final expectFile =
      new File('${source.toFilePath()}$expectFilePostfix.expect');
  final expected = expectFile.existsSync() ? expectFile.readAsStringSync() : '';

  if (actual != expected) {
    if (bool.fromEnvironment(kUpdateExpectations)) {
      expectFile.writeAsStringSync(actual);
      print("  Updated $expectFile");
    } else {
      if (bool.fromEnvironment(kDumpActualResult)) {
        new File(source.toFilePath() + '.actual').writeAsStringSync(actual);
      }
      Difference diff = findFirstDifference(actual, expected);
      fail("""

Result is different for the test case $source

The first difference is at line ${diff.line}.
Actual:   ${diff.actual}
Expected: ${diff.expected}

This failure can be caused by changes in the front-end if it starts generating
different kernel AST for the same Dart programs.

In order to re-generate expectations run tests with -D$kUpdateExpectations=true VM option:

  tools/test.py -m release --vm-options -D$kUpdateExpectations=true pkg/vm/

In order to dump actual results into .actual files run tests with -D$kDumpActualResult=true VM option:

  tools/test.py -m release --vm-options -D$kDumpActualResult=true pkg/vm/

""");
    }
  }
}
// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// Defines the VM-specific translation of Dart source code to kernel binaries.

import 'dart:async';
import 'dart:io' show File, IOSink;

import 'package:args/args.dart' show ArgParser, ArgResults;

import 'package:build_integration/file_system/multi_root.dart'
    show MultiRootFileSystem, MultiRootFileSystemEntity;

import 'package:crypto/crypto.dart';

import 'package:front_end/src/api_unstable/vm.dart'
    show
        CompilerContext,
        CompilerOptions,
        CompilerResult,
        InvocationMode,
        DiagnosticMessage,
        DiagnosticMessageHandler,
        FileSystem,
        FileSystemEntity,
        NnbdMode,
        ProcessedOptions,
        Severity,
        StandardFileSystem,
        Verbosity,
        getMessageUri,
        kernelForProgram,
        parseExperimentalArguments,
        parseExperimentalFlags,
        printDiagnosticMessage,
        resolveInputUri;

import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
import 'package:kernel/ast.dart'
    show Component, Library, Reference, NonNullableByDefaultCompiledMode;
import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
import 'package:kernel/core_types.dart' show CoreTypes;
import 'package:kernel/kernel.dart' show loadComponentFromBinary;
import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget;
import 'package:package_config/package_config.dart' show loadPackageConfigUri;

import 'http_filesystem.dart' show HttpAwareFileSystem;
import 'target_os.dart';
import 'native


 AO
	addq	$16 * SIZE, BO
	subq	$1, %rax
	jg	.L36
	ALIGN_4

.L38:
	movaps	ALPHA_R, %xmm6
	movaps	ALPHA_I, %xmm7

#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \
    defined(NR) || defined(NC) || defined(TR) || defined(TC)

	shufps	$0xb1, %xmm9, %xmm9
	shufps	$0xb1, %xmm11, %xmm11

	addsubps	%xmm9, %xmm8
	addsubps	%xmm11, %xmm10

	movaps	%xmm8, %xmm9
	movaps	%xmm10, %xmm11

	shufps	$0xb1, %xmm8, %xmm8
	shufps	$0xb1, %xmm10, %xmm10
#else
	shufps	$0xb1, %xmm8, %xmm8
	shufps	$0xb1, %xmm10, %xmm10

	addsubps	%xmm8, %xmm9
	addsubps	%xmm10, %xmm11

	movaps	%xmm9, %xmm8
	movaps	%xmm11, %xmm10

	shufps	$0xb1, %xmm9, %xmm9
	shufps	$0xb1, %xmm11, %xmm11
#endif

	mulps	%xmm6, %xmm9
	mulps	%xmm7, %xmm8
	mulps	%xmm6, %xmm11
	mulps	%xmm7, %xmm10

	addps	%xmm9, %xmm8
	addps	%xmm11, %xmm10

#if! defined(TRMMKERNEL) && !defined(BETAZERO)
	movsd	0 * SIZE(CO1), %xmm0
	movsd	0 * SIZE(CO2), %xmm2

	addps	%xmm0,  %xmm8
	addps	%xmm2, %xmm10
#endif

	movsd	%xmm8, 0 * SIZE(CO1)
	movsd	%xmm10, 0 * SIZE(CO2)

#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
	movq	K, %rax
	subq	KKK, %rax
	leaq	(,%rax,    8), %rax
	leaq	(AO, %rax, 1), AO
	leaq	(BO, %rax, 8), BO
#endif

#if defined(TRMMKERNEL) && defined(LEFT)
	addq	$1, KK
#endif
	ALIGN_4

.L39:
#if defined(TRMMKERNEL) && !defined(LEFT)
	addl	$2, KK
#endif

	leaq	(C, LDC, 2), C		# c += 2 * ldc
	decq	J			# j --
	jg	.L01
	ALIGN_4

.L40:
	testq	$1, N
	je	.L999
	ALIGN_4

.L41:
#if defined(TRMMKERNEL) && defined(LEFT)
	movq	OFFSET, %rax
	movq	%rax, KK
#endif

/* Copying to Sub Buffer */
	leaq	BUFFER, BO

	movq	K, %rax
	sarq	$2, %rax
	jle	.L43
	ALIGN_4

.L42:
	movss	 -32 * SIZE(B), %xmm8
	movss	 -31 * SIZE(B), %xmm9
	movss	 -30 * SIZE(B), %xmm10
	movss	 -29 * SIZE(B), %xmm11
	movss	 -28 * SIZE(B), %xmm


  }

        var doMod = cc switch {
            { IsPC: true } => true,
            { IsPCFaction: true } or { OriginalHostility: >= Hostility.Friend } => true,
            null or { hostility: > Hostility.Enemy } => true,
            _ => false,
        };

        if (!doMod) {
            return;
        }

        Msg.SetColor("bad");
        Msg.Say(KocLoc.CaughtPrompt);
        if (witnesses != 0) {
            Msg.Say(KocLoc.WithWitness(witnesses));
        }

        EClass.player.ModKarma(modifier);
        _skipped = true;
    }
}


    const _year=Number(year);
    const _month=Number(month);
    const date=_month<12?new Date(_year,_month,0):new Date(_year+1,0,0);
    const currentMonthLength:number=date.getDate();
    const list=Array.from({length:currentMonthLength}
      ,(_,index)=>{
        const d:string=fillDateWithZero(index+1);
        const _date=`${_year}-${fillDateWithZero(_month)}-${d}`;
        const _weekday=new Date(_date).getDay();
        return {date:_date,weekday:_weekday,week:WEEK_NUM[_weekday],year,month:fillDateWithZero(_month),day:index+1};
      });
    return list;
};
  // 日历视图的datelist
  // date:YYYY-MM-DD格式, YYYY不能缺省
  export const getDateListOfCurrentMonth=(date:string)=>{
    let result:any=[];
    if(!date||!date.split ||!date.split('-') ||!date.split('-').length) return result;
    const arr=date.split('-');
    const _year:string =arr[0];
    const _month :string =arr[1];
    if(_year&&_month){
      const currentList:any= getDateListByMonth(_year,_month);
      let preList:any=[];
      let nextList:any=[];
      const firstdayweekday=new Date(`${_year}-${_month}-01`).getDay();
      const prefixlenth=(firstdayweekday-SHOW_FIRST_WEEK_DAY)>=0?firstdayweekday-SHOW_FIRST_WEEK_DAY:7-(SHOW_FIRST_WEEK_DAY-firstdayweekday);// 以周几作为日历的第一位就减几
      if(prefixlenth>0){
        preList=Number(_month)===1?getDateListByMonth(Number(_year)-1,12):getDateListByMonth(_year,Number(_month)-1);
        preList=preList.splice(-prefixlenth);
        preList=preList.map((item:any)=>{
          item.isPrevMonth=true;
          item.disabled=true;
          return item;
        }) ||[];
      }
      const lastdayweekday=currentList[currentList.length-1].weekday;
      const subfixlength=7-lastdayweekday + SHOW_FIRST_WEEK_DAY-1;
      if(subfixlength){
          nextList=Number(_month)===12?getDateListByMonth(Number(_year)+1,1):getDateListByMonth(_year,Number(_month)+1);
          nextList=nextList.splice(0,subfixlength);
          nextList=nextList.map((item:any)=>{
            item.isNextMonth=true;
            item.disabled=true;
            return item;
          }) ||[];
      }
      result=result.concat(preList,currentList,nextList);
      return result;
    }else{
      return [];
    }
  };
  export const isDateInRange=(start,end)=>{
    const {y:startY,m:startM}=getYearMonthDay(start);
    const {y:endY,m:endM}=getYearMonthDay(end);
    if(startY>endY || (startY===endY&&startM>=endM)) return false;
    return true;

  };

  export const IMAGE_SRC_MAP={
    // 空白占位图
    'blankServiceImage':'http://image1.ljcdn.com/rent-front-image/e85157cb229559a393c605d6f4a82af9.png',
    // 当前日期
    'calendarTitleIcon':'http://image1.ljcdn.com/rent


import csv
import sys
import os
from Bio import SeqIO

def read_hla_file(filename):
    # 使用字典来存储每个样本的HLA类型
    hla_data = {}

    with open(filename, 'r') as file:
        # 创建一个csv阅读器，假设字段是通过制表符分隔的

        # 遍历文件中的每一行
        for idx, row in enumerate(file):
            if idx!=2:
                continue
            items=row.strip().split("\t")
            for iti, it in enumerate(items):
                if iti==0:
                    continue
                allele=it.split(",")[0]
                gene_tag=allele.split("*")[0]
                gene_dict[gene_tag].append(allele)

def replace_single_contig_name(input_file, output_file, new_contig_name):
    # 读取FASTA文件
    record = next(SeqIO.parse(input_file, "fasta"))

    # 更改contig名字
    record.id = new_contig_name
    record.description = new_contig_name

    # 写入新的FASTA文件
    SeqIO.write([record], output_file, "fasta")
    print("Contig name replaced successfully.")

def build_ref():
    # Write the reference file
    # shell code
    for gene, alleles in gene_dict.items():
        gene_dir=f"{HLA_dir}/{gene}"
        if not os.path.exists(gene_dir):
            os.makedirs(gene_dir)
        db_ref=db_ref_dir+f"/HLA_{gene}.fasta"
        for allele_idx, allele in enumerate(alleles):
            allele_idx+=1
            print(f"processing {gene} {allele} {allele_idx}")
            cmd=f"""
                samtools faidx {db_ref} {allele}>{gene_dir}/HLA_{gene}.raw.{allele_idx}.fa
            """
            os.system(cmd)
            replace_single_contig_name(f"{gene_dir}/HLA_{gene}.raw.{allele_idx}.fa", f"{gene_dir}/HLA_{gene}.{allele_idx}.fa", f"HLA_{gene}_ref{allele_idx}")

            os.system(cmd)
        merged_ref=f"{gene_dir}/HLA_{gene}.2allele.fa"

        cmd=f"""
            cat {gene_dir}/HLA_{gene}.1.fa  {gene_dir}/HLA_{gene}.2.fa > {merged_ref}
        """
        if len(set(alleles))==1:
            cmd=f"""
            cp {gene_dir}/HLA_{gene}.1.fa {merged_ref}
            """
        os.system(cmd)
        cmd=f"""
        samtools faidx {merged_ref}
        bwa index {merged_ref}
        faToTwoBit {merged_ref} {gene_dir}/HLA_{gene}.2allele.2bit
        makeblastdb -in {merged_ref} -dbtype nucl -parse_seqids -out {gene_dir}/HLA_{gene}.2allele
        """
        os.system(cmd)
        ref_count_file_f.write(f"{gene}\t{len(set(alleles))}\n")

def main():
    filename=f"{filedir}/hla.new.result.txt"
    read_hla_file(filename)
    print(gene_dict)
    build_ref()

if __name__ == "__main__":
    if len(sys.argv) <2:
        print("Usage: python script.py <filename>")
        sys.exit(1)

    filedir = sys.argv[1]
    sample=sys.argv[2]
    db_ref_dir=sys.argv[3]
    db_build_dir=sys.argv[4]
    ref_count_file=sys.argv[5]
    HLA_dir = f"{db_build_dir}/HLA"
    if not os.path.exists(HLA_dir):
        os.makedirs(HLA_dir)
    genes=["A","B","C","DPA1","DPB1","DQA1","DQB1", "DRB1"]
    gene_dict={}
    for gene in genes:
        gene_dict[gene]=[]
    ref_count_file_f=open(ref_count_file,"w")
    main()
    ref_count_file_f.close()


X_TASK_COUNT) {
            //超过最大下载数，添加进等待队列
            task.state = WAITING
            updateTask(task)
            waitTask.offer(task)
            return
        }

        task.state = DOWNLOADING
        updateTask(task)
        downloadingTask.add(task)

        //如果想使用RxJava或Flow下载，更改以下代码即可
        CoroutineScope(Dispatchers.Main).launch {
            RxHttp.get(task.url)
                .tag(task.url) //记录tag，手动取消下载时用到
                .toDownloadFlow(task.localPath, true)
                .onProgress{
                    //下载进度回调,0-100，仅在进度有更新时才会回调
                    task.progress = it.fraction        //当前进度 [0.0, 1.0]
                    task.currentSize = it.currentSize  //当前已下载的字节大小
                    task.totalSize = it.totalSize      //要下载的总字节大小
                    updateTask(task)
                    val key = task.url
                    val length = lengthMap[key]
                    if (length != task.totalSize) {
                        //服务器返回的文件总大小与本地的不一致，则更新
                        lengthMap[key] = task.totalSize
                        saveTotalSize(lengthMap)
                    }
                }.catch {
                    //手动取消下载时，会收到StreamResetException异常，不做任何处理
                    if (it !is StreamResetException) {
                        Tip.show("下载失败")
                        task.state = FAIL
                    }
                }.collect {
                    Tip.show("下载成功")
                    task.state = COMPLETED
                }

            //下载结束，不管任务成功还是失败，如果还有在等待的任务，都开启下一个任务
            updateTask(task)
            downloadingTask.remove(task)
            waitTask.poll()?.let { download(it) }
        }
    }

    private fun saveTotalSize(map: HashMap<String, Long>) {
        val editor = Preferences.getEditor()
        for ((key, value) in map) {
            val md5Key = key.encodeUtf8().md5().hex()
            editor.putLong(md5Key, value)
        }
        editor.commit()
    }

    //关闭所有任务
    @JvmStatic
    fun cancelAllTask() {
        var iterator = waitTask.iterator()
        while (iterator.hasNext()) {
            val task = iterator.next()
            task.state = CANCEL
            iterator.remove()
            updateTask(task)
        }

        iterator = downloadingTask.iterator()
        while (iterator.hasNext()) {
            val task = iterator.next()
            iterator.remove()
            RxHttpPlugins.cancelAll(task.url)
            task.state = CANCEL
            updateTask(task)
        }
    }

    //等待中->取消下载
    @JvmStatic
    fun removeWaitTask(task: DownloadTask) {
        waitTask.remove(task)
        task.state = CANCEL
        updateTask(task)
    }

    //暂停下载
    @JvmStatic
    fun pauseTask(task: DownloadTask) {
        //根据tag取消下载
        RxHttpPlugins.cancelAll(task.url)
        task.state = PAUSED
        updateTask(task)
    }

    @JvmStatic
    fun haveTaskExecuting(): Boolean {
        return waitTask.size > 0 || downloadingTask.size > 0
    }

    //发送通知，更新UI
    private fun updateTask(task: DownloadTask) {
        liveTask.value = task


arios().addAll((Collection<? extends PCMInterfaceUncertaintyScenario>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case PcmPackage.PCM_INTERFACE_UNCERTAINTY_SOURCE__TARGET:
				setTarget((OperationSignature)null);
				return;
			case PcmPackage.PCM_INTERFACE_UNCERTAINTY_SOURCE__SCENARIOS:
				getScenarios().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case PcmPackage.PCM_INTERFACE_UNCERTAINTY_SOURCE__TARGET:
				return target != null;
			case PcmPackage.PCM_INTERFACE_UNCERTAINTY_SOURCE__SCENARIOS:
				return scenarios != null && !scenarios.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //PCMInterfaceUncertaintySourceImpl
/**
 */
package dev.abunai.confidentiality.analysis.model.uncertainty.dfd.impl;

import dev.abunai.confidentiality.analysis.model.uncertainty.dfd.DFDInterfaceUncertaintyScenario;
import dev.abunai.confidentiality.analysis.model.uncertainty.dfd.DfdPackage;

import dev.abunai.confidentiality.analysis.model.uncertainty.impl.UncertaintyScenarioImpl;

import org.dataflowanalysis.dfd.datadictionary.Pin;
import org.dataflowanalysis.dfd.dataflowdiagram.Node;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 *
 * An implementation of the model object 'DFD Interface Uncertainty Scenario'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link dev.abunai.confidentiality.analysis.model.uncertainty.dfd.impl.DFDInterfaceUncertaintyScenarioImpl#getTargetInPin Target In Pin}

 *
{@link dev.abunai.confidentiality.analysis.model.uncertainty.dfd.impl.DFDInterfaceUncertaintyScenarioImpl#getTargetNode Target Node}

 *

 *
 * @generated
 */
public class DFDInterfaceUncertaintyScenarioImpl extends UncertaintyScenarioImpl implements DFDInterfaceUncertaintyScenario {
	/**
	 * The cached value of the '{@link #getTargetInPin() Target In Pin}' reference.
	 *
	 *
	 * @see #getTargetInPin()
	 * @generated
	 * @ordered
	 */
	protected Pin targetInPin;

	/**
	 * The cached value of the '{@link #getTargetNode() Target Node}' reference.
	 *
	 *
	 * @see #getTargetNode()
	 * @generated
	 * @ordered
	 */
	protected Node targetNode;

	/**
	 *
	 *
	 * @generated
	 */
	protected DFDInterfaceUncertaintyScenarioImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass


      Self::Binary => Collation::Binary,
            Self::Cp1250 => Collation::Cp1250GeneralCi,
            Self::Cp1251 => Collation::Cp1251GeneralCi,
            Self::Cp1256 => Collation::Cp1256GeneralCi,
            Self::Cp1257 => Collation::Cp1257GeneralCi,
            Self::Cp850 => Collation::Cp850GeneralCi,
            Self::Cp852 => Collation::Cp852GeneralCi,
            Self::Cp866 => Collation::Cp866GeneralCi,
            Self::Cp932 => Collation::Cp932JapaneseCi,
            Self::Dec8 => Collation::Dec8SwedishCi,
            Self::Eucjpms => Collation::EucjpmsJapaneseCi,
            Self::Euckr => Collation::EuckrKoreanCi,
            Self::Gb18030 => Collation::Gb18030ChineseCi,
            Self::Gb2312 => Collation::Gb2312ChineseCi,
            Self::Gbk => Collation::GbkChineseCi,
            Self::Geostd8 => Collation::Geostd8GeneralCi,
            Self::Greek => Collation::GreekGeneralCi,
            Self::Hebrew => Collation::HebrewGeneralCi,
            Self::Hp8 => Collation::Hp8EnglishCi,
            Self::Keybcs2 => Collation::Keybcs2GeneralCi,
            Self::Koi8R => Collation::Koi8RGeneralCi,
            Self::Koi8U => Collation::Koi8UGeneralCi,
            Self::Latin1 => Collation::Latin1SwedishCi,
            Self::Latin2 => Collation::Latin2GeneralCi,
            Self::Latin5 => Collation::Latin5TurkishCi,
            Self::Latin7 => Collation::Latin7GeneralCi,
            Self::Macce => Collation::MacceGeneralCi,
            Self::Macroman => Collation::MacromanGeneralCi,
            Self::Sjis => Collation::SjisJapaneseCi,
            Self::Swe7 => Collation::Swe7SwedishCi,
            Self::Tis620 => Collation::Tis620ThaiCi,
            Self::Ucs2 => Collation::Ucs2GeneralCi,
            Self::Ujis => Collation::UjisJapaneseCi,
            Self::Utf16 => Collation::Utf16GeneralCi,
            Self::Utf16Le => Collation::Utf16LeGeneralCi,
            Self::Utf32 => Collation::Utf32GeneralCi,
            Self::Utf8 => Collation::Utf8GeneralCi,
            Self::Utf8Mb4 => Collation::Utf8Mb40900AiCi,
            Self::Unknown(_) => panic!("unknown"),
        }
    }

    pub fn max_len(&self) -> u32 {
        match self {
            Self::Armscii8 => 1,
            Self::Ascii => 1,
            Self::Big5 => 2,
            Self::Binary => 1,
            Self::Cp1250 => 1,
            Self::Cp1251 => 1,
            Self::Cp1256 => 1,
            Self::Cp1257 => 1,
            Self::Cp850 => 1,
            Self::Cp852 => 1,
            Self::Cp866 => 1,
            Self::Cp932 => 2,
            Self::Dec8 => 1,
            Self::Eucjpms => 3,
            Self::Euckr => 2,
            Self::Gb18030 => 4,
            Self::Gb2312 => 2,
            Self::Gbk => 2,
            Self::Geostd8 => 1,
            Self::Greek => 1,
            Self::Hebrew => 1,
            Self::Hp8 => 1,
            Self::Keybcs2 => 1,
            Self::Koi8R => 1,
            Self::Koi8U => 1,
            Self::Latin1 => 1,
            Self::Latin2 => 1,
            Self::Latin5 => 1,
            Self::Latin7 => 1,
            Self::Macce =>


Percent = basic.Args{InjectId: networkFault.ID, ExecType: ExecInject, Key: "percent", KeyCn: "包重复率", Description: "packet loss rate", DescriptionCn: "丢包率", ValueType: "int", Required: true, ValueRule: "1-100"}

	argList := []*basic.Args{&NetworkArgsPercent}
	argList = append(argList, getNetworkCommonFilterParameters(networkFault)...)
	return basic.InsertArgsMulti(ctx, argList)
}

func InitNetworkTargetArgsReorder(ctx context.Context, networkFault basic.Fault) error {
	var (
		NetworkArgsLatency = basic.Args{InjectId: networkFault.ID, ExecType: ExecInject, Key: "latency", KeyCn: "包延迟", Unit: "us,ms,s", UnitCn: "us,ms,s", DefaultValue: "1s", Description: "Delay", DescriptionCn: "延迟时间", ValueType: "int", Required: true}
		NetworkArgsGap     = basic.Args{InjectId: networkFault.ID, ExecType: ExecInject, Key: "gap", KeyCn: "KeyCn", DefaultValue: "3", Description: "Select the interval. For example, a gap of 3 means that packets with serial numbers 1, 3, 6, 9, etc. will not be delayed, and the remaining packets will be delayed", DescriptionCn: "选中间隔,比如gap为3表示序号为1、3、6、9等的包不延迟,其余的包会延迟", ValueType: "int", ValueRule: ">0"}
	)
	argList := []*basic.Args{&NetworkArgsLatency, &NetworkArgsGap}
	argList = append(argList, getNetworkCommonFilterParameters(networkFault)...)
	return basic.InsertArgsMulti(ctx, argList)
}

func InitProcessFault(ctx context.Context, processTarget basic.Target) error {
	var (
		processFaultKill = basic.Fault{TargetId: processTarget.ID, Name: "kill", NameCn: "杀进程", Description: "To kill the target process, provide at least one of the pid and key parameters. When both are provided, the pid will prevail and the key will be ignored.", DescriptionCn: "把目标进程杀掉,pid和key参数至少提供一个,都提供的时候,以pid为准,忽略key"}
		processFaultStop = basic.Fault{TargetId: processTarget.ID, Name: "stop", NameCn: "停止进程", Description: "Stop the target process. Provide at least one of the pid and key parameters. When both are provided, the pid will prevail and the key will be ignored.", DescriptionCn: "停止目标进程,pid和key参数至少提供一个,都提供的时候,以pid为准,忽略key"}
	)
	if err := basic.InsertFault(ctx, &processFaultKill); err != nil {
		return err
	}
	if err := InitProcessTargetArgsKill(ctx, processFaultKill); err != nil {
		return err
	}

	if err := basic.InsertFault(ctx, &processFaultStop); err != nil {
		return err
	}
	return InitProcessTargetArgsStop(ctx, processFaultStop)
}

func InitProcessTargetArgsKill(ctx context.Context, processFault basic.Fault) error {
	var (
		ProcessArgsKey        = basic.Args{InjectId: processFault.ID, ExecType: ExecInject, Key: "key", KeyCn: "关键词", Description: "Keywords used to filter affected processes; Will use ps -ef | grep [key] to filter", DescriptionCn: "用来筛选受影响进程的关键词;会使用ps -ef | grep [key]来筛选", ValueType: "string"}


k.Start();
					}
				}
			}
			catch (Exception ex)
			{
				_log.FatalException(String.Format("Service {0} - Unexpected Error - Failed to start", ServiceName), ex);

				if (null != _currentTask)
				{
					_currentTask.Cancel();
					_currentTask = null;
				}

				//make sure that Windows knows that we're not running -- with the service messed, we can't
				throw;
			}
		}

		protected override void StopService()
		{
			//user asked for a stop, so cancel it -- and then punch them in the face!!
			_currentTask.CancelAndWait();
		}

		protected override void PauseService()
		{
			//TODO: this doesn't really make sense.... if this is a short-lived task, we should wait for it to finish
			 _currentTask.Task.Wait();
			//otherwise, we should cancel it
			//_currentTask.CancelAndWait();
		}
	}
}


3.49 3.49 0 0 1 6.95 6h4.55a2.5 2.5 0 0 0 0-5H6.95zM4.5 0h7a3.5 3.5 0 1 1 0 7h-7a3.5 3.5 0 1 1 0-7z"/>'),cb=s("Toggles2",'<path fill-rule="evenodd" d="M2 4a2 2 0 0 1 2-2h8a2 2 0 1 1 0 4H4a2 2 0 0 1-2-2zm2-1a1 1 0 0 0 0 2h8a1 1 0 1 0 0-2H4z"/><path d="M14 4a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/><path fill-rule="evenodd" d="M9.465 10H12a2 2 0 1 1 0 4H9.465c.34-.588.535-1.271.535-2 0-.729-.195-1.412-.535-2z"/><path fill-rule="evenodd" d="M6 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"/>'),ub=s("Tools",'<path fill-rule="evenodd" d="M0 1l1-1 3.081 2.2a1 1 0 0 1 .419.815v.07a1 1 0 0 0 .293.708L10.5 9.5l.914-.305a1 1 0 0 1 1.023.242l3.356 3.356a1 1 0 0 1 0 1.414l-1.586 1.586a1 1 0 0 1-1.414 0l-3.356-3.356a1 1 0 0 1-.242-1.023L9.5 10.5 3.793 4.793a1 1 0 0 0-.707-.293h-.071a1 1 0 0 1-.814-.419L0 1zm11.354 9.646a.5.5 0 0 0-.708.708l3 3a.5.5 0 0 0 .708-.708l-3-3z"/><path fill-rule="evenodd" d="M15.898 2.223a3.003 3.003 0 0 1-3.679 3.674L5.878 12.15a3 3 0 1 1-2.027-2.027l6.252-6.341A3 3 0 0 1 13.778.1l-2.142 2.142L12 4l1.757.364 2.141-2.141zm-13.37 9.019L3.001 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026z"/>'),sb=s("Trash",'<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1


#include <gbdk/platform.h>

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#include "sample_player.h"

#include "cowbell_8bit_pcm_unsigned.h"
#include "risset_drum_8bit_pcm_unsigned.h"

uint8_t joy = 0, old_joy;
inline void PROCESS_INPUT(void) {
    old_joy = joy, joy = joypad();
}
inline uint8_t KEY_PRESSED(uint8_t key) {
    return ((joy & ~old_joy) & key);
}

void main(void) {
    puts("PRESS A/B TO PLAY\n");
    uint8_t bank_save;
    while (true) {
        PROCESS_INPUT();

        if (KEY_PRESSED(J_A)) {
            bank_save = CURRENT_BANK;
            SWITCH_ROM(BANK(cowbell_8bit_pcm_unsigned));
            play_sample(cowbell_8bit_pcm_unsigned, sizeof(cowbell_8bit_pcm_unsigned));
            cut_sample(SFX_CH_1 | SFX_CH_2 | SFX_CH_3);
            SWITCH_ROM(bank_save);

        } else if (KEY_PRESSED(J_B)) {
            bank_save = CURRENT_BANK;
            SWITCH_ROM(BANK(risset_drum_8bit_pcm_unsigned));
            play_sample(risset_drum_8bit_pcm_unsigned, sizeof(risset_drum_8bit_pcm_unsigned));
            cut_sample(SFX_CH_1 | SFX_CH_2 | SFX_CH_3);
            SWITCH_ROM(bank_save);
        }
        vsync();
    }
}


using Common;
using Master;
using System;
using System.Text;

namespace Serialization;

public class MessageFactory
{
    private readonly Random numGenerator;

    public MessageFactory()
    {
        numGenerator = new Random();
    }

    private string GetRandomString(int length)
    {
        var sb = new StringBuilder();
        for (var i = 0; i < length; i++)
        {
            sb.Append(((char)(numGenerator.Next(0, 26) + 65)));
        }
        return sb.ToString();
    }

    public MasterMessage Heartbeat()
    {
        var m = new MasterMessage
        {
            Heartbeat = new Heartbeat()
            {
                OneWay = true
            },
            RndB = GetRandomString(numGenerator.Next(1, 5)),
            RndE = GetRandomString(numGenerator.Next(1, 5))
        };
        return m;
    }

    public MasterMessage Request(Request dataRequest)
    {
        return new MasterMessage()
        {
            Request = dataRequest,
            RndB = GetRandomString(numGenerator.Next(1, 3)),
            RndE = GetRandomString(numGenerator.Next(1, 3)),
        };
    }

    public MasterMessage ConnectionResult(HandshakeResult result, string message) => new()
    {
        Handshake = new Echo()
        {
            Result = result,
            Message = message
        },
        RndB = String.Empty,
        RndE = String.Empty
    };

    public MasterMessage MouseMove(int x, int y) => new()
    {
        MousePosition = new MouseMove
        {
            X = x,
            Y = y
        },
        RndB = String.Empty,
        RndE = String.Empty
    };

    public MasterMessage MouseWheel(Direction direction, int amount) => new()
    {
        MouseWheel = new()
        {
            ScrollDirection = direction,
            Amount = amount
        },
        RndB = Str


    Args:
        half_batch_size (int): Size of half batch (which corresponds to the number of positive examples).
        buffer_size (int): Number of batches that will be buffered.

    Returns:
        groups (list[list[int]]): List of list of indices of observations from the corresponding contrastive class.
    """
    groups = [
        torch.arange(half_batch_size) + half_batch_size * i for i in range(buffer_size)
    ]
    return groups

# TODO: Implement CLIP-inspired contrastive loss
# class ContrastiveLoss (Normlized Temperature-scaled CrossEntropy NT-Xent)
# def forward(self, input: Tensor, target: Tensor) -> Tensor:
#     return F.cross_entropy(
#         input,
#         target,
#         weight=self.weight,
#         ignore_index=self.ignore_index,
#         reduction=self.reduction,
#         label_smoothing=self.label_smoothing,
#     )


);

  // check if drag images are disabled
  bool enableDragImages = Preferences::GetBool(DRAGIMAGES_PREF, true);

  // didn't want an image, so just set the screen rectangle to the frame size
  if (!enableDragImages || !mHasImage) {
    // This holds a quantity in RelativeTo{presShell->GetRootFrame(),
    // ViewportType::Layout} space.
    nsRect presLayoutRect;
    if (aRegion) {
      // if a region was specified, set the screen rectangle to the area that
      // the region occupies
      presLayoutRect = ToAppUnits(aRegion->GetBounds(), AppUnitsPerCSSPixel());
    } else {
      // otherwise, there was no region so just set the rectangle to
      // the size of the primary frame of the content.
      nsCOMPtr<nsIContent> content = do_QueryInterface(dragNode);
      nsIFrame* frame = content->GetPrimaryFrame();
      if (frame) {
        presLayoutRect = frame->GetRect();
      }
    }

    LayoutDeviceRect screenVisualRect = ViewportUtils::ToScreenRelativeVisual(
        LayoutDeviceRect::FromAppUnits(presLayoutRect,
                                       (*aPresContext)->AppUnitsPerDevPixel()),
        *aPresContext);
    aScreenDragRect->SizeTo(screenVisualRect.Width(),
                            screenVisualRect.Height());
    return NS_OK;
  }

  // draw the image for selections
  if (mSelection) {
    LayoutDeviceIntPoint pnt(aScreenDragRect->TopLeft());
    *aSurface = presShell->RenderSelection(
        mSelection, pnt, aScreenDragRect,
        mImage ? RenderImageFlags::None : RenderImageFlags::AutoScale);
    return NS_OK;
  }

  // if a custom image was specified, check if it is an image node and draw
  // using the source rather than the displayed image. But if mImage isn't
  // an image or canvas, fall through to RenderNode below.
  if (mImage) {
    nsCOMPtr<nsIContent> content = do_QueryInterface(dragNode);
    HTMLCanvasElement* canvas = HTMLCanvasElement::FromNodeOrNull(content);
    if (canvas) {
      return DrawDragForImage(*aPresContext, nullptr, canvas, aScreenDragRect,
                              aSurface);
    }

    nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(dragNode);
    // for image nodes, create the drag image from the actual image data
    if (imageLoader) {
      return DrawDragForImage(*aPresContext, imageLoader, nullptr,
                              aScreenDragRect, aSurface);
    }

    // If the image is a popup, use that as the image. This allows custom drag
    // images that can change during the drag, but means that any platform
    // default image handling won't occur.
    // XXXndeakin this should be chrome-only

    nsIFrame* frame = content->GetPrimaryFrame();
    if (frame && frame->IsMenuPopupFrame()) {
      mDragPopup = content;
    }
  }

  if (!mDragPopup) {
    // otherwise, just draw the node
    RenderImageFlags renderFlags =
        mImage ? RenderImageFlags::None : RenderImageFlags::AutoScale;
    if (renderFlags != RenderImageFlags::None) {
      // check if the dragged node itself is an img element
      if (dragNode->NodeName().LowerCaseEqualsLiteral("img")) {
        renderFlags = renderFlags | RenderImageFlags::IsImage;
      } else {
        nsINodeList* childList = dragNode->ChildNodes();
        uint32_t length = childList->Length();
        // check every childnode for being an img element
        // XXXbz why don't we need to check descendants recursively?
        for (uint32_t count = 0; count < length; ++count) {


仪式进行到一半就被打断，基尔和碧莉娜还不是正式的夫妇关系。欧鲁巴再次戴上皇子的面具挂好表情，请她们入座，可碧莉娜依然直立不动。

“我有话想要对您说，虽然知道这显得非常无礼。”

一张口，便带着即将面临战场的士兵般表情的碧莉娜这么说道。她的来意，想要说的内容，大致已经猜到了。这次的事件绝对不是本国的意思，加贝拉没有想要再次与梅菲乌斯开战的想法，碧莉娜这么陈述着。

“那么”欧鲁巴打断了对方的话。“你是想说那个叫留卡奥的，不是加贝拉侧的人吗？”

这个名字一被提出来，少女顿时低垂眼眸，紧咬嘴唇犹豫了半响，随后松开嘴唇。用看着自己仇敌的目光死盯着欧鲁巴。

“没错。既然发生了这种事——这个消息已经传达给本国了，将会剥夺留卡奥的爵位，同时他也会失去加贝拉的国籍。”

“这件事是留卡奥个人的计策吗？”

“我只能这么认为。想要把我带走的士兵们提到了留卡奥的名字。加贝拉境内还有征讨梅菲乌斯的气概以及实力的，现在也只剩下他一个人了。”

“留卡奥是，”

“嗯？”

“是一个怎么样的人？”

有着黑亮眼珠的眼眸瞪得滚圆。因为欧鲁巴语气非常平淡，在自己早已做好思想准备的时候，居然被问了意料之外的问题。

“当然，他的威名在我们梅菲乌斯也非常响亮，但我却不清楚他本人是个怎样的人。公主殿下见过他吗？”

“嗯——见过。”

留卡奥是加贝拉领内某个地方豪族的血统。可正式隶属加贝拉家臣的只