!$OMP PARALLEL DO   &
!$OMP PRIVATE ( ii,k,ic,ip,i,j,t_,q_,p_,delz_,qci_,qrs_,den_,rain_,rainncv_,sr_,snow_,snowncv_ ) &
!$OMP SCHEDULE(dynamic)
      DO ip = 1,((1+(ite-its+1)/CHUNK)*CHUNK)*(jte-jts+1),CHUNK
       ! tid = omp_get_thread_num() + 1   ! not currently used but available and useful for debugging
       j  = jts+(ip-1)/((1+(ite-its+1)/CHUNK)*CHUNK)
       IF ( j .ge. jts .and. j .le. jte ) THEN
        ii = its+mod((ip-1),((1+(ite-its+1)/CHUNK)*CHUNK))
         DO k=kts,kte
          DO ic=1,min(CHUNK,ite-ii+1)
            i = ii+ic -1
            t_(ic,k)=th(i,k,j)*pii(i,k,j)
            q_(ic,k)=q(i,k,j)
            p_(ic,k)=p(i,k,j)
            delz_(ic,k)=delz(i,k,j)
            qci_(ic,k,1) = qc(i,k,j)
            qci_(ic,k,2) = qi(i,k,j)
            qrs_(ic,k,1) = qr(i,k,j)
            qrs_(ic,k,2) = qs(i,k,j)
            den_(ic,k) = den(i,k,j)
          ENDDO
         ENDDO
         DO ic=1,min(CHUNK,ite-ii+1)
            i = ii+ic -1
            rain_(ic) = rain(i,j)
            rainncv_(ic) = rainncv(i,j)
            sr_(ic) = sr(i,j)
            snow_(ic) = snow(i,j)
            snowncv_(ic) = snowncv(i,j)
         ENDDO
         IF ( min(CHUNK,ite-ii+1) .gt. 0 ) THEN
           CALL wsm52D(T=t_, Q=q_, QCI=qci_, QRS=qrs_                &
                      ,DEN=den_                                      &
                      ,P=p_, DELZ=delz_                              &
                      ,DELT=delt,G=g, CPD=cpd, CPV=cpv, RD=rd        &
                      ,RV=rv, T0C=t0c                                &
                      ,EP1=ep1, EP2=ep2, QMIN=qmin                   &
                      ,XLS=XLS, XLV0=XLV0, XLF0=XLF0                 &
                      ,DEN0=den0, DENR=denr                          &
                      ,CLIQ=cliq,CICE=cice,PSAT=psat                 &
                      ,LON=ii,LAT=j                                  &
                      ,RAIN=rain_  ,RAINNCV=rainncv_                 &
                      ,SR=sr_                                        &
                      ,SNOW=snow_      ,SNOWNCV=snowncv_             &
                      ,NX0=CHUNK, NK0=kte-kts+1                      &
                      ,IRESTRICT=min(CHUNK,ite-ii+1)                 &
                      ,DOIT=.TRUE., KTS=kts,KTE=kte                  )
         ENDIF
         DO K=kts,kte
          DO ic=1,min(CHUNK,ite-ii+1)
            i = ii+ic -1
            th(i,k,j)=t_(ic,k)/pii(i,k,j)
            q(i,k,j) = q_(ic,k)
            qc(i,k,j) = qci_(ic,k,1)
            qi(i,k,j) = qci_(ic,k,2)
            qr(i,k,j) = qrs_(ic,k,1)
            qs(i,k,j) = qrs_(ic,k,2)
          ENDDO
         ENDDO
         DO ic=1,min(CHUNK,ite-ii+1)
            i = ii+ic -1
            rain(i,j) = rain_(ic)
            rainncv(i,j) = rainncv_(ic)
            sr(i,j) = sr_(ic)
            snow(i,j) = snow_(ic)
            snowncv(i,j) = snowncv_(ic)
         ENDDO
       ENDIF
      ENDDO
      !$OMP END PARALLEL DO


//  SW4 LICENSE
// # ----------------------------------------------------------------------
// # SW4 - Seismic Waves, 4th order
// # ----------------------------------------------------------------------
// # Copyright (c) 2013, Lawrence Livermore National Security, LLC.
// # Produced at the Lawrence Livermore National Laboratory.
// #
// # Written by:
// # N. Anders Petersson (petersson1@llnl.gov)
// # Bjorn Sjogreen      (sjogreen2@llnl.gov)
// #
// # LLNL-CODE-643337
// #
// # All rights reserved.
// #
// # This file is part of SW4, Version: 1.0
// #
// # Please also read LICENCE.txt, which contains "Our Notice and GNU General Public License"
// #
// # This program is free software; you can redistribute it and/or modify
// # it under the terms of the GNU General Public License (as published by
// # the Free Software Foundation) version 2, dated June 1991.
// #
// # This program is distributed in the hope that it will be useful, but
// # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
// # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
// # conditions of the GNU General Public License for more details.
// #
// # You should have received a copy of the GNU General Public License
// # along with this program; if not, write to the Free Software
// # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
#ifndef NEARLYEQUAL_H
#define NEARLYEQUAL_H
namespace dbc
{

// Lock for assertions
// bool assertionLock (void);
// void assertionUnLock(void);

// nearlyEqual returns true if x and y approximately equal
template<typename T, typename U>
inline bool nearlyEqual(const T& x,
                 const U& y,
                 double relativeTolerance = 1.0e-5,
                 double absoluteTolerance = 1.0e-12)
{
   return (std::fabs(x-y) <=
           (std::fabs(y) * relativeTolerance + absoluteTolerance)
          );
}
} // namespace dbc
#endif


ui um identificador único (PID) e pode ser criado por meio da chamada de sistema `fork()`, que gera um novo processo filho a partir do processo pai. A comunicação e sincronização entre processos podem ser feitas por meio de sinais (`kill`), pipes e outros mecanismos de IPC.

## Melhorias no Chaveamento de Contexto
Ao longo dos anos, os sistemas operacionais aprimoraram o chaveamento de contexto para torná-lo mais eficiente. Melhorias incluem a introdução de técnicas como salvamento parcial de estado, onde apenas as partes essenciais do contexto são armazenadas e restauradas, reduzindo o tempo de chaveamento.

Além disso, otimizações em hardware, como o uso de registradores dedicados para troca de contexto e mecanismos de preempção mais rápidos, tornaram o processo mais ágil. O suporte a **multithreading em nível de kernel** e estratégias de escalonamento aprimoradas também contribuíram para diminuir a latência e melhorar o desempenho dos sistemas modernos.
## `rust-miniscript` vulnerability disclosure (DoS/Stack Overflow) - CVE-2024-44073

On 2nd July, we (Kartik Agarwala ([hax0kartik](https://github.com/hax0kartik)) and I) reported a stack overflow issue on rust-miniscript to Andrew Poelstra. We discovered that rust-miniscript could stack overflow when parsing a miniscript from a string due to a recursion. From our conversations, the reason was that the constant `MAX_RECURSION_DEPTH` was not being applied to prefix combinators like `n:`. It means the parser would take these "large" miniscripts and (iteratively) construct a tree with a very high depth. Then, this will stack overflow when doing any recursive operation. All the miniscript websites that help visualize/parse miniscript using `rust-miniscript` could crash with this input.

Affects: `rust-miniscript` 9, 10, 11 and 12.

---

### How did we find it?

**TL;DR: Fuzzing**

[Bitcoinfuzz](https://github.com/brunoerg/bitcoinfuzz) is a project that applies differential fuzzing in Bitcoin implementations and libraries. One of the targets does differential fuzzing with `rust-miniscript` and `Bitcoin Core` for parsing a miniscript from a string. So far, it found some bugs and has been helpful.

However, `bitcoinfuzz` had only support for `libfuzzer` and, at some point, Kartik suggested using some structures from `Bitcoin Core` to add support for more fuzzers in `bitcoinfuzz`. So, we started using `bitcoinfuzz` with AFL and, even fuzzing for a long time with libfuzzer, this bug was found in a few minutes with AFL. Just luck? We don't know haha.

#### Why the issue was not discovered before?

Both `rust-bitcoin` and `rust-miniscript` support fuzzing. Also, `rust-miniscript` has two targets called `roundtrip_miniscript_str` and `roundtrip_miniscript_script` which should be able to find this. However, the effectiveness of fuzzing depends on large campaigns, that is why it is important that both projects are continually fuzzed.

### Timeline

**07/02/2024** - Reported the issue to Andrew Poelstra via e-mail. \
**07/02/2024** - Andrew confirmed the issue and cc'ed Sanket. \
**07/08/2024** - Sanket reproduced the issue and opened a PR addressing it. \
**07/08/2024** - I tested and confirmed the fix. \
**07/18/2024** - Andrew discovered that the issue could also affect parsing Miniscripts from Script. \
**07/18/2024** - Sanket started working on a fix for it. \
**07/20/2024** - Sanket opened a PR addressing it. \
**08/06/2024** - I verified that all fixes were backported. Andrew and Sanke


h-product .product-info h2 {
  margin-bottom: 16px;
  margin-top: 16px;
  font-size: 56px;
  line-height: 1.14;
  font-weight: normal;
  color: #111111;
}

.h-product .product-packaging {
  margin: 0 0 15px 0;
}

.h-product .product-packaging h3 {
  font-size: 20px;
}

.h-product .product-packaging span {
  display: inline-block;
  margin: 0 10px 0 0;
}

.h-product .input-group-text,
.h-product .btn.btn-info {
  font-size: 18px;
  line-height: 1.89;
  letter-spacing: 3.6px;
  text-align: center;
  color: #111111;
  border-radius: 0;
}

.product-quantity-dropdown {
  position: relative;
  width: 100px;
}

.product-quantity-dropdown select {
  width: 100%;
  height: 45px;
  border: 1px solid #acacac;
  padding: 10px 16px;
  border-radius: 8px;
}

.product-quantity-dropdown img {
  position: absolute;
  right: 25px;
  top: 20px;
  width: 10px;
  height: 5px;
}

.h-product .cymbal-button-primary {
  margin-top: 16px;
}

/* Platform Banner */

.local,
.aws-platform,
.onprem-platform,
.azure-platform,
.alibaba-platform,
.gcp-platform {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 100vh;
  color: white;
  font-size: 24px;
  z-index: 999;
}

.aws-platform,
.aws-platform .platform-flag {
  background-color: #ff9900;
}

.onprem-platform,
.onprem-platform .platform-flag {
  background-color: #34A853;
}

.gcp-platform,
.gcp-platform .platform-flag {
  background-color: #4285f4;
}

.azure-platform,
.azure-platform .platform-flag {
  background-color: #f35426;
}

.alibaba-platform,
.alibaba-platform .platform-flag {
  background-color: #ffC300;
}

.local,
.local .platform-flag {
  background-color: #2c0678;
}

.platform-flag {
  position: absolute;
  top: 98px;
  left: 0;
  width: 190px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Recommendation */

.recommendations {
  background: #F9F9F9;
  padding-bottom: 55px;
}

.recommendations .container {
  max-width: 1174px;
}

@media (max-width: 992px) {
  .recommendations .container {
    max-width: none;
  }
}

.recommendations h2 {
  border-top: solid 1px;
  padding: 40px 0;
  font-weight: normal;
  text-align: center;
}

.recommendations h5 {
  margin-top: 8px;
  font-weight: normal;
  font-size: 18px;
}

.recommendations img {
  height: 100%;
  width: 100%;
  border-radius: 20% 0 20% 20%;
}

select {
  -webkit-appearance: none;
  -webkit-border-radius: 0px;
}

/* Cymbal */

/*
If we ever decide to create a separate Cymbal CSS library for Cymbal components,
the rules below could be


are"
		]
	},
	"den":
	{
		"english": [
			"Slave (Athapascan)"
		],
		"native": [
			"Slave (Athapascan)"
		]
	},
	"dgr":
	{
		"english": [
			"Dogrib"
		],
		"native": [
			"Dogrib"
		]
	},
	"din":
	{
		"english": [
			"Dinka"
		],
		"native": [
			"Dinka"
		]
	},
	"div":
	{
		"english": [
			"Dhivehi",
			"Divehi",
			"Maldivian"
		],
		"native": [
			"Dhivehi",
			"Divehi",
			"Maldivian"
		]
	},
	"dv":
	{
		"english": [
			"Dhivehi",
			"Divehi",
			"Maldivian"
		],
		"native": [
			"Dhivehi",
			"Divehi",
			"Maldivian"
		]
	},
	"doi":
	{
		"english": [
			"Dogri"
		],
		"native": [
			"Dogri"
		]
	},
	"dra":
	{
		"english": [
			"Dravidian Languages"
		],
		"native": [
			"Dravidian Languages"
		]
	},
	"dsb":
	{
		"english": [
			"Lower Sorbian"
		],
		"native": [
			"Lower Sorbian"
		]
	},
	"dua":
	{
		"english": [
			"Duala"
		],
		"native": [
			"Duala"
		]
	},
	"dum":
	{
		"english": [
			"Dutch Middle (ca.1050-1350)"
		],
		"native": [
			"Dutch Middle (ca.1050-1350)"
		]
	},
	"dut":
	{
		"english": [
			"Dutch",
			"Flemish"
		],
		"native": [
			"Dutch",
			"Flemish"
		]
	},
	"nld":
	{
		"english": [
			"Dutch",
			"Flemish"
		],
		"native": [
			"Dutch",
			"Flemish"
		]
	},
	"nl":
	{
		"english": [
			"Dutch",
			"Flemish"
		],
		"native": [
			"Dutch",
			"Flemish"
		]
	},
	"dyu":
	{
		"english": [
			"Dyula"
		],
		"native": [
			"Dyula"
		]
	},
	"dzo":
	{
		"english": [
			"Dzongkha"
		],
		"native": [
			"Dzongkha"
		]
	},
	"dz":
	{
		"english": [
			"Dzongkha"
		],
		"native": [
			"Dzongkha"
		]
	},
	"efi":
	{
		"english": [
			"Efik"
		],
		"native": [
			"Efik"
		]
	},
	"egy":
	{
		"english": [
			"Egyptian (Ancient)"
		],
		"native": [
			"Egyptian (Ancient)"
		]
	},
	"eka":
	{
		"english": [
			"Ekajuk"
		],
		"native": [
			"Ekajuk"
		]
	},
	"elx":
	{
		"english": [
			"Elamite"
		],
		"native": [
			"Elamite"
		]


margin-right: $tile-link-margin-left-right;

                    &:last-child {
                        margin-right: $tile-last-margin-right;
                    }
                }
            }
        }

        &.textplacement__center .ms-content-block__details {
            text-align: center;

            .ms-content-block__cta {
                /* stylelint-disable-next-line no-descending-specificity -- Auto-suppressed. Please fix if possible. */
                a[class^="msc-cta__"] {
                    margin-left: $tile-link-margin-left-right / 2;
                    margin-right: $tile-link-margin-left-right / 2;

                    &:first-child {
                        margin-left: $tile-first-margin-left;
                    }

                    &:last-child {
                        margin-right: $tile-last-margin-right;
                    }
                }
            }
        }

        @media (max-width: $msv-breakpoint-m) {
            padding-bottom: $tile-padding-bottom-mobile;
            width: 100%;

            & .ms-content-block__image img {
                width: 100%;
            }

            & .ms-content-block__image .ms-editable-field {
                /* stylelint-disable-next-line declaration-no-important -- Used to override default image inline style for the placeholder in editorial mode. */
                width: 100% !important;
            }
        }
    }
}

.col-sm:first-child .ms-content-block[data-m-layout="tile"]:first-child,
.col-md:first-child .ms-content-block[data-m-layout="tile"]:first-child {
    margin-left: $tile-first-margin-left;
}

.col-sm:last-child .ms-content-block[data-m-layout="tile"]:last-child,
.col-md:last-child .ms-content-block[data-m-layout="tile"]:last-child {
    margin-right: $tile-last-margin-right;
}

@media (max-width: $msv-breakpoint-m) {
    &.col-sm:last-child .ms-content-block[data-m-layout="tile"]:last-child {
        padding-bottom: $tile-last-padding-bottom-mobile;
    }
}
$msv-store-selector-phone-section-padding-top: 5px;
$msv-store-selector-location-line-shop-address-padding-top: 2px;
$msv-store-selector-location-line-shop-address-padding-right: 15px;
$msv-store-selector-input-height: 48px;
$msv-store-selector-button-border-radius: 0;
$msv-store-selector-input-border-radius: 2px 0 0 2px;
$msv-store-selector-input-padding-left: 12px;
$msv-store-selector-button-height: 48px;
$msv-store-selector-button-width: 48px;
$msv-store-selector-search-form-padding: 0 0 30px 0;
$msv-store-selector-location-line-item-margin-top: 10px;
$msv-breakpoint-modal-m: 450px;
$msv-store-selector-msc-modal-content-padding: 40px;
$msv-store-selector-search-form-margin-bottom: 5px;
$msv-store-line-header:20px;
$msv-store-locations-max-height:400px;
$pickup-option-list-item-bg-color: #F8F7F6;


n error to attempt to unmount a volume from a volume mount point when there is no volume actually mounted at that volume mount point.</para>
      ///   <para>Deleting a mounted folder does not cause the underlying directory to be deleted.</para>
      /// </remarks>
      /// </summary>
      /// <exception cref="ArgumentException"/>
      /// <exception cref="ArgumentNullException"/>
      /// <exception cref="NotSupportedException"/>
      /// <param name="transaction">The transaction.</param>
      /// <param name="volumeMountPoint">The Drive letter or mounted folder to be deleted. For example, X:\ or Y:\MountX\.</param>
      /// <param name="continueOnException"><c>true</c> suppress any Exception that might be thrown as a result from a failure, such as unavailable resources.</param>
      /// <param name="continueIfJunction"><c>true</c> suppress an exception due to this mount point being a Junction.</param>
      /// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
      [SecurityCritical]
      internal static void DeleteVolumeMountPointCore(KernelTransaction transaction, string volumeMountPoint, bool continueOnException, bool continueIfJunction, PathFormat pathFormat)
      {
         if (pathFormat != PathFormat.LongFullPath)
            Path.CheckSupportedPathFormat(volumeMountPoint, true, true);

         volumeMountPoint = Path.GetExtendedLengthPathCore(transaction, volumeMountPoint, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator);

         using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
         {
            // DeleteVolumeMountPoint()
            // 2013-01-13: MSDN does not confirm LongPath usage but a Unicode version of this function exists.

            // A trailing backslash is required.
            var success = NativeMethods.DeleteVolumeMountPoint(Path.AddTrailingDirectorySeparator(volumeMountPoint, false));

            var lastError = Marshal.GetLastWin32Error();
            if (!success && !continueOnException)
            {
               if (lastError == Win32Errors.ERROR_INVALID_PARAMETER && continueIfJunction)
                  return;

               if (lastError == Win32Errors.ERROR_FILE_NOT_FOUND)
                  lastError = (int)Win32Errors.ERROR_PATH_NOT_FOUND;

               NativeError.ThrowException(lastError, volumeMountPoint);
            }
         }
      }
   }
}


8
	ldr r0, [r0, #0x0]
	mov r1, #0x1
	bl PaletteData_FreeBuffers
	add r0, r4, #0x0
	add r0, #0xe8
	ldr r0, [r0, #0x0]
	mov r1, #0x2
	bl PaletteData_FreeBuffers
	add r0, r4, #0x0
	add r0, #0xe8
	ldr r0, [r0, #0x0]
	mov r1, #0x3
	bl PaletteData_FreeBuffers
	add r0, r4, #0x0
	add r0, #0xe8
	ldr r0, [r0, #0x0]
	bl sub_02002FEC
	mov r1, #0xf1
	lsl r1, r1, #0x2
	ldr r1, [r4, r1]
	ldr r0, [r4, #0x0]
	lsl r1, r1, #0x18
	lsr r1, r1, #0x18
	bl sub_02085D8C
	ldr r0, _02085D64 ; =0x00000428
	ldr r0, [r4, r0]
	bl FreeToHeap
	add r0, r4, #0x0
	bl ov62_0222DAEC
	mov r0, #0x73
	lsl r0, r0, #0x2
	ldr r0, [r4, r0]
	bl sub_0202212C
	mov r0, #0x69
	lsl r0, r0, #0x2
	ldr r0, [r4, r0]
	bl sub_020072E8
	mov r0, #0x97
	lsl r0, r0, #0x2
	ldr r0, [r4, r0]
	bl sub_02014C28
	add r0, r4, #0x0
	bl ov62_0222DD38
	add r0, r4, #0x0
	add r0, #0xd4
	bl ov62_0222E874
	bl sub_0201C29C
	mov r0, #0x23
	lsl r0, r0, #0x4
	ldr r0, [r4, r0]
	bl sub_020223BC
	mov r0, #0x35
	bl ov62_02230F70
	add r0, r5, #0x0
	bl OverlayManager_FreeData
	bl sub_0201CD04
	mov r0, #0x35
	bl DestroyHeap
	ldr r0, _02085D68 ; =SDK_OVERLAY_OVERLAY_08_ID
	bl UnloadOverlayByID
	mov r0, #0x1
	pop {r3-r5, pc}
	nop
_02085D64: .word 0x00000428
_02085D68: .word SDK_OVERLAY_OVERLAY_08_ID

	thumb_func_start sub_02085D6C
sub_02085D6C: ; 0x02085D6C
	push {r4, lr}
	add r4, r0, #0x0
	ldr r0, [r4, #0x0]
	cmp r0, r1
	bge _02085D7C
	bl GF_AssertFail
	mov r1, #0x0
_02085D7C:
	lsl r0, r1, #0x2
	add r0, r4, r0
	ldr r0, [r0, #0x4]
	pop {r4, pc}

	thumb_func_start sub_02085D84
sub_02085D84: ; 0x02085D84
	add r0, #0x2c
	ldrb r0, [r0, #0x0]
	bx lr
	.balign 4

	thumb_func_start sub_02085D8C
sub_02085


; Generated with ikazuchi 1.0 by riidefi
; Object File: JASAudioThread
; Segments:
;     .text:       0x80496cf0 -> 0x80497034
;     .data:       0x805ecf64 -> 0x805eeea0 (805ecf74 -> 805eeea0 (size 7980/0x1f2c) is greedily claimed anonymous data)
;     .bss:        0x806627e0 -> 0x806627f0 (806627ec -> 806627f0 (size 0004/0x0004) is greedily claimed anonymous data)
;     .sbss:       0x806b7588 -> 0x806b7590 (806b758c -> 806b7590 (size 0004/0x0004) is greedily claimed anonymous data)

; Symbols Defined
; 80496cf0 -> 80496d60 create__14JASAudioThreadFl
; 80496d60 -> 80496d70 stop__14JASAudioThreadFv
; 80496d70 -> 80496eb4 run__14JASAudioThreadFv
; 80496eb4 -> 80496f04 DMACallback__14JASAudioThreadFv
; 80496f04 -> 80496f70 DSPCallback__14JASAudioThreadFPv
; 80496f70 -> 80496fd8 __dt__14JASAudioThreadFv
; 80496fd8 -> 80497034 __sinit_\JASAudioThread_cpp
; 805ecf64 -> 805ecf74 __vt__14JASAudioThread
; 806627e0 -> 806627ec @2627
; 806b7588 -> 806b758c snIntCount__14JASAudioThread

; Exports
.global create__14JASAudioThreadFl
.global stop__14JASAudioThreadFv
.global run__14JASAudioThreadFv
.global DMACallback__14JASAudioThreadFv
.global DSPCallback__14JASAudioThreadFPv
.global __dt__14JASAudioThreadFv
.global __sinit_?3JASAudioThread_cpp
.global __vt__14JASAudioThread
.global ?22627
.global snIntCount__14JASAudioThread

; Segments
.section .text
create__14JASAudioThreadFl:
.byte 0x94, 0x21, 0xFF, 0xF0 # 80496cf0
.byte 0x7C, 0x08, 0x02, 0xA6 # 80496cf4
.byte 0x38, 0xA0, 0x00, 0x00 # 80496cf8
.byte 0x90, 0x01, 0x00, 0x14 # 80496cfc
.byte 0x93, 0xE1, 0x00, 0x0C # 80496d00
.byte 0x7C, 0x7F, 0x1B, 0x78 # 80496d04
.byte 0x38, 0x60, 0x00, 0x88 # 80496d08
.byte 0x80, 0x8D, 0xDE, 0xB8 # 80496d0c
.byte 0x4B, 0xF7, 0x47, 0x5D # 80496d10
.byte 0x2C, 0x03, 0x00, 0x00 # 80496d14
.byte 0x41, 0x82, 0x00, 0x14 # 80496d18
.byte 0x7F, 0xE4, 0xFB, 0x78


OnIncrementalSync(t *testing.T) {
	pqString := testutils.PrepareDBConnectionString()
	v2 := runTestV2Server(t)
	v3 := runTestServer(t, v2, pqString)
	defer v2.close()
	defer v3.close()

	t.Log("Alice creates a room.")
	v2.addAccount(t, alice, aliceToken)
	const roomID = "!unimportant"
	v2.queueResponse(aliceToken, sync2.SyncResponse{
		Rooms: sync2.SyncRoomsResponse{
			Join: v2JoinTimeline(roomEvents{
				roomID: roomID,
				events: createRoomState(t, alice, time.Now()),
			}),
		},
	})
	t.Log("Alice sliding syncs, explicitly requesting power levels.")
	aliceReq := sync3.Request{
		Lists: map[string]sync3.RequestList{
			"a": {
				Ranges: [][2]int64{{0, 20}},
				RoomSubscription: sync3.RoomSubscription{
					TimelineLimit: 10,
					RequiredState: [][2]string{{"m.room.power_levels", ""}},
				},
			},
		},
	}
	res := v3.mustDoV3Request(t, aliceToken, aliceReq)

	t.Log("Alice's poller receives a gappy poll with a state block. The power levels and room name have changed.")
	nameEvent := testutils.NewStateEvent(
		t,
		"m.room.name",
		"",
		alice,
		map[string]interface{}{"name": "banana"},
	)
	powerLevelsEvent := testutils.NewStateEvent(
		t,
		"m.room.power_levels",
		"",
		alice,
		map[string]interface{}{
			"users":          map[string]int{alice: 100},
			"events_default": 10,
		},
	)
	messageEvent := testutils.NewMessageEvent(t, alice, "hello")
	v2.queueResponse(aliceToken, sync2.SyncResponse{
		Rooms: sync2.SyncRoomsResponse{
			Join: map[string]sync2.SyncV2JoinResponse{
				roomID: {
					State: sync2.EventsResponse{
						Events: []json.RawMessage{nameEvent, powerLevelsEvent},
					},
					Timeline: sync2.TimelineResponse{
						Events:    []json.RawMessage{messageEvent},
						Limited:   true,
						PrevBatch: "batchymcbatchface",
					},
				},
			},
		},
	})
	v2.waitUntilEmpty(t, aliceToken)

	t.Log("Alice incremental sliding syncs.")
	_, respBytes, statusCode := v3.doV3Request(t, context.Background(), aliceToken, res.Pos, sync3.Request{})
	t.Log("The server should have closed the long-polling session.")
	assertUnknownPos(t, respBytes, statusCode)

	t.Log("Alice sliding syncs from scratch.")
	res = v3.mustDoV3Request(t, aliceToken, aliceReq)
	t.Log("Alice sees the new room name and power levels.")
	m.MatchResponse(t, res, m.MatchRoomSubscription(roomID,
		m.MatchRoomRequiredState([]json.RawMessage{powerLevelsEvent}),
		m.MatchRoomName("banana"),
	))
}

// Similar to TestPollerHandlesUnknownStateEventsOnIncrementalSync. Here we are testing
// that if Alice's poller sees Bob leave in a state block, the events seen in that
// timeline are not visible to Bob.
func TestPollerUpdatesRoomMemberTrackerOnGappySyncStateBlock(t *testing.T) {
	pqString := testutils.PrepareDBConnectionString()
	v2 := runTestV2Server(t)
	v3 := runTestServer(t, v2, pqString)
	defer v2.close()
	defer v3.close()
	v2.addAccount(t, alice, aliceToken)
	v2.addAccount(t, bob, bobToken)
	const roomID = "!unimportant"

	t.Log("Alice


-1) | 3*(6-0) ]
        VMUL    dVerPred,dDiffLeftS16,dMultiplier
        VPADD   dHVValS16,dHorPred,dVerPred

        VPADDL  dHVValS32,dHVValS16                                     ;// [V|H] in 32 bits each
        VSHL    dHVTempS32,dHVValS32,#4                                 ;// 17*H = 16*H + H = (H<<4)+H
        VADD    dHVValS32,dHVValS32,dHVTempS32                          ;// [ 17*V  | 17*H ]in 32 bits each
        VLD1    {dMultiplier0,dMultiplier1},[pMultiplierTable]          ;// qMultiplier = [ 4|3|2|1|0|-1|-2|-3 ]
        VRSHR   dHVValS32,dHVValS32,#5                                  ;// [c|b] in 16bits each
        VADDL   qA,dAboveVal,dLeftVal
        VDUP    qA,qA[7]
        VSHL    qA,qA,#4                                                ;// [a|a|a|a|a|a|a|a]
        VDUP    qB,dHVValS16[0]                                         ;// [b|b|b|b|b|b|b|b]
        VDUP    qC,dHVValS16[2]                                         ;// [c|c|c|c|c|c|c|c]

        VMUL    qB,qB,qMultiplier
        VMUL    qC,qC,qMultiplier
        VADD    qB,qB,qA

        VDUP    qC0,qC[0]
        VDUP    qC1,qC[1]
        VDUP    qC2,qC[2]
        VDUP    qC3,qC[3]
        VDUP    qC4,qC[4]
        VDUP    qC5,qC[5]
        VDUP    qC6,qC[6]
        VDUP    qC7,qC[7]

        VADD    qSum0,qB,qC0
        VADD    qSum1,qB,qC1
        VADD    qSum2,qB,qC2
        VADD    qSum3,qB,qC3
        VADD    qSum4,qB,qC4
        VADD    qSum5,qB,qC5
        VADD    qSum6,qB,qC6


`composer require revolt/event-loop` (Fiber)
- 协程默认是关闭的，需要单独设置eventLoop开启

## 开启方法
webman支持为不同的进程开启不同的驱动，所以你可以在`config/process.php`中通过`eventLoop`配置协程驱动：

```php
return [
    'webman' => [
        'handler' => Http::class,
        'listen' => 'http://0.0.0.0:8787',
        'count' => 1,
        'user' => '',
        'group' => '',
        'reusePort' => false,
        'eventLoop' => '', // 默认为空自动选择Select或者Event，不开启协程
        'context' => [],
        'constructor' => [
            'requestClass' => Request::class,
            'logger' => Log::channel('default'),
            'appPath' => app_path(),
            'publicPath' => public_path()
        ]
    ],
    'my-coroutine' => [
        'handler' => Http::class,
        'listen' => 'http://0.0.0.0:8686',
        'count' => 1,
        'user' => '',
        'group' => '',
        'reusePort' => false,
        // 开启协程需要设置为 Workerman\Events\Swoole::class 或者 Workerman\Events\Swow::class 或者 Workerman\Events\Fiber::class
        'eventLoop' => Workerman\Events\Swoole::class,
        'context' => [],
        'constructor' => [
            'requestClass' => Request::class,
            'logger' => Log::channel('default'),
            'appPath' => app_path(),
            'publicPath' => public_path()
        ]
    ]

    // ... 其它配置省略 ...
];
```

> **提示**
> webman可以为不同的进程设置不同的eventLoop，这意味着你可以选择性的为特定进程开启协程。
> 例如上面配置中8787端口的服务没有开启协程，8686端口的服务开启了协程，配合nginx转发可以实现协程和非协程混合部署。

## 协程示例
```php
<?php
namespace app\controller;

use support\Response;
use Workerman\Coroutine;
use Workerman\Timer;

class IndexController
{
    public function index(): Response
    {
        Coroutine::create(function(){
            Timer::sleep(1.5);
            echo "hello coroutine\n";
        });
        return response('hello webman');
    }

}
```

当`event


nys|d'aqui a \d+[.,]?\d* dies|d'aqui a \d+[.,]?\d* hora|d'aqui a \d+[.,]?\d* setm|d'aqui a \d+[.,]?\d* any|d'aqui a \d+[.,]?\d* dia|d'aqui a \d+[.,]?\d* mes|d'aqui a \d+[.,]?\d* min|fa \d+[.,]?\d* setmanes|d'aqui a \d+[.,]?\d* h|d'aqui a \d+[.,]?\d* s|d‘aqui a \d+[.,]?\d* h|fa \d+[.,]?\d* setmana|fa \d+[.,]?\d* minuts|fa \d+[.,]?\d* segons|fa \d+[.,]?\d* hores|fa \d+[.,]?\d* mesos|fa \d+[.,]?\d* minut|fa \d+[.,]?\d* segon|fa \d+[.,]?\d* anys|fa \d+[.,]?\d* dies|fa \d+[.,]?\d* hora|fa \d+[.,]?\d* setm|fa \d+[.,]?\d* any|fa \d+[.,]?\d* dia|fa \d+[.,]?\d* mes|fa \d+[.,]?\d* min|fa \d+[.,]?\d* h|fa \d+[.,]?\d* s)(\z|[^\pL\pM\d]|_)`),
		RxExactCombined: regexp.MustCompile(`(?i)^(d'aqui a \d+[.,]?\d* setmanes|d'aqui a \d+[.,]?\d* setmana|d'aqui a \d+[.,]?\d* minuts|d'aqui a \d+[.,]?\d* segons|d'aqui a \d+[.,]?\d* hores|d'aqui a \d+[.,]?\d* mesos|d'aqui a \d+[.,]?\d* minut|d'aqui a \d+[.,]?\d* segon|d'aqui a \d+[.,]?\d* anys|d'aqui a \d+[.,]?\d* dies|d'aqui a \d+[.,]?\d* hora|d'aqui a \d+[.,]?\d* setm|d'aqui a \d+[.,]?\d* any|d'aqui a \d+[.,]?\d* dia|d'aqui a \d+[.,]?\d* mes|d'aqui a \d+[.,]?\d* min|fa \d+[.,]?\d* setmanes|d'aqui a \d+[.,]?\d* h|d'aqui a \d+[.,]?\d* s|d‘aqui a \d+[.,]?\d* h|fa \d+[.,]?\d* setmana|fa \d+[.,]?\d* minuts|fa \d+[.,]?\d* segons|fa \d+[.,]?\d* hores|fa \d+[.,]?\d* mesos|fa \d+[.,]?\d* minut|fa \d+[.,]?\d* segon|fa \d+[.,]?\d* anys|fa \d+[.,]?\d* dies|fa \d+[.,]?\d* hora|fa \d+[.,]?\d* setm|fa \d+[.,]?\d* any|fa \d+[.,]?\d* dia|fa \d+[.,]?\d* mes|fa \d+[.,]?\d* min|fa \d+[.,]?\d* h|fa \d+[.,]?\d* s)$`),
		KnownWords:      []string{"la propera setmana", "la proxima setmana", "la setmana passada", "la setmana que ve", "la setmana vinent", "aquesta setmana", "la setm passada", "la setm que ve", "el mes passat", "el mes que ve", "endema pass


/* Generated by RuntimeBrowser
   Image: /System/Library/PrivateFrameworks/CameraUI.framework/CameraUI
 */

@interface CAMIdleController : NSObject <CAMPanoramaCaptureRequestDelegate, CAMStillImageCaptureRequestDelegate, CAMVideoCaptureRequestDelegate> {
    NSTimer * _enableIdleTimer;
    bool  _updatingIdleTimer;
}

@property (readonly, copy) NSString *debugDescription;
@property (readonly, copy) NSString *description;
@property (getter=_enableIdleTimer, setter=_setEnableIdleTimer:, nonatomic, retain) NSTimer *enableIdleTimer;
@property (readonly) unsigned long long hash;
@property (getter=_isIdleTimerIndefinitelyDisabled, nonatomic, readonly) bool idleTimerIndefinitelyDisabled;
@property (readonly) Class superclass;
@property (getter=isUpdatingIdleTimer, setter=_setUpdatingIdleTimer:, nonatomic) bool updatingIdleTimer;

- (void).cxx_destruct;
- (void)_delayIdleTimerByTimeInterval:(double)arg1;
- (void)_delayIdleTimerByTimeIntervalUnlessIndefinitelyDisabled:(double)arg1;
- (id)_enableIdleTimer;
- (void)_immediatelyEnableApplicationIdleTimer;
- (void)_indefinitelyDisableApplicationIdleTimer;
- (bool)_isIdleTimerIndefinitelyDisabled;
- (void)_setEnableIdleTimer:(id)arg1;
- (void)_setUpdatingIdleTimer:(bool)arg1;
- (void)_teardownEnableIdleTimer;
- (void)dealloc;
- (id)init;
- (bool)isUpdatingIdleTimer;
- (void)panoramaRequestDidStartCapturing:(id)arg1;
- (void)panoramaRequestDidStopCapturing:(id)arg1;
- (void)startUpdatingIdleTimer;
- (void)stillImageRequestDidStopCapturing:(id)arg1;
- (void)stopUpdatingIdleTimer;
- (void)timelapseRequestDidResumeCapturing;
- (void)timelapseRequestDidStartCapturing;
- (void)timelapseRequestDidStopCapturing;
- (void)videoRequestDidStartCapturing:(id)arg1;
- (void)videoRequestDidStopCapturing:(id)arg1;

@end


def book_seat(total_seats, booked_seats, seat_to_book):
    if seat_to_book in booked_seats:
        print(f"Seat {seat_to_book} is already booked!")
    elif seat_to_book > total_seats or seat_to_book < 1:
        print(f"Invalid seat number {seat_to_book}. Please choose a seat between 1 and {total_seats}.")
    else:
        booked_seats.append(seat_to_book)

def cancel_seat(booked_seats, seat_to_cancel):
    if seat_to_cancel in booked_seats:
        booked_seats.remove(seat_to_cancel)
    else:
        print(f"Seat {seat_to_cancel} was not booked!")

def get_available_seats(total_seats, booked_seats):
    available_seats = [seat for seat in range(1, total_seats + 1) if seat not in booked_seats]
    return available_seats

total_seats = 10
booked_seats = [2, 5, 7]
book_seat_number = 3
cancel_seat_number = 5

book_seat(total_seats, booked_seats, book_seat_number)

cancel_seat(booked_seats, cancel_seat_number)

available_seats = get_available_seats(total_seats, booked_seats)
print(f"Available seats: {available_seats}")


# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s

## AddRegFrm

# CHECK: movl	$1, %r16d
# CHECK: encoding: [0xd5,0x10,0xb8,0x01,0x00,0x00,0x00]
         movl	$1, %r16d

## MRMSrcReg

# CHECK: movslq	%r16d, %rax
# CHECK: encoding: [0xd5,0x18,0x63,0xc0]
         movslq	%r16d, %rax

# CHECK: movslq	%eax, %r16
# CHECK: encoding: [0xd5,0x48,0x63,0xc0]
         movslq	%eax, %r16

# CHECK: movslq	%r16d, %r17
# CHECK: encoding: [0xd5,0x58,0x63,0xc8]
         movslq	%r16d, %r17

# CHECK: popcntl %r16d, %r17d
# CHECK: encoding: [0xf3,0xd5,0xd0,0xb8,0xc8]
         popcntl %r16d, %r17d

## MRMSrcRegCC

# CHECK: cmovll	%r16d, %eax
# CHECK: encoding: [0xd5,0x90,0x4c,0xc0]
         cmovll	%r16d, %eax

# CHECK: cmovll	%eax, %r16d
# CHECK: encoding: [0xd5,0xc0,0x4c,0xc0]
         cmovll	%eax, %r16d

# CHECK: cmovll	%r16d, %r17d
# CHECK: encoding: [0xd5,0xd0,0x4c,0xc8]
         cmovll	%r16d, %r17d

## MRMSrcMem

# CHECK: imull	(%r16,%rax), %ebx
# CHECK: encoding: [0xd5,0x90,0xaf,0x1c,0x00]
         imull	(%r16,%rax), %ebx

# CHECK: imull	(%rax,%r16), %ebx
# CHECK: encoding: [0xd5,0xa0,0xaf,0x1c,0x00]
         imull	(%rax,%r16), %ebx

# CHECK: imull	(%rax,%rbx), %r16d
# CHECK: encoding: [0xd5,0xc0,0xaf,0x04,0x18]
         imull	(%rax,%rbx), %r16d

# CHECK: imull	(%r16,%r17), %eax
# CHECK: encoding: [0xd5,0xb0,0xaf,0x04,0x08]
         imull	(%r16,%r17), %eax

# CHECK: imull	(%rax,%r16), %r17d
# CHECK: encoding: [0xd5,0xe0,0xaf,0x0c,0x00]
         imull	(%rax,%r16), %r17d

# CHECK: imull	(%r16,%rax), %r17d
# CHECK: encoding: [0xd5,0xd0,0xaf,0x0c,0x00]
         imull	(%r16,%rax), %r17d

# CHECK: imull	(%r16,%r17), %r18d
# CHECK: encoding: [0xd5,0xf0,0xaf,0x14,0x08]
         imull	(%r16,%r17), %r18d

## MRMSrcMemCC

# CHECK: cmovll	(%r16,%rax), %ebx
# CHECK: encoding: [0xd5,0x90,0x4c,0x1c,0x00]
         cmovll	(%r16,%rax), %ebx

# CHEC


�树
		if len(dept.Children) > 0 {
			html += cli.generateDepartmentTreeWithUsersHTML(dept.Children, level+1)
		}

		html += "

"
	}
	return html
}

// saveDepartmentTreeWithUsersToHTML 生成包含部门信息和用户信息的部门树并将其输出为HTML文档
func (cli *wechatCli) saveDepartmentTreeWithUsersToHTML(nodes []*WxDepartmentNode, filename string) (string, error) {
	index := strings.LastIndex(filename, ".html")
	if index == -1 {
		filename = filename + ".html"
	}
	tmp := filename
	// 判断文件是否存在
	if utils.IsFileExists(filename) {
		newFilename := generateNewFilename(filename)
		filename = newFilename
	}
	file, err := os.Create(filename)
	if err != nil {
		return "", errors.New("创建HTML文件失败: " + err.Error())
	}
	defer file.Close()
	departmentTreeHTML := cli.generateDepartmentTreeWithUsersHTML(nodes, 0)
	htmlDocument := cli.generateTreeHTMLDocument(departmentTreeHTML)
	_, err = file.WriteString(htmlDocument)
	if err != nil {
		return "", errors.New("无法写入HTML内容到文件: " + err.Error())
	}
	if filename == tmp {
		return fmt.Sprintf("文件已保存至 %s", filename), nil
	}
	return fmt.Sprintf("%s 已存在,已另存为 %s", tmp, filename), nil
}

// generateTreeHTMLDocument 生成添加折叠功能的完整的HTML文档
func (cli *wechatCli) generateTreeHTMLDocument(content string) string {
	html := `
		<!DOCTYPE html>


ontrolImportAPI().SysCallN(22, m.Instance(), m.dragOverPtr)
}

func (m *TPageControl) SetOnEndDock(fn TEndDragEvent) {
	if m.endDockPtr != 0 {
		RemoveEventElement(m.endDockPtr)
	}
	m.endDockPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(23, m.Instance(), m.endDockPtr)
}

func (m *TPageControl) SetOnEndDrag(fn TEndDragEvent) {
	if m.endDragPtr != 0 {
		RemoveEventElement(m.endDragPtr)
	}
	m.endDragPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(24, m.Instance(), m.endDragPtr)
}

func (m *TPageControl) SetOnGetSiteInfo(fn TGetSiteInfoEvent) {
	if m.getSiteInfoPtr != 0 {
		RemoveEventElement(m.getSiteInfoPtr)
	}
	m.getSiteInfoPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(26, m.Instance(), m.getSiteInfoPtr)
}

func (m *TPageControl) SetOnMouseDown(fn TMouseEvent) {
	if m.mouseDownPtr != 0 {
		RemoveEventElement(m.mouseDownPtr)
	}
	m.mouseDownPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(27, m.Instance(), m.mouseDownPtr)
}

func (m *TPageControl) SetOnMouseEnter(fn TNotifyEvent) {
	if m.mouseEnterPtr != 0 {
		RemoveEventElement(m.mouseEnterPtr)
	}
	m.mouseEnterPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(28, m.Instance(), m.mouseEnterPtr)
}

func (m *TPageControl) SetOnMouseLeave(fn TNotifyEvent) {
	if m.mouseLeavePtr != 0 {
		RemoveEventElement(m.mouseLeavePtr)
	}
	m.mouseLeavePtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(29, m.Instance(), m.mouseLeavePtr)
}

func (m *TPageControl) SetOnMouseMove(fn TMouseMoveEvent) {
	if m.mouseMovePtr != 0 {
		RemoveEventElement(m.mouseMovePtr)
	}
	m.mouseMovePtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(30, m.Instance(), m.mouseMovePtr)
}

func (m *TPageControl) SetOnMouseUp(fn TMouseEvent) {
	if m.mouseUpPtr != 0 {
		RemoveEventElement(m.mouseUpPtr)
	}
	m.mouseUpPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(31, m.Instance(), m.mouseUpPtr)
}

func (m *TPageControl) SetOnMouseWheel(fn TMouseWheelEvent) {
	if m.mouseWheelPtr != 0 {
		RemoveEventElement(m.mouseWheelPtr)
	}
	m.mouseWheelPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(32, m.Instance(), m.mouseWheelPtr)
}

func (m *TPageControl) SetOnMouseWheelDown(fn TMouseWheelUpDownEvent) {
	if m.mouseWheelDownPtr != 0 {
		RemoveEventElement(m.mouseWheelDownPtr)
	}
	m.mouseWheelDownPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(33, m.Instance(), m.mouseWheelDownPtr)
}

func (m *TPageControl) SetOnMouseWheelUp(fn TMouseWheelUpDownEvent) {
	if m.mouseWheelUpPtr != 0 {
		RemoveEventElement(m.mouseWheelUpPtr)
	}
	m.mouseWheelUpPtr = MakeEventDataPtr(fn)
	pageControlImportAPI().SysCallN(34,


ASK_CONFIG.TASK.INSTRUCTION_SENSOR_UUID)
            batch = batch_obs(observations, self.device)
            batch = apply_obs_transforms_batch(batch, self.obs_transforms)

        #for b in range(self.batch_size):
         #       sim = sims[b]
          #      sim.close()

        if mode == 'train':
            loss = ml_weight * loss / total_actions
            self.loss += loss
            try:
                self.logs['IL_loss'].append(loss.item())
            except:
                self.logs['IL_loss'].append(loss)


estor views. */
    private fun getVisibleHierarchy(view: View): List<String> {
      val hierarchy: MutableList<String> = ArrayList()
      var current: Any? = view
      while (current is View) {
        hierarchy.add(
            ("view=${current.javaClass.simpleName}, alpha=${current.alpha}, visibility=${current.visibility}"))
        if (current.alpha <= 0 || current.visibility != View.VISIBLE) {
          break
        }
        current = current.parent
      }
      return hierarchy
    }
  }
}
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho

import com.facebook.litho.annotations.Comparable
import com.facebook.litho.annotations.EventHandlerRebindMode
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner

@RunWith(RobolectricTestRunner::class)
class ComponentUtilsTest {

  private lateinit var c1: ComponentTest
  private lateinit var c2: ComponentTest

  @Before
  fun setUp() {
    c1 = ComponentTest()
    c2 = ComponentTest()
  }

  @Test
  fun hasEquivalentFieldsArrayIntPropTest() {
    c1.propArrayInt = intArrayOf(2, 5, 6)
    c2.propArrayInt = intArrayOf(2, 5, 6)
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isTrue
    c2.propArrayInt = intArrayOf(2, 3)
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsArrayCharPropTest() {
    c1.propArrayChar = charArrayOf('a', 'c', '5')
    c2.propArrayChar = charArrayOf('a', 'c', '5')
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isTrue
    c2.propArrayChar = charArrayOf('a', 'c')
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsStateContainersTest() {
    val sc1 = StateTest(true, 3f)
    var sc2: StateContainer = StateTest(true, 3f)
    assertThat(ComponentUtils.hasEquivalentState(sc1, sc2)).isTrue
    sc2 = StateTest(true, 2f)
    assertThat(ComponentUtils.hasEquivalentState(sc1, sc2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsDoublePropTest() {
    c1.propDouble = 2.0
    c2.propDouble = 2.0
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isTrue
    c2.propDouble = 3.0
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsFloatPropTest() {
    c1.propFloat = 2f
    c2.propFloat = 2f
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isTrue
    c2.propFloat = 3f
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsCharPropTest() {
    c1.propChar = 'c'
    c2.propChar = 'c'
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isTrue
    c2.propChar = 'z'
    assertThat(ComponentUtils.hasEquivalentFields(c1, c2)).isFalse
  }

  @Test
  fun hasEquivalentFieldsBytePropTest() {
    c1.prop


候给咨询界同仁下了一条死原则，那就是：咨询顾问不要太深介入咨询方案实施操作落地，因为企业内部斗争水太深了。 —— via [**《战略小传》**][19]
* 在沿海一线城市的普通咨询师市场定价在300-1000，中位数可能在600-700，而其他地区可能会低20%左右。 —— via [**《正经心理服务到底能干啥？》**][20]
* [**卖房这门生意**][21]
* [**补习班，养起一批超级富豪**][22]
* [**你的第一桶金是如何赚到的？ - 知乎**][23] // 养羊驼的创业故事

【效率/思维】
* [**我为什么写博客 | Peng Zhao**][24]
* [**听完吴声的演讲，我感觉智商梗阻了**][25]
* [**研究发现“咖啡+小睡”可以帮助夜班人员保持清醒**][26]
* 所认识的几个高手老师，他们的脑力工作都是非常有规律性的。 华老师是凌晨五点到七点读书写作，李老师是零晨四点到七点读书写作，花老师是晚上九点到12点读书写作。 —— via [**《轻度抑郁青年的月度自律盘点。2019/3/29》**][27]
* Google Alerts: 用于采集社交舆情，并产生 RSS 订阅源； —— via [**《GoogleAlert+IFTTT+企业微信：收集整合资讯舆情，快人一步 - 少数派》**][28]
* 你财富自由之后想做什么工作，现在就该做什么工作，这样的工作才是理想的工作。做这样的工作，你会很开心，能学到东西，能充满激情。每天会从床上跳起来，一天不工作都不行。 —— via [**《巴菲特90岁生日，90个投资智慧精选》**][29]

【兴趣/极简/其它】
* Netflix 自制新纪录片《High Score》居然在我上周推荐的「低端影视」上有在线观看资源：[**《剑指高分》**][30]
* 李楠的Angry Miao发布会上发布的「潮牌」T恤，大哥你这引号看起来就是编译不过的样子啊…… https://t.co/g8gk6cWLol https://t.co/9QrfxZIaXb —— via [@**luosheng**][31]
* 那么，在投资资产配置方面，中国的家族办公室有何特点？根据瑞银集团（UBS）和中航信托（Avic Trust）、惠裕全球家族智库（FOTT）合作发布的《2020中国家族财富与家族办公室研究报告》，平均而言，家族办公室将其投资组合的一半以上配置给固定收益（22％）、股票（17％）和


using UnityEngine;

namespace RenderHeads.Media.AVProVideo
{
    public class MediaPlayer : MonoBehaviour
    {
        [SerializeField] float _playbackRate = 1.0f;

        public virtual ITextureProducer TextureProducer => null;
        public virtual IMediaControl Control => null;
        public virtual IMediaInfo Info => null;
        public bool Loop { get => false; set { } }
        public void Play() { }
        public void Pause() { }
        public bool OpenMedia(MediaPath path, bool autoPlay = true) => false;
        public bool OpenMedia(MediaPathType pathType, string path, bool autoPlay = true) => false;
        public bool OpenMedia(MediaReference mediaReference, bool autoPlay = true) => false;
        public void CloseMedia() { }
        public PlatformOptions GetCurrentPlatformOptions() => null;

    }

    public class MediaPath { }
    public class MediaReference { }
    public class PlatformOptions { }
    public class Windows
    {
        public enum A


);
        }
    }

    public virtual void VisitImplementation(in MdImplementation implementation)
    {
    }

    public virtual void VisitFactory(in MdFactory factory)
    {
        foreach (var md in factory.Resolvers)
        {
            VisitResolver(md);
        }

        foreach (var md in factory.Initializers)
        {
            VisitInitializer(md);
        }
    }

    public virtual void VisitInitializer(MdInitializer md)
    {
    }

    public virtual void VisitRoot(in MdRoot root)
    {
        if (root.Tag is {} tag)
        {
            VisitTag(tag);
        }
    }

    public virtual void VisitGenericTypeArgument(in MdGenericTypeArgument genericTypeArgument)
    {
    }

    public virtual void VisitGenericTypeArgumentAttribute(in MdGenericTypeArgumentAttribute genericTypeArgumentAttribute)
    {
    }

    public virtual void VisitResolver(in MdResolver resolver)
    {
        if (resolver.Tag is {} tag)
        {
            VisitTag(tag);
        }
    }

    public virtual void VisitArg(in MdArg arg)
    {
    }

    public virtual void VisitDefaultLifetime(in MdDefaultLifetime defaultLifetime)
    {
    }

    public virtual void VisitDependsOn(in MdDependsOn dependsOn)
    {
    }

    public virtual void VisitTypeAttribute(in MdTypeAttribute typeAttribute)
    {
    }

    public virtual void VisitTagAttribute(in MdTagAttribute tagAttribute)
    {
    }

    public virtual void VisitOrdinalAttribute(in MdOrdinalAttribute ordinalAttribute)
    {
    }

    public virtual void VisitLifetime(in MdLifetime lifetime)
    {
    }

    public virtual void VisitTag(in MdTag tag)
    {
    }

    public virtual void VisitAccumulator(in MdAccumulator accumulator)
    {
    }

    public virtual void VisitHint(in MdHint hint)
    {
    }

    public virtual void VisitFinish()
    {
    }

    public virtual void VisitConstruction(in MdConstruct construct)
    {
    }
}


on onEffectTick(target, effect)
   local power = effect:getPower()
   local decayby = 0
   -- Double attack rate decays until 20% then stays there
   if (power > 20) then
        decayby = 3
        effect:setPower(power-decayby)
        target:delMod(tpz.mod.DOUBLE_ATTACK, decayby)
    end
end

function onEffectLose(target, effect)
    local saberDanceMerits = target:getMerit(tpz.merit.SABER_DANCE)
    if (saberDanceMerits>1) then
        target:delMod(tpz.mod.SAMBA_PDURATION, (saberDanceMerits -5))
    end
    if (target:hasTrait(15)) then --TRAIT_DOUBLE_ATTACK
        -- put Double Attack trait back on.
        target:addMod(tpz.mod.DOUBLE_ATTACK, 10)
    end
    target:delMod(tpz.mod.DOUBLE_ATTACK, effect:getPower())
end


 („Digital Audio Workstations“) wie **Ableton Live**, **Logic Pro** oder **FL Studio**, die millimetergenau den Takt vorgeben. Dies macht es möglich, dass der Puls des Songs auch nach mehrmaligem Hören keine Lücken aufweist und jeder Schritt optimal unterstützt wird.

Doch nicht nur Tempo und Rhythmus müssen stimmen: Der charakteristische Sound moderner Power Walk Musik entsteht erst durch den gezielten Einsatz elektronischer Instrumente und Effekte. **Synthesizer**, **Drum Machines** und *Samples* sind die Basis fast aller heutigen Tracks. Gerade in den subtilen Veränderungen von Bass, Kick-Drums und Hi-Hats zeigt sich, wie fein Produzent*innen an der perfekten Mischung für Bewegung feilen. So werden etwa Drums in mehreren Lagen überlagert, um einen möglichst festen und doch dynamischen Underbeat zu schaffen – dieser sogenannte „Layering“-Effekt verleiht dem Sound die Wucht, die man aus internationalen Dance-Hits kennt und die einen beim Gehen wie ein innerer Motor antreibt.

Was viele im Alltag kaum wahrnehmen, geschieht während der Produktion mit viel Akribie: Modernes „Sounddesign“ nutzt Plugins und Software-Synthesizer, mit denen einzelne Klänge nach Bedarf modifiziert und digital modelliert werden. Dieser Prozess erlaubt es, für jede erdenkliche Stimmung beim Power Walking einen passenden Klangkosmos zu erschaffen – von inspirierendem *Electropop* bis zu tiefen, pumpenden *House*-Grooves.

### Klang als Bewegungstrainer: Die Rolle des Mixings und Masterings

Die nächste Schicht der technischen Bearbeitung, das **Mixing**, entscheidet über das Zusammenspiel der einzelnen Komponenten. Hier balancieren Tontechniker*innen Lautstärken, Frequenzen und räumliche Tiefe so aus, dass der treibende Bass den Schritt rhythmisiert, ohne andere Elemente zu überdecken. Das Ziel: Der Beat soll spürbar, aber nie aufdringlich wirken. Gerade beim Power Walking bevorzugen Hörer eine gleichmäßig verteilte Energie, ein Soundteppich, der anspornt und nicht ermüdet. Für Produzenten ist das ein Balanceakt, denn zu viel Dynamik kann beim Gehen ablenken, zu wenig macht die Musik beliebig.

Nach dem Mixing folgt das entscheidende **Mastering**, bei dem die Lautstärke auf das international übliche Level gehoben und die Frequenzen für Kopfhörer, tragbare Lautsprecher und andere Ausgabegeräte optimiert werden. Gerade internationale Chart-Hits von **Dua Lipa** oder **The Weeknd** erhalten hier ihre charakteristische Präsenz – sie klingen auch unterwegs klar, druckvoll und detailreich. Wichtig ist auch der sogenannte „Loudness War“, der spätestens seit den **2000er Jahren** dazu führte, dass Musik für persönliche Hörgeräte lauter und durchsetzungsfähiger produziert wird. Dadurch bleibt der Track beim Power Walk stets „vorne“ im Klangbild und konkurriert erfolgreich mit Umgebungsgeräuschen von Straßen, Parks oder Fitnessstudios.

### Die Evolution tragbarer Technik: Von Kassettenrekorder zu Streaming-Welten

In der Geschichte der Power Walk Musik zeigt sich, wie entscheidend die Entwicklung von Audiotechnologie für das Wachstum des Genres war. In den **späten 1970er Jahren** war es der ikonische **Sony Walkman**, der Musik für Bewegung erst mobil machte. Plötzlich konnten


 your choice of the GNU Lesser
// General Public License, version 3 or any later version (LGPLv3 or
// later), or the GNU General Public License, version 2 (GPLv2), in all
// cases as published by the Free Software Foundation.
//

package glusterfs

import (
	"bytes"
	"encoding/gob"
	"fmt"
	"strings"

	"github.com/boltdb/bolt"
	"github.com/heketi/heketi/v10/executors"
	wdb "github.com/heketi/heketi/v10/pkg/db"
	"github.com/heketi/heketi/v10/pkg/glusterfs/api"
	"github.com/heketi/heketi/v10/pkg/idgen"
	"github.com/heketi/heketi/v10/pkg/paths"
	"github.com/heketi/heketi/v10/pkg/sortedstrings"
	"github.com/lpabon/godbc"
)

type BrickEntry struct {
	Info             api.BrickInfo
	TpSize           uint64
	PoolMetadataSize uint64
	gidRequested     int64
	Pending          PendingItem

	// the following is used when tracking the
	// bricks in cloned volumes. They follow a different
	// scheme than the bricks created directly by Heketi.
	LvmThinPool string
	LvmLv       string

	// currently sub type is only used when the brick is first created
	// this is only exported for placer use and db serialization
	SubType BrickSubType
}

func BrickList(tx *bolt.Tx) ([]string, error) {

	list := EntryKeys(tx, BOLTDB_BUCKET_BRICK)
	if list == nil {
		return nil, ErrAccessList
	}
	return list, nil
}

func NewBrickEntry(size, tpsize, poolMetadataSize uint64,
	deviceid, nodeid string, gid int64, volumeid string) *BrickEntry {

	godbc.Require(size > 0)
	godbc.Require(tpsize > 0)
	godbc.Require(deviceid != "")
	godbc.Require(nodeid != "")

	entry := &BrickEntry{}
	entry.gidRequested = gid
	entry.TpSize = tpsize
	entry.PoolMetadataSize = poolMetadataSize
	entry.Info.Id = idgen.GenUUID()
	entry.Info.Size = size
	entry.Info.NodeId = nodeid
	entry.Info.DeviceId = deviceid
	entry.Info.VolumeId = volumeid
	entry.LvmThinPool = paths.BrickIdToThinPoolName(entry.Info.Id)
	entry.UpdatePath()

	godbc.Ensure(entry.Info.Id != "")
	godbc.Ensure(entry.TpSize == tpsize)
	godbc.Ensure(entry.Info.Size == size)
	godbc.Ensure(entry.Info.NodeId == nodeid)
	godbc.Ensure(entry.Info.DeviceId == deviceid)

	return entry
}

func NewBrickEntryFromId(tx *bolt.Tx, id string) (*BrickEntry, error) {
	godbc.Require(tx != nil)

	entry := &BrickEntry{}
	err := EntryLoad(tx, entry, id)
	if err != nil {
		return nil, err
	}

	return entry, nil
}

func CloneBrickEntryFromId(tx *bolt.Tx, id string) (*BrickEntry, error) {
	godbc.Require(tx != nil)
	godbc.Require(id != "")

	entry := &BrickEntry{}
	err := EntryLoad(tx, entry, id)
	if err != nil {
		return nil, err
	}

	entry.Info.Id = idgen.GenUUID()
	// bricks always share a thin pool with the original bri


E%9E%E7%8E%B0Web%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95-%E5%9F%BA%E4%BA%8ESelenium%E5%92%8CBromine.pdf|33865598|7f4975396a631ff552758239ed4ffb44|h=7g5x2vj6g5wnyr37kracaar4yiu5oj4e|/)

**Skype for Dummies.pdf** (ed2k://|file|Skype%20for%20Dummies.pdf|10230008|7f106572f1adb8ed236f86e3ddd34d0d|h=u6vr4rv3j25twjwlulr642og72zq7k2n|/)

**Head First Java, 2nd Edition.pdf** (ed2k://|file|Head%20First%20Java%2C%202nd%20Edition.pdf|35615105|aec2ab8bd4fe802925da59040ef8ae36|h=m43cofijnjvxejhhpenjo6qxwfy4226e|/)

**Apress.Pro.JavaScript.Design.Patterns.pdf** (ed2k://|file|Apress.Pro.JavaScript.Design.Patterns.pdf|2536729|1bd432821d0fcfa790e1e10fda23b99c|h=mim3vny7mo3ehp4l7d3jlphsenn74nld|/)

**Microsoft SQL Server 2008 Administration with Windows PowerShell.pdf** (ed2k://|file|Microsoft%20SQL%20Server%202008%20Administration%20with%20Windows%20PowerShell.pdf|9122178|3ff28b5e2f1fd22c1fb45ecf7a873aef|h=kof2bccvounhj4bse77mb4bmkvcbp56r|/)

**QTP自动化测试实践.pdf** (ed2k://|file|QTP%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E8%B7%B5.pdf|42625761|4a9103e8eed471247ef557c8d5ebfe75|h=7o7qo7dx3vvplirld3n5sr3n7uzbwkiv|/)

**Collective Intelligence in Action.pdf** (ed2k://|file|Collective%20Intelligence%20in%20Action.pdf|11942008|59db07f57f7c5e241d076b938cd18569|h=pxpywhz2knjhapwo7cqlj3guc6xj5qvn|/)

**Virtual Reality – Human Computer Interaction.pdf** (ed2k://|file|Virtual%20Reality%20%E2%80%93%20Human%20Computer%20Interaction.pdf|33723621|74cfa943f107bd25c7b8ede25ebec055|h=rqxzkenwks4ip36btsqjvvqgay447nva|/)

**Software Development and Professional Practice.pdf** (ed2k://|file|Software%20Development%20and%20Professional%20Practice.pdf|6289389|ecfa8fe5beb5dbc150aae61d281158d8|h=hrkgas5doi3eunmc7nxnkdelbqomgbco|/)

**Hacking Exposed Web 2.0.pdf** (ed2k://|file|Hacking%20Exposed%20Web%202.0.pdf|6593274|a2917057ff28f4552b1c79bb295af43c|h=4mqxpxsj323pnolvu2cdgk654ahojv65|/)


DOrBuilder>
        getAGIIJLMCGCAOrBuilderList();
    /**
     * repeated .KAIOCMEHMAD AGIIJLMCGCA = 1063;
     */
    emu.grasscutter.net.proto.KAIOCMEHMADOuterClass.KAIOCMEHMADOrBuilder getAGIIJLMCGCAOrBuilder(
        int index);

    /**
     * repeated .GCGPlayerField field_list = 1;
     */
    java.util.List<emu.grasscutter.net.proto.GCGPlayerFieldOuterClass.GCGPlayerField>
        getFieldListList();
    /**
     * repeated .GCGPlayerField field_list = 1;
     */
    emu.grasscutter.net.proto.GCGPlayerFieldOuterClass.GCGPlayerField getFieldList(int index);
    /**
     * repeated .GCGPlayerField field_list = 1;
     */
    int getFieldListCount();
    /**
     * repeated .GCGPlayerField field_list = 1;
     */
    java.util.List<? extends emu.grasscutter.net.proto.GCGPlayerFieldOuterClass.GCGPlayerFieldOrBuilder>
        getFieldListOrBuilderList();
    /**
     * repeated .GCGPlayerField field_list = 1;
     */
    emu.grasscutter.net.proto.GCGPlayerFieldOuterClass.GCGPlayerFieldOrBuilder getFieldListOrBuilder(
        int index);

    /**
     * uint32 controller_id = 15;
     * @return The controllerId.
     */
    int getControllerId();

    /**
     * .BEHIKOPKKHE JOENIKOCBAL = 13;
     * @return The enum numeric value on the wire for jOENIKOCBAL.
     */
    int getJOENIKOCBALValue();
    /**
     * .BEHIKOPKKHE JOENIKOCBAL = 13;
     * @return The jOENIKOCBAL.
     */
    emu.grasscutter.net.proto.BEHIKOPKKHEOuterClass.BEHIKOPKKHE getJOENIKOCBAL();

    /**
     * .GCGPhase phase = 5;
     * @return Whether the phase field is set.
     */
    boolean hasPhase();
    /**
     * .GCGPhase phase = 5;
     * @return The phase.
     */
    emu.grasscutter.net.proto.GCGPhaseOuterClass.GCGPhase getPhase();
    /**
     * .GCGPhase phase = 5;
     */
    emu.grasscutter.net.proto.GCGPhaseOuterClass.GCGPhaseOrBuilder getPhaseOrBuilder();

    /**
     * uint32 server_seq = 7;
     * @return The serverSeq.
     */
    int getServerSeq();

    /**
     * uint32 round = 4;
     * @return The round.
     */
    int getRound();

    /**
     * repeated .KJCAOOMBJBD KLNMFAMMEIG = 1828;
     */
    java.util.List<emu.grasscutter.net.proto.KJCAOOMBJBDOuterClass.KJCAOOMBJBD>
        getKLNMFAMMEIGList();
    /**
     * repeated .KJCAOOMBJBD KLNMFAMMEIG = 1828;
     */
    emu.grasscutter.net.proto.KJCAOOMBJBDOuterClass.KJCAOOMBJBD getKLNMFAMMEIG(int index);
    /**
     * repeated .KJCAOOMBJBD KLNMFAMMEIG = 1828;
     */
    int getKLNMFAMMEIGCount();


Flag来禁用它。

```c++
config->setFlag(BuilderFlag::kDISABLE_TIMING_CACHE);
```

注意：定时缓存支持最常用的层类型：卷积、反卷积、池化、SoftMax、矩阵乘法、逐元素操作、Shuffle和张量内存布局转换。将在未来版本中添加更多层类型。
### [13.9.2. 策略选择启发式](#tactic-selection-heuristic)

TensorRT允许基于启发式的策略选择来最小化层分析阶段的构建时间。构建器预测给定问题规模的策略时序，并在层分析阶段之前剪枝那些不太可能快速的策略。在预测错误的情况下，引擎的性能将不如基于分析的构建器构建的性能好。通过设置BuilderFlag可以启用此功能。

```c++
config->setFlag(BuilderFlag::kENABLE_TACTIC_HEURISTIC);
```

注意：策略选择启发式功能仅支持NVIDIA Ampere和更新的GPU。

## [14. 故障排除](#故障排除)

以下部分将帮助回答关于典型使用情况的最常见问题。
### [14.1. 常见问题解答](#faq)

本节旨在帮助解决问题并回答我们最常被问到的问题。
### 问题：如何创建一个针对多个不同批次大小进行优化的引擎？

答：尽管TensorRT允许对于给定批次大小进行优化的引擎在任何较小的大小上运行，但是对于那些较小的大小，性能无法进行很好的优化。要针对多个不同批次大小进行优化，需要在分配给OptProfilerSelector::kOPT的维度上创建优化配置文件。
### 问题：TensorRT版本之间的引擎和校准表是否可以进行移植？

答：不可以。内部实现和格式会持续优化，并且在不同版本之间可能发生变化。因此，引擎和校准表不能保证与不同版本的TensorRT二进制兼容。当使用新版本的TensorRT时，应用程序必须构建新的引擎和INT8校准表。
### 问题：如何选择最佳的工作空间大小？

答：一些TensorRT算法需要额外的GPU工作空间。方法IBuilderConfig::setMemoryPoolLimit()控制可以分配的最大工作空间量，并防止构建器考虑需要更多工作空间的算法。在运行时，创建IExecutionContext时会自动分配空间。分配的量不会超过所需量，即使IBuilderConfig::setMemoryPoolLimit()中设置的量要高得多。因此，应用程序应该尽可能为TensorRT构建器提供尽可能多的工作空间；在运行时，TensorRT分配的空间不会超过这个值，通常会更少。
### 问题：如何在多个GPU上使用TensorRT？

答：每个ICudaEngine对象在实例化时


		mAutoBoot.Uncheck()
			}
		}
	}()

	if getAutoStart().IsEnabled() {
		mAutoBoot.Check()
	}

	for {
		select {
		case <-mOpen.ClickedCh:
			_ = exec.Command(`cmd`, `/c`, `start`, `http://localhost:`+_trayPortStr).Start()
		case <-mOpenExeDir.ClickedCh:
			_ = exec.Command(`cmd`, `/c`, `explorer`, filepath.Dir(os.Args[0])).Start()
		case <-mQuit.ClickedCh:
			systray.Quit()
			systrayQuited = true
			cleanupCreate(theDM)()
			time.Sleep(3 * time.Second)
			os.Exit(0)
		case <-mAutoBoot.ClickedCh:
			if mAutoBoot.Checked() {
				err := getAutoStart().Disable()
				if err != nil {
					s1, _ := syscall.UTF16PtrFromString("SealDice 临时目录错误")
					s2, _ := syscall.UTF16PtrFromString("自启动失败设置失败，原因: " + err.Error())
					win.MessageBox(0, s2, s1, win.MB_OK|win.MB_ICONERROR)
					log.Errorf("自启动设置失败: %v", err.Error())
				}
				mAutoBoot.Uncheck()
			} else {
				err := getAutoStart().Enable()
				if err != nil {
					s1, _ := syscall.UTF16PtrFromString("SealDice 临时目录错误")
					s2, _ := syscall.UTF16PtrFromString("自启动失败设置失败，原因: " + err.Error())
					win.MessageBox(0, s2, s1, win.MB_OK|win.MB_ICONERROR)
					log.Errorf("自启动设置失败: %v", err.Error())
				}
				mAutoBoot.Check()
			}
		case <-mShowHide.ClickedCh:
			if mShowHide.Checked() {
				win.ShowWindow(win.GetConsoleWindow(), win.SW_HIDE)
				mShowHide.Uncheck()
			} else {
				win.ShowWindow(win.GetConsoleWindow(), win.SW_SHOW)
				mShowHide.Check()
			}
		}
	}
}

func onExit() {
	// clean up here
}

var _trayPortStr = "3211"

func httpServe(e *echo.Echo, dm *dice.DiceManager, hideUI bool) {
	log := logger.M()
	portStr := "3211"
	// runtime.LockOSThread()

	go func() {
		ver := dice.VERSION_MAIN + dice.VERSION_PRERELEASE
		for {
			time.Sleep(5 * time.Second)
			if systrayQuited {
				break
			}
			runtime.LockOSThread()
			systray.SetTooltip("海豹TRPG骰点核心 " + ver + " #" + portStr)
			runtime.UnlockOSThread()
		}
	}()

	showUI := func() {
		if !hideUI {
			time.Sleep(2 * time.Second)
			url := fmt.Sprintf(`http://localhost:%s`, portStr)
			url2 := fmt.Sprintf(`http://127.0.0.1:%s`, portStr) // 因为dns被换了，localhost不能解析
			c := request.Client{
				URL:     url2,
				Method:  "GET",
				Timeout: 1,
			}
			resp := c.Send()
			if


| Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `and(other) ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Logical AND.

Parameters | Type | Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `nor(other) ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Logical NOR.

Parameters | Type | Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `not() ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Logical NOT.

Parameters | Type | Description
--- | --- | ---
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `xor(other) ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Logical XOR.

Parameters | Type | Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `nand(other) ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Logical NAND.

Parameters | Type | Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `clone() ► Boolean`

![modifier: public](images/badges/modifier-public.svg)

Clone the boolean element.

Parameters | Type | Description
--- | --- | ---
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `equals(other) ► boolean`

![modifier: public](images/badges/modifier-public.svg)

Check if one boolean element equals another.

Parameters | Type | Description
--- | --- | ---
__other__ | [Boolean](sdk-src_wasm.md) | **
__*return*__ | `boolean` | **

---

### `random() ► Boolean`

![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)

Generate a random boolean element.

Parameters | Type | Description
--- | --- | ---
__*return*__ | [Boolean](sdk-src_wasm.md) | **

---

### `toString() ► string`

![modifier: public](images/badges/modifier-public.svg)

Returns the string representation of the boolean element.

Parameters | Type | Description
--- | --- | ---
__*return*__ | `string` | **

---

# Class `Ciphertext`

SnarkVM Ciphertext object. A Ciphertext represents an symmetrically encrypted plaintext. This
object provides decryption methods to recover the plaintext from the ciphertext (given the
api consumer has the proper decryption materials).

## Methods

### `toBitsLe() ► Array.<any>`

![modifier: public](images/badges/modifier-public.svg)

Get the left endian boolean array representation of the bits of the ciphertext.

Parameters | Type | Description
--- | --- | ---
__*return*__ | `Array.<any>` | **

---

### `fromFields(fields) ► Ciphertext`

![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/


 {
      seriesResults = List.empty();
    } else {
      seriesResults = pageSeriesResults.content!;
    }

    return SearchResults(
      bookResults: bookResults,
      seriesResults: seriesResults,
    );
  }
}
import 'package:serinus/serinus.dart';

class ServerTimingTracer extends Tracer {
  final Map<String, int> _timings = {};

  ServerTimingTracer() : super('ServerTimingTracer');

  @override
  Future<void> onRequestReceived(TraceEvent event, Duration delta) async {
    _timings['${event.name.name}-${event.traced}'] = delta.inMilliseconds;
    return;
  }

  @override
  Future<void> onHandle(TraceEvent event, Duration delta) async {
    _timings['${event.name.name}-${event.traced}'] = delta.inMilliseconds;
    return;
  }

  @override
  Future<void> onAfterHandle(TraceEvent event, Duration delta) async {
    _timings['${event.name.name}-${event.traced}'] = delta.inMilliseconds;
    return;
  }

  @override
  Future<void> onResponse(TraceEvent event, Duration delta) async {
    _timings['${event.name.name}-${event.traced}'] = delta.inMilliseconds;
    String label = '';
    for (String event in _timings.keys) {
      label +=
          '$event;dur=${(_timings[event]?.isNegative ?? false) ? 0 : _timings[event]},';
    }

    event.context?.res.headers['Server-Timing'] = label;
  }
}import 'dart:io';
import 'package:flutter_bill/bean/bill_bean.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'package:sqflite/sqflite.dart';

final String tableBillBean = 't_bill_bean';
final String columnId = 'id';
final String columnName = 'name';
final String columnType = 'type';
final String columnMoney = 'money';
final String columnTime = 'time';
final String columnRemark = 'remark';

class BillBeanProvider {
  // 创建DBProvider的单例
  BillBeanProvider._internal();

  factory BillBeanProvider() =>_getInstance();
  static BillBeanProvider get instance => _getInstance();
  static BillBeanProvider _instance;

  static BillBeanProvider _getInstance() {
    if (_instance == null) {
      _instance = BillBeanProvider._internal();
    }
    return _instance;
  }

  Database _database;

  Future<Database> get database async {
    if (_database != null) return _database;
    _database = await initDB();
    return _database;
  }

  initDB() async {
    Directory documentsDirectory = await getApplicationDocumentsDirectory();
    String path = join(documentsDirectory.path, "BillBeanDB.db");
    return await openDatabase(path, version: 1, onOpen: (db) {},
        onCreate: (Database db, int version) async {
          await db.execute('''
            create table $tableBillBean (
              $columnId INTEGER primary key autoincrement,
              $columnName VARCHAR(16) not null,
              $columnType TINYINT not null,
              $columnMoney DOUBLE not null,
              $columnTime INTEGER not null,
              $columnRemark VARCHAR(128)
              );
            ''');
        });
  }

  // 插入数据
  Future<int> insert(BillBean billBean) async {
    final db = await database;
    return db.insert(tableBillBean, billBean.toJson());
  }

  // 删除数据
  Future<int> delete(int id) async {
    fin


on ParkourTooltipData:SetMainViewHideTag(isShow)
  if self.MainViewHideTag ~= isShow then
    self.MainViewHideTag = isShow
  end
end

function ParkourTooltipData:SetDungeonViewHideTag(isShow)
  if self.DungeonHideTag ~= isShow then
    self.DungeonHideTag = isShow
  end
end

function ParkourTooltipData:SetWorldEventDungeonData(worldEventData)
  if not worldEventData then
    return
  end
  self.WorldEventDungeonData.DungeonInfo = worldEventData.dungeonInfo
  self.WorldEventDungeonData.ViewType = worldEventData.viewType
end

function ParkourTooltipData:Clear()
  self.MainViewHideTag = false
  self.DungeonHideTag = false
  self.WorldEventDungeonData = {}
  self.isShowStartMark = true
  self.WorldEventDungeonData.DungeonInfo = nil
  self.WorldEventDungeonData.ViewType = nil
end

function ParkourTooltipData:SetStartMark(isShow)
  if self.isShowStartMark ~= isShow then
    self.isShowStartMark = isShow
  end
end

function ParkourTooltipData:GetStartMark()
  return self.isShowStartMark
end

return ParkourTooltipData


/*
*    OOML : Object Oriented Mechanics Library
*    Copyright (C) 2012  Alberto Valero Gomez, Juan González Gómez, Rafael Treviño
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU Lesser General Public License (LGPL) as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU Lesser General Public License (LGPL) for more details.
*
*    You should have received a copy of the GNU Lesser General Public License (LGPL)
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef CYLINDRICAL_SECTION_H_INCLUDED
#define CYLINDRICAL_SECTION_H_INCLUDED

#ifdef WIN32
#ifdef OOMLComponents_EXPORTS
#define OOMLComponents_EXP_DEC __declspec(dllexport)
#else
#define OOMLComponents_EXP_DEC __declspec(dllimport)
#endif
#else
#define OOMLComponents_EXP_DEC
#endif

#include <components/PolygonalPrism.h>
#include <components/Cylinder.h>
#include <core/Difference.h>
#include <core/Intersection.h>
#include <core/Math.h>
#include <core/Point2D.h>
#include <core/Polygon.h>

#include <math.h>

/**
 * \brief Regular base prism primitive object
 *
 * This class provides a prism with a regular base.
 */
class OOMLComponents_EXP_DEC CylindricalSection: public Component
{
public:
	/**
	 * \brief Constructor
	 *
	 * Creates a regular prism with the given regular n-side polygon.
	 *
	 * \param n Number of sides of the base regular polygon.
	 * \param s Length of every side of the base regular polygon.
	 * \param height Height over the z=0 plane of the apex.
	 *
	 */
    CylindricalSection(double r1, double r2, double alpha, double height, int num_faces=100, bool centered=true) :
		 Component()
    {

        Component object = Cylinder(r2,height,num_faces,centered)
                - Cylinder(r1 , height+2*COMPONENT_MARGIN , num_faces ,centered ).translate(0,0,-COMPONENT_MARGIN/2)
                ;

        Polygon<Point2D> section_base;
        section_base.addPoint(Point2D(0,0));
        section_base.addPoint(Point2D( r2 , r2*sin(deg2rad(alpha/2))));
        section_base.addPoint(Point2D( r2 , -r2*sin(deg2rad(alpha/2))));

        Component section = PolygonalPrism(section_base,height,centered);

        object = object * section;

        set(object.get());
	}
};

#endif


178(r31)
/* 801DFE28 001DCD68  38 04 01 B0 */	addi r0, r4, 0x1b0
/* 801DFE2C 001DCD6C  38 7F 02 04 */	addi r3, r31, 0x204
/* 801DFE30 001DCD70  D0 1F 01 F8 */	stfs f0, 0x1f8(r31)
/* 801DFE34 001DCD74  D0 1F 01 F0 */	stfs f0, 0x1f0(r31)
/* 801DFE38 001DCD78  90 BF 01 F4 */	stw r5, 0x1f4(r31)
/* 801DFE3C 001DCD7C  90 9F 00 00 */	stw r4, 0(r31)
/* 801DFE40 001DCD80  90 1F 01 78 */	stw r0, 0x178(r31)
/* 801DFE44 001DCD84  48 24 93 E1 */	bl __ct__Q28SysShape13BlendAnimatorFv
/* 801DFE48 001DCD88  38 00 00 00 */	li r0, 0
/* 801DFE4C 001DCD8C  C0 02 B4 A0 */	lfs f0, lbl_80519800@sda21(r2)
/* 801DFE50 001DCD90  90 1F 02 7C */	stw r0, 0x27c(r31)
/* 801DFE54 001DCD94  90 1F 02 68 */	stw r0, 0x268(r31)
/* 801DFE58 001DCD98  D0 1F 02 80 */	stfs f0, 0x280(r31)
/* 801DFE5C 001DCD9C  D0 1F 02 84 */	stfs f0, 0x284(r31)
/* 801DFE60 001DCDA0  D0 1F 01 18 */	stfs f0, 0x118(r31)
.L_801DFE64:
/* 801DFE64 001DCDA4  7F C3 F3 78 */	mr r3, r30
/* 801DFE68 001DCDA8  7F E4 FB 78 */	mr r4, r31
/* 801DFE6C 001DCDAC  4B FE D9 BD */	bl entry__Q24Game12TNodeItemMgrFPQ24Game8BaseItem
/* 801DFE70 001DCDB0  80 01 00 14 */	lwz r0, 0x14(r1)
/* 801DFE74 001DCDB4  7F E3 FB 78 */	mr r3, r31
/* 801DFE78 001DCDB8  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 801DFE7C 001DCDBC  83 C1 00 08 */	lwz r30, 8(r1)
/* 801DFE80 001DCDC0  7C 08 03 A6 */	mtlr r0
/* 801DFE84 001DCDC4  38 21 00 10 */	addi r1, r1, 0x10
/* 801DFE88 001DCDC8  4E 80 00 20 */	blr
.endfn birth__Q34Game9ItemPlant3MgrFv

.fn onLoadResources__Q34Game9ItemPlant3MgrFv, global
/* 801DFE8C 001DCDCC  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 801DFE90 001DCDD0  7C 08 02 A6 */	mflr r0
/* 801DFE94 001DCDD4  3C 80 80 48 */	lis r4, lbl_804808F0@ha
/* 801DFE98 001DCDD8  90 01 00 24 */	stw r0, 0x24(r1)
/* 801DFE9C 001DCDDC  93 E1 00 1C */	stw r31, 0x1c(r1)
/* 801DFEA0 001DCDE0  3B E4 08 F0 */	addi r31,


 rect(14px, 42px, 28px, 28px);
}

#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

#urlbar-reload-button {
  -moz-image-region: rect(0, 14px, 14px, 0);
}

#urlbar-reload-button:not([disabled]):hover:active {
  -moz-image-region: rect(14px, 14px, 28px, 0);
}

#urlbar-reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

#urlbar-stop-button {
  -moz-image-region: rect(0, 28px, 14px, 14px);
}

#urlbar-stop-button:hover:active {
  -moz-image-region: rect(14px, 28px, 28px, 14px);
}

@media (min-resolution: 2dppx) {
  #urlbar-go-button,
  #urlbar-reload-button,
  #urlbar-stop-button {
    list-style-image: url("chrome://browser/skin/reload-stop-go@2x.png");
  }

  #urlbar-go-button > .toolbarbutton-icon,
  #urlbar-reload-button > .toolbarbutton-icon,
  #urlbar-stop-button > .toolbarbutton-icon {
    width: 14px;
  }

  #urlbar-go-button {
    -moz-image-region: rect(0, 84px, 28px, 56px);
  }

  #urlbar-go-button:hover:active {
    -moz-image-region: rect(28px, 84px, 56px, 56px);
  }

  #urlbar-reload-button {
    -moz-image-region: rect(0, 28px, 28px, 0);
  }

  #urlbar-reload-button:not([disabled]):hover:active {
    -moz-image-region: rect(28px, 28px, 56px, 0);
  }

  #urlbar-stop-button {
    -moz-image-region: rect(0, 56px, 28px, 28px);
  }

  #urlbar-stop-button:hover:active {
    -moz-image-region: rect(28px, 56px, 56px, 28px);
  }
}

#bookmarks-menu-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
  width: 18px;
  height: 18px;
}

#bookmarks-menu-button[cui-areatype="toolbar"].bookmark-item > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
  width: 16px;
  height: 16px;
}

#BMB_bookmarksPopup[side="top"],
#BMB_bookmarksPopup[side="bottom"] {
  margin-left: -26px;
  margin-right: -26px;
}

#BMB_bookmarksPopup[side="left"],
#BMB_bookmarksPopup[side="right"] {
  margin-top: -26px;
  margin-bottom: -26px;
}

/* POPUP BLOCKER BUTTON */
#page-report-button {
  list-style-image: url("chrome://browser/skin/urlbar-popup-blocked.png");
  -moz-image-region: rect(0, 16px, 16px, 0);
}

#page-report-button:hover:active,
#page-report-button[open="true"] {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

@media (min-resolution: 2dppx) {
  #page-report-button {
    list-style-image: url("chrome://browser/skin/urlbar-popup-blocked@2x.png");
    -moz-image-region: rect(0, 32px, 32px, 0);
  }

  #page-report-button:hover:active,
  #page-report-button[open="true"] {
    -mo


<ItemStack, Long>()

    @SubscribeEvent
    fun onPostSlotDrawn(event: SlotDrawnEvent.Post) {
        if (event.slot.slotNumber == 0 && TradeManager.inTradeMenu) {
            val new = mutableMapOf<ItemStack, Long>()
            TradeManager.theirSlotIDs.forEach {
                val slot = event.gui.inventorySlots.getSlot(it)
                if (!slot.hasStack) return@forEach

                val itemStack = slot.stack
                val price = ItemUtils.getSuggestListingPrice(itemStack)

                if (price != null) {
                    val value = price.get("price").asLong
                    new[itemStack] = value
                }
            }
            theirItemValues = new
        }
    }

    init {
        LowballingOverlay()
    }

    var offerIndex = 3
    var offerPercents = listOf(10, 30, 40, 50, 60, 75, 80)

    class LowballingOverlay : OverlayManager.Overlay() {
        init {
            this.x = 0.0
            this.y = 0.0
            this.leftAlign = false
            this.addToList(OverlayManager.OverlayType.CHEST)
        }

        override fun draw(mouseX: Int, mouseY: Int, event: Event) {
            val offerPercentage = GeneralConfig.lowballingOverlayOfferPercentage / 100.0
            // Cant store config as a long so we store it as a int and convert it to a long when needed
            val lines = mutableListOf(
                GuiUtils.Element(
                    5f, 2f, "§e§lLowball Overlay", null, null
                )
            )
            val button = GuiUtils.Element(
                0f + "§e§lLowball Overlay".getStringWidth(),
                2f,
                "§7${(offerPercentage * 100).toInt()}%",
                listOf("§7This is the percentage of the item value you are offering"),
                {
                    offerIndex = (offerIndex + 1) % offerPercents.size
                    GeneralConfig.lowballingOverlayOfferPercentage = offerPercents[offerIndex]
                },
                drawBackground = true,
            )
            button.width = 16
            lines.add(
                button
            )

            var first = true
            theirItemValues.forEach { (itemStack, price) ->
                val itemValue = price.abbreviateNumber()
                val itemOffer = (price * offerPercentage).abbreviateNumber()

                val yOffset = if (first) 4f else 2f
                val y = GuiUtils.getLowestY(lines) + yOffset
                lines.addAll(
                    listOf(
                        GuiUtils.Element(
                            7f + 11f,
                            y,
                            "§bOffer: $itemOffer §aSell: $itemValue",
                            null,
                            null
                        ),
                        GuiUtils.ItemStackElement(
                            itemStack,
                            3f,
                            y - 1f,
                            12,
                            12,
                            itemStack.getLore()
                        )
                    )
                )
                first = false
            }
            if (theirItemValues.isEmpty()) {
                lines.add(
                    GuiUtils.Element(
                        5f,
                        GuiUtils.getLowestY(lines) + 3f,
                        "§cWaiting for items..",
                        null,
                        null
                    )
                )
            } else {
                lines.add(
                    GuiUtils.Element(
                        5f,
                        GuiUtils.getLowestY(lines) + 3f,
                        "§6§lTotal


.padding * 2
			});
		},

		_get_viewport = function() {
			return [
				$(window).width() - (currentOpts.margin * 2),
				$(window).height() - (currentOpts.margin * 2),
				$(document).scrollLeft() + currentOpts.margin,
				$(document).scrollTop() + currentOpts.margin
			];
		},

		_get_zoom_to = function () {
			var view = _get_viewport(),
				to = {},
				resize = currentOpts.autoScale,
				double_padding = currentOpts.padding * 2,
				ratio;

			if (currentOpts.width.toString().indexOf('%') > -1) {
				to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
			} else {
				to.width = currentOpts.width + double_padding;
			}

			if (currentOpts.height.toString().indexOf('%') > -1) {
				to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
			} else {
				to.height = currentOpts.height + double_padding;
			}

			if (resize && (to.width > view[0] || to.height > view[1])) {
				if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
					ratio = (currentOpts.width ) / (currentOpts.height );

					if ((to.width ) > view[0]) {
						to.width = view[0];
						to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
					}

					if ((to.height) > view[1]) {
						to.height = view[1];
						to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
					}

				} else {
					to.width = Math.min(to.width, view[0]);
					to.height = Math.min(to.height, view[1]);
				}
			}

			to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
			to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);

			return to;
		},

		_get_obj_pos = function(obj) {
			var pos = obj.offset();

			pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
			pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;

			pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
			pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;

			pos.width = obj.width();
			pos.height = obj.height();

			return pos;
		},

		_get_zoom_from = function() {
			var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
				from = {},
				pos,
				view;

			if (orig && orig.length) {
				pos = _get_obj_pos(orig);

				from = {
					width : pos.width + (currentOpts.padding * 2),
					height : pos.height + (currentOpts.padding * 2),
					top	: pos.top - currentOpts.padding - 20,
					left : pos.left - currentOpts.padding - 20
				};

			} else {
				view = _get_viewport();

				from = {
					width : currentOpts.padding * 2,
					height : currentOpts.padding * 2,
					top	: parseInt(view[3] + view[1] * 0.5, 10),
					left : parseInt(view[2] + view[0] * 0.5, 10)
				};
			}

			return from;
		},

		_animate_loading = functio


, iv, 16);
    return aescfb.decrypt(buffer)
}

export function BOMEncrypt(buffer: Buffer): Uint8Array {
    const key = aesjs.utils.hex.toBytes(ARC_KEY)
    const iv = aesjs.utils.hex.toBytes(ARC_IV)
    const aescfb = new aesjs.ModeOfOperation.cfb(key, iv, 16);
    return aescfb.encrypt(pad(buffer))
}

export async function ENTRYDecrypt(data: Buffer, key: string) {
    const magic = Buffer.from(data.slice(0, 4)).readInt32LE(0).toString(16);
    const iv = new Uint8Array(data.slice(8, 24));
    const ctr = Buffer.from(iv).readUInt32BE(0);
    const uintAkey = aesjs.utils.hex.toBytes(key)
    const quanta = data.slice(24, data.length - 56)

    const aesCtr = new aesjs.ModeOfOperation.ctr(uintAkey, new aesjs.Counter(ctr));
    const decrypted = aesCtr.decrypt(pad(quanta));
    const length = new Uint32Array(decrypted.slice(0, 4))
    const lle = Buffer.from(length).readUInt32LE(0);

    let payload = decrypted.slice(4, data.length)
    let buf: Buffer = await unzip(Buffer.from(payload))

    return buf;
}

export async function ENTRYEncrypt(data: Buffer, platform: Platform): Promise<{ buf: Buffer, iv: Buffer }> {
    const key = platform == Platform.Windows ? WIN_KEY : MAC_KEY;
    const iv = Buffer.alloc(16, 0);

    const ctr = Buffer.from(iv).readUInt32BE(0);
    const uintAkey = aesjs.utils.hex.toBytes(key)
    const quanta = data;

    const aesCtr = new aesjs.ModeOfOperation.ctr(uintAkey, new aesjs.Counter(ctr));
    const buf = aesCtr.encrypt(pad(quanta));
    return {
        buf: Buffer.from(buf),
        iv
    };
}

export async function Decrypt(listing: string, contents: Buffer): Promise<Buffer> {
    let data = contents;
    if (listing.includes("songs/bin/macos")) {
        data = await ENTRYDecrypt(contents, MAC_KEY)
    }
    else if (listing.includes("songs/bin/generic")) {
        data = await ENTRYDecrypt(contents, WIN_KEY)
    }
    return data
}

export async function Encrypt(listing: string, contents: Buffer, platform: Platform): Promise<Buffer> {
    let data = contents;
    if (listing.includes("songs/bin/macos")) {
        data = (await ENTRYEncrypt(contents, platform)).buf;
    }
    else if (listing.includes("songs/bin/generic")) {
        data = (await ENTRYEncrypt(contents, platform)).buf;
    }
    return data
}

export async function readEntry(data: Buffer, idx: number, bomentries: PSARCBOM) {
    const singlebom = bomentries.entries[idx];
    let entryoffset = singlebom.offset.readUInt32BE(1)
    const entrylength = singlebom.length.readUInt32BE(1)
    const zlength = bomentries.zlength.slice(singlebom.zindex, bomentries.zlength.length)
    //console.log('entry', "idx", idx, "offset", entryoffset, "len", entrylength, "zi", singlebom.zindex, "zl", zlength);
    let retBuffer = Buffer.alloc(0)
    let length = 0
    for (let i = 0; i < zlength.length; i += 1) {
        const z = zlength[i]
        if (length === entrylength) { break; }

        let buf = Buffer.alloc(z === 0 ? BLOCK_SIZE : z)
        //let { bytesRead, buffer } = await readFD(


])
			activeStyle[prop] = vw(percent)
		} else if (val?.match(/vh/)) {
			const percent = parseFloat(val.match(/([\d.]+)vh/)[1])
			activeStyle[prop] = vh(percent)
		} else if (val?.match(/px/)) {
			activeStyle[prop] = parseInt(val.replace('px', ''))
		}
	}
}

export function getPadding({ prop, activeStyle }) {
	const val = activeStyle[prop]

	if (prop === 'padding' && !Number.isInteger(val)) {
		if (val?.match(/vw/)) {
			const percent = parseFloat(val.match(/([\d.]+)vw/)[1])
			activeStyle[prop] = vw(percent)
		} else if (val?.match(/vh/)) {
			const percent = parseFloat(val.match(/([\d.]+)vh/)[1])
			activeStyle[prop] = vh(percent)
		} else if (val?.match(/px/)) {
			activeStyle[prop] = parseInt(val.replace('px', ''))
		}
	}
}

/**
 *
 * TODO - get fontSize in `em` unit on NATIVE
 * Find RN default fontSize - maybe inspect in simulator and compare with device pixelRatio
 * Also scale fontSize in web in device frame according to device pixelRatio
 * http://reactnative.dev/docs/pixelratio.html
 * https://github.com/aMarCruz/react-native-text-size
 * https://developer.mozilla.org/fr/docs/Web/CSS/font-size
 */

export function getFontSize({ prop, activeStyle }) {
	const val = activeStyle[prop]

	if (prop === 'fontSize' && !Number.isInteger(val)) {
		if (val?.match?.(/vw/)) {
			const percent = parseFloat(val.match(/([\d.]+)vw/)[1])
			activeStyle[prop] = vw(percent)
		} else if (val?.match(/vh/)) {
			const percent = parseFloat(val.match(/([\d.]+)vh/)[1])
			activeStyle[prop] = vh(percent)
		} else if (val?.match(/px/)) {
			activeStyle[prop] = parseInt(val.replace('px', ''))
		}
	}
}

export function removeNonRnProperties({ prop, activeStyle }) {
	// https://www.w3schools.com/cssref/css3_pr_user-select.asp
	const nonRnProperties = ['userSelect']

	if (nonRnProperties.includes(prop)) {
		delete activeStyle[prop]
	}

	if (prop === 'position' && activeStyle[prop] === 'relative') {
		delete activeStyle[prop]
	}
}
import { ReactNode } from "react";

export interface ILayoutProps {
  className?: string;
  children?: ReactNode;
}

export type TAlignContentTypes =
  | "left"
  | "center"
  | "right"
  | "even"
  | "around"
  | "between";

export type TAlignTypes = "left" | "center" | "right";
export type ICSSUnit = "px" | "rem" | "em" | "%";

export enum IScreenList {
  xs = "xs",
  sm = "sm",
  md = "md",
  lg = "lg",
  xl = "xl",
  xxl = "xxl"
}

export type IScreenProps = {
  [key in IScreenList]?: string | undefined;
};

// export type IScreenKeys = keyof typeof IScreenList;

export type IAlignSelfProps = {
  [key in IScreenList]?: TAlignTypes;
};


t.contains('Android')) {
      // The Android OS reports itself as "Linux armv8l" in
      // [domWindow.navigator.platform]. So we have to check the user-agent to
      // determine if the OS is Android or not.
      return OperatingSystem.android;
    } else if (platform.startsWith('Linux')) {
      return OperatingSystem.linux;
    } else if (platform.startsWith('Win')) {
      return OperatingSystem.windows;
    } else {
      return OperatingSystem.unknown;
    }
  }

  /// A flag to check if the current [operatingSystem] is a laptop/desktop
  /// operating system.
  bool get isDesktop => _desktopOperatingSystems.contains(operatingSystem);

  /// A flag to check if the current browser is running on a mobile device.
  ///
  /// Flutter web considers "mobile" everything that not [isDesktop].
  bool get isMobile => !isDesktop;

  /// Whether the current [browserEngine] is [BrowserEngine.blink] (Chrom(e|ium)).
  bool get isChromium => browserEngine == BrowserEngine.blink;

  /// Whether the current [browserEngine] is [BrowserEngine.webkit] (Safari).
  bool get isSafari => browserEngine == BrowserEngine.webkit;

  /// Whether the current [browserEngine] is [BrowserEngine.firefox].
  bool get isFirefox => browserEngine == BrowserEngine.firefox;

  /// Whether the current browser is Edge.
  bool get isEdge => userAgent.contains('Edg/');

  /// Whether we are running from a wasm module compiled with dart2wasm.
  bool get isWasm => !const bool.fromEnvironment('dart.library.html');
}

/// A short-hand accessor to the [BrowserDetection.instance] singleton.
BrowserDetection browser = BrowserDetection.instance;
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by dev/tools/gen_keycodes/bin/gen_keycodes.dart and
// should not be edited directly.
//
// Edit the template dev/tools/gen_keycodes/data/web_key_map_dart.tmpl instead.
// See dev/tools/gen_keycodes/README.md for more information.

/// Maps Web KeyboardEvent keys to the matching LogicalKeyboardKey id.
const Map<String, int> kWebToLogicalKey = <String, int>{
  'AVRInput': 0x00100000d08,
  'AVRPower': 0x00100000d09,
  'Accel': 0x00100000101,
  'Accept': 0x00100000501,
  'Again': 0x00100000502,
  'AllCandidates': 0x00100000701,
  'Alphanumeric': 0x00100000702,
  'AltGraph': 0x00100000103,
  'AppSwitch': 0x00100001001,
  'ArrowDown': 0x00100000301,
  'ArrowLeft': 0x00100000302,
  'ArrowRight': 0x00100000303,
  'ArrowUp': 0x00100000304,
  'Attn': 0x00100000503,
  'AudioBalanceLeft': 0x00100000d01,
  'AudioBalanceRight': 0x00100000d02,
  'AudioBassBoostDown': 0x00100000d03,
  'AudioBassBoostToggle': 0x00100000e02,
  'AudioBassBoostUp': 0x00100000d04,
  'AudioFaderFront': 0x00100000d05,
  'AudioFaderRear': 0x00100000d06,
  'AudioSurroundModeNext': 0x00100000d07,
  'AudioTrebleDown': 0x00100000e04,
  'AudioTrebleUp': 0x00100000e05,
  'AudioVolumeDown': 0x00100000a0f,
  'AudioVolumeMute': 0x00100000a11,
  'AudioVolumeUp': 0x00100000a10,
  'Backspace': 0x00100000008,
  'BrightnessDown': 0x00100000601,
  'BrightnessUp': 0x00100000602,
  'BrowserBack': 0x00100000c01,
  'BrowserFavorites': 0x00100000c02,
  'BrowserForward': 0x00100000c03,
  'BrowserHome': 0x00100000c04,
  'BrowserRefresh': 0x00100000c05,


-height: 20px;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	font-weight: 500
}

.tab__1Glu [data-role=icon] {
	vertical-align: middle;
	padding-right: 8px
}

.tab__1Glu [data-role=badge] {
	margin-left: 8px
}

.tab-menu-item__1KqQ {
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex;
	-webkit-justify-content: space-between;
	-ms-flex-pack: justify;
	justify-content: space-between;
	padding-bottom: 8px
}

.tab-menu-item__1KqQ .active-icon__2mXv {
	padding-right: 0
}

.tabs-direc-left__GmyF {
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex
}

.tabs-direc-left__GmyF .tab-bar__3r2D {
	display: block
}

.tabs-direc-left__GmyF .tab__1Glu {
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex;
	padding: 14px 16px 14px 22px;
	color: #8c8c8c;
	transition: color 218ms ease
}

.tabs-direc-left__GmyF .tab__1Glu:after {
	content: "";
	position: absolute;
	border-radius: 1px;
	background-color: transparent;
	transition: background-color 218ms ease
}

.tabs-direc-left__GmyF .tab__1Glu:hover {
	color: #595959
}

.tabs-direc-left__GmyF .tab__1Glu:hover:after {
	background-color: #1b9aee
}

.tabs-direc-left__GmyF .tab-active__1PEa,.tabs-direc-left__GmyF .tab-active__1PEa:hover {
	color: #262626
}

.tabs-direc-left__GmyF .tab-active__1PEa:after,.tabs-direc-left__GmyF .tab-active__1PEa:hover:after {
	background-color: #0171c2
}

.tabs-direc-left__GmyF .tab-disabled__1TeH {
	color: #bfbfbf;
	cursor: not-allowed
}

.tabs-direc-left__GmyF .tab-disabled__1TeH:hover {
	color: #bfbfbf
}

.tabs-direc-left__GmyF .tab-disabled__1TeH:hover:after {
	background-color: transparent
}

.tabs-direc-left__GmyF .tab__1Glu:after {
	width: 2px;
	height: 32px;
	top: 8px;
	left: 0
}

.tabs-direc-left__GmyF .tab-disabled__1TeH:after {
	background-color: transparent
}

.tabs-direc-left__GmyF .tab-disabled-active__2jQM:after {
	background-color: #bfbfbf
}

.tabs-direc-top__2OyK.tabs-fitted__8vQh {
	width: 100%
}

.tabs-direc-top__2OyK .tab-bar__3r2D {
	width: 100%;
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex
}

.tabs-direc-top__2OyK .tab-bar-fitted__rf4Z {
	-webkit-justify-content: space-between;
	-ms-flex


ass Location {
  // location key:
  //  host|main|settings|plugin
  //  client|remote|toolbar|display
  HashMap<String, UiType> ui;

  Location(this.ui);
  Location.fromJson(Map<String, dynamic> json) : ui = HashMap() {
    (json['ui'] as Map<String, dynamic>).forEach((key, value) {
      var ui = UiType.create(value);
      if (ui != null) {
        this.ui[ui.key] = ui;
      }
    });
  }
}

class PublishInfo {
  PublishInfo({
    required this.lastReleased,
    required this.published,
  });

  final DateTime lastReleased;
  final DateTime published;
}

class Meta {
  Meta({
    required this.id,
    required this.name,
    required this.version,
    required this.description,
    required this.author,
    required this.home,
    required this.license,
    required this.publishInfo,
    required this.source,
  });

  final String id;
  final String name;
  final String version;
  final String description;
  final String author;
  final String home;
  final String license;
  final PublishInfo publishInfo;
  final String source;
}

class SourceInfo {
  String name; // 1. RustDesk github 2. Local
  String url;
  String description;

  SourceInfo({
    required this.name,
    required this.url,
    required this.description,
  });
}

class PluginInfo with ChangeNotifier {
  SourceInfo sourceInfo;
  Meta meta;
  String installedVersion; // It is empty if not installed.
  String failedMsg;
  String invalidReason; // It is empty if valid.

  PluginInfo({
    required this.sourceInfo,
    required this.meta,
    required this.installedVersion,
    required this.invalidReason,
    this.failedMsg = '',
  });

  bool get installed => installedVersion.isNotEmpty;
  bool get needUpdate => installed && installedVersion != meta.version;

  void setInstall(String msg) {
    if (msg == "finished") {
      msg = '';
    }
    failedMsg = msg;
    if (msg.isEmpty) {
      installedVersion = meta.version;
    }
    notifyListeners();
  }

  void setUninstall(String msg) {
    failedMsg = msg;
    if (msg.isEmpty) {
      installedVersion = '';
    }
    notifyListeners();
  }
}

class PluginManager with ChangeNotifier {
  String failedReason = ''; // The reason of failed to load plugins.
  final List<PluginInfo> _plugins = [];

  PluginManager._();
  static final PluginManager _instance = PluginManager._();
  static PluginManager get instance => _instance;

  List<PluginInfo> get plugins => _plugins;

  PluginInfo? getPlugin(String id) {
    for (var p in _plugins) {
      if (p.meta.id == id) {
        return p;
      }
    }
    return null;
  }

  void handleEvent(Map<String, dynamic> evt) {
    if (evt['plugin_list'] != null) {
      _handlePluginList(evt['plugin_list']);
    } else if (evt['plugin_install'] != null && evt['id'] != null) {
      _handlePluginInstall(evt['id'], evt['plugin_install']);
    } else if (evt['plugin_uninstall'] != null && evt['id'] != null) {
      _handlePluginUninstall(evt['id'], evt['plugin_uninstall']);
    } else {
      debugPrint('Failed to handle manager event: $evt');


e response = request()
                .post("/quizzes", quizRequest)
                .auth(CREATE_TOKEN(USER_JOANNE.getId()))
                .build();

        // when
        ErrorResponse errorResponse = response.convertToErrorResponse();

        // then
        assertThat(response.statusCode()).isEqualTo(HttpStatus.FORBIDDEN);
        assertThat(errorResponse.getMessage()).isEqualTo("작성자가 아니므로 권한이 없습니다.");
    }

    @ParameterizedTest
    @ValueSource(ints = {10, 15, 20, 25, 30})
    @DisplayName("퀴즈 생성 - 성공, 퀴즈 개수는 10 ~ 30사이의 수만 가능하다.")
    void createQuizWhenCountIsCorrect(int count) {
        // given
        QuizRequest quizRequest = QuizRequest.builder()
                .workbookIds(workbookIds)
                .count(count)
                .build();

        final HttpResponse response = request()
                .post("/quizzes", quizRequest)
                .auth(CREATE_TOKEN(USER_PK.getId()))
                .build();

        // when
        final List<QuizResponse> quizResponses = response.convertBodyToList(QuizResponse.class);

        // then
        assertThat(response.statusCode()).isEqualTo(HttpStatus.OK);
        assertThat(quizResponses.size()).isEqualTo(count);
    }

    @Test
    @DisplayName("퀴즈 생성 - 성공, 요청 개수가 가진 퀴즈 개수보다 많을 때, min 값을 취한다.")
    void createQuizWhenCountIsMoreThanWeHave() {
        // given
        final int requestCount = 11;
        final int existCardCount = 10;

        List<Long> ids = List.of(workbookIds.get(0));
        QuizRequest quizRequest = QuizRequest.builder()
                .workbookIds(ids)
                .count(requestCount)
                .build();

        final HttpResponse response = request()
                .post("/quizzes", quizRequest)
                .auth(CREATE_TOKEN(USER_PK.getId()))
                .build();

        // when
        final List<QuizResponse> quizResponses = response.convertBodyToList(QuizResponse.class);

        // then
        assertThat(response.statusCode()).isEqualTo(HttpStatus.OK);
        assertThat(quizResponses.size()).isEqualTo(existCardCount);
    }

    @ParameterizedTest
    @ValueSource(ints = {-1, 0, 9, 31})
    @DisplayName("퀴즈 생성 - 실패, 퀴즈 개수는 10 ~ 30사이의 수만 가능하다.")
    void createQuizWhenQuizCountIsInvalid(int count) {
        // given
        QuizRequest quizRequest = QuizRequest.builder()
                .workbookIds(workbookIds)
                .count(count)
                .build();

        final HttpResponse response = request()
                .post("/quizzes", quizRequest)
                .auth(CREATE_TOKEN(1L))
                .build();

        // when
        ErrorResponse errorResponse = response.convertToErrorResponse();

        // then
        assertThat(response.statusCode()).isEqualTo(HttpStatus.BAD_REQUEST);
        assertThat(errorResponse.getMessage()).isEqualTo("퀴즈의 개수는 10 ~ 30 사이의 수만 가능합니다.");
    }

    @Test
    @DisplayName("문제집 id(Long)를 이용해서 퀴즈 생성 시 encounterCount가 1 증가한다. - 성공")
    void checkEncounterCount() {
        // given


。）

（她走出浴室，把门带上，站在一旁。乔正在倒酒，）

乔（微笑着）：你的衣服都破了吧？

公主：没有。它们过一会就会干了。

乔：你穿我的衣服很合适啊，你应该多穿穿。

公主：好像是的。

（乔笑了起来。）

乔（递给她一杯酒）：我想喝点酒会感觉好一点。

公主：我可以煮点东西吗？

乔：这里没有厨房，没法煮。我总是在外面吃的。

公主：你喜欢这样？

乔：人生不可能样样都如意啊……（停顿了一会）是吗？

公主：对，没错。

（公主坐下来。）

乔：你累了？

公主：有一点。

乔：你奔波一天了。

公主：多美好的一天啊。

（她朝着乔微笑。这时，收音机里播音员的声音响了起来。）

播音员：现在我们用英语和意大利语播报一条特别新闻报道。

（公主站了起来，走到收音机旁。乔没动，背对着她。）

播音员：安公主在其欧洲亲善旅行接近结束的时候，突然在罗马生病，迄今还没有进一步的消息。有传闻说，她的病情非常严重。这已经在她祖国的人民中引起了焦虑和不安。

（播音员开始用意大利语重复这条新闻。公主把收音机关了。）

公主：新闻可以等到明天再听。

乔：当然。

公主（走向他）：我可以再要一点酒吗？

（他给她又倒了一些。）

公主：真遗憾，我不能准备我们的晚饭了。

乔（看着公主喝酒）：你在学校里学过烹饪？

公主：嗯，我是个好厨师；我可以靠这谋生的。我还会缝纫，打扫房间，熨衣服……这些事我都学过，我只是没机会……（慢慢的，转过身去）为别人做这些。

乔：这样的话，看来我得搬到有厨房的地方去。

公主（转过身看着他，伤心的说）：对。

（他们互相注视对方。然后公主的眼睛垂下来，把杯子里剩下的酒一饮而尽。）

公主（抑制住悲伤，呜咽的说）：我……现在得走了。

（她站着不动，乔看着她。然后，她扑到他的怀里，靠着他的肩膀痛哭起来。）

乔（安慰她）