45 7.26522 23.9999 7 23.9999H5C3.67441 23.9983 2.40356 23.471 1.46622 22.5336C0.528882 21.5963 0.00158786 20.3255 0 18.9999V17.5V16.9999V5C0.00158786 3.67441 0.528882 2.40356 1.46622 1.46622C2.40356 0.528882 3.67441 0.00158786 5 0H7C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.48043 8 0.734784 8 1C8 1.26522 7.89464 1.51957 7.70711 1.70711C7.51957 1.89464 7.26522 2 7 2H5C4.20435 2 3.44129 2.31607 2.87868 2.87868C2.31607 3.44129 2 4.20435 2 5V16.9999V17.5Z' fill='black'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M23.9998 17.5V18.9999C23.9982 20.3255 23.471 21.5963 22.5336 22.5336C21.5963 23.471 20.3254 23.9983 18.9998 23.9999H16.9998C16.7346 23.9999 16.4803 23.8945 16.2927 23.707C16.1052 23.5194 15.9998 23.2651 15.9998 22.9999C15.9998 22.7346 16.1052 22.4803 16.2927 22.2928C16.4803 22.1052 16.7346 21.9999 16.9998 21.9999H18.9998C19.7955 21.9999 20.5586 21.6838 21.1212 21.1212C21.6838 20.5586 21.9998 19.7955 21.9998 18.9999V17.5V16.9999V5C21.9998 4.20435 21.6838 3.44129 21.1212 2.87868C20.5586 2.31607 19.7955 2 18.9998 2H16.9998C16.7346 2 16.4803 1.89464 16.2927 1.70711C16.1052 1.51957 15.9998 1.26522 15.9998 1C15.9998 0.734784 16.1052 0.48043 16.2927 0.292893C16.4803 0.105357 16.7346 0 16.9998 0H18.9998C20.3254 0.00158786 21.5963 0.528882 22.5336 1.46622C23.471 2.40356 23.9982 3.67441 23.9998 5V16.9999V17.5Z' fill='black'/%3E%3C/svg%3E");
}

/* Breadcrumbs Trail */
body:not(.no-svg-replace) svg.breadcrumbs-trail-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' id='Layer_1' data-name='Layer 1' viewBox='0 0 24 24' width='100%25' height='100%25'%3E%3Cpath d='M17 23H7a5.006 5.006 0 0 1-5-5V10.446a1.119 1.119 0 0 0-.391-.792A4.989 4.989 0 0 1 .066 5.179C.482 2.6 2.85 1 6.242 1H18.848a5.122 5.122 0 0 1 5.086 4.179h0a4.99 4.99 0 0 1-1.546 4.478 1.115 1.115 0 0 0-.388.789V18A5.006 5.006 0 0 1 17 23Z


;
            }
            this.Show();
        }

        private void OnFormClosing(object sender, FormClosingEventArgs e)
        {
            if (!tablePanel.Controls.Cast<CheckBox>().Any(item => item.Checked))
            {
                e.Cancel = true;
                MessageBox.Show("Select at least one column");
                return;
            }
            List<string> temp = new List<string>();
            StringBuilder sb = new StringBuilder();
            foreach (CheckBox cb in tablePanel.Controls.Cast<CheckBox>().Where(item => item.Checked))
            {
                temp.Add(cb.Name);

                sb.Append(cb.Name);
                sb.Append(',');
            }
            if (S.GET<BlastEditorForm>() != null)
            {
                S.GET<BlastEditorForm>().VisibleColumns = temp;
                S.GET<BlastEditorForm>().RefreshVisibleColumns();
            }
            NetCore.Params.SetParam("BLASTEDITOR_VISIBLECOLUMNS", sb.ToString());
        }
    }
}


al? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"
},a={className:"literal",begin:"(#t|#f|#\\\\"+t+"|#\\\\.)"},i={
className:"number",variants:[{begin:n,relevance:0},{begin:n+"[+\\-]"+n+"i",
relevance:0},{begin:"#b[0-1]+(/[0-1]+)?"},{begin:"#o[0-7]+(/[0-7]+)?"},{
begin:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},c=e.QUOTE_STRING_MODE,s=[e.COMMENT(";","$",{
relevance:0}),e.COMMENT("#\\|","\\|#")],l={begin:t,relevance:0},o={
className:"symbol",begin:"'"+t},g={endsWithParent:!0,relevance:0},u={variants:[{
begin:/'/},{begin:"`"}],contains:[{begin:"\\(",end:"\\)",
contains:["self",a,c,i,l,o]}]},d={className:"name",relevance:0,begin:t,
keywords:r},p={variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}],
contains:[{begin:/lambda/,endsWithParent:!0,returnBegin:!0,contains:[d,{
endsParent:!0,variants:[{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/}],
contains:[l]}]},d,g]};return g.contains=[a,i,c,l,o,u,p].concat(s),{
name:"Scheme",aliases:["scm"],illegal:/\S/,
contains:[e.SHEBANG(),i,c,o,u,p].concat(s)}}})()
;hljs.registerLanguage("scheme",e)})();/*! `shell` grammar compiled for Highlight.js 11.9.0 */
(()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session",
aliases:["console","shellsession"],contains:[{className:"meta.prompt",
begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,
subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})();/*! `smalltalk` grammar compiled for Highlight.js 11.9.0 */
(()=>{var e=(()=>{"use strict";return e=>{const n="[a-z][a-zA-Z0-9_]*",a={
className:"string",begin:"\\$.{1}"},s={className:"symbol",
begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],
keywords:["self","super","nil","true","false","thisContext"],
contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",
begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:n+":",relevance:0
},e.C_NUMBER_MODE,s,a,{begin:"\\|[ ]*"+n+"([ ]+"+n+")*[ ]*\\|",returnBegin:!0,
end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+n}]},{begin:"#\\(",
end:"\\)",contains:[e.APOS_STRING_MODE,a,e.C_NUMBER_MODE,s]}]}}})()
;hljs.registerLanguage("smalltalk",e)})();/*! `sql` grammar compiled for Highlight.js 11.9.0 */
(()=>{var e=(()=>{"use strict";return e=>{
const r=e.regex,t=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","


ludeInlayFunctionLikeReturnTypeHints = true,
              includeInlayEnumMemberValueHints = true,
            },
          },
        },
      })

      lspconfig.tailwindcss.setup({
        capabilities = capabilities,
        filetypes = { "html", "css", "scss", "javascript", "javascriptreact", "typescript", "typescriptreact" },
      })

      lspconfig.cssls.setup({
        capabilities = capabilities,
      })

      lspconfig.ts_ls.setup({
        capabilities = capabilities,
        filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
        rootpatterns = {
          "package.json",
          "tsconfig.json",
          "jsconfig.json",
          ".git",
        },
      })

      lspconfig.eslint.setup({
        capabilities = capabilities,
        settings = {
          workingDirectories = { mode = "auto" },
        },
      })

      lspconfig.graphql.setup({
        capabilities = capabilities,
      })

      lspconfig.html.setup({
        capabilities = capabilities,
        filetypes = { "html", "htmldjango" },
      })

      lspconfig.jsonls.setup({
        capabilities = capabilities,
      })

      lspconfig.emmet_ls.setup({
        capabilities = capabilities,
        filetypes = {
          "html",
          "htmldjango",
          "css",
          "scss",
          -- Removed JS/TS files to prevent aggressive HTML tag suggestions
          -- "javascript",
          -- "javascriptreact",
          -- "typescript",
          -- "typescriptreact",
        },
      })

      lspconfig.pyright.setup({
        capabilities = capabilities,
      })

      lspconfig.ruff.setup({
        capabilities = capabilities,
      })

      vim.keymap.set("n", "K", vim.lsp.buf.hover, {})                -- show info in a hover
      vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})  -- go to definition
      vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})  -- go to references
      vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {}) -- perform code action
      vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {})      -- rename symbol
      vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, {}) -- go to type definition
      vim.keymap.set("n", "<leader>ds", vim.diagnostic.open_float, {}) -- show diagnostics
    end,
  },
}


xts_enc_final_abort:
	ret
.size	aes_v8_xts_encrypt,.-aes_v8_xts_encrypt
.globl	aes_v8_xts_decrypt
.type	aes_v8_xts_decrypt,%function
.align	5
aes_v8_xts_decrypt:
	AARCH64_VALID_CALL_TARGET
	cmp	x2,#16
	// Original input data size bigger than 16, jump to big size processing.
	b.ne	.Lxts_dec_big_size
	// Encrypt the iv with key2, as the first XEX iv.
	ldr	w6,[x4,#240]
	ld1	{v0.4s},[x4],#16
	ld1	{v6.16b},[x5]
	sub	w6,w6,#2
	ld1	{v1.4s},[x4],#16

.Loop_dec_small_iv_enc:
	aese	v6.16b,v0.16b
	aesmc	v6.16b,v6.16b
	ld1	{v0.4s},[x4],#16
	subs	w6,w6,#2
	aese	v6.16b,v1.16b
	aesmc	v6.16b,v6.16b
	ld1	{v1.4s},[x4],#16
	b.gt	.Loop_dec_small_iv_enc

	aese	v6.16b,v0.16b
	aesmc	v6.16b,v6.16b
	ld1	{v0.4s},[x4]
	aese	v6.16b,v1.16b
	eor	v6.16b,v6.16b,v0.16b

	ld1	{v0.16b},[x0]
	eor	v0.16b,v6.16b,v0.16b

	ldr	w6,[x3,#240]
	ld1	{v28.4s,v29.4s},[x3],#32			// load key schedule...

	aesd	v0.16b,v28.16b
	aesimc	v0.16b,v0.16b
	ld1	{v16.4s,v17.4s},[x3],#32			// load key schedule...
	aesd	v0.16b,v29.16b
	aesimc	v0.16b,v0.16b
	subs	w6,w6,#10			// bias
	b.eq	.Lxts_128_dec
.Lxts_dec_round_loop:
	aesd	v0.16b,v16.16b
	aesimc	v0.16b,v0.16b
	ld1	{v16.4s},[x3],#16			// load key schedule...
	aesd	v0.16b,v17.16b
	aesimc	v0.16b,v0.16b
	ld1	{v17.4s},[x3],#16			// load key schedule...
	subs	w6,w6,#2			// bias
	b.gt	.Lxts_dec_round_loop
.Lxts_128_dec:
	ld1	{v18.4s,v19.4s},[x3],#32			// load key schedule...
	aesd	v0.16b,v16.16b
	aesimc	v0.16b,v0.16b
	aesd	v0.16b,v17.16b
	aesimc	v0.16b,v0.16b
	ld1	{v20.4s,v21.4s},[x3],#32			// load key schedule...
	aesd	v0


  else if (strategy == MZ_HUFFMAN_ONLY) comp_flags &= ~TDEFL_MAX_PROBES_MASK;
  else if (strategy == MZ_FIXED) comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS;
  else if (strategy == MZ_RLE) comp_flags |= TDEFL_RLE_MATCHES;

  return comp_flags;
}
#endif //MINIZ_NO_ZLIB_APIS

#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable:4204) // nonstandard extension used : non-constant aggregate initializer (also supported by GNU C and C99, so no big deal)
#endif

// Simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299, more context at
// http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
// This is actually a modification of Alex's original code so PNG files generated by this function pass pngcheck.
void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip)
{
  // Using a local copy of this array here in case MINIZ_NO_ZLIB_APIS was defined.
  static const mz_uint s_tdefl_png_num_probes[11] = { 0, 1, 6, 32,  16, 32, 128, 256,  512, 768, 1500 };
  tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); tdefl_output_buffer out_buf; int i, bpl = w * num_chans, y, z; mz_uint32 c; *pLen_out = 0;
  if (!pComp) return NULL;
  MZ_CLEAR_OBJ(out_buf); out_buf.m_expandable = MZ_TRUE; out_buf.m_capacity = 57+MZ_MAX(64, (1+bpl)*h); if (NULL == (out_buf.m_pBuf = (mz_uint8*)MZ_MALLOC(out_buf.m_capacity))) { MZ_FREE(pComp); return NULL; }
  // write dummy header
  for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf);
  // compress image data
  tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
  for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8*)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); }
  if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; }
  // write real header
  *pLen_out = out_buf.m_size-41;
  {
    static const mz_uint8 chans[] = {0x00, 0x00, 0x04, 0x02, 0x06};
    mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00


 reference stream DP object */
        delete m_stream->m_vm_dp;
        m_stream->m_vm_dp = NULL;
    }
}

bool
TrexVmSplitter::split_internal() {

    /* no split needed ? fall back */
    if (!m_stream->m_vm.need_split()) {
        return false;
    }

    duplicate_vm();

    /* search for splitable instructions */
    for (StreamVmInstruction *instr : m_stream->m_vm.get_instruction_list()) {
        if (!instr->is_var_instruction()) {
            continue;
        }

        split_flow_var( (const StreamVmInstructionVar *)instr );

    }

    /* done - now compile for all cores */
    compile_vm();

    return true;

}

/**
 * split a flow var instruction
 *
 * @author imarom (20-Dec-15)
 *
 * @param instr
 *
 * @return bool
 */
void
TrexVmSplitter::split_flow_var(const StreamVmInstructionVar *src) {
    /* a var might not need split (random) */
    if (!src->need_split()) {
        return;
    }

    /* do work */
    int core_id = 0;
    for (TrexStream *core_stream : *m_core_streams) {

        StreamVmInstructionVar *dst = core_stream->m_vm.lookup_var_by_name(src->get_var_name());
        assert(dst);

        /* for each core we need to give a phase and multiply the step frequency */
        dst->update(core_id, m_dp_core_count);

        core_id++;
    }

}

/**
 * duplicate the VM instructions
 * to all the cores
 */
void
TrexVmSplitter::duplicate_vm() {
    /* for each core - duplicate the instructions */
    for (TrexStream *core_stream : *m_core_streams) {
        m_stream->m_vm.clone(core_stream->m_vm);
    }
}

/**
 * now compile the updated VM
 */
void
TrexVmSplitter::compile_vm() {
    /* for each core - duplicate the instructions */
    for (TrexStream *core_stream : *m_core_streams) {
        core_stream->vm_compile();
    }
}

/*
 Itay Marom
 Cisco Systems, Inc.
*/

/*
Copyright (c) 2015-2015 Cisco Systems, Inc.

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

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

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

#include "trex_rx_defs.h"
#include "publisher/trex_publisher.h"

#include "trex_stl.h"
#include "trex_stl_port.h"
#include "trex_stl_streams_compiler.h"
#include "trex_stl_messaging.h"
#include "trex_stl_fs.h"

#include <common/basic_utils.h>
#include <common/captureFile.h>

#include <string>

#ifndef TREX_RPC_MOCK_SERVER

// DPDK c++ issue
#ifndef UINT8_MAX
    #define UINT8_MAX 255
#endif

#ifndef UINT16_MAX
    #define UINT16_MAX 0xFFFF
#endif

// DPDK c++ issue
#endif

#include <os_time.h>

void
port_id_to_cores(uint8_t port_id, std::vector<std::pair<uint8_t, uint8_t>> &cores_id_list);

using namespace std;

/***************************
 * trex DP events handlers
 *
 **************************/


10 {
  margin-left: 83.333%;
}
.col-xs-offset-9 {
  margin-left: 75%;
}
.col-xs-offset-8 {
  margin-left: 66.666%;
}
.col-xs-offset-7 {
  margin-left: 58.333%;
}
.col-xs-offset-6 {
  margin-left: 50%;
}
.col-xs-offset-5 {
  margin-left: 41.666%;
}
.col-xs-offset-4 {
  margin-left: 33.333%;
}
.col-xs-offset-3 {
  margin-left: 25%;
}
.col-xs-offset-2 {
  margin-left: 16.666%;
}
.col-xs-offset-1 {
  margin-left: 8.333%;
}
.col-xs-offset-0 {
  margin-left: 0%;
}
@media (min-width: 768px) {
  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
    float: left;
  }
  .col-sm-12 {
    width: 100%;
  }
  .col-sm-11 {
    width: 91.666%;
  }
  .col-sm-10 {
    width: 83.333%;
  }
  .col-sm-9 {
    width: 75%;
  }
  .col-sm-8 {
    width: 66.666%;
  }
  .col-sm-7 {
    width: 58.333%;
  }
  .col-sm-6 {
    width: 50%;
  }
  .col-sm-5 {
    width: 41.666%;
  }
  .col-sm-4 {
    width: 33.333%;
  }
  .col-sm-3 {
    width: 25%;
  }
  .col-sm-2 {
    width: 16.666%;
  }
  .col-sm-1 {
    width: 8.333%;
  }
  .col-sm-pull-12 {
    right: 100%;
  }
  .col-sm-pull-11 {
    right: 91.666%;
  }
  .col-sm-pull-10 {
    right: 83.333%;
  }
  .col-sm-pull-9 {
    right: 75%;
  }
  .col-sm-pull-8 {
    right: 66.666%;
  }
  .col-sm-pull-7 {
    right: 58.333%;
  }
  .col-sm-pull-6 {
    right: 50%;
  }
  .col-sm-pull-5 {
    right: 41.666%;
  }
  .col-sm-pull-4 {
    right: 33.333%;
  }
  .col-sm-pull-3 {
    right: 25%;
  }
  .col-sm-pull-2 {
    right: 16.666%;
  }
  .col-sm-pull-1 {
    right: 8.333%;
  }
  .col-sm-pull-0 {
    right: auto;
  }
  .col-sm-push-12 {
    left: 100%;
  }
  .col-sm-push-11 {
    left: 91.666%;
  }
  .col-sm-push-10 {
    left: 83.333%;
  }
  .col-sm-push-9 {
    left: 75%;
  }
  .col-sm-push-8 {
    left: 66.666%;
  }
  .col-sm-push-7 {
    left: 58.333%;
  }
  .col-sm-push-6 {
    left: 50%;
  }
  .col-sm-push-5 {
    left: 41.6


 new Dimension(
			Math.min(size.width, max.width),
			Math.min(size.height, max.height)
		);
	}

	private static IFigure getContents(IFigure figure) {
		if (figure == null) {
			return null;
		}

		if (figure instanceof ScrollPane) {
			IFigure contents = ((ScrollPane)figure).getContents();
			if (contents != null) {
				return contents;
			}
		}
		return figure;
	}

	@Override
	public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
		if(((SplitFigure)container).getOrientation() == SplitConstants.HORIZONTAL_SPLIT) {
			return new Dimension(0, -1);
		}
		return super.getMinimumSize(container, wHint, hHint);
	}

	@Override
	public void setConstraint(IFigure child, Object constraint) {
		super.setConstraint(child, constraint);

		if (SplitFigure.LEFT.equals(constraint) || SplitFigure.TOP.equals(constraint)) {
			leftFigure = child;
		} else
		if (SplitFigure.DIVIDER.equals(constraint)) {
			dividerFigure = child;
		} else
		if (SplitFigure.RIGHT.equals(constraint) || SplitFigure.BOTTOM.equals(constraint)) {
			rightFigure = child;
		}
	}

	@Override
	public void layout(IFigure container) {
		Rectangle area = container.getClientArea();
//		Dimension minSize = getMinimumSize(container, -1, -1);
		Rectangle bounds = new Rectangle();

		Point sashLocation = dividerFigure.getBounds().getLocation();

		if(((SplitFigure)container).getOrientation() == SplitConstants.HORIZONTAL_SPLIT) {
			int sashX = 0;
			if (sashLocation.x < 0) {
				sashX = 0;
//			} else if (area.width > minSize.width && sashLocation.x  - dividerFigure.getPreferredSize().width > area.width) {
//				sashX = area.width  - dividerFigure.getPreferredSize().width;
			} else {
				sashX = sashLocation.x;
			}

			bounds.y = area.y;
			bounds.height = area.height;//Math.max(leftFigure.getPreferredSize().height, rightFigure.getPreferredSize().height));

			if (leftFigure != null) {
				bounds.x = 0;
				bounds.width = sashX;
				leftFigure.setBounds(bounds);
			}

			if (dividerFigure != null) {
				bounds.x += sashX;
				bounds.width = dividerFigure.getPreferredSize().width;
				dividerFigure.setBounds(bounds);
			}

			if (rightFigure != null) {
				bounds.x += dividerFigure.getPreferredSize().width;
				if (rightFigure instanceof ScrollPane) {
					bounds.width = area.width - bounds.x;
				} else {
					bounds.width = rightFigure.getPreferredSize().width;
					bounds.width = area.width - bounds.x;
				}
				rightFigure.setBounds(bounds);
			}
		} else {
			int sashY = 0;
			if (sashLocation.y < 0) {
				sashY = 0;
//			} else if (sashLocation.y  - dividerFigure.getPreferredSize().height > area.height) {
//				sashY = area.height  - dividerFigure.getPreferredSize().height;
			} else {
				sashY = sashLocation.y;
			}

			bounds.x = area.x;
			bounds.width = area.width;

			if (leftFigure != null) { // top figure
				bounds.y = 0;
				bounds.height = sashY;
				leftFigure.setBounds(bounds);
			}

			if (dividerFigure != null) {
				bounds.y += sashY;
				bounds.height = dividerFigure.getPreferredSize().height;
				dividerFigure.setBounds(bounds);
			}

			if (rightFigure != null) { // bottom figure
				bounds.y += dividerFigure.getPreferredSize().height;
				if (rightFigure instanceof ScrollPane) {
					bounds.height = area.height - bounds.y;
				} else {
					bounds.height = rightFigure.getPreferredSize().height;
				}
				rightFigure.setBounds(bounds);
			}
		}

	}

}
/********************


) => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<StructuredQuery_FieldReference>(create);
  static StructuredQuery_FieldReference? _defaultInstance;

  /// A reference to a field in a document.
  ///
  /// Requires:
  ///
  /// * MUST be a dot-delimited (`.`) string of segments, where each segment
  /// conforms to [document field name][google.firestore.v1.Document.fields]
  /// limitations.
  @$pb.TagNumber(2)
  $core.String get fieldPath => $_getSZ(0);
  @$pb.TagNumber(2)
  set fieldPath($core.String value) => $_setString(0, value);
  @$pb.TagNumber(2)
  $core.bool hasFieldPath() => $_has(0);
  @$pb.TagNumber(2)
  void clearFieldPath() => $_clearField(2);
}

/// The projection of document's fields to return.
class StructuredQuery_Projection extends $pb.GeneratedMessage {
  factory StructuredQuery_Projection({
    $core.Iterable<StructuredQuery_FieldReference>? fields,
  }) {
    final result = create();
    if (fields != null) result.fields.addAll(fields);
    return result;
  }

  StructuredQuery_Projection._();

  factory StructuredQuery_Projection.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory StructuredQuery_Projection.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'StructuredQuery.Projection',
      package:
          const $pb.PackageName(_omitMessageNames ? '' : 'google.firestore.v1'),
      createEmptyInstance: create)
    ..pc<StructuredQuery_FieldReference>(
        2, _omitFieldNames ? '' : 'fields', $pb.PbFieldType.PM,
        subBuilder: StructuredQuery_FieldReference.create)
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  StructuredQuery_Projection clone() =>
      StructuredQuery_Projection()..mergeFromMessage(this);
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  StructuredQuery_Projection copyWith(
          void Function(StructuredQuery_Projection) updates) =>
      super.copyWith(
              (message) => updates(message as StructuredQuery_Projection))
          as StructuredQuery_Projection;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

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

  /// The fields to return.
  ///
  /// If empty, all fields are returned. To only return the name
  /// of the document, use `['__name__']`.
  @$pb.TagNumber(2)
  $pb.PbList<StructuredQuery_FieldReference> get fields => $_getList(0);
}

/// Nearest Neighbors search config. The ordering provided by FindNearest
/// supers


 dna[j] + node.slice(i + 1)
        if (bankSet.has(d)) {
          queue.push([d, count + 1]) // 防止更长的路径，A-》C-》A。
          bankSet.delete(d)
        }
      }
    }
  }
  return -1
};

// 50

/*
// 1. BFS
function minMutation(start: string, end: string, bank: string[]): number {
  const bankSet = new Set(bank)
  if (!bankSet.has(end)) return -1;
  const dna = ['A', 'C', 'G', 'T']
  const queue:[string, number][] = [[start, 0]]
  while(queue.length) {
    let [node, count] = queue.shift()
    if (node === end) return count
    for (let i = 0; i < node.length; i++) {
      for (let j = 0; j < dna.length; j++) {
        let d = node.slice(0, i) + dna[j] + node.slice(i + 1)
        if (bankSet.has(d)) {
          queue.push([d, count + 1]) // 防止更长的路径，A-》C-》A。
          bankSet.delete(d)
        }
      }
    }
  }
  return -1
};

*/

// @lc code=end

import {
  ChangeDetectionStrategy,
  Component,
  Input,
  OnInit,
} from '@angular/core';

/**
 * Panels of varying shapes and sizes that display
 * text and/or images.
 */
@Component({
  selector: 'ath-card',
  templateUrl: './card.component.html',
  styleUrls: ['./card.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: {
    class: 'ath-card',
  },
})
export class AthCardComponent implements OnInit {
  private readonly defaultDiameter = 200;

  /**
   * Title text of the card, typically largest in size.
   */
  @Input() title: string;

  /**
   * Sub-title text of the card, typically medium in size.
   */
  @Input() subTitle: string;

  /**
   * Super sub-title text of the card, typically smallest in size.
   */
  @Input() superSubTitle: string;

  /**
   * Diameter scale of the card (decimal value between 0 and 1).
   */
  @Input() diameterScaleFactor: number = 1;

  /**
   * Shape of the card (square or donut).
   */
  @Input() shape: 'circle' | 'donut' | 'square' = 'square';

  /**
   * Background color of the card.
   */
  @Input() backgroundColor: string = 'red';

  /**
   * Foreground color of the card.
   */
  @Input() color: string = '#fff';

  get diameter(): string {
    return `${this.defaultDiameter * this.diameterScaleFactor}px`;
  }
  get shapeColor(): string {
    return this.shape === 'donut' ? 'transparent' : this.backgroundColor;
  }
  get border(): string {
    return this.shape === 'donut'
      ? `solid 10px ${this.backgroundColor}`
      : 'none';
  }
  constructor() {}

  ngOnInit(): void {}
}

export interface Attributes {
  name: string;
  alias?: string
}

export const getPokemonAttributes = (pokemon: any, attributes: Attributes[] = []) => {
  if (!pokemon) return;

  const attributesNames = attributes.map(attribute => attribute.name);
  const statAttributes = pokemon.stats.filter(statItem => attributesNames.includes(statItem.stat.name));

  return statAttributes.map(statItem => {
    const { name } = statItem.stat;
    const attribute = attributes.find(attribute => attribute.name === name);

    return { name, value: statItem.base_stat, ...(attribute && { alias: attribute.alias }) };
  })
}

export const getPokemonTypes = (pokemon: any) => {
  if (!poke


うせん" || detectMultipleSen(this) || this == "おくせん") return null
    val digits = mapOf(
        "ぜろ" to 0L, "れい" to 0L,
        "いち" to 1L, "いっ" to 1L,
        "に" to 2L,
        "さん" to 3L,
        "よん" to 4L, "し" to 4L,
        "ご" to 5L,
        "ろく" to 6L, "ろっ" to 6L,
        "なな" to 7L, "しち" to 7L,
        "はち" to 8L, "はっ" to 8L,
        "きゅう" to 9L, "く" to 9L
    )

    val units = mapOf(
        "じゅう" to 10L,
        "ひゃく" to 100L, "びゃく" to 100L, "ぴゃく" to 100L,
        "せん" to 1000L, "ぜん" to 1000L
    )

    val bigUnits = mapOf(
        "まん" to 10_000L,
        "おく" to 100_000_000L,
        "ちょう" to 1_000_000_000_000L,
    )

    val patterns = (digits.keys + units.keys + bigUnits.keys).sortedByDescending { it.length }

    var text = this
    var total = 0L

    fun parseDigits(digitText: String): Long? {
        var num = 0L
        var tmpText = digitText
        while (tmpText.isNotEmpty()) {
            var matched = false
            for (pattern in patterns) {
                if (digits.containsKey(pattern) && tmpText.startsWith(pattern)) {
                    num = num * 10 + digits[pattern]!!
                    tmpText = tmpText.substring(pattern.length)
                    matched = true
                    break
                }
            }
            if (!matched) {
                // Cannot parse further, invalid digit sequence
                return null
            }
        }
        return num
    }

    fun parseSection(sectionText: String): Long? {
        var sectionTotal = 0L
        var tmpText = sectionText

        val unitList = listOf("せん", "ぜん", "ひゃく", "びゃく", "ぴゃく", "じゅう")

        for (unit in unitList) {
            while (tmpText.contains(unit)) {
                val index = tmpText.indexOf(unit)
                val digitText = tmpText.substring(0, index)
                val unitValue = units[unit]!!

                var digit = 1L // Default to 1 if no digit is specified
                if (digitText.isNotEmpty()) {
                    val parsedDigit = parseDigits(digitText)
                        ?: return null // Invalid digit sequence
                    digit = parsedDigit
                }

                val value = digit * unitValue
                sectionTotal += value

                tmpText = tmpText.substring(index + unit.length)
            }
        }

        // Remaining text may contain digits without units
        if (tmpText.isNotEmpty()) {
            val digit = parseDigits(tmpText)
                ?: return null // Invalid digit sequence
            sectionTotal += digit
        }

        return sectionTotal
    }

    // Process big units
    while (text.isNotEmpty()) {
        var matchedBigUnit = false
        for ((bigUnit, bigUnitValue) in bigUnits.entries.sortedByDescending { it.value }) {
            if (text.contains(bigUnit)) {
                val index = text.indexOf(bigUnit)
                val leftText = text.substring(0, index)

                // Ensure the leftText is a valid numeric sequence
                if (leftText.isEmpty() || leftText.any { it !in digits.keys.joinToString("") }) {
                    return null  // Reject cases like "まんご"
                }

                val sectionValue = parseSection(leftText)
                    ?: return null // Invalid section
                total += sectionValue * bigUnitValue
                text = text.substring(index + b


-type tsd-kind-interface">IMutableVector3

The output vector containing Euler angles (x=pitch, y=yaw, z=roll)

Defined in foundation/math/IQuaternion.ts:100

to<wbr/>String<svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg>

to<wbr/>String(): string<svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg>

Returns a string representation of the quaternion.

Returns string

String representation of the quaternion

Defined in foundation/math/IQuaternion.ts:33

to<wbr/>String<wbr/>Approximately<svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg>

to<wbr/>String<wbr/>Approximately(): string<svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg>

Returns an approximate string representation of the quaternion with limited precision.

Returns string

Approximate string representation


::open(src)?;
        let mut buff: String = String::new();
        let _ = file.read_to_string(&mut buff);
        let dst: Self = serde_json::from_reader(buff.as_bytes())?;
        Ok(dst)
    }
    pub fn to_json(&self, dst: &Path) -> Result<(), io::Error> {
        let mut file: File = File::create(dst)?;
        write!(file, "{}", serde_json::to_string(&self)?)?;
        file.flush()?;
        Ok(())
    }
}

impl<T: 'static> Display for ModelParameters<T>
where
    T: CrateFloat,
{
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut output = String::new();
        output += &format!("model type: {}", self.model_enum);
        output += &format!("size of the input layer: {}", self.input_size);
        output += &format!(
            "sizes of the hidden layers: {}",
            vec_to_string(&self.hidden_sizes)
        );
        output += &format!("output size: {}", self.output_size);
        output += &format!("axis of batch: {}", self.batch_axis);
        output += &format!(
            "types of activators: {}",
            vec_to_string(&self.activator_enums)
        );
        output += &format!("type of optimizer: {}", self.optimizer_enum);
        output += &format!("batch normalization: {}", self.use_batch_norm);
        output += &format!("dropout: {}", self.use_dropout);
        output += &format!("regularizer: {}", self.regularizer_enum);
        output += &format!("weight init type: {}", self.weight_init_enum);
        output += &format!("weight init std: {}", self.weight_init_std);
        write!(f, "{}", output)
    }
}

fn vec_to_string<T>(src: &[T]) -> String
where
    T: Display,
{
    let mut dst = String::from("[");
    for v in src.iter() {
        dst += &format!("{},", *v);
    }
    dst + &"]"
}
use warp::Filter;

use serde_derive::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
struct Entry {
    name: String,
    count: u32,
}

#[tokio::main]
async fn main() {
    pretty_env_logger::init();

    let api = warp::post()
        .and(warp::path("api"))
        .and(warp::path("connect"))
        .and(warp::body::json())
        .map(|mut entry: Entry| {
            entry.count *= 10;
            warp::reply::json(&entry)
        });

    let ui = warp::fs::dir("./ui");

    let routes = api.or(ui);

    warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
}
<reponame>carterisonline/lateral<filename>src/thread/ps2.rs
use crate::cpu::interrupt::set_irq_handler;
use crate::io::keybindings::handle_input;
use crate::io::logging::kernel_warning;
use crossbeam_queue::ArrayQueue;
use pc_keyboard::{
    layouts, DecodedKey, HandleControl, KeyCode, Keyboard, KeyboardLayout, ScancodeSet,
    ScancodeSet1,
};
use spin::Mutex;

use lazy_static::lazy_static;
use x86_64::instructions::port::Port;

lazy_static! {
    pub static ref KEYBOARD: Mutex<Keyboard<layouts::Us104Key, ScancodeSet1>> = Mutex::new(
        Keyboard::new(layouts::Us104Key, ScancodeSet1, HandleControl::Ignore)
    );
}

lazy_static! {
    pub static ref SCANCODE_QUEUE: ArrayQueue<u8> = ArrayQueue


sbezngGjbNetCnggreaREXAF_15FvzcyrSbeznggreREAF1_19AhzoreFgevatOhvyqreRvCvF8_uE10HReebePbqr,%function
b__MA6vph_646ahzore4vzcy14FvzcyrZbqvsvre19sbezngGjbNetCnggreaREXAF_15FvzcyrSbeznggreREAF1_19AhzoreFgevatOhvyqreRvCvF8_uE10HReebePbqr:
nop
.text
.globl b__MA6vph_648ahzcnefr4vzcy18NeenlFrevrfZngpureP2Ri
.type b__MA6vph_648ahzcnefr4vzcy18NeenlFrevrfZngpureP2Ri,%function
b__MA6vph_648ahzcnefr4vzcy18NeenlFrevrfZngpureP2Ri:
nop
.text
.globl b__MAX6vph_6425FpvragvsvpAhzoreSbeznggre6sbezngREXAF_11SbeznggnoyrREAF_13HavpbqrFgevatRE10HReebePbqr
.type b__MAX6vph_6425FpvragvsvpAhzoreSbeznggre6sbezngREXAF_11SbeznggnoyrREAF_13HavpbqrFgevatRE10HReebePbqr,%function
b__MAX6vph_6425FpvragvsvpAhzoreSbeznggre6sbezngREXAF_11SbeznggnoyrREAF_13HavpbqrFgevatRE10HReebePbqr:
nop
.text
.globl b__MA6vph_6412PbyyngvbaXrlP1RCXuv
.type b__MA6vph_6412PbyyngvbaXrlP1RCXuv,%function
b__MA6vph_6412PbyyngvbaXrlP1RCXuv:
nop
.text
.globl b__MA6vph_6412PbyyngvbaXrlP1Ri
.type b__MA6vph_6412PbyyngvbaXrlP1Ri,%function
b__MA6vph_6412PbyyngvbaXrlP1Ri:
nop
.text
.globl b__MA6vph_6418PnyraqneNfgebabzre20rpyvcgvpGbRdhngbevnyREAF0_10RdhngbevnyRqq
.type b__MA6vph_6418PnyraqneNfgebabzre20rpyvcgvpGbRdhngbevnyREAF0_10RdhngbevnyRqq,%function
b__MA6vph_6418PnyraqneNfgebabzre20rpyvcgvpGbRdhngbevnyREAF0_10RdhngbevnyRqq:
nop
.text
.globl b__MAX6vph_6421PbyyngvbaEbbgRyrzragf16trgCevznelOrsberRwn
.type b__MAX6vph_6421PbyyngvbaEbbgRyrzragf16trgCevznelOrsberRwn,%function
b__MAX6vph_6421PbyyngvbaEbbgRyrzragf16trgCevznelOrsberRwn:
nop
.text
.globl b__MA6vph_6420QrpvznySbezngFlzobyfQ0Ri
.type b__MA6vph_6420QrpvznySbezngFlzobyfQ0Ri,%function
b__MA6vph_6420QrpvznySbezngFlzobyfQ0Ri:
nop
.text
.globl b__MA6vph_6413QrpvznySbezngQ1Ri
.type b__MA6vp


}

void ColorBar::onColorButtonChange(const app::Color& color)
{
  if (color.getType() == app::Color::IndexType)
    m_paletteView.selectColor(color.getIndex());
  else {
    m_paletteView.selectExactMatchColor(color);

    // As foreground or background color changed, we've to redraw the
    // palette view fg/bg indicators.
    m_paletteView.invalidate();
  }

  if (m_tintShadeTone && m_tintShadeTone->isVisible())
    m_tintShadeTone->selectColor(color);

  if (m_spectrum && m_spectrum->isVisible())
    m_spectrum->selectColor(color);

  if (m_wheel && m_wheel->isVisible())
    m_wheel->selectColor(color);
}

void ColorBar::onPickSpectrum(const app::Color& color, ui::MouseButtons buttons)
{
  if (buttons == kButtonNone)
    buttons = m_lastButtons;

  if ((buttons & kButtonRight) == kButtonRight)
    setBgColor(color);
  else if ((buttons & kButtonLeft) == kButtonLeft)
    setFgColor(color);

  m_lastButtons = buttons;
}

void ColorBar::onReverseColors()
{
  doc::PalettePicks entries;
  m_paletteView.getSelectedEntries(entries);

  entries.pickAllIfNeeded();
  int n = entries.picks();

  std::vector<int> mapToOriginal(n); // Maps index from selectedPalette -> palette
  int i = 0, j = 0;
  for (bool state : entries) {
    if (state)
      mapToOriginal[j++] = i;
    ++i;
  }

  Remap remap(get_current_palette()->size());
  i = 0;
  j = n;
  for (bool state : entries) {
    if (state)
      remap.map(i, mapToOriginal[--j]);
    else
      remap.map(i, i);
    ++i;
  }

  setPalette(*get_current_palette()->remap(remap), "Reverse Colors");
}

void ColorBar::onSortBy(SortPaletteBy channel)
{
  PalettePicks entries;
  m_paletteView.getSelectedEntries(entries);

  entries.pickAllIfNeeded();
  int n = entries.picks();

  // Create a "subpalette" with selected entries only.
  auto palette = get_current_palette()->clone();
  auto selectedPalette = Palette::create(n);
  std::vector<int> mapToOriginal(n); // Maps index from selectedPalette -> palette
  int i = 0, j = 0;
  for (bool state : entries) {
    if (state) {
      selectedPalette->setEntry(j, palette->getEntry(i));
      mapToOriginal[j] = i;
      ++j;
    }
    ++i;
  }

  // Create a remap to sort the selected entries with the given color
  // component/channel.
  Remap remap = doc::sort_palette(selectedPalette.get(), channel, m_ascending);

  // Create a bigger new remap for the original palette (with all
  // entries, selected and deselected).
  Remap remapOrig(palette->size());
  i = j = 0;
  for (bool state : entries) {
    if (state)
      remapOrig.map(i, mapToOriginal[remap[j++]]);
    else
      remapOrig.map(i, i);
    ++i;
  }

  // Create a new palette and apply the remap. This is the final new
  // palette for the sprite.
  setPalette(*palette->remap(remapOrig), "Sort Colors");
}

void ColorBar::onGradient()
{
  int index1, index2;
  if (!m_paletteView.getSelectedRange(index1, index2))
    return;

  auto newP


nbsp;بتطلع كبير للدراسة والمعرفة والوصول إلى المحتوى.  ويعكس هذا الواقع  الإقبال على استخدام الإنترنت بشكلٍ هائل، وكذلك تسارع مبادرات التحوّل الرقمي بشكل كبير على مدى العامين الماضيين؛ ويمثل هذا الاتجاه فرصة لشركة Cloudflare تضيف من خلالها قيمة كبيرة إلى الأعمال  والمؤسسات الإقليمية  ويعزز في الوقت ذاته عملها وحصتها السوقية.

إن  تحقيق الريادة ودخول أسواق جديدة للشركات إقليمياً وتحقيق النمو في الأعمال لمزودي البرامج والتكنولوجيا العالميين  هو من أهم أهدافي طوال مسيرتي المهنية وأتطلع إلى  دعم Cloudflare لتحقيق  الريادة وزيادة حصتها في هذه الأسواق السريعة النمو والديناميكية.

هذا وقد ساهمت خلال السنوات الماضية من عملي لدى كبرى الشركات العالمية المزودة لتكنولوجيا أمن المعلومات على بناء وتوسيع  أعمالها في الأسواق الناشئة، وخاصة منطقة الشرق الأوسط وتركيا. حيث وقبل  انضمامي إلى Cloudflare، شغلت منصب العضو المنتدب ورئيس المبيعات للأسواق الناشئة في CyberRes، وهي وحدة خط أعمال الأمن السيبراني لدى شركة MicroFocus وقد شمل نطاق تطوير عمل الشركة ومبيعاتها منطقة الشرق الأوسط وأفريقيا والبرازيل وروسيا وكومنولث الدول المستقلة وأوروبا الوسطى والشرقية. وقبل ذلك،  توليت منصب الرئيس التنفيذي  لشركة StarLink Value Added Distribution  والتي شملت أعمالها أسواق 22 دولة وبحجم أعمال سنوية تقارب قيمتها 500 مليون دولار. علاوة على ذلك، شغلت العديد من المناصب القيادية لدى كبرى الشركات المزودة للتكنولوجيا وحلول أمن المعلومات وشملت Symantec و BlueCoat و Fortinet و CyberGuard.

إذن بعد كل هذه  الخبرة ، لماذا انضمم


- devices
- freezer
- hugetlb
- memory
- net\_cls
- net\_prio
- pids
- rdma

# Supported Python

- python2: 2.6 and above
  - deprecated
- python3: 3.4 and above
  - 3.0 to 3.3 may work but not tested

# License

The tools are distributed under GPLv2. See COPYING for more detail.
# Using Ruff in the Antiques project

## Installation

```bash
# Install dev dependencies (including Ruff)
poetry install --no-root

# Or install only Ruff
poetry add --group dev ruff
```

## Main commands

### Linting

```bash
# Lint the entire project
poetry run ruff check src/ tests/

# Lint a specific file
poetry run ruff check src/main.py

# Lint with verbose output
poetry run ruff check src/ tests/ --verbose

# Lint only with specific rules
poetry run ruff check src/ --select E,F,W

# Ignore specific rules
poetry run ruff check src/ --ignore E501,W503
```

### Automatic fixing

```bash
# Fix all automatically fixable issues
poetry run ruff check --fix src/ tests/

# Fix only specific rules
poetry run ruff check --fix --select E,F src/

# Show what would be fixed without actually fixing
poetry run ruff check --fix --diff src/
```

### Code formatting

```bash
# Format the entire project
poetry run ruff format src/ tests/

# Check formatting without making changes
poetry run ruff format --check src/ tests/

# Show formatting diff
poetry run ruff format --diff src/
```

### Full check

```bash
# Check and fix all issues
poetry run ruff check --fix src/ tests/
poetry run ruff format src/ tests/

# Or with a single command (if configured in pyproject.toml)
poetry run ruff check --fix src/ tests/ && poetry run ruff format src/ tests/
```

## Using Makefile

```bash
# Show all available commands
make help

# Install dev dependencies
make install-dev

# Lint code
make lint

# Automatically fix issues
make lint-fix

# Format code
make format

# Run all checks
make check

# Run tests
make test

# Run tests with coverage
make test-cov

# Clean cache
make clean

# Set up dev environment
make dev-setup

# Run CI pipeline
make ci
```

## Pre-commit hooks

```bash
# Install pre-commit hooks
pre-commit install

# Run hooks on all files
pre-commit run --all-files

# Update hooks
pre-commit autoupdate
```
# Glyph

![](https://img.shields.io/github/actions/workflow/status/penxle/withglyph/ci.yml)
![](https://img.shields.io/github/license/penxle/withglyph)
![](https://img.shields.io/github/languages/code-size/penxle/withglyph)

나만의 공간, 함께 새겨질 우주 - Glyph

## 시스템 요구사항

- Node 20 LTS 이상
- pnpm 8 이상
- Doppler CLI

## 외부 서비스 요구사항

|             서비스             |        목적        |
| :----------------------------: | :----------------: |
| [Doppler](https://doppler.com) | 환경변수 중앙 관리 |

## 요구사항 설치

```bash
$ npm install -g pnpm
$ brew install node dopplerhq/cli/doppler
$ doppler login
```

## 환경 초기화

```bash
$ git clone git@github.com:penxle/withglyph.git
$ cd glyph
$ pnpm bootstrap
```

## 실행

### 터미널에서 실행시

```bash
$ pnpm dev
```

### vscode에서 실행시

```
`Launch` 액션 사용시 자동으로 실행


lic void setTooltip(String tooltip, String... classes) {
        setTooltip(tooltip);

        if (this.tooltip.getWidget().isAttached()) {
            addTooltipClass(classes);
        } else {
            this.tooltip.getWidget().addAttachHandler(event -> addTooltipClass(classes));
        }
    }

    public void addTooltipClass(String... classes) {
        JQueryElement tooltipElement = this.tooltip.getTooltipElement();
        if (tooltipElement != null) {
            for (String tooltipClass : classes) {
                tooltipElement.addClass(tooltipClass);
            }
        }
    }

    @Override
    public Position getTooltipPosition() {
        return tooltip == null ? null : tooltip.getPosition();
    }

    @Override
    public void setTooltipPosition(Position position) {
        initialize();
        tooltip.setPosition(position);
    }

    @Override
    public int getTooltipDelayMs() {
        return tooltip == null ? 0 : tooltip.getDelayMs();
    }

    @Override
    public void setTooltipDelayMs(int delayMs) {
        initialize();
        tooltip.setDelayMs(delayMs);
    }

    @Override
    public void setTooltipHTML(String html) {
        initialize();
        tooltip.setHtml(html);
    }

    @Override
    public String getTooltipHTML() {
        return tooltip.getHtml();
    }

    @Override
    public JQueryElement getTooltipElement() {
        return tooltip.getTooltipElement();
    }

    @Override
    public void removeTooltip() {
        if (tooltip != null) {
            JQueryElement tooltipElement = tooltip.getTooltipElement();
            if (tooltipElement != null) {
                tooltipElement.remove();
            }
        }
    }
}
/*
 * #%L
 * GwtMaterial
 * %%
 * Copyright (C) 2015 - 2017 GwtMaterialDesign
 * %%
 * 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.
 * #L%
 */
package gwt.material.design.client.base.mixin;

import com.google.gwt.user.client.ui.UIObject;
import gwt.material.design.client.base.HasScrollspy;
import gwt.material.design.client.base.helper.StyleHelper;
import gwt.material.design.client.constants.CssName;

/**
 * @author Ben Dol
 */
public class ScrollspyMixin<T extends UIObject & HasScrollspy> extends AbstractMixin<T> implements HasScrollspy {

    public ScrollspyMixin(final T uiObject) {
        super(uiObject);
    }

    @Override
    public void setScrollspy(String scrollspy) {
        uiObject.removeStyleName(CssName.SECTION + " " + CssName.SCROLLSPY);

        if (scrollspy != null) {
            uiObject.addStyleName(CssName.SECTION + " " + CssName.SCROLLSPY);
            setId(scrollspy);
        }
    }

    @Override
    public String getScrollspy() {
        if (StyleHelper.containsStyle(uiObject.getStyleName(), CssName.SCROLLSPY)) {
            return getId();
        } else {
            return null;
        }
    }

    @Override
    public void setId(String id) {
        uiObject.setId(id);
    }

    @Override
    public String getId() {
        return uiObject.getId();
    }
}
/*
 * #%L
 * GwtBootstrap3


Menu
import com.github.panpf.sketch.sample.ui.base.BaseBindingItemFactory

class DropdownMenuItemFactory(
    private val activity: Activity,
    private val compactModel: Boolean = false
) :
    BaseBindingItemFactory<MultiSelectMenu, ListItemMenuDropdownBinding>(MultiSelectMenu::class) {

    override fun initItem(
        context: Context,
        binding: ListItemMenuDropdownBinding,
        item: BindingItem<MultiSelectMenu, ListItemMenuDropdownBinding>
    ) {
        binding.root.setOnClickListener {
            val data = item.dataOrThrow
            showDialog(data) {
                binding.infoText.text = data.getValue()
            }
        }

        if (compactModel) {
            binding.titleText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f)
            binding.descText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10f)
            binding.infoText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f)
        }
    }

    override fun bindItemData(
        context: Context,
        binding: ListItemMenuDropdownBinding,
        item: BindingItem<MultiSelectMenu, ListItemMenuDropdownBinding>,
        bindingAdapterPosition: Int,
        absoluteAdapterPosition: Int,
        data: MultiSelectMenu
    ) {
        binding.titleText.text = data.title
        binding.infoText.text = data.getValue()
        binding.descText.text = data.desc
        binding.descText.isVisible = data.desc?.isNotEmpty() == true
    }

    private fun showDialog(data: MultiSelectMenu, after: () -> Unit) {
        AlertDialog.Builder(activity).apply {
            setItems(data.values.toTypedArray()) { _, which ->
                data.onSelect(which, data.values[which])
                after()
            }
        }.show()
    }
}
/*
 * Copyright (C) 2024 panpf <panpfpanpf@outlook.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.panpf.sketch.sample.ui.base

import androidx.appcompat.app.AppCompatActivity
import com.github.panpf.sketch.sample.AppSettings
import org.koin.android.ext.android.inject

abstract class BaseActivity : AppCompatActivity() {

    protected val appSettings: AppSettings by inject()

    private var resumeCount = 0

    var resumed = false

    override fun onResume() {
        super.onResume()
        resumed = true
        resumeCount++
        if (resumeCount == 1) {
            onFirstResume()
        }
    }

    override fun onPause() {
        super.onPause()
        resumed = false
    }

    protected open fun onFirstResume() {

    }
}/*
 * Copyright (C) 2024 panpf <panpfpanpf@outlook.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License


from collections.abc import Mapping
from typing import Any, TypeVar

from attrs import define as _attrs_define

T = TypeVar("T", bound="ExportedCatalogProperty")

@_attrs_define
class ExportedCatalogProperty:
    """
    Attributes:
        encrypted_value (str):
        name (str):
        preview (str):
    """

    encrypted_value: str
    name: str
    preview: str

    def to_dict(self) -> dict[str, Any]:
        encrypted_value = self.encrypted_value

        name = self.name

        preview = self.preview

        field_dict: dict[str, Any] = {}
        field_dict.update(
            {
                "encrypted_value": encrypted_value,
                "name": name,
                "preview": preview,
            }
        )

        return field_dict

    @classmethod
    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
        d = dict(src_dict)
        encrypted_value = d.pop("encrypted_value")

        name = d.pop("name")

        preview = d.pop("preview")

        exported_catalog_property = cls(
            encrypted_value=encrypted_value,
            name=name,
            preview=preview,
        )

        return exported_catalog_property


             CSRFGetFlag.java

              This random generator (java.util.Random) is predictable
FileCSRFGetFlag.java:[lines 42-86]
Class org.owasp.webgoat.csrf.CSRFGetFlag
Method org.owasp.webgoat.csrf.CSRFGetFlag.invoke(HttpServletRequest)
FileCSRFGetFlag.java:[line79]
Value java.util.Random.

} else {
            Random random = new Random();

            CWE-259

            HIGH
             IDORLogin.java

              Hard coded password found
FileIDORLogin.java:[lines 37-72]
Class org.owasp.webgoat.idor.IDORLogin
Method org.owasp.webgoat.idor.IDORLogin.initIDORInfo()
FileIDORLogin.java:[line44]
Sink method java/util/Map.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
Sink parameter 0.

idorUserInfo.put("tom", new HashMap<String, String>());
        idorUserInfo.get("tom").put("password", "cat");

            CWE-259

            HIGH
             IDORLogin.java

              Hard coded password found
FileIDORLogin.java:[lines 37-72]
Class org.owasp.webgoat.idor.IDORLogin
Method org.owasp.webgoat.idor.IDORLogin.in


        if(!options_->get<bool>("comet-final-sigmoid"))
          x = sigmoid(x);
        return -(y * log(x + eps) + (1.f - y) * log((1.f + eps) - x));
      };
    } else if(lossType == "mse") {
      lossFn = [&](Expr x, Expr y) {
        return square(x - y);
      };
    } else if(lossType == "mae") {
      lossFn = [&](Expr x, Expr y) {
        return abs(x - y);
      };
    } else {
      ABORT("Unknown loss type {} for COMET training", lossType);
    }

    auto encoded = encpool->apply(graph, corpusBatch, clearGraph);

    Expr x = encoded[0];
    Expr y = encoded[1];
    auto loss = lossFn(x, y);

    loss = mean(loss, /*axis=*/-2); // this should only do something with mixup regularization

    int dimBatch = loss->shape()[-3];
    if(rescore_)
      loss = reshape(loss, {1, dimBatch, 1});
    else
      loss = sum(loss, /*axis=*/-3); // [1, 1, 1]

    Ptr<MultiRationalLoss> multiLoss = New<SumMultiRationalLoss>();
    RationalLoss lossPiece(loss, (float)dimBatch);
    multiLoss->push_back(lossPiece);

    return multiLoss;
  }
};

} // namespace models
} // namespace marian


dev.tharki.ShowHiddenChannels"], [href*="com.cafeed28.NitroSpoof"], [href*="dev.tharki.LegalDiscordBypasses"], [href*="net.sammcheese.messageLogger"])::before {
        content: var(--FlashLang-Addon_Recommended, "🔧 Flashcord Compatibility: ❤ Recommended\A\A");
    }
    .replugged-addon-card:has([href*="dev.kingfish.InvisibleTyping"], [href*="dev.albertp.ChannelTyping"], [href*="dev.kingfish.BadgesEverywhere"], [href*="dev.tharki.ShowHiddenChannels"], [href*="com.cafeed28.NitroSpoof"],[href*="dev.tharki.LegalDiscordBypasses"], [href*="net.sammcheese.messageLogger"]) {
        order: -512;
    }

    .replugged-addon-card:has([href*="dev.replugged.RevertRebrand"], [href*="net.saltssaumure.CRT"], [href*="dev.oirnoir.onekoanimation"], [href*="nyria.discolored"])::before {
        content: var(--FlashLang-Addon_Compatible, "🔧 Flashcord Compatibility: ✅ Compatible\A\A");
    }
    .replugged-addon-card:has([href*="dev.replugged.RevertRebrand"], [href*="net.saltssaumure.CRT"], [href*="dev.oirnoir.onekoanimation"], [href*="nyria.discolored"]) {
        order: -386;
    }

    .replugged-addon-card:has([href*="xyz.griefmodz.StatisticCounter"])::before,
    .replugged-addon-card:has([href*="dev.tharki.ReUSRBG"])::before {
        content: var(--FlashLang-Addon_MinorIssues, "🔧 Flashcord Compatibility: ⚠ Minor Issues\A\A");
    }
    .replugged-addon-card:has([href*="xyz.griefmodz.StatisticCounter"]),
    .replugged-addon-card:has([href*="dev.tharki.ReUSRBG"]) {
        order: -256;
    }
}

/* [End] = Flashcord Beta == Replugged Plugin Compatibility List CSS = */

/* [Start] = Flashcord Beta == Replugged Theme Compatibility List CSS = */

/* NOTE: THIS MAY BE DEPRECRATED AND MAY BE NEXT POWERED BY THE FLASHCORD API!!! */

#rp-themes-tab::before,
#rp-quickcss-tab::before {
    content: var(--FlashLang-Addon_Welcome, "\A\A📸 Welcome to " var(--Flashcord-Branch) " ! You are using the " var(--Flashcord-Channel) " Channel of Flashcord.\A\A");
    white-space: pre;
    font-weight: 900;
    color: var(--text-normal);
}

@container FC-RPCL (min-width: 0px) {
    /* flashcord is basically banned lul so that won't happen

    Except now Flashcord LPM is on the Replugged store... Eh whatever

    .replugged-addon-card:has([href*="com.sirio-network.flashcord"])::before {
        content: "💖 Thank you for using Flashcord!\A\A";
    }
    .replugged-addon-card:has([href*="flashcord-legacy"])::before {
        content: "Don't. Don't do it.\A\A";
        font-weight: 900;
    }
    .replugged-addon-card:has([href*="com.sirio-network.flashcord"]) {
        order: -6948;
    }
    .replugged-addon-card:has([href*="flashcord-legacy"]) {
        order: 6948;


// --------

// Outer container
.progress {
  overflow: hidden;
  height: 18px;
  margin-bottom: 18px;
  @include gradient-vertical(#f5f5f5, #f9f9f9);
  @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
  @include border-radius(4px);
}

// Bar of progress
.progress .bar {
  width: 0%;
  height: 18px;
  color: $white;
  font-size: 12px;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  @include gradient-vertical(#149bdf, #0480be);
  @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
  @include box-sizing(border-box);
  @include transition(width .6s ease);
}

// Striped bars
.progress-striped .bar {
  @include gradient-striped(#149bdf);
  @include background-size(40px 40px);
}

// Call animation for the active one
.progress.active .bar {
  -webkit-animation: progress-bar-stripes 2s linear infinite;
     -moz-animation: progress-bar-stripes 2s linear infinite;
      -ms-animation: progress-bar-stripes 2s linear infinite;
       -o-animation: progress-bar-stripes 2s linear infinite;
          animation: progress-bar-stripes 2s linear infinite;
}

// COLORS
// ------

// Danger (red)
.progress-danger .bar {
  @include gradient-vertical(#ee5f5b, #c43c35);
}
.progress-danger.progress-striped .bar {
  @include gradient-striped(#ee5f5b);
}

// Success (green)
.progress-success .bar {
  @include gradient-vertical(#62c462, #57a957);
}
.progress-success.progress-striped .bar {
  @include gradient-striped(#62c462);
}

// Info (teal)
.progress-info .bar {
  @include gradient-vertical(#5bc0de, #339bb9);
}
.progress-info.progress-striped .bar {
  @include gradient-striped(#5bc0de);
}

// Warning (orange)
.progress-warning .bar {
  @include gradient-vertical(lighten($orange, 15%), $orange);
}
.progress-warning.progress-striped .bar {
  @include gradient-striped(lighten($orange, 15%));
}
pre code .hll { background-color: #ffffcc }
pre code .c { color: #408080; font-style: italic } /* Comment */
pre code .err { border: 1px solid #FF0000 } /* Error */
pre code .k { color: #008000; font-weight: bold } /* Keyword */
pre code .o { color: #666666 } /* Operator */
pre code .cm { color: #408080; font-style: italic } /* Comment.Multiline */
pre code .cp { color: #BC7A00 } /* Comment.Preproc */
pre code .c1 { color: #408080; font-style: italic } /* Comment.Single */
pre code .cs { color: #408080; font-style: italic } /* Comment.Special */
pre code .gd { color: #A00000 } /* Generic.Deleted */
pre code .ge { font-style: italic } /* Generic.Emph */
pre code .gr { color: #FF0000 } /* Generic.Error */
pre code .gh { color: #000080; font-weight: bold } /* Generic.Heading */
pre code .gi { color: #00A000 } /* Generic.Inserted */
pre code .go { color: #808080 } /* Generic.Output */
pre code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
pre code .gs { font-weight: bold } /* Generic.Strong */
pre code .gu { color: #80


20c=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(d3_rgbString);d3.scale.quantile=function(){return d3_scale_quantile([],[])};function d3_scale_quantile(domain,range){var thresholds;function rescale(){var k=0,q=range.length;thresholds=[];while(++k<q)thresholds[k-1]=d3.quantile(domain,k/q);return scale}function scale(x){if(!isNaN(x=+x))return range[d3.bisect(thresholds,x)]}scale.domain=function(x){if(!arguments.length)return domain;domain=x.map(d3_number).filter(d3_numeric).sort(d3_ascending);return rescale()};scale.range=function(x){if(!arguments.length)return range;range=x;return rescale()};scale.quantiles=function(){return thresholds};scale.invertExtent=function(y){y=range.indexOf(y);return y<0?[NaN,NaN]:[y>0?thresholds[y-1]:domain[0],y<thresholds.length?thresholds[y]:domain[domain.length-1]]};scale.copy=function(){return d3_scale_quantile(domain,range)};return rescale()}d3.scale.quantize=function(){return d3_scale_quantize(0,1,[0,1])};function d3_scale_quantize(x0,x1,range){var kx,i;function scale(x){return range[Math.max(0,Math.min(i,Math.floor(kx*(x-x0))))]}function rescale(){kx=range.length/(x1-x0);i=range.length-1;return scale}scale.domain=function(x){if(!arguments.length)return[x0,x1];x0=+x[0];x1=+x[x.length-1];return rescale()};scale.range=function(x){if(!arguments.length)return range;range=x;return rescale()};scale.invertExtent=function(y){y=range.indexOf(y);y=y<0?NaN:y/kx+x0;return[y,y+1/kx]};scale.copy=function(){return d3_scale_quantize(x0,x1,range)};return rescale()}d3.scale.threshold=function(){return d3_scale_threshold([.5],[0,1])};function d3_scale_threshold(domain,range){function scale(x){if(x<=x)return range[d3.bisect(domain,x)]}scale.domain=function(_){if(!arguments.length)return domain;domain=_;return scale};scale.range=function(_){if(!arguments.length)return range;range=_;return scale};scale.invertExtent=function(y){y=range.indexOf(y);return[domain[y-1],domain[y]]};scale.copy=function(){return d3_scale_threshold(domain,range)};return scale}d3.scale.identity=function(){return d3_scale_identity([0,1])};function d3_scal


thrd = 0.2
world.ukf.focuse_thrd = 0.09
world.ukf.thred_cluster = 6
world.ukf.monitor_samples = 1

world.monitor_particles = 1
world.monitor_ukfs = 1

world.enable_goal_update = 0
world.enable_corner_update = 0
world.enable_boundary_update = 0
world.enable_line_update = 0
world.enable_parallelLine_update = 0
world.enable_penaltyArea_update = 0
world.enable_spot = 0
world.enable_centerT = 0
world.enable_cornerT = 0
world.enable_circle = 0


_p.value_float = op_arg.value.rfloat;
			break;
		    case K_DECL_STRING:
			arg_p.value_string = op_arg.value.rstring;
			break;
		    default: ;
		    }
		    arg_p.value_decl = op_arg.value.decl;
		    arg_p.value_type = op_arg.type;
		    arg_p.value_name = op_arg.name;
		    arg_list[arg_count] = arg_p;
		    arg_count++;
		    op_arg.type = K_OPERAND_NO;
		    if ( op_arg.parlevel == op.parlevel - 1)
			break;
		}

		CcmReturn ret = functionExec( filectx, op.name, null, arg_list, arg_count, false);
		// Set returned argument values and free argumentlist
		for ( int i = 0; i < arg_list.length; i++) {
		    arg_p = arg_list[i];
		    if ( arg_p.value_type == K_OPERAND_NAME &&
			 arg_p.value_returned) {
			sts = setVar( funcctx, arg_p.value_name, arg_p.value_decl,
				      arg_p.value_float, arg_p.value_int, arg_p.value_string);
			if ( EVEN(sts)) return sts;
		    }
		}

		if ( EVEN(ret.sts)) return ret.sts;
		if ( ret.sts == CCM__EXITFUNC) exit_function_found = true;
		op.result = ret;
	    }

	    if ( next.type == K_OPERAND_NAME && !next.result_done &&
		 op.type != K_OPERAND_DECL) {

		CcmReturn ret = getVar( funcctx, next.name);
		if ( ret.evenSts()) return ret.sts;
		next.value.decl = ret.decl;
		next.value.rfloat = ret.rfloat;
		next.value.rint = ret.rint;
		next.value.rstring = ret.rstring;
	    }
	    if ( next.result_done) {

		// Use result, not value for next-operand
		next_decl = next.result.decl;
		next_int = next.result.rint;
		next_float = next.result.rfloat;
		next_string = next.result.rstring;
	    }
	    else {

		// Use value for next-operand
		next_decl = next.value.decl;
		next_int = next.value.rint;
		next_float = next.value.rfloat;
		next_string = next.value.rstring;
	    }

	    if ( next.type == K_OPERAND_NO && !next.result_done) {
		next.result.rfloat = op.result.rfloat;
		next.result.rint = op.result.rint;
		next.result.rstring = op.result.rstring;
		next.result.decl = op.result.decl;
	    }
	    else if ( next_decl == K_DECL_UNKNOWN) {
		next_decl = op.value.decl;
	    }

	    switch ( op.o_operator) {
	    case K_ACTION_EQL:
		sts = setVar( funcctx, op.name, next_decl, next_float, next_int,
			      next_string);
		if ( EVEN(sts)) return sts;
		break;
	    case K_ACTION_RETURN:
		if ( !next.result_done) {

		    next.result.decl = next_decl;
		    switch ( next_decl) {
		    case K_DECL_INT:
			next.result.rint = next_int;
			break;
		    case K_DECL_FLOAT:
			next.result.rfloat = next_float;
			break;
		    case K_DECL_STRING:
			next.result.rstring = next_


List.isEmpty())
            return null;
        if (minFluidInputs > 0 && GTUtility.amountOfNonNullElements(fluidInputs) < minFluidInputs) {
            return null;
        }
        if (minInputs > 0 && GTUtility.amountOfNonEmptyStacks(inputs) < minInputs) {
            return null;
        }
        if (maxInputs > 0) {
            return findByInputs(voltage, inputs, fluidInputs, matchingMode);
        } else {
            return findByFluidInputs(voltage, inputs, fluidInputs, matchingMode);
        }
    }

    @Nullable
    private Recipe findByFluidInputs(long voltage, List<ItemStack> inputs, List<FluidStack> fluidInputs, MatchingMode matchingMode) {
        for (FluidStack fluid : fluidInputs) {
            if (fluid == null) continue;
            Collection<Recipe> recipes = recipeFluidMap.get(new FluidKey(fluid));
            if (recipes == null) continue;
            for (Recipe tmpRecipe : recipes) {
                if (tmpRecipe.matches(false, inputs, fluidInputs, matchingMode)) {
                    return voltage >= tmpRecipe.getEUt() ? tmpRecipe : null;
                }
            }
        }
        return null;
    }

    @Nullable
    private Recipe findByInputs(long voltage, List<ItemStack> inputs, List<FluidStack> fluidInputs, MatchingMode matchingMode) {
        for (Recipe recipe : recipeList) {
            if (recipe.matches(false, inputs, fluidInputs, matchingMode)) {
                return voltage >= recipe.getEUt() ? recipe : null;
            }
        }
        return null;
    }

    public ModularUI.Builder createJeiUITemplate(IItemHandlerModifiable importItems, IItemHandlerModifiable exportItems, FluidTankList importFluids, FluidTankList exportFluids) {
        return createUITemplate(() -> 0.0, importItems, exportItems, importFluids, exportFluids);
    }

    //this DOES NOT include machine control widgets or binds player inventory
    public ModularUI.Builder createUITemplate(DoubleSupplier progressSupplier, IItemHandlerModifiable importItems, IItemHandlerModifiable exportItems, FluidTankList importFluids, FluidTankList exportFluids) {
        ModularUI.Builder builder = ModularUI.defaultBuilder();
        builder.widget(new ProgressWidget(progressSupplier, 77, 22, 21, 20, progressBarTexture, moveType));
        addInventorySlotGroup(builder, importItems, importFluids, false);
        addInventorySlotGroup(builder, exportItems, exportFluids, true);
        return builder;
    }

    protected void addInventorySlotGroup(ModularUI.Builder builder, IItemHandlerModifiable itemHandler, FluidTankList fluidHandler, boolean isOutputs) {
        int itemInputsCount = itemHandler.getSlots();
        int fluidInputsCount = fluidHandler.getTanks();
        boolean invertFluids = false;
        if (itemInputsCount == 0) {
            int tmp = itemInputsCount;
            itemInputsCount = fluidInputsCount;
            fluidInputsCount = tmp;
            invertFluids = true;
        }
        int[] inputSlotGrid = determineSlotsGrid(itemInputsCount);
        int itemSlotsToLeft = inputSlotGrid[0];
        int itemSlotsToDown = inputSlotGrid[1];
        int startInputsX = isOutputs ? 106 : 69 - itemSlotsToLeft * 18;
        int startInputsY = 32 - (int) (itemSlotsToDown / 2.0 * 18);
        for (int i = 0; i < itemSlotsToDown; i++) {
            for (int j = 0; j < itemSlotsToLeft; j++) {
                int slotIndex = i * itemSlotsToLeft + j;
                int x = startInputsX + 18 * j;
                int


oc = "1: fOFI clock active"]
    CONST_X1 = 1,
    #[doc = "2: fPLL clock active"]
    CONST_1X = 2,
}
impl From<SYSCLKMUX_A> for u8 {
    #[inline(always)]
    fn from(variant: SYSCLKMUX_A) -> Self {
        variant as _
    }
}
#[doc = "Field `SYSCLKMUX` reader - Status of System Clock Multiplexing Upon Source Switching"]
pub struct SYSCLKMUX_R(crate::FieldReader<u8, SYSCLKMUX_A>);
impl SYSCLKMUX_R {
    pub(crate) fn new(bits: u8) -> Self {
        SYSCLKMUX_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<SYSCLKMUX_A> {
        match self.bits {
            1 => Some(SYSCLKMUX_A::CONST_X1),
            2 => Some(SYSCLKMUX_A::CONST_1X),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `CONST_X1`"]
    #[inline(always)]
    pub fn is_const_x1(&self) -> bool {
        **self == SYSCLKMUX_A::CONST_X1
    }
    #[doc = "Checks if the value of the field is `CONST_1X`"]
    #[inline(always)]
    pub fn is_const_1x(&self) -> bool {
        **self == SYSCLKMUX_A::CONST_1X
    }
}
impl core::ops::Deref for SYSCLKMUX_R {
    type Target = crate::FieldReader<u8, SYSCLKMUX_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:1 - Status of System Clock Multiplexing Upon Source Switching"]
    #[inline(always)]
    pub fn sysclkmux(&self) -> SYSCLKMUX_R {
        SYSCLKMUX_R::new((self.bits & 0x03) as u8)
    }
}
#[doc = "Clock Multiplexing Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkmxstat](index.html) module"]
pub struct CLKMXSTAT_SPEC;
impl crate::RegisterSpec for CLKMXSTAT_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [clkmxstat::R](R) reader structure"]
impl crate::Readable for CLKMXSTAT_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets CLKMXSTAT to value 0"]
impl crate::Resettable for CLKMXSTAT_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
<gh_stars>1-10
#![allow(unused_variables)]
fn main() {
    let some_u8_value = Some(0u8);
    if let Some(3) = some_u8_value {
	println!("three");
    }
}
pub mod visitor;
pub mod symtab;
pub mod typetab;

use super::parser::*;
use super::source::*;
use super::lexer::*;

pub use self::visitor::*;
pub use self::symtab::*;
pub use self::typetab::*;use notify_rust::Notification;

pub fn notify_deadline_over() {
    Notification::new()
        .summary("⌚ Times up!")
        .body("Your deadline is over, hopefully you've achieved whatever you were tryna do 👀")
        .auto_icon()


/*
 * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/*
 * @file	zephyr/sys.h
 * @brief	Zephyr system primitives for libmetal.
 */

#ifndef __METAL_SYS__H__
#error "Include metal/sys.h instead of metal/zephyr/sys.h"
#endif

#ifndef __METAL_ZEPHYR_SYS__H__
#define __METAL_ZEPHYR_SYS__H__

#include <metal/cpu.h>
#include <stdlib.h>
#include <zephyr/kernel.h>

#include "log.h"

#ifdef __cplusplus
extern "C" {
#endif

#define metal_yield() metal_cpu_yield()

#define METAL_INIT_DEFAULTS				\
{							\
	.log_handler	= metal_zephyr_log_handler,	\
	.log_level	= METAL_LOG_INFO,		\
}

#ifndef METAL_MAX_DEVICE_REGIONS
#define METAL_MAX_DEVICE_REGIONS 1
#endif

/** Structure of zephyr libmetal runtime state. */
struct metal_state {

	/** Common (system independent) data. */
	struct metal_common_state common;
};

static inline void metal_wait_usec(uint32_t usec_to_wait)
{
	k_busy_wait(usec_to_wait);
}

#ifdef __cplusplus
}
#endif

#endif /* __METAL_ZEPHYR_SYS__H__ */


handler2);
        context.update(newState);
        expect(handler1).toBeCalledTimes(2);
        expect(handler1).toBeCalledWith(newState);
        expect(handler2).toBeCalledTimes(1);
        expect(handler2).toBeCalledWith(newState);

        newState = { test: 'test info 3' };
        context.subscribe(handler3);
        context.update(newState);
        expect(handler1).toBeCalledTimes(3);
        expect(handler1).toBeCalledWith(newState);
        expect(handler2).toBeCalledTimes(2);
        expect(handler2).toBeCalledWith(newState);
        expect(handler3).toBeCalledTimes(1);
        expect(handler3).toBeCalledWith(newState);

        context.unsubscribe(handler2);
        context.update(newState);
        expect(handler1).toBeCalledTimes(4);
        expect(handler1).toBeCalledWith(newState);
        expect(handler2).toBeCalledTimes(2);
        expect(handler2).toBeCalledWith(newState);
        expect(handler3).toBeCalledTimes(2);
        expect(handler3).toBeCalledWith(newState);

        context.unsubscribe(handler1);
        context.update(newState);
        expect(handler1).toBeCalledTimes(4);
        expect(handler1).toBeCalledWith(newState);
        expect(handler2).toBeCalledTimes(2);
        expect(handler2).toBeCalledWith(newState);
        expect(handler3).toBeCalledTimes(3);
        expect(handler3).toBeCalledWith(newState);

        context.unsubscribe(handler3);
        context.update(newState);
        expect(handler1).toBeCalledTimes(4);
        expect(handler1).toBeCalledWith(newState);
        expect(handler2).toBeCalledTimes(2);
        expect(handler2).toBeCalledWith(newState);
        expect(handler3).toBeCalledTimes(3);
        expect(handler3).toBeCalledWith(newState);
    });
});
import {
  CREATE_TRACKER,
  TrackersActionTypes,
  DELETE_TRACKER,
  PLAY_TRACKER,
  PAUSE_TRACKER,
  Tracker,
  SET_TRACKERS,
} from "./types";

export const createTracker = (
  name: string,
  id: string,
  timestamp: number
): TrackersActionTypes => ({
  type: CREATE_TRACKER,
  payload: { name, id, timestamp },
});
export const setTrackers = (trackers: Array<Tracker>): TrackersActionTypes => ({
  type: SET_TRACKERS,
  payload: trackers,
});
export const deleteTracker = (id: string): TrackersActionTypes => ({
  type: DELETE_TRACKER,
  id,
});
export const playTracker = (
  id: string,
  timestamp: number
): TrackersActionTypes => ({
  type: PLAY_TRACKER,
  id,
  timestamp,
});
export const pauseTracker = (
  id: string,
  time: number
): TrackersActionTypes => ({
  type: PAUSE_TRACKER,
  id,
  time,
});
declare interface Fn<T = any, R = T> {
  (...arg: T[]): R;
}

declare interface PromiseFn<T = any, R = T> {
  (...arg: T[]): Promise<R>;
}

declare type RefType<T> = T | null;
declare type Nullable<T> = T | null;
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;

declare type LabelValueOptions = {
  label: string;
  value: any;
  [key: string]: string | number | boolean;
}[];

declare type ObjectType = {
  [key: string]: any;
};

decl


("  END");
            System.out.println(STR2);

            if (n == 0) {
                n = 1;
            }
            for (int i = 0; i < n; i++) {
                System.out.println("");
            }
        }
        if (b) {
            System.exit(1);
        }
    }

    public void P(Object s1, Object s2, boolean b) {
        if (flag && globalFlag) {

            //String s=s1.toString();
            //if(s.indexOf("@")!=-1) s=s.substring(0,s.indexOf("@"));
            if (s1.getClass().getName().equals("java.lang.Class"))//static方法的情况
            {
                System.out.println(s1 + STR1 + s2);
            } else {
                System.out.println(s1.getClass().getName() + STR1 + s2);
            }
            System.out.println(STR2);
        }
        if (b) {
            System.exit(1);
        }
    }

    public void P(int n) {
        if (flag && globalFlag) {
            for (int i = 0; i < n; i++) {
                System.out.println("");
            }
        }
    }

    public static void ON() {
        globalFlag = true;
        //privateGlobalFlag=true;
    }

    public static void OFF() {
        globalFlag = false;
        //privateGlobalFlag=false;
    }

    private String STR1 = "===>";
    private String STR2 = "-----------------------------------------------------------";
}package org.junit.internal;

import java.io.PrintStream;
import java.text.NumberFormat;

import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;

public class TextListener extends RunListener {

	private final PrintStream fWriter;

	public TextListener() {
		this(System.out);
	}

	public TextListener(PrintStream writer) {
		this.fWriter= writer;
	}

	@Override
	public void testRunFinished(Result result) {
		printHeader(result.getRunTime());
		printFailures(result);
		printFooter(result);
	}

	@Override
	public void testStarted(Description description) {
		fWriter.append('.');
	}

	@Override
	public void testFailure(Failure failure) {
		fWriter.append('E');
	}

	@Override
	public void testIgnored(Description description) {
		fWriter.append('I');
	}

	/*
	 * Internal methods
	 */

	private PrintStream getWriter() {
		return fWriter;
	}

	protected void printHeader(long runTime) {
		getWriter().println();
		getWriter().println("Time: " + elapsedTimeAsString(runTime));
	}

	protected void printFailures(Result result) {
		if (result.getFailureCount() == 0)
			return;
		if (result.getFailureCount() == 1)
			getWriter().println("There was " + result.getFailureCount() + " failure:");
		else
			getWriter().println("There were " + result.getFailureCount() + " failures:");
		int i= 1;
		for (Failure each : result.getFailures())
			printFailure(each, i++);
	}

	protected void printFailure(Failure failure, int count) {
		printFailureHeader(failure, count);
		printFailureTrace(failure);
	}

	protected void printFailureHeader(Failure failure, int count) {
		getWriter().println(count + ") " + failure.getTestHeader());
	}

	protected void printFailure


/*
 *  SPDX-FileCopyrightText: 2016 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
 *  SPDX-FileCopyrightText: 2012 José Luis Vergara <pentalis@gmail.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
*/

#ifndef _KOCOMPOSITEOPDESTINATIONATOP_H_
#define _KOCOMPOSITEOPDESTINATIONATOP_H_

#include "KoCompositeOpBase.h"

/**
 *  Generic implementation of the Destination-atop composite op, based off the behind composite op.
 *  This is necessary for Open Raster support.
 *  https://www.w3.org/TR/compositing-1/
 */
template<class CS_Traits>
class KoCompositeOpDestinationAtop : public KoCompositeOpBase<CS_Traits, KoCompositeOpDestinationAtop<CS_Traits> >
{
    typedef KoCompositeOpBase<CS_Traits, KoCompositeOpDestinationAtop<CS_Traits> > base_class;
    typedef typename CS_Traits::channels_type channels_type;

    static const qint8 channels_nb = CS_Traits::channels_nb;
    static const qint8 alpha_pos   = CS_Traits::alpha_pos;

public:
    KoCompositeOpDestinationAtop(const KoColorSpace * cs)
        : base_class(cs, COMPOSITE_DESTINATION_ATOP, KoCompositeOp::categoryMix()) { }

public:
    template<bool alphaLocked, bool allChannelFlags>
    inline static channels_type composeColorChannels(const channels_type* src, channels_type srcAlpha,
                                                     channels_type*       dst, channels_type dstAlpha,
                                                     channels_type  maskAlpha, channels_type  opacity,
                                                     const QBitArray& channelFlags                    )  {
        using namespace Arithmetic;

        channels_type appliedAlpha       = mul(maskAlpha, srcAlpha, opacity);

        channels_type newDstAlpha        = appliedAlpha;

        if (dstAlpha != zeroValue<channels_type>() && srcAlpha != zeroValue<channels_type>()) {
            // blend the color channels as if we were painting on the layer below
            for (qint8 channel = 0; channel < channels_nb; ++channel)
                if(channel != alpha_pos && (allChannelFlags || channelFlags.testBit(channel))) {
                    dst[channel] = lerp(src[channel],dst[channel],dstAlpha);
                }
        }
        else if (srcAlpha != zeroValue<channels_type>()) {
            // don't blend if the color of the destination is undefined (has zero opacity)
            // copy the source channel instead
            for (qint8 channel = 0; channel < channels_nb; ++channel)
                if(channel != alpha_pos && (allChannelFlags || channelFlags.testBit(channel)))
                    dst[channel] = src[channel];
        }

        return newDstAlpha;
    }
};

#endif  // _KOCOMPOSITEOPDESTINATIONATOP_H_


WORK");
    break;
  case CV_TOO_MUCH_ACC:
    sprintf(name,"CV_TOO_MUCH_ACC");
    break;
  case CV_ERR_FAILURE:
    sprintf(name,"CV_ERR_FAILURE");
    break;
  case CV_CONV_FAILURE:
    sprintf(name,"CV_CONV_FAILURE");
    break;
  case CV_LINIT_FAIL:
    sprintf(name,"CV_LINIT_FAIL");
    break;
  case CV_LSETUP_FAIL:
    sprintf(name,"CV_LSETUP_FAIL");
    break;
  case CV_LSOLVE_FAIL:
    sprintf(name,"CV_LSOLVE_FAIL");
    break;
  case CV_RHSFUNC_FAIL:
    sprintf(name,"CV_RHSFUNC_FAIL");
    break;
  case CV_FIRST_RHSFUNC_ERR:
    sprintf(name,"CV_FIRST_RHSFUNC_ERR");
    break;
  case CV_REPTD_RHSFUNC_ERR:
    sprintf(name,"CV_REPTD_RHSFUNC_ERR");
    break;
  case CV_UNREC_RHSFUNC_ERR:
    sprintf(name,"CV_UNREC_RHSFUNC_ERR");
    break;
  case CV_RTFUNC_FAIL:
    sprintf(name,"CV_RTFUNC_FAIL");
    break;
  case CV_MEM_FAIL:
    sprintf(name,"CV_MEM_FAIL");
    break;
  case CV_MEM_NULL:
    sprintf(name,"CV_MEM_NULL");
    break;
  case CV_ILL_INPUT:
    sprintf(name,"CV_ILL_INPUT");
    break;
  case CV_NO_MALLOC:
    sprintf(name,"CV_NO_MALLOC");
    break;
  case CV_BAD_K:
    sprintf(name,"CV_BAD_K");
    break;
  case CV_BAD_T:
    sprintf(name,"CV_BAD_T");
    break;
  case CV_BAD_DKY:
    sprintf(name,"CV_BAD_DKY");
    break;
  case CV_TOO_CLOSE:
    sprintf(name,"CV_TOO_CLOSE");
    break;
  case CV_NLS_INIT_FAIL:
    sprintf(name,"CV_NLS_INIT_FAIL");
    break;
  case CV_NLS_SETUP_FAIL:
    sprintf(name,"CV_NLS_SETUPT_FAIL");
    break;
  case CV_NLS_FAIL:
    sprintf(name,"CV_NLS_FAIL");
    break;
  case CV_PROJ_MEM_NULL:
    sprintf(name,"CV_PROJ_MEM_NULL");
    break;
  case CV_PROJFUNC_FAIL:
    sprintf(name,"CV_PROJFUNC_FAIL");
    break;
  case CV_REPTD_PROJFUNC_ERR:
    sprintf(name,"CV_REPTD_PROJFUNC_ERR");
    break;
  default:
    sprintf(name,"NONE");
  }

  return(name);
}


spawn()
            }

            bee.update(dt)
        }
        beeUpdateTime.set(pt.takeMs())

        // copy mesh instance data
        pt.reset()
        updateInstances()
        instanceUpdateTime.set(pt.takeMs())
    }

    private fun updateInstances() {
        beeInstances.clear()
        beeInstances.addInstances(numSimulatedBees) { buf ->
            repeat(numSimulatedBees) { i ->
                buf.put {
                    set(BeeInstanceLayout.position, positions[i])
                    set(BeeInstanceLayout.rotation, rotations[i])
                }
            }
        }
    }

    private fun Bee.spawn() {
        rotation.set(randomF(0f, 360f).deg, random.randomInUnitSphere(tmpVec3a).norm())
        position.set(random.randomInUnitSphere(tmpVec3a).mul(BeeConfig.worldSize.x * 0.05f))
        position.x += -BeeConfig.worldSize.x * 0.4f + BeeConfig.worldSize.x * 0.8f * team
        enemy = EnemyBee(BeeConfig.maxBeesPerTeamCpu)
        random.randomInUnitSphere(velocity).mul(BeeConfig.maxSpawnSpeed)
    }

    private fun Bee.kill() {
        if (position.w == 0f) {
            position.w = 0.01f
        }
    }

    private fun getRandomBee() = Bee(random.randomI(0, max(1, BeeConfig.beesPerTeam.value - 1)))

    @JvmInline
    value class Bee(val index: Int) {
        init {
            if (index < 0) {
                throw IllegalArgumentException("negative index!")
            }
        }
    }

    @JvmInline
    value class EnemyBee(val index: Int)

    val Bee.position: MutableVec4f get() = positions[index]
    val Bee.rotation: MutableQuatF get() = rotations[index]
    val Bee.velocity: MutableVec3f get() = velocities[index]
    val Bee.isAlive: Boolean get() = position.w == 0f
    val Bee.isDecayed: Boolean get() = position.w >= BeeConfig.decayTime
    var Bee.enemy: EnemyBee
        get() = EnemyBee(enemies[index])
        set(value) {
            enemies[index] = value.index
        }

    val EnemyBee.position: MutableVec4f get() = enemyBees.positions[index]
    val EnemyBee.isAlive: Boolean get() = position.w == 0f

    fun Bee.update(dt: Float) {
        if (isAlive) {
            updateAlive(dt)
        } else {
            updateDead(dt)
        }

        // update position by current velocity and time step
        val rot = rotation
        val pos = position
        val vel = velocity

        pos.add(tmpVec3a.set(vel).mul(dt))

        // update rotation by current velocity direction
        val speed = vel.length()
        if (speed > 1f && abs(vel.dot(Vec3f.Y_AXIS) / speed) < 0.99f) {
            val right = Vec3f.Y_AXIS.cross(vel, tmpVec3a).norm()
            val up = vel.cross(right, tmpVec3b).norm()
            val front = tmpVec3a.set(vel).norm()

            tmpMat3.set(
                right.x, up.x, front.x,
                right.y, up.y, front.y,
                right.z, up.z, front.z
            )
            tmpMat3.getRotation(tmpQuat)

            val w0 = dt * 5f
            val w1 = 1f - w0
            rot.x = rot.x * w1 + tmpQuat.x * w0
            rot.y = rot.y * w1 + tmpQuat.y


ithLabelValues("POST", "/api/webhook/github", "400").Inc()
		c.JSON(http.StatusBadRequest, gin.H{"error": "Repository clone URL is missing from webhook payload"})
		return
	}

	// Get deployment configuration from Redis with better error handling
	config, err := getWebhookConfig()
	if err != nil {
		telemetry.HTTPErrorCounter.WithLabelValues("POST", "/api/webhook/github", "500").Inc()
		c.JSON(http.StatusNotFound, gin.H{
			"error":   "No deployment configured for this repository",
			"details": err.Error(),
		})
		return
	}

	// Validate branch
	branchFromRef := strings.TrimPrefix(request.Ref, "refs/heads/")
	if branchFromRef != config.Branch {
		telemetry.HTTPErrorCounter.WithLabelValues("POST", "/api/webhook/github", "200").Inc()
		c.JSON(http.StatusOK, gin.H{
			"message": fmt.Sprintf("Ignoring push to branch '%s'. Configured branch is '%s'", branchFromRef, config.Branch),
		})
		return
	}

	// Check for relevant changes
	relevantChanges, changedFiles := checkRelevantChanges(request.Commits, config.FolderPath)
	if !relevantChanges {
		telemetry.HTTPErrorCounter.WithLabelValues("POST", "/api/webhook/github", "200").Inc()
		c.JSON(http.StatusOK, gin.H{
			"message": "No relevant changes detected in the specified folder path",
		})
		return
	}

	// Perform webhook deployment
	deploymentResult, err := performWebhookDeployment(request, config)
	if err != nil {
		if apiErr, ok := err.(*APIError); ok {
			telemetry.HTTPErrorCounter.WithLabelValues("POST", "/api/webhook/github", fmt.Sprintf("%d", apiErr.Code)).Inc()
			c.JSON(apiErr.Code, gin.H{
				"error":   apiErr.Message,
				"details": apiErr.Details,
			})
		} else {
			telemetry.HTTPErrorCounter.WithLabelValues("POST", "/api/webhook/github", "500").Inc()
			c.JSON(http.StatusInternalServerError, gin.H{
				"error":   "Webhook deployment failed",
				"details": err.Error(),
			})
		}
		return
	}
	telemetry.TotalHTTPRequests.WithLabelValues("POST", "/api/webhook/github", "200").Inc()
	c.JSON(http.StatusOK, gin.H{
		"message":         "Webhook deployment successful",
		"deployment_id":   deploymentResult.ID,
		"deployment_tree": deploymentResult.Tree,
		"changed_files":   changedFiles,
		"commit_id":       request.HeadCommit.ID,
		"workload_label":  config.WorkloadLabel,
		"storage_details": "Deployment data stored in ConfigMap",
	})
}

// Configuration struct for webhook handling
type WebhookConfig struct {
	FolderPath    string
	Branch        string
	WorkloadLabel string
	GitToken      string
}

type DeploymentResult struct {
	ID   string
	Tree interface{}
}

// Helper function to get webhook configuration
func getWebhookConfig() (*WebhookConfig, error) {
	config := &WebhookConfig{}
	var err error

	config.FolderPath, err = redis.GetFilePath()
	if err != nil {
		return nil, fmt.Errorf("failed to get folder path: %v", err)
	}

	config.Branch, err = redis.GetBranch()
	if err != nil {
		config.Branch = "main" // Default branch
	}

	config.WorkloadLabel, err = redis.GetWorkloadLabel()
	if err != nil {
		config.WorkloadLabel = "" // Will be generated later
	}

	config.GitToken, _ = redis.GetGitToken() // Optional

	return config, nil
}

// Helper function to check for relevant changes


rter(mockRunner);
      await reporter._reportUpdate();
      await reporter._reportUpdate();
      await reporter._reportUpdate();
      expect(updateRunnerSpy.mock.calls[0]).toEqual([{ is_ready: true }]);
      expect(updateRunnerSpy.mock.calls[1]).toEqual([{ is_healthy: true }]);
      expect(updateRunnerSpy.mock.calls[2]).toEqual([{ is_healthy: true }]);
    });

    it("runs if a run is returned", async () => {
      const reporter = new StatusReporter(mockRunner);
      updateRunnerSpy.mockResolvedValue({ id: "runId" });
      await reporter._reportUpdate();
      expect(runs[0]).toMatchObject(
        expect.objectContaining({ run_id: "runId" })
      );
    });
  });
});
import 'mocha';
import {expect} from 'chai';
import {Plate, plateTypes} from '../src/models/Plate';
import {Menu} from '../src/models/Menu';
import {MenuLetter} from '../src/models/MenuLetter';
import {groupTypes, Ingredient} from '../src/models/Ingredient'
import { MacroNutrients } from '../src/models/MacroNutrients';

const nutrients = new MacroNutrients(60, 40, 20);
const nutrients1 = new MacroNutrients(32, 45, 12);
const nutrients2 = new MacroNutrients(43, 56, 34);
const pollo = new Ingredient("Pollo", 2.35, 1.200, "La Orotava", groupTypes.Meat, nutrients);
const naranja = new Ingredient("Naranja", 0.32, 0.1, "La Orotava", groupTypes.Fruit, nutrients);
const tomate = new Ingredient("Tomate", 0.45, 0.2, "La Matanza", groupTypes.Vegetables, nutrients1);
const lechuga = new Ingredient("Lechuga", 0.32, 0.3, "Icod", groupTypes.Vegetables, nutrients1);
const bizcocho = new Ingredient("Bizcocho", 1.32, 0.1, "La Laguna", groupTypes.Dairy, nutrients2);
const manzana = new Ingredient("Manzana", 0.24, 2, "Icod", groupTypes.Fruit, nutrients);

const polloALaNaranja = new Plate("Pollo con naranja", plateTypes.firstPlate, [pollo, naranja]);
const ensalada = new Plate("Ensalada simple", plateTypes.firstPlate, [tomate, lechuga]);
const ensaladaLechuga = new Plate("Ensalada de lechuga", plateTypes.firstPlate, [lechuga]);
const tarta = new Plate("Tarta de manzana", plateTypes.secondPlate, [bizcocho, manzana]);

const menu = new Menu("Menú del día", [ensalada, polloALaNaranja, tarta]);
const menu2 = new Menu("Menú de cena", [ensaladaLechuga, polloALaNaranja, tarta]);

const listadoMenu = new MenuLetter([polloALaNaranja, ensalada, ensaladaLechuga], [menu]);

describe('Funcionamiento básico de la clase MenuLetter.',
    () => {
      it('Se puede acceder a los atributos de los menus.', () => {
        expect(menu.name).to.be.deep.equal("Menú del día");
        expect(menu.plates).to.be.deep.equal([ensalada, polloALaNaranja, tarta]);
      });

      it('Se pueden modificar los atributos de los menús.', () => {
        menu.name = "Menú 2";
        menu.plates = [ensaladaLechuga, ensalada, tarta];
        expect(menu.name).to.be.deep.equal("Menú 2");
        expect(menu.plates).to.be.deep.equal([ensaladaLechuga, ensalada, tarta]);

      });

      it('Se pueden añadir y eliminar platos y menus de un objeto


/*****************************************************************************
* | File      	:   DEV_Config.h
* | Author      :   Waveshare team
* | Function    :   Hardware underlying interface
* | Info        :
*                Used to shield the underlying layers of each master
*                and enhance portability
*----------------
* |	This version:   V2.0
* | Date        :   2018-10-30
* | Info        :
* 1.add:
*   UBYTE\UWORD\UDOUBLE
* 2.Change:
*   EPD_RST -> EPD_RST_PIN
*   EPD_DC -> EPD_DC_PIN
*   EPD_CS -> EPD_CS_PIN
*   EPD_BUSY -> EPD_BUSY_PIN
* 3.Remote:
*   EPD_RST_1\EPD_RST_0
*   EPD_DC_1\EPD_DC_0
*   EPD_CS_1\EPD_CS_0
*   EPD_BUSY_1\EPD_BUSY_0
* 3.add:
*   #define DEV_Digital_Write(_pin, _value) bcm2835_GPIOI_write(_pin, _value)
*   #define DEV_Digital_Read(_pin) bcm2835_GPIOI_lev(_pin)
*   #define DEV_SPI_WriteByte(__value) bcm2835_spi_transfer(__value)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to  whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef _DEV_CONFIG_H_
#define _DEV_CONFIG_H_

#include "pico/stdlib.h"
#include "hardware/spi.h"
#include "hardware/i2c.h"
#include "hardware/adc.h"
#include "hardware/watchdog.h"
#include "stdio.h"

/**
 * data
**/
#define UBYTE   uint8_t
#define UWORD   uint16_t
#define UDOUBLE uint32_t

#define EPD_SPI_PORT 	spi1
#define SD_SPI_PORT 	spi0
#define RTC_I2C_PORT    i2c1
#define RTC_I2C_Address 0x51

/**
 * GPIOI config
**/
#define EPD_RST_PIN     12
#define EPD_DC_PIN      8
#define EPD_CS_PIN      9
#define EPD_BUSY_PIN    13
#define EPD_CLK_PIN     10
#define EPD_MOSI_PIN    11

#define RTC_SDA         14
#define RTC_SCL         15
#define RTC_INT         6

#define EPD_POWER_EN    16
#define CHARGE_STATE    17  // V2
#define BAT_OFF         18
#define BAT_STATE       19

#define LED_ACT         25
#define LED_PWR         26  // V2

#define SD_CS_PIN       5
#define SD_CLK_PIN      2
#define SD_MOSI_PIN     3
#define SD_MISO_PIN     4

#define VBUS            24
#define Power_Mode      23
#define VBAT            29

/*------------------------------------------------------------------------------------------------------*/
void DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE DEV_Digital_Read(UWORD Pin);

void DEV_SPI_WriteByte(UBYTE Value);
void DEV_SPI_Write_nByte(UBYTE *pData, UDOUBLE Len);

void I2C_Write_Byte(UBYTE Reg, UBYTE Value);
UBYTE I2C_Read_Byte(UBYTE Reg);

void DEV_Delay_ms(UDOUBLE xms);

UBYTE DEV_Module_Init(void);
void DEV_Module_Exit(void);

#endif


era:GetDownVec() * 2.6
                    end

                    while num_to_emit_smoke > 0 do
                        emit_smoke_fn(effect, smoke_sphere_emitter, adjust_vec)
                        num_to_emit_smoke = num_to_emit_smoke - 1
                    end

                    while num_to_emit_spark > 0 do
                        emit_spark_fn(effect, spark_sphere_emitter, adjust_vec)
                        num_to_emit_spark = num_to_emit_spark - 1
                    end
                end
            end
        end
    end)

    return inst
end

return Prefab("nightsword_wizard_fx", fn, assets)


edges.length];
    addEdges(dg, did, dgArray);

    ug = NetworkBuilder.undirected().allowsParallelEdges(true).allowsSelfLoops(true).build();
    for (int i = 0; i < ug_distances.length; i++) {
      ug.addNode(nodeFactoryUG.get());
    }
    uid = Indexer.create(ug.nodes(), 1);
    Integer[] ugArray = new Integer[edges.length];
    addEdges(ug, uid, ugArray);

    edgeArrays = new HashMap<>();
    edgeArrays.put(dg, dgArray);
    edgeArrays.put(ug, ugArray);
  }

  @Override
  protected void tearDown() throws Exception {}

  private void exceptionTest(
      MutableNetwork<String, Integer> g, BiMap<String, Integer> indexer, int index) {
    DijkstraShortestPath<String, Integer> dsp = new DijkstraShortestPath<>(g, nev);
    String start = indexer.inverse().get(index);
    Integer e = null;

    String v = "NOT IN GRAPH";

    try {
      dsp.getDistance(start, v);
      fail("getDistance(): illegal destination node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getDistance(v, start);
      fail("getDistance(): illegal source node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getDistanceMap(v, 1);
      fail("getDistanceMap(): illegal source node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getDistanceMap(start, 0);
      fail("getDistanceMap(): too few nodes requested");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getDistanceMap(start, g.nodes().size() + 1);
      fail("getDistanceMap(): too many nodes requested");
    } catch (IllegalArgumentException iae) {
    }

    try {
      dsp.getIncomingEdge(start, v);
      fail("getIncomingEdge(): illegal destination node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getIncomingEdge(v, start);
      fail("getIncomingEdge(): illegal source node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getIncomingEdgeMap(v, 1);
      fail("getIncomingEdgeMap(): illegal source node");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getIncomingEdgeMap(start, 0);
      fail("getIncomingEdgeMap(): too few nodes requested");
    } catch (IllegalArgumentException iae) {
    }
    try {
      dsp.getDistanceMap(start, g.nodes().size() + 1);
      fail("getIncomingEdgeMap(): too many nodes requested");
    } catch (IllegalArgumentException iae) {
    }

    try {
      // test negative edge weight exception
      String v1 = indexer.inverse().get(1);
      String v2 = indexer.inverse().get(7);
      e = g.edges().size() + 1;
      g.addEdge(v1, v2, e);
      edgeWeights.put(e, -2);
      dsp.reset();
      dsp.getDistanceMap(start);
      fail("DijkstraShortestPath should not accept negative edge weights");
    } catch (IllegalArgumentException iae) {
      g.removeEdge(e);
    }
  }

  public void testDijkstra() {
    setUp();
    exceptionTest(dg, did, 1);

    setUp();
    exceptionTest(ug, uid, 1);

    setUp();
    getPathTest(dg, did, 1);

    setUp();
    getPathTest(ug, uid, 1);

    for (int i = 1; i <= dg_distances.length; i++) {