function Register()

    module.Name = 'Komikast'
    module.Language = 'indonesian'
    module.Adult = false

    module.Domains.Add('komikcast.com')
    module.Domains.Add('komikcast.lol')

end

local function CleanTitle(title)

    return tostring(title):before(' Bahasa Indonesia')

end

function GetInfo()

    info.Title = CleanTitle(dom.SelectValue('//h1'))
    info.AlternativeTitle = dom.SelectValue('//span[contains(@class,"komik_info-content-native")]')
    info.Tags = dom.SelectValues('//span[contains(@class,"komik_info-content-genre")]/a')
    info.DateReleased = dom.SelectValue('//b[contains(text(),"Released:")]/fo


:100px}.addressKeysView-email,.addressKeysView-toggle{float:left}.addressKeysView-toggle{width:30px}.addressKeysView-email{width:calc(100% - 30px)}.addressKeysView-container.address [data-display-mode=user],.addressKeysView-container.user [data-display-mode=address]{display:none}.pm_toolbar{-webkit-box-shadow:inset 0 -1px 0 #acb0bf;box-shadow:inset 0 -1px 0 #acb0bf;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;padding:10px}.pm_toolbar.pm_toolbar_withSelector{padding:10px 10px 10px 4px}.toolbarDesktop-container{height:56px;position:relative;z-index:8;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.toolbarDesktop-container .toolbarDesktop-actions-right{display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:auto}.toolbarDesktop-container .pm_checkbox{float:left;display:block;height:34px;line-height:34px;margin:0}.toolbarDesktop-container .fa-check-square,.toolbarDesktop-container .fa-square-o,.toolbarDesktop-container .pm_checkbox{float:left}.toolbarDesktop-container .fa-check-square,.toolbarDesktop-container .fa-square-o{margin:0 5px}.toolbarDesktop-container .layout a img{display:block;height:16px;width:16px;position:relative}.toolbarMobile-container{height:70px;padding:10px}.toolbarMobile-container .pm_buttons,.toolbarMobile-container .pm_buttons a{height:48px}.toolbarMobile-container .pm_buttons a{padding:0 8px}.toolbarMobile-container>.pm_buttons,.toolbarMobile-container>.pull-right{margin-top:0}.toolbarMobile-container .pm_checkbox{float:left;margin-right:10px;padding-top:10px}.toolbarMobile-container .pm_checkbox input[type=checkbox]{margin:0}.toolbarMobile-container .pm_buttons{position:static}.toolbarMobile-container .pm_dropdown{left:0!important;right:0!important;top:134px;width:100%;z-index:888}.tooltip.tour .tooltip-inner{background-color:#34cc69;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.tooltip.tour.top-left .tooltip-arrow,.tooltip.tour.top-right .tooltip-arrow,.tooltip.tour.top .tooltip-arrow{border-top-color:#34cc69}.tooltip.tour.right .tooltip-arrow{border-right-color:#34cc69}.tooltip.tour.left .tooltip-arrow{border-left-color:#34cc69}.tooltip.tour.bottom-left .tooltip-arrow,.tooltip.tour.bottom-right .tooltip-arrow,.tooltip.tour.bottom .tooltip-arrow{border-bottom-color:#34cc69}.appConfigBody-tourActive .sidebarApp-link[href="/labels"]{overflow:visible}#pm_wizard{position:fixed;left:0;bottom:0;right:0;z-index:9999;-webkit-box-shadow:0 -1rem 1rem rgba(0,0,0,.1);box-shadow:0 -1rem 1rem rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;background:#fff;padding:2rem 14rem 2rem 8rem}#pm_wizard [class^=step-]{display:none}#pm_wizard .close{display:block;position:absolute;right:0;top:0;padding:0 1rem;background:inherit;border:0;line-height:2rem;cursor:pointer;color:#9397cd;


"""Imported by app_main.py when PyPy needs to fire up the interactive console.
"""
import sys
import os

irc_header = "And now for something completely different"

def interactive_console(mainmodule=None, quiet=False, future_flags=0):
    # set sys.{ps1,ps2} just before invoking the interactive interpreter. This
    # mimics what CPython does in pythonrun.c
    if not hasattr(sys, 'ps1'):
        sys.ps1 = '>>>> '
    if not hasattr(sys, 'ps2'):
        sys.ps2 = '.... '
    #
    if not quiet:
        try:
            from _pypy_irc_topic import some_topic
            text = "%s: ``%s''" % ( irc_header, some_topic())
            while len(text) >= 80:
                i = text[:80].rfind(' ')
                print(text[:i])
                text = text[i+1:]
            print(text)
        except ImportError:
            pass
    #
    try:
        if not os.isatty(sys.stdin.fileno()):
            # Bail out if stdin is not tty-like, as pyrepl wouldn't be happy
            # For example, with:
            # subprocess.Popen(['pypy', '-i'], stdin=subprocess.PIPE)
            raise ImportError
        from pyrepl.simple_interact import check
        if not check():
            raise ImportError
        from pyrepl.simple_interact import run_multiline_interactive_console
    except ImportError:
        run_simple_interactive_console(mainmodule, future_flags=future_flags)
    else:
        run_multiline_interactive_console(mainmodule, future_flags=future_flags)

def run_simple_interactive_console(mainmodule, future_flags=0):
    import code
    if mainmodule is None:
        import __main__ as mainmodule
    console = code.InteractiveConsole(mainmodule.__dict__, filename='<stdin>')
    if future_flags:
        console.compile.compiler.flags |= future_flags
    # some parts of code.py are copied here because it seems to be impossible
    # to start an interactive console without printing at least one line
    # of banner
    more = 0
    while 1:
        try:
            if more:
                prompt = getattr(sys, 'ps2', '... ')
            else:
                prompt = getattr(sys, 'ps1', '>>> ')
            try:
                line = raw_input(prompt)
                # Can be None if sys.stdin was redefined
                encoding = getattr(sys.stdin, 'encoding', None)
                if encoding and not isinstance(line, unicode):
                    line = line.decode(encoding)
            except EOFError:
                console.write("\n")
                break
            else:
                more = console.push(line)
        except KeyboardInterrupt:
            console.write("\nKeyboardInterrupt\n")
            console.resetbuffer()
            more = 0

# ____________________________________________________________

if __name__ == '__main__':    # for testing
    if os.getenv('PYTHONSTARTUP'):
        execfile(os.getenv('PYTHONSTARTUP'))
    interactive_console()


 []config.CUDABaseImage{}
	for _, tag := range tags {
		image, err := parseCUDABaseImage(tag)
		if err != nil {
			return nil, err
		}
		images = append(images, *image)
	}

	return images, nil
}

func fetchCUDABaseImageTags(url string) ([]string, error) {
	tags := []string{}

	resp, err := soup.Get(url)
	if err != nil {
		return tags, fmt.Errorf("Failed to download %s: %w", url, err)
	}

	var results struct {
		Next    *string
		Results []struct {
			Name string `json:"name"`
		} `json:"results"`
	}
	if err := json.Unmarshal([]byte(resp), &results); err != nil {
		return tags, fmt.Errorf("Failed parse CUDA images json: %w", err)
	}

	for _, result := range results.Results {
		tag := result.Name
		if strings.Contains(tag, "-cudnn") && !strings.HasSuffix(tag, "-rc") {
			tags = append(tags, tag)
		}
	}

	// recursive case for pagination
	if results.Next != nil {
		nextURL := *results.Next
		nextTags, err := fetchCUDABaseImageTags(nextURL)
		if err != nil {
			return tags, err
		}
		tags = append(tags, nextTags...)
	}

	sort.Sort(sort.Reverse(sort.StringSlice(tags)))

	return tags, nil
}

func parseCUDABaseImage(tag string) (*config.CUDABaseImage, error) {
	parts := strings.Split(tag, "-")
	if len(parts) != 4 {
		return nil, fmt.Errorf("Tag must be in the format <cudaVersion>-cudnn<cudnnVersion>-{devel,runtime}-ubuntu<ubuntuVersion>. Invalid tag: %s", tag)
	}

	return &config.CUDABaseImage{
		Tag:     tag,
		CUDA:    parts[0],
		CuDNN:   strings.Split(parts[1], "cudnn")[1],
		IsDevel: parts[2] == "devel",
		Ubuntu:  strings.Split(parts[3], "ubuntu")[1],
	}, nil
}
package update

import (
	"encoding/json"
	"os"
	"path/filepath"
	"time"

	"github.com/mitchellh/go-homedir"

	"github.com/replicate/cog/pkg/util/console"
	"github.com/replicate/cog/pkg/util/files"
)

type state struct {
	Message     string    `json:"message"`
	LastChecked time.Time `json:"lastChecked"`
	Version     string    `json:"version"`
}

// loadState loads the update check state from disk, returning defaults if it does not exist
func loadState() (*state, error) {
	state := state{}

	p, err := statePath()
	if err != nil {
		return nil, err
	}

	exists, err := files.Exists(p)
	if err != nil {
		return nil, err
	}
	if !exists {
		return &state, nil
	}
	text, err := os.ReadFile(p)
	if err != nil {
		console.Debugf("Failed to read %s: %s", p, err)
		return &state, nil
	}

	err = json.Unmarshal(text, &state)
	if err != nil {
		return nil, err
	}

	return &state, nil
}

// writeState saves analytics state to disk
func writeState(s *state) error {
	statePath, err := statePath()
	if err != nil {
		return err
	}

	bytes, err := json.MarshalIndent(s, "", " ")
	if err != nil {
		return err
	}
	dir := filepath.Dir(statePath)
	if err := os.MkdirAll(dir, 0o700); err != nil {
		return err
	}

	err = os.WriteFile(statePath, bytes, 0o600)
	if err != nil {
		return err
	}
	return nil
}

func userDir() (string, error)


Point3d[8];
      int [][] coords = {{1,1,1}, {1,1,0}, {1,0,0}, {1,0,1},
                           {0,1,1}, {0,1,0}, {0,0,0}, {0,0,1}};

      // create 8 corners
      for (int i=0; i<8; i++) {
         bounds[i] = new Point3d(p);
         for (int j=0; j<3; j++) {
            bounds[i].scaledAdd(projBounds[j][coords[i][j]], axis[j]);
         }
      }

      return bounds;

   }

   public static OBB getTightOBB(
      Point3d[] pnts, RigidTransform3d principal) {

      Vector3d [] axis = new Vector3d[3];
      double [][] projBounds = new double[3][2];

      for (int i=0; i<3; i++) {
         axis[i] = new Vector3d();
         principal.R.getColumn(i, axis[i]);
      }
      Vector3d p = principal.p;

      // loop through all nodes, projecting onto axes
      for (int i=0; i<pnts.length; i++) {

         for (int j=0; j<3; j++) {

            Vector3d vec = new Vector3d();
            vec.sub(pnts[i], p);

            double d =vec.dot(axis[j]);
            if (d < projBounds[j][0]) {
               projBounds[j][0] = d;
            } else if (d > projBounds[j][1]) {
               projBounds[j][1] = d;
            }
         } // end looping through axes
      } // end looping over vertices

      // construct bounds
      Point3d c = new Point3d(0,0,0);
      Vector3d widths = new Vector3d();
      for (int i=0; i<3; i++) {
         c.set(i, 0);
         widths.set(i, projBounds[i][1] - projBounds[i][0]);
         c.set(i, p.get(i) + (projBounds[i][0]+projBounds[i][1])/2);
      }
      RigidTransform3d trans = new RigidTransform3d(c, principal.R);
      OBB obb = new OBB(widths, trans);
      return obb;

   }

   // Lloyd sampling (relaxation)
   public static void lloydSample(Point3d[] out, Point3d[] in) {
      lloydSample(out, in, DEFAULT_THRESHOLD, DEFAULT_MAX_ITERS);
   }

   public static void lloydSample(Point3d[] out, Point3d[] in, double eps, int maxIters) {
      Point3d[] subs = new Point3d[out.length];
      farthestPointSampling(subs, in);

      for (int i=0; i<out.length; i++) {
         if (out[i] == null) {
            out[i] = (Point3d)subs[i].clone();
         } else {
            out[i].set(subs[i]);
         }
      }
      lloydRelaxation(out, in, eps, maxIters);
   }

   public static void farthestPointSampling(Point3d[] out, Point3d[] in, int offset) {

      int idxMax = 0;
      double dMin = 0;
      double dMax = -1;

      int [] idxs = new int[in.length];
      for (int i=0; i<in.length; i++) {
         idxs[i] = i;
      }

      int nIn = in.length;

      for (int i=offset; i<out.length; i++) {

         dMax = -1;
         idxMax = 0;

         for


tializer: `new ${type}()`,
        };
        return new ClassElementStructure(ClassElementType.Var, propertyStructure);
    }

    private getAccessor (makeSign: string, useSign: string, promiseReturn = false): ClassElementStructure {
        let returnType = this.type.typeAsString;
        if (promiseReturn)
            returnType = `Promise<${returnType}>`;

        const getterStructure: GetAccessorDeclarationStructure = {
            scope: Scope.Public,
            name: makeSign + this.name,
            returnType: returnType,
            bodyText: `return this.${this.oneName}.${useSign}get()`,
        };
        return new ClassElementStructure(ClassElementType.Get, getterStructure);
    }

    private setAccessor (): ClassElementStructure {
        const setterStructure: SetAccessorDeclarationStructure = {
            scope: Scope.Public,
            name: this.name,
            parameters: [{
                name: this.name,
                type: this.type.typeAsString,
            }],
            bodyText: `this.${this.oneName}.set(${this.name});`,
        };
        return new ClassElementStructure(ClassElementType.Set, setterStructure);
    }

    private extractGenericInfo (propertyNode: PropertyDeclaration) {
        const symbol = propertyNode.getSymbol();
        if (symbol == null)
        // TODO: Create more specific error when symbol of property does not exist
            throw new Error();
        this.name = symbol.getName();
    }

    private extractTypeInfo (propertyNode: PropertyDeclaration) {
        this.type = getTypeInfo(this.schemer, propertyNode.getType());
    }

    private extractDefaultValue (propertyNode: PropertyDeclaration) {
        const initializer = propertyNode.getInitializer();
        if (initializer)
            this.defaultValue = initializer.getText();
    }
}

export default class Carro {

    public  marca: string;
    public  modelo: string;
    private  placa: string;
    public velocidade: number;
    public  velocidade_Max: number;

    constructor(marca: string, modelo: string, placa: string, velocidade: number, Velocidade_Max: number) {
        this.marca = marca;
        this.modelo = modelo;
        this.placa = placa;
        this.velocidade = velocidade;
        this.velocidade_Max = Velocidade_Max;
    }

    public acelerar(Velo: number): void {

        if (Velo <= 10) {

            if (this.velocidade < this.velocidade_Max) {

                this.velocidade += Velo;
                console.log('o carro foi acelerado');

                if(this.velocidade == this.velocidade_Max){
                    console.log('o carro chegou na velocidade maxima!')
                }
            }
            else if(this.velocidade == this.velocidade_Max){
                console.log('O carro está na velocidade maxima!');
            }

        }
        else{
            console.log('O limite de aceleração é de 10 KM/h');
        }
    }

    public frear(): number {
        let tempo = this.velocidade

        this.velocidade = 0

        return (tempo / 10);
    }

    public imprimirDados(): void {
        console.log(`Marca: ${this.marca}`);
        console.log(`Modelo: ${this.modelo}`);
        console.log(`Placa: ${this.placa}`);
        console.log(`Velocidade atual: ${this.velocidade}`);
        console.log(`Velocidade máxima: ${


融领域中的应用。|
|时事新闻|请问你对最近美国加利福尼亚州枪击案有什么看法？|
|体育|请介绍一下卡塔尔世界杯足球赛的组织情况和规则。|
|生活|你有什么好的厨房储物整理建议吗？|
|科学|请简单介绍黑洞的形成机制以及我们了解它的方式。|
|社会|请谈谈你对老年人抑郁症的看法和建议。|
|娱乐|请推荐一些值得一看的好电影或电视剧。|
|电影推荐|能否给我一些最近值得观看的电影推荐？|
|菜谱查询|你能告诉我如何制作一道美味的意大利面吗？|
|健康咨询|如何才能减轻长时间坐着工作对身体带来的负担？|
|购物建议|我应该如何挑选一件适合我的运动鞋？|
|新闻分类|请根据以下描述，将该新闻归类: 梅西再次当选世界足球先生。|
|情感分析|根据下面这段文字，分析它所包含的情感：我经常梦见自己在漆黑的夜晚里迷路了。|
|人名解释|谁是马云？|
|旅游建议|我想去日本旅游，请问有哪些景点值得一去？|
|文本编辑|请将以下文章中的错别字修改过来：李白是中国唐代著名的古诗文作者，他的作品深受后人的喜爱。|
|翻译服务|请将下列英文句子翻译成汉语：In this world, nothing can be said to be certain, except death and taxes. |
|人工智能|如何定义人工智能？|
|餐厅推荐|请推荐一家适合商务午餐的中餐厅。|
|新闻分类|这则新闻是属于哪个领域的：「中国科学家成功制造出高温超导材料」？|
|商品比较|请比较 iPhone 和三星手机的优缺点。|
|股票预测|根据过去一个月的趋势，明天买入腾讯股票是否有利可图？|
|电影推荐|请推荐一部适合全家观看的喜剧电影。|
|足球比赛|德国队与巴西队的历史交锋战绩是多少？|
|疾病诊断|某患者出现头痛、恶心等症状，请问可能患上了哪种疾病？|
|旅游攻略|请提供一份巴厘岛旅游攻略。|
|教育政策|近年来教育部针对高考改革出台了哪些政策？|
| 开发人


            "tcId": 4000,
            "kdfParameter": {
              "kdfType": "oneStep",
              "t": "6A0BD531FEB81FAAD0C8A32683EA4658",
              "z": "43EB8D8D8C7813C427E9DAE923E21E5D797C0D0E570EAD28E8ACCEB3AB36E856EC42B8",
              "l": 1024,
              "algorithmId": "466D70C5FC559963BE76CBE3D1B9A28C"
            },
            "fixedInfoPartyU": {
              "partyId": "F1A9C89B23A0BA7AB4369A215E168482",
              "ephemeralData": "30D78669FC8CC53A2EA82DE7C2571EF689D4CBC29A5A1F569FE70EFF7B021FD54BAE5C"
            },
            "fixedInfoPartyV": {
              "partyId": "D061065F5A5E96B3125E9B82636D9FDF",
              "ephemeralData": "4808BC6434CE4ECF510F44BF5B07715D22BA2A48D036EB823941D377A763EC0496FA20"
            },
            "dkm": "8F4164B2E12593CDBAF1E0F3D6D1EA94012B33E0C34F232E2B670E8EAC99BB5CAC16172023E59C077174B6839F71A27FE5C3533D27FBD65F2A704B922456B925B96AC908A36074B2BA0A81E54E5D10135D3992BC975F7DD2C673D835FC3E8A5B2AA6FCC1A0B8A3C75F5735BCE5FE6FF38DD8A732EB331DBE3C05569C1D1F96DD"
          }
        ],
        "kdfConfiguration": {
          "kdfType": "oneStep",
          "l": 1024,
          "saltMethod": "random",
          "fixedInfoPattern": "algorithmId||uPartyInfo||vPartyInfo||t",
          "fixedInfoEncoding": "concatenation",
          "auxFunction": "SHA3-512"
        }
      }
    ]
  }
]
''';
  return jsonDecode(s);
}
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

const double _kVerticalOffset = 6.0;
const Widget _kDefaultDropdownButtonTrailing = ChevronDown();

typedef DropDownButtonBuilder =
    Widget Function(BuildContext context, VoidCallback? onOpen);

/// A dropdown button is a button that shows a chevron as a visual indicator that
/// it has an attached flyout that contains more options. It has the same
/// behavior as a standard Button control with a flyout; only the appearance is
/// different.
///
/// ![DropDownButton Showcase](https://docs.microsoft.com/en-us/windows/apps/design/controls/images/drop-down-button-align.png)
///
/// ## Usage
///
/// ```dart
/// DropDownButton(
///   title: const Text('Select an option'),
///   items: [
///     MenuFlyoutItem(
///       text: const Text('Option 1'),
///       onPressed: () { /* Handle option 1 */ },
///     ),
///     MenuFlyoutSubItem(
///       text: const Text('Submenu'),
///       items: (context) => [
///         MenuFlyoutItem(
///           text: const Text('Suboption 1'),
///           onPressed: () { /* Handle suboption 1 */ },
///         ),
///       ],
///     ),
///   ],
/// )
/// ```
///
/// See also:
///
///   * [Flyout], a light dismiss container that can show arbitrary UI as its
///     content. Used to back this button
///   * [ComboBox], a list of items that a user can select from
///   * <https://docs.microsoft.com/en-us/windows/apps/design/controls/buttons#create-a-drop-down-button>
class DropDownButton extends StatefulWidget {
  /// Creates a dropdown button.
  const DropDownButton({
    super.key,
    this.buttonBuilder,
    required this.item


"""
Exceptions that can be thrown by hyperframe.
"""
from __future__ import annotations

class HyperframeError(Exception):
    """
    The base class for all exceptions for the hyperframe module.

    .. versionadded:: 6.0.0
    """

class UnknownFrameError(HyperframeError):
    """
    A frame of unknown type was received.

    .. versionchanged:: 6.0.0
        Changed base class from `ValueError` to :class:`HyperframeError`
    """

    def __init__(self, frame_type: int, length: int) -> None:
        #: The type byte of the unknown frame that was received.
        self.frame_type = frame_type

        #: The length of the data portion of the unknown frame.
        self.length = length

    def __str__(self) -> str:
        return (
            f"UnknownFrameError: Unknown frame type 0x{self.frame_type:X} received, length {self.length} bytes"
        )

class InvalidPaddingError(HyperframeError):
    """
    A frame with invalid padding was received.

    .. versionchanged:: 6.0.0
        Changed base class from `ValueError` to :class:`HyperframeError`
    """

class InvalidFrameError(HyperframeError):
    """
    Parsing a frame failed because the data was not laid out appropriately.

    .. versionadded:: 3.0.2

    .. versionchanged:: 6.0.0
        Changed base class from `ValueError` to :class:`HyperframeError`
    """

class InvalidDataError(HyperframeError):
    """
    Content or data of a frame was is invalid or violates the specification.

    .. versionadded:: 6.0.0
    """


loads: %v", err)
	}

	// Filter workloads by group
	groupWorkloads, err := workloads.FilterByGroup(workloadList, groupName)
	if err != nil {
		return fmt.Errorf("failed to filter workloads by group: %v", err)
	}

	if len(groupWorkloads) == 0 {
		fmt.Printf("No running MCP servers found in group '%s'\n", groupName)
		return nil
	}

	// Extract workload names from the filtered list
	var workloadNames []string
	for _, workload := range groupWorkloads {
		workloadNames = append(workloadNames, workload.Name)
	}

	// Stop workloads in the group
	subtasks, err := workloadManager.StopWorkloads(ctx, workloadNames)
	if err != nil {
		return fmt.Errorf("failed to stop workloads in group '%s': %v", groupName, err)
	}

	// Wait for the stop operation to complete
	if err := subtasks.Wait(); err != nil {
		return fmt.Errorf("failed to stop workloads in group '%s': %v", groupName, err)
	}

	fmt.Printf("Successfully stopped %d workload(s) in group '%s'\n", len(workloadNames), groupName)
	return nil
}
package app

import (
	"context"
	"crypto/rand"
	"encoding/hex"
	"fmt"
	"net/http"
	"strconv"
	"time"

	"github.com/spf13/cobra"

	"github.com/stacklok/toolhive/cmd/thv/app/inspector"
	"github.com/stacklok/toolhive/pkg/container"
	"github.com/stacklok/toolhive/pkg/container/images"
	"github.com/stacklok/toolhive/pkg/container/runtime"
	"github.com/stacklok/toolhive/pkg/labels"
	"github.com/stacklok/toolhive/pkg/logger"
	"github.com/stacklok/toolhive/pkg/permissions"
	"github.com/stacklok/toolhive/pkg/transport/types"
	"github.com/stacklok/toolhive/pkg/workloads"
)

var (
	inspectorUIPort       int
	inspectorMCPProxyPort int
)

func inspectorCommand() *cobra.Command {
	inspectorCommand := &cobra.Command{
		Use:   "inspector [workload-name]",
		Short: "Launches the MCP Inspector UI and connects it to the specified MCP server",
		Long:  `Launches the MCP Inspector UI and connects it to the specified MCP server`,
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			return inspectorCmdFunc(cmd, args)
		},
	}

	inspectorCommand.Flags().IntVarP(&inspectorUIPort, "ui-port", "u", 6274, "Port to run the MCP Inspector UI on")
	inspectorCommand.Flags().IntVarP(&inspectorMCPProxyPort, "mcp-proxy-port", "p", 6277, "Port to run the MCP Proxy on")

	return inspectorCommand
}

func buildInspectorContainerOptions(uiPortStr string, mcpPortStr string) *runtime.DeployWorkloadOptions {
	return &runtime.DeployWorkloadOptions{
		ExposedPorts: map[string]struct{}{
			uiPortStr + "/tcp":  {},
			mcpPortStr + "/tcp": {},
		},
		PortBindings: map[string][]runtime.PortBinding{
			uiPortStr + "/tcp": {
				{HostIP: "127.0.0.1", HostPort: uiPortStr},
			},
			mcpPortStr + "/tcp": {
				{HostIP: "127.0.0.1", HostPort: mcpPortStr},
			},
		},
		AttachStdio: false,
	}
}

func waitForInspectorReady(ctx context.Context, port int, statusChan chan bool) {
	go func() {
		url := fmt.Sprintf("http://localhost:%d", port)
		for {
			resp, err := http.Get(url) //nolint:gosec
			if err == nil && resp.Status


rrowUntil[playerId] >= timestamp) return true;

        return false;
    }

    public override void OnReportDeadBody(PlayerControl reported, NetworkedPlayerInfo target)
    {
        if (target == null) return;

        if (SpiritualistTarget != byte.MaxValue)
            RemoveTarget(SpiritualistTarget);

        SpiritualistTarget = target.PlayerId;
    }

    public override void AfterMeetingTasks()
    {
        PlayerControl player = _Player;

        if (!player || !player.IsAlive()) return;

        LastGhostArrowShowTime[player.PlayerId] = 0;
        ShowGhostArrowUntil[player.PlayerId] = 0;

        PlayerControl target = Main.AllPlayerControls.FirstOrDefault(a => a.PlayerId == SpiritualistTarget);

        if (target == null) return;

        TargetArrow.Add(player.PlayerId, target.PlayerId);

        var writer = CustomRpcSender.Create("SpiritualistSendMessage", SendOption.None);
        writer.StartMessage(target.GetClientId());
        writer.StartRpc(target.NetId, (byte)RpcCalls.SetName)
            .Write(target.Data.NetId)
            .Write(GetString("SpiritualistNoticeTitle"))
            .EndRpc();
        writer.StartRpc(target.NetId, (byte)RpcCalls.SendChat)
            .Write(GetString("SpiritualistNoticeMessage"))
            .EndRpc();
        writer.StartRpc(target.NetId, (byte)RpcCalls.SetName)
            .Write(target.Data.NetId)
            .Write(target.Data.PlayerName)
            .EndRpc();
        writer.EndMessage();
        writer.SendMessage();
    }

    public override string GetSuffix(PlayerControl seer, PlayerControl target = null, bool isForMeeting = false)
    {
        if (!seer.Is(CustomRoles.Spiritualist) || !seer.IsAlive()) return string.Empty;
        if (target != null && seer.PlayerId != target.PlayerId) return string.Empty;
        if (GameStates.IsMeeting) return string.Empty;
        if (SpiritualistTarget != byte.MaxValue && ShowArrow(seer.PlayerId))
        {
            return Utils.ColorString(seer.GetRoleColor(), TargetArrow.GetArrows(seer, SpiritualistTarget));
        }
        return string.Empty;
    }

    public static void RemoveTarget(byte player)
    {
        if (SpiritualistTarget != player) return;

        if (AmongUsClient.Instance.AmHost)
            foreach (var spiritualist in Main.AllPlayerControls.Where(x => x.Is(CustomRoles.Spiritualist)).Select(x => x.PlayerId).ToList())
            {
                TargetArrow.Remove(spiritualist, SpiritualistTarget);
            }

        SpiritualistTarget = byte.MaxValue;
    }
}


/${response.weather[0].icon}@2x.png`))
    dispatch(setNotFoundError(false))
    dispatch(setCurrentCity(response.name))
    dispatch(setLoading(false))
}

export const getWeatherByCity = (city:any, currentLanguage="en") => (dispatch:any) => {
    dispatch(setLoading(true))
    getWeatherByCityAPI(city, currentLanguage).then(response=>{
        dispatch(getWeatherThunk(response))
    }, ()=>{
        dispatch(setLoading(false))
        dispatch(setNotFoundError(true))})
}

export const getWeatherByGeo =(leo:number, lat:number, currentLanguage="en") => (dispatch:any) => {
    dispatch(setLoading(true))
    getWeatherGeoAPI(lat, leo, currentLanguage).then(response=>{
        dispatch(getWeatherThunk(response))
    }, ()=>{
        dispatch(setLoading(false))
        dispatch(setNotFoundError(true))})
}import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'largeNumber'
})
export class LargeNumberPipe implements PipeTransform {

  transform(value: any): any {

    let exp;
    let suffixes = [' thousand', ' million', ' billion', ' trillion', 'quadrillion'];

    if (Number.isNaN(Number(value))) {
      return value;
    }

    if (Number.isNaN(value)) {
      return null;
    }

    if (value < 1000) {
      return value;
    }

    exp = Math.floor(Math.log(value) / Math.log(1000));

    return (value / Math.pow(1000, exp)) + suffixes[exp - 1];
  }

}
const { Notation } = require('notation');

export default function scoreObject(object, fields) {
  const notate = Notation.create;
  if(!object || !object.content) {
    console.debug('Content or dataObject not set', object);
    return object;
  }

  const { content } = object;
  let score = 0;
  let totalWeights = 0;

  for (let i = 0; i < fields.length; i += 1) {
    const value = notate(content).get(fields[i].key);
    if (value) {
      let passes = true;

      if (fields[i].minLength && value.length < fields[i].minLength) passes = false;
      if (fields[i].maxLength && value.length > fields[i].maxLength) passes = false;

      if (passes) score += fields[i].weight || 1;
    }

    totalWeights += fields[i].weight || 1;
  }

  const returnObject = Object.assign({}, object);

  if (!returnObject.enrichmentResults) returnObject.enrichmentResults = {};

  returnObject.enrichmentResults.score = score;
  returnObject.enrichmentResults.normalizedScore = score/totalWeights;

  return returnObject

}
type RunnableOptions = {
  bail: boolean
  sequential: boolean
  timeout: number
}

export enum RunStatus {
  PENDING = 'pending',
  RUNNING = 'running',
  PASSED = 'passed',
  FAILED = 'failed',
  SKIPPED = 'skipped',
  TODO = 'todo',
}

type _RunStatus = keyof typeof RunStatus

export type {
  _RunStatus,
  RunnableOptions,
}
import { esn } from '../css';
import { label, sliding, slidingFilled, slidingNormal } from './style';
export interface LabelProps {
    error?: boolean;
    success?: boolean;
    focused?: boolean;
    disabled?:boolean;
}
export const Label= esn<LabelProps, {},'label'>  ({
    displayName: 'Label.Label',
    tag: 'label',
    defaultProps: {
        error: false,
        success: false,
        focused: false,
        disabled:false,
    },
    style: label,
    rule: {
        error: ({ value }) => value ? ({


` Not Found Error

Add this to your `.zshrc` or `.bashrc`:

```sh
export LLDB_DEBUGSERVER_PATH="/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver"
```

##### Attach Failed (Not Allowed to Attach to Process)

1. **Check Console Messages**: Look in Console.app near the debugserver entries when the attach failed. The subsystem that denied permission will likely have logged an informative message.

2. **Grant Developer Tools Access**:
   - Go to `System Preferences` → `Privacy & Security` → `Developer Tools`
   - Grant access to Terminal

3. **Disable Debugging Protection**: On some machines, you may need to disable debugging protection. Refer to this [Apple Developer Forum thread](https://forums.developer.apple.com/forums/thread/17452) for detailed instructions.

##### Permission Denied When Trying to Debug a Program

Refer to the [Apple Developer Forum thread](https://forums.developer.apple.com/forums/thread/17452) for instructions on disabling debugging protection for macOS systems.

### Windows (WSL)

#### Common Issues and Solutions

##### `libpython 3.10.so.1.0` Not Found or Executable Not Found

Install Python 3.10 and development libraries:

```sh
sudo apt update
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10 python3.10-dev
python 3.10 --version
```

##### `lldb-server` Not Found Error

This issue occurs when the PATH for the LLDB server is not set correctly. Add this to your `.bashrc`:

```sh
export LLDB_DEBUGSERVER_PATH="/usr/bin/lldb-server"
```

### Solana LLDB

#### Common Issues and Solutions

##### Still cannot find solana-lldb

Sometimes, even after following the documentation to set up your PATH, tools like solana-lldb may not appear immediately. The exact location of platform-tools can vary slightly between machines, so you might need to locate it manually.

Steps:

1. Locate the solana installation folder

The default location is usually:

```bash
$HOME/.local/solana/install/active_release/bin
```

2. Find the `llvm/bin` folder

```bash
platform-tools/llvm/bin
```
This directory contains solana-lldb, llvm-objdump, and other necessary tools.

3. Add the folder to your PATH
You can temporarily add it with:

```bash
export PATH=$HOME/.local/solana/install/active_release/bin/platform-tools/llvm/bin:$PATH
```

4. Verify the installation

```bash
solana-lldb --version
```
If it shows the version, your PATH is set correctly, and the debugger tools are ready to use.
# ARecyclerView

对RecyclerView的封装，功能强大、使用简单、扩展性强。该库主要分成三部分：**RecyclerAdapter**、**XRecyclerView**、**XRecyclerContentLayout**

>该库在商业项目中历经一年多时间打磨，欢迎star、fork，后期会有更多分享，期待您的建议和关注。

**本库已经迁移到JitPack**

[![](https://jitpack.io/v/limedroid/ARecyclerView.svg)](https://jitpack.io/#limedroid/ARecyclerView)

## 说明

关于RecyclerView，有很多库。ARecyclerView与其他库有这几个区别，也许能更好的进行扩展，方便您的使用。

* **ARecyclerView继承自RecyclerView，它就是一个封装了常见功能的RecyclerView，而不是继承FrameLayout**
* **ARecyclerView中实现了Header、Footer，header和Footer可以有多个**
* **ARecyclerView的每一个header、footer的viewType是不同的，而大部分开源库的header、footer的viewtype是相同的，其直接后果是界面卡顿**
* **ARecyclerView可以做出几乎任何的界面效果，可以取代ScrollView，你只需要使用header或


at_entry(i), Some(0));
        let stm_assign = Spanned::new(
            span.clone(),
            StmX::Assign {
                lhs: Dest {
                    dest: crate::ast_to_sst::var_loc_exp(&span, &typ, uniq_ident),
                    is_init: true,
                },
                rhs: height_of_exp(ctxt, exp),
            },
        );
        decls.push(decl);
        stm_assigns.push(stm_assign);
    }
    (decls, stm_assigns)
}

// REVIEW: for simplicity, we completely disallow recursive calls from inside closures.
// It's possible that we could be allow some recursion.
fn disallow_recursion_exp(ctxt: &Ctxt, exp: &Exp) -> Result<(), VirErr> {
    let mut scope_map = ScopeMap::new();
    exp_visitor_check(exp, &mut scope_map, &mut |exp, _scope_map| match &exp.x {
        ExpX::Call(x, targs, _) if is_recursive_call(ctxt, x, targs) => {
            err_str(&exp.span, "recursion not allowed here")
        }
        _ => Ok(()),
    })
}

pub(crate) fn check_termination_exp(
    ctx: &Ctx,
    function: &Function,
    mut local_decls: Vec<LocalDecl>,
    body: &Exp,
    proof_body: Vec<Stm>,
) -> Result<(bool, Commands, Exp), VirErr> {
    if !is_recursive_exp(ctx, &function.x.name, body) {
        return Ok((false, Arc::new(vec![]), body.clone()));
    }
    let num_decreases = function.x.decrease.len();
    if num_decreases == 0 {
        return err_str(&function.span, "recursive function must call decreases(...)");
    }

    let decreases_exps = vec_map_result(&function.x.decrease, |e| {
        expr_to_exp(ctx, &params_to_pars(&function.x.params, false), e)
    })?;
    let scc_rep = ctx.global.func_call_graph.get_scc_rep(&Node::Fun(function.x.name.clone()));
    let ctxt =
        Ctxt { recursive_function_name: function.x.name.clone(), num_decreases, scc_rep, ctx };
    let check = terminates(&ctxt, &body)?;
    let (mut decls, mut stm_assigns) = mk_decreases_at_entry(&ctxt, &body.span, &decreases_exps);
    stm_assigns.extend(proof_body.clone());
    let error = error("could not prove termination", &body.span);
    let stm_assert = Spanned::new(body.span.clone(), StmX::Assert(Some(error), check));
    stm_assigns.push(stm_assert);
    let stm_block = Spanned::new(body.span.clone(), StmX::Block(Arc::new(stm_assigns)));

    // TODO: If we decide to support debugging decreases failures, we should plumb _snap_map
    // up to the VIR model
    local_decls.append(&mut decls);
    let (commands, _snap_map) = crate::sst_to_air::body_stm_to_air(
        ctx,
        &function.span,
        &vec![],
        &function.x.typ_params(),
        &function.x.params,
        &Arc::new(local_decls),
        &Arc::new(vec![]),
        &Arc::new(vec![]),
        &Arc::new(vec![]),
        &MaskSpec::NoSpec,
        function.x.mode,
        &stm_block,
        false,
        false,
        false,
        false,
    );

    assert_eq!(commands.len(), 1);
    let commands = commands.into_iter().next().unwrap().commands.clone();

    // New body: substitute rec%f(args, fuel) for f(args)
    let body = map_exp_visitor


(ndis.h)
description: The NdisSetEvent function sets a given event to the signaled state if it was not already Signaled.
old-location: netvista\ndissetevent.htm
tech.root: netvista
ms.date: 05/02/2018
keywords: ["NdisSetEvent function"]
ms.keywords: NdisSetEvent, NdisSetEvent function [Network Drivers Starting with Windows Vista], ndis/NdisSetEvent, ndis_event_ref_3abf6ebc-6dcf-4b3e-8e39-2902b9b00adf.xml, netvista.ndissetevent
req.header: ndis.h
req.include-header: Ndis.h
req.target-type: Universal
req.target-min-winverclnt: Supported for NDIS 6.0 and NDIS 5.1 drivers (see    NdisSetEvent (NDIS 5.1)) in Windows   Vista. Supported for NDIS 5.1 drivers (see    NdisSetEvent (NDIS 5.1)) in Windows   XP.
req.target-min-winversvr:
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance: Irql_Synch_Function
req.unicode-ansi:
req.idl:
req.max-support:
req.namespace:
req.assembly:
req.type-library:
req.lib: Ndis.lib
req.dll:
req.irql: <= DISPATCH_LEVEL
targetos: Windows
req.typenames:
f1_keywords:
 - NdisSetEvent
 - ndis/NdisSetEvent
topic_type:
 - APIRef
 - kbSyntax
api_type:
 - LibDef
api_location:
 - ndis.lib
 - ndis.dll
api_name:
 - NdisSetEvent
---

# NdisSetEvent function

## -description

The
  NdisSetEvent function sets a given event to the signaled state if it was not already Signaled.

## -parameters

### -param Event [in]

A pointer to an initialized event object for which the caller provides the storage.

## -remarks

When an event attains the
    signaled state, it causes waits on the event to be satisfied and any waiters to be dispatched for
    execution.

After a call to
    NdisSetEvent, the event remains in the
    signaled state until the driver calls the
    NdisResetEvent function.

## -see-also

NdisInitializeEvent

NdisResetEvent

NdisWaitEvent
---
title: FLT_PARAMETERS for IRP_MJ_PREPARE_MDL_WRITE Union
description: Describes the FLT_PARAMETERS union member used when the MajorFunction field of the FLT_IO_PARAMETER_BLOCK structure for the operation is IRP_MJ_PREPARE_MDL_WRITE.
keywords: ["FLT_PARAMETERS for IRP_MJ_PREPARE_MDL_WRITE union Installable File System Drivers", "FLT_PARAMETERS union Installable File System Drivers", "PFLT_PARAMETERS union pointer Installable File System Drivers"]
topic_type:
- apiref
api_name:
- FLT_PARAMETERS
api_location:
- fltkernel.h
api_type:
- HeaderDef
ms.date: 05/29/2024
ms.topic: reference
---

# FLT_PARAMETERS for IRP_MJ_PREPARE_MDL_WRITE union

The following [**FLT_PARAMETERS**](/windows-hardware/drivers/ddi/fltkernel/ns-fltkernel-_flt_parameters) u


rel="noopener noreferrer">Vuejs 源码

Previous

工程化：webpack 工作流程

Next

框架：Vue 的 computed 和 watch 的区别

相关问题

回答关键点

知识点深入

1. 前置概念

2. 实现原理

2.1 响应式对象

2.2 依赖收集

2.3 数据更新

3. 无法监听到的变化

4. Vue2 与 Vue3 的差异

参考资料

Loading script...


l_count == 2

@pytest.mark.asyncio
@patch("ollama.AsyncClient")
@patch("tqdm.tqdm")
async def test_parser_with_concurrent_processing(
    mock_tqdm, mock_async_client, pdf_path
):
    """Test parser with concurrent processing enabled."""
    # Mock the Ollama async client
    mock_client = AsyncMock()
    mock_async_client.return_value = mock_client

    # Mock the chat responses
    mock_chat = AsyncMock()
    mock_chat.side_effect = [
        {
            "message": {
                "content": json.dumps(
                    {
                        "text_detected": "Yes",
                        "tables_detected": "No",
                        "images_detected": "No",
                        "extracted_text": f"Test content for page {i}",
                        "confidence_score_text": 0.9,
                    }
                )
            }
        }
        for i in range(2)
    ] + [
        {"message": {"content": f"# Page {i}\n\nTest content for page {i}"}}
        for i in range(2)
    ]
    mock_client.chat = mock_chat

    parser = VisionParser(
        page_config=PDFPageConfig(dpi=300),
        model_name="llama3.2-vision:11b",
        temperature=0.7,
        top_p=0.7,
        enable_concurrency=True,
    )

    # Mock the PDF document
    with patch("pypdfium2.PdfDocument") as mock_open:
        mock_doc = MagicMock()
        mock_page = MagicMock()
        mock_bitmap = MagicMock()
        mock_bitmap.to_numpy.return_value = b"\x00" * (
            200 * 200 * 3
        )  # Create correct size buffer
        mock_bitmap.to_pil.return_value = MagicMock()
        mock_bitmap.close = MagicMock()
        mock_page.render.return_value = mock_bitmap
        mock_page.get_rotation.return_value = 0
        mock_doc.__len__.return_value = 2
        mock_doc.get_page.return_value = mock_page
        mock_open.return_value = mock_doc

        # Mock tqdm
        mock_progress = MagicMock()
        mock_tqdm.return_value.__enter__.return_value = mock_progress

        converted_pages = parser.convert_pdf(pdf_path)
        assert isinstance(converted_pages, list)
        assert len(converted_pages) > 0
        assert mock_chat.call_count == 2
        assert all(
            f"Test content for page {i}" in page
            for i, page in enumerate(converted_pages)
        )

def test_parser_with_custom_page_config():
    """Test parser initialization with custom page configuration."""
    custom_config = PDFPageConfig(
        dpi=600,
        color_space="GRAY",
        include_annotations=False,
        preserve_transparency=True,
    )
    parser = VisionParser(
        page_config=custom_config,
        model_name="llama3.2-vision:11b",
        temperature=0.7,
        top_p=0.7,
    )
    assert parser.page_config.dpi == 600
    assert parser.page_config.color_space == "GRAY"
    assert not parser.page_config.include_annotations
    assert parser.page_config.preserve_transparency

def test_parser_with_ollama_config():
    ollama_config = {
        "OLLAMA_HOST": "http://localhost:11434",
        "OLLAMA_NUM_GPU": "1",
        "OLLAMA_NUM_THREAD": "4",
    }
    parser = VisionParser(
        model_name="llama3.2-vision:11b",
        temperature=0.7,
        top_p=0.7,
        ollama_config=ollama_config,
    )
    assert parser.llm.ollama_config == ollama_config

def test_parser_custom_num_workers():
    custom_num_workers = 10
    parser = VisionParser(
        model_name="llama3.2-vision:11b",
        temperature=0.7,
        top_p=0.7,
        num_workers=custom_num_workers,
    )
    assert parser.num_workers == custom_num_workers
    assert parser.llm.num_workers == custom_num_workers


num: usize, f: F) -> R where
            F: FnOnce(Option<&hil::Driver>) -> R {
        match driver_num {
            1 => f(Some(self.gpio)),
            3 => f(Some(self.timer)),
            _ => f(None)
        }
    }
    //Don't have a driver for UART so can't add here

}

macro_rules! static_init {
   ($V:ident : $T:ty = $e:expr) => {
        let $V : &mut $T = {
            // Waiting out for size_of to be available at compile-time to avoid
            // hardcoding an abitrary large size...
            static mut BUF : [u8; 1024] = [0; 1024];
            let mut tmp : &mut $T = mem::transmute(&mut BUF);
            *tmp = $e;
            tmp
        };
   }
}

pub unsafe fn init<'a>() -> &'a mut Firestorm {
    use core::mem;
    use nrf51822::gpio::PA;

    static mut FIRESTORM_BUF : [u8; 1024] = [0; 1024];

    static_init!(gpio_pins : [&'static nrf51822::gpio::GPIOPin; 2] = [
            &nrf51822::gpio::PA[18], // LED_0
            &nrf51822::gpio::PA[19], // LED_1
            ]);
    static_init!(gpio : drivers::gpio::GPIO<'static, nrf51822::gpio::GPIOPin> =
                 drivers::gpio::GPIO::new(gpio_pins));
    for pin in gpio_pins.iter() {
        pin.set_client(gpio);
    }

    let rtc = &nrf51822::rtc::RTC;

    static_init!(mux_alarm : MuxAlarm<'static, nrf51822::rtc::Rtc> =
                    MuxAlarm::new(&nrf51822::rtc::RTC));
    rtc.configure(mux_alarm);

    static_init!(virtual_alarm1 : VirtualMuxAlarm<'static, nrf51822::rtc::Rtc> =
                    VirtualMuxAlarm::new(mux_alarm));
    static_init!(vtimer1 : AlarmToTimer<'static,
                                VirtualMuxAlarm<'static, nrf51822::rtc::Rtc>> =
                            AlarmToTimer::new(virtual_alarm1));
    virtual_alarm1.set_client(vtimer1);
    static_init!(timer : drivers::timer::TimerDriver<AlarmToTimer<'static,
                                VirtualMuxAlarm<'static, nrf51822::rtc::Rtc>>> =
                            drivers::timer::TimerDriver::new(vtimer1,
                                                 process::Container::create()));
    vtimer1.set_client(timer);

    let firestorm : &'static mut Firestorm = mem::transmute(&mut FIRESTORM_BUF);
    *firestorm = Firestorm {
        chip: nrf51822::chip::Nrf51822::new(),
        gpio: gpio,
        timer: timer,
    };

    firestorm
}

use core::fmt::Arguments;
#[cfg(not(test))]
#[lang="panic_fmt"]
#[no_mangle]
pub unsafe extern fn rust_begin_unwind(_args: &Arguments,
    _file: &'static str, _line: usize) -> ! {
    use support::nop;
    use hil::gpio::GPIOPin;

    let led0 = &nrf51822::gpio::PA[18];
    let led1 = &nrf51822::gpio::PA[19];

    led0.enable_output();
    led1.enable_output();
    loop {
        for _ in 0..100000 {
            led0.set();
            led1.set();
            nop();
        }
        for _ in 0..100000 {
            led0.clear();
            led1.clear();
            nop();
        }
    }
}

<gh_stars>0
use std::{net::SocketAddr, sync::Arc


tionSyntax node )
            => node
                .WithBody( this.RewriteBodyBlock( node.Body ) );

        public override SyntaxNode VisitPropertyDeclaration( PropertyDeclarationSyntax node ) => this.VisitBasePropertyDeclaration( node );

        public override SyntaxNode VisitIndexerDeclaration( IndexerDeclarationSyntax node ) => this.VisitBasePropertyDeclaration( node );

        public override SyntaxNode VisitEventDeclaration( EventDeclarationSyntax node ) => this.VisitBasePropertyDeclaration( node );

        private SyntaxNode VisitBasePropertyDeclaration( BasePropertyDeclarationSyntax node )
            => node.WithAccessorList(
                node.AccessorList?.WithAccessors(
                    List(
                        node.AccessorList.Accessors
                            .SelectAsReadOnlyList( a => a.WithBody( this.RewriteBodyBlock( a.Body ) ) ) ) ) );

        private BlockSyntax? RewriteBodyBlock( BlockSyntax? block )
        {
            if ( block == null )
            {
                return null;
            }
            else if ( this._projectOptions?.CodeFormattingOptions == CodeFormattingOptions.Formatted )
            {
                var countLabelUsesWalker = new CountLabelUsesWalker();
                countLabelUsesWalker.Visit( block );

                var withFlattenedBlocks = new CleanupBodyRewriter( this._generationContext ).Visit( block );

                var withoutTrivialLabels =
                    new RemoveTrivialLabelRewriter( countLabelUsesWalker.ObservedLabelCounters, this._generationContext ).Visit( withFlattenedBlocks );

                var withoutTrailingReturns = new RemoveTrailingReturnRewriter( this._generationContext ).Visit( withoutTrivialLabels );

                return (BlockSyntax?) withoutTrailingReturns;
            }
            else
            {
                return (BlockSyntax?) new CleanupBodyRewriter( this._generationContext ).Visit( block );
            }
        }
    }
}


class Solution:
  def digArtifacts(self, n: int, artifacts: List[List[int]], dig: List[List[int]]) -> int:
    digged = set((r, c) for r, c in dig)

    def canExtract(a: List[int]) -> bool:
      for i in range(a[0], a[2] + 1):
        for j in range(a[1], a[3] + 1):
          if (i, j) not in digged:
            return False
      return True

    return sum(canExtract(a) for a in artifacts)


 = new JPanel();
		p12Panel.setLayout(new BoxLayout(p12Panel, BoxLayout.X_AXIS));
		JTextField p12PathField = new JTextField();
		p12Panel.add(p12PathField);
		JButton p12Choosebutton = new JButton(I18nString.get("choose..."));
		JFileChooser p12Chooser = new JFileChooser();
		p12Choosebutton.addActionListener(arg0 -> {

			try {

				p12Chooser.addChoosableFileFilter(
						new FileNameExtensionFilter(I18nString.get("P12 file (*.p12, *.pfx)"), "p12", "pfx"));
				p12Chooser.setAcceptAllFileFilterUsed(false);
				p12Chooser.showOpenDialog(panel);
				File file = p12Chooser.getSelectedFile();
				if (file != null) {

					p12PathField.setText(file.getPath());
				}
			} catch (Exception e) {

				errWithStackTrace(e);
			}
		});
		p12Panel.add(p12Choosebutton);
		panel.add(label_and_object(I18nString.get("P12 file:"), p12Panel));

		JPasswordField p12PasswordField = new JPasswordField();
		panel.add(label_and_object(I18nString.get("Password of p12 file:"), p12PasswordField));

		JPanel buttons = new JPanel();
		buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
		JButton p12CancelButton = new JButton(I18nString.get("Back"));
		JButton p12ChooseDoneButton = new JButton(I18nString.get("Import"));
		buttons.add(p12CancelButton);
		buttons.add(p12ChooseDoneButton);
		buttons.setMaximumSize(new Dimension(Short.MAX_VALUE, p12CancelButton.getMaximumSize().height));
		panel.add(buttons);

		p12CancelButton.addActionListener(arg0 -> {

			p12PathField.setText("");
			p12PasswordField.setText("");
			cardLayout.show(cardPanel, "select panel");
		});
		p12ChooseDoneButton.addActionListener(arg0 -> {

			if (p12PathField.getText().isEmpty())
				return;
			try {

				ca.importP12(p12PathField.getText(), p12PasswordField.getPassword());
				JOptionPane.showMessageDialog(cardPanel, I18nString.get("Successfully imported"));
				dispose();
			} catch (java.nio.file.NoSuchFileException e) {

				JOptionPane.showMessageDialog(cardPanel, I18nString.get("[Error] no such file."));
			} catch (java.io.IOException e) {

				JOptionPane.showMessageDialog(cardPanel, I18nString.get("[Error] incorrect p12file password."));
			} catch (Exception e) {

				JOptionPane.showMessageDialog(cardPanel, I18nString.get("[Error] failed to import."));
				errWithStackTrace(e);
			}
		});

		return panel;
	}

	public void showDialog() {
		setModal(true);
		setVisible(true);
	}
}
/*
 * Copyright 2019 DeNA Co., Ltd.
 *
 * 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 packetproxy.gui;
import static packetproxy.util.Logging.errWithStackTrace;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ItemEvent;
import java.io.File;
import java.util.List;
import java.util.Objects;
import javax.swing.BoxLayout;
import javax.swing.JBu


 result = readCache(datatype.bytes)
            last = result.int
            return result
        }
        throw IndexOutOfBoundsException("Cache size is $cacheSize. Attempt to read byte at ${readBytes + datatype.bytes}")
    }

    /**
     * {RU}
     * Запись значения в кэш *Не используется!*
     *
     * @throws GeneralException
     * {RU}
     *
     * {EN}
     * Cache write *Doesn't use!*
     *
     * @throws GeneralException
     * {EN}
     */
    override fun write(datatype: Datatype, data: ULong) =
        throw GeneralException("You can't write in CachedMemoryStream!")

    /**
     * {RU}
     * Чтение значения из кэша без изменения текущей позиции
     *
     * @param datatype тип данных для загрузки
     * @return вычитанное значение
     * {RU}
     *
     * {EN}
     * Read value from cache without changing count of read bytes
     *
     * @param datatype data type to read
     * @return read value
     * {EN}
     */
    override fun peek(datatype: Datatype) = peekCache(datatype.bytes)

    /**
     * {EN}Reset current count of read bytes from stream{EN}
     *
     * {RU}Откат текущей позиции к исходному состоянию{RU}
     */
    override fun rewind() {
        // TODO: use ByteBuffer's internal position
        readBytes = 0
    }

    override val offset get() = (readBytes.ulong_z - mark).int

    override val data: ByteArray
        get() {
            cache.position(0)
            cache.limit(readBytes)
            return cache.slice().let {
                if (it.hasArray()) {
                    it.array()
                } else {
                    val newArray = ByteArray(readBytes)
                    it.get(newArray)
                    newArray
                }
            }.also {
                cache.limit(cache.capacity())
            }
        }
}

fun ByteBuffer.getNumber(position: Int, size: Int): ULong =
    if (order() != LITTLE_ENDIAN) {
        throw IllegalStateException("Unable to use the ByteBuffer.getNumber with not LE ByteBuffer (Not Implemented)");
    } else {
        when (size) {
            1 -> this.get(position).ulong_z
            2 -> this.getShort(position).ulong_z
            3 -> this.getChar(position).byte.ulong_z or (this.getShort(position + 1).ulong_z shl 8)
            4 -> this.getInt(position).ulong_z
            5 -> this.getChar(position).byte.ulong_z or (this.getInt(position + 1).ulong_z shl 8)
            6 -> this.getShort(position).ulong_z or (this.getInt(position + 2).ulong_z shl 16)
            7 -> {
                // TODO: optimize using read of 8 bytes, if the borders allows
                this.getChar(position).byte.ulong_z or
                        (this.getShort(position + 1).ulong_z shl 8) or
                        (this.getInt(position + 3).ulong_z shl 24)
            }

            8 -> {
                this.getLong(position).ulong
            }

            else -> throw IllegalArgumentException("Wrong ByteBuffer.getNumber size: $size at position $position")
        }
    }

fun ByteBuffer.putNumber(position: Int, value: ULong, size: Int): Unit {
    if (order() != LITTLE_ENDIAN) {
        throw IllegalStateException("Unable to use the ByteBuffer.getNumber with not LE ByteBuffer (Not Implemented)");
    } else when (size) {
        1 -> this.put(position, value.byte)
        2 -> this.putShort(position, value.short)
        3 -> {


// Generic interrupt based serial uart helper code
//
// Copyright (C) 2016-2018  Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.

#include <string.h> // memmove
#include "autoconf.h" // CONFIG_SERIAL_BAUD
#include "board/io.h" // readb
#include "board/irq.h" // irq_save
#include "board/misc.h" // console_sendf
#include "board/pgm.h" // READP
#include "command.h" // DECL_CONSTANT
#include "sched.h" // sched_wake_tasks
#include "serial_irq.h" // serial_enable_tx_irq

#define RX_BUFFER_SIZE 192

static uint8_t receive_buf[RX_BUFFER_SIZE], receive_pos;
static uint8_t transmit_buf[96], transmit_pos, transmit_max;

DECL_CONSTANT("SERIAL_BAUD", CONFIG_SERIAL_BAUD);
DECL_CONSTANT("RECEIVE_WINDOW", RX_BUFFER_SIZE);

// Rx interrupt - store read data
void
serial_rx_byte(uint_fast8_t data)
{
    if (data == MESSAGE_SYNC)
        sched_wake_tasks();
    if (receive_pos >= sizeof(receive_buf))
        // Serial overflow - ignore it as crc error will force retransmit
        return;
    receive_buf[receive_pos++] = data;
}

// Tx interrupt - get next byte to transmit
int
serial_get_tx_byte(uint8_t *pdata)
{
    if (transmit_pos >= transmit_max)
        return -1;
    *pdata = transmit_buf[transmit_pos++];
    return 0;
}

// Remove from the receive buffer the given number of bytes
static void
console_pop_input(uint_fast8_t len)
{
    uint_fast8_t copied = 0;
    for (;;) {
        uint_fast8_t rpos = readb(&receive_pos);
        uint_fast8_t needcopy = rpos - len;
        if (needcopy) {
            memmove(&receive_buf[copied], &receive_buf[copied + len]
                    , needcopy - copied);
            copied = needcopy;
            sched_wake_tasks();
        }
        irqstatus_t flag = irq_save();
        if (rpos != readb(&receive_pos)) {
            // Raced with irq handler - retry
            irq_restore(flag);
            continue;
        }
        receive_pos = needcopy;
        irq_restore(flag);
        break;
    }
}

// Process any incoming commands
void
console_task(void)
{
    uint_fast8_t rpos = readb(&receive_pos), pop_count;
    int_fast8_t ret = command_find_block(receive_buf, rpos, &pop_count);
    if (ret > 0)
        command_dispatch(receive_buf, pop_count);
    if (ret) {
        if (CONFIG_HAVE_BOOTLOADER_REQUEST && ret < 0 && pop_count == 32
            && !memcmp(receive_buf, " \x1c Request Serial Bootloader!! ~", 32))
            bootloader_request();
        console_pop_input(pop_count);
        if (ret > 0)
            command_send_ack();
    }
}
DECL_TASK(console_task);

// Encode and transmit a "response" message
void
console_sendf(const struct command_encoder *ce, va_list args)
{
    // Verify space for message
    uint_fast8_t tpos = readb(&transmit_pos), tmax = readb(&transmit_max);
    if (tpos >= tmax) {
        tpos = tmax = 0;
        writeb(&transmit_max, 0);
        writeb(&transmit_pos, 0);
    }
    uint_fast8_t max_size = READP(ce->max_size);
    if (tmax + max_size > sizeof(transmit_buf)) {
        if (tmax + max_size - tpos > sizeof(transmit_buf))
            // Not enough space for message
            return;
        // Disable TX irq and move buffer
        writeb(&transmit_max, 0);
        tpos = readb(&transmit_pos);
        tmax -= tpos;
        memmove(&transmit_buf[0], &transmit_buf[tpos], tmax);
        writeb(&transmit_pos, 0);
        writeb(&transmit_max, tmax);
        serial_enable_tx_irq();
    }

    // Generate message
    uint8_t *buf = &transmit_buf[tmax];
    uint_fast8_t msglen = command_encode_and_frame(buf, ce, args);

    // Start message transmit
    writeb(&transmit_max, tmax + msglen);
    serial_enable_tx_irq();
}


et:
		_, isSet := hooks.GetTrustAllSetting(ctx.GitX)
		if !isSet {
			ctx.Log.Info("The current repository does not have trust settings.")
		} else {
			err := hooks.SetTrustAllSetting(ctx.GitX, false, true)
			ctx.Log.AssertNoErrorPanic(err, "Could not unset trust settings.")
		}

		ctx.Log.Info("The current repository is no longer trusted.")

	case trustRevoke:
		fallthrough
	case trustDelete:
		err := hooks.SetTrustAllSetting(ctx.GitX, false, false)
		ctx.Log.AssertNoErrorPanicF(err, "Could not set trust settings.")
		ctx.Log.Info("The current repository is no longer trusted.")
	}

	if opt == trustDelete {
		err := os.RemoveAll(file)
		ctx.Log.AssertNoErrorPanicF(err, "Could not remove trust marker '%s'.", file)

		ctx.Log.Info("The trust marker is removed from the repository.")

		if !ctx.GitX.IsBareRepo() {
			ctx.Log.Info("Do not forget to commit and push it!")
		}
	}
}

// NewCmd creates this new command.
func NewCmd(ctx *ccm.CmdContext) *cobra.Command {

	trustCmd := &cobra.Command{
		Use:   "trust",
		Short: "Manages settings related to trusted repositories.",
		Long: `Sets up, or reverts the trusted setting for the local repository.

When called without arguments, it marks the local repository as trusted.

The 'revoke' argument resets the already accepted trust setting,
and the 'delete' argument also deletes the trust marker.

The 'forget' option unsets the trust setting, asking for accepting
it again next time, if the repository is marked as trusted.`,
		Run: func(cmd *cobra.Command, args []string) {
			runTrust(ctx, trustAdd)
		}}

	trustRevokeCmd := &cobra.Command{
		Use:   "revoke",
		Short: `Revoke repository trust settings.`,
		Run: func(cmd *cobra.Command, args []string) {
			runTrust(ctx, trustRevoke)
		}}

	trustForgetCmd := &cobra.Command{
		Use:   "forget",
		Short: `Forget repository trust settings.`,
		Run: func(cmd *cobra.Command, args []string) {
			runTrust(ctx, trustForget)
		}}

	trustDeleteCmd := &cobra.Command{
		Use:   "delete",
		Short: `Delete repository trust settings.`,
		Run: func(cmd *cobra.Command, args []string) {
			runTrust(ctx, trustDelete)
		}}

	trustCmd.AddCommand(
		ccm.SetCommandDefaults(ctx.Log, trustRevokeCmd),
		ccm.SetCommandDefaults(ctx.Log, trustForgetCmd),
		ccm.SetCommandDefaults(ctx.Log, trustDeleteCmd),
		ccm.SetCommandDefaults(ctx.Log, NewTrustHooksCmd(ctx)))

	trustCmd.PersistentPreRun = func(_ *cobra.Command, _ []string) {
		ccm.CheckGithooksSetup(ctx.Log, ctx.GitX)
	}

	return ccm.SetCommandDefaults(ctx.Log, trustCmd)
}
package ccm

import (
	"strings"

	"github.com/spf13/cobra"
)

func indentLeft(s string, firstPrefix string, indent string) string {
	return firstPrefix + strings.ReplaceAll(s, "\n", "\n"+indent)
}

var usageTemplate = `Usage:{{if .Runnable}}
  {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}


(n.a)&&isFinite(n.b)?new A.qW(n,b.b,b.c):c}else m=c
l=d.b[d.c].gi()
k=d.c
while(!0){if(!(k!==d.d&&l.b==null))break
k+=q?-1:1
l=d.b[k].gi()}b=l.b
if(b!=null){p=d.b[k]
o=d.a.gP()
o.toString
j=A.bC(p.b5(t.x.a(o)),b.a)
i=isFinite(j.a)&&isFinite(j.b)?new A.qW(j,b.b,b.c):c}else i=c
h=A.a([],t.AO)
g=d.ganb()?new A.u(0,0,0+d.gTP().a,0+d.gTP().b):c
for(f=d.d;f<=d.c;++f){e=d.b[f].gi().d
b=new A.V(e,new A.aaF(d,f,g),A.S(e).h("V<1,u>")).CP(0,new A.aaG())
B.b.L(h,A.Z(b,!0,b.$ti.h("w.E")))}return new A.nR(m,i,!s.k(0,l)?B.lh:s.c,h,!0)},
Mc(a,b){var s=b>a
while(!0){if(!(a!==b&&this.b[a].gi().c!==B.lh))break
a+=s?1:-1}return a},
kJ(a,b){return},
ahK(){var s,r=this,q=null,p=r.e,o=r.r,n=r.d
if(n===-1||r.c===-1){n=r.f
if(n!=null){n.kJ(q,q)
r.f=null}n=r.w
if(n!=null){n.kJ(q,q)
r.w=null}return}if(!J.d(r.b[n],r.f)){n=r.f
if(n!=null)n.kJ(q,q)}if(!J.d(r.b[r.c],r.w)){n=r.w
if(n!=null)n.kJ(q,q)}n=r.b
s=r.d
n=r.f=n[s]
if(s===r.c){r.w=n
n.kJ(p,o)
return}n.kJ(p,q)
n=r.b[r.c]
r.w=n
n.kJ(q,o)},
NS(){var s,r,q,p=this,o=p.d,n=o===-1
if(n&&p.c===-1)return
if(n||p.c===-1){if(n)o=p.c
n=p.b
new A.aR(n,new A.aaC(p,o),A.S(n).h("aR<1>")).ah(0,new A.aaD(p))
return}n=p.c
s=Math.min(o,n)
r=Math.max(o,n)
for(q=0;n=p.b,q<n.length;++q){if(q>=s&&q<=r)continue
p.fL(n[q],B.j_)}},
amX(a){var s,r,q,p=this
for(s=p.b,r=s.length,q=0;q<s.length;s.length===r||(0,A.K)(s),++q)p.fL(s[q],a)
p.d=0
p.c=p.b.length-1
return B.f3},
amY(a){var s,r,q,p,o,n=this


# -*- coding: utf-8 -*-

# SPDX-FileCopyrightText: 2024 Roman Koch <koch.roman@gmail.com>
# SPDX-FileType: SOURCE
# SPDX-FileContributor: Created by Roman Koch
# SPDX-License-Identifier: MIT

from commander.radar.GenericCmd import GenericCmd

class FormatCmd(GenericCmd):
    MODE = {
        'POSITION': 0x01,
        'AREA': 0x02,
        'COMBO': 0x03,

        'UNDEFINED': 0xff,
    }

    def __init__(self, command):
        GenericCmd.__init__(self, command)


党委不是黑帮。”

   7月1日陶铸在北大讲话，就污蔑北六“六．一八”事件说“6月18日少数坏分子打架”。还说什么“在我们中宣部也有左、右、中间派。现在都以革命面目出现，现在是左、右派互相点名，这里边有个真左派，假右派的问题”。

   《红旗》点名批判反革命修正主义头目周扬，刘少奇亲自派人对周扬加以安慰，叫他“不要紧张”，同时陶铸又叫张平化给周扬打电话，传达刘邓的这个意见，让其“安心休养”。

   7月3日陶铸给医科大学铁杆保皇份子顾瑞华的复信张贴在医大主楼上，公开为卫生部钱信忠等打保票。

   7月8日药研所张佩儒等四人写信给陶铸，颠倒黑白，混淆是非，污蔑董莉玉同志(是解放军派至卫生部工作组组长，放手发动群众，矛头指向卫生部)，陶铸看后批示：“文涛，信忠：我建议把这封信印发给工作组与学校文革小组全体成员，讨论统一认识，董必须承认错误，服从领导，否则撤消职务，送回部队”。

   7月13日陶铸遵照刘邓黑司令部的指示，破坏中小学文化大革命。经陶铸审批何伟签发的一个《关于中小学招生、考试、放假、毕业等问题的通知》要县以下的中学校招生、搞毕业、搞分配，不让中学生、小学教师参加文化大革命。”

   陶铸当天还直接向卫生部长钱信忠下黑指示，说汁么“现在敌人也要插手领导运动，敌人要插手这点要看到，但是……敌人一活动你就马上顶回去是不行的”，还疯狂叫嚣“最好要排队，先排当权派然后资产阶级‘权威’，中学生不排队，大学生要排队，最后要清理，现行反革命分子要处理”。

   7月14日陶铸按刘邓指示，宣布新的中宣部成立。任命他从中南带来的张平化、雍文涛和旧中


// h+=Sigma1(e)
	eor	x28,x28,x23			// Maj(a,b,c)
	eor	x17,x9,x22,ror#39	// Sigma0(a)
	eor	x7,x7,x0,lsr#6	// sigma1(X[i+14])
	add	x2,x2,x11
	add	x25,x25,x21			// d+=h
	add	x21,x21,x28			// h+=Maj(a,b,c)
	ldr	x28,[x30],#8		// *K++, x19 in next round
	add	x2,x2,x8
	add	x21,x21,x17			// h+=Sigma0(a)
	add	x2,x2,x7
	ldr	x7,[sp,#0]
	str	x10,[sp,#24]
	ror	x16,x25,#14
	add	x20,x20,x28			// h+=K[i]
	ror	x9,x4,#1
	and	x17,x26,x25
	ror	x8,x1,#19
	bic	x28,x27,x25
	ror	x10,x21,#28
	add	x20,x20,x2			// h+=X[i]
	eor	x16,x16,x25,ror#18
	eor	x9,x9,x4,ror#8
	orr	x17,x17,x28			// Ch(e,f,g)
	eor	x28,x21,x22			// a^b, b^c in next round
	eor	x16,x16,x25,ror#41	// Sigma1(e)
	eor	x10,x10,x21,ror#34
	add	x20,x20,x17			// h+=Ch(e,f,g)
	and	x19,x19,x28			// (b^c)&=(a^b)
	eor	x8,x8,x1,ror#61
	eor	x9,x9,x4,lsr#7	// sigma0(X[i+1])
	add	x20,x20,x16			// h+=Sigma1(e)
	eor	x19,x19,x22			// Maj(a,b,c)
	eor	x17,x10,x21,ror#39	// Sigma0(a)
	eor	x8,x8,x1,lsr#6	// sigma1(X[i+14])
	add	x3,x3,x12
	add	x24,x24,x20			// d+=h
	add	x20,x20,x19			// h+=Maj(a,b,c)
	ldr	x19,[x30],#8		// *K++, x28 in next round
	add	x3,x3,x9
	add	x20,x20,x17			// h+=Sigma0(a)
	add	x3,x3,x8
	cbnz	x19,.Loop_16_xx

	ldp	x0,x2,[x29,#96]
	ldr	x1,[x29,#112]
	sub	x30,x30,#648		// rewind

	ldp	x3,x4,[x0]
	ldp	x5,x6,[x0,#2*8]
	add	x1,x1,#14*8			// advance input pointer
	ldp	x7,x8,[x0,#4*8]
	add	x20,x20,x3
	ldp	x9,x10,[x0,#6*8]
	add	x21,x21,x4
	add	x22,x22,x5
	add	x23,x23,x6
	stp	x20,x21,[x0]
	add	x24,x24,x7
	add	x25,x25,x8
	stp	x22,x23,[x0,#2*8]
	add	x26,x26,x9
	add


green-100 border-solid border-0 border-l-4 border-green-500 text-green-700': state.messages[index] && state.messages[index].message.severity == 'success',
                    'bg-orange-100 border-solid border-0 border-l-4 border-orange-500 text-orange-700': state.messages[index] && state.messages[index].message.severity == 'warn',
                    'bg-red-100 border-solid border-0 border-l-4 border-red-500 text-red-700': state.messages[index] && state.messages[index].message.severity == 'error'
                })
            };
        },
        wrapper: 'flex items-center py-5 px-7',
        icon: {
            className: classNames('w-6 h-6', 'text-lg mr-2')
        },
        text: 'text-base font-normal',
        button: {
            className: classNames('w-8 h-8 rounded-full bg-transparent transition duration-200 ease-in-out', 'ml-auto overflow-hidden relative', 'flex items-center justify-center', 'hover:bg-white/30')
        },
        transition: {
            enterFromClass: 'opacity-0',
            enterActiveClass: 'transition-opacity duration-300',
            leaveFromClass: 'max-h-40',
            leaveActiveClass: 'overflow-hidden transition-all duration-300 ease-in',
            leaveToClass: 'max-h-0 opacity-0 !m-0'
        }
    }
}
        `
    };

    const code2 = {
        javascript: `
import React, { useEffect, useRef } from 'react';
import { useMountEffect } from 'primereact/hooks';
import { Messages } from 'primereact/messages';

export default function UnstyledDemo() {
    const msgs = useRef(null);

    useMountEffect(() => {
        if (msgs.current) {
            msgs.current.clear();
            msgs.current.show([
                { sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content' },
                { sticky: true, severity: 'success', summary: 'Success', detail: 'Message Content' },
                { sticky: true, severity: 'warn', summary: 'Warning', detail: 'Message Content' },
                { sticky: true, severity: 'error', summary: 'Error', detail: 'Message Content' }
            ]);
        }
    });

    return (

            <Messages ref={msgs} />

    )
}
    `
    };

    return (
        <>
            <DocSectionText {...props}>

                    PrimeReact offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the{' '}
                    <Link href="/tailwind">Tailwind Customization</Link> section for an example.

                <DocSectionCode code={code} hideToggleCode import hideStackBlitz />

A playground sample with the pre-built Tailwind theme.

                <DocSectionCode code={code2} embedded />
            </DocSectionText>
        </>
    );
}
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import Link from 'next/link';

export function TailwindDoc(props) {
    const code = {
        basic: `
const Tailwind = {
    knob: {
        root: ({ props }) => ({
            className: classNames('focus:outline-none focus:outline-offset-0 focus:shadow-0', {
                'opacity-60 select-none pointer-events-none cursor-default': props.disabled
            })
        }),
        range: 'stroke-current transition duration-100 ease-in stroke-gray-200 dark:stroke-gray-700 fill-none',
        value: 'animate-dash-frame  stroke-blue-500 fill-none',


{
	  subdivide (table, subtable, si->mr[i].start);
	  subtable += (1 << 8);
	}
      if ((si->mr[i].start + si->mr[i].size) & ((1 << 20) - 1))
	{
	  subdivide (table, subtable, si->mr[i].start + si->mr[i].size);
	  subtable += (1 << 8);
	}
    }

  for (i = 0; (signed) i < si->mr_no; i++)
    if ((si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_DRAM
	|| (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_SRAM
	|| (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_FLASH)
      {
	grub_uint32_t cur, end;
	cur = si->mr[i].start;
	end = si->mr[i].start + si->mr[i].size;
	while (cur < end)
	  {
	    grub_uint32_t *st;
	    if ((table[cur >> 20] & 3) == 2)
	      {
		cur = cur >> 20 << 20;
		table[cur >> 20] = cur | (3 << 10) | (1 << 3) | (1 << 2) | 2;
		cur += (1 << 20);
		continue;
	      }
	    cur = cur >> 12 << 12;
	    st = (grub_uint32_t *) (table[cur >> 20] & ~0x3ff);
	    st[(cur >> 12) & 0xff] = cur | (3 << 4) | (3 << 6)
	      | (3 << 8) | (3 << 10)
	      | (1 << 3) | (1 << 2) | 2;
	    cur += (1 << 12);
	  }
      }

  grub_printf ("MMU tables generated\n");
  if (is_v6_mmu)
    grub_arm_clear_mmu_v6 ();

  grub_printf ("enabling MMU\n");
  grub_arm_enable_mmu (table);
  grub_printf ("MMU enabled\n");
}

#endif

void
grub_arch_sync_caches (void *address, grub_size_t len)
{
  grub_addr_t start = (grub_addr_t) address;
  grub_addr_t end = start + len;

  if (type == ARCH_UNKNOWN)
    probe_caches ();
  start = ALIGN_DOWN (start, grub_arch_cache_max_linesz);
  end = ALIGN_UP (end, grub_arch_cache_max_linesz);
  switch (type)
    {
    case ARCH_ARMV6:
      grub_arm_clean_dcache_range_armv6 (start, end, grub_arch_cache_dlinesz);
      grub_arm_invalidate_icache_range_armv6 (start, end,
					      grub_arch_cache_ilinesz);
      break;
    case ARCH_ARMV7:
      grub_arm_clean_dcache_range_armv7 (start, end, grub_arch_cache_dlinesz);
      grub_arm_invalidate_icache_range_armv7 (start, end,
					      grub_arch_cache_ilinesz);
      break;
      /* Nothing to do.  */
    case ARCH_ARMV5_WRITE_THROUGH:
    case ARCH_ARMV6_UNIFIED:
      break;
      /* Pacify GCC.  */
    case ARCH_UNKNOWN:
      break;
    }
}

void
grub_arm_disable_caches_mmu (void)
{
  if (type == ARCH_UNKNOWN)
    probe_caches ();
  switch (type)
    {
    case ARCH_ARMV5_WRITE_THROUGH:
    case ARCH_ARMV6_UNIFIED:
    case ARCH_ARMV6:
      grub_arm_disable_caches_mmu_armv6 ();
      break;
    case ARCH_ARMV7:
      grub_arm_disable_caches_mmu_armv7 ();
      break;
      /* Pacify GCC.  */
    case ARCH_UNKNOWN:
      break;
    }
}


.RecommendedLiterature.Mnemonic.LiteratureGutenschwager";
    t[9077] = "u";
    t[9078] = "ScriptPopup.Simulation.TriggerScript";
    t[9079] = "Skript an Station zeitverz\u00f6gert ausf\u00fchren";
    t[9084] = "Help.Search.Search";
    t[9085] = "Suchen";
    t[9088] = "Statistic.Viewer.Report.Settings.Fonts.Size";
    t[9089] = "Schriftgr\u00f6\u00dfe";
    t[9108] = "Simulation.Log.ResourceFailure";
    t[9109] = "Ressource";
    t[9114] = "Resources.Number.bySchedule";
    t[9115] = "Anzahl gem\u00e4\u00df Schichtplan";
    t[9118] = "Simulation.Creator.InputConnectionsNotMatching";
    t[9119] = "Bei Element id=%d stimmt die Anzahl an geplanten und an tats\u00e4chlichen einlaufenden Kanten nicht \u00fcberein.";
    t[9120] = "Editor.SurfaceTooltip.PasteFromClipboard";
    t[9121] = "Element aus Zwischenablage einf\u00fcgen";
    t[9122] = "Statistics.XML.RunTime";
    t[9123] = "StatistikLaufzeit";
    t[9132] = "Elements.Catalog.DataInputOutput";
    t[9133] = "Daten Ein-/Ausgabe";
    t[9134] = "Surface.CounterMulti.Dialog.GroupName.Short";
    t[9135] = "Gruppe";
    t[9140] = "ModelDescription.TransportTransporterSource.Capacity";
    t[9141] = "Parkplatzkapazit\u00e4t";
    t[9144] = "Surface.Process.Dialog.Tab.Operators.Alternative.Delete.Confirm.InfoNo";
    t[9145] = "Bedienalternative beibehalten.";
    t[9152] = "Surface.Process.XML.TimeType.Nothing";
    t[9153] = "nichts";
    t[9156] = "Statistics.TimesByStationsAndClientTypes";
    t[9157] = "Zeiten nach Stationen und Kundentypen";
    t[9164] = "ExpressionBuilder.ProbabilityDistributions.ChiSquareDistribution.DensityInfo";
    t[9165] = "
Berechnet den Wert der Dichte der Chi2-Verteilung an der als ersten Parameter angegebenen Stelle mit der Anzahl an Freiheitsgraden gem\u00e4\u00df dem zweiten Parameter.
";
    t[9168] = "ParameterCompare.Select.Title.Store";
    t[9169] = "Statistikergebnisse speichern";
    t[9170] = "Resources.Group.EditName.Dialog.Title";
    t[9171] = "Bedienergruppe bearbeiten";
    t[9174] = "Surface.AnimationLCD.XML.SegmentLineWidth";
    t[9175] = "ModellElementAnimationLCDLinienbreite";
    t[9176] = "SoundSelectPanel.Play.ErrorTitle";
    t[9177] = "Sound-Ausgabefehler";
    t[9178] = "Surface.UserStatistic.XML.Record.Key";
    t[9179] = "Bezeichner";
    t[9188] = "Simulation.Log.LogicIf.ConditionFalse";
    t[9189] = "Kunde: %s, Bedingung nicht erf\u00fcllt, Weiterleitung zu id=%d";
    t[9196] = "ExpressionBuilder.SimulationCharacteristics.ProcessingTimesOverAll.CoefficientOfVariationOfTheTime";


 set_mix(&mut self, mix: f64, tween: Tween) -> Result<(), CommandError> {
		self.command_producer
			.push(Command::SetMix(mix, tween))
			.map_err(|_| CommandError::CommandQueueFull)
	}
}
<filename>rusty-poker/src/calculator/mod.rs
use hand;
use table;
use types;

mod flush;
mod four_of_a_kind;
mod full_house;
mod kickers;
mod pair;
mod straight;
mod straight_flush;
mod three_of_a_kind;
mod two_pairs;

mod utility;

pub struct Calculator {}

impl Calculator {
  pub fn get_highest_combination<'a>(
    hand: &'a hand::Hand,
    table: &'a table::Table,
  ) -> types::Combination {
    let sorted_cards = utility::combine_hand_and_table(&hand.cards[..], &table.cards[..]);

    utility::check_cards_sanity(&sorted_cards);

    if let Some(result) = straight_flush::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = four_of_a_kind::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = full_house::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = flush::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = straight::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = three_of_a_kind::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = two_pairs::test(sorted_cards.clone()) {
      return result;
    }

    if let Some(result) = pair::test(sorted_cards.clone()) {
      return result;
    }

    return kickers::test(sorted_cards);
  }
}
<reponame>crschmidt/abstreet<gh_stars>1000+
use map_gui::ID;
use map_model::{Map, Position};
use sim::{AgentID, Sim};
use widgetry::{GfxCtx, Key, Text};

use crate::app::App;

pub struct ObjectDebugger;

impl ObjectDebugger {
    pub fn draw(&self, g: &mut GfxCtx, app: &App) {
        if g.is_key_down(Key::LeftControl) {
            if let Some(pt) = g.canvas.get_cursor_in_map_space() {
                let mut txt = Text::new();
                txt.add_line(pt.to_string());
                txt.add_line(pt.to_gps(app.primary.map.get_gps_bounds()).to_string());
                txt.add_line(format!("{:?}", g.canvas.get_cursor()));
                txt.add_line(format!("zoom: {}", g.canvas.cam_zoom));
                txt.add_line(format!(
                    "cam_x = {}, cam_y = {}",
                    g.canvas.cam_x, g.canvas.cam_y
                ));
                if let Some(ID::Lane(l)) = app.primary.current_selection {
                    let lane = app.primary.map.get_l(l);
                    let pl = &lane.lane_center_pts;
                    if let Some((dist, _)) = pl.dist_along_of_point(pl.project_pt(pt)) {
                        txt.add_line(Position::new(l, dist).to_string());
                    }
                    txt.add_line(format!(
                        "{:?}",
                        lane.get_nearest_side_of_road(&app.primary.map)
                    ));
                }
                g.draw_


34 30.3-16.9L224 392.7l39.2 21.9 30.3 16.9-6.8-34L278 353.5l33-30.5 25.5-23.5L302 295.4l-44.6-5.3-18.8-40.8zM216 311.6l8-17.4 8 17.4 3.8 8.1 8.9 1.1 19.1 2.3-14.1 13-6.6 6.1 1.7 8.8 3.7 18.8-16.8-9.4-7.8-4.4-7.8 4.4-16.8 9.4 3.7-18.8 1.7-8.8-6.6-6.1-14.1-13 19.1-2.3 8.9-1.1 3.8-8.1z"],"user-hair-mullet":[448,512,["business-front","party-back","trian-balbot"],"e45c","M320 144V128c0-5.5-.5-10.8-1.3-16H256h-8.6l-4.8-7.1L224 76.8l-18.7 28-4.8 7.1H192 129.3c-.9 5.2-1.3 10.5-1.3 16v16c0 53 43 96 96 96s96-43 96-96zm40-32h-9c.7 5.2 1 10.6 1 16v16c0 15.6-2.8 30.6-7.9 44.5c.7 26.5 7.7 46.3 21.3 66.6l10.1 15.1-16.2 8.1-16 8-14.3 7.2-14.3-28.6 14.3-7.2 .6-.3c-4.6-8.7-8.3-17.6-11.1-26.9c-5.7 6.3-12.1 12-19 17l11.8 35.5 5.1 15.2-30.4 10.1-5.1-15.2-10-29.9c-14.5 5.7-30.3 8.8-46.9 8.8s-32.3-3.1-46.9-8.8l-10 29.9-5.1 15.2-30.4-10.1 5.1-15.2 11.8-35.5c-6.9-5-13.2-10.7-19-17c-2.8 9.3-6.5 18.2-11.1 26.9l.6 .3 14.3 7.2-14.3 28.6-14.3-7.2-16-8-16.2-8.1 10.1-15.1c13.5-20.3 20.6-40.2 21.3-66.6C98.8 174.6 96 159.6 96 144V128c0-5.4 .3-10.8 1-16H88V80h16 1.3c19-46.9 65-80 118.7-80s99.7 33.1 118.7 80H344h16v32zM183.4 80l27.2-40.9 4.5-6.7c-31.8 2.9-59.1 21.3-74.3 47.6h42.6zm123.7 0c-15.2-26.3-42.5-44.7-74.3-47.6l4.5 6.7L264.6 80h42.6zM44.4 480H403.6L360.9 352H87.1L44.4 480zM64 320H384l53.3 160L448 512H414.3 33.7 0l10.7-32L64 320z"],"microphone-stand":[512,512,[127908],"f8cb","M449.5 186.9L325.1 62.5l4.7-4.7c34.4-34.4 90.1-34.4 124.4 0s34.4 90.1 0 124.5l-4.7 4.7zm-22.6 22.6l-4.7 4.7c-15.2 15.2-34.7 23.7-54.6 25.4l-6.4-6.4-82.6-82.6-6.4-6.4c1.7-19.9 10.2-39.3 25.4-54.6l4.


 () => {
    const actual = convert(8_760 as Hours, "hours", "years", {
      month: "January",
      year: 2021 as Years,
    });
    const expected = 1 as Years;

    expect(actual).toEqual<typeof actual>(expected);
  });

  test("hours => 1 year (for 2020, leap year)", () => {
    const actual = convert(8_784 as Hours, "hours", "years", {
      month: "January",
      year: 2020 as Years,
    });
    const expected = 1 as Years;

    expect(actual).toEqual<typeof actual>(expected);
  });

  test("hours => 4 years (for 2020)", () => {
    const actual = convert(35_064 as Hours, "hours", "years", {
      month: "January",
      year: 2020 as Years,
    });
    const expected = 4 as Years;

    expect(actual).toEqual<typeof actual>(expected);
  });

  test("hours => decades (for 2020)", () => {
    const actual = convert(87_672 as Hours, "hours", "decades", {
      month: "January",
      year: 2020 as Years,
    });
    const expected = 1 as Decades;

    expect(actual).toEqual<typeof actual>(expected);
  });

  test("hours => centuries (for 2020)", () => {
    const actual = convert(876_576 as Hours, "hours", "centuries", {
      month: "January",
      year: 2020 as Years,
    });
    const expected = 1 as Centuries;

    expect(actual).toEqual<typeof actual>(expected);
  });

  test("hours => millenniums (for 2020)", () => {
    const actual = convert(8_765_808 as Hours, "hours", "millenniums", {
      month: "January",
      year: 2020 as Years,
    });
    const expected = 1 as Millenniums;

    expect(actual).toEqual<typeof actual>(expected);
  });
});
import Person from "../class/Person";

export default class Finery extends Person {
    protected Person: Person | undefined;
    public Decorate(person: Person) {
        this.Person = person;
    }

    Show() {
        if (this.Person !== undefined) {
            this.Person.Show();
        }
    }
}import {
  BeforeInsert,
  BeforeUpdate,
  CreateDateColumn,
  Entity,
  ManyToOne,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

import User from './User';

@Entity({ name: 'sessions' })
class Session {
  @PrimaryGeneratedColumn()
  id: number;

  @CreateDateColumn({ type: 'timestamp with time zone' })
  createdAt: Date;

  @UpdateDateColumn({ type: 'timestamp with time zone' })
  updatedAt: Date;

  @ManyToOne(() => User)
  user: User;

  @BeforeInsert()
  private setCreationDate(): void {
    this.createdAt = new Date();
  }

  @BeforeInsert()
  @BeforeUpdate()
  private setUpdateDate(): void {
    this.updatedAt = new Date();
  }
}

export default Session;
import 'jasmine'
import rewire from 'rewire'
import * as ConfigTasks from '../ConfigTasks'

const MockConfigTasks = rewire<typeof ConfigTasks>('../ConfigTasks')

describe('ConfigTasks', () => {
  describe('GetConfig', () => {
    it('should join paths to get the config path', (done) => {
      const mockCheckConfig = jasmine.createSpy('checkConfig')
      const mockSetBaseConfigResponse = {}
      const mockSetBaseConfig = jasmine.createSpy('setConfig').and.returnValue(mockSetBaseConfigResponse)
      const mockPath = {
        default: {
          join: jasmine.createSpy('join').and.returnValue('full path')
        }
      }
      const mockFs = {
        promises: {
          readFile: jasmine.createSpy('readFile').and.returnValue(Promise.resolve('{"test": "test"}'))
        }
      }
      MockConf


		return this._config;
		}

		this._items.forEach(item => {
			switch (item.type) {
			case 'env':
				this._config = this.merge(this._config, this.loadEnvironment(item.value));
				break;
			case 'file':
				this._config = this.merge(this._config, this.loadConfigFile(item.value));
				break;
			case 'obj':
				this._config = this.merge(this._config, item.value);
				break;
			}
		});

		return this._config;
	}

	private loadEnvironment(prefix: string): object {
		const pfx = prefix.toUpperCase();
		const env = process.env;
		const config = {};

		Object.keys(env)
			.map(key => key.toUpperCase())
			.filter(key => key.startsWith(pfx))
			.map(key => key.replace(`${pfx}_`, ''))
			.forEach(key => {
				const segments = key.split('_');
				const value = env[key];

				const setObject = (object: object, keys: string[], value: string) => {
					const key = keys.shift();
					object[key] = object[key] || {};

					if (keys.length === 0) {
						if (value.toLowerCase && value.toLowerCase() === 'false') {
							object[key] = false;
							return;
						}
						if (value.toLowerCase && value.toLowerCase() === 'true') {
							object[key] = true;
							return;
						}

						const num  = this.parseFloat(value);
						if (!isNaN(num)) {
							object[key] = num;
						} else {
							object[key] = value;
						}
						return;
					}

					return setObject(object[key], keys, value);
				};

				setObject(config, segments, value);
			});

		return config;
	}

	private loadConfigFile(filename: string): object {
		if (!filename.endsWith('.json')) {
			throw new Error(`Configuration file '${filename}' is not a JSON file`);
		}
		if (!fs.existsSync(filename)) {
			throw new Error(`Failed to load configuration file '${filename}'`);
		}

		return require(filename);
	}

	private parseFloat(num: string): number {
		if (/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/.test(num)) {
			return Number(num);
		}

		return NaN;
	}

	private merge(targetObject: object, sourceObject: object): T {
		return merge.recursive(true, targetObject, sourceObject);
	}
}
import { Component, OnInit, Input, ContentChildren, QueryList, Output, EventEmitter, HostBinding, HostListener, ElementRef } from '@angular/core';
import { DoubleSliderLabelComponent } from './double-slider-label.component';
import { DoubleSliderTickComponent } from './double-slider-tick.component';

@Component({
  selector: 'app-double-slider',
  templateUrl: './double-slider.component.html',
  styleUrls: ['./double-slider.component.scss']
})
export class DoubleSliderComponent {
  constructor(private _el: ElementRef) { }

  @ContentChildren(DoubleSliderLabelComponent) labels: QueryList<DoubleSliderLabelComponent>;
  @ContentChildren(DoubleSliderTickComponent) ticks: QueryList<DoubleSliderTickComponent>;

  _leftValue = 2;
  _rightValue = 5;

  _isDraggingLeft = false;
  _isDraggingRight = false;
  get _isDragging(): boolean { return this._isDraggingLeft || this._isDraggingRight };

  get leftValue(): number { return this._leftValue; }
  get rightValue(): number { return this._rightValue; }

  get left


 SectorParameters
                {
                    Length = 400f,
                    Tickrate = 2,
                    CanHitSameTargetConsecutively = true,
                    OverrideFlags = SpellDataFlags.AffectEnemies | SpellDataFlags.AffectNeutral | SpellDataFlags.AffectMinions | SpellDataFlags.AffectHeroes,
                    Type = SectorType.Area
                });

                SlowSector = spell.CreateSpellSector(new SectorParameters
                {
                    Length = 400f,
                    Tickrate = 4,
                    CanHitSameTargetConsecutively = true,
                    OverrideFlags = SpellDataFlags.AffectEnemies | SpellDataFlags.AffectNeutral | SpellDataFlags.AffectMinions | SpellDataFlags.AffectHeroes,
                    Type = SectorType.Area
                });
            }
        }

        public void TargetExecute(Spell spell, AttackableUnit target, SpellMissile missile, SpellSector sector)
        {
            if (!spell.CastInfo.Owner.HasBuff(thisBuff))
            {
                return;
            }

            if (SlowSector != null && sector == SlowSector)
            {
                AddBuff("Chilled", 1.0f, 1, spell, target, spell.CastInfo.Owner);

                return;
            }

            var ap = spell.CastInfo.Owner.Stats.AbilityPower.Total * 0.125f;
            var damage = 40 + (20 * (spell.CastInfo.SpellLevel - 1)) + ap;

            target.TakeDamage(spell.CastInfo.Owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELLAOE, false);
            AddBuff("Chilled", 1.0f, 1, spell, target, spell.CastInfo.Owner);
        }
    }
}


_single {
  padding: 8px;
}

.detail_theme_record_blocks.detailview_record_detail {
  border-bottom: 1px solid var(--grist-theme-card-list-blocks-border, var(--grist-color-dark-grey));
  padding-bottom: 8px;
}

.detail_theme_field_blocks {
  padding: 6px;
  margin: 8px;
  background-color: var(--grist-theme-card-blocks-bg, var(--grist-color-medium-grey));
  border-radius: 2px;
}

.detail_theme_field_blocks .g_record_detail_label {
  font-size: var(--grist-small-font-size);
  color: var(--grist-theme-card-blocks-label, var(--grist-color-slate));
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  margin-left: 3px;     /* to align with the .field_clip content */
  margin-right: -6px;   /* allow labels to overflow into the padding */
  margin-bottom: 4px;
}

@media print {
  .detail_theme_record_compact {
    background-color: var(--grist-color-medium-grey) !important;
  }
  .detail_theme_record_compact > .g_record_detail_inner {
    background-color: white !important;
  }
  .detail_theme_field_blocks {
    background-color: var(--grist-color-medium-grey) !important;
  }
}
/* This file is auto-generated by buildtools/genIconCSS.ts */
/* Do not edit it manually. */

@layer grist-base {
  :root {
    --icon-ChartArea: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMy4xOTA5ODMwMSw4IEw1LjA1Mjc4NjQsNC4yNzYzOTMyIEM1LjE4NzI4NTQ0LDQuMDA3Mzk1MTIgNS41MjcxMTE4MSwzLjkxNzE0OTMzIDUuNzc3MzUwMSw0LjA4Mzk3NDg1IEwxMS4zMzE2NDU0LDcuNzg2ODM4MzcgTDE1LjA2NTg3ODQsMS4yNTE5MzA1MyBDMTUuMjAyODgzNCwxLjAxMjE3MTgxIDE1LjUwODMxMDcsMC45Mjg4NzM0NDQgMTUuNzQ4MDY5NSwxLjA2NTg3ODQzIEMxNS45ODc4MjgyLDEuMjAyODgzNDEgMTYuMDcxMTI2NiwxLjUwODMxMDc1IDE1LjkzNDEyMTYsMS43NDgwNjk0NyBMMTEuOTM0MTIxNiw4Ljc0ODA2OTQ3IEMxMS43OTAzOTc0LDguOTk5NTg2NzggMTEuNDYzNjgyNyw5LjA3NjcxMzY2IDExLjIyMjY0OTksOC45MTYwMjUxNSBMNS42OTM5MTU3OSw1LjIzMDIwMjQxIEw0LjEzODI4NDI0LDguMzQxNDY1NTEgTDEwLjQ0NTk1MTMsMTIuODQ2OTQyIEwxNS4xNDY0NDY2LDguMTQ2NDQ2NjEgQzE1LjQ2MTQyOSw3LjgzMTQ2NDE4IDE2LDguMDU0NTQ3NTcgMTYsOC41IEwxNiwxNS4wMDAxMDk1IEMxNiwxNS4yNzYyNTMzIDE1Ljc3NjE0MDEsMTUuNTAwMTExNSAxNS40OTk5OTYzLDE1LjUwMDEwOTUgTDAuNDk5OTk2MzQ5LDE1LjUgQzAuMjIzODU1NCwxNS40OTk5OTggMCwxNS4yNzYxNDA5IDAsMTUgTDAsOC41IEMwLDgu


'''
    Project: Gui Gin Rummy
    File name: canvas_item.py
    Author: William Hale
    Date created: 3/14/2020
'''

# from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from rlcard.agents.gin_rummy_human_agent.gui_gin_rummy.game_canvas import GameCanvas
    from rlcard.agents.gin_rummy_human_agent.gui_cards.card_image import CardImage

class CanvasItem(object):

    def __init__(self, item_id: int, game_canvas: 'GameCanvas'):
        self.item_id = item_id
        self.game_canvas = game_canvas

    def __eq__(self, other):
        if isinstance(other, int):  # FIXME: temporary kludge to convert all item_id to CanvasItem
            return other == self.item_id
        return isinstance(other, CanvasItem) and self.item_id == other.item_id

    def __hash__(self):
        return hash(self.item_id)

    def get_tags(self):
        return self.game_canvas.gettags(self.item_id)

class CardItem(CanvasItem):

    def __init__(self, item_id: int, card_id: int, card_image: 'CardImage', game_canvas: 'GameCanvas'):
        super().__init__(item_id=item_id, game_canvas=game_canvas)
        self.card_id = card_id
        self.card_image = card_image

    def is_face_up(self) -> bool:
        return self.card_image.face_up

    def set_card_id_face_up(self, face_up: bool):
        if self.card_image.face_up != face_up:
            target_image = self.card_image if face_up else self.game_canvas.card_back_image
            self.game_canvas.itemconfig(self.item_id, image=target_image)
            self.card_image.face_up = face_up

    def flip_over(self):
        self.card_image.face_up = not self.card_image.face_up
        target_image = self.card_image if self.card_image.face_up else self.game_canvas.card_back_image
        self.game_canvas.itemconfig(self.item_id, image=target_image)


-sliding-panes-header-alt', 'Swap rotated header direction', 'headerAlt');
  }
}/**
 * 程序事件处理接口定义
 * @param  {string} topic 标志
 * @param  {any} data 数据
 * @param  {(e:any,data?:any)=>void} handler 回调方法
 */
interface IAppEvent {
  topic: string;
  data: any;
  handler:(e:any, data:any)=> void;
}
/**
 * 中介器接口
 */
interface IMediator {

  /**
   * 触发事件，事件被触发，所有订阅的地方都会收到通知
   * @param  {IAppEvent} e
   * @returns void
   */
  publish(e:IAppEvent):void;
  /**
   * 订阅事件，为一个事件设置事件处理
   * @param  {IAppEvent} e
   * @returns void
   */
  subscribe(e:IAppEvent):void;
  /**
   * 取消订阅，移除一个事件的处理函数
   * @param  {IAppEvent} e
   * @returns void
   */
  unsubscribe(e:IAppEvent):void;
}

/**
 * 程序组件设置接口
 * 主要负责初始化框架的主要组件（路由，中介器，调度器）
 * @param  {IDispatcher} _dispatcher 调度器
 * @param  {IMediator} _mediator 中介器
 * @param  {IRouter} _router 路由
 * @param  {IControllerDetails} _controllers 控制器
 * @param  {FN} _onErrorHandler   全局错误处理函数
 */
interface IAppSettings {
  isDebug: boolean;
  defaultController:string;
  defaultAction:string;
  controllers: Array<IControllerDetails>;
  onErrorHandler: (o:Object)=>void;
}

/*一个完整的控制器*/
interface IControllerDetails {
  controllerName: string;
  controller: {new(args:any[]):IController;};
}

/**
 * 路由转化器
 * @param  {string} controllerName 控制器名称
 * @param  {string} actionName 请求名称
 * @param  {Object[]} args 请求参数
 * @FN serialize 转化路由并返回路由地址
 */
interface IRoute {
  controllerName: string;
  actionName: string;
  args:Object[];
  serialize(): string;
}

/**
 * 事件发射器
 */
interface IEventEmitter {
  triggerEvent(event:IAppEvent):void;
  subscribeToEvents(events: Array<IAppEvent>):void;
  unsubscribeToEvents(events: Array<IAppEvent>):void;
}

/*
* 路由
*/
interface IRouter extends IEventEmitter {
  initialize():void;
}

/*调度器*/
interface IDispatcher extends IEventEmitter {
  initialize():void;
}

/*
* 负责控制器初始化和销毁view和model
* initialize 初始化
* dispose 销毁
*/
interface IController extends IEventEmitter {
  initialize():void;
  dispose():void;
}

/*
* model 网络通信服务，格式化返回数据
*/
interface IModel extends IEventEmitter {
  initialize():void;
  dispose():void;
}

/*
* 负责加载编译模板
*/
interface IView extends IEventEmitter {
  initialize():void;
  dispose():void;
}import { If } from '../control-flow'
import {
  ArrayAndReadonlyArrayByPassArray,
  FlattedArrayItem,
  IsEmptyTypeArray,
  IsTuple,
} from './type'

// notice: distributed condition type
export type Flat<T extends ArrayAndReadonlyArrayByPassArray> = T extends T
  ? If<
      IsTuple<T>,
      T extends ArrayAndReadonlyArrayByPassArray<[infer A, ...infer B]>
        ? A extends ArrayAndReadonlyArrayByPassArray
          ? [...Flat<A>, ...Flat<B>]
          : [A, ...Flat<B>]
        : T extends ArrayAndReadonlyArrayByPassArray<[...infer A, infer B]>
        ? B extends ArrayAndReadonlyArrayByPassArray
          ? [...Flat<A>, ...Flat<B>]
          : [...Flat<A>, B


如下：

**【深信服安全感知管理平台SIP】**预计2023年12月02日发布检测方案。

**【深信服安全托管服务MSS】**预计2023年12月02日发布检测方案，（需要具备SIP组件能力）。

**【深信服安全检测与响应平台XDR】**预计2023年12月02日发布检测方案。

**4.漏洞安全防护**

支持对Apache ActiveMQ Jolokia代码执行漏洞(CVE-2022-41678)的防御，可**阻断攻击者针对该事件的入侵行为**，相关产品及服务如下：

**【深信服下一代防火墙AF】**预计2023年12月02日发布防护方案。

**【深信服Web应用防火墙WAF】**预计2023年12月02日发布防护方案。

**【深信服安全托管服务MSS】**预计2023年12月02日发布防护方案，（需要具备AF组件能力）。

**【深信服安全检测与响应平台XDR】**预计2023年12月02日发布防护方案，（需要具备AF组件能力）。

**参考链接**

https://www.openwall.com/lists/oss-security/2023/11/28/1

**时间轴**

**2023/11/30**

深瞳漏洞实验室监测到CVE-2022-41678详细PoC已在互联网公开。

**2023/11/30**

深瞳漏洞实验室发布漏洞通告。

点击**阅读原文**，及时关注并登录深信服**智安全平台**，可轻松查询漏洞相关解决方案。

![](https://mmbiz.qpic.cn/mmbiz_jpg/w8NHw6tcQ5yg8iaCotRYdChLSkTYpQo3Dy5ZialKMZQXCZJskNpZkUJd0mfuaY6BySuYNLzpGvm1Kh0NQIHzco8Q/640?wx_fmt=jpeg&from=appmsg "")

#  CNNVD | 关于Apache Dubbo 代码问题漏洞的通报
 中国信息安全   2023-12-20 18:48

![](https://mmbiz.qpic.cn/sz_mmbiz_gif/1brjUjbpg5zlXThOicZKAOm4xofkjJ31avItZCM9SXDoNrg0JQ4kMia3nNz7INM8MCEvmnRI4EVibX0g9JSEzcdpA/640?wx_fmt=gif&from=appmsg "")

![](https://mmbiz.qpic.cn/sz_mmbiz_gif/1brjUjbpg5zl


rator should match");
  Expect.equals(4, calls, "Fourth call count");

  var error = StateError("quo");
  thrownError = error;
  Expect.identical(
    error,
    Expect.throws(() => ints.iterator),
    "Should throw first error",
  );
  Expect.equals(5, calls, "Fifth call count");
  Expect.identical(
    error,
    Expect.throws(() => ints.iterator),
    "Should throw second error",
  );
  Expect.equals(6, calls, "Sixth call count");

  thrownError = null;
  Expect.identical(intIterator2, ints.iterator, "Fifth iterator should match");
  Expect.equals(7, calls, "Seventh call count");

  var objectqs = Iterable.withIterator(f<Object?>);
  Expect.identical(
    intIterator2,
    objectqs.iterator,
    "Object iterator should match",
  );
  Expect.equals(8, calls, "Eighth call count");

  var nulls = Iterable.withIterator(f<Null>);
  var nullIterator = <Null>[].iterator;
  returnedIterator = nullIterator;
  Expect.identical(nullIterator, nulls.iterator, "Null iterator should match");
  Expect.equals(9, calls, "Ninth call count");

  var nevers = Iterable.withIterator(f<Never>);
  thrownError = error;
  Expect.identical(
    error,
    Expect.throws(() => nevers.iterator),
    "Should throw third error",
  );
  Expect.equals(10, calls, "Tenth call count");
  Expect.identical(
    error,
    Expect.throws(() => nevers.iterator),
    "Should throw fourth error",
  );
  Expect.equals(11, calls, "Eleventh call count");
}

void testIteratorEquality() {
  var iterable1 = Iterable.withIterator(() => [1, 2, 3].iterator);
  var iterable2 = Iterable.withIterator(() => [1, 2, 3].iterator);
  Expect.listEquals(
    iterable1.toList(),
    iterable2.toList(),
    "Iterator contents should be equal",
  );
}
// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import "package:expect/expect.dart";

// Test that error constructors do what they are documented as doing.

main() {
  Expect.equals("Invalid argument(s)", new ArgumentError().toString());
  Expect.equals(
    "Invalid argument(s): message",
    new ArgumentError("message").toString(),
  );
  Expect.equals(
    "Invalid argument: null",
    new ArgumentError.value(null).toString(),
  );
  Expect.equals("Invalid argument: 42", new ArgumentError.value(42).toString());
  Expect.equals(
    "Invalid argument: \"bad\"",
    new ArgumentError.value("bad").toString(),
  );
  Expect.equals(
    "Invalid argument (foo): null",
    new ArgumentError.value(null, "foo").toString(),
  );
  Expect.equals(
    "Invalid argument (foo): 42",
    new ArgumentError.value(42, "foo").toString(),
  );
  Expect.equals(
    "Invalid argument (foo): message: 42",
    new ArgumentError.value(42, "foo", "message").toString(),
  );
  Expect.equals(
    "Invalid argument: message: 42",
    new ArgumentError.value(42, null, "message").toString(),
  );
  Expect.equals(
    "Invalid argument(s): Must not be null",
    new ArgumentError.notNull


/../../../org/apache/poi/ss/usermodel/Workbook.html#PICTURE_TYPE_DIB">Workbook.PICTURE_TYPE_DIB

Returns:
image dimension in pixels

getImageDimension

public java.awt.Dimension getImageDimension()

Return the dimension of the embedded image in pixel

Specified by:
getImageDimension in interface Picture

Returns:
image dimension in pixels

getPictureData

public XSSFPictureData getPictureData()

Return picture data for this shape

Specified by:
getPictureData in interface Picture

Returns:
picture data for this shape

getShapeProperties

protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()

Description copied from class: XSSFShape

Returns xml bean with shape properties.

Specified by:
getShapeProperties in class XSSFShape

Returns:
xml bean with shape properties.

getClientAnchor

public XSSFClientAnchor getClientAnchor()

Specified by:
getClientAnchor in interface <A HREF