 = ForeignKey.CASCADE,
      onUpdate = ForeignKey.CASCADE
    )
  ],
  indices = [
    Index(value = [ChanPostHttpIconEntity.OWNER_POST_ID_COLUMN_NAME])
  ]
)
data class ChanPostHttpIconEntity(
  @ColumnInfo(name = ICON_URL_COLUMN_NAME)
  val iconUrl: HttpUrl,
  @ColumnInfo(name = OWNER_POST_ID_COLUMN_NAME)
  val ownerPostId: Long,
  @ColumnInfo(name = ICON_NAME_COLUMN_NAME)
  val iconName: String
) {

  companion object {
    const val TABLE_NAME = "chan_post_http_icon"

    const val ICON_URL_COLUMN_NAME = "icon_url"
    const val OWNER_POST_ID_COLUMN_NAME = "owner_post_id"
    const val ICON_NAME_COLUMN_NAME = "icon_name"
  }
}package com.github.k1rakishou.model.data.board

import com.github.k1rakishou.model.data.descriptor.BoardDescriptor

class ChanBoard(
  val boardDescriptor: BoardDescriptor,
  var active: Boolean = false,
  val order: Int? = null,
  val name: String? = null,
  val description: String = "",
  val perPage: Int = 15,
  val pages: Int = 10,
  val maxFileSize: Int = -1,
  val maxWebmSize: Int = -1,
  val maxMediaWidth: Int = -1,
  val maxMediaHeight: Int = -1,
  val maxCommentChars: Int = -1,
  val bumpLimit: Int = -1,
  val imageLimit: Int = -1,
  val cooldownThreads: Int = -1,
  val cooldownReplies: Int = -1,
  val cooldownImages: Int = -1,
  val customSpoilers: Int = -1,
  val workSafe: Boolean = false,
  val spoilers: Boolean = false,
  val userIds: Boolean = false,
  val countryFlags: Boolean = false,
  val isUnlimitedCatalog: Boolean = false
) {

  fun copy(
    boardDescriptor: BoardDescriptor? = null,
    active: Boolean? = null,
    order: Int? = null,
    name: String? = null,
    description: String? = null,
    perPage: Int? = null,
    pages: Int? = null,
    maxFileSize: Int? = null,
    maxWebmSize: Int? = null,
    maxMediaWidth: Int? = null,
    maxMediaHeight: Int? = null,
    maxCommentChars: Int? = null,
    bumpLimit: Int? = null,
    imageLimit: Int? = null,
    cooldownThreads: Int? = null,
    cooldownReplies: Int? = null,
    cooldownImages: Int? = null,
    customSpoilers: Int? = null,
    workSafe: Boolean? = null,
    spoilers: Boolean? = null,
    userIds: Boolean? = null,
    countryFlags: Boolean? = null,
    isUnlimitedCatalog: Boolean? = null,
    chanBoardMeta: ChanBoardMeta? = null
  ): ChanBoard {
    return ChanBoard(
      boardDescriptor ?: this.boardDescriptor,
      active ?: this.active,
      order ?: this.order,
      name ?: this.name,
      description ?: this.description,
      perPage ?: this.perPage,
      pages ?: this.pages,
      maxFileSize ?: this.maxFileSize,
      maxWebmSize ?: this.maxWebmSize,
      maxMediaWidth ?: this.maxMediaWidth,
      maxMediaHeight ?: this.maxMediaHeight,
      maxCommentChars ?: this.maxCommentChars,
      bumpLimit ?: this.bumpLimit,
      imageLimit ?: this.imageLimit,
      cooldownThreads ?: this.cooldownThreads,
      cooldownReplies ?: this.cooldownReplies,
      cooldownImages ?: this.cooldownImages,
      customSpoilers ?: this.customSpoilers,
      workSafe ?: this.workSafe,
      spoilers ?: this.spoilers,
      userIds ?: this.userIds,
      countryFlags ?: this.count


ck for overflow condition
  orrne r10,r10,#0x10000000 ;@ set overflow flag
  bne endofop80fa ;@ overflow!

  mov r1,r3,lsl #16 ;@ Clip to 16-bits
  adds r1,r1,#0 ;@ Defines NZ, clears CV
  mrs r10,cpsr ;@ r10=flags
  mov r1,r1,lsr #16
  orr r1,r1,r2,lsl #16 ;@ Insert remainder

;@ EaWrite: r1 into register[r11]:
  str r1,[r7,r11,lsr #7]

endofop80fa:
  ldrh r8,[r4],#2 ;@ Fetch next opcode
  subs r5,r5,#148 ;@ Subtract cycles
  ldrge pc,[r6,r8,asl #2] ;@ Jump to opcode handler
  b CycloneEnd

divzero80fa:
  mov r0,#5 ;@ Divide by zero
  bl Exception
  ldrh r8,[r4],#2 ;@ Fetch next opcode
  subs r5,r5,#186 ;@ Subtract cycles
  ldrge pc,[r6,r8,asl #2] ;@ Jump to opcode handler
  b CycloneEnd

;@ ---------- [80fb] divu.w ($33,pc,d3.w*2), d0; =35 uses Op80fb ----------
Op80fb:
  str r5,[r7,#0x5c] ;@ Save Cycles

;@ EaCalc : Get '($33,pc,d3.w*2)' into r0:
  ldr r0,[r7,#0x60] ;@ Get Memory base
  ldrh r3,[r4] ;@ Get extension word
  sub r0,r4,r0 ;@ r0=PC
  add r4,r4,#2
  mov r0,r0,asl #8 ;@ use only 24bits of PC
  mov r2,r3,lsr #10
  tst r3,#0x0800 ;@ Is Rn Word or Long
  and r2,r2,#0x3c ;@ r2=Index of Rn
  ldreqsh r2,[r7,r2] ;@ r2=Rn.w
  ldrne   r2,[r7,r2] ;@ r2=Rn.l
  mov r3,r3,asl #24 ;@ r3=Get 8-bit signed Disp
  add r2,r2,r3,asr #24 ;@ r2=Disp+Rn
  add r0,r2,r0,asr #8 ;@ r0=Disp+PC+Rn
;@ EaRead : Read '($33,pc,d3.w*2)' (address in r0) into r0:
  mov lr,pc
  ldr pc,[r7,#0x84] ;@ Call fetch16(r0) handler

;@ EaCalc : Get register index into r11:
  and r11,r8,#0x0e00
;@ EaRead : Read register[r11] into r2:
  ldr r2,[r7,r11,lsr #7]

  movs r1,r0,asl #16
  beq divzero80fb ;@ division by zero

  mov r0,r1,lsr #16 ;@ use only 16 bits of divisor

;@ Divide r2 by r0
  mov r3,#0
  mov r1,r0

;@ Shift up divisor till it's just less than numerator
Shift80fb:
  cmp r1,r2,lsr #1
  movls r1,r1,lsl #1
  bcc Shift80fb

Divide80fb:
  cmp r2,r1
  adc r3,r3,r3 ;@ Double r3 and add 1 if carry set
  subcs r2,r2,r1
  teq r1,r0
  movne r1,r1,lsr #1
  bne Divide80fb

;@r3


using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Identity.Web.Resource;
using Orders.Core.Models;
using Orders.Service;
using Orders.Web.Common;
using Orders.Web.ViewModels;

namespace Orders.Web.Controllers
{
    [ApiController]
    [Route("api/orders")]
    [Produces("application/json")]
    [Authorize]
    public class OrderController(IOrderService orderService,
        IUserClaims userClaims, IMapper mapper,
        IUserProfileService userProfileService) : ControllerBase
    {
        private readonly IOrderService _orderService = orderService;
        private readonly IUserClaims userClaims = userClaims;
        private readonly IMapper mapper = mapper;
        private readonly IUserProfileService userProfileService = userProfileService;

        ///// <summary>
        ///// Get an order by ID.
        ///// </summary>
        ///// <param name="orderId">The ID of the order.</param>
        ///// <returns>The order.</returns>
        [HttpGet("{orderId}")]
        [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(OrderModel))]
        [ProducesResponseType(StatusCodes.Status404NotFound)]
        [RequiredScope(RequiredScopesConfigurationKey = "AzureAdB2C:Scopes:Read")]
        public async Task<IActionResult> GetOrderById(int orderId)
        {
            OrderModel order = await _orderService.GetOrderByIdAsync(orderId);
            if (order == null)
            {
                return NotFound();
            }

            return Ok(order);
        }

        ///// <summary>
        ///// Get orders for a specific user.
        ///// </summary>
        ///// <param name="userId">The ID of the user.</param>
        ///// <returns>The list of orders for the user.</returns>
        [HttpGet("user/{userId}")]
        [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(List<OrderModel>))]
        [RequiredScope(RequiredScopesConfigurationKey = "AzureAdB2C:Scopes:Read")]
        public async Task<IActionResult> GetOrdersByUserIdAsync(int userId)
        {
            var orders = await _orderService.GetOrdersByUserIdAsync(userId);
            return Ok(orders);
        }

        /// <summary>
        /// Get orders for a specific user.
        /// </summary>
        /// <param name="userId">The ID of the user.</param>
        /// <returns>The list of orders for the user.</returns>
        [HttpGet()]
        [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(List<OrderModel>))]
        [RequiredScope(RequiredScopesConfigurationKey = "AzureAdB2C:Scopes:Read")]
        public async Task<IActionResult> GetOrdersByCurrentUserAsync()
        {
            var userId = await GetUserIdAsync();
            var orders = await _orderService.GetOrdersByUserIdAsync(userId);
            return Ok(orders);
        }

        /// <summary>
        /// Add a new order.
        /// </summary>
        /// <param name="orderModel">The order details.</param>
        /// <returns>The created order.</returns>
        [HttpPost]
        [ProducesResponseType(StatusCodes.Status201Created, Type = typeof(OrderModel))]
        [ProducesResponseType(StatusCodes.Status400BadRequest)]


"""Example code to do convolution."""
import os
import numpy as np
import scipy.signal
import tvm
from tvm.contrib import nvcc
import topi
from topi.util import get_const_tuple

TASK = "conv2d_hwcn_map"
USE_MANUAL_CODE = False

@tvm.register_func
def tvm_callback_cuda_compile(code):
    ptx = nvcc.compile_cuda(code, target="ptx")
    return ptx

def write_code(code, fname):
    with open(fname, "w") as f:
        f.write(code)

@tvm.register_func
def tvm_callback_cuda_postproc(code):
    if not os.path.exists("perf"):
        os.mkdir("perf")
    write_code(code, "perf/%s_generated.cu" % TASK)
    if USE_MANUAL_CODE:
        code = open("perf/%s_manual.cu" % TASK).read()
    return code

def test_conv2d_hwcn_map():
    batch = 64
    in_channel = 128
    in_height = 16
    in_width = 16
    num_filter = 128
    kernel = 3
    stride = 2
    padding = 'SAME'

    A = tvm.te.placeholder((in_height, in_width, in_channel, batch), name='A')
    W = tvm.te.placeholder((kernel, kernel, in_channel, num_filter), name='W')
    B = topi.nn.conv2d_hwcn(A, W, stride, padding)
    C = topi.nn.relu(B)
    s1 = topi.cuda.schedule_conv2d_hwcn([B])
    s2 = topi.cuda.schedule_conv2d_hwcn([C])

    a_np = np.random.uniform(size=get_const_tuple(A.shape)).astype(A.dtype)
    w_np = np.random.uniform(size=get_const_tuple(W.shape)).astype(W.dtype)
    b_np = topi.testing.conv2d_hwcn_python(a_np, w_np, stride, padding)
    c_np = np.maximum(b_np, 0)

    def check_device(device):
        if not tvm.runtime.module.enabled(device):
            print("Skip because %s is not enabled" % device)
            return
        ctx = tvm.device(device, 0)
        a = tvm.nd.array(a_np, ctx)
        w = tvm.nd.array(w_np, ctx)
        b = tvm.nd.array(np.zeros(get_const_tuple(B.shape), dtype=B.dtype), ctx)
        c = tvm.nd.array(np.zeros(get_const_tuple(C.shape), dtype=C.dtype), ctx)
        with tvm.build_config(auto_unroll_max_step=128,
                              unroll_explicit=device == 'rocm'):
            func1 = tvm.build(s1, [A, W, B], device)
            func1(a, w, b)
            tvm.testing.assert_allclose(b.asnumpy(), b_np, rtol=1e-5)
            func2 = tvm.build(s2, [A, W, C], device)
            func2(a, w, c)
            tvm.testing.assert_allclose(c.asnumpy(), c_np, rtol=1e-5)

    for device in ['cuda', 'opencl', 'rocm']:
        check_device(device)

if __name__ == "__main__":
    test_conv2d_hwcn_map()


.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// TODO: switch syz-verifier to use syz-fuzzer.

//go:build ignore

package main

import (
	"testing"

	"github.com/google/go-cmp/cmp"
)

func dummyStats() *Stats {
	return (&Stats{
		TotalProgs:          StatUint64{uint64: 24},
		TotalCallMismatches: StatUint64{uint64: 10},
		FlakyProgs:          StatUint64{uint64: 4},
		MismatchingProgs:    StatUint64{uint64: 6},
		Calls: StatMapStringToCallStats{
			mapStringToCallStats: mapStringToCallStats{
				"foo": {"foo", 2, 8, map[ReturnState]bool{
					returnState(1, 7): true,
					returnState(3, 7): true}},
				"bar": {"bar", 5, 6, map[ReturnState]bool{
					crashedReturnState(): true,
					returnState(10, 7):   true,
					returnState(22, 7):   true}},
				"tar": {"tar", 3, 4, map[ReturnState]bool{
					returnState(31, 7): true,
					returnState(17, 7): true,
					returnState(5, 7):  true}},
				"biz": {"biz", 0, 2, map[ReturnState]bool{}},
			},
		},
	}).Init()
}

func TestGetCallStatsTextDescription(t *testing.T) {
	tests := []struct {
		name, call, report string
	}{
		{
			name:   "report for unsupported call",
			call:   "read",
			report: "",
		},
		{
			name: "report for supported call",
			call: "foo",
			report: "statistics for foo:\n" +
				"\t↳ mismatches of foo / occurrences of foo: 2 / 8 (25.00 %)\n" +
				"\t↳ mismatches of foo / total number of mismatches: 2 / 10 (20.00 %)\n" +
				"\t↳ 2 distinct states identified: " +
				"[\"Flags: 7, Errno: 1 (operation not permitted)\" \"Flags: 7, Errno: 3 (no such process)\"]\n",
		},
	}

	for _, test := range tests {
		s := dummyStats()
		t.Run(test.name, func(t *testing.T) {
			got, want := s.getCallStatsTextDescription(test.call), test.report
			if diff := cmp.Diff(want, got); diff != "" {
				t.Errorf("s.getCallStatsTextDescription mismatch (-want +got):\n%s", diff)
			}
		})
	}
}

func TestGetTextDescription(t *testing.T) {
	stats := dummyStats()

	got, want := stats.GetTextDescription(float64(10)),
		"total number of mismatches / total number of calls "+
			"executed: 10 / 20 (50.00 %)\n\n"+
			"programs / minute: 2.40\n\n"+
			"true mismatching programs: 6 / total number of programs: 24 (25.00 %)\n"+
			"flaky programs: 4 / total number of programs: 24 (16.67 %)\n\n"+
			"statistics for bar:\n"+
			"\t↳ mismatches of bar / occurrences of bar: 5 / 6 (83.33 %)\n"+
			"\t↳ mismatches of bar / total number of mismatches: 5 / 10 (50.00 %)\n"+
			"\t↳ 3 distinct states identified: "+
			"[\"Crashed\" \"Flags: 7, Errno: 10 (no child processes)\" "+
			"\"Flags: 7, Errno: 22 (invalid argument)\"]\n\n"+
			"statistics for tar:\n"+
			"\t↳ mismatches of tar / occurrences


import sqlite3
import tkinter as tk

# Criação e conexão com o banco de dados
conn = sqlite3.connect('professor.db')
cursor = conn.cursor()

# Criar as tabelas se elas não existirem
cursor.execute('''
                CREATE TABLE IF NOT EXISTS prof_key
                (name_prof TEXT, mat_prof TEXT)
                ''')

def configurar_estilos():
    root.tk_setPalette(background='#C9F3F5', foreground='#333333')
    root.option_add('*TButton.background', '#4CAF50')
    root.option_add('*TButton.foreground', '#ffffff')
    root.option_add('*TButton.font', ('Helvetica', 12))

    # Configurar a cor de fundo da Listbox como branca
    listbox.configure(bg='#FFFFFF')

    # Configurar a cor de fundo da caixa de entrada como branca
    name_prof_entry.configure(bg='#FFFFFF')
    mat_prof_entry.configure(bg='#FFFFFF')

    # Configurar a cor de fundo da caixa de registrar como branca
    add_button.configure(bg='#FFFFFF')

def add_professor():
    name_prof = name_prof_entry.get()
    mat_prof = mat_prof_entry.get()
    cursor.execute("INSERT INTO prof_key VALUES (?, ?)", (name_prof, mat_prof))
    conn.commit()
    name_prof_entry.delete(0, tk.END)
    mat_prof_entry.delete(0, tk.END)
    update_list()

def remover_professor(event):
    selecionado = listbox.curselection()
    if selecionado:
        nome_prof = listbox.get(selecionado).split(" - ")[0]
        matricula_prof = listbox.get(selecionado).split(" - ")[1]
        cursor.execute("DELETE FROM prof_key WHERE name_prof = ? AND mat_prof = ?", (nome_prof, matricula_prof))
        conn.commit()
        update_list()

def update_list():
    listbox.delete(0, tk.END)
    cursor.execute("SELECT name_prof, mat_prof FROM prof_key")
    for row in cursor.fetchall():
        listbox.insert(tk.END, f"{row[0]} - {row[1]}")

# Criação da interface gráfica
root = tk.Tk()
root.title("Cadastro de Professores")

largura_janela = 900
altura_janela = 900

# Label e entrada para nome
label_name_prof = tk.Label(root, text="Nome do Professor", font="Arial 14 bold")
label_name_prof.grid(row=0, column=0)
name_prof_entry = tk.Entry(root)
name_prof_entry.grid(row=0, column=1)

# Label e entrada para matrícula
label_mat_prof = tk.Label(root, text="Matrícula", font="Arial 14 bold")
label_mat_prof.grid(row=1, column=0)
mat_prof_entry = tk.Entry(root)
mat_prof_entry.grid(row=1, column=1)

#Deixar um espaço vazio
header_void_2 = tk.Label(root, text=" ")
header_void_2.grid(row=4, column=1)

# Botão para adicionar aluno
add_button = tk.Button(root, text="Registrar", font="Arial 14 bold", command=add_professor)
add_button.grid(row=5, column=1)

#Deixar um espaço vazio
header_void = tk.Label(root, text=" ")
header_void.grid(row=6, column=1)

# Listagem para as chaves que foram pegas
header_2 = tk.Label(root, text="Nome do Professor - Matrícula")
header_2.grid(row=7, column=1)
listbox = tk.Listbox(root, width=45)
listbox.grid(row=8, column=1)
listbox.bind('<Double-1>', remover_professor)

update_list()
configurar_estilos()

# Obter largura e altura da tela
largura_tela = root.winfo_screenwidth()
altura_tela = root.winfo_screenheight()
pos_x = (largura_tela // 2) - (largura_janela // 2)
pos_y = (altura_tela // 2) - (altura_tela // 2)

# Define a posição da janela
root.geometry('{}x{}+{}+{}'.format(largura_janela, altura_janela, pos_x, pos_y))

# Manter a tela em funcionamento
root.mainloop()


flags int) (err error)
//sys	write(fd int, p []byte) (n int, err error)
//sys	writev(fd int, iovecs []Iovec) (cnt uintptr, err error)
//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
//sys   munmap(addr uintptr, length uintptr) (err error)
//sysnb fork() (pid int, err error)
//sysnb execve(path *byte, argv **byte, envp **byte) (err error)
//sysnb exit(res int) (err error)
//sys	sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error)
//sys   unlinkat(fd int, path string, flags int) (err error)
//sys   openat(fd int, path string, flags int, perm uint32) (fdret int, err error)
//sys	getcwd(buf []byte) (n int, err error)

func init() {
	execveDarwin = execve
}

func fdopendir(fd int) (dir uintptr, err error) {
	r0, _, e1 := syscallPtr(abi.FuncPCABI0(libc_fdopendir_trampoline), uintptr(fd), 0, 0)
	dir = r0
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

func libc_fdopendir_trampoline()

//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"

func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
	r0, _, e1 := syscall(abi.FuncPCABI0(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
	n = int(r0)
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
	// Simulate Getdirentries using fdopendir/readdir_r/closedir.
	// We store the number of entries to skip in the seek
	// offset of fd. See issue #31368.
	// It's not the full required semantics, but should handle the case
	// of calling Getdirentries or ReadDirent repeatedly.
	// It won't handle assigning the results of lseek to *basep, or handle
	// the directory being edited underfoot.
	skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
	if err != nil {
		return 0, err
	}

	// We need to duplicate the incoming file descriptor
	// because the caller expects to retain control of it, but
	// fdopendir expects to take control of its argument.
	// Just Dup'ing the file descriptor is not enough, as the
	// result shares underlying state. Use openat to make a really
	// new file descriptor referring to the same directory.
	fd2, err := openat(fd, ".", O_RDONLY, 0)
	if err != nil {
		return 0, err
	}
	d, err := fdopendir(fd2)
	if err != nil {
		Close(fd2)
		return 0, err
	}
	defer closedir(d)

	var cnt int64
	for {
		var entry Dirent
		var entryp *Dirent
		e := readdir_r(d, &entry, &entryp)
		if e != 0 {
			return n, errnoErr(e)
		}
		if entryp == nil {
			break
		}
		if skip > 0 {
			skip--
			cnt++
			continue
		}
		reclen := int(entry.Re


: &str = "replica";
pub const ORCHESTRATOR_JOB_NAME: &str = "orchestrator";
pub const NODE_EXPORTER_JOB_NAME: &str = "node_exporter";
pub const HOST_NODE_EXPORTER_JOB_NAME: &str = "host_node_exporter";
pub const JOB_NAMES: &[&str; 4] = &[
    REPLICA_JOB_NAME,
    ORCHESTRATOR_JOB_NAME,
    NODE_EXPORTER_JOB_NAME,
    HOST_NODE_EXPORTER_JOB_NAME,
];

/// Provide service discovery for Prometheus for a set of Internet Computers.
pub trait IcServiceDiscovery: Send + Sync {
    /// Returns a list of [PrometheusTargetGroup] containing all prometheus
    /// targets for the given `job_name`.
    ///
    /// The job name must be one of `replica`, `orchestrator`, `node_exporter`,
    /// or `host_node_exporter`.
    fn get_prometheus_target_groups(
        &self,
        job_name: &str,
    ) -> Result<BTreeSet<PrometheusTargetGroup>, IcServiceDiscoveryError>;
}

/// A [PrometheusTargetGroup] associates a set of prometheus scrape targets with
/// a set of labels.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct PrometheusTargetGroup {
    pub node_id: NodeId,
    pub ic_name: String,
    /// A set of targets to be scraped by prometheus that share the same labels.
    pub targets: BTreeSet<SocketAddr>,
    /// A set of labels that are associated with the targets listed in
    /// `socket_addr`.
    pub subnet_id: Option<SubnetId>,
}

/// Exposes service discovery data for a set of Internet Computers. Manages a
/// directory containing a registry local store for every Internet Computer
/// whose discovery data is exposed. Each local store is updated on a regular
/// basis.
#[derive(Clone)]
pub struct IcServiceDiscoveryImpl {
    /// The directory containing one local store per observed Internet Computer.
    ic_scraping_targets_dir: PathBuf,
    /// The http request timeout that is used when updating the local stores.
    registry_query_timeout: Duration,
    /// An in-memory representation of the registries that is updated when
    /// calling `load_new_scraping_targets`.
    registries: Arc<RwLock<BTreeMap<String, LocalRegistry>>>,
}

impl IcServiceDiscoveryImpl {
    /// Create new instance of [IcServiceDiscoveryImpl]. The
    /// `ic_scraping_targets_dir` must point to a directory that contains the
    /// local stores of the Internet Computer instances to be scraped.
    pub fn new<P: AsRef<Path>>(
        ic_scraping_targets_dir: P,
        registry_query_timeout: Duration,
    ) -> Result<Self, IcServiceDiscoveryError> {
        let ic_scraping_targets_dir = PathBuf::from(ic_scraping_targets_dir.as_ref());
        if !ic_scraping_targets_dir.is_dir() {
            return Err(IcServiceDiscoveryError::NotADirectory {
                path: ic_scraping_targets_dir,
            });
        }
        let registries = Arc::new(RwLock::new(Default::default()));
        let self_ = Self {
            ic_scraping_targets_dir,
            registry_query_timeout,
            registries,
        };
        self_.load_new_ics()?;
        Ok(self_)
    }

    /// Update each scraping target by fetching update for the respective
    /// registry.
    ///
    /// If all updates succeed, returns `Ok(())`. Otherwise an error is returned
    /// containing all failed update attempts.
    pub fn update_registries(&self) -> Result<(), IcServiceDiscoveryError> {
        let cache = self.registries.read().unwrap();
        let failures = cache.iter().fold(vec![], |mut a, (ic_name, registry)| {
            if let Err(e) = registry.


 ldigits)
	case 'c':
		p.fmtC(int64(v))
	case 'd':
		p.fmt.integer(int64(v), 10, unsigned, ldigits)
	case 'v':
		if goSyntax {
			p.fmt0x64(v, true)
		} else {
			p.fmt.integer(int64(v), 10, unsigned, ldigits)
		}
	case 'o':
		p.fmt.integer(int64(v), 8, unsigned, ldigits)
	case 'q':
		if 0 <= v && v <= unicode.MaxRune {
			p.fmt.fmt_qc(int64(v))
		} else {
			p.badVerb(verb)
		}
	case 'x':
		p.fmt.integer(int64(v), 16, unsigned, ldigits)
	case 'X':
		p.fmt.integer(int64(v), 16, unsigned, udigits)
	case 'U':
		p.fmtUnicode(int64(v))
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtFloat32(v float32, verb rune) {
	switch verb {
	case 'b':
		p.fmt.fmt_fb32(v)
	case 'e':
		p.fmt.fmt_e32(v)
	case 'E':
		p.fmt.fmt_E32(v)
	case 'f':
		p.fmt.fmt_f32(v)
	case 'g', 'v':
		p.fmt.fmt_g32(v)
	case 'G':
		p.fmt.fmt_G32(v)
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtFloat64(v float64, verb rune) {
	switch verb {
	case 'b':
		p.fmt.fmt_fb64(v)
	case 'e':
		p.fmt.fmt_e64(v)
	case 'E':
		p.fmt.fmt_E64(v)
	case 'f':
		p.fmt.fmt_f64(v)
	case 'g', 'v':
		p.fmt.fmt_g64(v)
	case 'G':
		p.fmt.fmt_G64(v)
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtComplex64(v complex64, verb rune) {
	switch verb {
	case 'e', 'E', 'f', 'F', 'g', 'G':
		p.fmt.fmt_c64(v, verb)
	case 'v':
		p.fmt.fmt_c64(v, 'g')
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtComplex128(v complex128, verb rune) {
	switch verb {
	case 'e', 'E', 'f', 'F', 'g', 'G':
		p.fmt.fmt_c128(v, verb)
	case 'v':
		p.fmt.fmt_c128(v, 'g')
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtString(v string, verb rune, goSyntax bool) {
	switch verb {
	case 'v':
		if goSyntax {
			p.fmt.fmt_q(v)
		} else {
			p.fmt.fmt_s(v)
		}
	case 's':
		p.fmt.fmt_s(v)
	case 'x':
		p.fmt.fmt_sx(v, ldigits)
	case 'X':
		p.fmt.fmt_sx(v, udigits)
	case 'q':
		p.fmt.fmt_q(v)
	default:
		p.badVerb(verb)
	}
}

func (p *pp) fmtBytes(v []byte, verb rune, goSyntax bool, depth int) {
	if verb == 'v' || verb == 'd' {
		if goSyntax {
			p.buf.Write(bytesBytes)
		} else {
			p.buf.WriteByte('[')
		}
		for i, c := range v {
			if i > 0 {
				if goSyntax {
					p.buf.Write(commaSpaceBytes)
				} else {
					p.buf.WriteByte(' ')
				}
			}


byte[] Encrypto(string strv)
        {
            return DesCrypto.DesEncrypto(strv, PicasaBar.Key, PicasaBar.Iv);
        }

        // Token: 0x060003DB RID: 987 RVA: 0x00017954 File Offset: 0x00015B54
        public static string Decrypto(byte[] cary)
        {
            var bytes = DesCrypto.DesDecrypto(cary, PicasaBar.Key, PicasaBar.Iv);
            return Encoding.Unicode.GetString(bytes);
        }

        // Token: 0x060003DC RID: 988 RVA: 0x0001797D File Offset: 0x00015B7D
        public PicasaBar()
        {
            InitializeComponent();
        }

        // Token: 0x060003DD RID: 989 RVA: 0x00017998 File Offset: 0x00015B98
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            var text = "";
            var picasaAccessor = new PicasaAccessor();
            try
            {
                backgroundWorker1.ReportProgress(5);
                Console.WriteLine("创建一个临时文件");
                text = Path.GetTempFileName();
                var imageCodecInfo = GetImageCodecInfo();
                var quality = System.Drawing.Imaging.Encoder.Quality;
                var encoderParameters = new EncoderParameters(1);
                var encoderParameter = new EncoderParameter(quality, 100L);
                encoderParameters.Param[0] = encoderParameter;
                SendImage.Save(text, imageCodecInfo, encoderParameters);
                backgroundWorker1.ReportProgress(10);
                Console.WriteLine("登录");
                if (!picasaAccessor.ClientLogin(_strID, _strPass))
                {
                    switch (picasaAccessor.LoginErrorCode)
                    {
                        case PicasaLoginError.BadAuthentication:
                        case PicasaLoginError.NotVerified:
                        case PicasaLoginError.CaptchaRequired:
                        case PicasaLoginError.AccountDeleted:
                        case PicasaLoginError.AccountDisabled:
                            _error = "无法登录。";
                            goto IL_119;
                        case PicasaLoginError.TermsNotAgreed:
                            _error = "不同意的条款和条件。";
                            goto IL_119;
                        case PicasaLoginError.ServiceDisabled:
                            _error = "Picasa服务当前无法使用。";
                            goto IL_119;
                        case PicasaLoginError.ServiceUnavailable:
                            _error = "Picasa服务未启动。";
                            goto IL_119;
                        case PicasaLoginError.ConnectionError:
                            _error = "无法连接。";
                            goto IL_119;
                    }
                    _error = "登录失败。";
                IL_119:
                    e.Cancel = true;
                }
                else
                {
                    backgroundWorker1.ReportProgress(20);
                    Console.WriteLine("检查相册");
                    var text2 = picasaAccessor.ExistAlbum(AlbumName);
                    if (text2.Length == 0)
                    {
                        text2 = picasaAccessor.CreateAlbum(AlbumName, AlbumComment, AlbumPublic);
                    }
                    backgroundWorker1.ReportProgress(30);
                    if (text2.Length == 0)
                    {
                        _error = "无法创建相册。\n\n※要使用此功能，您需要同意使用Picasa服务协议。\n请登陆 https://picasaweb.google.com/ 详细确认。";
                        e.Cancel = true;
                    }
                    else
                    {
                        Console.WriteLine("上传过程");
                        if (!picasaAccessor.UploadPhoto(AlbumName, text, backgroundWorker1, 30))
                        {
                            switch (picasaAccessor.UploadErrorCode)
                            {
                                case PicasaUploadError.BadRequest:
                                case PicasaUploadError.UnAuthorized:


ی افريقا وخت"]},"Africa/Bujumbura":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Gaborone":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Lubumbashi":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Blantyre":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Kigali":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Lusaka":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Harare":{"long":["منځنی افريقا وخت","منځنی افريقا وخت"]},"Africa/Nairobi":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Djibouti":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Asmera":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Addis_Ababa":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Indian/Comoro":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Indian/Antananarivo":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Mogadishu":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Dar_es_Salaam":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Kampala":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Indian/Mayotte":{"long":["ختيځ افريقا وخت","ختيځ افريقا وخت"]},"Africa/Johannesburg":{"long":["جنوبي افريقا معياري وخت","جنوبي افريقا معياري وخت"]},"Africa/Maseru":{"long":["جنوبي افريقا معياري وخت","جنوبي افريقا معياري وخت"]},"Africa/Mbabane":{"long":["جنوبي افريقا معياري وخت","جنوبي افريقا معياري وخت"]},"Africa/Lagos":{"long":["لویدیځ افریقایي معیاري وخت","د افریقا افریقا لویدیځ وخت"]},"Africa/Luanda":{"long":["لویدیځ افریقایي معیاري وخت","د افریقا افریقا لویدیځ وخت"]},"Africa/Porto-Novo":{"long":["لویدیځ افریقایي معیاري وخت","د افریقا افریقا لویدیځ وخت"]},"Africa/K


n] lookupRepository		Repository to check dependencies for.
	/// @return                       True if done. False if cancelled.
	//----------------------------------------------------------------------------------------
	static MAXON_METHOD Result<Bool> CheckDownloadAssetWithModalProgressDialog(const AssetDescription& asset, const AssetRepositoryRef& lookupRepository);

	using Filter = Delegate<Bool(const AssetDescription& desc)>;

	//----------------------------------------------------------------------------------------
	/// GetAssetFilenameFromDragData extracts the filename/url from the legacy d&d message. If filter is null,
	/// this will only return assets of type AssetTypes::File, otherwise only assets which pass the given filter.
	/// @param[in] dragData           DragData containing the asset filename.
	/// @return                       Bool: false if cancelled by user, Id: Asset ID, Url: asset url, AssetDescription: asset description, String: filter string from asset browser
	//----------------------------------------------------------------------------------------
	static MAXON_METHOD Tuple<Bool, Id, Url, AssetDescription, String> GetAssetFilenameFromDragData(const void* dragData, Bool updateUsage, Bool showDownloadDialog, const Filter& filter = GetZeroRef<Filter>());

	//----------------------------------------------------------------------------------------
	/// RevealAsset opens the asset browser to show the given assets in the browser.
	/// @param[in] assets							Assets to show.
	/// @return                       OK on success.
	//----------------------------------------------------------------------------------------
	static MAXON_METHOD Result<void> RevealAsset(const Block<AssetDescription>& assets);

	//----------------------------------------------------------------------------------------
	/// LoadAssets executes the load asset command from the asset browser (e.g. double click or open).
	/// @param[in] searchRepository		Search repository.
	/// @param[in] selectionAndFilterString HashMap which contains the search terms to switch modes in the newly created node/object.
	/// @param[in] presenter					Optional presenter to use when creating nodes.
	/// @param[in] graphModelRef			Optional parameter to pass the node graph where to insert nodes.
	/// @return                       Bool on success. True if loaded. False indicates another error state.
	//----------------------------------------------------------------------------------------
	static MAXON_METHOD Result<Bool> LoadAssets(const AssetRepositoryRef& searchRepository, const HashMap<Id, String>& selectionAndFilterString, const GraphModelPresenterRef& presenter = GetZeroRef<GraphModelPresenterRef>(), const nodes::NodesGraphModelRef& graphModelRef = GetZeroRef<nodes::NodesGraphModelRef>());
};

#include "assetmanagerinterface1.hxx"
#include "assetmanagerinterface2.hxx"

} // namespace maxon

#endif // ASSETMANAGERINTERFACE_H__


edisRpcResponse response = request.getResponse();
        if (id <= 0) {
            response.setStatusCode(ErrorCode.ERROR400.getCode());
            response.setBody("param error");
            return response;
        }
        streamPushPlayService.start(id, (code, msg, data) -> {
            if (code == ErrorCode.SUCCESS.getCode()) {
                response.setStatusCode(ErrorCode.SUCCESS.getCode());
                response.setBody(JSONObject.toJSONString(data));
                sendResponse(response);
            }
        }, null, null);
        return null;
    }

}
package com.demo.filter.typeview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;

import com.demo.R;
import com.demo.filter.adapter.BaseBaseAdapter;
import com.demo.filter.adapter.SimpleTextAdapter;
import com.demo.filter.util.CommonUtil;
import com.demo.filter.util.MLog;

import java.util.List;

/**
 * 创建 省-市-区 三级联动 自定义listView
 */
public class ThreeListView<FIRSTD, SECONDD, THIRDD> extends LinearLayout implements AdapterView.OnItemClickListener {

    private BaseBaseAdapter<FIRSTD> mFirstAdpater;
    private BaseBaseAdapter<SECONDD> mSecondAdapter;
    private BaseBaseAdapter<THIRDD> mThirdAdapter;
    private ListView lv_first;
    private ListView lv_second;
    private ListView lv_third;

    public ThreeListView(Context context) {
        this(context, null);
        init(context);
    }

    public ThreeListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public ThreeListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private void init(Context context) {
        setOrientation(VERTICAL);
        inflate(context, R.layout.act_filter_three_list, this);

        //初始化控件
        lv_first = findViewById(R.id.lv_first);
        lv_second = findViewById(R.id.lv_second);
        lv_third = findViewById(R.id.lv_three);

        //设置单选
        lv_first.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv_second.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv_third.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

        //设置监听
        lv_first.setOnItemClickListener(this);
        lv_second.setOnItemClickListener(this);
        lv_third.setOnItemClickListener(this);
    }

    //listView的adapter
    public ThreeListView<FIRSTD, SECONDD, THIRDD> firstAdapter(SimpleTextAdapter<FIRSTD> firstAdapter) {
        mFirstAdpater = firstAdapter;
        lv_first.setAdapter(firstAdapter);
        return this;
    }

    public ThreeListView<FIRSTD, SECONDD, THIRDD> secondAdapter(SimpleTextAdapter<SECONDD> secondAdpater) {
        mSecondAdapter = secondAdpater;
        lv_second.setAdapter(secondAdpater);
        return this;
    }

    public ThreeListView<FIRSTD, SECONDD, THIRDD> thirdAdapter(SimpleTextAdapter<THIRDD> threeAdapter) {
        mThirdAdapter = threeAdapter;
        lv_third.setAdapter(threeAdapter);
        return


    subscribe(OBJECT: SubscribeOBJECT): any;

    /**
     * 取消订阅（一般不建议调用，调用后 regId 失效，需要重新订阅获取新的 regId）
     * @example
     * ```js
     * push.unsubscribe({
     *   success: function(data) {
     *     console.log(
     *       `push.unsubscribe succeeded, result data = ${JSON.stringify(data)}`
     *     )
     *   },
     *   fail: function(data, code) {
     *     console.log(
     *       `push.unsubscribe failed, result data = ${JSON.stringify(
     *         data
     *       )}, code = ${code}`
     *     )
     *   },
     *   complete: function() {
     *     console.log('push.unsubscribe completed')
     *   }
     * })
     * ```
     */
    unsubscribe(OBJECT: UnsubscribeOBJECT): any;

    /**
     * 添加 push 事件回调（透传消息的 payload 内容可在此回调中收到）
     * @example
     * ```js
     * push.on({
     *   callback: function(ret) {
     *     console.log(`received pass through message, ret = ${JSON.stringify(ret)}`)
     *   }
     * })
     * ```
     */
    on(OBJECT: OnOBJECT): any;

    /**
     * 移除 push 事件回调，push.on中的callback不会再收到透传内容
     * @example
     * ```js
     * push.off()
     * ```
     */
    off(): any;
  }

  /**
   *
   * @param callback push 事件回调处理
   */
  interface OnOBJECT {
    callback: OnOBJECTCallbackCB;
  }

  /**
   * push 事件回调处理
   */
  type OnOBJECTCallbackCB = (callbackArg: OnCallbackCallbackArg) => any;

  /**
   * push 事件回调处理
   * @param messageId 消息 id[可选]
   * @param data 消息内容 payload[可选]
   */
  interface OnCallbackCallbackArg {
    messageId?: String;
    data?: String;
  }

  /**
   *
   * @param success 成功回调[可选]
   * @param fail 失败回调，返回失败原因[可选]
   * @param complete 执行结束后的回调[可选]
   */
  interface UnsubscribeOBJECT {
    success?: Function;
    fail?: Function;
    complete?: Function;
  }

  /**
   *
   * @param success 成功回调[可选]
   * @param fail 失败回调，返回失败原因[可选]
   * @param complete 执行结束后的回调[可选]
   */
  interface SubscribeOBJECT {
    success?: SubscribeOBJECTSuccessCB;
    fail?: Function;
    complete?: Function;
  }

  /**
   * 成功回调
   */
  type SubscribeOBJECTSuccessCB = (
    successArg: SubscribeSuccessSuccessArg
  ) => any;

  /**
   * 成功回调
   * @param regId PushService 返回的注册 id，可用于针对某个用户发送消息[可选]
   */
  interface SubscribeSuccessSuccessArg {
    regId?: String;
  }

  /**
   * 推送 push
   * @后台运行限制 无限制。 后台运行详细用法参见后台运行 脚本。
   * @see https://doc.quickapp.cn/features/service/push.html
   */
  const push: Push;
  export default push;
}
/**
 * 元组使用和类型约束
 */

 // 该行代码如果把20年龄放在中间也不会报错，所以元组是这么诞生的
//  let xiaojiejie: (string | number)[] = ['a', 'teacher', 20]

let xiaojiejie: [string, string, number] = ['a', 'teacher', 20];

let xiaojiejies: [string, str


SteerType.KeyBoardId, 26)
  self.inputKeyDescComp_:Init(26, self.uiBinder.binder_key)
end

function MultActionCtrlBtn:OnDeActive()
  Z.EventMgr:Remove("CancelMulAction", self.btnFuncCall, self)
  self.inputKeyDescComp_:UnInit()
end

function MultActionCtrlBtn:AddListener()
  self:AddAsyncClick(self.uiBinder.btn_item, function()
    local multactionVM = Z.VMMgr.GetVM("multaction")
    multactionVM.AsyncCancelAction(self.cancelSource:CreateToken())
  end)
end

function MultActionCtrlBtn:btnFuncCall()
  Z.CoroUtil.create_coro_xpcall(function()
    local multactionVM = Z.VMMgr.GetVM("multaction")
    multactionVM.AsyncCancelAction(self.cancelSource:CreateToken())
  end)()
end

return MultActionCtrlBtn


s = false) { }
    addReactions(reacts: AnyReact[]): this {
        this.reacts.push(...reacts);
        return this;
    }
}

const channelReacts = [
    new ChannelReactions(channelIDs.creations).addReactions([
        new FileReact(["💙"], FileReact.MimeCheck(["image", "video"]), true)
    ]),
    new ChannelReactions(channelIDs.musiccreations).addReactions([
        new FileReact(["💙"], FileReact.MimeCheck(["audio", "video"]), true)
    ]),
    new ChannelReactions(channelIDs.memes).addReactions([
        new FileReact(["👍", "👎"], FileReact.MimeCheck(["audio", "video", "image"]), true)
    ]),
    new ChannelReactions(channelIDs.trenchmemes).addReactions([
        new FileReact(["👍", "👎"], FileReact.MimeCheck(["audio", "video", "image"]), true)
    ]),
    new ChannelReactions(channelIDs.cliqueartfriday).addReactions([
        new FileReact(["💝"], FileReact.MimeCheck(["audio", "video", "image"]), true)
    ]),
    new ChannelReactions(channelIDs.artevents, true).addReactions([
        new FileReact(["💝"], FileReact.MimeCheck(["audio", "video", "image"]), true)
    ])
];

async function onMessage(msg: Message): Promise<void> {
    const msgInThread = msg.channel.isThread();

    // Find ChannelReactions object for this channel
    const channelReact = channelReacts.find((cr) => {
        // Simple in channel
        if (cr.channel === msg.channel.id) return true;

        // In thread of channel
        return msgInThread && cr.includeThreads && msg.channel.parentId === cr.channel;
    });

    if (!channelReact) return;

    // Find reaction that applies to this message
    const react = channelReact.reacts.find((r) => r.appliesTo(msg));
    if (!react) return;

    // React to message
    for (const reactionEmoji of react.reactWith) await msg.react(reactionEmoji);
}

export default onMessage;
const DRAGON: string = '龙';
const TIGER: string = '虎';
const DEUCE: string = '和';
const UNKNOWN: string = '未知';

let cIsDragonOrTiger = (aNumbers: number[], aPositions: number[]): string => {
  let iDragonNumber = aNumbers[aPositions[0]] === 0 ? 0 : aNumbers[aPositions[0]] || void 0;
  let iTigerNumber = aNumbers[aPositions[1]] === 0 ? 0 : aNumbers[aPositions[1]] || void 0;
  if (undefined === iDragonNumber || undefined === iTigerNumber) {
    return UNKNOWN;
  }
  if (iDragonNumber - iTigerNumber > 0) {
    return DRAGON;
  }

  if (iDragonNumber - iTigerNumber < 0) {
    return TIGER;
  }

  if (iDragonNumber - iTigerNumber === 0) {
    return DEUCE;
  }
  return UNKNOWN;
};

export default cIsDragonOrTiger;
import { useEffect, useRef } from 'react'

export const useInterval = (callback: () => void, delay: number) => {
  const savedCallback = useRef(() => {})
  useEffect(() => {
    savedCallback.current = callback
  })
  useEffect(() => {
    const listener = setInterval(savedCallback.current, delay)
    return () => clearInterval(listener)
  }, [delay])
}

export const useTimeout


;

  describe("Free highlight thickness can be changed", () => {
    let pages;

    beforeEach(async () => {
      pages = await loadAndWait(
        "empty.pdf",
        ".annotationEditorLayer",
        null,
        null,
        { highlightEditorColors: "yellow=#000000" }
      );
    });

    afterEach(async () => {
      await closePages(pages);
    });

    it("must check that the thickness is correctly updated", async () => {
      await Promise.all(
        pages.map(async ([browserName, page]) => {
          await switchToHighlight(page);

          const rect = await getRect(page, ".annotationEditorLayer");

          for (let i = 0; i < 3; i++) {
            const x = rect.x + 120 + i * 120;
            const y = rect.y + 120 + i * 120;
            const clickHandle = await waitForPointerUp(page);
            await page.mouse.move(x, y);
            await page.mouse.down();
            await page.mouse.move(x + 100, y + 100);
            await page.mouse.up();
            await awaitPromise(clickHandle);

            await page.waitForSelector(getEditorSelector(i));
          }

          let value = 12;
          await waitForSerialized(page, 3);
          let serialized = await getSerialized(page);
          expect(serialized.map(x => x.thickness))
            .withContext(`In ${browserName}`)
            .toEqual([value, value, value]);

          await selectAll(page);

          const editorSelector = getEditorSelector(0);
          const { width: prevWidth } = await getRect(page, editorSelector);

          value = 24;
          await page.evaluate(val => {
            window.PDFViewerApplication.eventBus.dispatch(
              "switchannotationeditorparams",
              {
                source: null,
                type: window.pdfjsLib.AnnotationEditorParamsType
                  .HIGHLIGHT_THICKNESS,
                value: val,
              }
            );
          }, value);

          await page.waitForFunction(
            (w, sel) =>
              document.querySelector(sel).getBoundingClientRect().width !== w,
            {},
            prevWidth,
            editorSelector
          );

          await waitForSerialized(page, 3);
          serialized = await getSerialized(page);
          expect(serialized.map(x => x.thickness))
            .withContext(`In ${browserName}`)
            .toEqual([value, value, value]);
        })
      );
    });
  });

  describe("Highlight with the keyboard", () => {
    let pages;

    beforeEach(async () => {
      pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
    });

    afterEach(async () => {
      await closePages(pages);
    });

    it("must check that some text has been highlighted", async () => {
      await Promise.all(
        pages.map(async ([browserName, page]) => {
          await switchToHighlight(page);
          const sel = getEditorSelector(0);

          const spanRect = await getRect(
            page,
            `.page[data-page-number="1"] > .textLayer > span`
          );
          await page.keyboard.down("Shift");
          await page.mouse.click(
            spanRect.x + 1,
            spanRect.y + spanRect.height / 2,
            { count: 2 }
          );
          for (let i = 0; i < 6; i++) {
            await page.keyboard.press("ArrowRight");
          }
          await page.keyboard.press("ArrowDown");
          // Here and elsewhere, we add a small delay between press and release
          // to make sure that a keyup event for Shift is triggered after
          // selectionchange (it's why adding


             electricalGroup, ParameterType.NumberOfPoles);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("bce04092-fe19-476a-a652-4903bb02081e"), "Power",
                electricalGroup, ParameterType.ElectricalPower);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("ecebf138-86d6-4868-879c-bdc5a0b7d746"), "PowerFactor",
                electricalGroup, ParameterType.Number);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("ab0a5903-6625-482f-9e6b-f3bffb38dd13"), "Voltage",
                electricalGroup, ParameterType.ElectricalPotential);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("7dfc1be1-c5d2-471a-b341-7532d2d1627c"), "Wiring",
                "Electrical", ParameterType.Text);

            #endregion

            #region Plumbing

            var plumbingGroup = new SharedParameterFile.Group("Plumbing", 103);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("99e06fdb-82cc-41fe-9fa2-9c524fec6f0f"), "Cold Water Size",
                plumbingGroup, ParameterType.PipeSize);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("a0030f64-4f46-4c02-a88e-a7e72a36611c"), "Cold Water Consumption",
                plumbingGroup, ParameterType.PipingFlow);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("b96ead64-4cb4-459e-aec0-787140811551"), "Cold Water Temperature",
                plumbingGroup, ParameterType.PipingTemperature);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("c031fafc-ce7b-423b-84a1-b87f48f89abf"), "Hot Water Size",
                plumbingGroup, ParameterType.PipeSize);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("6b2ae170-1a20-4bcc-a214-0fabb349dd8f"), "Hot Water Consumption",
                plumbingGroup, ParameterType.PipingFlow);
            simpleSharedFromBuilt.Parameters.Add(
                new Guid("66b5367d-78cd-477a-9fd3-0e04f8459d5a"), "Hot Water Supply Temperature",
                plumbingGroup, ParameterType.PipingTemperature);

            #endregion

            // Remove any difference in terms of line endings
            var simpleSharedFromBuiltText = simpleSharedFromBuilt
                .ToString()
                .Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\n")
                .TrimEnd('\n');

            simpleSharedFromDisk = simpleSharedFromDisk
                .Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\n")
                .TrimEnd('\n');

            Assert.Equal(simpleSharedFromBuiltText, simpleSharedFromDisk);
        }

        /// <summary>
        /// Saves the a catalog to a file.
        /// </summary>
        [Fact]
        public void SavingSharedParametersToFile()
        {
            var sharedParamFile = new SharedParameterFile();
            sharedParamFile.Parameters.Add(
                new Guid("61ff3d56-09d7-4049-8c78-4abe745e4e5a"), "EquipmentName",
                "Identity Data", ParameterType.Text);
            var sharedParamFileTmp = $"{Path.GetTempFileName()}.txt";
            Assert.True(sharedParamFile.Save(sharedParamFileTmp) && File.Exists(sharedParamFileTmp));
        }

        /// <summary>
        /// Tries to initialize shared param file with an ambiguous string.
        /// </summary>
        [Fact]
        public void SharedParametersFromAmbiguousString()
        {
            Assert.Throws<InvalidDataException>(() => new SharedParameterFile("abc"));
        }
    }
}


ontent__geometry circle[fill="#F5F3FF"],html.dark .calculator-content__geometry ellipse[fill="#F5F3FF"],html.dark .calculator-content__geometry path[fill="#F5F3FF"],html.dark .calculator-content__geometry rect[fill="#F5F3FF"]{fill:#4C4E72}.calculator-content__geometry circle[fill="#fff"],.calculator-content__geometry ellipse[fill="#fff"],.calculator-content__geometry path[fill="#fff"],.calculator-content__geometry rect[fill="#fff"]{fill:#fff}html.dark .calculator-content__geometry circle[fill="#fff"],html.dark .calculator-content__geometry ellipse[fill="#fff"],html.dark .calculator-content__geometry path[fill="#fff"],html.dark .calculator-content__geometry rect[fill="#fff"]{fill:#1F2937}html.dark .calculator-content__geometry circle[stroke="#7C3AED"],html.dark .calculator-content__geometry ellipse[stroke="#7C3AED"],html.dark .calculator-content__geometry path[stroke="#7C3AED"],html.dark .calculator-content__geometry rect[stroke="#7C3AED"]{stroke:#A78BFA}html.dark .calculator-content__geometry path[fill="#7C3AED"]{fill:#A78BFA}.calculator-content--small{padding:12px 32px}.calculator-content--gray{background-color:#f9fafb}.calculator-content--options{padding:0;gap:0}.calculator-content--footer{position:relative;z-index:10;border-bottom-left-radius:8px;border-bottom-right-radius:8px}.calculator-content--active .calculator-content-head svg:last-child{transform:rotate(180deg)}.calculator-content--active .calculator-content-body{padding-top:8px;padding-bottom:32px;max-height:100%}@media only screen and (max-width:768px){.calculator-content--active .calculator-content-body{padding-top:8px;padding-bottom:8px}}.calculator-content--bookmarks{padding:0!important;display:flex;gap:0;flex-direction:row}.calculator-content:first-child{border-top-left-radius:8px;border-top-right-radius:8px}@media only screen and (max-width:640px){.calculator-content:first-child{border-radius:0}}.calculator-content--basic,.calculator-content--scientific,.calculator-content:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}@media only screen and (max-width:640px){.calculator-content--basic,.calculator-content--scientific,.calculator-content:last-child{border-radius:0}}.calculator-content+.calculator-content,script+.calculator-content{border-top:1px solid #e5e7eb}@media only screen and (max-width:768px){.calculator-content{padding:32px 16px}.calculator-content--small{padding:12px 16px}.calculator-content--options{padding:0}}html.dark .calculator-content{background:#1f2937}html.dark .calculator-content--gray{background:#374151;border-color:#1f2937}html.dark .calculator-content+html.dark .calculator-content,script+html.dark .calculator-content{border-color:#374151}.calculator-content-head{padding:16px 32px;display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;gap:.75rem}.calculator-content-head svg{transition:.3s linear;width:20px;height:20px}.calculator-content-head svg:not(:last-child){margin-left:auto


w_publish_serialized_messagePtr = _lookup<
          ffi.NativeFunction<
              rmw_ret_t Function(
                  ffi.Pointer<rmw_publisher_t>,
                  ffi.Pointer<rmw_serialized_message_t>,
                  ffi.Pointer<rmw_publisher_allocation_t>)>>(
      'rmw_publish_serialized_message');
  late final _rmw_publish_serialized_message =
      _rmw_publish_serialized_messagePtr.asFunction<
          int Function(
              ffi.Pointer<rmw_publisher_t>,
              ffi.Pointer<rmw_serialized_message_t>,
              ffi.Pointer<rmw_publisher_allocation_t>)>();

  /// Compute the size of a serialized message.
  /// /**
  ///  * Given a message definition and bounds, compute the serialized size.
  ///  *
  ///  * \param[in] type_support The type support of the message to compute.
  ///  * \param[in] message_bounds Artifical bounds to use on unbounded fields.
  ///  * \param[out] size The computed size of the serialized message.
  ///  * \return `RMW_RET_OK` if successful, or
  ///  * \return `RMW_RET_INVALID_ARGUMENT` if either argument is null, or
  ///  * \return `RMW_RET_UNSUPPORTED` if it's unimplemented, or
  ///  * \return `RMW_RET_ERROR` if an unexpected error occurs.
  ///  */
  int rmw_get_serialized_message_size(
    ffi.Pointer<rosidl_message_type_support_t> type_support,
    ffi.Pointer<rosidl_runtime_c__Sequence__bound> message_bounds,
    ffi.Pointer<ffi.Size> size,
  ) {
    return _rmw_get_serialized_message_size(
      type_support,
      message_bounds,
      size,
    );
  }

  late final _rmw_get_serialized_message_sizePtr = _lookup<
      ffi.NativeFunction<
          rmw_ret_t Function(
              ffi.Pointer<rosidl_message_type_support_t>,
              ffi.Pointer<rosidl_runtime_c__Sequence__bound>,
              ffi.Pointer<ffi.Size>)>>('rmw_get_serialized_message_size');
  late final _rmw_get_serialized_message_size =
      _rmw_get_serialized_message_sizePtr.asFunction<
          int Function(
              ffi.Pointer<rosidl_message_type_support_t>,
              ffi.Pointer<rosidl_runtime_c__Sequence__bound>,
              ffi.Pointer<ffi.Size>)>();

  /// Manually assert that this Publisher is alive (for RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC)
  /// /**
  ///  * If the rmw Liveliness policy is set to RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC, the creator of
  ///  * this publisher may manually call `assert_liveliness` at some point in time to signal to the rest
  ///  * of the system that this Node is still alive.
  ///  *
  ///  * <hr>
  ///  * Attribute          | Adherence
  ///  * ------------------ | -------------
  ///  * Allocates Memory   | No
  ///  * Thread-Safe        | Yes
  ///  * Uses Atomics       | No
  ///  * Lock-Free          | Yes
  ///  *
  ///  * \param[in] publisher handle to the publisher that needs liveliness to be asserted
  ///  * \return `RMW_RET_OK` if the liveliness assertion was completed successfully, or
  ///  * \return `RMW_RET_ERROR` if an unspecified error occurs, or
  ///  * \return `RMW_RET_UNSUPPORTED` if the rmw implementation does not support asserting liveliness.
  ///  */
  int rmw_publisher_assert_liveliness(
    ffi.Pointer<rmw_publisher_t> publisher,
  ) {
    return _rmw_publisher_assert_liveliness(
      publisher,
    );
  }

  late final _rmw_publisher_assert_livelinessPtr =


�и на сервер","image":"Слика","flash":"Флеш елемент","form":"Форма","checkbox":"Поље за потврду","radio":"Радио-дугме","textField":"Текстуално поље","textarea":"Зона текста","hiddenField":"Скривено поље","button":"Дугме","select":"Изборно поље","imageButton":"Дугме са сликом","notSet":"<није постављено>","id":"Ид","name":"Назив","langDir":"Смер језика","langDirLtr":"С лева на десно (LTR)","langDirRtl":"С десна на лево (RTL)","langCode":"Kôд језика","longDescr":"Пун опис УРЛ","cssClass":"Stylesheet класе","advisoryTitle":"Advisory наслов","cssStyle":"Стил","ok":"OK","cancel":"Oткажи","close":"Затвори","preview":"Изглед странице","resize":"Resize","generalTab":"Опште","advancedTab":"Напредни тагови","validateNumberFailed":"Ова вредност није цигра.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"You have changed some options. Are you sure you want to close the dialog window?","options":"Опције","target":"Meтa","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"С лева на десно (LTR)","langDirRTL":"С десна на лево (RTL)","styles":"Стил","cssClasses":"Stylesheet класе","width":"Ширина","height":"Висина","align":"Равнање","alignLeft":"Лево","alignRight":"Десно","alignCenter":"Средина","alignJustify":"Обострано равнање","alignTop":"Врх","alignMiddle":"Средина","alignBottom":"Доле","alignNone":"None","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1, unavailable"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"Подебљано","italic":"Курзив","strike":"Прецртано","subscript":"Индекс","superscript":"Степен","underline":"Подвучено"},"blockquo


唱沙作米": [["chàng"], ["shā"], ["zuò"], ["mǐ"]],
"超超玄著": [["chāo"], ["chāo"], ["xuán"], ["zhù"]],
"超导体": [["chāo"], ["dǎo"], ["tǐ"]],
"超度众生": [["chāo"], ["dù"], ["zhòng"], ["shēng"]],
"超高频": [["chāo"], ["gāo"], ["pín"]],
"超高压": [["chāo"], ["gāo"], ["yā"]],
"超级大国": [["chāo"], ["jí"], ["dà"], ["guó"]],
"超级市场": [["chāo"], ["jí"], ["shì"], ["chǎng"]],
"超今冠古": [["chāo"], ["jīn"], ["guàn"], ["gǔ"]],
"超期服役": [["chāo"], ["qī"], ["fú"], ["yì"]],
"超然不群": [["chāo"], ["rán"], ["bù"], ["qún"]],
"超然独处": [["chāo"], ["rán"], ["dú"], ["chǔ"]],
"超然远举": [["chāo"], ["rán"], ["yuǎn"], ["jǔ"]],
"超然远引": [["chāo"], ["rán"], ["yuǎn"], ["yǐn"]],
"超然自得": [["chāo"], ["rán"], ["zì"], ["dé"]],
"巢焚原燎": [["cháo"], ["fén"], ["yuán"], ["liáo"]],
"巢居穴处": [["cháo"], ["jū"], ["xué"], ["chǔ"]],
"朝不保暮": [["zhāo"], ["bù"], ["bǎo"], ["mù"]],
"巢林一枝": [["cháo"], ["lín"], ["yī"], ["zhī"]],
"朝不保夕": [["zhāo"], ["bù"], ["bǎo"], ["xī"]],
"朝不及夕": [["zhāo"], ["bù"], ["jí"], ["xī"]],
"朝不虑夕": [["zhāo"], ["bù"], ["lǜ"], ["xī"]],
"朝朝暮暮": [["zhāo"], ["zhāo"], ["mù"], ["mù"]],
"朝不谋夕": [["zhāo"], ["bù"], ["móu"], ["xī"]],
"朝趁暮食": [["zhāo"], ["chèn"], ["mù"], ["shí"]],
"朝成暮徧": [["cháo"], ["chéng"], ["mù"], ["shí"]],
"朝成暮毁": [["zhāo"], ["chéng"], ["mù"], ["huǐ"]],
"朝成暮遍": [["zhāo"], ["chéng"], ["mù"], ["biàn"]],
"朝成夕毁": [["zhāo"], ["chéng"], ["xī"], ["huǐ"]],
"朝穿暮塞": [["zhāo"], ["chuān"], ["mù"], ["sāi"]],
"朝发暮至": [["zhāo"], ["fā"], ["mù"], ["zhì"]],
"朝歌暮弦": [["zhāo"], ["gē"], ["mù"], ["xián"]],
"朝发夕至": [["zhāo"], ["fā"], ["xī"], ["zhì"]],
"朝更暮改": [["zhāo"], ["gèng"], ["mù"], ["gǎ


D
    ENTER key

    -
    0E-0F
    Undefined

    VK_SHIFT
    10
    SHIFT key

    VK_CONTROL
    11
    CTRL key

    VK_MENU
    12
    ALT key

    VK_PAUSE
    13
    PAUSE key

    VK_CAPITAL
    14
    CAPS LOCK key

    VK_KANA
    15
    Input Method Editor (IME) Kana mode

    VK_HANGUEL
    15
    IME Hanguel mode (maintained for compatibility; use VK_HANGUL)

    VK_HANGUL
    15
    IME Hangul mode

    -
    16
    Undefined

    VK_JUNJA
    17
    IME Junja mode

    VK_FINAL
    18
    IME final mode

    VK_HANJA
    19
    IME Hanja mode

    VK_KANJI
    19
    IME Kanji mode

    -
    1A
    Undefined

    VK_ESCAPE
    1B
    ESC key

    VK_CONVERT
    1C
    IME convert (Reserved for Kanji systems)

    VK_NONCONVERT
    1D
    IME nonconvert (Reserved for Kanji systems)

    V


{
			"wpn_fps_upg_vg_ass_smg_stubby"
		}
	}
	self.parts.wpn_fps_smg_mp7_s_standard = {
		type = "stock",
		name_id = "bm_wp_mp7_s_standard",
		texture_bundle_folder = "gage_pack",
		a_obj = "a_s",
		unit = "units/pd2_dlc_dec5/weapons/wpn_fps_smg_mp7_pts/wpn_fps_smg_mp7_s_standard",
		stats = {value = 1}
	}
	self.parts.wpn_fps_smg_mp7_s_long = {
		pcs = {
			10,
			20,
			30,
			40
		},
		type = "stock",
		name_id = "bm_wp_mp7_s_long",
		texture_bundle_folder = "gage_pack",
		a_obj = "a_s",
		unit = "units/pd2_dlc_dec5/weapons/wpn_fps_smg_mp7_pts/wpn_fps_smg_mp7_s_long",
		stats = {
			value = 1,
			recoil = 2,
			spread_moving = -1,
			concealment = -2
		},
		dlc = "gage_pack"
	}
	self.parts.wpn_fps_smg_mp7_m_short.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_m_short"
	self.parts.wpn_fps_smg_mp7_m_extended.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_m_extended"
	self.parts.wpn_fps_smg_mp7_b_standard.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_b_standard"
	self.parts.wpn_fps_smg_mp7_b_suppressed.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_b_suppressed"
	self.parts.wpn_fps_smg_mp7_body_standard.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_body_standard"
	self.parts.wpn_fps_smg_mp7_s_standard.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_s_standard"
	self.parts.wpn_fps_smg_mp7_s_long.third_unit = "units/pd2_dlc_dec5/weapons/wpn_third_smg_mp7_pts/wpn_third_smg_mp7_s_long"
	self.wpn_fps_smg_mp7 = {}
	self.wpn_fps_smg_mp7.unit = "units/pd2_dlc_dec5/weapons/wpn_fps_smg_mp7/wpn_fps_smg_mp7"
	self.wpn_fps_smg_mp7.optional_types = {"barrel_ext", "gadget"}
	self.wpn_fps_smg_mp7.default_blueprint = {
		"wpn_fps_smg_mp7_m_short",
		"wpn_fps_smg_mp7_b_standard",
		"wpn_fps_smg_mp7_body_standard",
		"wpn_fps_smg_mp7_s_standard"
	}
	self.wpn


n
// the presence of a fixed length list constructor call.

/*member: myList:Container([exact=JSExtendableArray], element: Union([exact=JSString], [subclass=JSNumber]), length: null)*/
var myList = [];

/*member: otherList:Container([exact=JSExtendableArray], element: Union([exact=JSString], [exact=JSUInt31]), length: 2)*/
var otherList = ['foo', 42];

/*member: main:[null]*/
main() {
  dynamic a = otherList
      /*Container([exact=JSExtendableArray], element: Union([exact=JSString], [exact=JSUInt31]), length: 2)*/
      [0];
  a /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ += 54;
  myList
      .
      /*invoke: Container([exact=JSExtendableArray], element: Union([exact=JSString], [subclass=JSNumber]), length: null)*/
      add(a);
}
// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart = 2.7

/*member: main:[null]*/
main() {
  thisExact();
  thisSubclass();
  thisSubclassExact();
  thisSubtype();
  thisSubtypeExact();
  thisSubtypeMixedIn();
  thisSubtypeExactMixedIn();
}

////////////////////////////////////////////////////////////////////////////////
/// Return `this` of a class with no subclasses.
////////////////////////////////////////////////////////////////////////////////

/*member: Class1.:[exact=Class1]*/
class Class1 {
  /*member: Class1.method:[exact=Class1]*/
  method() => this;
}

/*member: thisExact:[exact=Class1]*/
thisExact() => Class1(). /*invoke: [exact=Class1]*/ method();

////////////////////////////////////////////////////////////////////////////////
/// Return `this` of a class with an instantiated subclass.
////////////////////////////////////////////////////////////////////////////////

/*member: Class2a.:[exact=Class2a]*/
class Class2a {
  /*member: Class2a.method:[subclass=Class2a]*/
  method() => this;
}

/*member: Class2b.:[exact=Class2b]*/
class Class2b extends Class2a {}

/*member: thisSubclass:[subclass=Class2a]*/
thisSubclass() {
  Class2b();
  return Class2a(). /*invoke: [exact=Class2a]*/ method();
}

////////////////////////////////////////////////////////////////////////////////
/// Return `this` of a class with no instantiated subclasses.
////////////////////////////////////////////////////////////////////////////////

/*member: Class3a.:[exact=Class3a]*/
class Class3a {
  /*member: Class3a.method:[exact=Class3a]*/
  method() => this;
}

class Class3b extends Class3a {}

/*member: thisSubclassExact:[exact=Class3a]*/
thisSubclassExact() {
  return Class3a(). /*invoke: [exact=Class3a]*/ method();
}

////////////////////////////////////////////////////////////////////////////////
/// Return `this` of a class that is mixed into an instantiated class.
////////////////////////////////////////////////////////////////////////////////

/*member: Class4a.:[exact=Class4a]*/
class Class4a {
  /*member: Class4a.method:[subtype=Class4a]*/
  method() => this;
}

/*member: Class4b.:[exact=Class4b]*/
class Class4b extends Object with Class4a {}

/*member: thisSubtype:[subtype=Class4a]*/
thisSubtype() {
  Class4b();


  });
}

template <typename scalar_t, typename scalar_t_underlying>
void _qmaxpool_2d_nhwc_kernel(
    const Tensor& qx,
    int64_t iC, // input/output channels
    int64_t iH,
    int64_t iW, // input sizes
    int64_t oH,
    int64_t oW, // output sizes
    int64_t kH,
    int64_t kW, // kernel size
    int64_t sH,
    int64_t sW, // strides
    int64_t pH,
    int64_t pW, // padding
    int64_t dH,
    int64_t dW, // dilation
    Tensor& qy) {
    scalar_t* idata = static_cast<scalar_t*>(qx.data_ptr());
    scalar_t* odata = static_cast<scalar_t*>(qy.data_ptr());

    int64_t nBatch = qx.size(0);
    at::parallel_for(0, nBatch * oH * oW, 0, [&](int64_t begin, int64_t end) {
      int64_t b{0}, row{0}, col{0};
      data_index_init(begin, b, nBatch, row, oH, col, oW);

      for (const auto i : c10::irange(begin, end)) {
        auto* i_p = reinterpret_cast<scalar_t_underlying*>(idata + b * iW * iH * iC);
        auto* o_p = reinterpret_cast<scalar_t_underlying*>(odata + i * iC);

        // Loop over reduction block
        int64_t h_start = row * sH - pH;
        int64_t w_start = col * sW - pW;
        int64_t h_end = std::min(h_start + (kH - 1) * dH + 1, iH);
        int64_t w_end = std::min(w_start + (kW - 1) * dW + 1, iW);
        while (h_start < 0)
          h_start += dH;
        while (w_start < 0)
          w_start += dW;

        int64_t c = 0;

        // Interleaved vector loop 4x
        constexpr auto vec_width = Vectorized<scalar_t>::size();
        for (; c + 4 * vec_width <= iC; c += 4 * vec_width) {
          Vectorized<scalar_t> acc{
              scalar_t(std::numeric_limits<scalar_t_underlying>::lowest())};
          // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
          Vectorized<scalar_t> accs[4] = {acc, acc, acc, acc};
          int64_t tcntr = 0;
          int64_t x, y;
          for (y = h_start; y < h_end; y += dH) {
            for (x = w_start; x < w_end; x += dW) {
              for (const auto i : c10::irange(4)) {
                tcntr = y * iW + x;
                auto vals = Vectorized<scalar_t>::loadu(
                    i_p + tcntr * iC + c + Vectorized<scalar_t>::size() * i);
                accs[i] = vec::maximum(accs[i], vals);
              }
            } // for x
          } // for y
          for (const auto i : c10::irange(4)) {
            accs[i].store(o_p + c + Vectorized<scalar_t>::size() * i);
          }
        } // for c

        //


height: 8px;
          margin: 0 14px 1px 10px;
          content: " ";
          background: @brand-primary;
        }

        &:hover,
        &:focus {
          background: @navbarside-sub-bg;
        }
      }

      &.current {
        a {
          &::before {
            width: 8px;
            padding-left: 8px;
            margin-right: 6px;
          }
        }
      }

      &.login {
        border-top: 1px solid fade(@white, 10%);
      }
    }
  }

  // Hide config-bar inside navigation since it is always cropped
  .config-bar {
    display: none !important;
  }
}

// expanded view
@media (min-width: @screen-sm-min) {
  .navbar-static-side {
    display: none;
  }

  #content-wrapper {
    margin-left: 0;
  }
}

@media (max-width: @screen-sm) {
  .nav-open-lg {
    #cms-admin-footer {
      z-index: @zindex-navbar-fixed;
    }
  }
}

@media (min-width: @grid-float-breakpoint) {
  .nav-open-lg {
    .navbar-static-side {
      display: flex;
      flex-direction: column;
    }

    #content-wrapper {
      margin-left: @navbarside-width;
    }
  }
}

// sub page styles
.main-content {
  padding: 5px 15px;

  #page-content {
    min-height: 600px;
  }

  .page-title,
  .page-title-inject,
  .page-title-addon {
    padding: 4px 15px;
    margin: -5px -15px 5px;
    color: @pagetitle-text-color;
    background-color: var(--pagetitle-background, @pagetitle-background);

    .title {
      margin: 0;
      font-size: 24px;
      font-weight: 700;
    }

    .page-icon {
      display: none;
    }

    .breadcrumb {
      padding: 0;
      margin: 0;
      font-size: 12px;

      a:hover {
        text-decoration: underline;
      }

      i {
        display: none;
      }

      > li + li::before {
        padding: 0 14px;
        font-family: @fa-font-face;
        font-size: .8333em;
        font-weight: @fa-theme-weight;
        content: "@{breadcrumb-separator}";
      }
    }
  }

  .page-title,
  .page-title-addon {
    border-bottom: 1px solid @gray-lighter;
  }

  @media (min-width: @screen-md-min) {
    padding: 0;
    margin: 35px 35px 0;

    .page-title,
    .page-title-inject,
    .page-title-addon {
      padding: 4px 35px;
      margin: -35px -35px 35px;
    }

    .page-title {
      padding: 20px 35px;
    }
  }
}

.main-footer {
  padding: 15px 0;
}

// person profile
@media (min-width: @screen-md-min) {
  .personprofile {
    margin: -35px -35px 0;
  }
}

// workflow page
.workflow-activity {
  & > .panel-heading {
    color: @white;
    background-color: @btn-action-bg;
    border-color: @btn-action-bg;

    a.btn-link {
      color: @white;
    }
  }

  .btn-action.add-action {
    color: @panel-heading


using DodocoTales.SR.Library;
using DodocoTales.SR.Library.Enums;
using DodocoTales.SR.Library.GameClient.Models;
using Microsoft.Extensions.FileSystemGlobbing;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace DodocoTales.SR.Loader
{
    public class DDCGGameClientLoader
    {
        readonly string output_log_cn = Environment.GetEnvironmentVariable("USERPROFILE") + @"/AppData/LocalLow/miHoYo/崩坏：星穹铁道/Player.log";
        readonly string output_log_os = Environment.GetEnvironmentVariable("USERPROFILE") + @"/AppData/LocalLow/Cognosphere/Star Rail/Player.log";
        readonly string game_path_pattern = @"Loading player data from (.+)data.unity3d.+";
        public readonly string StarRailData_CN = "StarRail_Data";
        public readonly string ClientName_CN = "崩坏：星穹铁道";
        public readonly string StarRailData_OS = "StarRail_Data";
        public readonly string ClientName_OS = "Honkai: Star Rail";

        public void LoadGameClientFromGameLog()
        {
            var ls = new List<DDCLGameClientItem>();
            ls.AddRange(LoadGameClientFromGameLogBase(output_log_cn));
            ls.AddRange(LoadGameClientFromGameLogBase(output_log_os));
            var exists = DDCL.GameClientLib.GetClients().Select(x => x.Path);
            ls.RemoveAll(x => exists.Contains(x.Path));
            DDCL.GameClientLib.AddClients(ls);
        }

        private List<DDCLGameClientItem> LoadGameClientFromGameLogBase(string output_log)
        {
            var items = new List<DDCLGameClientItem>();
            try
            {
                using (var stream = File.Open(output_log, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                {
                    StreamReader reader = new StreamReader(stream);
                    var log = reader.ReadToEnd();
                    var result = Regex.Match(log, game_path_pattern);
                    var starrail_data_dir = result.Groups[1].Value;

                    var item = new DDCLGameClientItem
                    {
                        Path = starrail_data_dir,
                        IsDefault = false,
                    };

                    var info = new DirectoryInfo(starrail_data_dir);
                    if (info.Name == StarRailData_CN)
                    {
                        //DDCLog.Info(DCLN.Loader, String.Format("CN client detected: {0}", genshin_data_dir));
                        item.Name = ClientName_CN;
                        item.ClientType = DDCLGameClientType.CN;
                    }
                    else if (info.Name == StarRailData_OS)
                    {
                        item.Name = ClientName_OS;
                        item.ClientType = DDCLGameClientType.Global;
                    }
                    else
                    {
                        item = null;
                    }
                    if (item != null) items.Add(item);
                }
            }
            catch
            {

            }
            return items;
        }

        public readonly string ClientExecutable = "StarRail.exe";

        public DDCLGameClientItem LoadGameClientItemFromExecutablePath(string execpath)
        {
            FileInfo exec = new FileInfo(execpath);
            if (exec.Name == ClientExecutable)
            {
                var star_rail_data_dir = exec.DirectoryName + "/" + StarRai


/**
 * Finds the class declaration that is being referred to by a node.
 * @param reference Node referring to a class declaration.
 * @param typeChecker
 */
export function findClassDeclaration(
    reference: ts.Node, typeChecker: ts.TypeChecker): ts.ClassDeclaration|null {
  return typeChecker.getTypeAtLocation(reference).getSymbol()?.declarations?.find(
             ts.isClassDeclaration) ||
      null;
}

/** Finds a property with a specific name in an object literal expression. */
export function findLiteralProperty(literal: ts.ObjectLiteralExpression, name: string) {
  return literal.properties.find(
      prop => prop.name && ts.isIdentifier(prop.name) && prop.name.text === name);
}

/** Gets a relative path between two files that can be used inside a TypeScript import. */
export function getRelativeImportPath(fromFile: string, toFile: string): string {
  let path = relative(dirname(fromFile), toFile).replace(/\.ts$/, '');

  // `relative` returns paths inside the same directory without `./`
  if (!path.startsWith('.')) {
    path = './' + path;
  }

  // Using the Node utilities can yield paths with forward slashes on Windows.
  return normalizePath(path);
}

/** Function used to remap the generated `imports` for a component to known shorter aliases. */
export function knownInternalAliasRemapper(imports: PotentialImport[]) {
  return imports.map(
      current => current.moduleSpecifier === '@angular/common' && current.symbolName === 'NgForOf' ?
          {...current, symbolName: 'NgFor'} :
          current);
}

/**
 * Gets the closest node that matches a predicate, including the node that the search started from.
 * @param node Node from which to start the search.
 * @param predicate Predicate that the result needs to pass.
 */
export function closestOrSelf<T extends ts.Node>(
    node: ts.Node, predicate: (n: ts.Node) => n is T): T|null {
  return predicate(node) ? node : closestNode(node, predicate);
}

/**
 * Checks whether a node is referring to a specific class declaration.
 * @param node Node that is being checked.
 * @param className Name of the class that the node might be referring to.
 * @param moduleName Name of the Angular module that should contain the class.
 * @param typeChecker
 */
export function isClassReferenceInAngularModule(
    node: ts.Node, className: string|RegExp, moduleName: string,
    typeChecker: ts.TypeChecker): boolean {
  const symbol = typeChecker.getTypeAtLocation(node).getSymbol();
  const externalName = `@angular/${moduleName}`;
  const internalName = `angular2/rc/packages/${moduleName}`;

  return !!symbol?.declarations?.some(decl => {
    const closestClass = closestOrSelf(decl, ts.isClassDeclaration);
    const closestClassFileName = closestClass?.getSourceFile().fileName;

    if (!closestClass || !closestClassFileName || !closestClass.name ||
        !ts.isIdentifier(closestClass.name) ||
        (!closestClassFileName.includes(externalName) &&
         !closestClassFileName.includes(internalName))) {
      return false;
    }

    return typeof className === 'string' ? closestClass.name.text === className :
                                           className.test(closestClass.name.text);
  });
}
import * as inquirer from "inquirer";
import { add, validate } from "./number-util";

const questions: inquirer.Questions = [
  {
    type: "input",
    name: "a",
    message: "What's the first number",
    default: generateRandomNumb


Time Skin Rendering
	//
	//			http://developer.download.nvidia.com/presentations/2007/gdc/Advanced_Skin.pdf
	//			http://http.developer.nvidia.com/GPUGems3/gpugems3_ch14.html
	// ------------------------------------------------------------------------------------------ */

	'skin' : {

		uniforms: THREE.UniformsUtils.merge( [

			THREE.UniformsLib[ "fog" ],
			THREE.UniformsLib[ "lights" ],

			{

			"passID": { type: "i", value: 0 },

			"tDiffuse"	: { type: "t", value: null },
			"tNormal"	: { type: "t", value: null },

			"tBlur1"	: { type: "t", value: null },
			"tBlur2"	: { type: "t", value: null },
			"tBlur3"	: { type: "t", value: null },
			"tBlur4"	: { type: "t", value: null },

			"tBeckmann"	: { type: "t", value: null },

			"uNormalScale": { type: "f", value: 1.0 },

			"diffuse":  { type: "c", value: new THREE.Color( 0xeeeeee ) },
			"specular": { type: "c", value: new THREE.Color( 0x111111 ) },
			"ambient":  { type: "c", value: new THREE.Color( 0x050505 ) },
			"opacity": 	  { type: "f", value: 1 },

			"uRoughness": 	  		{ type: "f", value: 0.15 },
			"uSpecularBrightness": 	{ type: "f", value: 0.75 }

			}

		] ),

		fragmentShader: [

			"uniform vec3 ambient;",
			"uniform vec3 diffuse;",
			"uniform vec3 specular;",
			"uniform float opacity;",

			"uniform float uRoughness;",
			"uniform float uSpecularBrightness;",

			"uniform int passID;",

			"uniform sampler2D tDiffuse;",
			"uniform sampler2D tNormal;",

			"uniform sampler2D tBlur1;",
			"uniform sampler2D tBlur2;",
			"uniform sampler2D tBlur3;",
			"uniform sampler2D tBlur4;",

			"uniform sampler2D tBeckmann;",

			"uniform float uNormalScale;",

			"varying vec3 vTangent;",
			"varying vec3 vBinormal;",
			"varying vec3 vNormal;",
			"varying vec2 vUv;",

			"uniform vec3 ambientLightColor;",

			"#if MAX_DIR_LIGHTS > 0",
				"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];",
				"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];",
			"#endif",

			"#if MAX_POINT_LIGHTS > 0",
				"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];",
				"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];",
			"#endif",

			"varying vec3 vViewPosition;",

			THREE.ShaderChunk[ "fog_pars_fragment" ],

			"float fresnelReflectance( vec3 H, vec3 V, float F0 ) {",

				"float base = 1.0 - dot( V, H );",
				"float exponential = pow( base, 5.0 );",

				"return exponential + F0 * ( 1.0 - exponential );",

			"}",

			// Kelemen/Szirmay-Kalos specular BRDF

			"float KS_Skin_Specular( vec3 N,", 		// Bumped surface normal
									"vec3 L,", 		// Points to light
									"vec3 V,", 		// Points to eye
									"float m,",  	// Roughness
									"float rho_s", 	// Specular brightness
									") {",

				"float result = 0.0;",
				"float ndotl = dot( N, L );",

				"if( ndotl > 0.0 ) {",

					"vec3 h = L + V;", // Unnormalized half-way vector


Base
import org.jetbrains.r.psi.api.RAssignmentStatement
import org.jetbrains.r.psi.api.RCallExpression

class R6ClassInfoUtilTests : RClassesUtilTestsBase() {
  private val fullClassCodeDefinition = """
      Car <- R6Class("Car",
        inherit = Vehicle,
        public = list(
          weight = 0,
          speed = 0,
          accelerate = function(acc = 1){
            self${"$"}speed <- self${"$"}speed + acc
            invisible(self)
          },
          slowDown = function(neg_acc = 1){
            self${"$"}speed <- self${"$"}speed - acc
            invisible(self)
          }
        ),
        private = list(
          engine_rpm = 1000,
          maximize = function(rmp = 1000) {
            self${"$"}engine_rpm <- self${"$"}engine_rpm + rmp
            invisible(self)
          }
        ),
        active = list(
          asd = 0,
          random = function(value) {
            if (missing(value)) {
              runif(1)
            } else {
              stop("Can't set `${"$"}random`", call. = FALSE)
            }
          }
        )
      )
      """.trimIndent()

  private val shortedClassCodeDefinition = """
      Car <- R6Class("Car",
        inherit = Vehicle,
        list(
          weight = 0,
          speed = 0,
          accelerate = function(acc = 1){
            self${"$"}speed <- self${"$"}speed + acc
            invisible(self)
          },
          slowDown = function(neg_acc = 1){
            self${"$"}speed <- self${"$"}speed - acc
            invisible(self)
          }
        )
      )
      """.trimIndent()

  fun testGetAssociatedClassName(){
    val rCallExpression = doTestBase(fullClassCodeDefinition)
    val className = R6ClassInfoUtil.getAssociatedClassNameFromR6ClassCall(rCallExpression)
    assertEquals("Car", className)
  }

  fun testGetAssociatedClassNameFromInstantiationCall(){
    val call = doTestBase("obj <- MyClass${'$'}new()")
    val className = R6ClassInfoUtil.getAssociatedClassNameFromInstantiationCall(call)
    assertEquals("MyClass", className)
  }

  fun testGetAssociatedSuperClasses(){
    val rCallExpression = doTestBase("""
      SuperParentClass <- R6Class("SuperParentClass")
      ParentClass <- R6Class("ParentClass", inherit = SuperParentClass)
      ChildClass <- R6Class("ChildClass", inherit = ParentClass)
    """.trimIndent())

    val superClassNames = R6ClassInfoUtil.getAssociatedSuperClassesHierarchy(rCallExpression)
    assertNotNull(superClassNames)
    assertContainsElements(superClassNames!!, "ParentClass", "SuperParentClass")
  }

  fun testClassContainsFields() = doFieldsTest(fullClassCodeDefinition, "weight" to true, "speed" to true, "engine_rpm" to false)
  fun testClassContainsMethods() = doMethodsTest(fullClassCodeDefinition, "accelerate" to true, "slowDown" to true, "maximize" to false)
  fun testGetAssociatedActiveBindings(){
    val rCallExpression = doTestBase(fullClassCodeDefinition)
    val classActiveBindings = R6ClassInfoUtil.getAssociatedActiveBindings(rCallExpression)

    assertNotNull(classActiveBindings)
    assertEquals(classActiveBindings!!.size, 1)
    assertContainsElements(classActiveBindings.map { it.name }, "random")
  }

  fun testGetShort


Holder.sidedSuccess(player.getItemInHand(hand), world.isClientSide)
    }

    override fun inventoryTick(stack: ItemStack, world: Level, entity: Entity, slot: Int, isSelected: Boolean) {
        if (entity !is LivingEntity || world.isClientSide) return

        // TODO check for FSB armor

        val capability = Capabilities.getContamination(entity) ?: return

        val radPerSecond = capability.getRadPerSecond()

        if (world.gameTime % 5L == 0L) if (radPerSecond > 0) {
            var intensity = 0
            val likelihood = if (radPerSecond < 1) 3
            else if (radPerSecond < 5) 2
            else 1
            if (radPerSecond < 10) intensity = 1
            if (radPerSecond > 5 && radPerSecond < 15) intensity = intensity or (1 shl 1)
            if (radPerSecond > 10 && radPerSecond < 20) intensity = intensity or (1 shl 2)
            if (radPerSecond > 15 && radPerSecond < 25) intensity = intensity or (1 shl 3)
            if (radPerSecond > 20 && radPerSecond < 30) intensity = intensity or (1 shl 4)
            if (radPerSecond > 25) intensity = intensity or (1 shl 5)

            // making use of short-circuiting
            if ((likelihood == 1 || world.random.nextInt(likelihood) == 0)) {
                val sound = when (Random.nextInt(intensity.countTrailingZeroBits(), intensity.countOneBits() + intensity.countTrailingZeroBits()) + 1) {
                    1 -> SoundEvents.geiger1
                    2 -> SoundEvents.geiger2
                    3 -> SoundEvents.geiger3
                    4 -> SoundEvents.geiger4
                    5 -> SoundEvents.geiger5
                    6 -> SoundEvents.geiger6
                    else -> SoundEvents.geiger1
                }

                world.playSound(null, entity, sound.get(), SoundSource.PLAYERS, 1F, 1F)
            }

        } else if (world.random.nextInt(50) == 0)
            world.playSound(null, entity,
                if (world.random.nextInt(2) == 0) SoundEvents.geiger2.get() else SoundEvents.geiger1.get(),
                SoundSource.PLAYERS, 1F, 1F
            )
    }

    companion object {
        fun printGeigerData(player: Player) {
            val world = player.level
            val capability = Capabilities.getContamination(player) ?: return

            // for that hbm approved decimal rounding
            val chunkRadiation = (ChunkRadiation.getRadiation(world, player.blockPosition()) * 10F).toInt() / 10F
            val environmentRadiation = (capability.getRadPerSecond() * 10F).toInt() / 10F
            val playerIrradiation = (capability.getIrradiation() * 10F).toInt() / 10F
            val playerResistance = (10_000F - EntityContaminationEffects.calculateRadiationMod(player) * 10_000F).toInt() / 100F
            val playerResistanceCoefficient = (HazmatValues.getPlayerResistance(player) * 10_000F).toInt() / 100F

            player.displayClientMessage(
                TextComponent("===== ☢ ")
                    .append(LangKeys.GEIGER_TITLE)
                    .append(TextComponent(" ☢ ====="))
                    .withStyle(ChatFormatting.GOLD), false
            )
            player.displayClientMessage(
                LangKeys.GEIGER_CHUNK_RADIATION
                    .append(TextComponent(" $chunkRadiation RAD/s").withStyle(getColorForRadValue(chunkRadiation)))
                    .withStyle(ChatFormatting.YELLOW), false
            )
            player.displayClientMessage(
                LangKeys.GEIGER_TOTAL_ENVIRONMENTAL_RADIATION
                    .append(TextComponent(" $environmentRadiation RAD/s").with


T
	sta	GBASL

	lda	gr_offsets+1,X
	clc
	adc	DRAW_PAGE
	sta	GBASH

	ldy	#5
sword_inner_loop:
	lda	(CURRENT_SPRITEL),Y
	beq	skip_pixel
	sta	(GBASL),Y
skip_pixel:
	;====================================

	dey
	bpl	sword_inner_loop

	; handle reflections

	lda	REFCOUNT
	lsr
	bcs	pixel_odd

	tay
	lda	reflect1_h,Y
	clc
	adc	DRAW_PAGE
	sta	REF1H
	lda	reflect1_l,Y
	sta	REF1L

	lda	reflect2_h,Y
	clc
	adc	DRAW_PAGE
	sta	REF2H
	lda	reflect2_l,Y
	sta	REF2L

	ldy	#3
	lda	(CURRENT_SPRITEL),Y
	beq	pixel_odd		; skip if black

	ldy	#0
	sta	(REF1L),Y
	sta	(REF2L),Y

pixel_odd:
	;============================

	inc	REFCOUNT
	inc	COUNT

	clc
	lda	CURRENT_SPRITEL
	adc	#6
	sta	CURRENT_SPRITEL
	lda	#0
	adc	CURRENT_SPRITEH
	sta	CURRENT_SPRITEH

	inx
	inx
	cpx	#28
	bne	sword_loop

	; move to next input line

	clc
	lda	BASE_SPRITEL
	adc	#6
	sta	BASE_SPRITEL
	lda	#0
	adc	BASE_SPRITEH
	sta	BASE_SPRITEH

	rts

        ;==========
        ; page_flip
        ;==========

page_flip:
        lda     DRAW_PAGE                                               ; 3
        beq     page_flip_show_1                                        ; 2nt/3
page_flip_show_0:
	; show page2, draw page1
        bit     PAGE2                                                   ; 4
        lda     #0                                                      ; 2
        sta	DRAW_PAGE
        rts                                                             ; 6

page_flip_show_1:
	; show page1, draw page2
	bit	PAGE1                                                   ; 4
	lda	#4
	sta	DRAW_PAGE
	rts

reflect1_h:
	; 46,44,42,40,38,36,34
	.byte	>$7d0,>$750,>$6d0,>$650,>$5d0,>$550,>$4d0
	; 39, 38, 37, 36, 36, 34, 33
reflect1_l:
	.byte	<$7d0+39,<$750+38,<$6d0+37,<$650+36,<$5d0+35,<$550+34,<$4d0+33

reflect2_h:
	; 4,6,8,10,12,14,16
	.byte	>$500,>$580,>$600,>$680,>$700,>$780,>$428
reflect2_l:
	.byte	<$500+32,<$580+31,<$600+30,<$680+29,<$700+28,<$780+27,<$428+26

	.include	"../wait_keypress.s"

;	.include	"../gr_pageflip.s"
	.include	"../gr_copy.s"

	.include	"../gr_offsets.s"

	.include	"../audio.s"
	.include	"../irq_wait.s"

spheres_data:
;	.incbin "graphics/spheres.hgr.zx02"
	.incbin "graphics/spheres.gr.zx02"

transmission_data:
	.incbin "audio/transmission.btc.zx02"

	.include "graphics/sword_sprite.inc"


// ReconnectToReplicationSource reconnects to an existing replication source
func ReconnectToReplicationSource(conn ClickhouseConn, details *ClickhouseReplicationSourceDetails, eventHandler func(map[string]interface{})) error {
	// For Clickhouse, we need to recreate the replication setup
	// as there's no direct equivalent to PostgreSQL's replication slots

	// First, clean up any existing replication setup for this table
	cleanupReplication(conn, details.TableName)

	// Then create a new replication source
	_, err := CreateReplicationSource(conn, details.TableName, details.DatabaseID, eventHandler)
	if err != nil {
		return fmt.Errorf("error recreating replication source: %v", err)
	}

	return nil
}

func cleanupReplication(conn ClickhouseConn, tableName string) {
	ctx := context.Background()

	// Find and drop materialized views related to this table
	query := `
		SELECT name
		FROM system.tables
		WHERE database = currentDatabase()
		AND engine = 'MaterializedView'
		AND name LIKE ?
	`

	rows, err := conn.Query(ctx, query, fmt.Sprintf("_mv_%s_%%", tableName))
	if err != nil {
		log.Printf("Error finding materialized views: %v", err)
		return
	}
	defer rows.Close()

	for rows.Next() {
		var mvName string
		if err := rows.Scan(&mvName); err != nil {
			log.Printf("Error scanning materialized view name: %v", err)
			continue
		}

		err = conn.Exec(ctx, fmt.Sprintf("DROP VIEW IF EXISTS %s", mvName))
		if err != nil {
			log.Printf("Error dropping materialized view %s: %v", mvName, err)
		}
	}

	// Find and drop buffer tables related to this table
	query = `
		SELECT name
		FROM system.tables
		WHERE database = currentDatabase()
		AND engine = 'Buffer'
		AND name LIKE ?
	`

	rows, err = conn.Query(ctx, query, fmt.Sprintf("_buffer_%s_%%", tableName))
	if err != nil {
		log.Printf("Error finding buffer tables: %v", err)
		return
	}
	defer rows.Close()

	for rows.Next() {
		var bufferName string
		if err := rows.Scan(&bufferName); err != nil {
			log.Printf("Error scanning buffer table name: %v", err)
			continue
		}

		err = conn.Exec(ctx, fmt.Sprintf("DROP TABLE IF EXISTS %s", bufferName))
		if err != nil {
			log.Printf("Error dropping buffer table %s: %v", bufferName, err)
		}
	}
}

func listenForReplicationEvents(conn ClickhouseConn, bufferTableName string, eventHandler func(map[string]interface{})) {
	ctx := context.Background()

	for {
		// Query the buffer table for changes
		query := fmt.Sprintf("SELECT * FROM %s", bufferTableName)
		rows, err := conn.Query(ctx, query)
		if err != nil {
			log.Printf("Error querying buffer table: %v", err)
			time.Sleep(5 * time.Second)
			continue
		}

		// Process each change
		columnNames := rows.Columns()
		for rows.Next() {
			// Create a slice to hold the values
			values := make([]interface{}, len(columnNames))
			for i := range values {
				values[i] = new(interface{})
			}

			if err := rows.Scan(values...); err != nil {
				log.Printf("Error scanning row: %v", err)
				continue
			}

			// Extract operation type (first column)
			operation := ""
			if opVal, ok := values[0].(*interface{}); ok && *opVal != nil {
				operation = fmt.Sprintf("%v", *opVal)
			}

			// Build data map
			data := make(map[string]interface{})
			for i := 1; i < len(columnNames); i++ {


_type\":\"stdin\",\"status\":301,\"user-identifier\":\"-\"}"
                    },
                    {
                        "id": "35683658089659183914001456229543810359430816722590236673",
                        "timestamp": 1600110569041,
                        "message": "{\"bytes\":17707,\"datetime\":\"14/Sep/2020:11:45:41 -0400\",\"host\":\"192.168.127.12\",\"method\":\"GET\",\"protocol\":\"HTTP/2.0\",\"referer\":\"http://www.investormission-critical.io/24/7/vortals\",\"request\":\"/scale/functionalities/optimize\",\"source_type\":\"stdin\",\"status\":502,\"user-identifier\":\"feeney1708\"}"
                    }
                ]
            }
        "#;

    #[test]
    fn generate_config() {
        crate::test_util::test_generate_config::<AwsKinesisFirehoseConfig>();
    }

    async fn source(
        access_key: Option<String>,
        record_compression: Option<Compression>,
        delivered: bool,
    ) -> (impl Stream<Item = Event>, SocketAddr) {
        use EventStatus::*;
        let status = if delivered { Delivered } else { Rejected };
        let (sender, recv) = SourceSender::new_test_finalize(status);
        let address = next_addr();
        let cx = SourceContext::new_test(sender, None);
        tokio::spawn(async move {
            AwsKinesisFirehoseConfig {
                address,
                tls: None,
                access_key,
                record_compression,
                framing: default_framing_message_based(),
                decoding: default_decoding(),
                acknowledgements: true.into(),
            }
            .build(cx)
            .await
            .unwrap()
            .await
            .unwrap()
        });
        wait_for_tcp(address).await;
        (recv, address)
    }

    /// Sends the body to the address with the appropriate Firehose headers
    ///
    /// https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html
    async fn send(
        address: SocketAddr,
        timestamp: DateTime<Utc>,
        records: Vec<&[u8]>,
        key: Option<&str>,
        gzip: bool,
        record_compression: Compression,
    ) -> reqwest::Result<reqwest::Response> {
        let request = models::FirehoseRequest {
            request_id: REQUEST_ID.to_string(),
            timestamp,
            records: records
                .into_iter()
                .map(|record| models::EncodedFirehoseRecord {
                    data: encode_record(record, record_compression).unwrap(),
                })
                .collect(),
        };

        let mut builder = reqwest::Client::new()
            .post(&format!("http://{}", address))
            .header("host", address.to_string())
            .header(
                "x-amzn-trace-id",
                "Root=1-5f5fbf1c-877c68cace58bea222ddbeec",
            )
            .header("x-amz-firehose-protocol-version", "1.0")
            .header("x-amz-firehose-request-id", REQUEST_ID.to_string())
            .header("x-amz-firehose-source-arn", SOURCE_ARN.to_string())
            .header("user-agent", "Amazon Kinesis Data Firehose Agent/1.0")
            .header("content-type", "application/json");

        if let Some(key) = key {
            builder = builder.header("x-amz-firehose-access-key", key);
        }

        if gzip {
            let mut gz = GzEncoder::new(
                Cursor::new(serde_json::to_vec(&request).unwrap()),
                flate2::Compression::fast(),
            );
            let mut buffer = Vec::new();
            gz.read_to_end(&mut buffer).unwrap();
            builder = builder.header("content-encoding", "gzip").body(buffer);


#!/usr/bin/env python

"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""

from lib.core.enums import PRIORITY

__priority__ = PRIORITY.LOW

def dependencies():
    pass

def tamper(payload, **kwargs):
    """
    Replaces space character (' ') with comments '/**/'

    Tested against:
        * Microsoft SQL Server 2005
        * MySQL 4, 5.0 and 5.5
        * Oracle 10g
        * PostgreSQL 8.3, 8.4, 9.0

    Notes:
        * Useful to bypass weak and bespoke web application firewalls

    >>> tamper('SELECT id FROM users')
    'SELECT/**/id/**/FROM/**/users'
    """

    retVal = payload

    if payload:
        retVal = ""
        quote, doublequote, firstspace = False, False, False

        for i in xrange(len(payload)):
            if not firstspace:
                if payload[i].isspace():
                    firstspace = True
                    retVal += "%23aa/*/*/*%0c%0a"
                    continue

            elif payload[i] == '\'':
                quote = not quote

            elif payload[i] == '"':
                doublequote = not doublequote

            elif payload[i] == " " and not doublequote and not quote:
                retVal += "%23aa/*/*/*%0c%0a"
                continue

            retVal += payload[i]

    return retVal