RJ\n\nN\u00d3 - Dist\u00e2ncia Alvo: 3\n GRAFO - N\u00f3s: 2129, Arestas: 3992, Camadas Solicitadas: 3, Conectado: Sim\nMensagem: \n N\u00f3s Adjacentes (Grau 4):\n--\u003e EN_ANDAR CHILE REPUBLICA TORRE 330 25 2-RIO DE JANEIRO-RJ\n--\u003e TE_21 35509150\n\u003c-- PJ_PETROLEO BRASILEIRO S A PETROBRAS - Ativa - (Sociedade Consorciada)\n\u003c-- PJ_SHELL BRASIL PETROLEO LTDA - Ativa - (Sociedade Consorciada)", "value": "4", "z_ancestor": "false", "z_group": 7, "z_group_total": 7, "z_novo": 1}, {"algoritmos": "Betweenness Centrality: VALE S.A.\nCloseness Centrality:      VALE S.A.\nEigenvector Centrality:   PETROLEO BRASILEIRO S A PETROBRAS\nDegree Centrality:          PETROLEO BRASILEIRO S A PETROBRAS\nPagerank (Bidirecional): PETROLEO BRASILEIRO S A PETROBRAS\n\n#####  BETWEENNESS CENTRALITY  #####\n1) VALE S.A.: 703978.349\n2) PETROLEO BRASILEIRO S A PETROBRAS: 296886.894\n3) PF_***903168**-MARCELO FERIOZZI BACCI: 149941.32\n#####  CLOSENESS CENTRALITY  #####\n1) VALE S.A.: 0.366\n2) CONSORCIO BM-ES-27: 0.31\n3) CONSORCIO BM-S-48: 0.309\n#####  EIGENVECTOR CENTRALITY  #####\n1) PETROLEO BRASILEIRO S A PETROBRAS: 0.624\n2) PF_***382706**-FERNANDO ASSUMPCAO BORGES: 0.195\n3) SHELL BRASIL PETROLEO LTDA: 0.147\n#####  PAGERANK (ARESTAS BIDIRECIONAIS)  #####\n1) PETROLEO BRASILEIRO S A PETROBRAS: 0.067\n2) ENGIE BRASIL ENERGIA S.A.: 0.021\n3) SHELL BRASIL PETROLEO LTDA: 0.021", "camadas_solicitadas": 3, "font": {"color": "#777777"}, "id": "PJ_18512840000107", "image": "images\\pj_brasil_ativa.png", "label": "CONSORCIO BAR-M-388_R11", "shape": "image", "size": 20, "title": "CONSORCIO BAR-M-388_R11 (PJ_18512840000107)\nAVENIDA REPUBLICA DO CHILE, 330 - 25 ANDAR TORRE 2-CENTRO - RIO DE JANEIRO - RJ\n\nN\u00d3 - Dist\u00e2ncia Alvo: 3\n GRAFO - N\u00f3s: 2129, Arestas: 3992, Camadas Solicitadas: 3, Conectado: Sim\nMensagem: \n N\u00f3s Adjacentes (Grau 4):\n--\u003e EN_ANDAR CHILE REPUBLICA TORRE 330 25 2-RIO DE JANEIRO-RJ\n--\u003e TE_21 35509150\n\u003c-- PJ_PETROLEO BRASILEIRO S A PETROBRAS - Ativa - (Sociedade Consorciada)\n\u003c-- PJ_SHELL BRASIL PETROLEO LTDA - Ativa


#!/usr/bin/env python3

from parsers import FType

def readFlags(ll, f):
	flags = {}
	for l in ll:
		flags[l[0]] = f & (2**(l[1]+1)-1)
		f >>= l[1]
	return flags

class parser(FType):
	DESC = "GIF / Graphics Interchange Format"
	TYPE = "GIF"
	SUBBLOCK_MAX = 255 # max size of a subblock chunk

	def __init__(self, data=""):
		FType.__init__(self, data)
		self.data = data

		self.bParasite = True
		self.parasite_o = 16     # Extension, right after the header (extreme case if there's no global palette)
		self.parasite_s = self.SUBBLOCK_MAX	# put a higher value for a chunked payload

		self.cut = 13     # variable if global palette is present
		self.prewrap = 3
		self.postwrap = 1 # terminator of the comment

	def identify(self):
		# in theory, only GIF 89 support comments
		# but in practice, it's irrelevant
		return self.data.startswith(b"GIF87a") or \
			self.data.startswith(b"GIF89a")

	def wrap(self, parasite):
		left = len(parasite)
		chunked = b""
		index = 0
		while left > 0:
			this_length = min(left, self.SUBBLOCK_MAX)
			chunked += bytes([this_length]) + parasite[index:index + this_length]

			left -= this_length
			index += this_length
		assert index == len(parasite)
		chunked += bytes([0]) # terminator
		return b"!" + b"\xfe" + chunked

	def getCut(self):
		host = self.data

		# is there a Global Color Table?
		flags = readFlags([
			["GlobalColorTable",1],
			["ColorResolution", 3],
			["Sort", 1],
			["GCTSize", 3],
		][::-1],
			host[0xA]
		)

		gct_s = 3*(2<<(flags["GCTSize"])) if flags["GlobalColorTable"] == 1 else 0
		cut = 6 + 7 + gct_s

		self.cut = cut

		return self.cut


*

   * Optional. A set of tags to apply to all underlying control plane Azure
   * resources.
   *

   *
   * map<string, string> tags = 7 [(.google.api.field_behavior) = OPTIONAL];
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getTagsMap() {
    return internalGetTags().getMap();
  }

  /**
   *
   *
   *

   * Optional. A set of tags to apply to all underlying control plane Azure
   * resources.
   *

   *
   * map<string, string> tags = 7 [(.google.api.field_behavior) = OPTIONAL];
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getTagsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }

  /**
   *
   *
   *

   * Optional. A set of tags to apply to all underlying control plane Azure
   * resources.
   *

   *
   * map<string, string> tags = 7 [(.google.api.field_behavior) = OPTIONAL];
   */
  @java.lang.Override
  public java.lang.String getTagsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int REPLICA_PLACEMENTS_FIELD_NUMBER = 13;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.gkemulticloud.v1.ReplicaPlacement> replicaPlacements_;

  /**
   *
   *
   *

   * Optional. Configuration for where to place the control plane replicas.
   *
   * Up to three replica placement instances can be specified. If
   * replica_placements is set, the replica placement instances will be applied
   * to the three control plane replicas as evenly as possible.
   *

   *
   *
   * repeated .google.cloud.gkemulticloud.v1.ReplicaPlacement replica_placements = 13 [(.google.api.field_behavior) = OPTIONAL];
   *
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.gkemulticloud.v1.ReplicaPlacement>
      getReplicaPlacementsList() {
    return replicaPlacements_;
  }

  /**
   *
   *
   *

   * Optional. Configuration for where to place the control plane replicas.
   *
   * Up to three replica placement instances can be specified. If
   * replica_placements is set, the replica placement instances will be applied
   * to the three control plane replicas as evenly as possible.
   *

   *
   *
   * repeated .google.cloud.gkemulticloud.v1.ReplicaPlacement replica_placements = 13 [(.google.api.field_behavior) = OPTIONAL];
   *
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.gkemulticloud.v1.ReplicaPlacementOrBuil


aterin-mwd-schwein-fuer-die-region-ostdeutschland-27225?&utm_campaign=job-des-monats&utm_source=blw-webseite&utm_medium=stellenteaser">
AHV Deutschland GmbH

VERKAUFSBERATER/IN (M/W/D) SCHWEIN – für die Region  Ostdeutschland

  - 24.11.2022

BEST 3 Geflügelernährung GmbH

Produktfeldleiter Geflügelmast (m/w/d)

 Twistringen - 23.11.2022

Beratung für Naturland Erzeugerring für naturgemäßen Landbau e.V.

Berater für ökologischen Landbau (m/w/d), idealerweise Schwerpunkt Milchviehhaltung

 Landshut - 25.11.2022

Argo GmbH

Produktmanager (m/w/d)

 Burgoberbach - 23.11.2022

Riebensahm Agribusiness Recruiting

Fach- und Führ


  var $7759=$1638;
   $1637=$7759;
   var $7760=$1637;
   var $7761=$7760; //@line 2374 "G:/emscripten/system/include/libcxx/memory"
   $1636=$7761;
   var $7762=$1636;
   var $7763=$7762; //@line 2187 "G:/emscripten/system/include/libcxx/memory"
   $1635=$7763;
   var $7764=$1635;
   var $7765=(($7762)|0); //@line 2187 "G:/emscripten/system/include/libcxx/memory"
   $1634=$7756;
   var $7766=$1634;
   var $7767=(($7766)|0); //@line 1610 "G:/emscripten/system/include/libcxx/string"
   $1633=$7767;
   var $7768=$1633;
   var $7769=$7768; //@line 2432 "G:/emscripten/system/include/libcxx/memory"
   $1632=$7769;
   var $7770=$1632;
   var $7771=(($7770)|0); //@line 2253 "G:/emscripten/system/include/libcxx/memory"
   var $7772=(($7771)|0); //@line 1610 "G:/emscripten/system/include/libcxx/string"
   var $7773=$7772; //@line 1610 "G:/emscripten/system/include/libcxx/string"
   var $7774=(($7773)|0); //@line 1610 "G:/emscripten/system/include/libcxx/string"
   $__a_i_i_i_i_i_i227=$7774; //@line 1610 "G:/emscripten/system/include/libcxx/string"
   $__i_i_i_i_i_i_i228=0; //@line 1611 "G:/emscripten/system/include/libcxx/string"
   label = 999; break; //@line 1611 "G:/emscripten/system/include/libcxx/string"
  case 999:
   var $7776=$__i_i_i_i_i_i_i228; //@line 1611 "G:/emscripten/system/include/libcxx/string"
   var $7777=(($7776)>>>(0)) < 3; //@line 1611 "G:/emscripten/system/include/libcxx/string"
   if ($7777) { label = 1000; break; } else { label = 1001; break; } //@line 1611 "G:/emscripten/system/include/libcxx/string"
  case 1000:
   var $7779=$__i_i_i_i_i_i_i228; //@line 1612 "G:/emscripten/system/include/libcxx/string"
   var $7780=$__a_i_i_i_i_i_i227; //@line 1612 "G:/emscripten/system/include/libcxx/string"
   var $7781=(($7780+($7779<<2))|0); //@line 1612 "G:/emscripten/system/include/libcxx/string"
   HEAP32[(($7781)>>2)]=0; //@line 1612 "G:/emscripten/system/include/libcxx/string"
   var $7782=$__i_i_i_i_i_i_i228; //@line 1611 "G:/emscripten/system/include/libcxx/string"
   var $7783=((($7782)+(1))|0); //@line 1611 "G:/emscripten/system/include/libcxx/string"
   $__i_i_i_i_i_i_i228=$7783; //@line 1611 "G:/emscripten/system/include/libcxx/string"
   label = 999; break; //@line 1611 "G:/emscripten/system/include/libcxx/string"
  case 1001:


_TableH1 {
            get {
                return ResourceManager.GetString("UserPage_TableH1", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 电话号码 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH10 {
            get {
                return ResourceManager.GetString("UserPage_TableH10", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 头像 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH2 {
            get {
                return ResourceManager.GetString("UserPage_TableH2", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 用户名 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH3 {
            get {
                return ResourceManager.GetString("UserPage_TableH3", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 是否启用 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH4 {
            get {
                return ResourceManager.GetString("UserPage_TableH4", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 操作 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH5 {
            get {
                return ResourceManager.GetString("UserPage_TableH5", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 姓名 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH6 {
            get {
                return ResourceManager.GetString("UserPage_TableH6", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 角色 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH7 {
            get {
                return ResourceManager.GetString("UserPage_TableH7", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 组织 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH8 {
            get {
                return ResourceManager.GetString("UserPage_TableH8", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 邮箱 的本地化字符串。
        /// </summary>
        public static string UserPage_TableH9 {
            get {
                return ResourceManager.GetString("UserPage_TableH9", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 用户 的本地化字符串。
        /// </summary>
        public static string UserPage_Title {
            get {
                return ResourceManager.GetString("UserPage_Title", resourceCulture);
            }
        }
    }
}


erm::termcolor::NoColor::new(&mut buffer);

    term::emit(&mut writer, &config, &files, &diagnostic).ok()?;

    String::from_utf8(buffer).ok()
  }

  fn next_token(&mut self) -> Result<()> {
    mem::swap(&mut self.cur_token, &mut self.peek_token);
    mem::swap(&mut self.lexer_position, &mut self.peek_lexer_position);

    if let Some(next_token) = self.tokens.next() {
      let nt = next_token.map_err(Error::LEXER)?;
      self.peek_token = nt.1;
      self.peek_lexer_position = nt.0;
    }

    Ok(())
  }

  fn advance_to_next_rule(&mut self) -> Result<()> {
    let mut is_possible_rule = false;

    while !is_possible_rule {
      self.next_token()?;
      if let Token::IDENT(_) = self.cur_token {
        match self.peek_token {
          Token::ASSIGN | Token::TCHOICEALT | Token::GCHOICEALT => is_possible_rule = true,
          _ => continue,
        }
      } else if let Token::EOF = self.cur_token {
        is_possible_rule = true;
      }
    }

    Ok(())
  }

  #[cfg(feature = "ast-comments")]
  fn collect_comments(&mut self) -> Result<Option<Comments<'a>>> {
    #[cfg_attr(not(feature = "lsp"), allow(unused_mut))]
    let mut comments: Option<Comments> = None;

    while let Token::COMMENT(_comment) = self.cur_token {
      #[cfg(feature = "lsp")]
      comments.get_or_insert(Comments::default()).0.push(_comment);

      self.next_token()?;
    }

    while let Token::NEWLINE = self.cur_token {
      #[cfg(feature = "lsp")]
      comments.get_or_insert(Comments::default()).0.push("\n");

      self.next_token()?;
    }

    if let Token::COMMENT(_) = self.cur_token {
      if let Some(c) = self.collect_comments()? {
        #[cfg_attr(not(feature = "lsp"), allow(unused_mut))]
        for comment in c.0.iter() {
          comments.get_or_insert(Comments::default()).0.push(comment);
        }
      }
    }

    Ok(comments)
  }

  #[cfg(not(feature = "ast-comments"))]
  fn advance_newline(&mut self) -> Result<()> {
    while let Token::NEWLINE = self.cur_token {
      #[cfg(feature = "lsp")]
      comments.get_or_insert(Comments::default()).0.push("\n");

      self.next_token()?;
    }

    Ok(())
  }

  /// Parses into a `CDDL` AST
  pub fn parse_cddl(&mut self) -> Result<CDDL<'a>> {
    #[cfg(not(feature = "ast-comments"))]
    self.advance_newline()?;

    let mut c = CDDL {
      #[cfg(feature = "ast-comments")]
      comments: self.collect_comments()?,
      ..Default::default()
    };

    while self.cur_token != Token::EOF {
      match self.parse_rule() {
        Ok(r) => {
          let rule_exists =
            |existing_rule: &Rule| r.name() == existing_rule.name() && !r.is_choice_alternate();
          if c.rules.iter().any(rule_exists) {
            #[cfg(feature = "ast-span")]
            {
              self.parser_position.range = (r.span().0, r.span().1);
              self.parser_position.line = r.span().2;
            }

            self.errors.push(Error::PARSER {
              #[


        callback_skip_++;

        callout_handle.setStatus(CalloutHandle::NEXT_STEP_SKIP);

        return (0);
    }

    // Values to be used in callout to override lease6 content
    static const IOAddress addr_override_;
    static const uint32_t pref_override_;
    static const uint32_t valid_override_;

    // Callback will store original and overridden values here
    static IOAddress callback_addr_original_;
    static IOAddress callback_addr_updated_;

    // Buffers (callback will store received values here)
    static string callback_name_;
    static ConstSubnet6Ptr callback_subnet6_;
    static Lease6Ptr callback_lease6_;
    static bool callback_fake_allocation_;
    static vector<string> callback_argument_names_;
    static Pkt6Ptr callback_qry_pkt6_;
    static bool callback_qry_options_copy_;

    // Counter for next step skip (should be not retried)
    static unsigned callback_skip_;
};

// For some reason initialization within a class makes the linker confused.
// linker complains about undefined references if they are defined within
// the class declaration.
const IOAddress HookAllocEngine6Test::addr_override_("2001:db8::abcd");
const uint32_t HookAllocEngine6Test::pref_override_ = 8000;
const uint32_t HookAllocEngine6Test::valid_override_ = 9000;

IOAddress HookAllocEngine6Test::callback_addr_original_("::");
IOAddress HookAllocEngine6Test::callback_addr_updated_("::");

string HookAllocEngine6Test::callback_name_;
ConstSubnet6Ptr HookAllocEngine6Test::callback_subnet6_;
Lease6Ptr HookAllocEngine6Test::callback_lease6_;
bool HookAllocEngine6Test::callback_fake_allocation_;
vector<string> HookAllocEngine6Test::callback_argument_names_;
Pkt6Ptr HookAllocEngine6Test::callback_qry_pkt6_;
bool HookAllocEngine6Test::callback_qry_options_copy_;

unsigned HookAllocEngine6Test::callback_skip_;

// This test checks if the lease6_select callout is executed and expected
// parameters as passed.
TEST_F(HookAllocEngine6Test, lease6_select) {

    // Note: The following order is working as expected:
    // 1. create AllocEngine (that register hook points)
    // 2. call loadLibraries()
    //
    // This order, however, causes segfault in HooksManager
    // 1. call loadLibraries()
    // 2. create AllocEngine (that register hook points)

    // Create allocation engine (hook names are registered in its ctor)
    boost::scoped_ptr<AllocEngine> engine;
    ASSERT_NO_THROW(engine.reset(new AllocEngine(100)));
    ASSERT_TRUE(engine);

    // Initialize Hooks Manager
    HookLibsCollection libraries; // no libraries at this time
    ASSERT_NO_THROW(HooksManager::loadLibraries(libraries));

    // Install lease6_select
    EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
                        "lease6_select", lease6_select_callout));

    Lease6Ptr lease;
    AllocEngine::ClientContext6 ctx(subnet_, duid_, false, false, "", false,
                                    Pkt6Ptr(new Pkt6(DHCPV6_REQUEST, 1234)),
                                    HooksManager::createCalloutHandle());
    ctx.currentIA().iaid_ = iaid_;

    EXPECT_NO_THROW(lease = expectOneLease(engine->allocateLeases6(ctx)));
    // Check that we got a lease
    ASSERT_TRUE(lease);

    // Do all checks on the lease
    checkLease6(duid_, lease, Lease::TYPE_NA, 128);

    // Check that the lease is indeed in LeaseMgr
    Lease6Ptr from_mgr = LeaseMgrFactory::instance().getLease6(lease->type_,
                                                               lease->a


icrosoft Word 97">
<TITLE>win32</TITLE>
<META NAME="Version" CONTENT="8.0.3410">
<META NAME="Date" CONTENT="10/11/96">
<META NAME="Template" CONTENT="D:\Program Files\Microsoft Office\Office\HTML.DOT">

Freeze for Win32

This document describes how to use Freeze for the Win32 platform.

Freeze itself is a Python tool for creating stand-alone executables from Python source code.  This document does not attempt to document freeze itself - only the win32 specific changes.

Frozen programs under Win32

Frozen programs under Win32 can (theoretically) freeze any type of program supported by Python on Win32 - At the moment, Console .EXE and NT Service .EXE programs are supported.  GUI Python programs and COM .EXE programs are very nearly all ready to go.

Program Dependencies

The person freezing the program has control over what external DLLs are required by a frozen program.  The following dependencies are supported:

Minimal frozen programs

These programs freeze only .py files in your program.  All external DLLs are required at run-time.  This includes all .pyd/.dll modules used by your program, Python20.dll, and msvcrt.dll.

A small Python program would typically create a .EXE around 300kb.

Frozen Extension programs

Note: For Python1.5.1, you must get a patch from Guido to import.c for this to work.

These programs also freeze in the sources from all .pyd and .dll files used at runtime.  This means the resulting .EXE is only dependent on Python20.dll and msvcrt.dll.

A small Python program using win32api, win32con and one or 2 other win32 extensions would typically create a .EXE around 400kb.

Completely frozen programs

Completely stand-alone programs, as is the default on Unix systems.  These are currently not supported, mainly as the size of a decent Python program gets very large.  However, by tweaking the existing Unix support, this would not be difficult to do.

Freezing Extension Modules

By default, a file in the main "freeze" directory called "extensions_win32.ini" is used to obtain information about frozen extensions.  A typical entry is:

[win32api]

dsp=%PYTHONEX%\win32\win32api.dsp

cl=/I %PYTHONEX%\win32\src

libs=kernel32.lib user32.lib shell32.lib advapi32.lib

This entry indicates that the win32api extension module is defined in the MSVC project file "%PYTHONEX%\win32\win32api.dsp".  Note the use of "%PYTHONEX%" - most strings are substituted with environment variables


createWorker = this.createWorker;
        mode.inlinePhp = true;
        return mode;
    }
    HtmlMode.call(this);
    this.HighlightRules = PhpHighlightRules;
    this.createModeDelegates({
        "js-": JavaScriptMode,
        "css-": CssMode,
        "php-": PhpMode
    });
    this.foldingRules.subModes["php-"] = new CStyleFoldMode();
};
oop.inherits(Mode, HtmlMode);

(function() {

    this.createWorker = function(session) {
        var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker");
        worker.attachToDocument(session.getDocument());

        if (this.inlinePhp)
            worker.call("setOptions", [{inline: true}]);

        worker.on("error", function(e) {
            session.setAnnotations(e.data);
        });

        worker.on("ok", function() {
            session.clearAnnotations();
        });

        return worker;
    };

    this.$id = "ace/mode/php";
}).call(Mode.prototype);

exports.Mode = Mode;
});
define("ace/mode/vala_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";

var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

var ValaHighlightRules = function() {

    this.$rules = { start:
       [ { token:
            [ 'meta.using.vala',
              'keyword.other.using.vala',
              'meta.using.vala',
              'storage.modifier.using.vala',
              'meta.using.vala',
              'punctuation.terminator.vala' ],
           regex: '^(\\s*)(using)\\b(?:(\\s*)([^ ;$]+)(\\s*)((?:;)?))?' },
         { include: '#code' } ],
      '#all-types':
       [ { include: '#primitive-arrays' },
         { include: '#primitive-types' },
         { include: '#object-types' } ],
      '#annotations':
       [ { token:
            [ 'storage.type.annotation.vala',
              'punctuation.definition.annotation-arguments.begin.vala' ],
           regex: '(@[^ (]+)(\\()',
           push:
            [ { token: 'punctuation.definition.annotation-arguments.end.vala',
                regex: '\\)',
                next: 'pop' },
              { token:
                 [ 'constant.other.key.vala',
                   'text',
                   'keyword.operator.assignment.vala' ],
                regex: '(\\w*)(\\s*)(=)' },
              { include: '#code' },
              { token: 'punctuation.seperator.property.vala', regex: ',' },
              { defaultToken: 'meta.declaration.annotation.vala' } ] },
         { token: 'storage.type.annotation.vala', regex: '@\\w*' } ],
      '#anonymous-classes-and-new':
       [ { token: 'keyword.control.new.vala',
           regex: '\\bnew\\b',
           push_disabled:
            [ { token: 'text',
                regex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)',
                TODO: 'FIXME: regexp doesn\'t have js equivalent',
                originalRegex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)',
                next: 'pop' },
              { token: [ 'storage.type.vala', 'text' ],
                regex: '(\\w+)(\\s*)(?=\\[)',
                push:
                 [ { token: 'text', regex: '}|(?=;|\\))', next: 'pop' },
                   { token: 'text',
                     regex: '\\[',
                     push:
                      [ { token: 'text', regex: '\\]', next: 'pop' },
                        { include: '#code' } ] },
                   { token: 'text',


tate {
  [key: string]:
    | {
        loading: boolean;
        code: string;
        err: string;
      }
    | undefined;
}

const initialState: BundlesState = {};

// ------
// Reducers
// uses immer under the hood for mutable code
const slice = createSlice({
  name: 'bundles',
  initialState,
  reducers: {
    bundleStart: (state, action: PayloadAction<{ cellId: string }>) => {
      state[action.payload.cellId] = {
        loading: true,
        code: '',
        err: '',
      };
    },
    bundleComplete: (
      state,
      action: PayloadAction<{ cellId: string; bundle: { code: string; err: any } }>,
    ) => {
      state[action.payload.cellId] = {
        loading: false,
        code: action.payload.bundle.code,
        err: action.payload.bundle.err,
      };
    },
  },
});

export const { bundleStart, bundleComplete } = slice.actions;

export const createBundle = (cellId: string, input: string) => async (
  dispatch: Dispatch<RootActions>,
) => {
  dispatch({
    type: bundleStart.type,
    payload: {
      cellId,
    },
  });

  const result = await bundle(input);

  return dispatch({
    type: bundleComplete.type,
    payload: {
      cellId,
      bundle: result,
    },
  });
};

export default slice.reducer;
import * as React from "react";
import { ReactAnchorAttr, ReactAttr, ReactLIAttr } from "../../../typings/shared";

type ExcludedAttributes = "role" | "tabIndex";
interface InheritedProps extends Omit<ReactLIAttr, ExcludedAttributes> {
    href: NonNullable<ReactAnchorAttr["href"]>,
    tabIndex: NonNullable<ReactAttr["tabIndex"]>,
}

export interface TabCustomAnchorProvidedProps {
    "aria-selected": boolean,
    className: NonNullable<ReactAttr["className"]>,
    href: InheritedProps["href"],
    role: "tab",
    tabIndex: NonNullable<ReactAttr["tabIndex"]>,
}

export interface TabProps extends InheritedProps {
    handleTabAnchorFocus(index: TabProps["index"]): void,
    handleTabClick(index: TabProps["index"], label: TabProps["label"], event: React.MouseEvent<HTMLLIElement>): void,
    handleTabKeyDown(index: TabProps["index"], label: TabProps["label"], event: React.KeyboardEvent<HTMLLIElement>): void,
    index?: number,
    label?: React.ReactNode,
    renderAnchor?: React.FC<TabCustomAnchorProvidedProps>,
    role?: string, // marked as required, but render code overwrites it currently
    selected?: boolean, // required but has default value
}

declare class Tab extends React.Component<TabProps> { }

export default Tab;
import {
    ADD_TODOS,
    TOGGLE_COMPLETE,
    UPDATE_TODO,
    DESTROY_TODO,
    CLEAR_ALL_COMPLETED,
    FILTER_TODOS,
    TOGGLE_ALL
} from '../constants'

export interface Action {
    type: string,
    payload?: any
}

export interface TodoInterface {
    id: number,
    title: string,
    completed: boolean
}

export interface State {
    nowShowing: string,
    todos: TodoInterface[]
}

export const Todo = (state: State, action: Action): State => {
    switch (action.type) {
        case ADD_TODOS:
            return {...state, todos: [...state.todos, action.payload]};
        case TOGGLE_COMPLETE:
            return {
                ...state,
                todos: state.todos.map((todo: TodoInterface): TodoInterface => todo.id === action.payload ? {
                    ...todo,


import pytest

from plenum.test.ledger.conftest import TXNS_IN_BATCH, NUM_BATCHES

def test_get_unexistent_txn(ledger_with_batches_appended, inital_size):
    ledger = ledger_with_batches_appended
    with pytest.raises(KeyError):
        ledger.get_by_seq_no_uncommitted(inital_size + NUM_BATCHES * TXNS_IN_BATCH + 1)
    with pytest.raises(KeyError):
        ledger.get_by_seq_no_uncommitted(0)
    with pytest.raises(KeyError):
        ledger.get_by_seq_no_uncommitted(-1)

def test_get_committed_txns(ledger_with_batches_appended, inital_size):
    ledger = ledger_with_batches_appended
    assert ledger.get_by_seq_no_uncommitted(1)
    assert ledger.get_by_seq_no_uncommitted(inital_size)

def test_get_uncommitted_txns(ledger_with_batches_appended, inital_size, created_txns):
    ledger = ledger_with_batches_appended
    assert ledger.get_by_seq_no_uncommitted(inital_size + 1) == created_txns[0][0]
    assert ledger.get_by_seq_no_uncommitted(inital_size + 2) == created_txns[0][1]
    assert ledger.get_by_seq_no_uncommitted(inital_size + TXNS_IN_BATCH) == created_txns[0][TXNS_IN_BATCH - 1]
    assert ledger.get_by_seq_no_uncommitted(inital_size + TXNS_IN_BATCH + 3) == created_txns[1][2]
    assert ledger.get_by_seq_no_uncommitted(inital_size + (NUM_BATCHES - 1) * TXNS_IN_BATCH) == \
           created_txns[NUM_BATCHES - 2][TXNS_IN_BATCH - 1]
    assert ledger.get_by_seq_no_uncommitted(inital_size + (NUM_BATCHES - 1) * TXNS_IN_BATCH + 1) == \
           created_txns[NUM_BATCHES - 1][0]
    assert ledger.get_by_seq_no_uncommitted(inital_size + NUM_BATCHES * TXNS_IN_BATCH) == \
           created_txns[NUM_BATCHES - 1][TXNS_IN_BATCH - 1]


_1_n(Expr *x)
{
    Expr        *arg1 = x->arg1;
    Expr        *arg2 = x->arg2;
    Sample      *is1 = &arg1->smpls[0];
    Sample      *is2 = &arg2->smpls[0];
    Sample      *os = &x->smpls[0];
    Boolean	iv1;
    Boolean	*ip2;
    Boolean	*op;
    int         i;

    EVALARG(arg1)
    EVALARG(arg2)
    ROTATE(x)

    if (arg1->valid && arg2->valid && x->tspan > 0 && x->tspan == arg2->tspan) {
	iv1 = *(Boolean *)is1->ptr;
	ip2 = (Boolean *)is2->ptr;
	op = (Boolean *)os->ptr;
	for (i = 0; i < x->tspan; i++) {
	    *op++ = AND(iv1, *ip2);
	    ip2++;
	}
	os->stamp = (is1->stamp > is2->stamp) ? is1->stamp : is2->stamp;
	x->valid++;
    }
    else if (arg1->valid && x->tspan > 0) {
	*(Boolean *)os->ptr = AND1(*(Boolean *)is1->ptr);
	os->stamp = is1->stamp;
	x->valid++;
    }
    else if (arg2->valid && x->tspan > 0 && x->tspan == arg2->tspan) {
	ip2 = (Boolean *)is2->ptr;
	op = (Boolean *)os->ptr;
	for (i = 0; i < x->tspan; i++) {
	    *op++ = AND1(*ip2);
	    ip2++;
	}
	os->stamp = is2->stamp;
	x->valid++;
    }
    else x->valid = 0;

    if (pmDebugOptions.appl2) {
	fprintf(stderr, "cndAnd_1_n(" PRINTF_P_PFX "%p) ...\n", x);
	dumpExpr(x);
    }
}

void
cndAnd_1_1(Expr *x)
{
    Expr        *arg1 = x->arg1;
    Expr        *arg2 = x->arg2;
    Sample      *is1 = &arg1->smpls[0];
    Sample      *is2 = &arg2->smpls[0];
    Sample      *os = &x->smpls[0];

    EVALARG(arg1)
    EVALARG(arg2)
    ROTATE(x)

    if (arg1->valid && arg2->valid) {
	*(Boolean *)os->ptr = AND(*(Boolean *)is1->ptr, *(Boolean *)is2->ptr);
	os->stamp = (is1->stamp > is2->stamp) ? is1->stamp : is2->stamp;
	x->valid++;
    }
    else if (arg1->valid) {
	*(Boolean *)os->ptr = AND1(*(Boolean *)is1->ptr);
	os->stamp = is1->stamp;
	x->valid++;
    }
    else if (arg2->valid) {
	*(Boolean *)os->ptr = AND1(*(Boolean *)is2->ptr);
	os->stamp = is2->stamp;
	x->valid++;
    }
    else x->valid = 0;

    if (pmDebugOptions.appl2) {
	fprintf(stderr, "cndAnd_1_1(" PRINTF_P_PFX "%p) ...\n", x);
	dumpExpr(x);
    }
}


ent .. '(\n'
			..table.mapi(expr, function(xi)
				return self:apply(xi, indent..tab)
			end):concat('\n'..indent..'):'..expr:nameForExporter(self)..'(\n')..'\n'
			..indent..')'
	end,
	-- TODO same with ne, ge, gt, le, lt
	-- 'unary' ?
	[require 'symmath.op.unm'] = function(self, expr, indent)
		return indent..'-(\n'
			..self:apply(expr[1], indent..tab)..'\n'
			..indent..')'
	end,
	[require 'symmath.tensor.Index'] = function(self, expr, indent)
		local sep = ''
		local s = expr:nameForExporter(self)..'{'
		if expr.lower ~= nil then s = s..sep..'lower='..tolua(expr.lower) sep=', ' end
		if expr.derivative ~= nil then s = s..sep..'derivative='..tolua(expr.derivative) sep=', ' end
		if expr.symbol ~= nil then s = s..sep..'symbol='..tolua(expr.symbol) sep=', ' end
		s = s ..'}'
		return indent .. s
	end,
	-- Tensor constructor is a mess
	[require 'symmath.Tensor'] = function(self, expr, indent)
		local s = indent..expr:nameForExporter(self)..'(\n'
		if #expr.variance > 0 then
			s = s ..indent..tab..'{\n'
				..table.mapi(expr.variance, function(xi)
					return self:apply(xi)
				end):concat(',\n')..'\n'
				..indent..tab..'},\n'
		end
		s = s ..table.mapi(expr, function(xi)
				return self:apply(xi, indent..tab)
			end):concat(',\n')..'\n'
			..indent..')'
		return s
	end,
	[require 'symmath.Expression'] = function(self, expr, indent)
		local name = expr:nameForExporter(self)
		return indent..name..'(\n'
			..table.mapi(expr, function(xi)
				return self:apply(xi, indent..tab)
			end):concat(',\n')..'\n'
			..indent..')'
	end,
}:setmetatable(nil)

function SymMath:apply(expr, indent, ...)
	return SymMath.super.apply(self, expr, indent or '', ...)
end

return SymMath()


rameter","$visitor"]),pb.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","PathItem","$visitor"]),mb.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Paths","$visitor"]),yb.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Reference","$visitor"]),_b.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","RequestBody","$visitor"]),Sb.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Response","$visitor"]),wb.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Responses","$visitor"]),Z_.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Schema","$visitor"]),eS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","SecurityRequirement","$visitor"]),tS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","SecurityScheme","$visitor"]),rS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Server","$visitor"]),nS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","ServerVariable","$visitor"]),sS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","Tag","$visitor"]),oS.refract=apidom_ns_openapi_3_1_src_refractor_createRefractor(["visitors","document","objects","XML","$visitor"]);const rw=class NotImplementedError extends jh{};const nw=class MediaTypes extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new rw("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new rw("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new rw("latest method in MediaTypes class is not yet implemented.")}};class OpenAPIMediaTypes extends nw{filterByFormat(s="generic"){const o="generic"===s?"openapi;version":s;return this.filter((s=>s.includes(o)))}findBy(s="3.1.0",o="generic"){const i="generic"===o?`vnd.oai.openapi;version=${s}`:`vnd.oai.openapi+${o};version=${s}`;return this.find((s=>s.includes(i)))||this.unknownMediaType}latest(s="generic"){return Ba(this.filterByFormat(s))}}const sw=new OpenAPIMediaTypes("application/vnd.oai.openapi;version=3.1.0","application/vnd.oai.openapi+json;version=3.1.0","application/vnd.oai.openapi+yaml;version=3.1.0");const ow=class src_Reference_Reference{uri;depth;value;refSet;errors;constructor({uri:s,depth:o=0,refSet:i,value:a}){this.uri=s,this.value=a,this.depth=o,this.refSet=i,this.errors=[]}};const iw=class ReferenceSet{rootRef;refs;circular;constructor({refs:s=[],circular:o=!1}={}){this.refs=[],


-col-8\@lg {
    --grid-columns: 8;
  }
  .col-8\@lg {
    --column-span: 8;
  }
  .grid-col-9\@lg {
    --grid-columns: 9;
  }
  .col-9\@lg {
    --column-span: 9;
  }
  .grid-col-10\@lg {
    --grid-columns: 10;
  }
  .col-10\@lg {
    --column-span: 10;
  }
  .grid-col-11\@lg {
    --grid-columns: 11;
  }
  .col-11\@lg {
    --column-span: 11;
  }
  .grid-col-12\@lg {
    --grid-columns: 12;
  }
  .col-12\@lg {
    --column-span: 12;
  }
  .col-1\@lg, .col-2\@lg, .col-3\@lg, .col-4\@lg, .col-5\@lg, .col-6\@lg, .col-7\@lg, .col-8\@lg, .col-9\@lg, .col-10\@lg, .col-11\@lg, .col-12\@lg {
    width: calc((100% - (var(--grid-columns) - 1) * var(--column-gap)) * var(--column-span) / var(--grid-columns) + (var(--column-span) - 1) * var(--column-gap));
    flex: initial;
  }
  .col\@lg {
    width: auto;
    flex: 1 1 0;
  }
  .col-content\@lg {
    width: auto;
    flex: 0 1 auto;
  }
  .offset-1\@lg {
    --column-offset: 1;
  }
  .offset-2\@lg {
    --column-offset: 2;
  }
  .offset-3\@lg {
    --column-offset: 3;
  }
  .offset-4\@lg {
    --column-offset: 4;
  }
  .offset-5\@lg {
    --column-offset: 5;
  }
  .offset-6\@lg {
    --column-offset: 6;
  }
  .offset-7\@lg {
    --column-offset: 7;
  }
  .offset-8\@lg {
    --column-offset: 8;
  }
  .offset-9\@lg {
    --column-offset: 9;
  }
  .offset-10\@lg {
    --column-offset: 10;
  }
  .offset-11\@lg {
    --column-offset: 11;
  }
  .offset-1\@lg, .offset-2\@lg, .offset-3\@lg, .offset-4\@lg, .offset-5\@lg, .offset-6\@lg, .offset-7\@lg, .offset-8\@lg, .offset-9\@lg, .offset-10\@lg, .offset-11\@lg {
    margin-left: calc((100% - (var(--grid-columns) - 1) * var(--column-gap)) * var(--column-offset) / var(--grid-columns) + var(--column-offset) * var(--column-gap));
  }
  .offset-0\@lg {
    margin-left: 0;
  }
  /* gap */
  .gap-4xs\@lg {
    --row-gap: var(--space-4xs);
    --column-gap: var(--space-4xs);
    gap: var(--row-gap) var(--column-gap);
  }
  .gap-x-4xs\@lg {
    --column-gap: var(--space-4xs);
    column-gap: var(--column-gap);
  }
  .gap-y-4xs\@lg {
    --row-gap: var(--space-4xs);
    row-gap: var(--row-gap);
  }
  .gap-3xs\@lg {
    --row-gap: var(--space-3xs);


/*	$NetBSD: memset.S,v 1.1 2014/09/03 19:34:25 matt Exp $ */

/*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Matt Thomas of 3am Software Foundry.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <machine/asm.h>

#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: memset.S,v 1.1 2014/09/03 19:34:25 matt Exp $")
#endif /* LIBC_SCCS && !lint */

/*----------------------------------------------------------------------*/
/*
     void bzero(void *b r3, size_t len r4);
     void * memset(void *b r3, int c r4, size_t len r5);
*/
/*----------------------------------------------------------------------*/

#ifdef _BZERO
#define r_fill	r0
ENTRY(bzero)
#else
#define r_fill	r4
ENTRY(memset)
#endif
#ifdef _BZERO
		l.ori	r5, r4, 0
		l.or	r4, r0, r0
#else
		l.or	r11, r3, r0


 OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package parser

import (
	"math"
	"slices"
	"strings"
	"unicode"
	"unicode/utf8"

	"github.com/bufbuild/protocompile/experimental/report"
	"github.com/bufbuild/protocompile/experimental/token"
	"github.com/bufbuild/protocompile/internal/ext/stringsx"
)

// maxFileSize is the maximum file size Protocompile supports.
const maxFileSize int = math.MaxInt32 // 2GB

// lex performs lexical analysis on the file contained in ctx, and appends any
// diagnostics that results in to l.
//
// lex will freeze the stream in ctx when it is done.
//
// You should almost never need to call this function; [Parse] calls it directly.
// It is exported so that it is straight forward to build other parsers on top
// of the Protobuf lexer.
func lex(ctx token.Context, errs *report.Report) {
	l := &lexer{
		Context: ctx,
		Stream:  ctx.Stream(),
		Report:  errs,
	}

	defer l.CatchICE(false, func(d *report.Diagnostic) {
		d.Apply(
			report.Snippetf(l.Span(l.cursor, l.cursor), "cursor is here"),
			report.Notef("cursor: %d, count: %d", l.cursor, l.count),
		)
	})
	defer l.Freeze()

	if !lexPrelude(l) {
		return
	}

	// This is the main loop of the lexer. Each iteration will examine the next
	// rune in the source file to determine what action to take.
	mp := l.mustProgress()
	for !l.Done() {
		mp.check()

		start := l.cursor
		r := l.Pop()

		switch {
		case unicode.In(r, unicode.Pattern_White_Space):
			// Whitepace. Consume as much whitespace as possible and mint a
			// whitespace token.
			l.TakeWhile(func(r rune) bool {
				return unicode.In(r, unicode.Pattern_White_Space)
			})
			l.Push(l.cursor-start, token.Space)

		case r == '/' && l.Peek() == '/':
			l.cursor++ // Skip the second /.

			// Single-line comment. Seek to the next '\n' or the EOF.
			var text string
			if comment, ok := l.SeekInclusive("\n"); ok {
				text = comment
			} else {
				text = l.SeekEOF()
			}
			l.Push(len("//")+len(text), token.Comment)
		case r == '/' && l.Peek() == '*':
			l.cursor++ // Skip the *.

			// Block comment. Seek to the next "*/". Protobuf comments
			// unfortunately do not nest, and allowing them to nest can't
			// be done in a backwards-compatible manner. We acknowledge that
			// this behavior is user-hostile.
			//
			// If we encounter no "*/", seek EOF and emit a diagnostic. Trying
			// to lex a partial comment is hopeless.

			var text string
			if comment, ok := l.SeekInclusive("*/"); ok {
				text = comment
			} else {
				// Create a span for the /*, that's what we're gonna highlight.
				l.Error(errUnmatched{Span: l.SpanFrom(l.cursor - 2)})
				text = l.SeekEOF()
			}
			l.Push(len("/*")+len(text), token.Comment)
		case r == '*' && l.Peek() == '/':
			l.cursor++ // Skip the /.

			// The user definitely thought nested comments were allowed. :/
			tok := l.Push(len("*/"), t


5){eF: 5-):PPAtA :JFe9<*A J:Jse)<)A:9:35)<5P3:FA t&F:9P*t3*3JJe*P)te*:J<e<<PA{935P)F59{*A: 3)%5;{)Fe {9{:<PPt{t3Jte9<9A*9t33)J<uA:9e3:)559 :F{ Aft{PP9t * J3eJP555*eJ:e5t)AP9A3A) J {9F*   5:J{)F) eJJ:5P<tP eJAet<FA9tA3 )35JA)9)35):PF)eFP {VA{FPFt***y e3P:5:*)Jee:t<A<9{3{)*J*{FF9 *<P:3{xFQ )J3::P5t< )J{eA<tAFt{3*) 53Ah9d3:)ePt*>FP Pj{A)Ptt9*9eee Pe5e*fJ)eet*A59P3P){55{tFF 9){: P3tJ c  :eP:t5*PJPet<AFJ<{39)*5  :FJ3)))<P{:FAAA8P:{PA33*FJ*e*< AF9JJOe)<FA:953<)P5F{AFF F){:*P t33J)::)P:t:*<J<<*<{tF*33F) 5*t{F3 J)TP){AF: Pf<:AP{*A*tC*55<*tU93v{er<)Ae*<Jt)<5F{{*F t^F:9{39t*3j5:R{tte*:J5e<<{A{9F3t)J59{3F  3eA5v{eFe 5?5:{PPt{3EJteF<9A39 3J)J<5:59e3:)5F<{PFA ADt:PP9t** bPeJPDt)*eJPe5<PAP*:3A)t5Ft9*{  2J:J{)F)%AQ:5P{3tP*tJA5:<FA99*s e)5JAe9)35):{5{<9A tHA:*PF9:**J e3{)F5*)JPe:A:A<9P3{eF<A{F9m *e<:3PJFk ))F::PPt<*9J{eF<tAF <3*)353A_9;3:)e5:AAF< PG{:FPtt9*9J*et<3AJ*nJ3ee<:A5995:){5A{tP9 9^ : P3tJ 595:eP:t5APJPeA<At9o<39)*5 A:FJ34))5edFF5 PpP55PAtt*F)95e< AJ9JJ)e){eA:95J5)P5A{AF9 FI9:*P Fe*JN_:)Pet:*PJ<eF{eAA9t3F F5*{3F3JJ{35){{F: A;<5JP{FF:)JF:e<*9t933JeU<)e39:3t)<5 {{FF t)j<JP*Fe*3P3:^Pete*5J5etEtA{9A3tAt59{ F 3e*e5V{)Fetel5:PPP9{:PJt:}<9t^9 s{)JPe3t9e39)5<{{PF{ Act3PP9Fe* _PeJPet)*A){e5<9APe*3A)F5F{*F*3)*):J{+F)5{(::<P<tF{FJAet<FX59*33)35J{*9)3A):<e{<FP {eAAtP9Fe**#)e3{)tn*)e&e:<FA<9A3{)t5t{3<3 *6 :3


.attr[attr]

    # Remove references to removed nodes except Const nodes.
    for node in graph_def.node:
        for i in reversed(range(len(node.input))):
            if node.input[i] in removedNodes:
                del node.input[i]

def writeTextGraph(modelPath, outputPath, outNodes):
    try:
        import cv2 as cv

        cv.dnn.writeTextGraph(modelPath, outputPath)
    except:
        import tensorflow as tf
        from tensorflow.tools.graph_transforms import TransformGraph

        with tf.gfile.FastGFile(modelPath, 'rb') as f:
            graph_def = tf.GraphDef()
            graph_def.ParseFromString(f.read())

            graph_def = TransformGraph(graph_def, ['image_tensor'], outNodes, ['sort_by_execution_order'])

            for node in graph_def.node:
                if node.op == 'Const':
                    if 'value' in node.attr and node.attr['value'].tensor.tensor_content:
                        node.attr['value'].tensor.tensor_content = b''

        tf.train.write_graph(graph_def, "", outputPath, as_text=True)


니다.
    `command = uga`: 사용자가 드롭다운 메뉴에서 항목을 선택할 때 호출되는 콜백 함수입니다.

    `dropdown.configure(state='normal')`: 드롭다운 메뉴를 활성화 상태로 설정합니다.
    비활성화를 하려면 `disable`로 설정합니다.

    `root.mainloop()`: Tkinter GUI 루프를 실행합니다.

### tk2_add_btn_fram.py

시리얼 포트를 선택하고, 시리얼 통신을 시작하거나 중지하는 기능을 구현하기 위한 코드입니다.
시리얼 포트 탐지와 함수 구현을 통해 기능을 설정할 수 있습니다.

1. 모듈 가져오기
    ```python
    import tkinter as tk
    from tkinter import ttk
    ```
    GUI를 만들기 위한 `tkinter` 모듈과 `ttk` 서브 모듈을 사용합니다.

2. 함수 정의
    ```python
    def select_serial():
        pass

    def start_serial():
        pass

    def stop_serial():
        pass
    ```
    `select_serial`, `start_serial`, `stop_serial`: 각각 시리얼 포트 선택, 시작, 정지를 처리하기 위한 자리 표시 함수입니다.
    현재는 pass로 구현되어 있어 아무 동작도 수행하지 않는 상태입니다.

3. 시리얼 포트 리스트 초기화
    ```python
    serial_list = ['시리얼 포트를 선택하세요.']
    ```
    `serial_list`: 드롭다운 메뉴에 표시될 옵션 목록으로, `시리얼 포트를 선택하세요`옵션을 기본으로 포함하고 있습니다. 나중에 이 리스트에 실제 시리얼 포트 목록이 추가됩니다.

4. Tkinter 루트 윈도우 설정
    ```python
    root = tk.Tk()
    root.title('JDcobot 100 Control')
    root.geometry('600x480')
    ```
    제목 `JDcobot 100 control`, 창 크기 600 x 480인 메인 윈도우를 생성합니다.

5. Frame 생성 및 레이아웃 설정
    ```python
    m


+ loopCycle, k13, method42(plane, k13, j11) - l18, j11);
				aClass19_1013.insertHead(class30_sub2_sub4_sub4);
			}
		}
	}

	public static void setLowMem() {
		WorldController.lowMem = true;
		Texture.lowMem = true;
		lowMem = true;
		ObjectManager.lowMem = true;
		ObjectDef.lowMem = true;
	}

	public void method139(Stream stream) {
		stream.initBitAccess();
		int k = stream.readBits(8);
		if (k < npcCount) {
			for (int l = k; l < npcCount; l++) {
				anIntArray840[anInt839++] = npcIndices[l];
			}

		}
		if (k > npcCount) {
			Signlink.reporterror(myUsername + " Too many npcs");
			throw new RuntimeException("eek");
		}
		npcCount = 0;
		for (int i1 = 0; i1 < k; i1++) {
			int j1 = npcIndices[i1];
			NPC npc = npcArray[j1];
			int k1 = stream.readBits(1);
			if (k1 == 0) {
				npcIndices[npcCount++] = j1;
				npc.anInt1537 = loopCycle;
			} else {
				int l1 = stream.readBits(2);
				if (l1 == 0) {
					npcIndices[npcCount++] = j1;
					npc.anInt1537 = loopCycle;
					anIntArray894[anInt893++] = j1;
				} else if (l1 == 1) {
					npcIndices[npcCount++] = j1;
					npc.anInt1537 = loopCycle;
					int i2 = stream.readBits(3);
					npc.moveInDir(false, i2);
					int k2 = stream.readBits(1);
					if (k2 == 1) {
						anIntArray894[anInt893++] = j1;
					}
				} else if (l1 == 2) {
					npcIndices[npcCount++] = j1;
					npc.anInt1537 = loopCycle;
					int j2 = stream.readBits(3);
					npc.moveInDir(true, j2);
					int l2 = stream.readBits(3);
					npc.moveInDir(true, l2);
					int i3 = stream.readBits(1);
					if (i3 == 1) {
						anIntArray894[anInt893++] = j1;
					}
				} else if (l1 == 3) {
					anIntArray840[anInt839++] = j1;
				}
			}
		}

	}

	public void processLoginScreenInput() {
		if (loginScreenState == 0) {
			int i = super.myWidth / 2 - 80;
			int l = super.myHeight / 2 + 20;
			l += 20;
			if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
				loginScreenState = 3;
				loginScreenCursorPos = 0;
			}
			i = super.myWidth / 2 + 80;
			if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
				loginMessage1 = "";
				loginMessage2 = "Enter your username & password.";
				loginScreenState = 2;
				loginScreenCursorPos = 0;
			}
		} else {
			if (loginScreenState == 2) {
				int j = super.myHeight / 2 - 40;
				j += 30;


tmp = snip.env.TM_SELECTED_TEXT
                tmp[0] = nil
                return tmp or {}
            end, {}),
            text { "", "```", "" },
            insert(0),
        }),
        snip({
            trig = "codeempty",
            namr = "markdown_code_empty",
            dscr = "Create empty markdown code block",
        }, {
            text "``` ",
            insert(1, "Language"),
            text { "", "" },
            insert(2, "Content"),
            text { "", "```", "" },
            insert(0),
        }),
        snip({
            trig = "meta",
            namr = "Metadata",
            dscr = "Yaml metadata format for markdown",
        }, {
            text { "---", "title: " },
            insert(1, "note_title"),
            text { "", "author: " },
            insert(2, "author"),
            text { "", "date: " },
            func(date, {}),
            text { "", "cathegories: [" },
            insert(3, ""),
            text { "]", "lastmod: " },
            func(date, {}),
            text { "", "tags: [" },
            insert(4),
            text { "]", "comments: true", "---", "" },
            insert(0),
        }),
    },
    go = {
        snip("test", {
            text "func ",
            insert(1, "Name"),
            text "(t *testing.T)",
            text { " {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
        snip("typei", {
            text "type ",
            insert(1, "Name"),
            text { " interface {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
        snip("types", {
            text "type ",
            insert(1, "Name"),
            text { " struct {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
        snip("func", {
            text "func ",
            insert(1, "Name"),
            text "(",
            insert(2),
            text ")",
            insert(3),
            text { " {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
        snip("if", {
            text "if ",
            insert(1, "true"),
            text { " {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),

        snip("fori", {
            text "for ",
            insert(1, "i := 0"),
            text ";",
            insert(2, "i < 10"),
            text ";",
            insert(3, "i++"),
            text { " {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
        snip("forr", {
            text "for ",
            insert(1, "k, v"),
            text " := range ",
            insert(2, "expr"),
            text { " {", "" },
            text "\t",
            insert(0),
            text { "", "}" },
        }),
    },
    yaml = {
        snip(
            {
                trig = "pod",
                namr = "k8s Pod",
                dscr = "Kubernetes Pod definition",


 T & Thing;

    extendWith<T>(...mixins: T[]): T & Thing;
}

export = Thing;

export class Item {
  name: string;
  ingredients: Ingredient[];
  murloc?: string;
  color?: string;
  amount?: number;
}

export class Ingredient {
  name: string;
  amount: number;
  color?: string;
  murloc?: string;
}
/* eslint-disable max-lines-per-function */
import scenario from "../test/scenario.test.js";
import WeakCache from "./weakcache.js";

describe("WeakCache", () => {
  describe("Basic operations", () => {
    it("Set/get", async () => {
      const cache = new WeakCache<number>();
      await scenario(
        cache,
        [
          {method: "set", key: "test1", value: 34},
          {method: "get", key: "test1", value: 34},
          {method: "set", key: "test2", value: 35},
          {method: "get", key: "test2", value: 35},
        ],
      );
    });
    it("Get non existent", async () => {
      const cache = new WeakCache<number>();
      await scenario(
        cache,
        [
          {method: "get", key: "test1", value: undefined},
          {method: "set", key: "test1", value: 34},
          {method: "get", key: "test1", value: 34},
          {method: "get", key: "test2", value: undefined},
        ],
      );
    });
  });

  describe("Checking LRU algorithm", () => {
    it("Basic removal", async () => {
      const cache = new WeakCache<number>({maxSize: 5});
      await scenario(
        cache,
        [
          {method: "set", key: "test1", value: 34},
          {method: "set", key: "test2", value: 35},
          {method: "set", key: "test3", value: 36},
          {method: "set", key: "test4", value: 37},
          {method: "set", key: "test5", value: 38},
          {method: "set", key: "test6", value: 63},
          {method: "get", key: "test1", value: undefined},
          {method: "get", key: "test2", value: 35},
          {method: "get", key: "test3", value: 36},
          {method: "get", key: "test4", value: 37},
          {method: "get", key: "test5", value: 38},
          {method: "get", key: "test6", value: 63},
        ],
      );
    });
    it("Reorder set", async () => {
      const cache = new WeakCache<number>({maxSize: 4});
      await scenario(
        cache,
        [
          {method: "set", key: "test1", value: 34},
          {method: "set", key: "test2", value: 35},
          {method: "set", key: "test3", value: 36},
          {method: "set", key: "test4", value: 37},
          {method: "set", key: "test5", value: 38},
          {method: "set", key: "test1", value: 1664},
          {method: "set", key: "test6", value: 63},
          {method: "get", key: "test1", value: 1664},
          {method: "get", key: "test2", value: undefined},
          {method: "get", key: "test3", value: undefined},
          {method: "get", key: "test4", value: 37},
          {method: "get", key: "test5", value: 38},
          {method: "get", key: "test6", value: 63},
        ],
      );
    });
    it("Reorder get", async () => {
      const cache = new WeakCache<number>({maxSize: 4});
      await scenario(


eTo(30.2521f, 31.9173f)
                horizontalLineTo(30.0688f)
                lineTo(30.0717f, 31.8938f)
                curveTo(30.0917f, 31.7603f, 30.115f, 31.6269f, 30.1289f, 31.4902f)
                curveTo(30.1483f, 31.3574f, 30.1571f, 31.2258f, 30.1571f, 31.0897f)
                verticalLineTo(31.0687f)
                horizontalLineTo(30.3078f)
                lineTo(30.3118f, 31.0836f)
                curveTo(30.345f, 31.2033f, 30.4314f, 31.2042f, 30.5529f, 31.2063f)
                horizontalLineTo(33.0267f)
                curveTo(33.158f, 31.2042f, 33.2538f, 31.2024f, 33.2622f, 31.0786f)
                lineTo(33.263f, 31.0558f)
                lineTo(33.2851f, 31.0601f)
                lineTo(33.4198f, 31.0813f)
                lineTo(33.4166f, 31.1023f)
                curveTo(33.397f, 31.2297f, 33.379f, 31.3574f, 33.3647f, 31.4847f)
                curveTo(33.355f, 31.6119f, 33.355f, 31.7396f, 33.355f, 31.8677f)
                verticalLineTo(31.8821f)
                lineTo(33.3411f, 31.8876f)
                lineTo(33.1731f, 31.9491f)
                lineTo(33.1724f, 31.9216f)
                curveTo(33.16f, 31.743f, 33.1411f, 31.4847f, 32.8411f, 31.4847f)
                horizontalLineTo(32.0833f)
                verticalLineTo(33.9896f)
                curveTo(32.0881f, 34.3475f, 32.2302f, 34.3726f, 32.4564f, 34.3771f)
                horizontalLineTo(32.5671f)
                verticalLineTo(34.5605f)
                horizontalLineTo(32.5474f)
                close()
            }
            path(fill = SolidColor(Color(0xFF1A1919)), stroke = null, strokeLineWidth = 0.0f,
                    strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
                    pathFillType = EvenOdd) {
                moveTo(33.5714f, 34.3976f)
                horizontalLineTo(33.6379f)
                curveTo(33.8089f, 34.3976f, 33.9886f, 34.3743f, 33.9886f, 34.1272f)
                verticalLineTo(31.6406f)
                curveTo(33.9886f, 31.3932f, 33.8089f, 31.3697f, 33.6379f, 31.3697f)
                horizontalLineTo(33.5714f)
                verticalLineTo(31.2271f)
                curveTo(33.7566f, 31.2271f, 34.0409f, 31.2459f, 34.2732f, 31.2459f)
                curveTo(34.5111f, 31.2459f, 34.796f, 31.2271f, 35.0195f, 31.2271f)
                verticalLineTo(31.3697f)
                horizontalLineTo(34.9529f)
                curveTo(34.7813f, 31.3697f, 34.6009f, 31.3932f, 34.6009f, 31.6406f)
                verticalLineTo(34.1272f)
                curveTo(34.6009f, 34


.Style.Coordinates.prototype.__repr__=function(){
var repr=MochiKit.Base.repr;
return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
};
MochiKit.Style.Coordinates.prototype.toString=function(){
return this.__repr__();
};
MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_421){
var dom=MochiKit.DOM;
var d=dom._document;
elem=dom.getElement(elem);
_421=MochiKit.Base.camelize(_421);
if(!elem||elem==d){
return undefined;
}
if(_421=="opacity"&&typeof (elem.filters)!="undefined"){
var _424=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
if(_424&&_424[1]){
return parseFloat(_424[1])/100;
}
return 1;
}
if(_421=="float"||_421=="cssFloat"||_421=="styleFloat"){
if(elem.style["float"]){
return elem.style["float"];
}else{
if(elem.style.cssFloat){
return elem.style.cssFloat;
}else{
if(elem.style.styleFloat){
return elem.style.styleFloat;
}else{
return "none";
}
}
}
}
var _425=elem.style?elem.style[_421]:null;
if(!_425){
if(d.defaultView&&d.defaultView.getComputedStyle){
var css=d.defaultView.getComputedStyle(elem,null);
_421=_421.replace(/([A-Z])/g,"-$1").toLowerCase();
_425=css?css.getPropertyValue(_421):null;
}else{
if(elem.currentStyle){
_425=elem.currentStyle[_421];
if(/^\d/.test(_425)&&!/px$/.test(_425)&&_421!="fontWeight"){
var left=elem.style.left;
var _428=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
elem.style.left=_425||0;
_425=elem.style.pixelLeft+"px";
elem.style.left=left;
elem.runtimeStyle.left=_428;
}
}
}
}
if(_421=="opacity"){
_425=parseFloat(_425);
}
if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.findValue(["left","top","right","bottom"],_421)!=-1)){
if(MochiKit.Style.getStyle(elem,"position")=="static"){
_425="auto";
}
}
return _425=="auto"?null:_425;
},setStyle:function(elem,_42a){
elem=MochiKit.DOM.getElement(elem);
for(var name in _42a){
switch(name){
case "opacity":
MochiKit.Style.setOpacity(elem,_42a[name]);
break;
case "float":
case "cssFloat":
case "styleFloat":
if(typeof (elem.style["float"])!="undefined"){
elem.style["float"]=_42a[name];
}else{
if(typeof (elem.style.cssFloat)!="undefined"){
elem.style.cssFloat=_42a[name];
}else{
elem.style.styleFloat=_42a[name];
}
}
break;
default:
elem.style[MochiKit.Base.camelize(name)]=_42a[name];
}
}
},setOpacity:function(elem,o){
elem=MochiKit.DOM.getElement(elem);
var self=MochiKit.Style;
if(o==1){
var _42f=/Gecko/.test(navigator.us


와 반대

- 단일 인덱스 ( Single Index )

  - 한 개의 컬럼으로 구성한 인덱스

    CREATE INDEX idx_ukempno_emp ON emp(empno);

- 결합 인덱스 ( Composite Index )

  - 두 개 이상의 컬럼으로 인덱스를 구성하는 것을 말한다. 예를들어 부서번호와 부서명을 결합하여 인덱스를 설정하는 것과 같다. ( CREATE INDEX idx_dept_com ON index_dept(deptno, dname) );

- 함수 기반 인덱스 ( Function Based Index )

  - 컬럼에 어떠한 산술식을 수행했을 때의 인덱스이다.

### 참고 블로그

- [데이터베이스 인덱스-1](https://lalwr.blogspot.com/2016/02/db-index.html)
- [데이터베이스 인덱스-2](https://itholic.github.io/database-index/)

### 한 줄 요약

인덱스 : 데이터가 어디에 위치하였는지 위치 정보를 가진 제약있는 주소록# OSI  7 계층

- OSI 7 계층이란?

  - OSI(Open Systems Interconnection) : 개방형 시스템, 즉 시스템 간의 상호연결성을 부여하는 표준

  - 국제표준화기구 (ISO: International Organization for Standardiztion)에서 만든 네트워크 통신 7단계 과정.

  - OSI 7 계층은 **"OSI 참조 모델"** 이라고도 불리며,  컴퓨팅 장치나 네트워킹 장치를 만들 때 OSI 참조 모델을 기준으로 모든 통신장치를 만들고 있음
    **because**  기준을 통해 만든 제품이 유지보수가 편하기 때문

  - 데이터 흐름을 파악하기 위해 계층을 나누었고, 각 계층별로 모듈화가 되어있어서 각 계층을 하나로 보는 것이 아니라 융화시켜 호환성에 용이하도록 만듦.

    **ex) OSI 7 계층을 정하지 않았던 때에는 통신 장비 업체간 호환성이 전혀 되지 않�


10 10 10 10-4.47 10-10S17.53 2 12 2m3.1 5.07c.14 0 .28.05.4.16l1.27 1.27c.23.22.23.57 0 .78l-1 1-2.05-2.05 1-1c.1-.11.24-.16.38-.16m-1.97 1.74 2.06 2.06-6.06 6.06H7.07v-2.06l6.06-6.06Z"/></svg>');--md-admonition-icon--abstract:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 9H7V7h10m0 6H7v-2h10m-3 6H7v-2h7M12 3a1 1 0 0 1 1 1 1 1 0 0 1-1 1 1 1 0 0 1-1-1 1 1 0 0 1 1-1m7 0h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2Z"/></svg>');--md-admonition-icon--info:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"/></svg>');--md-admonition-icon--tip:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.66 11.2c-.23-.3-.51-.56-.77-.82-.67-.6-1.43-1.03-2.07-1.66C13.33 7.26 13 4.85 13.95 3c-.95.23-1.78.75-2.49 1.32-2.59 2.08-3.61 5.75-2.39 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.23.1-.47.04-.66-.12a.58.58 0 0 1-.14-.17c-1.13-1.43-1.31-3.48-.55-5.12C5.78 10 4.87 12.3 5 14.47c.06.5.12 1 .29 1.5.14.6.41 1.2.71 1.73 1.08 1.73 2.95 2.97 4.96 3.22 2.14.27 4.43-.12 6.07-1.6 1.83-1.66 2.47-4.32 1.53-6.6l-.13-.26c-.21-.46-.77-1.26-.77-1.26m-3.16 6.3c-.28.24-.74.5-1.1.6-1.12.4-2.24-.16-2.9-.82 1.19-.28 1.9-1.16 2.11-2.05.17-.8-.15-1.46-.28-2.23-.12-.74-.1-1.37.17-2.06.19.38.39.76.63 1.06.77 1 1.98 1.44 2.24 2.8.04.14.06.28.06.43.03.82-.33 1.72-.93 2.27Z"/></svg>');--md-admonition-icon--success:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 7 9 19l-5.5-


[]ModuleName{moduleName})
		receivedValuesGlobal = make([]field.Element, len(blueprintGL.ReceivedValuesGlobalAccsRoots))
	)

	witnessesGL = make([]*ModuleWitnessGL, nbSegmentModule)

	for moduleIndex := range witnessesGL {

		moduleWitnessGL := &ModuleWitnessGL{
			ModuleName:           moduleName,
			ModuleIndex:          moduleIndex,
			IsFirst:              moduleIndex == 0,
			IsLast:               moduleIndex == nbSegmentModule-1,
			Columns:              make(map[ifaces.ColID]smartvectors.SmartVector),
			ReceivedValuesGlobal: receivedValuesGlobal,
		}

		for _, col := range cols {

			col := runtime.Spec.Columns.GetHandle(col)

			if ModuleOfColumn(disc, col) != moduleName {
				continue
			}

			segment := SegmentOfColumn(runtime, disc, col, moduleIndex, nbSegmentModule)
			moduleWitnessGL.Columns[col.GetColID()] = segment
		}

		witnessesGL[moduleIndex] = moduleWitnessGL
		receivedValuesGlobal = moduleWitnessGL.NextReceivedValuesGlobal(blueprintGL)
	}

	return witnessesGL
}

// SegmentModuleLPP produces the list of the [ModuleWitness] for a given module
func SegmentModuleLPP(runtime *wizard.ProverRuntime, disc *StandardModuleDiscoverer, moduleLPP *ModuleSegmentationBlueprint) (witnessesLPP []*ModuleWitnessLPP) {

	var (
		cols          = runtime.Spec.Columns.AllKeys()
		n0            = make([]int, len(moduleLPP.NextN0SelectorRoots))
		moduleNameSet = make(map[ModuleName]struct{})
		columnsLPPSet = make(map[ifaces.ColID]struct{})
	)

	for moduleIndex, moduleName := range moduleLPP.ModuleNames {
		moduleNameSet[moduleName] = struct{}{}
		for _, col := range moduleLPP.LPPColumnSets[moduleIndex] {
			columnsLPPSet[col] = struct{}{}
		}
	}

	var (
		nbSegmentModule = NbSegmentOfModule(runtime, disc, moduleLPP.ModuleNames)
		witnessesLPPs   = make([]*ModuleWitnessLPP, nbSegmentModule)
	)

	for segment := range witnessesLPPs {

		moduleWitnessLPP := &ModuleWitnessLPP{
			ModuleName:  moduleLPP.ModuleNames,
			ModuleIndex: segment,
			Columns:     make(map[ifaces.ColID]smartvectors.SmartVector),
			N0Values:    n0,
		}

		for _, col := range cols {

			if _, ok := columnsLPPSet[col]; !ok {
				continue
			}

			col := runtime.Spec.Columns.GetHandle(col)
			segment := SegmentOfColumn(runtime, disc, col, segment, nbSegmentModule)
			moduleWitnessLPP.Columns[col.GetColID()] = segment
		}

		witnessesLPPs[segment] = moduleWitnessLPP
		n0 = moduleWitnessLPP.NextN0s(moduleLPP)
	}

	return witnessesLPPs
}

var (
	segmentWarningCache = &sync.Map{}
)

// NbSegmentOfModule returns the number of segments for a given module
func NbSegmentOfModule(runtime *wizard.ProverRuntime, disc *StandardModuleDiscoverer, moduleName []ModuleName) (nbSegment int) {

	var (
		cols            = runtime.Spec.Columns.AllKeys()
		nbSegmentModule = -1
		moduleSet       = map[ModuleName]struct{}{}
	)

	for _, mn := range moduleName {
		moduleSet[mn] = struct{}{}
	}

	for _, col := range cols {

		var (
			col = runtime.Spec.Columns.GetHandle(col)
			mn  = disc.ModuleOf(col.(column.Natural))
		)

		if len(mn) == 0 {
			disc := disc
			utils.Panic("one column does not belong to any module: %v, disc: %v, mn: %v", col.GetColID(), disc


/*
 * brin_internal.h
 *		internal declarations for BRIN indexes
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * IDENTIFICATION
 *		src/include/access/brin_internal.h
 */
#ifndef BRIN_INTERNAL_H
#define BRIN_INTERNAL_H

#include "access/amapi.h"
#include "storage/bufpage.h"
#include "utils/typcache.h"

/*
 * A BrinDesc is a struct designed to enable decoding a BRIN tuple from the
 * on-disk format to an in-memory tuple and vice-versa.
 */

/* struct returned by "OpcInfo" amproc */
typedef struct BrinOpcInfo
{
	/* Number of columns stored in an index column of this opclass */
	uint16		oi_nstored;

	/* Regular processing of NULLs in BrinValues? */
	bool		oi_regular_nulls;

	/* Opaque pointer for the opclass' private use */
	void	   *oi_opaque;

	/* Type cache entries of the stored columns */
	TypeCacheEntry *oi_typcache[FLEXIBLE_ARRAY_MEMBER];
} BrinOpcInfo;

/* the size of a BrinOpcInfo for the given number of columns */
#define SizeofBrinOpcInfo(ncols) \
	(offsetof(BrinOpcInfo, oi_typcache) + sizeof(TypeCacheEntry *) * ncols)

typedef struct BrinDesc
{
	/* Containing memory context */
	MemoryContext bd_context;

	/* the index relation itself */
	Relation	bd_index;

	/* tuple descriptor of the index relation */
	TupleDesc	bd_tupdesc;

	/* cached copy for on-disk tuples; generated at first use */
	TupleDesc	bd_disktdesc;

	/* total number of Datum entries that are stored on-disk for all columns */
	int			bd_totalstored;

	/* per-column info; bd_tupdesc->natts entries long */
	BrinOpcInfo *bd_info[FLEXIBLE_ARRAY_MEMBER];
} BrinDesc;

/*
 * Globally-known function support numbers for BRIN indexes.  Individual
 * opclasses can define more function support numbers, which must fall into
 * BRIN_FIRST_OPTIONAL_PROCNUM .. BRIN_LAST_OPTIONAL_PROCNUM.
 */
#define BRIN_PROCNUM_OPCINFO		1
#define BRIN_PROCNUM_ADDVALUE		2
#define BRIN_PROCNUM_CONSISTENT		3
#define BRIN_PROCNUM_UNION			4
#define BRIN_MANDATORY_NPROCS		4
#define BRIN_PROCNUM_OPTIONS 		5	/* optional */
/* procedure numbers up to 10 are reserved for BRIN future expansion */
#define BRIN_FIRST_OPTIONAL_PROCNUM 11
#define BRIN_LAST_OPTIONAL_PROCNUM	15

#undef BRIN_DEBUG

#ifdef BRIN_DEBUG
#define BRIN_elog(args)			elog args
#else
#define BRIN_elog(args)			((void) 0)
#endif

/* brin.c */
extern BrinDesc *brin_build_desc(Relation rel);
extern void brin_free_desc(BrinDesc *bdesc);
extern IndexBuildResult *brinbuild(Relation heap, Relation index,
								   struct IndexInfo *indexInfo);
extern void brinbuildempty(Relation index);
extern bool brininsert(Relation idxRel, Datum *values, bool *nulls,
					   ItemPointer heaptid, Relation heapRel,
					   IndexUniqueCheck checkUnique,
					   bool indexUnchanged,
					   struct IndexInfo *indexInfo);
extern IndexScanDesc brinbeginscan(Relation r, int nkeys, int norderbys);
extern int64 bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
extern void brinrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
					   ScanKey orderbys, int norderbys);
extern void brinendscan(IndexScanDesc scan);
extern IndexBulkDeleteResult *brinbulkdelete(IndexVacuumInfo *info,
											 IndexBulkDeleteResult *stats,
											 IndexBulkDeleteCallback callback,
											 void *callback_state);
extern IndexBulkDeleteResult *brinvacuumcleanup(IndexVacuumInfo *info,
												IndexBulkDeleteResult *stats);
extern bytea *brinoptions(Datum reloptions, bool validate);

/* brin_validate.c */
extern bool brinvalidate(Oid opclassoid);

#endif							/* BRIN_INTERNAL_H */


, 0),
                    3,
                    3
                ),
                arrayOf<Any>(
                    "Cert valid for over 15 months, needs 3 SCTs",
                    date(2015, 3, 25, 11, 25, 0),
                    date(2016, 6, 27, 11, 25, 0),
                    3,
                    3
                ),
                arrayOf<Any>(
                    "Cert valid for exactly 27 months, needs 3 SCTs",
                    date(2015, 3, 25, 11, 25, 0),
                    date(2017, 6, 25, 11, 25, 0),
                    3,
                    3
                ),
                arrayOf<Any>(
                    "Cert valid for over 27 months, needs 4 SCTs",
                    date(2015, 3, 25, 11, 25, 0),
                    date(2017, 6, 28, 11, 25, 0),
                    4,
                    3
                ),
                arrayOf<Any>(
                    "Cert valid for exactly 39 months, needs 4 SCTs (old policy) or 3 SCTs (new policy)",
                    date(2015, 3, 25, 11, 25, 0),
                    date(2018, 6, 25, 11, 25, 0),
                    4,
                    3
                ),
                arrayOf<Any>(
                    "Cert valid for over 39 months, needs 5 SCTs (old policy) or 3 SCTs (new policy)",
                    date(2015, 3, 25, 11, 25, 0),
                    date(2018, 6, 27, 11, 25, 0),
                    5,
                    3
                )
            )
        }
    }
}

@Suppress("LongParameterList", "SameParameterValue")
fun date(year: Int, month: Int, dayOfMonth: Int, hour: Int, minute: Int, second: Int): Date =
    Calendar.getInstance().apply {
        set(Calendar.YEAR, year)
        set(Calendar.MONTH, month - 1)
        set(Calendar.DAY_OF_MONTH, dayOfMonth)
        set(Calendar.HOUR_OF_DAY, hour)
        set(Calendar.MINUTE, minute)
        set(Calendar.SECOND, second)
        set(Calendar.MILLISECOND, 0)
        timeZone = java.util.TimeZone.getTimeZone("UTC")
    }.time

private val oldPolicySct
    get() = SignedCertificateTimestamp(
        id = LogId(Random.nextBytes(10)),
        timestamp = LocalDateTime.of(2022, 1, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant(),
        extensions = byteArrayOf(),
        signature = DigitallySigned(signature = byteArrayOf())
    )

private val newPolicySct
    get() = SignedCertificateTimestamp(
        id = LogId(Random.nextBytes(10)),
        // 15 April 2022
        timestamp = Instant.ofEpochMilli(1649980800000),
        extensions = byteArrayOf(),
        signature = DigitallySigned(signature = byteArrayOf())
    )
/*
 * Copyright 2020 Appmattus Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.appmattus.layercache

import android.content.Context
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertNull
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.security.KeyStore

@RunWith(AndroidJUnit4::class)
class EncryptionEncryptValuesConnectedTest {


,
        Enchantment = 162,
        Azure_Lore = 163,
        Chain_Affinity = 164,
        Burst_Affinity = 165,
        Overdrive = 166,
        Magic_Def_Down = 167,
        Inhibit_TP = 168,
        Potency = 169,
        Regain = 170,
        Pax = 171,
        Intension = 172,
        Dread_Spikes = 173,
        Magic_Acc_Down = 174,
        Magic_Atk_Down = 175,
        Quickening = 176,
        Encumbrance = 177,
        Firestorm = 178,
        Hailstorm = 179,
        Windstorm = 180,
        Sandstorm = 181,
        Thunderstorm = 182,
        Rainstorm = 183,
        Aurorastorm = 184,
        Voidstorm = 185,
        Helix = 186,
        Sublimation_Activated = 187,
        Sublimation_Complete = 188,
        Max_TP_Down = 189,
        Magic_Atk_Boost = 190,
        Magic_Def_Boost = 191,
        Requiem = 192,
        Lullaby = 193,
        Elegy = 194,
        Paeon = 195,
        Ballad = 196,
        Minne = 197,
        Minuet = 198,
        Madrigal = 199,
        Prelude = 200,
        Mambo = 201,
        Aubade = 202,
        Pastoral = 203,
        Hum = 204,
        Fantasia = 205,
        Operetta = 206,
        Capriccio = 207,
        Serenade = 208,
        Round = 209,
        Gavotte = 210,
        Fugue = 211,
        Rhapsody = 212,
        Aria = 213,
        March = 214,
        Etude = 215,
        Carol = 216,
        Threnody = 217,
        Hymnus = 218,
        Mazurka = 219,
        Sirvente = 220,
        Dirge = 221,
        Scherzo = 222,
        Auto_Regen = 233,
        Auto_Refresh = 234,
        Fishing_Imagery = 235,
        Woodworking_Imagery = 236,
        Smithing_Imagery = 237,
        Goldsmithing_Imagery = 238,
        Clothcraft_Imagery = 239,
        Leathercraft_Imagery = 240,
        Bonecraft_Imagery = 241,
        Alchemy_Imagery = 242,
        Cooking_Imagery = 243,
        Dedication = 249,
        Ef_Badge = 250,
        Food = 251,
        Chocobo = 252,
        Signet = 253,
        Battlefield = 254,
        Sanction = 256,
        Besieged = 257,
        Illusion = 258,
        //Encumbrance
        No_Weapons_Armor = 259,
        //Obliviscence
        No_Support_Job = 260,
        //Impairment
        No_Job_Abilities = 261,
        //Omerta
        No_Magic_Casting = 262,
        //Debilitation
        Penalty_to_Attributes = 263,
        Pathos = 264,
        Flurry = 265,
        Concentration = 266,
        Allied_Tags = 267,
        Sigil = 268,
        Level_Sync = 269,
        Aftermath_lvl1 = 270,
        Aftermath_lvl2 = 271,
        Aftermath_lvl3 = 272,
        Aftermath = 273,
        Enlight = 274,
        Auspice = 275,
        Confrontation = 276,
        Enfire_2 = 277,
        Enblizzard_2 = 278,
        Enaero_2 = 279,
        Enstone_2 = 280,
        Enthunder_2 = 281,
        Enwater_2 = 282,
        Perfect_Defense = 283,
        Egg = 284,
        Visitant = 285,
        Baramnesia = 286,
        Atma =


 [r1]
	b _02217674
_02217664:
	ldr r0, [sp, #0xc]
	add r1, sp, #0
	strh r0, [r1]
	mov r0, #8
	ldrh r2, [r1]
	ldrsb r0, [r4, r0]
	mul r0, r2
	strh r0, [r1]
_02217674:
	add r0, r5, #0
	add r1, sp, #0
	bl sub_020135B0
	mov r0, #1
	add sp, #0x18
	pop {r3, r4, r5, pc}
	.align 2, 0

	thumb_func_start ov08_02217684
ov08_02217684: ; 0x02217684
	push {r3, r4, r5, lr}
	sub sp, #0x18
	add r5, r0, #0
	add r4, r1, #0
	mov r1, #0
	add r0, sp, #0
	strh r1, [r0]
	add r0, r4, #0
	add r1, sp, #4
	bl ov08_022173BC
	add r0, r4, #0
	bl ov08_0221727C
	strb r0, [r4, #8]
	ldr r0, [sp, #8]
	cmp r0, #1
	bne _022176AC
	mov r0, #1
	strb r0, [r4, #8]
_022176AC:
	ldr r1, [sp, #4]
	cmp r1, #3
	bgt _022176CA
	cmp r1, #0
	blt _022176DE
	add r0, r1, r1
	add r0, pc
	ldrh r0, [r0, #6]
	lsl r0, r0, #0x10
	asr r0, r0, #0x10
	add pc, r0
_022176C2: ; jump table
	.short _022176CE - _022176C2 - 2 ; case 0
	.short _022176D8 - _022176C2 - 2 ; case 1
	.short _022176DE - _022176C2 - 2 ; case 2
	.short _022176DE - _022176C2 - 2 ; case 3
_022176CA:
	cmp r1, #0xff
	b _022176DE
_022176CE:
	add r0, r5, #0
	add r1, sp, #0
	bl sub_020135F4
	b _022176DE
_022176D8:
	ldr r1, [sp, #0xc]
	add r0, sp, #0
	strh r1, [r0]
_022176DE:
	add r0, r5, #0
	add r1, sp, #0
	bl sub_020135E0
	mov r0, #1
	add sp, #0x18
	pop {r3, r4, r5, pc}

	thumb_func_start ov08_022176EC
ov08_022176EC: ; 0x022176EC
	mov r0, #1
	bx lr

	thumb_func_start ov08_022176F0
ov08_022176F0: ; 0x022176F0
	mov r0, #1
	bx lr

	thumb_func_start ov08_022176F4
ov08_022176F4: ; 0x022176F4
	mov r0, #1
	bx lr

	thumb_func_start ov08_022176F8
ov08_022176F8: ; 0x022176F8
	mov r0, #1
	bx lr

	thumb_func_start ov08_022176FC
ov08_022176FC: ; 0x022176FC
	push {r3, r4, r5


.0, 40.0, 10.0, 20.0, 35.0, 10.0],
    [20.0, 30.0, 35.0, 35.0, 30.0, 20.0, 20.0, 30.0],
  ]);

  // Prints: "Bounding box: 10.0,10.0,45.0,45.0"
  // Values contained in the bbox in this case: min-x, min-y, max-x, max-y
  final bbox = polygon.calculateBounds();
  print('Bounding box: ${bbox?.toText(decimals: 1, compactNums: false)}');

  // Bbox center, prints: "Bbox center: 27.5,27.5"
  final center = bbox?.aligned2D();
  print('Bbox center: ${center?.toText(decimals: 1)}');

  // It's also possible to calculate aligned points inside a bounding box.
  // X = The horizontal distance fraction.
  //    The value -1.0 represents the west side edge of the box.
  //    The value 0.0 represents the center horizontally.
  //    The value 1.0 represents the east side edge of the box.
  // Y = The vertical distance fraction.
  //    The value -1.0 represents the south side edge of the box.
  //    The value 0.0 represents the center vertically.
  //    The value 1.0 represents the north side edge of the box.

  // Bbox aligned, prints: "Bbox aligned: 36.250,36.250"
  final aligned = bbox?.aligned2D(Aligned(x: 0.5, y: 0.5));
  print('Bbox aligned: ${aligned?.toText(decimals: 3)}');

  // Prints: "Centroid pos: 27.407,28.765"
  final centroid = polygon.centroid2D();
  print('Centroid pos: ${centroid?.toText(decimals: 3)}');

  // Prints: "Polylabel pos: 17.65625,24.21875 dist: 5.745242597140699"
  final p = polygon.polylabel2D(precision: 2.0);
  print('Polylabel pos: ${p.position} dist: ${p.distance}');

  // prints: "(20,20) => true, (10,10) => false"
  final inside = polygon.isPointInPolygon2D([20.0, 20.0].xy);
  final outside = polygon.isPointInPolygon2D([10.0, 10.0].xy);
  print('(20,20) => $inside, (10,10) => $outside');

  // prints: "(20,20) => 3.7139067635410368, (10,10) => 9.284766908852593"
  final dist1 = polygon.distanceTo2D([20.0, 20.0].xy);
  final dist2 = polygon.distanceTo2D([10.0, 10.0].xy);
  print('(20,20) => $dist1, (10,10) => $dist2');

  // Polygon outer ring length, inner ring length and total outline length.
  // "Outer 114.35571426165451 + inner 45.76491222541475 = 160.12062648706927"
  final outerLength = polygon.exterior?.length2D();
  final innerLength = polygon.interior.first.length2D();
  final totalLength = polygon.length2D();
  print('Outer $outerLength + inner $innerLength = $totalLength');

  // Polygon outer ring area, inner ring area and total outline area.
  // Prints: "Outer 775.0 - inner 100.0 = 675.0"
  final outerArea = polygon.exterior?.signedArea2D().abs();
  final innerArea = polygon.interior.first.signedArea2D().abs();
  final totalArea = polygon.area2D();
  print('Outer $outerArea - inner $innerArea = $totalArea');
}

void _geometricCartesianPolygonFromGeometryManipulation() {
  // Polygon linear rings each an `PositionSeries` instance constructed by
  // `positions()` method.
  final exteriorRing =
      [35.


	addq	#1,T20006.l		      ; 51171 00004E26	     Ry  N&
	beq.s	L12060			      ; 63444 		     g$
	clr.l	-(a7)			      ; 41247 		     B
	pea	(a2)			      ; 44122 		     HR
	move	#67,-(a7)	; Fattrib     ; 37474 0043	     ?< C
	trap	#1		; Gemdos      ; 47101 		     NA
	lea 	10(a7),a7		      ; 47757 000A	     O
	tst	d0			      ; 45100 		     J@
	bge.s	L11988			      ; 66312 		     l
	movea.l	a2,a0			      ; 20112 		      J
	move.l	a3,d0			      ; 20013
	beq.s	L12054			      ; 63406 		     g
	movea.l	a3,a0			      ; 20113 		      K
L12050:
	move.b	(a2)+,(a3)+		      ; 13332
	bne.s	L12050			      ; 63374 		     f
L12054:
	movea.l	(a7)+,a2		      ; 22137 		     $_
	movea.l	(a7)+,a3		      ; 23137 		     &_
	rts				      ; 47165 		     Nu

L12060:
	suba.l	a0,a0			      ; 90710
	bra.s	L12054			      ; 60366 		     `


IMESTAMP ECG BIOZ STATUS\n"
                stream.write(headerLine)
            }
            val logLine = "$timeStamp $ecg $bioz $status\n"
            stream.write(logLine)
        }
    }

    @Throws(IOException::class)
    fun logHr(timeStamp: Long? = null, data: PolarHrData.PolarHrSample) {
        logStreams[StreamType.HR]?.let { stream ->
            if (!stream.isStarted()) {
                var headerLine = "TIMESTAMP HR PPQ_QUALITY CORRECTED_HR RR_AVAILABLE CONTACT_SUPPORTED CONTACT_STATUS RR(ms)\n"
                stream.write(headerLine)
            }
            val logLine = "${timeStamp ?: ""} ${data.hr} ${data.ppgQuality} ${data.correctedHr} ${data.rrAvailable} ${data.contactStatusSupported} ${data.contactStatus} ${if (data.rrsMs.isEmpty()) "NA" else data.rrsMs.joinToString(separator = " ")}\n"
            stream.write(logLine)
        }
    }

    @Throws(IOException::class)
    fun logPpg(timeStamp: Long, ppgs: List<Int>, ambient: Int) {
        latestTimeStamp = timeStamp
        ppgTimeStamp = timeStamp
        logStreams[StreamType.PPG]?.let { stream ->
            if (!stream.isStarted()) {
                val ppgChannels = mutableListOf<String>()
                for (index in ppgs.indices) {
                    ppgChannels.add("PPG$index")
                }
                val headerLine = "TIMESTAMP ${ppgChannels.joinToString(separator = " ")} AMBIENT\n"
                stream.write(headerLine)
            }
            val logLine = "$timeStamp ${ppgs.joinToString(separator = " ")} $ambient\n"
            stream.write(logLine)
        }
    }

    @Throws(IOException::class)
    fun logPpg2Channels(timeStamp: Long, ppgs: List<Int>, status: Int) {
        latestTimeStamp = timeStamp
        ppgTimeStamp = timeStamp
        logStreams[StreamType.PPG]?.let { stream ->
            if (!stream.isStarted()) {
                val ppgChannels = mutableListOf<String>()
                for (index in ppgs.indices) {
                    ppgChannels.add("PPG$index")
                }
                val headerLine = "TIMESTAMP ${ppgChannels.joinToString(separator = " ")} Status\n"
                stream.write(headerLine)
            }
            val logLine = "$timeStamp ${ppgs.joinToString(separator = " ")} $status\n"
            stream.write(logLine)
        }
    }

    @Throws(IOException::class)
    fun logPpg2ChannelsAutoGain(timeStamp: Long, ppgs: List<Int>, numints: Int) {
        latestTimeStamp = timeStamp
        ppgTimeStamp = timeStamp
        logStreams[StreamType.PPG]?.let { stream ->
            if (!stream.isStarted()) {
                val ppgChannels = mutableListOf<String>()
                for (index in ppgs.indices) {
                    ppgChannels.add("TIA_GAIN_CH${index}_TS1")
                }
                val headerLine = "TIMESTAMP ${ppgChannels.joinToString(separator = " ")} NUMINT_TS1\n"
                stream.write(headerLine)
            }
            val logLine = "$timeStamp ${ppgs.joinToString(separator = " ")} $numints\n"
            stream.write(logLine)
        }
    }

    @Throws(IOException::class)
    fun logPpgData16Channels(timeStamp: Long, ppgs: List<Int>, status: Long) {
        latestTimeStamp = timeStamp
        logStreams[StreamType.PPG_DATA_16


   // duel not requested
    if (!duel)
        return;

    // Check if DuelComplete() has been called already up in the stack and in that case don't do anything else here
    if (duel->isCompleted || ASSERT_NOTNULL(duel->opponent->duel)->isCompleted)
        return;

    duel->isCompleted = true;
    duel->opponent->duel->isCompleted = true;

    TC_LOG_DEBUG("entities.unit", "Player::DuelComplete: Player '%s' (%s), Opponent: '%s' (%s)",
        GetName().c_str(), GetGUID().ToString().c_str(), duel->opponent->GetName().c_str(), duel->opponent->GetGUID().ToString().c_str());

    WorldPacket data(SMSG_DUEL_COMPLETE, (1));
    data << (uint8)((type != DUEL_INTERRUPTED) ? 1 : 0);
    SendDirectMessage(&data);

    if (duel->opponent->GetSession())
        duel->opponent->SendDirectMessage(&data);

    if (type != DUEL_INTERRUPTED)
    {
        data.Initialize(SMSG_DUEL_WINNER, (1+20));          // we guess size
        data << uint8(type == DUEL_WON ? 0 : 1);            // 0 = just won; 1 = fled
        data << duel->opponent->GetName();
        data << GetName();
        SendMessageToSet(&data, true);
    }

    sScriptMgr->OnPlayerDuelEnd(duel->opponent, this, type);

    switch (type)
    {
        case DUEL_FLED:
            // if initiator and opponent are on the same team
            // or initiator and opponent are not PvP enabled, forcibly stop attacking
            if (duel->initiator->GetTeam() == duel->opponent->GetTeam())
            {
                duel->initiator->AttackStop();
                duel->opponent->AttackStop();
            }
            else
            {
                if (!duel->initiator->IsPvP())
                    duel->initiator->AttackStop();
                if (!duel->opponent->IsPvP())
                    duel->opponent->AttackStop();
            }
            break;
        case DUEL_WON:
            UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
            duel->opponent->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);

            // Credit for quest Death's Challenge
            if (getClass() == CLASS_DEATH_KNIGHT && duel->opponent->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE)
                duel->opponent->CastSpell(duel->opponent, 52994, true);

            // Honor points after duel (the winner) - ImpConfig
            if (uint32 amount = sWorld->getIntConfig(CONFIG_HONOR_AFTER_DUEL))
                duel->opponent->RewardHonor(nullptr, 1, amount);

            break;
        default:
            break;
    }

    // Victory emote spell
    if (type != DUEL_INTERRUPTED)
        duel->opponent->CastSpell(duel->opponent, 52852, true);

    //Remove Duel Flag object
    GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER));
    if (obj)
        duel->initiator->RemoveGameObject(obj, true);

    /* remove auras */
    AuraApplicationMap &itsAuras = duel->opponent->GetAppliedAuras();
    for (AuraApplicationMap::iterator i = itsAuras.begin(); i != itsAuras.end();)
    {
        Aura const* aura = i->second->GetBase();
        if (!i->second->IsPositive() && aura->GetCasterGUID() == GetGUID() && aura->GetApplyTime() >= duel->startTime)
            duel->opponent->RemoveAura(i);


 err := PdfiumInstance.FPDFSignatureObj_GetSubFilter(&requests.FPDFSignatureObj_GetSubFilter{
					Signature: signature,
				})
				Expect(err).To(BeNil())
				Expect(subFilter).To(Equal(&responses.FPDFSignatureObj_GetSubFilter{}))
			})

			It("returns no signature reason", func() {
				reason, err := PdfiumInstance.FPDFSignatureObj_GetReason(&requests.FPDFSignatureObj_GetReason{
					Signature: signature,
				})

				Expect(err).To(BeNil())
				Expect(reason).To(Equal(&responses.FPDFSignatureObj_GetReason{}))
			})

			It("returns the correct signature time", func() {
				signatureTime, err := PdfiumInstance.FPDFSignatureObj_GetTime(&requests.FPDFSignatureObj_GetTime{
					Signature: signature,
				})
				Expect(err).To(BeNil())
				Expect(signatureTime).To(Equal(&responses.FPDFSignatureObj_GetTime{}))
			})

			It("returns the correct DocMDPPermission", func() {
				docMDPPermission, err := PdfiumInstance.FPDFSignatureObj_GetDocMDPPermission(&requests.FPDFSignatureObj_GetDocMDPPermission{
					Signature: signature,
				})
				Expect(err).To(BeNil())
				Expect(docMDPPermission).To(Equal(&responses.FPDFSignatureObj_GetDocMDPPermission{
					DocMDPPermission: 1,
				}))
			})
		})
	})
})
//go:build pdfium_experimental
// +build pdfium_experimental

package shared_tests

import (
	"io/ioutil"

	"github.com/klippa-app/go-pdfium/enums"
	"github.com/klippa-app/go-pdfium/references"
	"github.com/klippa-app/go-pdfium/requests"
	"github.com/klippa-app/go-pdfium/responses"

	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
)

func toPointer[T any](input T) *T {
	return &input
}

var _ = Describe("fpdf_attachment", func() {
	BeforeEach(func() {
		Locker.Lock()
	})

	AfterEach(func() {
		Locker.Unlock()
	})

	Context("no document is given", func() {
		It("returns an error when GetForm is called", func() {
			GetForm, err := PdfiumInstance.GetForm(&requests.GetForm{})
			Expect(err).To(MatchError("either page reference or index should be given"))
			Expect(GetForm).To(BeNil())
		})
	})

	Context("a normal PDF file without form fields", func() {
		var doc references.FPDF_DOCUMENT

		BeforeEach(func() {
			pdfData, err := ioutil.ReadFile(TestDataPath + "/testdata/test.pdf")
			Expect(err).To(BeNil())

			newDoc, err := PdfiumInstance.FPDF_LoadMemDocument(&requests.FPDF_LoadMemDocument{
				Data: &pdfData,
			})
			Expect(err).To(BeNil())

			doc = newDoc.Document
		})

		AfterEach(func() {
			FPDF_CloseDocument, err := PdfiumInstance.FPDF_CloseDocument(&requests.FPDF_CloseDocument{
				Document: doc,
			})
			Expect(err).To(BeNil())
			Expect(FPDF_CloseDocument).To(Not(BeNil()))
		})

		It("returns no form fields", func() {
			GetForm, err := PdfiumInstance.GetForm(&requests.GetForm{
				Page: requests.Page{
					ByIndex: &requests.PageByIndex{
						Document: doc,
						Index:    0,
					},
				},
			})
			Expect(err).To(BeNil())
			Expect(GetForm).To(Equal(&responses.GetForm{
				Page


local M = {}

local config = {
    -- Key mappings.
    -- Set any mapping to empty string to disable it.
    keymaps = {
        -- Set to `false` to disable all default mappings.
        defaults = true,

        -- Decode Base64 in-place (normal mode)
        decode_base64_inplace = "gyb",

        -- Decode Base64 in-place (visual mode)
        vdecode_base64_inplace = "gyb",

        -- Decode Base64 in a popup (normal mode)
        decode_base64_popup = "gb",

        -- Decode Base64 in a popup (visual mode)
        vdecode_base64_popup = "gb",

        -- Encode Base64 in-place (normal mode)
        encode_base64_inplace = "gB",

        -- Encode Base64 in-place (visual mode)
        vencode_base64_inplace = "gB",

        -- Decode Base64URL in-place (normal mode)
        decode_base64url_inplace = "gys",

        -- Decode Base64URL in-place (visual mode)
        vdecode_base64url_inplace = "gys",

        -- Decode Base64URL in a popup (normal mode)
        decode_base64url_popup = "gs",

        -- Decode Base64URL in a popup (visual mode)
        vdecode_base64url_popup = "gs",

        -- Encode Base64URL in-place (normal mode)
        encode_base64url_inplace = "gS",

        -- Encode Base64URL in-place (visual mode)
        vencode_base64url_inplace = "gS",

        -- Decode URL in-place (normal mode)
        decode_url_inplace = "gyl",

        -- Decode URL in-place (visual mode)
        vdecode_url_inplace = "gyl",

        -- Decode URL in a popup (normal mode)
        decode_url_popup = "gl",

        -- Decode URL in a popup (visual mode)
        vdecode_url_popup = "gl",

        -- Encode URL in-place (normal mode)
        encode_url_inplace = "gL",

        -- Encode URL in-place (visual mode)
        vencode_url_inplace = "gL",
    },

    -- Popup window settings
    popup = {
        -- Whether to enter popup window on open or no
        enter = true,

        -- Whether to show window title (with encoding type) or not


return (UserCalendar) this.getEntityForOne(hql, userId, bussIdentityKey, expireTime);
        } catch (BaseException e) {
            throw new PersistentException(ErrorCode.OBJECT_GET_ERROR, "获取用户日历异常", e);

        }
    }

    /**
     * 获取用户日历
     *
     * @param userId
     * @param sourceType
     * @param sourceId
     * @return
     */
    public UserCalendar getUserCalendar(Long userId, UserCalendarSource sourceType,String sourceId) {
        try {
            String hql = "from UserCalendar where userId =?0 and sourceType=?1 and sourceId=?2 ";
            return (UserCalendar) this.getEntityForOne(hql, userId, sourceType, sourceId);
        } catch (BaseException e) {
            throw new PersistentException(ErrorCode.OBJECT_GET_ERROR, "获取用户日历异常", e);

        }
    }

    /**
     * 获取用户目前需要的日历
     *
     * @return
     */
    public List<UserCalendar> getCurrentUserCalendarList(Long userId) {
        try {
            StringBuffer sb = new StringBuffer();
            sb.append("from UserCalendar where expireTime>=?0 and finishedTime is null ");
            if (userId != null) {
                sb.append("and userId=" + userId);
            } else {
                sb.append("order by userId");
            }
            return this.getEntityListNoPageHQL(sb.toString(), new Date());
        } catch (BaseException e) {
            throw new PersistentException(ErrorCode.OBJECT_GET_ERROR, "获取用户目前需要的日历异常", e);

        }
    }

    /**
     * @param userId
     * @param needFinished 是否需要已经完成的
     * @param needPeriod   是否需要周期性的
     * @param startDate
     * @param endDate
     * @return
     */
    public List<UserCalendar> getCurrentUserCalendarList(Long userId, String name, UserCalendarSource sourceType, Boolean needFinished, Boolean needPeriod, Date startDate, Date endDate) {
        try {
            StringBuffer sb = new StringBuffer();
            sb.append("from UserCalendar where userId=?0 ");
            sb.append("and bussDay<=?1 and expireTime>=?2 ");
            if (false == needFinished) {
                sb.append("and finishType is null ");
            }
            if (false == needPeriod) {
                sb.append("and period=0 ");
            }
            if (sourceType != null) {
                sb.append("and sourceType=" + sourceType.ordinal());
            }
            if (StringUtil.isNotEmpty(name)) {
                sb.append("and (title like '%" + name + "%' or content like '%" + name + "%')");
            }
            return this.getEntityListNoPageHQL(sb.toString(), userId, endDate, startDate);
        } catch (BaseException e) {
            throw new PersistentException(ErrorCode.OBJECT_GET_ERROR, "获取用户目前需要的日历异常", e);

        }
    }

    /**
     * 获取用户目前需要的日历数
     *
     * @return
     */
    public Long getTodayUserCalendarCount(Long userId) {
        try {
            String hql = "select count(0) from UserCalendar where expireTime>=?0 and finishedTime is null and userId=?1 ";

            return this.getCount(hql, new Date(), userId);
        } catch (BaseException e) {
            throw new PersistentException(ErrorCode.OBJECT_GET_ERROR, "获取用户目前需要的日历数异常", e);

        }
    }

    /**
     * 更新用户日历
     *
     *


 bbit0_d_nt_b_c_s9_has_delay_slot,   1
    .set bbit0_d_nt_b_c_s9_cc, 0
    bbit0_d_nt_b_c_s9_start:
	bbit0.d.nt r4,r5,@.Lbbit_target
    bbit0_d_nt_b_c_s9_end:
	nop_s

    ; bbit0.t b,c,s9
    .set bbit0_t_b_c_s9_target, @.Lbbit_target
    .set bbit0_t_b_c_s9_has_delay_slot,   0
    .set bbit0_t_b_c_s9_cc, 0
    bbit0_t_b_c_s9_start:
	bbit0.t r4,r5,@.Lbbit_target
    bbit0_t_b_c_s9_end:

    ; bbit0.d.t b,c,s9
    .set bbit0_d_t_b_c_s9_target, @.Lbbit_target
    .set bbit0_d_t_b_c_s9_has_delay_slot,   1
    .set bbit0_d_t_b_c_s9_cc, 0
    bbit0_d_t_b_c_s9_start:
	bbit0.d.t r4,r5,@.Lbbit_target
    bbit0_d_t_b_c_s9_end:
	nop_s

    ; bbit0.nt b,u6,s9
    .set bbit0_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit0_nt_b_u6_s9_has_delay_slot,   0
    .set bbit0_nt_b_u6_s9_cc, 0
    bbit0_nt_b_u6_s9_start:
	bbit0.nt r4,u6_value,@.Lbbit_target
    bbit0_nt_b_u6_s9_end:

    ; bbit0.d.nt b,u6,s9
    .set bbit0_d_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit0_d_nt_b_u6_s9_has_delay_slot,   1
    .set bbit0_d_nt_b_u6_s9_cc, 0
    bbit0_d_nt_b_u6_s9_start:
	bbit0.d.nt r4,u6_value,@.Lbbit_target
    bbit0_d_nt_b_u6_s9_end:
	nop_s

    ; bbit0.nt b,u6,s9
    .set bbit0_t_b_u6_s9_target, @.Lbbit_target
    .set bbit0_t_b_u6_s9_has_delay_slot,   0
    .set bbit0_t_b_u6_s9_cc, 0
    bbit0_t_b_u6_s9_start:
	bbit0.t r4,u6_value,@.Lbbit_target
    bbit0_t_b_u6_s9_end:

    ; bbit0.d.nt b,u6,s9
    .set bbit0_d_t_b_u6_s9_target, @.Lbbit_target
    .set bbit0_d_t_b_u6_s9_has_delay_slot,   1
    .set bbit0_d_t_b_u6_s9_cc, 0
    bbit0_d_t_b_u6_s9_start:
	bbit0.d.t r4,u6_value,@.Lbbit_target
    bbit0_d_t_b_u6_s9_end:
	nop_s

    ; bbit0.nt b,limm,s9
    .set bbit0_nt_b_limm_s9_target, @.Lbbit_target
    .set bbit0_nt_b_limm_s