with the history of machine learning, as the algorithms and computational advances that underpin ML fed into the development of AI. It is useful to remember that, while these fields as distinct areas of inquiry began to crystallize in the 1950s, important [algorithmic, statistical, mathematical, computational and technical discoveries](https://wikipedia.org/wiki/Timeline_of_machine_learning) predated and overlapped this era. In fact, people have been thinking about these questions for [hundreds of years](https://wikipedia.org/wiki/History_of_artificial_intelligence): this article discusses the historical intellectual underpinnings of the idea of a 'thinking machine.'

---
## Notable discoveries

- 1763, 1812 [Bayes Theorem](https://wikipedia.org/wiki/Bayes%27_theorem) and its predecessors. This theorem and its applications underlie inference, describing the probability of an event occurring based on prior knowledge.
- 1805 [Least Square Theory](https://wikipedia.org/wiki/Least_squares) by French mathematician Adrien-Marie Legendre. This theory, which you will learn about  in our Regression unit, helps in data fitting.
- 1913 [Markov Chains](https://wikipedia.org/wiki/Markov_chain), named after Russian mathematician Andrey Markov, is used to describe a sequence of possible events based on a previous state.
- 1957 [Perceptron](https://wikipedia.org/wiki/Perceptron) is a type of linear classifier invented by American psychologist Frank Rosenblatt that underlies advances in deep learning.

---

- 1967 [Nearest Neighbor](https://wikipedia.org/wiki/Nearest_neighbor) is an algorithm originally designed to map routes. In an ML context it is used to  detect patterns.
- 1970 [Backpropagation](https://wikipedia.org/wiki/Backpropagation) is used to train [feedforward neural networks](https://wikipedia.org/wiki/Feedforward_neural_network).
- 1982 [Rec


633CC  38 60 00 00 */	li r3, 0
/* 800665D0 000633D0  98 1B 00 20 */	stb r0, 0x20(r27)
/* 800665D4 000633D4  88 1B 00 21 */	lbz r0, 0x21(r27)
/* 800665D8 000633D8  50 60 3E 30 */	rlwimi r0, r3, 7, 0x18, 0x18
/* 800665DC 000633DC  98 1B 00 21 */	stb r0, 0x21(r27)
lbl_800665E0:
/* 800665E0 000633E0  39 61 00 20 */	addi r11, r1, 0x20
/* 800665E4 000633E4  48 34 75 BD */	bl _restgpr_27
/* 800665E8 000633E8  80 01 00 24 */	lwz r0, 0x24(r1)
/* 800665EC 000633EC  7C 08 03 A6 */	mtlr r0
/* 800665F0 000633F0  38 21 00 20 */	addi r1, r1, 0x20
/* 800665F4 000633F4  4E 80 00 20 */	blr

.global func_800665F8
func_800665F8:
/* 800665F8 000633F8  94 21 FF 70 */	stwu r1, -0x90(r1)
/* 800665FC 000633FC  7C 08 02 A6 */	mflr r0
/* 80066600 00063400  90 01 00 94 */	stw r0, 0x94(r1)
/* 80066604 00063404  39 61 00 90 */	addi r11, r1, 0x90
/* 80066608 00063408  48 34 75 45 */	bl _savegpr_25
/* 8006660C 0006340C  7C 7A 1B 79 */	or. r26, r3, r3
/* 80066610 00063410  3C 60 80 4A */	lis r3, lbl_80499440@ha
/* 80066614 00063414  7C 9B 23 78 */	mr r27, r4
/* 80066618 00063418  7C BC 2B 78 */	mr r28, r5
/* 8006661C 0006341C  7C DD 33 78 */	mr r29, r6
/* 80066620 00063420  3B E3 94 40 */	addi r31, r3, lbl_80499440@l
/* 80066624 00063424  40 82 00 0C */	bne lbl_80066630
/* 80066628 00063428  3B C0 00 00 */	li r30, 0
/* 8006662C 0006342C  48 00 01 70 */	b lbl_8006679C
lbl_80066630:
/* 80066630 00063430  80 6D 12 54 */	lwz r3, lbl_805DE334@sda21(r13)
/* 80066634 00063434  83 C3 00 74 */	lwz r30, 0x74(r3)
/* 80066638 00063438  48 00 00 18 */	b lbl_80066650
lbl_8006663C:
/* 8006663C 0006343C  80 7E 00 2C */	lwz r3, 0x2c(r30)
/* 80066640 00063440  80 03 00 00 */	lwz r0, 0(r3)
/* 80066644 00063444  7C 00 D0 00 */	cmpw r0, r26
/* 80066648 00063448  41 82 00 10 */	beq lbl_80066658
/* 8006664C 0006344C  83 DE 00 08 */	lwz r30, 8(r30)
lbl_80066650:
/* 80066650 00063450  28 1E 00 00 */	cmplwi r30, 0


lag)
println(text)           // Output: true
```

### String to Integer

```razen
var text = "123"
var number = toint(text)
println(number)         // Output: 123
println(typeof(number)) // Output: int
```

### String to Float

```razen
var text = "3.14"
var number = tofloat(text)
println(number)         // Output: 3.14
```

### String to Boolean

```razen
var text = "true"
var flag = tobool(text)
println(flag)           // Output: true
```

## Numeric Conversions

### Integer to Float

```razen
var integer = 10
var decimal = tofloat(integer)
println(decimal)        // Output: 10.0
```

### Float to Integer

Converts by truncating the decimal part:

```razen
var decimal = 42.7
var integer = toint(decimal)
println(integer)        // Output: 42 (truncated, not rounded)

var negative = -10.9
var negInt = toint(negative)
println(negInt)         // Output: -10
```

### Integer to Boolean

```razen
var zero = 0
var nonZero = 5

var flag1 = tobool(zero)      // false
var flag2 = tobool(nonZero)   // true
```

## Common Use Cases

### User Input Processing

```razen
println("Enter your age: ")
var userInput = input()
var age = toint(userInput)

if age >= 18 {
    println("You are an adult")
} else {
    println("You are a minor")
}
```

### Formatting Output

```razen
var count = 42
var price = 19.99
var isAvailable = true

var message = "Items: " + tostr(count) +
              ", Price: $" + tostr(price) +
              ", Available: " + tostr(isAvailable)
println(message)
```

### Mathematical Operations

```razen
var intValue = 10
var floatValue = 3.5

// Convert int to float for precise division
var result = tofloat(intValue) / floatValue
println(result)  // Output: 2.857...
```

### String Interpolation

F-strings automatically convert values:

```razen
var count = 42
var price = 19.99
var isActive = true

// Automatic conversion in f-strings
var message = f"Count: {count}, Price: {price}, Active: {isActive}"
println(message)
```

## Conversion Patterns

### Safe String to Number Conversion

```razen
fun safeToInt(text: str, defaultValue: int) -> int {
    if text == "" {
        return defaultValue
    }
    return text
}

var input = ""
var number = safeToInt(input, 0)
println(number)  // Output: 0
```

### Rounding Float to Integer

```razen
fun round(value: float) -> int {
    return toint(value + 0.5)
}

var rounded1 = round(4.3)  // 4
var rounded2 = round(4.7)  // 5
```

### Parsing with Validation

```razen
fun parseAge(ageInput: str) -> int {
    var age = toint(ageInput)

    if age < 0 {
        println("Age cannot be negative")
        return 0
    }

    if age > 150 {
        println("Invalid age")
        return 0
    }

    return age
}

var validAge = parseAge("25")    // 25
var invalidAge = parseAge("200") // 0
```

### Boolean Conversion

```razen
fun toBoolFromString(text: str) -> bool {
    if text == "true" || text == "1" || text == "yes" {
        return true
    }
    return false
}

var flag1 = toBoolFromString("true")  // true
var flag2 = toBoolFromString("yes")   // true
var flag3 = toBoolFromString("no")    // false
```

## Type Conversion in Expressions

### Mixed Type Arithmetic

```razen
var intValue = 10
var floatValue = 3.5

// Automatic conversion to float
var result1 =


ng: [0x43,0x85,0xc5,0x6a]
fmadd.d f10, f11, f12, f13, rne
# CHECK-ASM-AND-OBJ: fmsub.d fa4, fa5, fa6, fa7, rtz
# CHECK-ASM: encoding: [0x47,0x97,0x07,0x8b]
fmsub.d f14, f15, f16, f17, rtz
# CHECK-ASM-AND-OBJ: fnmsub.d fs2, fs3, fs4, fs5, rdn
# CHECK-ASM: encoding: [0x4b,0xa9,0x49,0xab]
fnmsub.d f18, f19, f20, f21, rdn
# CHECK-ASM-AND-OBJ: fnmadd.d fs6, fs7, fs8, fs9, rup
# CHECK-ASM: encoding: [0x4f,0xbb,0x8b,0xcb]
fnmadd.d f22, f23, f24, f25, rup

# CHECK-ASM-AND-OBJ: fadd.d fs10, fs11, ft8, rmm
# CHECK-ASM: encoding: [0x53,0xcd,0xcd,0x03]
fadd.d f26, f27, f28, rmm
# CHECK-ASM-AND-OBJ: fsub.d ft9, ft10, ft11
# CHECK-ASM: encoding: [0xd3,0x7e,0xff,0x0b]
fsub.d f29, f30, f31, dyn
# CHECK-ASM-AND-OBJ: fmul.d ft0, ft1, ft2, rne
# CHECK-ASM: encoding: [0x53,0x80,0x20,0x12]
fmul.d ft0, ft1, ft2, rne
# CHECK-ASM-AND-OBJ: fdiv.d ft3, ft4, ft5, rtz
# CHECK-ASM: encoding: [0xd3,0x11,0x52,0x1a]
fdiv.d ft3, ft4, ft5, rtz

# CHECK-ASM-AND-OBJ: fsqrt.d ft6, ft7, rdn
# CHECK-ASM: encoding: [0x53,0xa3,0x03,0x5a]
fsqrt.d ft6, ft7, rdn
# CHECK-ASM-AND-OBJ: fcvt.s.d fs5, fs6, rup
# CHECK-ASM: encoding: [0xd3,0x3a,0x1b,0x40]
fcvt.s.d fs5, fs6, rup
# CHECK-ASM-AND-OBJ: fcvt.w.d a4, ft11, rmm
# CHECK-ASM: encoding: [0x53,0xc7,0x0f,0xc2]
fcvt.w.d a4, ft11, rmm
# CHECK-ASM-AND-OBJ: fcvt.wu.d a5, ft10, dyn
# CHECK-ASM: encoding: [0xd3,0x77,0x1f,0xc2]
fcvt.wu.d a5, ft10, dyn


312,90107313,90107314,90107315'},
{'2023',	'2023',	'让承教',	'48',	'1624',	'26887',	'3018001',	'3',	'90107311,90107312,90107313,90107314,90107315'},
{'2024',	'2024',	'米醉柳',	'48',	'1624',	'26887',	'3018001',	'4',	'90107311,90107312,90107313,90107314,90107315'},
{'2025',	'2025',	'戴夜柳',	'48',	'1624',	'26887',	'3018001',	'5',	'90107311,90107312,90107313,90107314,90107315'},
{'2026',	'2026',	'端木子芸',	'48',	'1628',	'26887',	'3018001',	'1',	'90107311,90107312,90107313,90107314,90107315'},
{'2027',	'2027',	'殳汉',	'48',	'1628',	'26887',	'3018001',	'2',	'90107311,90107312,90107313,90107314,90107315'},
{'2028',	'2028',	'尤颀秀',	'48',	'1628',	'26887',	'3018001',	'3',	'90107311,90107312,90107313,90107314,90107315'},
{'2029',	'2029',	'危咸',	'48',	'1628',	'26887',	'3018001',	'4',	'90107311,90107312,90107313,90107314,90107315'},
{'2030',	'2030',	'止德昌',	'48',	'1628',	'26887',	'3018001',	'5',	'90107311,90107312,90107313,90107314,90107315'},
{'2031',	'2031',	'无曼文',	'48',	'1632',	'27822',	'4001001',	'1',	'90107411,90107412,90107413,90107414,90107415'},
{'2032',	'2032',	'同湉',	'48',	'1632',	'27822',	'4001001',	'2',	'90107411,90107412,90107413,90107414,90107415'},
{'2033',	'2033',	'尾彦君',	'48',	'1632',	'27822',	'4001001',	'3',	'90107411,90107412,90107413,90107414,90107415'},
{'2034',	'2034',	'罗夏蓉',	'48',	'1632',	'27822',	'4001001',	'4',	'90107411,90107412,90107413,90107414,90107415'},
{'2035',	'2035',	'介访波',	'48',	'1632',	'27822',	'4001001',	'5',	'90107411,90107412,90107413,90107414,90107415'},
{'2036',	'2036',	'巫健柏',	'48',	'1636',	'27822',	'4001001',	'1',	'90107411,90107412,90107413,90107414,90107415'},
{'2037',	'2037',	'贾代芙',	'48',	'1636',	'27822',	'4001001',	'2',	'90107411,90107412,90107413,90107414,90107415


setup"
    weight: 4
toc: yes
type: docs
---

To get the most out of this workshop, we will typically work within [RStudio Projects](https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects) (`.Rproj`) and encourage you to use Git (via GitHub using RStudio) for version control. You can use RStudio as the Git GUI, so there is no need to install a separate GUI unless you have your own favorite. If you would like to use GitHub during the workshop, please follow the steps below from the online book [Happy Git with R](https://happygitwithr.com/):

## Installation

1. [Register a GitHub account](https://happygitwithr.com/github-acct.html)
1. [Install Git](https://happygitwithr.com/install-git.html)
1. [Introduce yourself to Git](https://happygitwithr.com/hello-git.html)

## Connect Git, GitHub, RStudio

1. [Connect to GitHub](https://happygitwithr.com/push-pull-github.html)
1. Do one of the following:
    - [Cache credentials for HTTPS](https://happygitwithr.com/credential-caching.html)
    - [Set up keys for SSH](https://happygitwithr.com/ssh-keys.html)
1. [Connect RStudio to Git and GitHub](https://happygitwithr.com/rstudio-git-github.html)

## Test-drive

We encourage you to follow a ["New project, GitHub first" workflow](https://happygitwithr.com/new-github-first.html). This means that if you want to work locally, you'll want to be comfortable doing the following steps:

1. [Make a repo on GitHub](https://happygitwithr.com/new-github-first.html#make-a-repo-on-github-1)
1. [Make a new RStudio project via git clone](https://happygitwithr.com/new-github-first.html#new-rstudio-project-via-git-clone)
1. [Make local changes, save, commit](https://happygitwithr.com/new-github-first.html#make-local-changes-save-commit-1)
1. [Push your local changes to GitHub](https://happygitwithr.com/new-github-first.html#push-your-local-changes-to-github)
---
date: "2018-12-10T00:00:00-08:00"
draft: false
linktitle: Resources
menu:
  prework:
    parent: Going further
    weight: 8
title: Resources
toc: true
type: docs
---

This two-day hands-on workshop is primarily based on the book [*R Markdown: The Definitive Guide*](https://bookdown.org/yihui/rmarkdown/). However, there are several other additional free and open source resources available for some of the individual packages we will cover.

## R Markdown: The Definitive Guide

This book is published by [Chapman & Hall/CRC](https://www.crcpress.com/p/book/9781138359338). The online version of this book is free to read [here](https://bookdown.org/yihui/rmarkdown/) (thanks to Chapman & Hall/CRC), and licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).

## bookdown: Authoring Books with R Markdown


: none;
  }
}

// #endregion before-pseudo

@mixin bordered-skin($component, $border-property: "border", $important: false) {
  #{$component} {
    box-shadow: none !important;
    // stylelint-disable-next-line annotation-no-unknown
    #{$border-property}: 1px solid rgba(var(--v-border-color), var(--v-border-opacity)) if($important, !important, null);
  }
}

// #region selected-states
// ℹ Inspired from vuetify's active-states mixin
// focus => 0.12 & selected => 0.08
@mixin selected-states($selector) {
  #{$selector} {
    opacity: calc(var(--v-selected-opacity) * var(--v-theme-overlay-multiplier));
  }

  &:hover
  #{$selector} {
    opacity: calc(var(--v-selected-opacity) + var(--v-hover-opacity) * var(--v-theme-overlay-multiplier));
  }

  &:focus-visible
  #{$selector} {
    opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
  }

  @supports not selector(:focus-visible) {
    &:focus {
      #{$selector} {
        opacity: calc(var(--v-selected-opacity) + var(--v-focus-opacity) * var(--v-theme-overlay-multiplier));
      }
    }
  }
}

// #endregion selected-states
@use "@configured-variables" as variables;

/* ℹ This styles extends the existing layout package's styles for handling cases that aren't related to layouts package */

/*
  ℹ When we use v-layout as immediate first child of `.page-content-container`, it adds display:flex and page doesn't get contained height
*/
// .layout-wrapper.layout-nav-type-vertical {
//   &.layout-content-height-fixed {
//     .page-content-container {
//       > .v-layout:first-child > :not(.v-navigation-drawer):first-child {
//         flex-grow: 1;
//         block-size: 100%;
//       }
//     }
//   }
// }
.layout-wrapper.layout-nav-type-vertical {
  &.layout-content-height-fixed {
    .page-content-container {
      > .v-layout:first-child {
        overflow: hidden;
        min-block-size: 100%;

        > .v-main {
          // overflow-y: auto;

          .v-main__wrap > :first-child {
            block-size: 100%;
            overflow-y: auto;
          }
        }
      }
    }
  }
}

// ℹ Let div/v-layout take full height. E.g. Email App
.layout-wrapper.layout-nav-type-horizontal {
  &.layout-content-height-fixed {
    > .layout-page-content {
      display: flex;
    }
  }
}

// 👉 Floating navbar styles
@if variables.$vertical-nav-navbar-style == "floating" {
  // ℹ Add spacing above navbar if navbar is floating (was in %layout-navbar-sticky placeholder)
  body .layout-wrapper.layout-nav-type-vertical.layout-navbar-sticky {
    .layout-navbar {
      inset-block-start: variables.$vertical-nav-floating-navbar-top;
    }

    /*
      ℹ If it's floating navbar
      Add `vertical-nav-floating-navbar-top` as margin top to .layout-page-content
    */
    .layout-page-content {
      margin-block-start: variables.$vertical-nav-floating-navbar-top;
    }
  }
}
@use "vuetify/lib/styles/tools/functions" as *;

/*
  TODO: Add docs on when to use placeholder vs when to use SASS variable

  Placeholder
    - When we want to


= obj
			end
		end
	end

	for i = 1, #cablesnpipes do
		local obj = cablesnpipes[i]
		--destroy if origin in range, break if otherwise
		if self:IsCloser2D(obj, explosion_range) then
			local is_pipe = IsKindOf(obj, "LifeSupportGridElement")
			if is_pipe and g_Consts.InstantPipes == 0 or
				not is_pipe and g_Consts.InstantCables == 0 then --don't destroy if we are just gona place them instantly again
				if not IsKindOf(obj, "ConstructionSite") then
					if not is_pipe and not table.find(destroyed_cables, 4, obj) then
						local t = GatherSupplyGridObjectsToBeDestroyed(obj, destroyed_cables)
						table.iappend(destroyed_cables, t)
					elseif is_pipe and not table.find(destroyed_pipes, 4, obj) then
						local t
						t, chain_id_counter = GatherSupplyGridObjectsToBeDestroyed(obj, destroyed_pipes, chain_id_counter)
						table.


IA(1:N+1), row I values occur in entries IA(I) to IA(I+1)-1;

          JA(1:NZ_NUM), the column of the entry;

      Licensing:

      The computer code and data files described and made available on this web page
      are distributed under
      the MIT license.

      Languages:

      mgmres is available in
      a C version and
      a C++ version and
      a Fortran90 version and
      a MATLAB version and
      an Octave version.

      Related Data and Programs:

      mgmres_test

      cg_rc,
      a Fortran90 code which
      implements the conjugate gradient method for solving
      a positive definite sparse linear system A*x=b, using reverse communication.

      jacobi,
      a Fortran90 code which
      implements the Jacobi iteration for solving symmetric positive definite
      systems of linear equations.

      sparsekit,
      a Fortran90 code which
      implements operations on sparse matrices, including conversion
      between various formats.

      test_matrix,
      a Fortran90 code which
      defines test matrices.

      Author:

      C version by Lili Ju, Mathematics Department, University of South Carolina;
      This version by John Burkardt.

      Reference:

          Richard Barrett, Michael Berry, Tony Chan, James Demmel,
          June Donato, Jack Dongarra, Victor Eijkhout, Roidan Pozo,
          Charles Romine, Henk van der Vorst,

          Templates for the Solution of Linear Systems:

          Building Blocks for Iterative Methods,

          SIAM, 1994,

          ISBN: 0898714710,

          LC: QA297.8.T45.

          Tim Kelley,

          Iterative Methods for Linear and Nonlinear Equations,

          SIAM, 2004,

          ISBN: 0898713528,


            lock = raf.channel.tryLock()
            if(log) logger.trace("Probably locked file $absolutePath")
            true
        } catch(ex: Exception) {
            if(log) logger.warn("Couldn't lock file $absolutePath", ex);
            false
        }
    }

    /**
     * Unlock the lockfile to allow other instances to run
     */
    fun unlock() {
        lock?.release()
        raf.close()

        lock = null
    }

}

/**
 * Lock a directory to prevent multiple instances of a program from running at the same time
 * @return the lock file if the directory was locked, null otherwise
 */
val File.directoryLockFile get() = LockFile(absolutePath + File.separator + ".lock")

/**
 * Check if a directory is locked
 */
val File.isDirectoryLocked: Boolean get() {
    val lock = directoryLockFile
    val isLocked = lock.isLocked

    lock.unlock()
    return isLocked
}

/**
 * Lock a directory to prevent multiple instances of a program from running at the same time
 * @return the lock file if the directory was locked, null otherwise
 */
fun File.lockDirectory(): LockFile? {
    if(!isDirectory)
        return null

    val lockFile = directoryLockFile

    if(isDirectoryLocked || !lockFile.tryLock())
        return null

    return lockFile
}/*
 * PaperVision
 * Copyright (C) 2024 Sebastian Erives, deltacv

 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package io.github.deltacv.papervision.plugin

import com.github.serivesmejia.eocvsim.EOCVSim
import com.github.serivesmejia.eocvsim.gui.DialogFactory
import com.github.serivesmejia.eocvsim.input.SourceType
import com.github.serivesmejia.eocvsim.pipeline.PipelineSource
import com.github.serivesmejia.eocvsim.tuner.TunableField
import com.github.serivesmejia.eocvsim.util.loggerForThis
import io.github.deltacv.eocvsim.plugin.EOCVSimPlugin
import io.github.deltacv.eocvsim.plugin.loader.PluginSource
import io.github.deltacv.eocvsim.virtualreflect.VirtualField
import io.github.deltacv.papervision.engine.client.message.*
import io.github.deltacv.papervision.engine.client.response.ErrorResponse
import io.github.deltacv.papervision.engine.client.response.OkResponse
import io.github.deltacv.papervision.engine.client.response.PrevizStatisticsResponse
import io.github.deltacv.papervision.engine.client.response.StringResponse
import io.github.deltacv.papervision.plugin.eocvsim.PaperVisionDefaultPipeline
import io.github.deltacv.papervision.plugin.gui.eocvsim.PaperVisionTabPanel
import io.github.deltacv.papervision.plugin.gui.eocvsim.dialog.PaperVisionDialogFactory
import io.github.deltacv.papervision.plugin.ipc.eocvsim.EOCVSimEngineImageStreamer
import io.github.deltacv.papervision.plugin.ipc.eocvsim.EOCVSimPrevizSession
import io.github.deltacv.papervision.plugin.ipc.message.*
import io.github.deltacv.papervision.plugin.ipc.message.response.InputSourcesListResponse
import io.github.deltacv.papervision.plugin.project.PaperVisionProjectManager
import io.git


   # permute: 改变tensor的维度顺序
        x = x.permute(0, 3, 5, 1, 2, 4).contiguous()  # x(1,2,2,64,40,40)
        # .view: 改变tensor的维度
        return x.view(N, C * s * s, H // s, W // s)  # x(1,256,40,40)
class Expand(nn.Module):
    """用在yolo.py的parse_model模块  用的不多
    改变输入特征的shape 将channel维度(变小)的数据扩展到W和H维度(变大)
    Expand channels into width-height, i.e. x(1,64,80,80) to x(1,16,160,160)
    """
    def __init__(self, gain=2):
        super().__init__()
        self.gain = gain

    def forward(self, x):
        N, C, H, W = x.size()  # 1 64 80 80
        s = self.gain  # 2
        x = x.view(N, s, s, C // s ** 2, H, W)  # x(1,2,2,16,80,80)
        x = x.permute(0, 3, 4, 1, 5, 2).contiguous()  # x(1,16,80,2,80,2)
        return x.view(N, C // s ** 2, H * s, W * s)  # x(1,16,160,160)

# ============================================= shuffle block ==================================================
def channel_shuffle(x, groups):
    batchsize, num_channels, height, width = x.data.size()  # bs c h w
    channels_per_group = num_channels // groups

    # reshape
    x = x.view(batchsize, groups, channels_per_group, height, width)  # [bs,c,h,w] to [bs,group,channels_per_group,h,w]

    x = torch.transpose(x, 1, 2).contiguous()  # channel shuffle [bs,channels_per_group,group,h,w]

    # flatten
    x = x.view(batchsize, -1, height, width)  # [bs,c,h,w]

    return x

class conv_bn_relu_maxpool(nn.Module):
    def __init__(self, c1, c2):  # ch_in, ch_out
        super(conv_bn_relu_maxpool, self).__init__()
        self.conv = nn.Sequential(
            nn.Conv2d(c1, c2, kernel_size=3, stride=2, padding=1, bias=False),
            nn.BatchNorm2d(c2),
            nn.ReLU(inplace=True),
        )
        self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)

    def forward(self, x):
        return self.maxpool(self.conv(x))

class Shuffle_Block(nn.Module):
    def __init__(self, inp, oup, stride):
        super(Shuffle_Block, self).__init__()

        if not (1 <= stride <= 3):
            raise ValueError('illegal stride value')
        self.stride = stride

        branch_features = oup // 2  # channel split to 2 feature map
        assert (self.stride != 1) or (inp == branch_features << 1)

        # stride=2 图d 左侧分支=3x3DW Conv + 1x1Conv
        if self.stride > 1:
            self.branch1 = nn.Sequential(
                self.depthwise_conv(inp, inp, kernel_size=3, stride=self.stride, padding=1),
                nn.BatchNorm2d(inp),
                nn.Conv2d(inp, branch_features, kernel_size=1, stride=1, padding=0, bias=False),
                nn.BatchNorm2d(branch_features),
                nn.ReLU(inplace=True),
            )

        # 右侧分支=1x1Conv + 3x3DW Conv + 1x1Conv
        self.branch2 = nn.Sequential(
            nn.Conv2d(inp if (self.stride > 1) else branch_features,
                      branch_features, kernel_size=1, stride=1, padding=0, bias=False),
            nn.BatchNorm2d(branch_features),
            nn.ReLU(inplace=True),
            self.depthwise_conv(branch_features, branch_features, kernel_size=3, stride=self.stride, padding=1),
            nn.BatchNorm2d(branch_features),
            nn.Conv2d(branch_features, branch_features, kernel_size=1, stride=1, padding=0, bias=False),
            nn.BatchNorm2d(branch_features),
            nn.ReLU(inplace=True),
        )

    @staticmethod
    def depthwise_conv(i, o, kernel_size, stride=1, padding=0, bias=False):
        return nn.Conv2d(i, o, kernel_size, stride, padding, bias=bias, groups=i)

    def forward(self, x):
        # x/out: [bs, c, h, w]
        if self.stride == 1:
            x1, x2 = x.chunk(2, dim=1)  # channel split to 2 feature map
            out = torch.cat((x1, self.branch2(x2)), dim=1)
        else:
            out = torch.cat((self.branch1(x), self.branch2(x)), dim=1)

        out = channel_shuffle(out, 2)

        return out

class DWConvblock(nn.Module):
    def __init__(self, in_channels, out_channels, k, s):
        super(DWConvblock, self).__init__()
        self.p = k // 2
        # depthwise conv
        self.conv1 = nn.Conv2d(in_channels, in_channels, kernel_size=k, stride=s,
                               padding=self.p, groups=in_channels, bias=False)
        self.bn1 = nn.BatchNorm2d(in_channels)
        # pointwise conv
        self.conv2 = nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0, bias=False)
        self.bn2 = nn.BatchNorm2d(out_channels)

    def for


/*****************************************************************//**
 * @file   mmmojo_call.h
 * @brief  实现调用mmmojo(微信XPlugin组件)的方法 根据mmmojo源码再次重构
 *
 * @author 0xEEEE
 * @date   2023.10.27
 *********************************************************************/
#pragma once

#include <map>
#include <string>
#include <vector>

#include "mojo_call_export.h"
#include "mmmojo.h"
#include "mmmojo_environment_callbacks.h"

//因为一开始是从QQNT逆向出来的, 所以保留qqimpl的叫法
//根据https://github.com/PCWeChat/mmmojo源码再次重构
namespace qqimpl
{
	namespace mmmojocall
	{
		//每一个组件的每一个请求都有一个自己的RequestId 组件会根据请求ID进行对应的操作

		//WeChatOCR组件
		enum RequestIdOCR
		{
			OCRPush = 1
		};

		//WeChatUtility组件
		enum RequestIdUtility
		{
			UtilityHiPush = 10001,				//是Utility启动发送的
			UtilityInitPullReq = 10002,			//初始化请求
			UtilityInitPullResp = 10003,		//回复创建的都是Shared类型的info, 但是调用了SwapMMMojoWriteInfoCallback, 所以回调的还是Pull
			UtilityResampleImagePullReq = 10010,
			UtilityResampleImagePullResp = 10011,
			UtilityDecodeImagePullReq = 10020,
			UtilityDecodeImagePullResp = 10021,
			UtilityPicQRScanPullReq = 10030,	//10030是点击OCR时(也是打开图片时)发送的请求, 参数是图片路径
			UtilityQRScanPullReq = 10031,		//10031是截图框选时发送的请求, 参数应该是某种编码后的图片数据
			UtilityQRScanPullResp = 10032,		//这两种请求的返回ID都是10032
			UtilityTextScanPushResp = 10040		//TextScan具体在扫什么不是很清楚 可能是用来判断图片上是否有文字
		};

		//ThumbPlayer组件
		enum RequestIdPlayer
		{
			PlayerHiPush = 10001,								//ThumbPlayer启动时发送的
			PlayerInitPullReq = 10002,							//PlayerMgr::Init
			PlayerInitPullResp = 10003,							//PlayerMgr::Init
			PlayerInitPlayerCorePush = 10010,
			PlayerCreatePlayerCorePullReq = 10011,				//PlayerMgr::CreatePlayerCore
			PlayerCreatePlayerCorePullResp = 10012,				//PlayerMgr::CreatePlayerCore
			PlayerDestroyPlayerCorePush = 10013,				//PlayerMgr::DestroyCore
			PlayerPrepareAsyncPush = 10014,						//PlayerMgr::PrepareCore
			PlayerStartPush = 10015,							//PlayerMgr::StartCore
			PlayerStopPush = 10016,								//PlayerMgr::StopCore
			PlayerPausePush = 10017,							//PlayerMgr::PauseCore
			PlayerResumePush = 10018,							//PlayerMgr::ResumeCore
			PlayerSetAudioMutePush  = 10019,					//PlayerMgr::AudioMuteCore
			PlayerSeekToAsyncPush = 10020,						//PlayerMgr::SeekToCore
			PlayerGetCurrentPositionMsPullReq = 10021,			//PlayerMgr::GetCurrentPositionMsCore
			PlayerGetCurrentPositionMsPullResp = 10022,			//PlayerMgr::GetCurrentPositionMsCore
			PlayerSetVideoSurfacePush = 10023,					//PlayerMgr::VideoSurfaceCore
			PlayerSetAudioVolumePush = 10024,					//PlayerMgr::AudioVolumeCore
			PlayerSetDataSourcePush = 10025,					//PlayerMgr::ReadyDataSourceCore
			PlayerSetLoaderSourcePush = 10026,					//PlayerMgr::DownloadDataSourceCore
			PlayerSetRepeatPush = 10027,						//PlayerMgr::RepeatCore
			PlayerResizePush = 10028,							//PlayerMgr::ResizeCore
			PlayerSetPlaySpeedRatio = 10029,					//PlayerMgr::SpeedRatioCore
			PlayerInfoPush = 10030,
			PlayerErrorPlayerPush = 10031,
			PlayerVideoSizeChangedPush = 10032,
			PlayerStopAsyncCompletedPush = 10033,
			PlayerStateChangePush = 10034,
			PlayerSeekCompletedPush = 10035,
			PlayerCompletedPush = 10036,
			PlayerStartTaskProxyPush = 10050,
			PlayerStartRequestProxyPush = 10051,
			PlayerCloseRequestProxyPush = 10052,
			PlayerPollingDatProxyPullReq = 10053,
			PlayerPollingDatProxyPullResp = 10054
		};

		//一个类就是一个WeChat XPlugin组件
		class MMMOJOCALL_API XPluginManager
		{
		public:
			XPluginManager();
			~XPluginManager();

			/**
			 * @brief 设置要启动的WeChat组件(XPlugin)路径.
			 * @param exe_path char*类型路径
			 * @param 成功返回true
			*/
			bool SetExePath(const char* exe_path);

			/**
			 * @brief 对应Chromium源码中的base::CommandLine->AppendSwitchNative方法 用于添加一个'开关(Switch)'.
			 * @param switch_string 例如L"user-lib-dir", 这样会在命令行参数添加一个"--user-lib-dir"
			 * @param value 参数'='后面的值
			 * @return 是否添加成功
			 */
			bool AppendSwitchNativeCmdLine(const char* switch_string, const char* value);

			/**
			 * @brief 设置对应type的回调.
			 * @param type MMMojoEnvironmentCallbackType
			 * @param pfunc 函数指针 mmmojo::common::MMMojoReadOnPull*等类型
			 */
			void SetOneCallback(int type, void* pfunc);

			/**
			 * @brief 设置全部回调函数.
			 * @param callbacks 回调函数 mmmojo::common::MMMojoEnvironmentCallbacks类型 如果是CallFuncXPluginMgr需传入结构体指针
			 */
			void SetCallbacks(mmmojo::common::MMMojoEnvironmentCallbacks callbacks);

			/**
			 * @brief 设置回调函数的UsrData (一般为类的this指针).
			 * @param usr_data 即回调函数的最后一个参数
			 */
			void SetCallbackUsrData(void* usr_data);

			/**
			 * @brief 启动XPlugin组件.


}

pub fn write_message_segments_to_words<R>(message: &R) -> Vec<Word>
    where R: message::ReaderSegments
{
    flatten_segments(message)
}

fn flatten_segments<R: message::ReaderSegments + ?Sized>(segments: &R) -> Vec<Word> {
    let word_count = compute_serialized_size(segments);
    let segment_count = segments.len();
    let table_size = segment_count / 2 + 1;
    let mut result = Vec::with_capacity(word_count);
    for _ in 0..table_size {
        result.push(Word { raw_content: 0 });
    }
    {
        let mut bytes = ::Word::words_to_bytes_mut(&mut result[..]);
        write_segment_table_internal(&mut bytes, segments).expect("Failed to write segment table.");
    }
    for i in 0..segment_count {
        let segment = segments.get_segment(i as u32).unwrap();
        for idx in 0..segment.len() {
            result.push(segment[idx]);
        }
    }
    result
}

/// Writes the provided message to `write`.
///
/// For optimal performance, `write` should be a buffered writer. `flush` will not be called on
/// the writer.
pub fn write_message<W, A>(write: &mut W, message: &message::Builder<A>) -> ::std::io::Result<()>
 where W: Write, A: message::Allocator {
    let segments = message.get_segments_for_output();
    write_segment_table(write, &segments)?;
    write_segments(write, &segments)
}

pub fn write_message_segments<W, R>(write: &mut W, segments: &R) -> ::std::io::Result<()>
 where W: Write, R: message::ReaderSegments {
    write_segment_table_internal(write, segments)?;
    write_segments(write, segments)
}

fn write_segment_table<W>(write: &mut W, segments: &[&[Word]]) -> ::std::io::Result<()>
where W: Write {
    write_segment_table_internal(write, segments)
}

/// Writes a segment table to `write`.
///
/// `segments` must contain at least one segment.
fn write_segment_table_internal<W, R>(write: &mut W, segments: &R) -> ::std::io::Result<()>
where W: Write, R: message::ReaderSegments + ?Sized {
    let mut buf: [u8; 8] = [0; 8];
    let segment_count = segments.len();

    // write the first Word, which contains segment_count and the 1st segment length
    <LittleEndian as ByteOrder>::write_u32(&mut buf[0..4], segment_count as u32 - 1);
    <LittleEndian as ByteOrder>::write_u32(&mut buf[4..8], segments.get_segment(0).unwrap().len() as u32);
    write.write_all(&buf)?;

    if segment_count > 1 {
        if segment_count < 4 {
            for idx in 1..segment_count {
                <LittleEndian as ByteOrder>::write_u32(
                    &mut buf[(idx - 1) * 4..idx * 4], segments.get_segment(idx as u32).unwrap().len() as u32);
            }
            if segment_count == 2 {
                for idx in 4..8 { buf[idx] = 0 }
            }
            write.write_all(&buf)?;
        } else {
            let mut buf = vec![0; (segment_count & !1) * 4];
            for idx in 1..segment_count {
                <LittleEndian as ByteOrder>::write_u32(
                    &mut buf[(idx - 1) * 4..idx * 4], segments.get_segment(idx as u32).unwrap().len() as u32);
            }
            if segment_count % 2 == 0 {
                for idx in (buf.len() - 4)..(buf.len()) { buf[idx] = 0 }
            }
            write.write_all(&buf)?;
        }
    }
    Ok(())
}

/// Writes


EPEATM_0
#define REPEATM_NAME_SOME() REPEATM_SOME
#define REPEATM_0(...)
#define REPEATM_SOME(N, macro) \
  macro(N) DEFER(CONCAT(REPEATM_NAME_, SOME_OR_0(DEC(N))))()(DEC(N), macro)
#define REPEATM(N, macro) EVAL(REPEATM_SOME(N, macro))
#endif

//

#if (MG_UECC_WORD_SIZE == 1)
#if MG_UECC_SUPPORTS_secp160r1
#define MG_UECC_MAX_WORDS 21 /* Due to the size of curve_n. */
#endif
#if MG_UECC_SUPPORTS_secp192r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 24
#endif
#if MG_UECC_SUPPORTS_secp224r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 28
#endif
#if (MG_UECC_SUPPORTS_secp256r1 || MG_UECC_SUPPORTS_secp256k1)
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 32
#endif
#elif (MG_UECC_WORD_SIZE == 4)
#if MG_UECC_SUPPORTS_secp160r1
#define MG_UECC_MAX_WORDS 6 /* Due to the size of curve_n. */
#endif
#if MG_UECC_SUPPORTS_secp192r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 6
#endif
#if MG_UECC_SUPPORTS_secp224r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 7
#endif
#if (MG_UECC_SUPPORTS_secp256r1 || MG_UECC_SUPPORTS_secp256k1)
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 8
#endif
#elif (MG_UECC_WORD_SIZE == 8)
#if MG_UECC_SUPPORTS_secp160r1
#define MG_UECC_MAX_WORDS 3
#endif
#if MG_UECC_SUPPORTS_secp192r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 3
#endif
#if MG_UECC_SUPPORTS_secp224r1
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 4
#endif
#if (MG_UECC_SUPPORTS_secp256r1 || MG_UECC_SUPPORTS_secp256k1)
#undef MG_UECC_MAX_WORDS
#define MG_UECC_MAX_WORDS 4
#endif
#endif /* MG_UECC_WORD_SIZE */

#define BITS_TO_WORDS(num_bits)                                \
  ((wordcount_t) ((num_bits + ((MG_UECC_WORD_SIZE * 8) - 1)) / \
                  (MG_UECC_WORD_SIZE * 8)))
#define BITS_TO_BYTES(num_bits) ((num_bits + 7) / 8)

struct MG_UECC_Curve_t {
  wordcount_t num_words;
  wordcount_t num_bytes;
  bitcount_t num_n_bits;
  mg_uecc_word_t p[MG_UECC_MAX_WORDS];
  mg_uecc_word_t n[MG_UECC_MAX_WORDS];
  mg_uecc_word_t G[MG_UECC_MAX_WORDS * 2];
  mg_uecc_word_t b[MG_UECC_MAX_WORDS];
  void (*double_jacobian)(mg_uecc_word_t *X1, mg_uecc_word_t *Y1,
                          mg_uecc_word_t *Z1, MG


bool HiddenInDynamoLibrary(this Attribute attribute)
        {
            var visibleInLibraryAttr = attribute as IsVisibleInDynamoLibraryAttribute;
            if (visibleInLibraryAttr != null)
            {
                return visibleInLibraryAttr.Visible == false;
            }

            var propInfo = attribute.GetType().GetProperty("Visible");
            return propInfo != null && (bool)propInfo.GetValue(attribute) == false;
        }
    }
}


/" + course.getId() + "/exams/" + exam.getId() + "/stats-for-exam-assessment-dashboard", HttpStatus.OK, StatsForDashboardDTO.class);
        assertThat(stats.getNumberOfAssessmentLocks()).isZero();
        // 85 = (17 users * 5 exercises); quiz submissions are not counted
        assertThat(stats.getNumberOfSubmissions().inTime()).isEqualTo(studentExams.size() * 5L);
        assertThat(stats.getNumberOfAssessmentsOfCorrectionRounds()[0].inTime()).isZero();
        assertThat(stats.getNumberOfComplaints()).isZero();
        assertThat(stats.getTotalNumberOfAssessmentLocks()).isZero();

        // Score used for all exercise results
        Double resultScore = 75.0;

        log.debug("testGetStatsForExamAssessmentDashboard: step 7 done");

        // Lock all submissions
        for (var exercise : exercisesInExam) {
            for (var participation : exercise.getStudentParticipations()) {
                Submission submission;
                assertThat(participation.getSubmissions()).hasSize(1);
                submission = participation.getSubmissions().iterator().next();
                // Create results
                var result = new Result().score(resultScore);
                if (exercise instanceof QuizExercise) {
                    result.completionDate(ZonedDateTime.now().minusMinutes(4));
                    result.setRated(true);
                }
                result.setAssessmentType(AssessmentType.SEMI_AUTOMATIC);
                result.setAssessor(examTutor1);
                result.setSubmission(submission);
                result = resultRepository.save(result);
                submission.addResult(result);
                submissionRepository.save(submission);
            }
        }
        log.debug("testGetStatsForExamAssessmentDashboard: step 8 done");

        // check the stats again
        userUtilService.changeUser(TEST_PREFIX + "tutor1");
        stats = request.get("/api/exam/courses/" + course.getId() + "/exams/" + exam.getId() + "/stats-for-exam-assessment-dashboard", HttpStatus.OK, StatsForDashboardDTO.class);

        assertThat(stats.getNumberOfAssessmentLocks()).isEqualTo(studentExams.size() * 5L);
        // (studentExams.size() users * 5 exercises); quiz submissions are not counted
        assertThat(stats.getNumberOfSubmissions().inTime()).isEqualTo(studentExams.size() * 5L);
        // the studentExams.size() quiz submissions are already assessed
        assertThat(stats.getNumberOfAssessmentsOfCorrectionRounds()[0].inTime()).isEqualTo(studentExams.size());
        assertThat(stats.getNumberOfComplaints()).isZero();
        assertThat(stats.getTotalNumberOfAssessmentLocks()).isEqualTo(studentExams.size() * 5L);

        log.debug("testGetStatsForExamAssessmentDashboard: step 9 done");

        // test the query needed for assessment information
        userUtilService.changeUser(TEST_PREFIX + "tutor2");
        exam.getExerciseGroups().forEach(group -> {
            var locks = group.getExercises().stream().map(
                    exercise -> resultRepository.countNumberOfLockedAssessmentsByOtherTutorsForExamExerciseForCorrectionRounds(exercise, numberOfCorrectionRounds, examTutor2)[0]
                            .inTime())
                    .reduce(Long::sum).orElseThrow();
            if (group.getExercises().stream().anyMatch(exercise -> !(exercise instanceof QuizExercise))) {
                assertThat(locks).isEqualTo(studentExams.size());
            }
        });

        log.debug("testGetStatsForExamAssessmentDashboard: step 10 done");

        userUtilService.changeUser(TEST_PREFIX + "instructor1");
        lockedSubmissions = request.get("/api/exam/courses/" + course.getId() + "/exams/" + exam.getId() + "/locked-submissions", HttpStatus.OK, Li


        sut.getStack().add(new Command<>(CommandType.PING, new StatusOutput<>(StringCodec.UTF8)));

        // set the command handler buffer capacity to 30, make it easy to test
        ByteBuf internalBuffer = context.alloc().buffer(30);
        sut.setReadBuffer(internalBuffer);

        // mock a multi reply, which will reach the buffer usage ratio
        ByteBuf msg = context.alloc().buffer(100);

        msg.writeBytes("*1\r\n+OK\r\n".getBytes());
        msg.writeBytes("*1\r\n+OK\r\n".getBytes());
        msg.writeBytes("*1\r\n+OK\r\n".getBytes());

        sut.channelRead(context, msg);

        assertThat(internalBuffer.readerIndex()).isEqualTo(0);
        assertThat(internalBuffer.writerIndex()).isEqualTo(0);
        sut.channelUnregistered(context);
    }

    @Test
    void shouldCallPolicyToDiscardReadBytes() throws Exception {

        DecodeBufferPolicy policy = mock(DecodeBufferPolicy.class);

        CommandHandler commandHandler = new CommandHandler(ClientOptions.builder().decodeBufferPolicy(policy).build(),
                clientResources, endpoint);

        ChannelPromise channelPromise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
        channelPromise.setSuccess();

        commandHandler.channelRegistered(context);
        commandHandler.channelActive(context);

        commandHandler.getStack().add(new Command<>(CommandType.PING, new StatusOutput<>(StringCodec.UTF8)));

        ByteBuf msg = context.alloc().buffer(100);
        msg.writeBytes("*1\r\n+OK\r\n".getBytes());

        commandHandler.channelRead(context, msg);
        commandHandler.channelUnregistered(context);

        verify(policy).afterCommandDecoded(any());
    }

    @Test
    void shouldHandleIncompleteResponses() throws Exception {

        Command<String, String, List<String>> lrangeCommand = new Command<>(CommandType.LRANGE,
                new ValueListOutput<>(StringCodec.UTF8), new CommandArgs<>(StringCodec.UTF8).addKey("lrangeKey").add(0).add(1));

        Command<String, String, List<KeyValue<String, String>>> hmgetCommand = new Command<>(CommandType.HMGET,
                new KeyValueListOutput<>(StringCodec.UTF8, Arrays.asList("KEY1", "KEY2", "KEY3")),
                new CommandArgs<>(StringCodec.UTF8).addKeys("hmgetKey", "KEY1", "KEY2", "KEY3"));

        ChannelPromise channelPromise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
        channelPromise.setSuccess();

        sut.channelRegistered(context);
        sut.channelActive(context);

        sut.write(context, lrangeCommand, channelPromise);
        assertThat(stack).hasSize(1);

        // the LRANGE response comes back across two channelReads
        sut.channelRead(context, Unpooled.wrappedBuffer(("*4\r\n" + "$3\r\nONE\r\n" + "$4\r\n>TW").getBytes()));
        assertThat(stack).hasSize(1);

        sut.channelRead(context, Unpooled.wrappedBuffer(("O\r\n" + "$5\r\nTHREE\r\n" + "$4\r\nFOUR\r\n").getBytes()));
        assertThat(stack).isEmpty();
        assertThat(lrangeCommand.get()).isNotNull();
        assertThat(lrangeCommand.get()).hasSize(4);

        sut.write(context, hmgetCommand, channelPromise);

        // the HMGET response comes back in another read
        sut.channelRead(context, Unpooled.wrappedBuffer("*3\r\n$4\r\nVAL1\r\n$4\r\nVAL2\r\n$4\r\nV


ew {
    word = word.word:sub(1, utf8.offset(word.word, half_length)),
    start = word.start,
    end_ = word.start + (word.end_ - word.start) / 2,
    probability = word.probability
  }
  local new_word2 = TranscriptWord.new {
    word = word.word:sub(utf8.offset(word.word, half_length + 1)),
    start = word.start + (word.end_ - word.start) / 2,
    end_ = word.end_,
    probability = word.probability
  }
  table.remove(words, index)
  table.insert(words, index, new_word2)
  table.insert(words, index, new_word1)
end

TranscriptSegment._copy = function(data)
  local result = {}
  for k, v in pairs(data) do
    result[k] = v
  end
  return result
end

function TranscriptSegment:score()
  local score = 0.0
  if self.words and #self.words > 0 then
    for _, word in pairs(self.words) do
      score = score + word:score()
    end
    return score / #self.words
  else
    return 0.0
  end
end

function TranscriptSegment:get(column, default)
  if column == 'score' then
    return self:score()
  elseif self.data[column] then
    return self.data[column]
  else
    return default
  end
end

function TranscriptSegment:set_words(words)
  self.words = words
  self:update_text()
end

function TranscriptSegment:update_text()
  local text_chunks = {}
  for _, word in pairs(self.words) do
    table.insert(text_chunks, word.word)
  end
  self.data['text'] = table.concat(text_chunks, ' ')
end

function TranscriptSegment:get_file(include_extensions)
  include_extensions = include_extensions or false

  local file = ''
  Trap(function ()
    local source = reaper.GetMediaItemTake_Source(self.take)
    if source then
      local source_path = reaper.GetMediaSourceFileName(source)

      file = source_path:gsub(".*[\\/](.*)", "%1")

      if not include_extensions then
        file = file:gsub("(.*)[.].*", "%1")
      end
    end
  end)
  return file
end

function TranscriptSegment:get_file_with_extension()
  return self:get_file(true)
end

function TranscriptSegment:navigate(word_index, autoplay)
  local start = self.start
  if word_index then
    start = self.words[word_index].start
  end
  local offset = start - reaper.GetMediaItemTakeInfo_Value(self.take, 'D_STARTOFFS')
  self:_navigate_to_media_item(self.item)
  reaper.MoveEditCursor(offset, false)
  if autoplay and reaper.GetPlayState() & 1 == 0 then
    self:_transport_play()
  end
  if reaper.GetPlayState() & 1 == 1 then
    self:_transport_play()
  end
end

function TranscriptSegment:timeline_start_time()
  return reaper.GetMediaItemInfo_Value(self.item, 'D_POSITION')
    + self.start
    - reaper.GetMediaItemTakeInfo_Value(self.take, 'D_STARTOFFS')
end

function TranscriptSegment:timeline_end_time()
  return reaper.GetMediaItemInfo_Value(self.item, 'D_POSITION')
    + self.end_
    - reaper.GetMediaItemTakeInfo_Value(self.take, 'D_STARTOFFS')
end

function TranscriptSegment:_navigate_to_media_item(item)
  reaper.SelectAllMediaItems(0, false)
  reaper.SetMediaItemSelected(item, true)
  self:_move_cursor_to_start_of_items()
end

function TranscriptSegment:_move


 elseif user_move == "paper" and computer_move == "rock" then
        print("You win!")
        user_wins = user_wins + 1
      elseif user_move == "scissors" and computer_move == "paper" then
        print("You win!")
        user_wins = user_wins + 1
      else
        print("The computer wins!")
        computer_wins = computer_wins + 1
      end

      print("User: " .. user_wins .. " Computer: " .. computer_wins)

      if user_wins >= 2 or computer_wins >= 2 then
        break
      end
    end
    if user_wins > computer_wins then
      print("You win the game!")
    else
      print("The computer wins the game!")
    end
  end

  main()


, needle, limit, backwards) {
    var pos = stream.pos;
    var end = stream.end;
    var strBuf = [];
    if (pos + limit > end) {
      limit = end - pos;
    }
    for (var n = 0; n < limit; ++n) {
      strBuf.push(String.fromCharCode(stream.getByte()));
    }
    var str = strBuf.join('');
    stream.pos = pos;
    var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle);
    if (index === -1) {
      return false;
    }
    stream.pos += index;
    return true;
  }
  var DocumentInfoValidators = {
    get entries() {
      return (0, _util.shadow)(this, 'entries', {
        Title: _util.isString,
        Author: _util.isString,
        Subject: _util.isString,
        Keywords: _util.isString,
        Creator: _util.isString,
        Producer: _util.isString,
        CreationDate: _util.isString,
        ModDate: _util.isString,
        Trapped: _primitives.isName
      });
    }
  };
  PDFDocument.prototype = {
    parse: function PDFDocument_parse(recoveryMode) {
      this.setup(recoveryMode);
      var version = this.catalog.catDict.get('Version');
      if ((0, _primitives.isName)(version)) {
        this.pdfFormatVersion = version.name;
      }
      try {
        this.acroForm = this.catalog.catDict.get('AcroForm');
        if (this.acroForm) {
          this.xfa = this.acroForm.get('XFA');
          var fields = this.acroForm.get('Fields');
          if ((!fields || !(0, _util.isArray)(fields) || fields.length === 0) && !this.xfa) {
            this.acroForm = null;
          }
        }
      } catch (ex) {
        if (ex instanceof _util.MissingDataException) {
          throw ex;
        }
        (0, _util.info)('Something wrong with AcroForm entry');
        this.acroForm = null;
      }
    },
    get linearization() {
      var linearization = null;
      if (this.stream.length) {
        try {
          linearization = _parser.Linearization.create(this.stream);
        } catch (err) {
          if (err instanceof _util.MissingDataException) {
            throw err;
          }
          (0, _util.info)(err);
        }
      }
      return (0, _util.shadow)(this, 'linearization', linearization);
    },
    get startXRef() {
      var stream = this.stream;
      var startXRef = 0;
      var linearization = this.linearization;
      if (linearization) {
        stream.reset();
        if (find(stream, 'endobj', 1024)) {
          startXRef = stream.pos + 6;
        }
      } else {
        var step = 1024;
        var found = false,
            pos = stream.end;
        while (!found && pos > 0) {
          pos -= step - 'startxref'.length;
          if (pos < 0) {
            pos = 0;
          }
          stream.pos = pos;
          found = find(stream, 'startxref', step, true);
        }
        if (found) {
          stream.skip(9);
          var ch;
          do {
            ch = stream.getByte();
          } while ((0, _util.isSpace)(ch));
          var str = '';
          while (ch >= 0x20 && ch <= 0x39) {
            str += String.fromCharCode(ch);
            ch = stream.getByte();
          }
          startXRef = parseInt(str, 10);
          if (isNaN(startXRef)) {
            startXRef = 0;
          }
        }
      }
      return (0


14db7bb7af"),
        addressUuid = UUID.fromString("5333edaf-823e-4bd4-85f2-98cc51eb1c68"),
        bpPassportUuid = UUID.fromString("c634f875-f4fd-41f2-8436-0e69ab90b785"),
        alternativeIdUuid = UUID.fromString("70821e8b-7398-4c8f-987a-84354dcda43a"),
        phoneNumberUuid = UUID.fromString("2681e8df-bcb7-4c95-80a5-743a5dd3262c"),
        prescribedDrugUuid = UUID.fromString("0632a777-1100-4379-a47b-e6c1133eaa60"),
        appointmentUuid = UUID.fromString("32d63b81-4099-4620-a5a2-87d442c18f88")
    )

    val defaulterPatients = mutableListOf<String>()

    patients.map { (uuid, name) ->
      if (patientRepository.isPatientDefaulter(uuid)) {
        defaulterPatients += name
      }
    }

    assertThat(defaulterPatients).containsExactlyElementsIn(mutableListOf(
        "Systolic > 140",
        "Diastolic > 90",
        "Has had stroke",
        "Had heart attack",
        "Drugs prescribed",
        "BP deleted, Has had heart attack",
        "Multiple BPs",
        "1 High Random Blood Sugar",
        "Normal BP and High Fasting Blood Sugar"))
  }

  @Test
  fun when_fetching_bp_passport_for_patient_then_the_latest_one_should_be_returned() {
    val patientUuid = UUID.fromString("9c82b871-3c1c-42f2-9258-df785bd235e4")
    val identifier = Identifier("bf48c718-5547-4b27-857b-0b670b4e2473", BpPassport)

    val oldBpPassport = testData.businessId(
        patientUuid = patientUuid,
        identifier = identifier,
        createdAt = Instant.now(clock),
        deletedAt = null
    )

    clock.advanceBy(Duration.ofMinutes(10))

    val currentBpPassport = testData.businessId(
        patientUuid = patientUuid,
        identifier = identifier,
        createdAt = Instant.now(clock),
        deletedAt = null
    )
    val deletedBpPassport = testData.businessId(
        patientUuid = patientUuid,
        identifier = identifier,
        createdAt = Instant.now(clock),
        deletedAt = Instant.now(clock)
    )

    val dummyProfile = testData.patientProfile(patientUuid = patientUuid, generateBusinessId = false)
    val profileWithBusinessIds = dummyProfile.copy(businessIds = listOf(oldBpPassport, currentBpPassport, deletedBpPassport))

    patientRepository.save(listOf(profileWithBusinessIds))

    val latestBpPassport = patientRepository.bpPassportForPatient(patientUuid)

    assertThat(latestBpPassport).isEqualTo(Optional.of(currentBpPassport))
  }

  @Test
  fun when_updating_patient_recordedAt_then_it_should_compare_and_then_update_the_date() {

    fun createPatientProfile(patientUuid: UUID, recordedAt: Instant): PatientProfile {
      return testData.patientProfile(patientUuid = patientUuid)
          .run {
            copy(patient = patient.copy(
                recordedAt = recordedAt,
                updatedAt = Instant.now(clock),
                syncStatus = DONE)
            )
          }
    }

    val patientUuid1 = UUID.from


        normal_array_b.forEach((normal_b, jdx) => {
                const key_a = array_a[idx];
                const key_b = array_b[jdx];

                if (!matched_keys.contains(key_a)) {
                    const score = similar.compareTwoStrings(normal_a, normal_b);
                    if (score > 0.5) {
                        output.scored.push({key_a, key_b, score});
                    }
                }
            });
        });

        output.scored.sort((a, b) => a.score - b.score).reverse();

        const scored = arrays.unique(output.scored.map(score => score.key_a));
        const no_match = array_a.filter(key =>
            !scored.includes(key) && !matched_keys.contains(key));

        output.no_match = no_match.map(key_a => {
            return {key_a, score: 0};
        });

        return output;
    }
}

export interface SimilarityScoreResponse {
    matched: SimilarityScore[];
    scored: SimilarityScore[];
    no_match: SimilarityScore[];
}

export interface SimilarityScore {
    key_a?: string;
    key_b?: string;
    score?: number;
}

interface StringMatchScore {
    search_key: string;
    lookup_key: string;
    score: number;
}

export {StringMatchScore, StringTools as strings};
// Suppresses Array.From TS error
interface ArrayConstructor {
    from(arrayLike: any, mapFn?, thisArg?): Array<any>;
}

export const MAX_CHARACTERS = 12;

export function shuffleArray(array: any[] = []): any[] {
    let i = array.length - 1;
    for (; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        const temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
    return array;
}

export function buildRandomCharacters(length: number): string {
    let text = "";
    const possible = "abcdefghijklmnopqrstuvwxyz";

    for( let i=0; i < length; i++ )
        text += possible.charAt(Math.floor(Math.random() * possible.length));

    return text;
}

export function convertStringToArray(value: string): string[] {
    return Array.from(value);
}import { remove, open, readAll } from "deno";
import { assertEqual, test } from "../testing/mod.ts";
import * as log from "./mod.ts";
import { FileHandler } from "./handlers.ts";

// constructor(levelName: string, options: HandlerOptions = {}) {
//   this.level = getLevelByName(levelName);
//   this.levelName = levelName;

//   this.formatter = options.formatter || DEFAULT_FORMATTER;
// }

class TestHandler extends log.handlers.BaseHandler {
  testOutput = "";

  log(msg: string) {
    this.testOutput += `${msg}\n`;
  }
}

test(function testDefaultlogMethods() {
  log.debug("Foobar");
  log.info("Foobar");
  log.warning("Foobar");
  log.error("Foobar");
  log.critical("Foobar");

  const logger = log.getLogger("");
  console.log(logger);
});

test(async function testDefaultFormatter() {
  await log.setup({
    handlers: {
      test: new TestHandler("DEBUG")
    },

    loggers: {
      test: {
        level: "DEBUG",
        handlers: ["test"]
      }
    }
  });

  const logger = log.getLogger("test");
  const handler = log.getHandler("test");
  logger.debug("Hello, world!");
  assertEqual(handler.testOutput, "DEBUG Hello, world!\n");
});

test(async function testFormatterAsString() {
  await log.setup({
    handlers: {
      test: new TestHandler("DEBUG", {
        formatter: "test {levelName} {msg}"
      })
    },

    loggers: {
      test: {
        level: "DEBUG",
        handlers: ["test


 = false
            return field
        }
        if (field == originalText && allowedToPause) {
            ticksToWait = Tick.msToTicks(200)
            return field
        }
        allowedToPause = true
        field = marquify(field)
        return field
    }

    private var allowedToPause = true
    private var ticksToWait = Tick.msToTicks(200)
    private var originalText = _text

    init {
        if (_text.length > getMaxDisplayLength()) {
            text = "$_text " + getSongSeparator()
            originalText = "$_text "
        }
    }

    private fun marquify(text: String): String {
        if (text.length <= getMaxDisplayLength()) {
            return text
        }
        return text.substring(1) + text[0]
    }

    private fun getMaxDisplayLength(): Int {
        return if (preferences.get("songIcon", "true")!!.toBoolean()) 12 else 21
    }

    private fun getSongSeparator(): String {
        return if (preferences.get("songSeparator", "false")!!.toBoolean()) "| " else ""
    }
}import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

fun properties(key: String) = project.findProperty(key).toString()

plugins {
    // Java support
    id("java")
    // Kotlin support
    id("org.jetbrains.kotlin.jvm") version "2.0.10"
    // Gradle IntelliJ Plugin
    id("org.jetbrains.intellij") version "1.13.3"
    // Gradle Changelog Plugin
    id("org.jetbrains.changelog") version "2.2.1"
    // Gradle Qodana Plugin
    id("org.jetbrains.qodana") version "0.1.13"
    id("org.sonarqube") version "6.0.1.5171"

}

group = properties("pluginGroup")
version = properties("pluginVersion")

// Configure project's dependencies
repositories {
    mavenCentral()
}
dependencies {
    implementation("com.taskadapter:trello-java-wrapper:0.14") {
        exclude("org.slf4j", "slf4j-api")
    }
    implementation("org.springframework:spring-web:6.2.5")
    compileOnly("org.projectlombok:lombok:1.18.38")
    implementation("org.mapstruct:mapstruct:1.6.3")
    annotationProcessor("org.projectlombok:lombok:1.18.38")
    annotationProcessor("org.mapstruct:mapstruct-processor:1.6.3")

    testCompileOnly("org.projectlombok:lombok:1.18.38")
    testAnnotationProcessor("org.projectlombok:lombok:1.18.38")
}
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
    pluginName.set(properties("pluginName"))
    version.set(properties("platformVersion"))
    type.set(properties("platformType"))
    downloadSources.set(properties("platformDownloadSources").toBoolean())
    updateSinceUntilBuild.set(true)

    // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
    plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
    version.set(properties("pluginVersion"))
    groups.set(emptyList())
}

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
    cachePath.set(projectDir.resolve(".qodana").canonicalPath)
    reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
    saveReport.set(true)
    showReport.set(System.getenv("QODANA_SHOW_REPORT").toBoolean())
}

tasks {
    // Set the JVM c


ta which latest meta page refers to.
			 */
			meta = mdb_env_pick_meta(env);
			env->me_txns->mti_txnid = meta->mm_txnid;
			/* env is hosed if the dead thread was ours */
			if (env->me_txn) {
				env->me_flags |= MDB_FATAL_ERROR;
				env->me_txn = NULL;
				rc = MDB_PANIC;
			}
		}
		DPRINTF(("%cmutex owner died, %s", (rlocked ? 'r' : 'w'),
			(rc ? "this process' env is hosed" : "recovering")));
		rc2 = mdb_reader_check0(env, rlocked, NULL);
		if (rc2 == 0)
			rc2 = mdb_mutex_consistent(mutex);
		if (rc || (rc = rc2)) {
			DPRINTF(("LOCK_MUTEX recovery failed, %s", mdb_strerror(rc)));
			UNLOCK_MUTEX(mutex);
		}
	} else {
#ifdef _WIN32
		rc = ErrCode();
#endif
		DPRINTF(("LOCK_MUTEX failed, %s", mdb_strerror(rc)));
	}

	return rc;
}
#endif	/* MDB_ROBUST_SUPPORTED */

#if defined(_WIN32)
/** Convert \b src to new wchar_t[] string with room for \b xtra extra chars */
static int ESECT
utf8_to_utf16(const char *src, MDB_name *dst, int xtra)
{
	int rc, need = 0;
	wchar_t *result = NULL;
	for (;;) {					/* malloc result, then fill it in */
		need = MultiByteToWideChar(CP_UTF8, 0, src, -1, result, need);
		if (!need) {
			rc = ErrCode();
			free(result);
			return rc;
		}
		if (!result) {
			result = malloc(sizeof(wchar_t) * (need + xtra));
			if (!result)
				return ENOMEM;
			continue;
		}
		dst->mn_alloced = 1;
		dst->mn_len = need - 1;
		dst->mn_val = result;
		return MDB_SUCCESS;
	}
}
#endif /* defined(_WIN32) */
/** @} */


#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Application.Progress;
using JetBrains.Application.Threading;
using JetBrains.DocumentModel;
using JetBrains.ReSharper.Feature.Services.CodeCleanup;
using JetBrains.ReSharper.Plugins.Unity.Shaders.Resources;
using JetBrains.ReSharper.Plugins.Unity.Shaders.ShaderLab.Psi;
using JetBrains.ReSharper.Plugins.Unity.Shaders.ShaderLab.Psi.Tree;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.CodeStyle;
using JetBrains.ReSharper.Psi.Files;
using JetBrains.ReSharper.Psi.Tree;
using JetBrains.Util;

namespace JetBrains.ReSharper.Plugins.Unity.Shaders.ShaderLab.Feature.Services.Formatting
{
    [CodeCleanupModule]
    public class ShaderLabReformatCode : ICodeCleanupModule
    {
        // Arbitrary order number...
        private static readonly CodeCleanupLanguage ourShaderLabCleanupLanguage = new("ShaderLab", 12);

        private static readonly CodeCleanupSingleOptionDescriptor ourDescriptor =
            new CodeCleanupOptionDescriptor<bool>("ShaderLabReformatCode", ourShaderLabCleanupLanguage,
                CodeCleanupOptionDescriptor.ReformatGroup, displayName: Strings.ReformatCode_Text);

        public ICollection<CodeCleanupOptionDescriptor> Descriptors => new[] { ourDescriptor };

        public PsiLanguageType LanguageType => ShaderLabLanguage.Instance!;

        public bool IsAvailableOnSelection => true;

        public void SetDefaultSetting(CodeCleanupProfile profile, CodeCleanupService.DefaultProfileType profileType)
        {
            switch (profileType)
            {
                case CodeCleanupService.DefaultProfileType.FULL:
                case CodeCleanupService.DefaultProfileType.REFORMAT:
                case CodeCleanupService.DefaultProfileType.CODE_STYLE:
                    profile.SetSetting(ourDescriptor, true);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("profileType");
            }
        }

        public bool IsAvailable(IPsiSourceFile sourceFile)
        {
            return sourceFile.IsLanguageSupported<ShaderLabLanguage>();
        }

        public bool IsAvailable(CodeCleanupProfile profi


 model.eval()  # set model to eval mode
    pbar = tqdm(enumerate(val_loader), total=val_loader.__len__())
    cls_mious = torch.zeros(cfg.shape_classes, dtype=torch.float32).cuda(non_blocking=True)
    cls_nums = torch.zeros(cfg.shape_classes, dtype=torch.int32).cuda(non_blocking=True)
    ins_miou_list, ins_macc_list, ins_mpre_list, ins_mrecall_list = [], [], [], []
    part_iou, part_acc, part_pre, part_recall = [], [], [], []

    # label_size: b, means each sample has one corresponding class
    for idx, data in pbar:
        for key in data.keys():
            data[key] = data[key].cuda(non_blocking=True)
        target = data['y']
        cls = data['cls']
      #  data['x'] = get_features_by_keys(data, cfg.feature_keys)
        batch_size, num_point, _ = data['pos'].size()

        data['pos'] = data['pos'].permute(0,2,1)
        data['x'] = data['x'].permute(0, 2, 1)
        # 在第二个维度上进行拼接
        data_all = torch.cat((data['pos'], data['x']), dim=1)

        label_one_hot = np.zeros((data['cls'].shape[0], 1))
        for idx in range(data['cls'].shape[0]):
            label_one_hot[idx, data['cls'][idx]] = 1
        label_one_hot = torch.from_numpy(label_one_hot.astype(np.float32))
        label_one_hot = label_one_hot.cuda()
        # data['x'] = get_features_by_keys(data, cfg.feature_keys)
        # print(data['x'].shape)
        # print(data['cls'])

        logits = 0
        for v in range(num_votes+1):
            set_random_seed(v)
            if v > 0:
                data_all = data_transform(data_all)
            logits +=  model(data_all, label_one_hot)  # data['pos']  pct,dgcnn,pointnet
            # logits += model(data_all)  # [8,128,4096]   # pointtransformer

        logits /= (num_votes + 1)
        preds = logits.max(dim=1)[1]   #preds即为所求类别
        # print(preds.shape)
        # print(data_all.shape)
        # if cfg.get('refine', False):
        #     part_seg_refinement(preds, data['pos'], data['cls'], cfg.cls2parts, cfg.get('refine_n', 10))
        #     part_seg_refinement(preds, data_all, data['cls'], cfg.cls2parts, cfg.get('refine_n', 10))
        if cfg.criterion_args.NAME != 'MultiShapeCrossEntropy':
            batch_ins_mious,batch_part_iou = get_part_mious(preds, target, data['cls'], cfg.cls2parts)
            batch_ins_macc,batch_part_acc = get_part_acc(preds, target, data['cls'], cfg.cls2parts)
            batch_ins_mpre,batch_part_pre = get_part_pre(preds, target, data['cls'], cfg.cls2parts)
            batch_ins_mrecall,batch_part_recall = get_part_recall(preds, target, data['cls'], cfg.cls2parts)
            ins_miou_list += batch_ins_mious    # IoU
            part_iou.append(batch_part_iou)
            ins_macc_list += batch_ins_macc     # acc
            part_acc.append(batch_part_acc)
            ins_mpre_list += batch_ins_mpre    # pre
            part_pre.append(batch_part_pre)
            ins_mrecall_list += batch_ins_mrecall    # recall
            part_recall.append(batch_part_recall)
            loss = criterion(logits, target)   ##############第2步
        else:
            iou_array = []
            for ib in range(batch_size):
                sl = data['cls'][ib][0]
                iou = get_ins_mious(preds[ib:ib + 1], target[ib:ib + 1], sl.unsqueeze(0), cfg.cls2parts, multihead=True)
                iou_array.append(iou)
            ins_miou_list += iou_array

        loss_meter.update(loss.item(), n=batch_size)  ##############第3步
        # print(loss.item())
        # record_iter_val['loss'].append(loss.item())
        record_iter_val['loss'].append(loss_meter.avg)
        record_iter_val['epoch'].append(epoch)

        # per category iou at each batch_size:
        for shape_idx in range(batch_size):  # sample_idx
            cur_gt_label = int(cls[shape_idx].cpu().numpy())
            # add the iou belongs to this cat
            cls_mious[cur_gt_label] += batch_ins_mious[shape_idx]
            cls_nums[cur_gt_label] += 1

    ins_mious_sum, count = torch.sum(torch.stack(ins_miou_list)), torch.tensor(len(ins_miou_list)).cuda()
    if cfg.distributed:
        dist.all_reduce(cls_mious), dist.all_reduce(cls_nums), dist.all_reduce(ins_mious_sum), dist.all_reduce(count)

    for cat_idx in range(cfg.shape_classes):
        # indicating this cat is included during previous iou appending
        if cls_nums[cat_idx] > 0:
            cls_mious[cat_idx] = cls_mious[cat_idx] / cls_nums[cat_idx]

    part_iou = np.array(part_iou)  # part_iou = 每次迭代中每个类别的iou      # [tot


rt';

part 'login_session_dto.g.dart';

/// LoginSessionDto
///
/// Properties:
/// * [id] - Session primary identifier
/// * [authorizationRequest]
@BuiltValue()
abstract class LoginSessionDto implements Built<LoginSessionDto, LoginSessionDtoBuilder> {
  /// Session primary identifier
  @BuiltValueField(wireName: r'id')
  String get id;

  @BuiltValueField(wireName: r'authorizationRequest')
  LoginSessionDtoAuthorizationRequest get authorizationRequest;

  LoginSessionDto._();

  factory LoginSessionDto([void updates(LoginSessionDtoBuilder b)]) = _$LoginSessionDto;

  @BuiltValueHook(initializeBuilder: true)
  static void _defaults(LoginSessionDtoBuilder b) => b;

  @BuiltValueSerializer(custom: true)
  static Serializer<LoginSessionDto> get serializer => _$LoginSessionDtoSerializer();
}

class _$LoginSessionDtoSerializer implements PrimitiveSerializer<LoginSessionDto> {
  @override
  final Iterable<Type> types = const [LoginSessionDto, _$LoginSessionDto];

  @override
  final String wireName = r'LoginSessionDto';

  Iterable<Object?> _serializeProperties(
    Serializers serializers,
    LoginSessionDto object, {
    FullType specifiedType = FullType.unspecified,
  }) sync* {
    yield r'id';
    yield serializers.serialize(
      object.id,
      specifiedType: const FullType(String),
    );
    yield r'authorizationRequest';
    yield serializers.serialize(
      object.authorizationRequest,
      specifiedType: const FullType(LoginSessionDtoAuthorizationRequest),
    );
  }

  @override
  Object serialize(
    Serializers serializers,
    LoginSessionDto object, {
    FullType specifiedType = FullType.unspecified,
  }) {
    return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
  }

  void _deserializeProperties(
    Serializers serializers,
    Object serialized, {
    FullType specifiedType = FullType.unspecified,
    required List<Object?> serializedList,
    required LoginSessionDtoBuilder result,
    required List<Object?> unhandled,
  }) {
    for (var i = 0; i < serializedList.length; i += 2) {
      final key = serializedList[i] as String;
      final value = serializedList[i + 1];
      switch (key) {
        case r'id':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(String),
          ) as String;
          result.id = valueDes;
          break;
        case r'authorizationRequest':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(LoginSessionDtoAuthorizationRequest),
          ) as LoginSessionDtoAuthorizationRequest;
          result.authorizationRequest.replace(valueDes);
          break;
        default:
          unhandled.add(key);
          unhandled.add(value);
          break;
      }
    }
  }

  @override
  LoginSessionDto deserialize(
    Serializers serializers,
    Object serialized, {
    FullType specifiedType = FullType.unspecified,
  }) {
    final result = LoginSessionDtoBuilder();
    final serializedList = (serialized as Iterable<Object?>).toList();
    final unhandled = <Object?>[];
    _deserializeProperties(
      serializers,
      serialized,
      specifiedType: specifiedType,
      serializedList: serializedList,
      unhandled: unhandled,
      result: result,
    );
    return result.build();
  }
}

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//

// ignore_for_file: unused_element
import 'package:built_collection/built_collection.


.91557],
    'pop': 3388,
    'state': 'WA'
  },
  {
    '_id': '99360',
    'city': 'LOWDEN',
    'loc': [-118.655411, 46.04851],
    'pop': 1234,
    'state': 'WA'
  },
  {
    '_id': '99361',
    'city': 'WAITSBURG',
    'loc': [-118.144734, 46.269092],
    'pop': 2138,
    'state': 'WA'
  },
  {
    '_id': '99362',
    'city': 'WALLA WALLA',
    'loc': [-118.331544, 46.061373],
    'pop': 34993,
    'state': 'WA'
  },
  {
    '_id': '99371',
    'city': 'WASHTUCNA',
    'loc': [-118.286203, 46.820912],
    'pop': 625,
    'state': 'WA'
  },
  {
    '_id': '99401',
    'city': 'ANATONE',
    'loc': [-117.088316, 46.128466],
    'pop': 141,
    'state': 'WA'
  },
  {
    '_id': '99402',
    'city': 'ASOTIN',
    'loc': [-117.001548, 46.134318],
    'pop': 89,
    'state': 'WA'
  },
  {
    '_id': '99403',
    'city': 'CLARKSTON',
    'loc': [-117.064457, 46.394622],
    'pop': 17375,
    'state': 'WA'
  },
  {
    '_id': '99501',
    'city': 'ANCHORAGE',
    'loc': [-149.876077, 61.211571],
    'pop': 14436,
    'state': 'AK'
  },
  {
    '_id': '99502',
    'city': 'ANCHORAGE',
    'loc': [-150.093943, 61.096163],
    'pop': 15891,
    'state': 'AK'
  },
  {
    '_id': '99503',
    'city': 'ANCHORAGE',
    'loc': [-149.893844, 61.189953],
    'pop': 12534,
    'state': 'AK'
  },
  {
    '_id': '99504',
    'city': 'ANCHORAGE',
    'loc': [-149.74467, 61.203696],
    'pop': 32383,
    'state': 'AK'
  },
  {
    '_id': '99505',
    'city': 'FORT RICHARDSON',
    'loc': [-149.675454, 61.275256],
    'pop': 7979,
    'state': 'AK'
  },
  {
    '_id': '99506',
    'city': 'ELMENDORF AFB',
    'loc': [-149.812667, 61.251531],
    'pop': 7907,
    'state': 'AK'
  },
  {
    '_id': '99507',
    'city': 'ANCHORAGE',
    'loc': [-149.828912, 61.153543],
    'pop': 20128,
    'state': 'AK'
  },
  {
    '_id': '99508',
    'city': 'ANCHORAGE',
    'loc': [-149.810085, 61.205959],
    'pop': 29857,
    'state': 'AK'
  },
  {
    '_id': '99515',
    'city': 'ANCHORAGE',
    'loc': [-149.897401, 61.119381],
    'pop': 17094,
    'state': 'AK'
  },
  {
    '_id': '


 =>
      expect(isValueValid(value)).toBe(true));
  });
  ["", null, undefined].forEach((value) => {
    it(`should invalidate '${String(value)}'`, () =>
      expect(isValueValid(value)).toBe(false));
  });
});

describe("buildOrderQuery", () => {
  it("should generate no query for no sortOptions", () => {
    expect(buildOrderQuery()).toEqual("");
  });
  it("should return if no id", () => {
    expect(buildOrderQuery([{}] as any)).toEqual("");
  });
  it("should generate query for one sortOptions element", () => {
    expect(buildOrderQuery([{ id: "column" }])).toEqual("column ASC");
  });
  it("should generate query for one ascending sortOptions element", () => {
    expect(buildOrderQuery([{ id: "column", desc: false }])).toEqual(
      "column ASC",
    );
  });
  it("should generate query for one descending sortOptions element", () => {
    expect(buildOrderQuery([{ id: "column", desc: true }])).toEqual(
      "column DESC",
    );
  });
  it("should generate query for mixed sortOptions elements", () => {
    expect(
      buildOrderQuery([
        { id: "column1" },
        { id: "column2", desc: false },
        { id: "column3", desc: true },
      ]),
    ).toEqual("column1 ASC, column2 ASC, column3 DESC");
  });
});

let block = false

window.addEventListener("message", ({data}) => {
  if (data.type === "YS_BLOCK_QUALITY_CHANGE") {
    block = true
  } else if (data.type === "YS_UNBLOCK_QUALITY_CHANGE") {
    block = false
  }
})

let ogSetItem = localStorage.setItem
localStorage.setItem = function(...args: any[]) {
  const key = args[0]
  if (block && key && key.toLowerCase() === "yt-player-quality") {
    return
  }

  return ogSetItem.apply(this, args)
}
interface Movie {
  id: string;
  title: string;
  rating: number;
}

/**
 * Sample array with movies
 */
let movies: Array<Movie> = [
  {
    id: "1",
    title: "TENET",
    rating: 10,
  },
  {
    id: "2",
    title: "No Time to Die",
    rating: 8,
  },
  {
    id: "3",
    title: "The Way Back",
    rating: 7,
  },
  {
    id: "4",
    title: "The Invisible Man",
    rating: 9,
  },
  {
    id: "5",
    title: "Onward",
    rating: 8,
  },
];

/**
 * Returns all the movies in database
 */
const getMovies = ({ response }: { response: any }) => {
  response.body = movies;
};

/**
 * Returns a movie by id
 */
const getMovie = ({
  params,
  response,
}: {
  params: { id: string };
  response: any;
}) => {
  const movie = movies.filter((movie) => movie.id == params.id)[0];
  if (movie) {
    response.status = 200;
    response.body = movie;
  } else {
    response.status = 404;
    response.body = { message: "404 Not found" };
  }
};

/**
 * Creates a new movie
 */
const createMovie = async ({
  request,
  response,
}: {
  request: any;
  response: any;
}) => {
  const body = await request.body();
  const movie: Movie = body.value;
  movies.push(movie);
  response.body = { success: true, data: movie };
  response.status = 201;
};

/**
 * Updates an existing movie
 */
const updateMovie = async ({


llTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp)
  final DateTime afterLastTakenDate;

  /// 変更前の最終服用ピル番号（非推奨）
  /// 服用記録前のピル番号
  @override
  final int beforeLastTakenPillNumber;

  /// 変更後の最終服用ピル番号（非推奨）
  /// 服用記録後のピル番号
  @override
  final int afterLastTakenPillNumber;

  @override
  String toString() {
    return 'TakenPillValue(isQuickRecord: $isQuickRecord, edited: $edited, beforeLastTakenDate: $beforeLastTakenDate, afterLastTakenDate: $afterLastTakenDate, beforeLastTakenPillNumber: $beforeLastTakenPillNumber, afterLastTakenPillNumber: $afterLastTakenPillNumber)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$TakenPillValueImpl &&
            (identical(other.isQuickRecord, isQuickRecord) || other.isQuickRecord == isQuickRecord) &&
            (identical(other.edited, edited) || other.edited == edited) &&
            (identical(other.beforeLastTakenDate, beforeLastTakenDate) || other.beforeLastTakenDate == beforeLastTakenDate) &&
            (identical(other.afterLastTakenDate, afterLastTakenDate) || other.afterLastTakenDate == afterLastTakenDate) &&
            (identical(other.beforeLastTakenPillNumber, beforeLastTakenPillNumber) || other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) &&
            (identical(other.afterLastTakenPillNumber, afterLastTakenPillNumber) || other.afterLastTakenPillNumber == afterLastTakenPillNumber));
  }

  @JsonKey(ignore: true)
  @override
  int get hashCode =>
      Object.hash(runtimeType, isQuickRecord, edited, beforeLastTakenDate, afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$TakenPillValueImplCopyWith<_$TakenPillValueImpl> get copyWith => __$$TakenPillValueImplCopyWithImpl<_$TakenPillValueImpl>(this, _$identity);

  @override
  Map<String, dynamic> toJson() {
    return _$$TakenPillValueImplToJson(
      this,
    );
  }
}

abstract class _TakenPillValue extends TakenPillValue {
  const factory _TakenPillValue(
      {final bool? isQuickRecord,
      final TakenPillEditedValue? edited,
      @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate,
      @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp)
      required final DateTime afterLastTakenDate,
      required final int beforeLastTakenPillNumber,
      required final int afterLastTakenPillNumber}) = _$TakenPillValueImpl;
  const _TakenPillValue._() : super._();

  factory _TakenPillValue.fromJson(Map<String, dynamic> json) = _$TakenPillValueImpl.fromJson;

  @override // ============ BEGIN: Added since v1 ============
  /// クイック記録かどうかのフラグ（v1追加）
  /// nullは途中から追加されたプロパティのため判定不能を表す
// null => 途中から追加


finite;
  animation: blink 1.06s steps(1) infinite;
}
.cm-animate-fat-cursor {
  width: auto;
  border: 0;
  -webkit-animation: blink 1.06s steps(1) infinite;
  -moz-animation: blink 1.06s steps(1) infinite;
  animation: blink 1.06s steps(1) infinite;
  background-color: #7e7;
}
@-moz-keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}
@-webkit-keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}
@keyframes blink {
  0% {}
  50% { background-color: transparent; }
  100% {}
}

/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite .CodeMirror-cursor {}

.cm-tab { display: inline-block; text-decoration: inherit; }

.CodeMirror-rulers {
  position: absolute;
  left: 0; right: 0; top: -50px; bottom: -20px;
  overflow: hidden;
}
.CodeMirror-ruler {
  border-left: 1px solid #ccc;
  top: 0; bottom: 0;
  position: absolute;
}

/* DEFAULT THEME */

.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}

.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}

.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}

.CodeMirror-composing { border-bottom: 2px solid; }

/* Default styles for common addons */

div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}

/* STOP */

/* The rest of this file contains styles related to the mechanics of
   the editor. You probably shouldn't touch them. */

.CodeMirror {
  position: relative;
  overflow: hidden;


bl_804E64F4:
/* 804E64F4 004E1A34  38 09 00 01 */	addi r0, r9, 1
/* 804E64F8 004E1A38  1C 00 00 0C */	mulli r0, r0, 0xc
/* 804E64FC 004E1A3C  7C 7E 02 14 */	add r3, r30, r0
/* 804E6500 004E1A40  38 03 00 1C */	addi r0, r3, 0x1c
lbl_804E6504:
/* 804E6504 004E1A44  35 29 00 01 */	addic. r9, r9, 1
/* 804E6508 004E1A48  90 05 00 24 */	stw r0, 0x24(r5)
/* 804E650C 004E1A4C  20 09 00 05 */	subfic r0, r9, 5
/* 804E6510 004E1A50  1C 00 00 60 */	mulli r0, r0, 0x60
/* 804E6514 004E1A54  7C 7E 02 14 */	add r3, r30, r0
/* 804E6518 004E1A58  38 03 04 A4 */	addi r0, r3, 0x4a4
/* 804E651C 004E1A5C  90 05 00 28 */	stw r0, 0x28(r5)
/* 804E6520 004E1A60  40 82 00 0C */	bne lbl_804E652C
/* 804E6524 004E1A64  38 00 00 00 */	li r0, 0
/* 804E6528 004E1A68  48 00 00 14 */	b lbl_804E653C
lbl_804E652C:
/* 804E652C 004E1A6C  38 09 FF FF */	addi r0, r9, -1
/* 804E6530 004E1A70  1C 00 00 0C */	mulli r0, r0, 0xc
/* 804E6534 004E1A74  7C 7E 02 14 */	add r3, r30, r0
/* 804E6538 004E1A78  38 03 00 1C */	addi r0, r3, 0x1c
lbl_804E653C:
/* 804E653C 004E1A7C  2C 09 00 05 */	cmpwi r9, 5
/* 804E6540 004E1A80  90 05 00 2C */	stw r0, 0x2c(r5)
/* 804E6544 004E1A84  40 82 00 0C */	bne lbl_804E6550
/* 804E6548 004E1A88  38 00 00 00 */	li r0, 0
/* 804E654C 004E1A8C  48 00 00 14 */	b lbl_804E6560
lbl_804E6550:
/* 804E6550 004E1A90  38 09 00 01 */	addi r0, r9, 1
/* 804E6554 004E1A94  1C 00 00 0C */	mulli r0, r0, 0xc
/* 804E6558 004E1A98  7C 7E 02 14 */	add r3, r30, r0
/* 804E655C 004E1A9C  38 03 00 1C */	addi r0, r3, 0x1c
lbl_804E6560:
/* 804E6560 004E1AA0  90 05 00 30 */	stw r0, 0x30(r5)
/* 804E6564 004E1AA4  38 A5 00 18 */	addi r5, r5, 0x18
/* 804E6568 004E1AA8  39 29 00 01 */	addi r9, r9, 1
/* 804E656C 004E1AAC  42


Test fun testTwoJavaEightTwoJs() = testClass(Params(clazz = Java8Test2::class.java, minimize = false, log = false))

	@Test fun testURLEncoderDecoder() = testClass(Params(clazz = URLEncoderDecoderTest::class.java, minimize = false, log = false, treeShaking = true))

	//@Test fun testIssue100Double() = testClass(Params(clazz = Issue100Double::class.java, minimize = true, log = false, treeShaking = true))
	@Test fun testIssue100Double() = testClass(Params(clazz = Issue100Double::class.java, minimize = false, log = false, treeShaking = true))

	//@Ignore@Test fun testIssue105() = testClass(Params(clazz = Issue105::class.java, minimize = false, log = false, treeShaking = true))

	@Test fun testExtendedCharsets() = testClass(Params(clazz = ExtendedCharsetsTest::class.java, minimize = false, log = false, treeShaking = true))

	@Test fun testMessageDigestTest() = testClass(Params(clazz = MessageDigestTest::class.java, minimize = false, log = false, treeShaking = true))

	//@Test fun testMicroHelloWorldAsm2() = testClass<MicroHelloWorld>(minimize = false, log = false, treeShaking = true, backend = BuildBackend.ASM2)
	//@Test fun testMicroHelloWorldAsm2() = testClass<MicroHelloWorld>(minimize = false, log = false, treeShaking = true, backend = BuildBackend.ASM2)
	//@Test fun testMicroHelloWorldAsm2() = testClass<HelloWorldTest>(minimize = false, log = false, treeShaking = true, backend = BuildBackend.ASM2)
	//@Test fun testMicroHelloWorldAsm2() = testClass<BenchmarkTest>(minimize = false, log = false, treeShaking = true, backend = BuildBackend.ASM2)

	@Test fun testMicroStaticInitTest() = testClass(Params(clazz = StaticInitTest::class.java, minimize = false, log = false, backend = BuildBackend.ASM, treeShaking = true))

	@Test fun testMicroStaticInitTest2() = testClass(Params(clazz = StaticInitTest2::class.java, minimize = false, log = false, backend = BuildBackend.ASM, treeShaking = true))

	@Test fun testHelloWorld() = testClass(Params(clazz = HelloWorldTest::class.java, minimize = false, log = false))
	@Test fun testBenchmarkTest() = testClass(Params(clazz = BenchmarkTest::class.java, minimize = false, log = false))

	@Test fun testServiceLoaderTest() = testNativeClass(Params(clazz = ServiceLoaderTest::class.java, minimize = false, configureInjector = {
            mapInstance(ConfigServiceLoader(
                classesToSkip = listOf(
                    TestServiceJs2::class.java.name
                )
            ))
        }), """
            TestServiceImpl1.test:ss
            TestServiceJs10
        """)

	@Test fun nativeJsTest() = testNativeClass(Params(clazz = JTranscJsNativeMixedTest::class.java, minimize = false, treeShaking = true), """
		17
		-333
		Services:
		testservice.TestServiceImpl1
		TestServiceImpl1.test:ss
		/Services:
		2
		hello
		world
		10
		jtransc_jtransc_JTranscInternalNamesTest
		main([Ljava/lang/String;)V
		___hello
		Error !(10 < 10)
		ok
		JTranscReinterpretArrays:
		MethodBodyReferencesTestJs:true
		MethodBodyReferencesTestCpp:false
		MethodBodyReferencesTestJvm:false
		OK!
		MixedJsKotlin.main[1]
		MixedJsKotlin.main[2]
		[ 1, 2, 3 ]
		<Buffer 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f>
		{"


n false
	end

	if target.itemid == 15796 or target.itemid == 15712 then
		player:setStorageValue(Storage.Quest.U9_60.BigfootsBurden.RepairedCrystalCount, repairedCount + 1)
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have repaired a damaged crystal!")
		addEvent(returnCrystal, math.random(50, 140) * 1000, toPosition, target.itemid)
		target:transform(15800)
		toPosition:sendMagicEffect(CONST_ME_ENERGYAREA)
	else
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This is no damaged crystal!")
	end
	return true
end

bigfootCrystal:id(15703)
bigfootCrystal:register()


0.01 GOTO 10 (Error 3)
;	ON 255.5 GOTO 10 (Error 3)
;	ON 32768 GOTO 10 (Error 7)
;	ON 65536 GOTO 10 (Error 3)
;	ON 0 GOTO 1/0 (Continues execution)
;	ON 2 GOTO 1/0 (Error 11)
;	ON 1 GOTO 10,1/0 (Jumps to line 10)
;
.proc stOn
_index = stScratch
		;fetch and convert the selection value
		jsr		ExprEvalPopIntPos

		;issue error 3 if value is greater than 255
		bne		stErrorValueError

		;exit immediately if index is zero
		txa
		beq		xit
		sta		_index

		;next token should be GOTO or GOSUB
		jsr		ExecGetComma

		;save GOTO/GOSUB token
		pha

count_loop:
		;check if it's time to branch
		dec		_index
		beq		do_branch

		;evaluate a line number
		jsr		ExprEvalPopIntPos

		;read next token and check if it is a comma
		jsr		ExecGetComma
		beq		count_loop

		;out of line numbers -- continue with next statement
		pla
xit:
		rts

do_branch:
		;check if we should do GOTO or GOSUB
		pla
		lsr
		bcs		stGoto

		;!! fall through to stGosub!
.endp

stGosub:
		;push gosub frame
		;##TRACE "Pushing GOSUB frame: $%04x+$%02x" dw(stmcur) db(exLineOffset)
		lda		#4
		jsr		ExecCheckStack
		lda		#0
		tay
		jsr		stFor.push_frame

		;fall through

.proc stGoto
		;get line number
		jsr		ExprEvalPopIntPos
gotoFR0Int:
		jsr		exFindLineInt
		bcc		not_found
		sta		stmcur
		sty		stmcur+1

		;jump to it
		pla
		pla
		jmp		exec.new_line

not_found:
		jmp		errorLineNotFound
.endp

;===========================================================================
stGoto2 = stGoto

;===========================================================================
stBye = ReturnToDOS

;===========================================================================
; CONT
;
; Resumes execution from the last stop or error point.
;
; Quirks:
;	- The documentation says that CONT resumes execution at the next lineno,
;	  but this is incorrect. Instead, Atari BASIC appears to do an insertion
;	  search for the stop line itself, then skip to the end of that line.
;	  This means that if the stop line is deleted, execution will resume at
;	  the line AFTER the next line.
;
.proc stCont
		;check if we are executing the immediate mode line
		ldy		#1
		lda		(stmcur),y

		;if we aren't (deferred mode), it's a no-op
		bpl		stPosition.xit

		;bail if stop line is >=32K
		ldx		stopln
		lda		stopln+1
		bmi		stGoto.not_found

		;search for the stop line -- okay if this fails
		jsr		exFindLineInt

		;jump to that line
		sta		stmcur
		sty		stmcur+1

		;warp to end of line and continue execution
		jmp		exec.next_line
.endp

;===========================================================================
stSetupCommandXY = stPosition
.proc stPosition
		;evaluate X
		jsr		evaluateInt
		pha					;push X high
		txa
		pha					;push X low

		;skip comma and evaluate Y
		jsr		ExprSkipCommaAndEvalPopIntPos
		bne		stErrorValueError

		;position at (X,Y)
		;stx		rowcrs
		pla
		;sta		colcrs
		pla
		;sta		colcrs+1


。党是从两条路线的斗争中得到发展的，毛主席的路线是经过斗争得到发展的。现在上千万人在串联，到北京来了几百万人，有的来过几次，这就没法统计了。原来想分期分批地来，现在都打破了。这么大的运动也不能下框框，很多问题群众在串联中能解决。天南地北，从哈尔滨到海南岛，在群众大串联中互相学习，互相支持，在大规模的群众运动中解决。

   全国性的红卫兵组织的成立，我们要考虑，我看条件不够成熟。

   串联的单位今天可能是左派，在大动荡中青年也允许犯错误，观点也可以改变。大动荡中建立这样的组织，有非常不稳定的可能性。现在你们要做艰苦，细致，踏踏实实的工作，不能满足于少数派，过去你们被斗是光荣的。在革命运动中如何把左派组织起来，团结大多数，这是一个很困难的工作。不是讲话，发通告能够解决的。现在就缺少艰苦，细致的工作。共青团中央为什么到现在还没有改组呢？还要看一看，因斗争在发展中变化很大，组织问题放在后期比较好。现在不要急於建立全国性红卫兵组织。

   国际红卫兵中国支队实际上还是中国的，别的国家也不可能马上成立红卫兵组织，日本出现一股，很快就被扑灭了。墨西哥也出现一股，很快就被抓进监狱。说明中国红卫兵在世界上影响很大，但在全世界还要有一个过程。

   戚本禹讲话：

   大方向是对的，潮流所趋，红卫兵是否代替共青团还得考虑。红卫兵全国组织是一种趋势，将来总会建立的，这是大事情，非常严肃的事情，全国红卫兵的大事，对整个世界震动很大。因此这么大的组织不能仓促成立，要做很多工作。

   国际红卫兵中国支队，主席不能做你们的统帅，这不是小孩闹着玩的事情，牵涉到国际关系……你们国际红卫兵中国支队发了大字报，外国人都很感兴趣。我们俩人建议你们不要用这个旗号打出去，打出去反而对人家国家的红卫兵斗争不利。日本出现了，被抓了，就搞秘密组织，抓是抓不尽的，革命的大火是扑不灭的。你们搞国际红卫兵中国支队有联系可以抓，这样好心变成坏事，对外国（革命）并不有利。

   红卫兵全国性组织，将来是要成立的，但要经过一定时期。文化革命运动，要经过一定的阶段，大动荡，大分化，比较稳定的时期……你们要成立，不要比建立全国性的组织，要比做踏实细致的工作。现在不要急於成立这样的组织，到时候你们不成立也不行，那时候我们再听听你们的意见。


            </form>

{/block}<!DOCTYPE html><meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
<title><?php echo sysconfig('CMS_SEOTITLE'); ?></title>
<meta name="keywords" content="<?php echo sysconfig('CMS_KEYWORDS'); ?>" /><meta name="description" content="<?php echo sysconfig('CMS_DESCRIPTION'); ?>" />
<link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/wap/weui.min.css"/>
<link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/wap/style.css"/>

<?php echo sysconfig('CMS_COMPANY_NAME'); ?>

<?php echo sysconfig('CMS_COMPANY_CONTACT'); ?>

                联系人：范例

                联系方式：<?php echo sysconfig('CMS_COMPANY_CONTACT'); ?>

                电子邮箱：277023115@qq.com

                微信号：jkui2012

                QQ：277023115</spa


.New("Unable to find GnbPDUSession ID " + string(pduSessionid))
	}
	pduSession := ue.PduSession[pduSessionid-1]
	close(pduSession.Wait)
	stopSignal := pduSession.GetStopSignal()
	if stopSignal != nil {
		stopSignal <- true
	}
	ue.PduSession[pduSessionid-1] = nil
	return nil
}

func (pduSession *UEPDUSession) SetIp(ip [12]uint8) {
	pduSession.ueIP = fmt.Sprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3])
}

func (pduSession *UEPDUSession) GetIp() string {
	return pduSession.ueIP
}

func (pduSession *UEPDUSession) SetGnbIp(ip netip.Addr) {
	pduSession.ueGnbIP = ip
}

func (pduSession *UEPDUSession) GetGnbIp() netip.Addr {
	return pduSession.ueGnbIP
}

func (pduSession *UEPDUSession) SetStopSignal(stopSignal chan bool) {
	pduSession.stopSignal = stopSignal
}

func (pduSession *UEPDUSession) GetStopSignal() chan bool {
	return pduSession.stopSignal
}

func (pduSession *UEPDUSession) GetPduSesssionId() uint8 {
	return pduSession.Id
}

func (pduSession *UEPDUSession) SetTunInterface(tun netlink.Link) {
	pduSession.tun = tun
}

func (pduSession *UEPDUSession) GetTunInterface() netlink.Link {
	return pduSession.tun
}

func (pduSession *UEPDUSession) SetTunRule(rule *netlink.Rule) {
	pduSession.rule = rule
}

func (pduSession *UEPDUSession) GetTunRule() *netlink.Rule {
	return pduSession.rule
}

func (pduSession *UEPDUSession) SetTunRoute(route *netlink.Route) {
	pduSession.routeTun = route
}

func (pduSession *UEPDUSession) GetTunRoute() *netlink.Route {
	return pduSession.routeTun
}

func (pduSession *UEPDUSession) SetVrfDevice(vrf *netlink.Vrf) {
	pduSession.vrf = vrf
}

func (pduSession *UEPDUSession) GetVrfDevice() *netlink.Vrf {
	return pduSession.vrf
}

func (pdu *UEPDUSession) SetStateSM_PDU_SESSION_INACTIVE() {
	pdu.StateSM = SM5G_PDU_SESSION_INACTIVE
}

func (pdu *UEPDUSession) SetStateSM_PDU_SESSION_ACTIVE() {
	pdu.StateSM = SM5G_PDU_SESSION_ACTIVE
}

func (pdu *UEPDUSession) SetStateSM_PDU_SESSION_PENDING() {
	pdu.StateSM = SM5G_PDU_SESSION_ACTIVE_PENDING
}

func (pduSession *UEPDUSession) GetStateSM() int {
	return pduSession.StateSM
}

func (ue *UEContext) deriveSNN() string {
	// 5G:mnc093.mcc208.3gppnetwork.org
	var resu string
	if len(ue.amfInfo.mnc) == 2 {
		resu = "5G:mnc0" + ue.amfInfo.mnc + ".mcc" + ue.amfInfo.mcc + ".3gppnetwork.org"
	} else {
		resu = "5G:mnc" + ue.amfInfo.mnc + ".mcc" + ue.amfInfo.mcc + ".3gppnetwork.org"
	}
	return resu
}

func (ue *UEContext) GetUeSecurityCapability() *nasType.UESecurityCapability {
	return ue.UeSecurity.UeSecurityCapability
}

func (ue *UEConte


fcPlcupcRgbuse);
        LittleEndian.putInt(data, 0x326 + offset, field_217_lcbPlcupcRgbuse);
        LittleEndian.putInt(data, 0x32a + offset, field_218_fcPlcupcUsp);
        LittleEndian.putInt(data, 0x32e + offset, field_219_lcbPlcupcUsp);
        LittleEndian.putInt(data, 0x332 + offset, field_220_fcSttbGlsyStyle);
        LittleEndian.putInt(data, 0x336 + offset, field_221_lcbSttbGlsyStyle);
        LittleEndian.putInt(data, 0x33a + offset, field_222_fcPlgosl);
        LittleEndian.putInt(data, 0x33e + offset, field_223_lcbPlgosl);
        LittleEndian.putInt(data, 0x342 + offset, field_224_fcPlcocx);
        LittleEndian.putInt(data, 0x346 + offset, field_225_lcbPlcocx);
        LittleEndian.putInt(data, 0x34a + offset, field_226_fcPlcfbteLvc);
        LittleEndian.putInt(data, 0x34e + offset, field_227_lcbPlcfbteLvc);
        LittleEndian.putInt(data, 0x352 + offset, field_228_dwLowDateTime);
        LittleEndian.putInt(data, 0x356 + offset, field_229_dwHighDateTime);
        LittleEndian.putInt(data, 0x35a + offset, field_230_fcPlcflvc);
        LittleEndian.putInt(data, 0x35e + offset, field_231_lcbPlcflvc);
        LittleEndian.putInt(data, 0x362 + offset, field_232_fcPlcasumy);
        LittleEndian.putInt(data, 0x366 + offset, field_233_lcbPlcasumy);
        LittleEndian.putInt(data, 0x36a + offset, field_234_fcPlcfgram);
        LittleEndian.putInt(data, 0x36e + offset, field_235_lcbPlcfgram);
        LittleEndian.putInt(data, 0x372 + offset, field_236_fcSttbListNames);
        LittleEndian.putInt(data, 0x376 + offset, field_237_lcbSttbListNames);
        LittleEndian.putInt(data, 0x37a + offset, field_238_fcSttbfUssr);
        LittleEndian.putInt(data, 0x37e + offset, field_239_lcbSttbfUssr);
    }

    public String toString()
    {
        StringBuffer buffer = new StringBuffer();

        buffer.append("[FIB]\n");

        buffer.append("    .wIdent               = ");
        buffer.append(HexDump.intToHex(getWIdent()));
        buffer.append(" (").append(getWIdent()).append(" )\n");

        buffer.append("    .nFib                 = ");
        buffer.append(HexDump.intToHex(getNFib()));
        buffer.append(" (").append(getNFib()).append(" )\n");

        buffer.append("    .nProduct             = ");
        buffer.append(HexDump.intToHex(getNProduct()));
        buffer.append(" (").append(getNProduct()).append(" )\n");

        buffer.append("    .lid                  = ");
        buffer.append(HexDump.intToHex(getLid()));
        buffer.append(" (").append(getLid()).append(" )\n");

        buffer.append("    .pnNext               = ");
        buffer.append(HexDump.intToHex(getPnNext()));
        buffer.append(" ("