-- логика создания заданий пишется на языке программирования Lua
-- больше о создании интерфейсов заданий: https://github.com/ilyavasilev14/test_generator/blob/master/docs/custom_gui.md

local symbols_list = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
    "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X",
    "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
}

-- генерация задания
local answer = ""
local answer_param = ""

for _ = 1, math.random(7, 15) do
    local symbol = math.random(1, #symbols_list)
    answer = answer .. symbols_list[symbol]
end

for _ = 1, math.random(7, 15) do
    local symbol = math.random(1, #symbols_list)
    answer_param = answer_param .. symbols_list[symbol]
end

local lines_count = math.random(100, 500)
local answer_line = math.random(50, lines_count)

local file_data = ""
for i = 1, lines_count do
    if i == answer_line then
        file_data = file_data .. answer_param .. ' = "' .. answer .. '"\n'
    else
        local new_param_name = ""
        for _ = 1, math.random(7, 15) do
            local symbol = math.random(1, #symbols_list)
            new_param_name = new_param_name .. symbol


TaskRunStatus{
				TaskRunStatusFields: v1.TaskRunStatusFields{
					CompletionTime: &metav1.Time{
						Time: time.Now(),
					},
				},
				Status: duckv1.Status{
					Conditions: duckv1.Conditions{
						{
							Status: corev1.ConditionUnknown,
							Reason: v1.TaskRunReasonRunning.String(),
						},
					},
				},
			},
		},
	}

	prdata := []*v1.PipelineRun{
		{
			ObjectMeta: metav1.ObjectMeta{
				Namespace:         "ns",
				Name:              "pipeline-run-1",
				Labels:            map[string]string{"tekton.dev/pipeline": "pipeline"},
				CreationTimestamp: metav1.Time{Time: clock.Now()},
			},
			Spec: v1.PipelineRunSpec{
				PipelineRef: &v1.PipelineRef{
					Name: "pipeline",
				},
			},
			Status: v1.PipelineRunStatus{
				Status: duckv1.Status{
					Conditions: duckv1.Conditions{
						{
							Status: corev1.ConditionTrue,
							Reason: v1.PipelineRunReasonRunning.String(),
						},
					},
				},
				PipelineRunStatusFields: v1.PipelineRunStatusFields{
					// pipeline run starts now
					StartTime: &metav1.Time{Time: clock.Now()},
				},
			},
		},
	}

	type clients struct {
		pipelineClient pipelinetest.Clients
		dynamicClient  dynamic.Interface
	}

	seeds := make([]clients, 0)
	for i := 0; i < 5; i++ {
		trs := trdata
		prs := prdata
		cs, _ := test.SeedTestData(t, pipelinetest.Data{TaskRuns: trs, Tasks: tasks, PipelineRuns: prs, Namespaces: ns})
		cs.Pipeline.Resources = cb.APIResourceList(version, []string{"taskrun", "pipelinerun"})
		tdc := testDynamic.Options{}
		dc, err := tdc.Client(
			cb.UnstructuredT(tasks[0], version),
			cb.UnstructuredTR(trdata[0], version),
			cb.UnstructuredTR(trdata[1], version),
			cb.UnstructuredPR(prs[0], version),
		)
		if err != nil {
			t.Errorf("unable to create dynamic client: %v", err)
		}
		seeds = append(seeds, clients{cs, dc})
	}
	testParams := []struct {
		name        string
		command     []string
		dynamic     dynamic.Interface
		input       pipelinetest.Clients
		inputStream io.Reader
		wantError   bool
		want        string
	}{
		{
			name:        "Taskrun with running pipelinerun and answer y",
			command:     []string{"rm", "tr0-1", "-n", "ns"},
			dynamic:     seeds[0].dynamicClient,
			input:       seeds[0].pipelineClient,
			inputStream: strings.NewReader("y"),
			wantError:   false,
			want:        "Are you sure you want to delete TaskRun(s) \"tr0-1\" (y/n): TaskRun(s): tr0-1 attached to PipelineRun is still running deleting will restart the completed taskrun. Proceed (y/n): TaskRuns deleted: \"tr0-1\"\n",
		},
		{
			name:        "Taskrun with running pipelinerun force",
			command:     []string{"rm", "tr0-1", "-n", "ns", "-f"},
			dynamic:     seeds[2].dynamicClient,
			input:       seeds[2].pipelineClient,
			inputStream: nil,
			wantError:   false,
			want:        "warning: Taskrun tr0-1 related pipelinerun still running.\nTaskRuns deleted:


.iban",  "sepa.src.iban",  null, LogFilter.FILTER_IDS);
        addConstraint("src.name",  "sepa.src.name",  null, LogFilter.FILTER_IDS);
        addConstraint("dst.bic",   "sepa.dst.bic",   "",   LogFilter.FILTER_MOST, true); // Kann eventuell entfallen, da BIC optional
        addConstraint("dst.iban",  "sepa.dst.iban",  null, LogFilter.FILTER_IDS, true);
        addConstraint("dst.name",  "sepa.dst.name",  null, LogFilter.FILTER_IDS, true);
        addConstraint("btg.value", "sepa.btg.value", null, LogFilter.FILTER_NONE, true);
        addConstraint("btg.curr",  "sepa.btg.curr",  "EUR", LogFilter.FILTER_NONE, true);
        addConstraint("usage",     "sepa.usage",     "",   LogFilter.FILTER_NONE, true);

        //Constraints für die PmtInfId (eindeutige SEPA Message ID) und EndToEndId (eindeutige ID um Transaktion zu identifizieren)
        addConstraint("sepaid",    "sepa.sepaid",      getSEPAMessageId(),      LogFilter.FILTER_NONE);
        addConstraint("pmtinfid",  "sepa.pmtinfid",    getSEPAMessageId(),      LogFilter.FILTER_NONE);
        addConstraint("endtoendid", "sepa.endtoendid", ENDTOEND_ID_NOTPROVIDED, LogFilter.FILTER_NONE, true);
        addConstraint("purposecode","sepa.purposecode", "",                     LogFilter.FILTER_NONE, true);
    }

    /**
     * @see org.kapott.hbci.GV.AbstractSEPAGV#getPainJobName()
     */
    public String getPainJobName()
    {
        // Als Job-Namen nehmen wir die normale SEPA-Ueberweisung, weil das die selbe SEPA-Message ist
        return "UebSEPA";
    }
}
/**********************************************************************
 *
 * This file is part of HBCI4Java.
 * Copyright (c) 2001-2008 Stefan Palme
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 **********************************************************************/

package org.kapott.hbci.GV;

import java.util.Properties;

import org.kapott.hbci.GV_Result.GVRSaldoReq;
import org.kapott.hbci.dialog.KnownReturncode;
import org.kapott.hbci.dialog.KnownTANProcess;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtils;
import org.kapott.hbci.manager.LogFilter;
import org.kapott.hbci.passport.AbstractPinTanPassport;
import org.kapott.hbci.passport.HBCIPassportInternal;
import org.kapott.hbci.status.HBCIMsgStatus;
import org.kapott.hbci.tools.StringUtil;

/**
 * @author stefan.palme
 */
public class GVTAN2Step extends HBCIJobImpl
{
    // Wenn der Wert NULL ist, ist "this" also das zweite HKTAN
    private GVTAN2Step step2;

    private KnownTANProcess process = null;

    // Wenn der Wert NULL ist, ist "this" also das er


a1, $a1, 0x30F8           ## $a1 = 040030F8
/* 0D794 8083F9A4 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 0D798 8083F9A8 0C20FDCB */  jal     func_8083F72C
/* 0D79C 8083F9AC 8FA6002C */  lw      $a2, 0x002C($sp)
/* 0D7A0 8083F9B0 10000002 */  beq     $zero, $zero, .L8083F9BC
/* 0D7A4 8083F9B4 24020001 */  addiu   $v0, $zero, 0x0001         ## $v0 = 00000001
/* 0D7A8 8083F9B8 00001025 */  or      $v0, $zero, $zero          ## $v0 = 00000000
.L8083F9BC:
/* 0D7AC 8083F9BC 8FBF001C */  lw      $ra, 0x001C($sp)
/* 0D7B0 8083F9C0 8FB00018 */  lw      $s0, 0x0018($sp)
/* 0D7B4 8083F9C4 27BD0028 */  addiu   $sp, $sp, 0x0028           ## $sp = 00000000
/* 0D7B8 8083F9C8 03E00008 */  jr      $ra
/* 0D7BC 8083F9CC 00000000 */  nop


s called when exiting the parenstmt production.
	ExitParenstmt(c *ParenstmtContext)

	// ExitBracestmt is called when exiting the bracestmt production.
	ExitBracestmt(c *BracestmtContext)

	// ExitBracketstmt is called when exiting the bracketstmt production.
	ExitBracketstmt(c *BracketstmtContext)

	// ExitGtltstmt is called when exiting the gtltstmt production.
	ExitGtltstmt(c *GtltstmtContext)
}
// Code generated from brainflak.g4 by ANTLR 4.9.3. DO NOT EDIT.

package brainflak // brainflak
import (
	"fmt"
	"reflect"
	"strconv"

	"github.com/antlr/antlr4/runtime/Go/antlr"
)

// Suppress unused import errors
var _ = fmt.Printf
var _ = reflect.Copy
var _ = strconv.Itoa

var parserATN = []uint16{
	3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 11, 62, 4,
	2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3,
	2, 6, 2, 16, 10, 2, 13, 2, 14, 2, 17, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 24,
	10, 3, 3, 4, 3, 4, 7, 4, 28, 10, 4, 12, 4, 14, 4, 31, 11, 4, 3, 4, 3, 4,
	3, 5, 3, 5, 7, 5, 37, 10, 5, 12, 5, 14, 5, 40, 11, 5, 3, 5, 3, 5, 3, 6,
	3, 6, 7, 6, 46, 10, 6, 12, 6, 14, 6, 49, 11, 6, 3, 6, 3, 6, 3, 7, 3, 7,
	7, 7, 55, 10, 7, 12, 7, 14, 7, 58, 11, 7, 3, 7, 3, 7, 3, 7, 2, 2, 8, 2,
	4, 6, 8, 10, 12, 2, 2, 2, 63, 2, 15, 3, 2, 2, 2, 4, 23, 3, 2, 2, 2, 6,
	25, 3, 2, 2, 2, 8, 34, 3, 2, 2, 2, 10, 43, 3, 2, 2, 2, 12, 52, 3, 2, 2,
	2, 14, 16, 5, 4, 3, 2, 15, 14, 3, 2, 2, 2, 16, 17, 3, 2, 2, 2, 17, 15,
	3, 2, 2, 2, 17, 18, 3, 2, 2, 2, 18, 3, 3, 2, 2, 2, 19, 24, 5, 6, 4, 2,
	20, 24, 5, 8, 5, 2, 21, 24, 5, 10, 6, 2, 22, 24, 5, 12, 7, 2, 23, 19, 3,
	2, 2, 2, 23, 20, 3, 2, 2, 2, 23, 21, 3, 2, 2, 2, 23, 22, 3, 2, 2, 2, 24,
	5, 3, 2, 2, 2, 25, 29, 7, 3, 2, 2, 26, 28, 5, 4, 3, 2, 27, 26, 3, 2, 2,
	2, 28, 31, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 30, 3, 2, 2, 2, 30, 32,
	3, 2, 2, 2, 31, 29, 3, 2, 2, 2, 32, 33, 7, 4, 2, 2, 33, 7, 3, 2, 2, 2,
	34, 38, 7, 7, 2, 2, 35, 37, 5, 4, 3, 2, 36, 35, 3, 2, 2, 2, 37, 40, 3,
	2, 2, 2, 38, 36, 3, 2, 2, 2, 38, 39, 3, 2, 2, 2, 39, 41, 3, 2, 2, 2, 40,
	38, 3, 2, 2, 2, 41, 42, 7, 8, 2, 2, 42, 9, 3, 2, 2, 2, 43, 47, 7, 9, 2,
	2, 44, 46, 5, 4, 3, 2, 45, 44, 3, 2, 2, 2, 46, 49, 3, 2, 2, 2, 47, 45,
	3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 50, 3, 2, 2, 2, 49, 47, 3, 2, 2, 2,
	50, 51, 7, 10, 2, 2, 51, 11, 3, 2, 2, 2, 52, 56,


.Builder(context, R.style.map_transparent_dialog)
        val view = LayoutInflater.from(context).inflate(R.layout.map_dialog_choose, null, false)
        builder.setView(view)
        builder.setCancelable(true)

        val map_tv_tip_title = view.findViewById<TextView>(R.id.map_tv_tip_title)
        val map_tv_tip_text = view.findViewById<TextView>(R.id.map_tv_tip_text)
        val map_tv_tip_deny = view.findViewById<TextView>(R.id.map_tv_tip_deny)
        val map_tv_tip_positive = view.findViewById<TextView>(R.id.map_tv_tip_positive)
        map_tv_tip_title.text = title
        map_tv_tip_text.text = content

        val dialog = builder.create()
        dialog.show()

        map_tv_tip_deny.setOnSingleClickListener {
            listener.onDeny()
            dialog.dismiss()
        }
        map_tv_tip_positive.setOnSingleClickListener {
            listener.onPositive()
            dialog.dismiss()
        }
    }
}package com.cyxbs.pages.map.component

import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import com.cyxbs.pages.map.R

class RoundRectImageView : AppCompatImageView {
    private var paint: Paint? = null

    /**
     * 个人理解是
     *
     *
     * 这两个都是画圆的半径
     */
    private var roundWidth = 10
    private var roundHeight = 10
    private var paint2: Paint? = null

    constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {
        init(context, attrs)
    }

    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        init(context, attrs)
    }

    constructor(context: Context) : super(context) {
        init(context, null)
    }

    private fun init(context: Context, attrs: AttributeSet?) {
        if (attrs != null) {
            val a = context.obtainStyledAttributes(attrs, R.styleable.MapRoundAngleImageView)
            roundWidth = a.getDimensionPixelSize(R.styleable.MapRoundAngleImageView_map_roundWidth, roundWidth)
            roundHeight = a.getDimensionPixelSize(R.styleable.MapRoundAngleImageView_map_roundHeight, roundHeight)
        } else {
            val density = context.resources.displayMetrics.density
            roundWidth = (roundWidth * density).toInt()
            roundHeight = (roundHeight * density).toInt()
        }
        paint = Paint()
        paint!!.color = Color.WHITE
        paint!!.isAntiAlias = true
        paint!!.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT)
        paint2 = Paint()
        paint2!!.xfermode = null
    }

    override fun draw(canvas: Canvas) {
        val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
        val canvas2 = Canvas(bitmap)
        super.draw(canvas2)
        drawLiftUp(canvas2)
        drawLiftDown(canvas2)
        drawRightUp(canvas2)
        drawRightDown(canvas2)
        canvas.drawBitmap(bitmap, 0f, 0f, paint2)
        bitmap.recycle()
    }

    private fun drawLiftUp(canvas: Canvas) {
        val path = Path()
        path.moveTo(0f, roundHeight.toFloat())
        path.lineTo(0f, 0f)
        path.lineTo(roundWidth.toFloat(), 0f)
        path.arcTo(RectF(0f, 0f, (roundWidth * 2).toFloat(), (roundHeight * 2).toFloat()), -90f, -90f)
        path.close()
        paint?.let { canvas.drawPath(path, it) }
    }


nTestCWE9() {
/* BEGIN-AUTOGENERATED-JAVA-TESTS-9 */

			/* END-AUTOGENERATED-JAVA-TESTS-9 */
}
}/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE252_Unchecked_Return_Value__FileInputStream_04.java
Label Definition File: CWE252_Unchecked_Return_Value__FileInputStream.label.xml
Template File: point-flaw-04.tmpl.java
*/
/*
* @description
* CWE: 252 Unchecked Return Value
* Sinks:
*    GoodSink: Check the return value from FileInputStream.read() and handle possible errors
*    BadSink : Do not check the return value of FileInputStream.read()
* Flow Variant: 04 Control flow: if(PRIVATE_STATIC_FINAL_TRUE) and if(PRIVATE_STATIC_FINAL_FALSE)
*
* */

package testcases.CWE252_Unchecked_Return_Value;

import testcasesupport.*;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.FileNotFoundException;

import java.util.logging.Level;

public class CWE252_Unchecked_Return_Value__FileInputStream_04 extends AbstractTestCase
{
    /* The two variables below are declared "final", so a tool should
     * be able to identify that reads of these will always return their
     * initialized values.
     */
    private static final boolean PRIVATE_STATIC_FINAL_TRUE = true;
    private static final boolean PRIVATE_STATIC_FINAL_FALSE = false;

    public void bad() throws Throwable
    {
        if (PRIVATE_STATIC_FINAL_TRUE)
        {
            FileInputStream streamFileInput = null;
            try
            {
                int bytesToRead = 1024;
                byte[] byteArray = new byte[bytesToRead];
                streamFileInput = new FileInputStream("c:\\file.txt");
                streamFileInput.read(byteArray);
                /* FLAW: Do not check the return value of read() */
                IO.writeLine(new String(byteArray, "UTF-8"));
            }
            catch(FileNotFoundException exceptFileNotFound)
            {
                IO.logger.log(Level.WARNING, "FileNotFoundException opening file", exceptFileNotFound);
            }
            catch (IOException exceptIO)
            {
                IO.logger.log(Level.WARNING, "IOException reading file", exceptIO);
            }
            finally
            {
                try
                {
                    if(streamFileInput != null)
                    {
                        streamFileInput.close();
                    }
                }
                catch (IOException exceptIO)
                {
                    IO.logger.log(Level.WARNING, "IOException closing FileInputStream", exceptIO);
                }
            }
        }
    }

    /* good1() changes PRIVATE_STATIC_FINAL_TRUE to PRIVATE_STATIC_FINAL_FALSE */
    private void good1() throws Throwable
    {
        if (PRIVATE_STATIC_FINAL_FALSE)
        {
            /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
            IO.writeLine("Benign, fixed string");
        }
        else
        {

            FileInputStream streamFileInput = null;

            try
            {
                int bytesToRead = 1024;
                byte[] byteArray = new byte[bytesToRead];

                streamFileInput = new FileInputStream("c:\\file.txt");

                int numberOfBytesRead = streamFileInput.read(byteArray);

                /* FIX: Check the return value of read()


/* ISC license. */

#include <string.h>
#include <strings.h>
#include <stdint.h>
#include <unistd.h>

#include <skalibs/types.h>
#include <skalibs/sgetopt.h>
#include <skalibs/strerr.h>
#include <skalibs/djbunix.h>
#include <skalibs/exec.h>

#include <s6-rc/config.h>
#include <s6-rc/s6rc.h>

#define USAGE "s6-rc-oneshot-run [ -l live ] [ -b ] up|down servicenumber"
#define dieusage() strerr_dieusage(100, USAGE)

int main (int argc, char const *const *argv)
{
  char const *live = S6RC_LIVE_BASE ;
  unsigned int number ;
  int up ;
  int blocking = 0 ;
  PROG = "s6-rc-oneshot-run" ;
  {
    subgetopt l = SUBGETOPT_ZERO ;
    for (;;)
    {
      int opt = subgetopt_r(argc, argv, "l:b", &l) ;
      if (opt == -1) break ;
      switch (opt)
      {
        case 'l' : live = l.arg ; break ;
        case 'b' : blocking = 1 ; break ;
        default : dieusage() ;
      }
    }
    argc -= l.ind ; argv += l.ind ;
  }

  if (argc < 2) dieusage() ;
  if (!strcasecmp(argv[0], "up")) up = 1 ;
  else if (!strcasecmp(argv[0], "down")) up = 0 ;
  else dieusage() ;
  if (!uint0_scan(argv[1], &number)) dieusage() ;

  {
    size_t livelen = strlen(live) ;
    int fdcompiled, compiledlock ;
    s6rc_db_t db ;
    char compiled[livelen + 10] ;
    memcpy(compiled, live, livelen) ;
    memcpy(compiled + livelen, "/compiled", 10) ;

    if (!s6rc_lock(0, 0, 0, compiled, 1, &compiledlock, blocking))
      strerr_diefu2sys(111, "take lock on ", compiled) ;
    fdcompiled = open_readb(compiled) ;
    if (fdcompiled < 0)
      strerr_diefu2sys(111, "open ", compiled) ;

   /* Read the sizes of the compiled db */

    if (!s6rc_db_read_sizes(fdcompiled, &db))
      strerr_diefu3sys(111, "read ", compiled, "/n") ;

    if (number < db.nlong || number >= db.nlong + db.nshort)
      strerr_dief1x(3, "invalid service number") ;

   /* Allocate enough stack for the db */

    {
      s6rc_service_t serviceblob[db.nshort + db.nlong] ;
      char const *argvblob[db.nargvs] ;
      uint32_t depsblob[db.ndeps << 1] ;
      uint32_t producersblob[db.nproducers] ;
      char stringblob[db.stringlen] ;
      int r ;

      db.services = serviceblob ;
      db.argvs = argvblob ;
      db.deps = depsblob ;
      db.producers = producersblob ;
      db.string = stringblob ;

     /* Read the db from the file */

      r = s6rc_db_read(fdcompiled, &db) ;
      if (r < 0) strerr_diefu3sys(111, "read ", compiled, "/db") ;
      if (!r) strerr_dief3x(4, "invalid service database in ", compiled, "/db") ;
      close(fdcompiled) ;
      close(compiledlock) ;

     /* Run the script */

      {
        unsigned int sargc = db.services[number].x.oneshot.argc[up] ;
        char const *const *sargv = db.argvs + db.services[number].x.oneshot.argv[up] ;
        char const *newargv[sargc + 1] ;
        char const **p = newargv ;
        while (sargc--) *p++ = *sargv++ ;
        *p = 0 ;
        xexec0(newargv) ;
      }
    }
  }
}


 rows: 1, size: { h: 864, w: 1152 }, type: ResolutionType['XGA+'] },
  'WXGA': { columns: 2, rows: 1, size: { h: 800, w: 1280 }, type: ResolutionType.WXGA },
  'SXGA': { columns: 2, rows: 1, size: { h: 1024, w: 1280 }, type: ResolutionType.SXGA },
  'HD': { columns: 2, rows: 1, size: { h: 768, w: 1366 }, type: ResolutionType.HD },
  'WXGA+': { columns: 2, rows: 1, size: { h: 900, w: 1440 }, type: ResolutionType['WXGA+'] },
  'HD+': { columns: 2, rows: 1, size: { h: 900, w: 1600 }, type: ResolutionType['HD+'] },
  'WSXGA+': { columns: 2, rows: 1, size: { h: 1050, w: 1680 }, type: ResolutionType['WSXGA+'] },
  'FHD': { columns: 2, rows: 1, size: { h: 1080, w: 1920 }, type: ResolutionType.FHD },
  'WUXGA': { columns: 2, rows: 1, size: { h: 1200, w: 1920 }, type: ResolutionType.WUXGA },
  'QHD': { columns: 2, rows: 1, size: { h: 1440, w: 2560 }, type: ResolutionType.QHD },
  'UWQHD': { columns: 3, rows: 2, size: { h: 1440, w: 3440 }, type: ResolutionType.UWQHD },
  '4K UHD': { columns: 3, rows: 1, size: { h: 2160, w: 3840 }, type: ResolutionType['4K UHD'] },
};
/* tslint:enable:object-literal-sort-keys */
/**
 * Functions to MP3 by ELECFREAKS Co.,Ltd.
 */
//% weight=0 color=#009900 icon="\uf001" block="MP3"
namespace mp3Player {

    let Start_Byte = 0x7E
    let Version_Byte = 0xFF
    let Command_Length = 0x06
    let End_Byte = 0xEF
    let Acknowledge = 0x00
    let CMD = 0x00
    let para1 = 0x00
    let para2 = 0x00
    let highByte = 0x00
    let lowByte = 0x00
    let dataArr: number[] = [Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge, para1, para2, highByte, lowByte, End_Byte]
	/*
	* Play status selection button list
	*/
    export enum playType {
        //% block="Play"
        Play = 0x0D,
        //% block="Stop"
        Stop = 0x16,
        //% block="PlayNext"
        PlayNext = 0x01,
        //% block="PlayPrevious"
        PlayPrevious = 0x02,
        //% block="Pause"
        Pause = 0x0E
    }
    /*
	* Loop button list
	*/
    export enum repeatList {
        //% block="no"
        No = 0,
        //% block="yes"
        Yes = 1
    }
    /**
     * TODO: Initializing the MP3 connection port as a serial port
     * @param pinRX Serial port TX pin of micro:bit , eg: SerialPin.P1
     */
    //% blockId="MP3_setSerial" block="set MP3Player model connect to %pinRX"
    //% weight=100
    export function MP3SetSerial(pinRX: SerialPin): void {
        serial.redirect(
            pinRX,
            SerialPin.USB_TX,
            BaudRate.BaudRate9600
        )
        basic.pause(100)
    }
    /**
     * TODO: Perform playback or other
     * @param myType Left wheel speed , eg: playType.Play
     */
    //% blockId="execute"
    //% block="execute procedure:%myType"
    //% weight=90 blockExternalInputs=true
    export function execute(myType: playType): void {
        CMD = myType
        para1 = 0x00
        para2 = 0x00
        dataArr[3] = CMD


on.
//

package functional

import (
	"os"
	"strconv"
	"syscall"
	"testing"

	"github.com/heketi/heketi/v10/pkg/glusterfs/api"
	"github.com/heketi/tests"
)

func TestAdminModes(t *testing.T) {
	setupCluster(t, 4, 8)
	defer teardownCluster(t)
	t.Run("testAdminStatusGet", testAdminStatusGet)
	teardownVolumes(t)
	t.Run("testAdminStatusLocal", testAdminStatusLocal)
	teardownVolumes(t)
	t.Run("testAdminStatusNormal", testAdminStatusNormal)
	teardownVolumes(t)
	t.Run("testAdminStatusReadOnly", testAdminStatusReadOnly)
	t.Run("testAdminStatusReset", testAdminStatusReset)
}

func checkAdminState(t *testing.T, s api.AdminState) {
	as, err := heketi.AdminStatusGet()
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
	tests.Assert(t, as.State == s,
		"expected as.State == s, got:", as.State, s)
}

func testAdminStatusGet(t *testing.T) {
	checkAdminState(t, api.AdminStateNormal)
}

func testAdminStatusLocal(t *testing.T) {
	err := heketi.AdminStatusSet(&api.AdminStatus{
		State: api.AdminStateLocal,
	})
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
	checkAdminState(t, api.AdminStateLocal)

	// now we should still be able to create a volume as
	// the test runs on the same host as heketi
	volReq := &api.VolumeCreateRequest{}
	volReq.Size = 1
	volReq.Durability.Type = api.DurabilityReplicate
	volReq.Durability.Replicate.Replica = 3
	_, err = heketi.VolumeCreate(volReq)
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
}

func testAdminStatusNormal(t *testing.T) {
	testAdminStatusLocal(t)
	// re-executing the local status test will leave this
	// in local-only mode. But because we are a local client
	// we should be able to set server back to normal

	err := heketi.AdminStatusSet(&api.AdminStatus{
		State: api.AdminStateNormal,
	})
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
	checkAdminState(t, api.AdminStateNormal)

	// now we should still be able to create a volume as
	// the test runs on the same host as heketi
	volReq := &api.VolumeCreateRequest{}
	volReq.Size = 1
	volReq.Durability.Type = api.DurabilityReplicate
	volReq.Durability.Replicate.Replica = 3
	_, err = heketi.VolumeCreate(volReq)
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
}

func testAdminStatusReadOnly(t *testing.T) {
	err := heketi.AdminStatusSet(&api.AdminStatus{
		State: api.AdminStateReadOnly,
	})
	tests.Assert(t, err == nil, "expected err == nil, got:", err)
	checkAdminState(t, api.AdminStateReadOnly)

	// now we can no longer make changes to the system
	volReq := &api.VolumeCreateRequest{}
	volReq.Size = 1
	volReq.Durability.Type = api.DurabilityReplicate
	volReq.Durability.Replicate.Replica = 3
	_, err = heketi.VolumeCreate(volReq)
	tests.Assert(t, err


ed(title: String) {
        val matcher = withId(R.id.title) + withText(title)
        onView(withId(R.id.offlineContentRecyclerView))
            .perform(RecyclerViewActions.scrollTo<BindableViewHolder>(hasDescendant(matcher)))
        onView(matcher).scrollTo().assertDisplayed()
    }

    fun assertDiscardDialogDisplayed() {
        WaitForViewMatcher.waitForView(ViewMatchers.withText(R.string.offline_content_discard_dialog_title))
            .assertDisplayed()
    }

    fun assertSyncDialogDisplayed(text: String) {
        WaitForViewMatcher.waitForView(ViewMatchers.withText(text)).assertDisplayed()
    }

    fun assertStorageInfoText(storageInfoText: String) {
        Espresso.onView(
            ViewMatchers.withId(R.id.storageInfo) + ViewMatchers.withText(
                storageInfoText
            )
        ).assertDisplayed()
    }
}

/*
 * Copyright (C) 2016 - present Instructure, Inc.
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
package com.instructure.student.activity

import android.app.Activity
import android.appwidget.AppWidgetManager
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.instructure.pandautils.base.BaseCanvasActivity
import com.instructure.pandautils.binding.viewBinding
import com.instructure.student.R
import com.instructure.student.databinding.ActivityWidgetSetupBinding
import com.instructure.student.util.StudentPrefs
import com.instructure.student.widget.WidgetUpdater.updateWidgets

class WidgetSetupActivity : BaseCanvasActivity() {

    private val binding by viewBinding(ActivityWidgetSetupBinding::inflate)

    private var appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // Sets the result canceled so if the user decides not to setup the widget it does not get added
        setResult(Activity.RESULT_CANCELED)

        setContentView(binding.root)

        binding.cardDark.setOnClickListener(cardClickListener)
        binding.cardLight.setOnClickListener(cardClickListener)
        binding.checkBox.setOnCheckedChangeListener { _, isChecked ->
            StudentPrefs.putBoolean(WIDGET_DETAILS_PREFIX + appWidgetId, isChecked)
        }

        intent.extras?.let { extras ->
            // Get the widget id we are adding/updating
            appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID)
        }

        // If our appWidgetId is bad or does not exist we exit the activity
        if (appWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) finish()
    }

    private val cardClickListener = View.OnClickListener { v ->
        val resultValue = Intent()
        resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
        when (v.id


import pandas as pd
import sqlalchemy
import matplotlib.pyplot as plt

# Establish database connection
DATABASE_URL = "postgresql://username:password@localhost:port_number/your_DB"
engine = sqlalchemy.create_engine(DATABASE_URL)

# Query to get the total number of books for each rating (1-5)
query_ratings_count = """
SELECT
    rating,
    COUNT(book_id) AS total_books
FROM dim_ratings
WHERE rating IN (1, 2, 3, 4, 5)
GROUP BY rating
ORDER BY rating;
"""

# Execute the query and load data into pandas DataFrame
df_ratings_count = pd.read_sql_query(query_ratings_count, engine)

# Plotting the total number of books for each rating
plt.figure(figsize=(8, 6))
plt.bar(df_ratings_count['rating'], df_ratings_count['total_books'], color=['red', 'purple', 'magenta', 'green', 'blue'])

# Adding labels and title
plt.xlabel('Rating Values')
plt.ylabel('Total Number of Books')
plt.title('Total Number of  Books for Each Rating (1-5)')

# Display the plot
plt.tight_layout()
plt.show()


, 0, ENTRY_HEIGHT),
			pos = UDim2.new(0, offset, 0, 0),
			isExpanded = showGraph,

			onButtonPress = onButtonPress,
		}, {
			name = Roact.createElement(CellLabel, {
				text = name,
				size = UDim2.new(1, 0, 1, 0),
				pos = UDim2.new(0, CELL_PADDING, 0, 0),
			}),

			horizonal1 = Roact.createElement("Frame", {
				Size = UDim2.new(1, -offset , 0, LINE_WIDTH),
				Position = UDim2.new(0, offset, 0, 0),
				BackgroundColor3 = LINE_COLOR,
				BorderSizePixel = 0,
			}),

			horizonal2 = Roact.createElement("Frame", {
				Size = UDim2.new(1, -offset, 0, LINE_WIDTH),
				Position = UDim2.new(0, offset, 1, 0),
				BackgroundColor3 = LINE_COLOR,
				BorderSizePixel = 0,
			}),
		}),

		value = Roact.createElement(CellLabel, {
			text = formatValueStr(value),
			size = UDim2.new(VALUE_CELL_WIDTH, -VALUE_PADDING, 0, ENTRY_HEIGHT),
			pos = UDim2.new(1 - VALUE_CELL_WIDTH, VALUE_PADDING, 0, 0),
		}),

		vertical = Roact.createElement("Frame", {
			Size = UDim2.new(0, 1, 0, ENTRY_HEIGHT),
			Position = UDim2.new(1 - VALUE_CELL_WIDTH, 0, 0, 0),
			BackgroundColor3 = LINE_COLOR,
			BorderSizePixel = 0,
		}),

		Graph = showGraph and Roact.createElement(LineGraph, {
			pos = UDim2.new(0, 0, 0, ENTRY_HEIGHT),
			size = UDim2.new(1, 0, 1, -ENTRY_HEIGHT),
			graphData = dataStats.dataSet,
			maxY = dataStats.max,
			minY = dataStats.min,

			getX = getX,
			getY = getY,

			stringFormatX = convertTimeStamp,
			stringFormatY = formatValueStr,

			axisLabelX = "Timestamp",
			axisLabelY = name,
		}),
	})
end

--return MemoryViewEntry


ateDirect(buffer, newCapacity), false);
        return this;
    }
}
/*
 * Copyright 2015 The Netty Project
 *
 * The Netty Project licenses this file to you 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 io.netty.buffer;

import io.netty.util.internal.PlatformDependent;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;

import static io.netty.util.internal.MathUtil.isOutOfBounds;
import static io.netty.util.internal.ObjectUtil.checkNotNull;
import static io.netty.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;

/**
 * All operations get and set as {@link ByteOrder#BIG_ENDIAN}.
 */
final class UnsafeByteBufUtil {
    private static final boolean UNALIGNED = PlatformDependent.isUnaligned();
    private static final byte ZERO = 0;

    static byte getByte(long address) {
        return PlatformDependent.getByte(address);
    }

    static short getShort(long address) {
        if (UNALIGNED) {
            short v = PlatformDependent.getShort(address);
            return BIG_ENDIAN_NATIVE_ORDER ? v : Short.reverseBytes(v);
        }
        return (short) (PlatformDependent.getByte(address) << 8 | PlatformDependent.getByte(address + 1) & 0xff);
    }

    static short getShortLE(long address) {
        if (UNALIGNED) {
            short v = PlatformDependent.getShort(address);
            return BIG_ENDIAN_NATIVE_ORDER ? Short.reverseBytes(v) : v;
        }
        return (short) (PlatformDependent.getByte(address) & 0xff | PlatformDependent.getByte(address + 1) << 8);
    }

    static int getUnsignedMedium(long address) {
        if (UNALIGNED) {
            return (PlatformDependent.getByte(address) & 0xff) << 16 |
                    (BIG_ENDIAN_NATIVE_ORDER ? PlatformDependent.getShort(address + 1)
                                             : Short.reverseBytes(PlatformDependent.getShort(address + 1))) & 0xffff;
        }
        return (PlatformDependent.getByte(address)     & 0xff) << 16 |
               (PlatformDependent.getByte(address + 1) & 0xff) << 8  |
               PlatformDependent.getByte(address + 2)  & 0xff;
    }

    static int getUnsignedMediumLE(long address) {
        if (UNALIGNED) {
            return (PlatformDependent.getByte(address) & 0xff) |
                    ((BIG_ENDIAN_NATIVE_ORDER ? Short.reverseBytes(PlatformDependent.getShort(address + 1))
                                              : PlatformDependent.getShort(address + 1)) & 0xffff) << 8;
        }
        return PlatformDependent.getByte(address)      & 0xff        |
               (PlatformDependent.getByte(address + 1) & 0xff) << 8  |
               (PlatformDependent.getByte(address + 2) & 0xff) << 16;
    }

    static int getInt(long address) {
        if (UNALIGNED) {
            int v = PlatformDependent.getInt(address);
            return BIG_ENDIAN_NATIVE_ORDER ? v : Integer.reverseBytes(v);
        }
        return PlatformDependent.getByte(address) << 24 |
               (PlatformDependent.getByte(address + 1) & 0xff) << 16 |
               (PlatformDependent.getByte(address + 2) & 0xff) <<  8 |
               PlatformD


using OSPSuite.Core.Domain;
using OSPSuite.Core.Domain.Services;
using static PKSim.Core.CoreConstants.Compartment;

namespace PKSim.Core.Model
{
   public class IndividualTransporter : IndividualMolecule
   {
      private TransportType _transportType;

      public IndividualTransporter()
      {
         MoleculeType = QuantityType.Transporter;
      }

      /// <summary>
      ///    Transporter type => Direction of transport
      /// </summary>
      public TransportType TransportType
      {
         get => _transportType;
         set => SetProperty(ref _transportType, value);
      }

      public TransporterExpressionContainer BloodCells


 max.x, min.y, max.z, lineWidth, color, shape)
        tryDrawLine(max.x, max.y, min.z, max.x, max.y, max.z, lineWidth, color, shape)
        tryDrawLine(max.x, min.y, max.z, max.x, max.y, max.z, lineWidth, color, shape)

        // connections between 2 quads
        tryDrawLine(min.x, min.y, min.z, max.x, min.y, min.z, lineWidth, color, shape)
        tryDrawLine(min.x, max.y, min.z, max.x, max.y, min.z, lineWidth, color, shape)
        tryDrawLine(min.x, max.y, max.z, max.x, max.y, max.z, lineWidth, color, shape)
        tryDrawLine(min.x, min.y, max.z, max.x, min.y, max.z, lineWidth, color, shape)
    }

    fun drawVoxelShape(shape: Shape, position: Vec3d, lineWidth: Float, color: RGBAColor, margin: Float = 0.0f) {
        val positionedShape = shape + position

        for (aabb in shape) {
            drawAABB(aabb + position, lineWidth, color, margin, positionedShape)
        }
    }
}
/*
 * Minosoft
 * Copyright (C) 2020-2024 Moritz Zwerger
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
 *
 * This software is not affiliated with Mojang AB, the original developer of Minecraft.
 */

package de.bixilon.minosoft.gui.rendering.shader.uniform

import de.bixilon.minosoft.gui.rendering.shader.ShaderSetter
import de.bixilon.minosoft.gui.rendering.system.base.shader.NativeShader
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

class ShaderUniform<T>(
    private val native: NativeShader,
    default: T,
    private val name: String,
    private val setter: ShaderSetter<T>,
) : ReadWriteProperty<Any, T> {
    private var value = default
    private var upload: Boolean = true

    fun upload() {
        if (!upload) {
            return
        }
        forceUpload()
    }

    fun forceUpload() {
        native.use()
        setter.set(native, name, value)
        upload = false
    }

    override fun getValue(thisRef: Any, property: KProperty<*>): T {
        return value
    }

    override fun setValue(thisRef: Any, property: KProperty<*>, value: T) {
        if (this.value == value) {
            return
        }
        this.value = value
        upload = true
        if (Thread.currentThread() == native.context.thread) {
            upload()
        }
    }
}
/*
 * Minosoft
 * Copyright (C) 2020-2025 Moritz Zwerger
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
 *
 * This software is not affiliate


_clearing,
            hill_sphere: 0.0,
            tectonic_activity: false,
            magnetosphere: false,
            has_collision: false,
        };

        for _i in 0..post_accretion_intensity {
            let Planetesimal { a, e, mass, .. } = random_planet;
            let r_inner = inner_effect_limit(&a, &e, &mass);
            let r_outer = outer_effect_limit(&a, &e, &mass);
            let mut outer_body = Planetesimal::random_outer_body(&r_inner, &r_outer, rng);
            planetesimals_intersect(
                &mut outer_body,
                &mut random_planet,
                &stellar_luminosity,
                &stellar_mass,
                rng,
            );
        }

        random_planet.derive_planetary_environment(
            &stellar_luminosity,
            &stellar_mass,
            &main_seq_age,
            &ecosphere,
            rng,
        );

        for moon in random_planet.moons.iter_mut() {
            moon.derive_planetary_environment(
                &stellar_luminosity,
                &random_planet.mass,
                &main_seq_age,
                &ecosphere,
                rng,
            );
        }

        random_planet
    }
}
/// Convert a u64 to usize or error on failure.
macro_rules! to_usize_or_err {
( $( $x:expr ),+ ) => {
        {
            $(
                use core::convert::TryFrom;
                match usize::try_from($x) {
                       Ok(res) => res,
                       Err(e) => return Err(nom::Err::Error(crate::parser::err::SevenZParserError::new(crate::parser::err::SevenZParserErrorKind::ConversionFailure(crate::parser::err::SevenZConversionError::ToUsize(e))))),
               }
            )+
        }
    };
}
<filename>tests/allocate_4mb_of_memory.rs
use std::time::Instant;

use memory_stats::memory_stats;

/// Tests if the reported memory increases
/// reasonably if 4mb of memory is allocated
/// and then used.
///
/// Note that this test will likely fail if
/// smaps is not avaliable on Linux, since
/// the physical memory metric is inaccurate.
#[test]
fn allocate_4mb_of_memory() {
    const FOUR_MB: usize = 4_000_000;
    let initial = memory_stats().unwrap();
    println!("Initial memory usage: {:?}", initial);

    // allocate, but do not use, about 4 kb of memory
    let mut memories = Vec::<u8>::with_capacity(FOUR_MB);
    let after_alloc = memory_stats().unwrap();
    println!("Memory usage after allocating 4mb: {:?}", after_alloc);
    assert!(after_alloc.virtual_mem >= initial.virtual_mem + FOUR_MB);

    // fill the above with non-determinstic data
    let start = Instant::now();
    for _ in 0..FOUR_MB {
        memories.push((Instant::now().duration_since(start).as_nanos() % u8::MAX as u128) as u8);
    }
    let after_fill = memory_stats().unwrap();
    println!("Memory usage after filling 4mb: {:?}", after_fill);
    assert!(after_fill.physical_mem >= initial.physical_mem + FOUR_MB);
}
use instruction_def::*;
use test::run_test;
use Operand::*;
use Reg::*;
use RegScale::*;
use RegType::*;
use {BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};

#[test]
fn movnti_1() {
    run_test(
        &Instruction {
            mnemonic: Mnemonic::MOVNTI,
            operand1: Some(IndirectDisplaced(BP, 5766,


:'pinjam uang',amount:3000}); -->hasil tidak bisa !
console.log(arrayInvoice);
console.log(invoice01.format())
console.log(invoice02.format())

//yang jadi masalah adalah bahwa properti dari class
//bersifat public shingga bisa diakses nilainya dari luar dan
// bisa diganti langsung utk kita akan buat sebgai static
// contoh dibawah ini bisa diubah2

invoice01.client= 'rujak cingur' //mngubah client dari indra ke rujak cingur
console.log(invoice01.format());

/////////////////////
//form
const form = document.querySelector('.new-item-form') as HTMLFormElement;
//input
   const type =document.querySelector('#type') as HTMLSelectElement;
   const tofrom = document.querySelector('#toform') as HTMLInputElement;
   const details = document.querySelector('#details') as HTMLInputElement;
   const amount = document.querySelector('#amount') as HTMLInputElement;

//event
form.addEventListener('submit',(e)=> {
    e.preventDefault();
    console.log(
      type.value,
      tofrom.value,
      details.value ,
      amount.valueAsNumber //value dari js biasanya
      //adalah merupakan text pada element anak form
      //tapi pada ts ini ada value as number yg langsung
      // ubah

    )
})

/*
catatan pwnting tentang class nanti bisa refresh dengan class yg ada di jvascript
sama
jadi class adalah blue print atau cetakan biru ,trdiri atas property
yang berisi dari key dan value jadi propertuy ini merupakan variable
global didalam class,ini defaultnya
nah pada saat cetak atau instansiate maka nilai dari object yg akan dicetak
dimasukan kedalam class melalui passing parameter di constructor yg ada didalam class
construtor sendiri adalah gunanya utk mengisikan nilai object kedalam properti class
atau dgn kata lain meng-assign ke dalam nilai properti class
jadi ketika dicetak object tadi sudah punya value propertinya

contoh :
class Invoice {
 //ini dibawah di sebut properti class
 clients:string,
 details:string,
 amount:number

 constructor(a:string,b:details,c:number)
   //buat constructor passing parameter agar properti dari obj nnti sudah ada
   //nilainya karena dari properti class ini yg diasigned argumen
   //dari object yg akan di cetak
   this.clients = a;
   this.details = b;
   this.details= c;

}
//kita buat metode class

}

*/

import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';

@Component({
  selector: 'app-department-list',
  template: `

Department List

 <button>{{dept.id}}  {{dept.name}} </button>

  `,
  styles: [],

})
export class DepartmentListComponent implements OnInit {

  public selectedId;
  constructor(private router: Router, private route: ActivatedRoute) { }

  ngOnInit(): void {
    this.route.paramMap.subscribe((params:ParamMap)=>{
     let id = parseInt(params.get('id'));
     this.selectedId = id;
    });
  }

  _departme


set"],
					min = -200,
					max = 200,
					step = 1,
				},
			},
		},
		animation = {
			order = 5,
			type = "group",
			inline = true,
			name = L["Animation Duration"],
			args = {
				fadeInTime = {
					order = 1,
					type = "range",
					name = L["Fade In"],
					desc = L["The time of animation. Set 0 to disable animation."],
					min = 0,
					max = 5,
					step = 0.1,
				},
				stayTime = {
					order = 2,
					type = "range",
					name = L["Stay"],
					desc = L["The time of animation. Set 0 to disable animation."],
					min = 0,
					max = 10,
					step = 0.1,
				},
				fadeOutTime = {
					order = 3,
					type = "range",
					name = L["Fade Out"],
					desc = L["The time of animation. Set 0 to disable animation."],
					min = 0,
					max = 5,
					step = 0.1,
				},
			},
		},
		color = {
			order = 6,
			type = "group",
			inline = true,
			name = L["Color"],
			args = {
				classColor = {
					order = 1,
					type = "toggle",
					name = L["Use Class Color"],
				},
				customColor = {
					order = 2,
					type = "color",
					name = L["Custom Color"],
					get = function(info)
						local db = E.db.WT.maps.whoClicked[info[#info]]
						local default = P.maps.whoClicked[info[#info]]
						return db.r, db.g, db.b, nil, default.r, default.g, default.b, nil
					end,
					set = function(info, r, g, b, a)
						local db = E.db.WT.maps.whoClicked[info[#info]]
						db.r, db.g, db.b, db.a = r, g, b, nil
					end,
				},
			},
		},
		font = {
			order = 7,
			type = "group",
			inline = true,
			name = L["Font Setting"],
			get = function(info)
				return E.db.WT.maps.whoClicked.font[info[#info]]
			end,
			set = function(info, value)
				E.db.WT.maps.whoClicked.font[info[#info]] = value
				WC:ProfileUpdate()
			end,
			args = {
				name = {
					order = 1,
					type = "select",
					dialogControl = "LSM30_Font",
					name = L["Font"],
					values = LSM:HashTable("font"),
				},
				style = {
					order = 2,
					type = "select",
					name = L["Outline"],
					values = {
						NONE = L["None"],
						OUTLINE = L["Outline"],
						THICKOUTLINE = L["Thick"],
						SHADOW = L["|cff888888Shadow|r"],
						SHADOWOUTLINE = L["|cff888888Shadow|r Outline"],
						SHADOWTHICKOUTLINE = L["|cff888888Shadow|r Thick"],
						MONOCHROME = L["|cFFAAAAAAMono|r"],
						MONOCHROMEOUTLINE = L["|cFFAAAAAAMono|r Outline"],
						MONOCHROMETHICKOUTLINE = L["|cFFAAAAAAMono|r Thick"],
					},
				},
				size = {
					order = 3,
					name = L["Size"],
					type = "range",
					min = 5,
					max = 60,
					step = 1,
				},
			},
		},
	},
}

options.rectangleMinimap = {
	order = 3,
	type = "group",
	name = L["Rectangle Minimap"],
	get = function(info)
		return E.db.WT.maps.rectangleMinimap[info[#info]]
	end,
	set = function(info, value)
		E.db.WT.maps.rectangleMinimap[info[#info]] = value
		RM:ChangeShape()
	end


em>not support
     * the {@code Entry.setValue} method.
     *
     * @param key the key
     *
     * @throws ClassCastException   {@inheritDoc}
     * @throws NullPointerException if the specified key is null
     */
    // 〖后继〗获取一个结点并将其包装为只读版本的Entry，该结点包含的key，是遍历当前Map时形参key的后继
    public Map.Entry<K, V> higherEntry(K key) {
        return findNearEntry(key, GT, comparator);
    }

    /**
     * Returns a key-value mapping associated with the greatest key
     * less than or equal to the given key, or {@code null} if there
     * is no such key. The returned entry does not support
     * the {@code Entry.setValue} method.
     *
     * @param key the key
     *
     * @throws ClassCastException   {@inheritDoc}
     * @throws NullPointerException if the specified key is null
     */
    // 【前驱】获取一个结点并将其包装为只读版本的Entry，该结点包含的key，是遍历当前Map时形参key的前驱（包括key本身）
    public Map.Entry<K, V> floorEntry(K key) {
        return findNearEntry(key, LT | EQ, comparator);
    }

    /**
     * Returns a key-value mapping associated with the least key
     * greater than or equal to the given key, or {@code null} if
     * there is no such entry. The returned entry does not
     * support the {@code Entry.setValue} method.
     *
     * @throws ClassCastException   {@inheritDoc}
     * @throws NullPointerException if the specified key is null
     */
    // 【后继】获取一个结点并将其包装为只读版本的Entry，该结点包含的key，是遍历当前Map时形参key的后继（包括key本身）
    public Map.Entry<K, V> ceilingEntry(K key) {
        return findNearEntry(key, GT | EQ, comparator);
    }

    /**
     * Removes and returns a key-value mapping associated with
     * the least key in this map, or {@code null} if the map is empty.
     * The returned entry does not support
     * the {@code Entry.setValue} method.
     */
    // 移除遍历当前Map时的首个结点，并将其包装为只读版本的Entry后返回
    public Map.Entry<K, V> pollFirstEntry() {
        return doRemoveFirstEntry();
    }

    /**
     * Removes and returns a key-value mapping associated with
     * the greatest key in this map, or {@code null} if the map is empty.
     * The returned entry does not support
     * the {@code Entry.setValue} method.
     */
    // 移除遍历当前Map时的最后一个结点，并将其包装为只读版本的Entry后返回
    public Map.Entry<K, V> pollLastEntry() {
        return doRemoveLastEntry();
    }

    // 获取当前Map中的key的集合
    public NavigableSet<K> navigableKeySet() {
        KeySet<K, V> ks = keySet;
        if(ks != null) {
            return ks;
        }

        return keySet = new KeySet<>(this);
    }

    // 获取【逆序】Map中的key的集合
    public NavigableSet<K> descendingKeySet() {
        return descendingMap().navigableKeySet();
    }

    /**
     * @throws ClassCastException       {@inheritDoc}
     * @throws NullPointerException     if


`declare module` 的例子中，我们就在声明文件中导入了 `moment`，并且使用了 `moment.CalendarKey` 这个类型：

```ts
// types/moment-plugin/index.d.ts

import * as moment from 'moment';

declare module 'moment' {
    export function foo(): moment.CalendarKey;
}
```

除了可以在声明文件中通过 `import` 导入另一个声明文件中的类型之外，还有一个语法也可以用来导入另一个声明文件，那就是三斜线指令。

#### 三斜线指令

与 `namespace` 类似，三斜线指令也是 ts 在早期版本中为了描述模块之间的依赖关系而创造的语法。随着 ES6 的广泛应用，现在已经不建议再使用 ts 中的三斜线指令来声明模块之间的依赖关系了。

但是在声明文件中，它还是有一定的用武之地。

类似于声明文件中的 `import`，它可以用来导入另一个声明文件。与 `import` 的区别是，当且仅当在以下几个场景下，我们才需要使用三斜线指令替代 `import`：

- 当我们在**书写**一个全局变量的声明文件时
- 当我们需要**依赖**一个全局变量的声明文件时

##### **书写**一个全局变量的声明文件

这些场景听上去很拗口，但实际上很好理解——在全局变量的声明文件中，是不允许出现 `import`, `export` 关键字的。一旦出现了，那么他就会被视为一个 npm 包或 UMD 库，就不再是全局变量的声明文件了。故当我们在书写一个全局变量的声明文件时，如果需要引用另一个库的类型，那么就必须用三斜线指令了[28](https://github.com/xcatliu/typescript-tutorial/tree/master/examples/declaration-files/28-triple-slash-directives)：

```ts
// types/jquery-plugin/index.d.ts

/// <reference types="jquery" />

declare function foo(options: JQuery.AjaxSettings): string;
```

```ts
// src/index.ts

foo({});
```

三斜线指令的语法如上，`///` 后面使用 xml 的格式添加了对 `jquery` 类型的依赖，这样就可以在声明文件中使用 `JQuery.AjaxSettings` 类型了。

注意，三斜线指令必须放在文件的最顶端，三斜线指令的前面只允许出现单行或多行注释。

##### **依赖**一个全局变量的声明文件

在另一个场景下，当我们需要依赖一个全局变量的声明文件时，由于全局变量不支持通过 `import` 导入，当然也就必须使用三斜线指令来引入了[29](https://github.com/xcatliu/typescript-tutorial/tree/master/examples/declaration-files/29-triple-slash-directives-global)：

```ts
// types/node-plugin/index.d.ts


::str_type: return fromBigEndian<uint64_t>(fromHex(_v.get_str()));
    default: return 0;
    }
}

PrecompiledContract createPrecompiledContract(js::mObject const& _precompiled)
{
    auto n = _precompiled.at("name").get_str();
    try
    {
        u256 startingBlock = 0;
        if (_precompiled.count("startingBlock"))
            startingBlock = u256(_precompiled.at("startingBlock").get_str());

        if (!_precompiled.count("linear"))
            return PrecompiledContract(PrecompiledRegistrar::pricer(n), PrecompiledRegistrar::executor(n), startingBlock);

        auto const& l = _precompiled.at("linear").get_obj();
        unsigned base = toUnsigned(l.at("base"));
        unsigned word = toUnsigned(l.at("word"));
        return PrecompiledContract(base, word, PrecompiledRegistrar::executor(n), startingBlock);
    }
    catch (PricerNotFound const&)
    {
        cwarn << "Couldn't create a precompiled contract account. Missing a pricer called:" << n;
        throw;
    }
    catch (ExecutorNotFound const&)
    {
        // Oh dear - missing a plugin?
        cwarn << "Couldn't create a precompiled contract account. Missing an executor called:" << n;
        throw;
    }
}
}

// TODO move AccountMaskObj to libtesteth (it is used only in test logic)
AccountMap dev::eth::jsonToAccountMap(std::string const& _json, u256 const& _defaultNonce,
    AccountMaskMap* o_mask, PrecompiledContractMap* o_precompiled, const fs::path& _configPath)
{
    auto u256Safe = [](std::string const& s) -> u256 {
        bigint ret(s);
        if (ret >= bigint(1) << 256)
            BOOST_THROW_EXCEPTION(
                ValueTooLarge() << errinfo_comment("State value is equal or greater than 2**256"));
        return (u256)ret;
    };

    std::unordered_map<Address, Account> ret;

    js::mValue val;
    json_spirit::read_string_or_throw(_json, val);

    for (auto const& account : val.get_obj())
    {
        Address a(fromHex(account.first));
        auto const& accountMaskJson = account.second.get_obj();

        bool haveBalance = (accountMaskJson.count(c_wei) || accountMaskJson.count(c_finney) ||
                            accountMaskJson.count(c_balance));
        bool haveNonce = accountMaskJson.count(c_nonce);
        bool haveCode = accountMaskJson.count(c_code) || accountMaskJson.count(c_codeFromFile);
        bool haveStorage = accountMaskJson.count(c_storage);
        bool shouldNotExists = accountMaskJson.count(c_shouldnotexist);

        if (haveStorage || haveCode || haveNonce || haveBalance)
        {
            u256 balance = 0;
            if (accountMaskJson.count(c_wei))
                balance = u256Safe(accountMaskJson.at(c_wei).get_str());
            else if (accountMaskJson.count(c_finney))
                balance = u256Safe(accountMaskJson.at(c_finney).get_str()) * finney;
            else if (accountMaskJson.count(c_balance))
                balance = u256Safe(accountMaskJson.at(c_balance).get_str());

            u256 nonce =
                haveNonce ? u256Safe(accountMaskJson.at(c_nonce).get_str()) : _defaultNonce;

            ret[a] = Account(nonce, balance);
            auto codeIt = accountMaskJson.find(c_code);
            if (codeIt


x-input-el;
  }

  .x-field-toggle .x-slider {
    width: $form-thumb-size * 2;
    @if $include-border-radius { @include border-radius($form-thumb-size/2); }
    overflow: hidden;
    border: .1em solid darken($form-light, 15%);
    // -webkit-transform: translate3d(0px, 0px, 0px);
    @include background-gradient($form-light, 'recessed');
    z-index: 2;

    // Masking the slider doesn't work in iOS 3, so we're fake-masking the outer area
    // UPDATED: Doesnt fly on Android...
    // &:after {
    //   @include insertion($form-thumb-size*2, $form-thumb-size, 0, 0);
    //   -webkit-mask: theme_image($theme-name, "trackmask_outer.png");
    //   background-color: white;
    //   -webkit-mask-size: $form-thumb-size*2 $form-thumb-size;
    //   pointer-events: none;
    //   z-index: 4;
    // }

    .x-thumb {

      .x-toggle-thumb-off, .x-toggle-thumb-on {
        display: none;
      }

      &.x-dragging {
        opacity: 1;
      }

      &:before {
        top: ($form-thumb-size - $form-toggle-size) / 2;
      }

      // Actual thumb
      // &:after {
      //   @include insertion($form-thumb-size, $form-thumb-size, 0, 0);
      //   @include box-shadow(rgba(0,0,0,.5) 0 0 .15em);
      //   @if $include-border-radius { @include border-radius($form-thumb-size/2); }
      //   -webkit-transform: scale(.65);
      //   @include background-gradient($complement_light, 'glossy');
      //   border: 1px solid $complement;
      //   overflow: visible;
      //   z-index: 2;
      // }

      // &.x-dragging {
      //   &:after {
      //     -webkit-transform: scale(.75);
      //   }
      // }
      //
      // Used to animate the thumb. class added/removed by javascript when needed.
      // &.x-animate {
      //   -webkit-transition: left .2s ease-in-out;
      // }
    }

    &.x-toggle-on {
      @include background-gradient($confirm-color, 'recessed');
    }
  }

  .x-android .x-field-toggle .x-slider {
    //-webkit-transform: translate(0px, 0px);
  }
}
// Tab icons used with permission from Drew Wilson
// http://pictos.drewwilson.com/
// Pictos icons are (c) 2010 Drew Wilson

@import '../global';

/**
 * @class Ext.tab.Bar
 */

/**
 * @var {boolean} $include-tabbar-uis Optionally disable separate tabbar UIs (light and dark).
 */
$include-tabbar-uis: $include-default-uis !default;

/**
 * @var {boolean} $include-top-tabs
 * Optionally exclude top tab styles by setting to false.
 */
$include-top-tabs: true !default;

/**
 * @var {boolean} $include-bottom-tabs
 * Optionally exclude bottom tab styles by setting to false.
 */
$include-bottom-tabs: true !default;

/**
 * @var {color} $tabs-light
 * Base color for "light" UI tabs.
 */
$tabs-light: desaturate($base-color, 10%) !default;

/**
 * @var {color} $tabs-light-active
 * Active color for "light" UI tabs.
 */
$tabs-light-active: lighten(sa


ron(op_mat, np.eye(2)),
        named_op.to_sparse_matrix([*named_qbs, Qubit("a", 1)]).toarray(),
    )

    # https://github.com/CQCL/tket/issues/294
    P = QubitPauliString({Qubit(0): Pauli.Z, Qubit(1): Pauli.I})
    H = QubitPauliOperator({P: 1})
    assert np.allclose(P.to_sparse_matrix().todense(), H.to_sparse_matrix().todense())

def test_QubitPauliOperator_compression() -> None:
    qbs = [Qubit(i) for i in range(2)]
    qpsXY = QubitPauliString(qbs, [Pauli.X, Pauli.Y])
    qpsZI = QubitPauliString(qbs, [Pauli.Z, Pauli.I])
    qpsYY = QubitPauliString(qbs, [Pauli.Y, Pauli.Y])
    x = Symbol("x")
    op = QubitPauliOperator({qpsXY: 2, qpsZI: 1e-11j * x, qpsYY: 1e-11 * x + 1j})
    op.compress()
    with pytest.raises(KeyError) as errorinfo:
        _ = op[qpsZI]
    assert "(Zq[0], Iq[1])" in str(errorinfo.value)
    assert op[qpsXY] == 2
    assert re(op[qpsYY]) == 0
    assert im(op[qpsYY])
    assert op[qpsYY].subs({x: 0.001}).equals(1.0j)
    assert op[qpsYY].subs({x: 10}).equals(1.0j)

def test_QubitPauliString_serialization() -> None:
    qps0 = QubitPauliString()
    qps1 = QubitPauliString(
        [Qubit(i) for i in range(4)], [Pauli.Y, Pauli.I, Pauli.X, Pauli.Z]
    )
    assert qps0.to_list() == []
    for qps in [qps0, qps1]:
        serializable = qps.to_list()
        assert QubitPauliString.from_list(serializable) == qps
        assert json.loads(json.dumps(serializable)) == serializable

def test_QubitPauliOperator_serialization() -> None:
    qps = [Qubit(i) for i in range(2)]
    qpsXY = QubitPauliString(qps, [Pauli.X, Pauli.Y])
    qpsZI = QubitPauliString(qps, [Pauli.Z, Pauli.I])
    op = QubitPauliOperator({qpsXY: 2.0, qpsZI: 1j})

    serializable = op.to_list()
    assert QubitPauliOperator.from_list(serializable) == op
    assert json.loads(json.dumps(serializable)) == serializable

def test_QubitPauliOperator_serialization_symbolic() -> None:
    # https://github.com/CQCL/tket/issues/614
    qps = [Qubit(i) for i in range(2)]
    qpsXY = QubitPauliString(qps, [Pauli.X, Pauli.Y])
    qpsZI = QubitPauliString(qps, [Pauli.Z, Pauli.I])
    x = Symbol("x")
    op = QubitPauliOperator({qpsXY: 2 * x, qpsZI: 1j})

    serializable = op.to_list()
    assert QubitPauliOperator.from_list(serializable) == op
    assert json.loads(json.dumps(serializable)) == serializable

@given(st.qubitpaulistrings())
def test_QubitPauliString_serialization_hypothesis(qps: QubitPauliString) -> None:
    serializable = qps.to_list()
    assert QubitPauliString.from_list(serializable) == qps
    assert json.loads(json.dumps(serializable)) == serializable

@given(st.qubitpaulioperators())
@settings(deadline=None)
def test_QubitPauliOperator_serialization_hypothesis(ops: QubitPauliOperator) -> None:
    serializable = ops.to_list()
    assert QubitPauliOperator.from_list(serializable) == ops
    assert json.loads(json.dumps(serializable)) == serializable


(
					testAccCheckNewRelicAlertConditionExists("newrelic_alert_condition.foo"),
				),
			},
		},
	})
}

func TestAccNewRelicAlertCondition_FloatThreshold(t *testing.T) {
	t.Skip("Skipping. API has been deprecated and has reached EOL.")

	rName := fmt.Sprintf("tf-test-%s", acctest.RandString(5))
	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckNewRelicAlertConditionDestroy,
		Steps: []resource.TestStep{
			{
				Config: testAccNewRelicAlertConditionConfigThreshold(rName, 0.5),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckNewRelicAlertConditionExists("newrelic_alert_condition.foo"),
				),
			},
		},
	})
}

func TestAccNewRelicAlertCondition_AlertPolicyNotFound(t *testing.T) {
	t.Skip("Skipping. API has been deprecated and has reached EOL.")

	rName := fmt.Sprintf("tf-test-%s", acctest.RandString(5))

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckNewRelicAlertConditionDestroy,
		Steps: []resource.TestStep{
			{
				Config: testAccNewRelicAlertConditionConfig(rName),
			},
			{
				PreConfig: testAccDeleteNewRelicAlertPolicy(rName),
				Config:    testAccNewRelicAlertConditionConfig(rName),
				Check:     testAccCheckNewRelicAlertConditionExists("newrelic_alert_condition.foo"),
			},
		},
	})
}

func TestAccNewRelicAlertCondition_ApplicationScopeWithCloseTimer(t *testing.T) {
	t.Skip("Skipping. API has been deprecated and has reached EOL.")

	rName := fmt.Sprintf("tf-test-%s", acctest.RandString(5))

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckNewRelicAlertConditionDestroy,
		Steps: []resource.TestStep{
			{
				Config:      testAccNewRelicAlertConditionApplicationScopeWithCloseTimerConfig(rName),
				ExpectError: regexp.MustCompile("violation_close_timer only supported for apm_app_metric when condition_scope = 'instance'"),
			},
		},
	})
}

func TestAccNewRelicAlertCondition_InstanceScopeWithCloseTimer(t *testing.T) {
	t.Skip("Skipping. API has been deprecated and has reached EOL.")

	if !nrInternalAccount {
		t.Skipf("New Relic internal testing account required")
	}

	rName := fmt.Sprintf("tf-test-%s", acctest.RandString(5))

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckNewRelicAlertConditionDestroy,
		Steps: []resource.TestStep{
			{
				Config: testAccNewRelicAlertConditionInstanceScopeWithCloseTimerConfig(rName),
			},
		},
	})
}

func TestAccNewRelicAlertCondition_APMJVMMetricApplicationScope(t *testing.T) {
	t.Skip("Skipping. API has been deprecated and has reached EOL.")

	if !nrInternalAccount {
		t.Skipf("New Relic internal testing account required")
	}

	rName := fmt.Sprintf("tf-test-%s", acctest.RandString(5))

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:


t')!,
        type: mapValueOfType<String>(json, r'type')!,
      );
    }
    return null;
  }

  static List<IoK8sApimachineryPkgApisMetaV1WatchEvent>? listFromJson(
    dynamic json, {
    bool growable = false,
  }) {
    final result = <IoK8sApimachineryPkgApisMetaV1WatchEvent>[];
    if (json is List && json.isNotEmpty) {
      for (final row in json) {
        final value = IoK8sApimachineryPkgApisMetaV1WatchEvent.fromJson(row);
        if (value != null) {
          result.add(value);
        }
      }
    }
    return result.toList(growable: growable);
  }

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

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

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

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

import 'package:kubenav/models/kubernetes/io_k8s_api_core_v1_endpoint_address.dart';
import 'package:kubenav/models/kubernetes/io_k8s_api_core_v1_endpoint_port.dart';

class IoK8sApiCoreV1EndpointSubset {
  /// Returns a new [IoK8sApiCoreV1EndpointSubset] instance.
  IoK8sApiCoreV1EndpointSubset({
    this.addresses = const [],
    this.notReadyAddresses = const [],
    this.ports = const [],
  });

  /// IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.
  List<IoK8sApiCoreV1EndpointAddress> addresses;

  /// IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.
  List<IoK8sApiCoreV1EndpointAddress> notReadyAddresses;

  ///


f, 0);

			for (int k = 0; k < Player.maxBuffs; k++)
			{
				player.TPlayer.buffType[k] = 0;
			}

			/*
			 * The following packets are sent twice because the server will not send a packet to a client
			 * if they have not spawned yet if the remoteclient is -1
			 * This is for when players login via uuid or serverpassword instead of via
			 * the login command.
			 */
			NetMessage.SendData(50, -1, -1, NetworkText.Empty, player.Index, 0f, 0f, 0f, 0);
			NetMessage.SendData(50, player.Index, -1, NetworkText.Empty, player.Index, 0f, 0f, 0f, 0);

			NetMessage.SendData(76, player.Index, -1, NetworkText.Empty, player.Index);
			NetMessage.SendData(76, -1, -1, NetworkText.Empty, player.Index);

			NetMessage.SendData(39, player.Index, -1, NetworkText.Empty, 400);

			if (Main.GameModeInfo.IsJourneyMode)
			{
				var sacrificedItems = TShock.ResearchDatastore.GetSacrificedItems();
				for(int i = 0; i < ItemID.Count; i++)
				{
					var amount = 0;
					if (sacrificedItems.ContainsKey(i))
					{
						amount = sacrificedItems[i];
					}

					var response = NetCreativeUnlocksModule.SerializeItemSacrifice(i, amount);
					NetManager.Instance.SendToClient(response, player.Index);
				}
			}
		}
	}
}


row to allow more info to be reported later.
      e.set_pos_if_unset (len, k+1);
      throw;
    }

  return retval;
}

octave_value
octave_char_matrix_str::resize (const dim_vector& dv, bool fill) const
{
  charNDArray retval (matrix);
  if (fill)
    retval.resize (dv, 0);
  else
    retval.resize (dv);
  return octave_value (retval, is_sq_string () ? '\'' : '"');
}

#define CHAR_MATRIX_CONV(TNAME, FCN)                                    \
                                                                        \
  if (! force_string_conv)                                              \
    err_invalid_conversion ("string", TNAME);                           \
                                                                        \
  warn_implicit_conversion ("Octave:str-to-num", "string", TNAME);      \
                                                                        \
  return octave_char_matrix::FCN ()

double
octave_char_matrix_str::double_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("real scalar", double_value);
}

Complex
octave_char_matrix_str::complex_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("complex scalar", complex_value);
}

Matrix
octave_char_matrix_str::matrix_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("real matrix", matrix_value);
}

ComplexMatrix
octave_char_matrix_str::complex_matrix_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("complex matrix", complex_matrix_value);
}

NDArray
octave_char_matrix_str::array_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("real N-D array", array_value);
}

ComplexNDArray
octave_char_matrix_str::complex_array_value (bool force_string_conv) const
{
  CHAR_MATRIX_CONV ("complex N-D array", complex_array_value);
}

string_vector
octave_char_matrix_str::string_vector_value (bool) const
{
  string_vector retval;

  if (matrix.ndims () != 2)
    error ("invalid conversion of charNDArray to string_vector");

  charMatrix chm (matrix);

  octave_idx_type n = chm.rows ();

  retval.resize (n);

  for (octave_idx_type i = 0; i < n; i++)
    retval[i] = chm.row_as_string (i);

  return retval;
}

std::string
octave_char_matrix_str::string_value (bool) const
{
  if (matrix.ndims () != 2)
    error ("invalid conversion of charNDArray to string");

  charMatrix chm (matrix);

  // FIXME: Is this correct?
  return chm.row_as_string (0);
}

Array<std::string>
octave_char_matrix_str::cellstr_value (void) const
{
  Array<std::string> retval;

  if (matrix.ndims () != 2)
    error ("cellstr: cannot convert multidimensional arrays");

  const charMatrix chm (matrix);
  octave_idx_type nr = chm.rows ();
  retval.clear (nr, 1);
  for (octave_idx_type i = 0; i < nr; i++)
    retval.xelem (i) = chm.row_as_string (i);

  return retval;
}

void
octave_char_matrix_str::print_raw (std::ostream& os,
                                   bool pr_as_read_syntax) const
{
  octave_print_internal (os, matrix, pr_as_read_syntax,
                         current_print_indent_level (), true);
}

void
octave_char_ma


native_lsp = {
          enabled = true,
          underlines = {
            errors = { "undercurl" },
            hints = { "undercurl" },
            warnings = { "undercurl" },
            information = { "undercurl" },
          },
        },
        navic = { enabled = true, custom_bg = "lualine" },
        neotest = true,
        neotree = true,
        semantic_tokens = true,
        telescope = true,
        treesitter = true,
        treesitter_context = true,
        which_key = true,
      },
    },
  },
}


 static const enum AVPixelFormat pix_fmts[] = {
        AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
    };

    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
    return 0;
}

static int request_frame(AVFilterLink *outlink)
{
    MPTestContext *test = outlink->src->priv;
    AVFrame *picref;
    int w = WIDTH, h = HEIGHT,
        cw = FF_CEIL_RSHIFT(w, test->hsub), ch = FF_CEIL_RSHIFT(h, test->vsub);
    unsigned int frame = outlink->frame_count;
    enum test_type tt = test->test;
    int i;

    if (test->max_pts >= 0 && test->pts > test->max_pts)
        return AVERROR_EOF;
    picref = ff_get_video_buffer(outlink, w, h);
    if (!picref)
        return AVERROR(ENOMEM);
    picref->pts = test->pts++;

    // clean image
    for (i = 0; i < h; i++)
        memset(picref->data[0] + i*picref->linesize[0], 0, w);
    for (i = 0; i < ch; i++) {
        memset(picref->data[1] + i*picref->linesize[1], 128, cw);
        memset(picref->data[2] + i*picref->linesize[2], 128, cw);
    }

    if (tt == TEST_ALL && frame%30) /* draw a black frame at the beginning of each test */
        tt = (frame/30)%(TEST_NB-1);

    switch (tt) {
    case TEST_DC_LUMA:       dc_test(picref->data[0], picref->linesize[0], 256, 256, frame%30); break;
    case TEST_DC_CHROMA:     dc_test(picref->data[1], picref->linesize[1], 256, 256, frame%30); break;
    case TEST_FREQ_LUMA:   freq_test(picref->data[0], picref->linesize[0], frame%30); break;
    case TEST_FREQ_CHROMA: freq_test(picref->data[1], picref->linesize[1], frame%30); break;
    case TEST_AMP_LUMA:     amp_test(picref->data[0], picref->linesize[0], frame%30); break;
    case TEST_AMP_CHROMA:   amp_test(picref->data[1], picref->linesize[1], frame%30); break;
    case TEST_CBP:          cbp_test(picref->data   , picref->linesize   , frame%30); break;
    case TEST_MV:            mv_test(picref->data[0], picref->linesize[0], frame%30); break;
    case TEST_RING1:      ring1_test(picref->data[0], picref->linesize[0], frame%30); break;
    case TEST_RING2:      ring2_test(picref->data[0], picref->linesize[0], frame%30); break;
    }

    return ff_filter_frame(outlink, picref);
}

static const AVFilterPad mptestsrc_outputs[] = {
    {
        .name          = "default",
        .type          = AVMEDIA_TYPE_VIDEO,
        .request_frame = request_frame,
        .config_props  = config_props,
    },
    { NULL }
};

AVFilter ff_vsrc_mptestsrc = {
    .name          = "mptestsrc",
    .description   = NULL_IF_CONFIG_SMALL("Generate various test pattern."),
    .priv_size     = sizeof(MPTestContext),
    .priv_class    = &mptestsrc_class,
    .init          = init,
    .query_formats = query_formats,
    .inputs        = NULL,
    .outputs       = mptestsrc_outputs,
};


T) {
									resp, err := testDummyAppConn(fmt.Sprintf("https://%v", rootProxyAddr.Addr), clientCert)
									require.NoError(t, err)
									resp.Body.Close()
									require.Equal(t, http.StatusOK, resp.StatusCode)
									require.Equal(t, app.name, resp.Header.Get("Server"))
								}, 5*time.Second, 50*time.Millisecond)

								// Verify that the app.session.start event was emitted.
								if app.cluster == "root" {
									require.EventuallyWithT(t, func(t *assert.CollectT) {
										now := time.Now()
										ctx := context.Background()
										es, _, err := rootAuthServer.SearchEvents(ctx, events.SearchEventsRequest{
											From:       now.Add(-time.Hour),
											To:         now.Add(time.Hour),
											Order:      types.EventOrderDescending,
											EventTypes: []string{events.AppSessionStartEvent},
										})
										require.NoError(t, err)

										for _, e := range es {
											require.Equal(t, e.(*apievents.AppSessionStart).AppName, app.name)
											return
										}
										t.Errorf("failed to find AppSessionStartCode event (0/%d events matched)", len(es))
									}, 5*time.Second, 500*time.Millisecond)
								}
								// app logout.
								err = Run(ctx, []string{
									"app",
									"logout",
									"--cluster", app.cluster,
								}, setHomePath(loginPath))
								require.NoError(t, err)
							})

							// Test connecting to the app through a local proxy.
							t.Run("tsh proxy app", func(t *testing.T) {
								localProxyPort := ports.Pop()
								proxyCtx, proxyCancel := context.WithTimeout(ctx, 10*time.Second)
								defer proxyCancel()

								errC := make(chan error)
								go func() {
									errC <- Run(proxyCtx, []string{
										"--insecure",
										"proxy",
										"app",
										app.name,
										"--port", localProxyPort,
										"--cluster", app.cluster,
									}, setHomePath(loginPath), webauthnLoginOpt)
								}()

								assert.EventuallyWithT(t, func(t *assert.CollectT) {
									resp, err := testDummyAppConn(fmt.Sprintf("http://127.0.0.1:%v", localProxyPort))
									if !assert.NoError(t, err) {
										return
									}
									assert.Equal(t, http.StatusOK, resp.StatusCode)
									assert.Equal(t, app.name, resp.Header.Get("Server"))
									resp.Body.Close()
								}, 10*time.Second, 20*time.Millisecond)

								proxyCancel()
								assert.NoError(t, <-errC)

								// proxy certs should not be saved to disk if mfa was used..
								if requireMFAType == types.RequireMFAType_SESSION {
									err = Run(context.Background(), []string{
										"app",
										"config",
										app.name,
										"--cluster", app.cluster,
									}, setHomePath(loginPath))
									assert.True(t, trace.IsNotFound(err), "expected not found error but got: %v", err)
								}
							})
						})
					}
				})
			}
		})
	}
}

func TestFormatAppConfig(t *testing.T) {
	t.Parallel()

	defaultTc := &client.TeleportClient{
		Config: client.Config{
			SiteName:     "root",
			WebPr


ING: Each function/entry in this table must be <= 16 bytes.
 *          Be very careful when adding instructions.
 *
 * C Prototype:
 *       void asm_idtvec_table(void) { asm_interrupt(); }
 */
.align 16
ENTRY(asm_idtvec_table)
	vector=0
	.rept NUM_IDT_ENTRIES
		.if vector<=7||vector==9||vector==15||vector==16||vector>=18
		pushq $0		/* push dummy error_code */
		.endif
		pushq $vector		/* push vector # into RDI slot */
		jmp asm_interrupt	/* call common handler */

		/* Move onto next entry in table*/
		.align 16
		vector=vector+1
	.endr
END(asm_idtvec_table)

/**
 * Reload gs selector with e


("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 *
	 * 查询字典表的分组统计总条数
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * dateFormatType	日期格式化类型   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/newSelectDateGroupCount")
	public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化类型不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
		return R.ok().put("data", result);
	}
/**
 * 饼状图
 * -- 饼状图  查询当前表
 -- 				查询字典表【月】
 -- 				 统计   -- 查询某个月的每个类型的订单销售数量
 -- 				 求和   -- 查询某个月的每个类型的订单销售额
 -- 				查询某个字符串【月】
 -- 				 统计   -- 查询某个月的每个员工的订单销售数量
 -- 				 求和   -- 查询某个月的每个员工的订单销售额
 -- 				查询时间【年】
 -- 				 统计 	-- 查询每个月的订单销售数量
 -- 				 求和 	-- 查询每个月的订单销售额
 -- 饼状图  查询级联表
 -- 				查询字典表
 -- 				 统计  	-- 查询某个月的每个类型的订单销售数量
 -- 				 求和   -- 查询某个月的每个类型的订单销售额
 -- 				查询某个字符串
 -- 				 统计   -- 查询某个月的每个员工的订单销售数量
 -- 				 求和   -- 查询某个月的每个员工的订单销售额
 -- 				查询时间
 -- 				 统计 	-- 统计每个月的订单销售数量
 -- 				 求和 	-- 查询每个月的订单销售额
 */

/**
 * 柱状图
 -- 柱状图  查询当前表
 --             某个【年，月】
 -- 			 当前表 2 级联表 1
 -- 						统计
 --   						【日期，字符串，下拉框】
 -- 						求和
 --   						【日期，字符串，下拉框】
 -- 柱状图  查询级联表
 -- 					某个【年，月】
 -- 						统计
 --


wnerFilter, darkKnobImage, numberOfImages, DELAYTIME);
    delaySyncButton = addNormalButton(this->controlAccordeonTab, 288, 186, ownerFilter, buttonImage, false, DELAYSYNC);
    delayFactorLButton = addNormalButton(this->controlAccordeonTab, 338, 176, ownerFilter, buttonImage, false, DELAYFACTORL);
    delayFactorRButton = addNormalButton(this->controlAccordeonTab, 338, 196, ownerFilter, buttonImage, false, DELAYFACTORR);
    delayHighShelfKnob = addNormalKnob(this->controlAccordeonTab, 388, 179, ownerFilter, darkKnobImage, numberOfImages, DELAYHIGHSHELF);
    delayLowShelfKnob = addNormalKnob(this->controlAccordeonTab, 439, 179, ownerFilter, darkKnobImage, numberOfImages, DELAYLOWSHELF);
    delayFeedbackKnob = addNormalKnob(this->controlAccordeonTab, 490, 179, ownerFilter, darkKnobImage, numberOfImages, DELAYFEEDBACK);

    // chorus
    chorus1Button = addNormalButton(this->controlAccordeonTab, 38, 129, ownerFilter, buttonImage, false, CHORUS1ENABLE);
	chorus2Button = addNormalButton(this->controlAccordeonTab, 95, 129, ownerFilter, buttonImage, false, CHORUS2ENABLE);

    // others
    oscBitcrusherKnob = addNormalKnob(this->controlAccordeonTab, 65, 179, ownerFilter, darkKnobImage, numberOfImages, OSCBITCRUSHER);

    this->accordeonTabContainer->add(this->controlAccordeonTab);

    // Logo Panel
    // ------------------------------------------
    this->logoPanel = new LogoPanel(internalCachedBackgroundImage, 1100, 60);

	// Version info
	versionLabel = new Label("Version Info", "V 3.22");
	versionLabel->setBounds(235, 15, 200, 20);
	versionLabel->setColour(Label::textColourId, Colour((juce::uint8)100, (juce::uint8)100, (juce::uint8)100, 0.9f));
    this->logoPanel->addAndMakeVisible(versionLabel);

    infoText = new Label("Info Text", "-");
    infoText->setBounds(480, 30, 62, 20);
    infoText->setJustificationType(juce::Justification::centred);
    infoText->setColour(Label::textColourId, Colour::greyLevel(0.8f));
    infoText->setColour(Label::backgroundColourId, Colour((juce::uint8)100, (juce::uint8)100, (juce::uint8)100, (juce::uint8)0));
    this->logoPanel->addAndMakeVisible(infoText);

    loadButton = addNormalButton(this->logoPanel, 544, -13, ownerFilter, loadButtonImage, true, PRESETLOAD);
    saveButton = addNormalButton(this->logoPanel, 544, 8, ownerFilter, saveButtonImage, true, PRESETSAVE);

    panicButton = addNormalButton(this->logoPanel, 620, 5, ownerFilter, buttonImage, true, PANIC);
    this->accordeonTabContainer->add(this->logoPanel);

    this->setBufferedToImage(true);

    this->updateParametersFromFilter();

    ownerFilter->addChangeListener (this);

    this->envelopeEditorAccordeonTab->addListener (this);
    this->synth1AccordeonTab->addListener (this);
    this->synth2AccordeonTab->addListener (this);
    this->controlAccordeonTab->addListener (this);

    this->accordeonTabContainer->resizeComponent();
    this->addAndMakeVisible(this->accordeonTabContainer);

    this->accordeonTabContainer->resizeTabs(true);
    this->resized();
}

TalComponent::~TalComponent


ailyIssueEndTime == null) {
			throw new EventTimeException(EVENT_TIME_IS_NULL.formatted(dailyIssueStartTime, dailyIssueEndTime));
		}
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");

		LocalTime startTime = LocalTime.parse(dailyIssueStartTime, formatter);
		LocalTime endTime = LocalTime.parse(dailyIssueEndTime, formatter);

		/**
		 * 요청 시간이 dailyIssueStartTime과 dailyIssueEndTime 사이에 있는지 확인
		 * Duration.between(a,b) : a와 b 사이의 시간을 반환, a가 b보다 시간상으로 이전이면 양수, 이후면 음수
		 */
		Duration startDuration = Duration.between(startTime, requestTime.toLocalTime());
		Duration endDuration = Duration.between(requestTime.toLocalTime(), endTime);

		return (startDuration.isZero() || !startDuration.isNegative()) &&
			(endDuration.isZero() || !endDuration.isNegative());
	}

	/**
	 * 이벤트 발급 기간 및 시간 검증
	 *
	 * @param localDateTime
	 * @throws EventPeriodException 이벤트 기간이 아닐 경우
	 * @throws EventTimeException 이벤트 시간이 아닐 경우
	 */
	public void availableIssuePeriodAndTime(LocalDateTime localDateTime) {
		if (!availableIssueDate(localDateTime)) {
			throw new EventPeriodException(INVALID_EVENT_PERIOD.formatted(startDate, endDate));
		}
		if (!availableIssueTime(localDateTime)) {
			throw new EventTimeException(INVALID_EVENT_TIME.formatted(dailyIssueStartTime, dailyIssueEndTime));
		}
	}
}
package com.flab.offcoupon.repository.redis;

import java.util.concurrent.TimeUnit;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Repository
public class RedisRepository {

	private final RedisTemplate<String, Object> redisTemplate;

	/**
	 * Redis INCR 명령어: 키의 값을 1 증가시킵니다.
	 * @param key 카운팅할 키
	 * @return 카운팅된 값
	 */
	public Long increment(String key) {
		return redisTemplate.opsForValue().increment(key);
	}

	/**
	 * TTL(Time To Live)을 조회합니다.
	 * @param key TTL을 조회할 키
	 **/
	public Long getTTL(String key) {
		return redisTemplate.getExpire(key);
	}

	/**
	 * TTL(Time To Live)을 설정합니다.
	 * @param key TTL을 설정할 키
	 * @param timeout TTL 시간
	 * @param timeUnit TTL 단위
	 **/
	public void setTTL(String key, long timeout, TimeUnit timeUnit) {
		redisTemplate.expire(key, timeout, timeUnit);
	}

	/**
	 * Redis PUBLISH 명령어: 메시지를 특정 채널로 발행합니다.
	 * @param topic 채널
	 * @param message 발행할 메시지
	 */
	public void publish(String topic, Object message) {
		redisTemplate.convertAndSend(topic, message);
	}

	/**
	 * Redis GET 명령어 : 특정 키에 대한 값을 조회합니다.[테스트 코드에서 사용]
	 * @param key 조회할 키
	 * @return 조�


o::Alternate<$txaf, Input<Floating>>>, $rx<crate::gpio::Alternate<$rxaf, Input<Floating>>>) {}
            impl crate::can::Pins for ($tx<crate::gpio::Alternate<$txaf, Input<Floating>>>, $rx<crate::gpio::Alternate<$rxaf, Input<Floating>>>) {
                type Instance = $PER;
            }
        )+
    }
}

mod common_pins {
    use crate::gpio::{
        gpioa::{PA11, PA12},
        gpiob::{PB8, PB9},
        gpiod::{PD0, PD1},
        Floating, Input, AF9,
    };
    use crate::pac::CAN1;

    // All STM32L4 models with CAN support these pins
    pins! {
        CAN1 => (PA12<AF9>, PA11<AF9>),
        CAN1 => (PD1<AF9>, PD0<AF9>),
        CAN1 => (PB9<AF9>, PB8<AF9>),
    }
}

#[cfg(feature = "stm32l4x1")]
mod pb13_pb12_af10 {
    use crate::gpio::{
        gpiob::{PB12, PB13},
        Floating, Input, AF10,
    };
    use crate::pac::CAN1;
    pins! { CAN1 => (PB13<AF10>, PB12<AF10>), }
}

/// Enable/disable peripheral
pub trait Enable: sealed::Sealed {
    /// Enables this peripheral by setting the associated enable bit in an RCC enable register
    fn enable(apb: &mut APB1R1);
}

impl crate::can::sealed::Sealed for crate::pac::CAN1 {}

impl crate::can::Enable for crate::pac::CAN1 {
    #[inline(always)]
    fn enable(apb: &mut APB1R1) {
        // Enable peripheral clock
        apb.enr().modify(|_, w| w.can1en().set_bit());
        apb.rstr().modify(|_, w| w.can1rst().set_bit());
        apb.rstr().modify(|_, w| w.can1rst().clear_bit());
    }
}

/// Interface to the CAN peripheral.
pub struct Can<Instance, Pins> {
    can: Instance,
    pins: Pins,
}

impl<Instance, P> Can<Instance, P>
where
    Instance: Enable,
    P: Pins<Instance = Instance>,
{
    /// Creates a CAN interface.
    pub fn new(apb: &mut APB1R1, can: Instance, pins: P) -> Can<Instance, P> {
        Instance::enable(apb);
        Can { can, pins }
    }

    // Split the peripheral back into its components.
    pub fn split(self) -> (Instance, P) {
        (self.can, self.pins)
    }
}

unsafe impl<Pins> bxcan::Instance for Can<CAN1, Pins> {
    const REGISTERS: *mut bxcan::RegisterBlock = CAN1::ptr() as *mut _;
}

unsafe impl<Pins> bxcan::FilterOwner for Can<CAN1, Pins> {
    const NUM_FILTER_BANKS: u8 = 14;
}

unsafe impl<Pins> bxcan::MasterInstance for Can<CAN1, Pins> {}
use futures::TryFutureExt;
use tokio::time::error::Elapsed;
use tonic_health::proto::{
    health_check_response::ServingStatus as ServingStatusProto,
    health_client::HealthClient as HealthClientProto,
    HealthCheckRequest as HealthCheckRequestProto,
};

#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum HealthcheckError {
    #[error("not found {0}")]
    NotFound(String),

    #[error("healthcheck failed {0}")]
    HealthcheckFailed(String),
}

#[non_exhaustive]
#[derive(Debug)]
pub enum HealthcheckStatus {
    Serving,
    NotServing,
    Unknown,
}

#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum


ctx context.Context, host *device.Instance, target *device.Instance, handler interface{}) error {
	info, err := w.jobs.GetWorker(ctx, host, target, w.op)
	if err != nil {
		return err
	}
	entry := &Worker{
		Info:    info,
		handler: event.AsHandler(ctx, handler),
		tasks:   make(chan taskEntry),
	}
	go entry.run(ctx)
	w.entries = append(w.entries, entry)
	return nil
}

// Find searches the live worker set to find the one that is managing a given target device.
func (w *Workers) Find(ctx context.Context, device string) *Worker {
	for _, entry := range w.entries {
		if entry.Info.Target == device {
			return entry
		}
	}
	return nil
}

func (w *Worker) run(ctx context.Context) {
	for e := range w.tasks {
		e.result <- w.handler(ctx, e.task)
		close(e.result)
	}
}

func (w *Worker) send(ctx context.Context, task Task) error {
	if w == nil {
		return log.Err(ctx, nil, "No worker for device")
	}
	result := make(chan error)
	w.lock.Lock()
	if w.tasks != nil {
		w.tasks <- taskEntry{task: task, result: result}
	}
	w.lock.Unlock()
	err := <-result
	if err != nil {
		w.lock.Lock()
		if w.tasks != nil {
			close(w.tasks)
			w.tasks = nil
		}
		w.lock.Unlock()
	}
	return err
}
// Copyright (C) 2017 Google 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.

package local

import (
	"context"
	"reflect"
	"sync"

	"github.com/google/gapid/core/event"
	"github.com/google/gapid/core/log"
	"github.com/google/gapid/test/robot/search"
	"github.com/google/gapid/test/robot/search/eval"
	"github.com/google/gapid/test/robot/stash"
)

var entityClass = reflect.TypeOf(&stash.Entity{})

type entityIndex struct {
	mu       sync.Mutex
	entities []*stash.Entity
	byID     map[string]*stash.Entity
	onAdd    event.Broadcast
}

func (i *entityIndex) init() {
	i.entities = []*stash.Entity{}
	i.byID = map[string]*stash.Entity{}
}

func (i *entityIndex) lockedAddEntry(ctx context.Context, entity *stash.Entity) {
	i.entities = append(i.entities, entity)
	i.byID[entity.Upload.Id] = entity
	if err := i.onAdd.Send(ctx, entity); err != nil {
		log.E(ctx, "Stash notification failed. Error: %v", err)
	}
}

func (e *entityIndex) Lookup(ctx context.Context, id string) (*stash.Entity, error) {
	e.mu.Lock()
	defer e.mu.Unlock()

	entity, found := e.byID[id]
	if !found {
		return nil, stash.ErrEntityNotFound
	}
	return entity, nil
}

func (e *entityIndex) Search(ctx context.Context, query *search.Query, handler stash.EntityHandler) error {
	filter := eval.Filter(ctx, query, entityClass, eve


d_list_t which stands for the list of collectors of the priority collection
 */
linked_list_t *priority_collectors_get_list(priority_collectors_t *priority_collectors_ptr);

/**
 * @brief returns the priority of the priority collection
 *
 * @param priority_collectors_ptr  the priority collection
 *
 * @return A @c COLLECTOR_PRIORITY which stands for the priority of the priority collection
 */
collector_priority_t priority_collectors_get_priority(priority_collectors_t *priority_collectors_ptr);

/**
 * @brief returns the priority of the current collector collection
 *
 * @param priority_collectors_ptr    the priority collection
 *
 * @return A @c collector_t* which stands for the current collector of the priority collection
 */
collector_t *priority_collectors_get_current_collector(priority_collectors_t *priority_collectors_ptr);

/**
 * @brief sets the current collector iterator
 *
 * @param priority_collectors_ptr    the priority collection
 * @param collector_ptr              the collector to be replaced as current
 */
void priority_collectors_set_current_collector(priority_collectors_t *priority_collectors_ptr, collector_t *collector_ptr);

/**
 * @brief searches for the next non-empty collector
 *
 * @param priority_collectors_ptr    the priority collection
 *
 * This function iterates through the priority collection and goes to the begining in case it reached the end
 *
 * @return A @c collector_t* indicating the position of the next cyclic collector.
 */
collector_t *priority_collectors_get_next_cyclic_collector(priority_collectors_t *priority_collectors_ptr);

#endif /* IOTSECURITY_COLLECTOR_COLLECTION_H */


/* $Header$ */
/*
 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 * See the copyright notice in the ACK home directory, in the file "Copyright".
 */
/* Integer to String translator
	-> base is a value from [-16,-2] V [2,16]
	-> base < 0: see 'val' as unsigned value
	-> no checks for buffer overflow and illegal parameters
	(1985, EHB)
*/

#define MAXWIDTH 32

char *
long2str(val, base)
	register long val;
	register base;
{
	static char numbuf[MAXWIDTH];
	static char vec[] = "0123456789ABCDEF";
	register char *p = &numbuf[MAXWIDTH];
	int sign = (base > 0);

	*--p = '\0';		/* null-terminate string	*/
	if (val) {
		if (base > 0) {
			if (val < 0L) {
				long v1 = -val;
				if (v1 == val)
					goto overflow;
				val = v1;
			}
			else
				sign = 0;
		}
		else
		if (base < 0) {			/* unsigned */
			base = -base;
			if (val < 0L) {	/* taken from Amoeba src */
				register mod, i;
			overflow:
				mod = 0;
				for (i = 0; i < 8 * sizeof val; i++) {
					mod <<= 1;
					if (val < 0)
						mod++;
					val <<= 1;
					if (mod >= base) {
						mod -= base;
						val++;
					}
				}
				*--p = vec[mod];
			}
		}
		do {
			*--p = vec[(int) (val % base)];
			val /= base;
		} while (val != 0L);
		if (sign)
			*--p = '-';	/* don't forget it !!	*/
	}
	else
		*--p = '0';		/* just a simple 0	*/
	return p;
}


img class="mr2" src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/64D2oSodAjCSr4ZsFdqza7/ed56e59a206a6ba9ca6dc8b09aff39c2/cloudflare-argo-tunnel-with-rust-and-raspberry-pi.png" alt="">

Yesterday Cloudflare launched Argo Tunnel. In the words of the product team:

Argo Tunnel exposes applications running on your local web server, on any network with an Internet connection, without adding DNS records or configuring a firewall or router. It just works.

Once I grokked this, the first thing that came to mind was that I could actually use one of my Raspberry Pi's sitting around to serve a website, without:

A flaky DDNS running on my router

Exposing my home network to the world

A cloud VM

Ooooh... so exciting.

The Rig

			<svg width="16" height="16" viewBox="0 0 24 24">
				<path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path>
			</svg>

I'll assume you already have a Raspberry Pi with Raspbian on it.

Plug the Pi into your router. It should now have an IP address. Look that up in your router’s admin UI:

		<img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6nD8bAb7meAZ3X44R4o8YJ/632c6a588761b86e7c7be9f9e87f8c0e/devices.png" alt="Attached devices" class="kg-image" width="747"


); d.stop(val) }
    0x11 => { let imm = fetchw(d); d.ld16(Reg16Dir(DE), Imm16(imm)) }
    0x12 => d.ld8(Reg16Ind8(DE), Reg8Dir(A)),
    0x13 => d.inc16(Reg16Dir(DE)),
    0x14 => d.inc8(Reg8Dir(D)),
    0x15 => d.dec8(Reg8Dir(D)),
    0x16 => { let imm = d.fetch(); d.ld8(Reg8Dir(D), Imm8(imm)) }
    0x17 => d.rla(),

    0x18 => { let imm = d.fetch(); d.jr(CondNone, imm as i8) }
    0x19 => d.add16(Reg16Dir(HL), Reg16Dir(DE)),
    0x1a => d.ld8(Reg8Dir(A), Reg16Ind8(DE)),
    0x1b => d.dec16(Reg16Dir(DE)),
    0x1c => d.inc8(Reg8Dir(E)),
    0x1d => d.dec8(Reg8Dir(E)),
    0x1e => { let imm = d.fetch(); d.ld8(Reg8Dir(E), Imm8(imm)) }
    0x1f => d.rra(),

    // 0x20
    0x20 => { let imm = d.fetch(); d.jr(CondNZ, imm as i8) }
    0x21 => { let imm = fetchw(d); d.ld16(Reg16Dir(HL), Imm16(imm)) }
    0x22 => d.ld8(Reg16Ind8Inc(HL), Reg8Dir(A)),
    0x23 => d.inc16(Reg16Dir(HL)),
    0x24 => d.inc8(Reg8Dir(H)),
    0x25 => d.dec8(Reg8Dir(H)),
    0x26 => { let imm = d.fetch(); d.ld8(Reg8Dir(H), Imm8(imm)) }
    0x27 => d.daa(),

    0x28 => { let imm = d.fetch(); d.jr(CondZ, imm as i8) }
    0x29 => d.add16(Reg16Dir(HL), Reg16Dir(HL)),
    0x2a => d.ld8(Reg8Dir(A), Reg16Ind8Inc(HL)),
    0x2b => d.dec16(Reg16Dir(HL)),
    0x2c => d.inc8(Reg8Dir(L)),
    0x2d => d.dec8(Reg8Dir(L)),
    0x2e => { let imm = d.fetch(); d.ld8(Reg8Dir(L), Imm8(imm)) }
    0x2f => d.cpl(),

    // 0x30
    0x30 => { let imm = d.fetch(); d.jr(CondNC, imm as i8) }
    0x31 => { let imm = fetchw(d); d.ld16(Reg16Dir(SP), Imm16(imm)) }
    0x32 => d.ld8(Reg16Ind8Dec(HL), Reg8Dir(A)),
    0x33 => d.inc16(Reg16Dir(SP)),
    0x34 => d.inc8(Reg16Ind8(HL)),
    0x35 => d.dec8(Reg16Ind8(HL)),
    0x36 => { let imm = d.fetch(); d.ld8(Reg16Ind8(HL), Imm8(imm)) }
    0x37 => d.scf(),

    0x38 => { let imm = d.fetch(); d.jr(CondC, imm as i8) }
    0x39 => d.add16(Reg16Dir(HL), Reg16Dir(SP)),
    0x3a => d.ld8(Reg8Dir(A), Reg16Ind8Dec(HL)),
    0x3b => d.dec16(Reg16Dir(SP)),
    0x3c => d.inc8(Reg8Dir(A)),
    0x3d => d.dec8(Reg8Dir(A)),
    0x3e => { let imm = d.fetch(); d.ld8(Reg8Dir(A), Imm8(imm)) }
    0x3f => d.ccf(),

    // 0x40-0x70
    0x40...0x75