/* mpsw3.h: RAVENBROOK MEMORY POOL SYSTEM C INTERFACE, WINDOWS PART
 *
 * $Id: //info.ravenbrook.com/project/mps/version/1.113/code/mpsw3.h#1 $
 * Copyright (c) 2001 Ravenbrook Limited.  See end of file for license.
 *
 * .readership: customers, MPS developers.
 * .sources: <design/interface-c/>.
 */

#ifndef mpsw3_h
#define mpsw3_h

#include "mps.h"               /* needed for mps_tramp_t */
#include <windows.h>           /* needed for SEH filter */

extern LONG mps_SEH_filter(LPEXCEPTION_POINTERS, void **, size_t *);
extern void mps_SEH_handler(void *, size_t);

#define mps_tramp(r_o, f, p, s) \
  MPS_BEGIN \
    void **_r_o = (r_o); \
    mps_tramp_t _f = (f); \
    void *_p = (p); \
    size_t _s = (s); \
    void *_hp = NULL; size_t _hs = 0; \
    __try { \
      *_r_o = (*_f)(_p, _s); \
    } __except(mps_SEH_filter(GetExceptionInformation(), \
               &_hp, &_hs)) { \
      mps_SEH_handler(_hp, _hs); \
    } \
  MPS_END

#endif /* mpsw3_h */

/* C. COPYRIGHT AND LICENSE
 *
 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
 * All rights reserved.  This is an open source license.  Contact
 * Ravenbrook for commercial licensing options.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 *
 * 3. Redistributions in any form must be accompanied by information on how
 * to obtain complete source code for this software and any accompanying
 * software that uses this software.  The source code must either be
 * included in the distribution or be available for no more than the cost
 * of distribution plus a nominal fee, and must be freely redistributable
 * under reasonable conditions.  For an executable file, complete source
 * code means the source code for all modules it contains. It does not
 * include source code for modules or files that typically accompany the
 * major components of the operating system on which the executable file
 * runs.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


7c6f64;}
.cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; }
.cm-s-gruvbox-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #8e8d8875 !important; }
.cm-s-gruvbox-dark .cm-animate-fat-cursor { background-color: #8e8d8875 !important; }
.cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; }
.cm-s-gruvbox-dark span.cm-meta { color: #83a598; }

.cm-s-gruvbox-dark span.cm-comment { color: #928374; }
.cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; }
.cm-s-gruvbox-dark span.cm-keyword { color: #f84934; }

.cm-s-gruvbox-dark span.cm-variable { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-variable-2 { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: #fabd2f; }
.cm-s-gruvbox-dark span.cm-operator { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-callee { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-def { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-property { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-string { color: #b8bb26; }
.cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; }
.cm-s-gruvbox-dark span.cm-qualifier { color: #8ec07c; }
.cm-s-gruvbox-dark span.cm-attribute { color: #8ec07c; }

.cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; }
.cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; }

.cm-s-gruvbox-dark span.cm-builtin { color: #fe8019; }
.cm-s-gruvbox-dark span.cm-tag { color: #fe8019; }
/* Loosely based on the Midnight Textmate theme */

.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-night div.CodeMirror-selected { background: #447; }
.cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); }
.cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); }
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-night .CodeMirror-guttermarker { color: white; }
.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; }
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white; }

.cm-s-night span.cm-comment { co


/gpt-5_prompting_guide
- Added At: 2025-08-09 07:24:06
- [Link To Text](2025-08-09-gpt-5-prompting-guide-openai-cookbook_raw.md)

## TL;DR

GPT-5通过精细参数调校（如推理努力分级、工具前缀设计）和API优化（响应API提升效率），在代理任务、编码能力及可控性上显著提升。需明确任务边界、采用结构化工具流程，并结合生产环境调优（如Cursor案例），同时避免矛盾指令并强化伦理安全，最终依赖精准提示工程实现高效可控的人工智能应用。

## Summary

GPT-5是OpenAI推出的旗舰模型，显著提升了代理任务处理、编码能力、原始智能和可控性。以下为使用指南核心要点：

---

### **代理任务调校**
- **控制主动性**：
  - **减少主动性**：调整`reasoning_effort`为低或中档，定义清晰的探索边界（如限制工具调用次数），使用提示示例如`Early stop criteria`避免冗长推理。极端场景可设固定工具预算（如最多2次调用）。
  - **增加主动性**：提升`reasoning_effort`，使用提示如`保持任务完成直至解决`，禁止因不确定性终止任务，自主推断合理假设继续执行。

- **工具前缀（Tool Preambles）**：
  - 设计清晰的工具调用前缀，例如：
    - 重述用户目标 → 制定结构化计划 → 逐步执行并更新进度 → 总结成果。
  - 通过API参数控制前缀详细程度，提升用户对代理任务的理解与互动体验。

---

### **推理与API优化**
- **推理努力（Reasoning Effort）分级**：
  - `minimal`：低延迟，适合简单任务；需清晰提示规划步骤，防止任务中途终止。
  - `medium/high`：复杂任务推荐，确保多步骤推理连贯性。

- **响应API（Responses API）**：
  - 核心优势：保留历史推理上下文，减少重复计划构建，降低成本和延迟。
  - 实际效果：零售基准测试中性能提升超4%（Tau-Bench评分从73.9%至78.2%）。

---

### **编码与前端开发**
- **前端


* Process attribute to generate an accessor
		 * @param  {BufferAttribute} attribute Attribute to process
		 * @param  {BufferGeometry} geometry (Optional) Geometry used for truncated draw range
		 * @param  {Integer} start (Optional)
		 * @param  {Integer} count (Optional)
		 * @return {Integer}           Index of the processed accessor on the "accessors" array
		 */
		function processAccessor( attribute, geometry, start, count ) {

			var types = {

				1: 'SCALAR',
				2: 'VEC2',
				3: 'VEC3',
				4: 'VEC4',
				16: 'MAT4'

			};

			var componentType;

			// Detect the component type of the attribute array (float, uint or ushort)
			if ( attribute.array.constructor === Float32Array ) {

				componentType = WEBGL_CONSTANTS.FLOAT;

			} else if ( attribute.array.constructor === Uint32Array ) {

				componentType = WEBGL_CONSTANTS.UNSIGNED_INT;

			} else if ( attribute.array.constructor === Uint16Array ) {

				componentType = WEBGL_CONSTANTS.UNSIGNED_SHORT;

			} else if ( attribute.array.constructor === Uint8Array ) {

				componentType = WEBGL_CONSTANTS.UNSIGNED_BYTE;

			} else {

				throw new Error( 'THREE.GLTFExporter: Unsupported bufferAttribute component type.' );

			}

			if ( start === undefined ) start = 0;
			if ( count === undefined ) count = attribute.count;

			// @TODO Indexed buffer geometry with drawRange not supported yet
			if ( options.truncateDrawRange && geometry !== undefined && geometry.index === null ) {

				var end = start + count;
				var end2 = geometry.drawRange.count === Infinity
					? attribute.count
					: geometry.drawRange.start + geometry.drawRange.count;

				start = Math.max( start, geometry.drawRange.start );
				count = Math.min( end, end2 ) - start;

				if ( count < 0 ) count = 0;

			}

			// Skip creating an accessor if the attribute doesn't have data to export
			if ( count === 0 ) {

				return null;

			}

			var minMax = getMinMax( attribute, start, count );

			var bufferViewTarget;

			// If geometry isn't provided, don't infer the target usage of the bufferView. For
			// animation samplers, target must not be set.
			if ( geometry !== undefined ) {

				bufferViewTarget = attribute === geometry.index ? WEBGL_CONSTANTS.ELEMENT_ARRAY_BUFFER : WEBGL_CONSTANTS.ARRAY_BUFFER;

			}

			var bufferView = processBufferView( attribute, componentType, start, count, bufferViewTarget );

			var gltfAccessor = {

				bufferView: bufferView.id,
				byteOffset: bufferView.byteOffset,
				componentType: componentType,
				count: count,
				max: minMax.max,
				min: minMax.min,
				type: types[ attribute.itemSize ]

			};

			if ( attribute.normalized === true ) {

				gltfAccessor.normalized = true;

			}

			if ( ! outputJSON.accessors ) {

				outputJSON.accessors = [];

			}

			outputJSON.accessors.push( gltfAccessor );

			return outputJSON.accessors.length - 1;

		}

		/**
		 * Process image
		 * @param  {Image} image to process
		 * @param  {Integer} format of the image (e.g. THREE.RGBFormat, RGBAFormat etc)
		 * @param  {Boolean} flipY before writing out the image
		 * @return {Integer}     Index of the processed texture in the "images" array
		 */
		function processImage( image, format, flipY ) {

			if ( ! cachedData.images.has( image ) ) {

				cachedData.images.set( image, {} );

			}

			var cachedImages = cachedData.images.get( image );
			var mimeType = format === RGBAFormat ?


Text()}
            ||${generatedDefinitions.asFile.readText()}
        """.trimMargin("||")

        generatedDefinitions.asFile.writeText(resultDefinitions)
    }
    dependsOn(tasks.named("jsProductionExecutableCompileSync"))
}

val npmPublish = NodeJsExec.register(
    compilation = kotlin.js().compilations.getByName(MAIN_COMPILATION_NAME),
    name = "npmPublish",
) {
    val npmAuthToken: String? by project

    group = "publishing"
    args("--run", "distribute", "--", "--//registry.npmjs.org/:_authToken=$npmAuthToken")
    dependsOn(
        copyNpmResources,
        prepareTypeScriptDefinitions,
        tasks.build,
    )
}

val File.posixPath
    get() = path.replace('\\', '/')
package io.github.sgrishchenko.karakum.util

import js.array.*

private class DeepMapEntry<K, V> {
    var value: V? = null
    var isInitialized = false
    val children = mutableMapOf<K, DeepMapEntry<K, V>>()

    fun entries(prefix: ReadonlyArray<K>): ReadonlyArray<Tuple2<ReadonlyArray<K>, V>> {
        val children = children.flatMap { (key, value) ->
            value.entries(prefix + key).asIterable()
        }.toTypedArray()

        if (isInitialized) {
            @Suppress("UNCHECKED_CAST")
            val current = tupleOf(prefix, value as V)
            return arrayOf(current) + children
        } else {
            return children
        }
    }

    fun keys(prefix: ReadonlyArray<K>): ReadonlyArray<ReadonlyArray<K>> {
        return entries(prefix).map { (key) -> key }.toTypedArray()
    }

    fun values(prefix: ReadonlyArray<K>): ReadonlyArray<V> {
        return entries(prefix).map { (_, value) -> value }.toTypedArray()
    }
}

@JsExport
class DeepMap<K, V> {
    private var root = DeepMapEntry<K, V>()

    fun clear() {
        root = DeepMapEntry()
    }

    fun delete(key: ReadonlyArray<K>) {
        var current = root

        for (keyItem in key) {
            val child = current.children[keyItem] ?: return
            current = child
        }

        current.value = null
        current.isInitialized = false
    }

    @JsExport.Ignore
    operator fun minusAssign(key: ReadonlyArray<K>) = delete(key)

    operator fun get(key: ReadonlyArray<K>): V? {
        var current = root

        for (keyItem in key) {
            val child = current.children[keyItem] ?: return null
            current = child
        }

        return current.value
    }

    fun has(key: ReadonlyArray<K>): Boolean {
        var current = root

        for (keyItem in key) {
            val child = current.children[keyItem] ?: return false
            current = child
        }

        return current.isInitialized
    }

    @JsExport.Ignore
    operator fun contains(key: ReadonlyArray<K>): Boolean = has(key)

    operator fun set(key: ReadonlyArray<K>, value: V) {
        var current = root

        for (keyItem in key) {
            var child = current.children[keyItem]
            if (child == null) {
                child = DeepMapEntry()
                current.children[keyItem] = child
            }
            current = child
        }

        current.value = value
        current.isInitialized = true
    }

    @JsExport.Ignore
    operator fun plusAssign(pair: Pair<ReadonlyArray<K>, V>) = set(pair.first, pair.second)

    fun entries() = root.entries(emptyArray())

    fun keys() = root.keys(emptyArray())

    fun values() = root.values(emptyArray())
}
package io.github.sgrishchenko.karakum


e{
							{
								Name:    "kaf",
								Version: "0.2.6-r5",
							},
							{
								Name:    "kaf",
								Version: "0.2.6-r6",
							},
						},
					},
					shouldBeValid: false,
				},
				{
					name:            "added-advisory", // i.e. "modified-document", can be just in APKINDEX
					subcase:         "package in APKINDEX but not distro",
					packageCfgsFunc: distroWithNothing,
					apkindex: &apk.APKIndex{
						Packages: []*apk.Package{
							{
								Name: "ko",
							},
						},
					},
					shouldBeValid: true,
				},
				{
					name:            "added-advisory",
					subcase:         "package in distro and APKINDEX",
					packageCfgsFunc: distroWithKo,
					apkindex: &apk.APKIndex{
						Packages: []*apk.Package{
							{
								Name: "ko",
							},
						},
					},
					shouldBeValid: true,
				},
				{
					name:            "added-advisory",
					subcase:         "package not in distro or APKINDEX",
					packageCfgsFunc: distroWithNothing,
					apkindex:        &apk.APKIndex{},
					shouldBeValid:   false,
				},
				{
					name:            "added-event-fixed",
					subcase:         "fixed version in APKINDEX but not distro",
					packageCfgsFunc: distroWithNothing,
					apkindex: &apk.APKIndex{
						Packages: []*apk.Package{
							{
								Name:    "ko",
								Version: "0.19.2-r7",
							},
						},
					},
					shouldBeValid: true,
				},
				{
					name:            "added-event-fixed",
					subcase:         "fixed version not in distro or APKINDEX",
					packageCfgsFunc: distroWithNothing,
					apkindex:        &apk.APKIndex{},
					shouldBeValid:   false,
				},
			}

			for _, tt := range cases {
				t.Run(tt.name+" -- "+tt.subcase, func(t *testing.T) {
					aDir := filepath.Join("testdata", "diff", tt.name, "a")
					bDir := filepath.Join("testdata", "diff", tt.name, "b")
					aFsys := rwos.DirFS(aDir)
					bFsys := rwos.DirFS(bDir)
					aIndex, err := adv2.NewIndex(context.Background(), aFsys)
					require.NoError(t, err)
					bIndex, err := adv2.NewIndex(context.Background(), bFsys)
					require.NoError(t, err)

					err = Validate(context.Background(), ValidateOptions{
						AdvisoryDocs:          bIndex,
						BaseAdvisoryDocs:      aIndex,
						Now:                   now,
						PackageConfigurations: tt.packageCfgsFunc(t),
						APKIndex:              tt.apkindex,
					})
					if tt.shouldBeValid && err != nil {
						t.Errorf("should be valid but got error: %v", err)
					}
					if !tt.shouldBeValid && err == nil {
						t.Error("shouldn't be valid but got no error")
					}
				})
			}
		})
	})

	t.Run("alias completeness", func(t *testing.T) {
		cases := []struct {
			name          string
			shouldBeValid bool
		}{
			{
				name:          "alias-missing-cve",
				shouldBeValid: false,
			},
			{
				name:          "alias-missing-ghsa",
				shouldBeValid: false,
			},
			{
				name:          "alias-not-missing",
				shouldBeValid: true,
			},
		}

		mockAF


) => (tr) => {
  const cells = getCellsInColumn(columnIndex)(tr.selection);
  if (cells) {
    for (let i = cells.length - 1; i >= 0; i--) {
      tr = cellTransform(cells[i], tr);
    }
    if (setCursorToLastCell) {
      const $pos = tr.doc.resolve(tr.mapping.map(cells[cells.length - 1].pos));
      tr.setSelection(Selection.near($pos));
    }
    return cloneTr(tr);
  }
  return tr;
};

// :: (rowIndex: number, cellTransform: (cell: {pos: number, start: number, node: ProseMirrorNode}, tr: Transaction) → Transaction, setCursorToLastCell: ?boolean) → (tr: Transaction) → Transaction
// Returns a new transaction that maps a given `cellTransform` function to each cell in a row at a given `rowIndex`.
// It will set the selection into the last cell of the row if `setCursorToLastCell` param is set to `true`.
//
// ```javascript
// dispatch(
//   forEachCellInRow(0, (cell, tr) => setCellAttrs(cell, { background: 'red' })(tr))(state.tr)
// );
// ```
export const forEachCellInRow = (rowIndex, cellTransform, setCursorToLastCell) => (tr) => {
  const cells = getCellsInRow(rowIndex)(tr.selection);
  if (cells) {
    for (let i = cells.length - 1; i >= 0; i--) {
      tr = cellTransform(cells[i], tr);
    }
    if (setCursorToLastCell) {
      const $pos = tr.doc.resolve(tr.mapping.map(cells[cells.length - 1].pos));
      tr.setSelection(Selection.near($pos));
    }
  }
  return tr;
};

// :: (cell: {pos: number, start: number, node: ProseMirrorNode}, attrs: Object) → (tr: Transaction) → Transaction
// Returns a new transaction that sets given `attrs` to a given `cell`.
//
// ```javascript
// dispatch(
//   setCellAttrs(findCellClosestToPos($pos), { background: 'blue' })(tr);
// );
// ```
export const setCellAttrs = (cell, attrs) => (tr) => {
  if (cell) {
    tr.setNodeMarkup(cell.pos, null, Object.assign({}, cell.node.attrs, attrs));
    return cloneTr(tr);
  }
  return tr;
};

// :: (schema: Schema, rowsCount: ?number, colsCount: ?number, withHeaderRow: ?boolean, cellContent: ?Node) → Node
// Returns a table node of a given size.
// `withHeaderRow` defines whether the first row of the table will be a header row.
// `cellContent` defines the content of each cell.
//
// ```javascript
// const table = createTable(state.schema); // 3x3 table node
// dispatch(
//   tr.replaceSelectionWith(table).scrollIntoView()
// );
// ```
export const createTable = (schema, rowsCount = 3, colsCount = 3, withHeaderRow = true, cellContent = null) => {
  const { cell: tableCell, header_cell: tableHeader, row: tableRow, table } = tableNodeTypes(schema);

  const cells = [];
  const headerCells = [];
  for (let i = 0; i < colsCount; i++) {
    cells.push(createCell(tableCell, cellContent));

    if (withHeaderRow) {
      headerCells.push(createCell(tableHeader, cellContent));
    }
  }

  const rows = [];
  for (let i = 0; i < rowsCount; i++) {
    rows.push(tableRow.createChecked(null, withHeaderRow && i === 0 ? headerCells : cells));
  }

  return table.createChecked(null, rows);
};

// :: ($pos: ResolvedPos) → ?{pos: number, start: number, node: ProseMirrorNode}
// Iterates over parent


код
#end if">
	  #if условие

	    тук въведете код

	  #else

	    алтернативен код

	  #end if

	Пълно:

	  #if условие1

	    тук въведете код

	  #else if условие2

	    тук въведете код

	  #else

	    алтернативен код

	  #end if

	Може да добавяте произволен брой "#else if" блокове, но само един "#else".

+Блок за цикъл:

	Стандартен:

	  #repeat брой повторения

	    тук въведете код

	  #loop

	Условен:

	  #repeat брой повторения

	    тук въведете код

	    #if условие

	      #break или #continue

	    #end if

	    още код

	  #loop

+Модули и макроси/тексто


: @invertedLabelHoverTextColor;
    }

    .ui.inverted.multiple.dropdown > .label > .close.icon,
    .ui.inverted.multiple.dropdown > .label > .delete.icon {
      opacity: @invertedLabelIconOpacity;
    }

    .ui.inverted.multiple.dropdown > .label > .close.icon:hover,
    .ui.inverted.multiple.dropdown > .label > .delete.icon:hover {
      opacity: @invertedLabelIconHoverOpacity;
    }
  }

  /* Selection for form elements */
  .ui.inverted.dropdown textarea::-webkit-selection,
  .ui.inverted.dropdown input::-webkit-selection {
    background-color: @invertedInputHighlightBackground;
    color: @invertedInputHighlightColor;
  }
  .ui.inverted.dropdown textarea::-moz-selection,
  .ui.inverted.dropdown input::-moz-selection {
    background-color: @invertedInputHighlightBackground;
    color: @invertedInputHighlightColor;
  }
  .ui.inverted.dropdown textarea::selection,
  .ui.inverted.dropdown input::selection {
    background-color: @invertedInputHighlightBackground;
    color: @invertedInputHighlightColor;
  }

  /* Scrollbars */
  .ui.dropdown .inverted.menu::-webkit-scrollbar-track,
  .ui.inverted.dropdown .menu::-webkit-scrollbar-track {
    background: @trackInvertedBackground;
  }
  .ui.dropdown .inverted.menu::-webkit-scrollbar-thumb,
  .ui.inverted.dropdown .menu::-webkit-scrollbar-thumb {
    background: @thumbInvertedBackground;
  }
  .ui.dropdown .inverted.menu::-webkit-scrollbar-thumb:window-inactive,
  .ui.inverted.dropdown .menu::-webkit-scrollbar-thumb:window-inactive {
    background: @thumbInvertedInactiveBackground;
  }
  .ui.dropdown .inverted.menu::-webkit-scrollbar-thumb:hover,
  .ui.inverted.dropdown .menu::-webkit-scrollbar-thumb:hover {
    background: @thumbInvertedHoverBackground;
  }
  & when (@variationDropdownPointing) {
    .ui.pointing.dropdown > .inverted.menu:after,
    .ui.inverted.pointing.dropdown > .menu:after {
      background: @invertedPointingArrowBackground;
      box-shadow: @invertedPointingArrowBoxShadow;
    }
  }
}

.loadUIOverrides();
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 224 71.4% 4.1%;
    --card: 0 0% 100%;
    --card-foreground: 224 71.4% 4.1%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71.4% 4.1%;
    --primary: 220.9 39.3% 11%;
    --primary-foreground: 210 20% 98%;
    --secondary: 220 14.3% 95.9%;
    --secondary-foreground: 220.9 39.3% 11%;
    --muted: 220 14.3% 95.9%;
    --muted-foreground: 220 8.9% 46.1%;
    --accent: 220 14.3% 95.9%;
    --accent-foreground: 220.9 39.3% 11%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210


headline":"RBI Prescribes Five-pillared Approach 'GUARD' to Deal With Cybersecurity Threats in Urban Co-op Banks","articleBody":"The Reserve Bank on Thursday came out with a five-pillared strategic approach 'GUARD' to deal with cybersecurity threats being faced by urban cooperative banks (UCBs). The number, frequency and impact of cyber incidents and attacks have increased manifold in the recent past, more so in the case of the financial sector, including UCBs, RBI said in its document 'Technology Vision for Cyber Security for Urban Cooperative Banks 2020-2023'.    It has, therefore, become essential to enhance the security posture of UCBs to prevent, detect, respond to and recover from cyber-attacks, the central bank said. The five-pillared strategic approach 'GUARD' comprises Governance Oversight, Utile Technology Investment, Appropriate Regulation and Supervision, Robust Collaboration and Developing necessary IT and cybersecurity skills set.   The technology vision document, which was formalised after obtaining inputs from various stakeholders, is aimed at enhancing the cybersecurity posture of UCBs against evolving IT and cyber threat environment, the RBI said. The 12 specific action points suggested in the document include - more board oversight over cybersecurity; enabling UCBs to better manage and secure their IT assets; and setting up offsite supervisory mechanism framework on cybersecurity-related controls.   It also includes developing a forum for UCBs so help them share best practices and discuss practical issues and challenges; and creating a framework for providing awareness\/ training. "The implementation of the approach outlined in this Technology Vision document will strengthen the cyber resilience of the Urban Co-operative Banks," the RBI said.   Observing that the cybersecurity landscape will continue to evolve with wider adoption of digital banking channels, necessitating the UCBs to manage the associated risks effectively, the RBI said "active collaboration within UCBs and their stakeholders would be necessary for sharing and coordinating various measures taken on cybersecurity aspects."   Use of information technology by banks has grown rapidly and is now an important part of the operational strategy of banks. In October 2018, the RBI had issued a circular prescribing basic cybersecurity controls for all the UCBs.","articleSection":"Business","image":{"@type":"ImageObject","url":"https:\/\/images.news18.com\/ibnlive\/uploads\/2016\/04\/Cyber-warfare.jpg","height":522,"width":696},"datePublished":"2020-09-24T21:27:32+05:30","dateModified":"2020-09-24T21:27:32+05:30","author":{"@type":"Person","name":"News18"},"publisher":{"@type":"Organization","name":"News18","logo":{"@type":"ImageObject","url":"https:\/\/images.news18.com\/static_news18\/pix\/ibnhome\/news18\/images\/desktop\/indiwo\/indiwo-logo-desk.png","width":154,"height":40}},"description":"The technology vision document, which was formalised after obtaining inputs from various stakeholders, is aimed at enhancing the cybersecurity posture of UCBs against evolving IT and cyber threat environment, the RBI said.","keywords":"cyber attack, cybersecurity, Reserve Bank of India, urban cooperative banks"}</sc


// GPIO functions on lpc176x
//
// Copyright (C) 2018  Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.

#include <string.h> // ffs
#include "board/irq.h" // irq_save
#include "command.h" // shutdown
#include "gpio.h" // gpio_out_setup
#include "internal.h" // gpio_peripheral
#include "sched.h" // sched_shutdown

/****************************************************************
 * Pin mappings
 ****************************************************************/

DECL_ENUMERATION_RANGE("pin", "P0.0", GPIO(0, 0), 32);
DECL_ENUMERATION_RANGE("pin", "P1.0", GPIO(1, 0), 32);
DECL_ENUMERATION_RANGE("pin", "P2.0", GPIO(2, 0), 32);
DECL_ENUMERATION_RANGE("pin", "P3.0", GPIO(3, 0), 32);
DECL_ENUMERATION_RANGE("pin", "P4.0", GPIO(4, 0), 32);

static LPC_GPIO_TypeDef * const digital_regs[] = {
    LPC_GPIO0, LPC_GPIO1, LPC_GPIO2, LPC_GPIO3, LPC_GPIO4
};

// Set the mode and extended function of a pin
void
gpio_peripheral(uint32_t gpio, int func, int pull_up)
{
    uint32_t bank_pos = GPIO2PORT(gpio) * 2, pin_pos = (gpio % 32) * 2;
    if (pin_pos >= 32) {
        pin_pos -= 32;
        bank_pos++;
    }
    uint32_t sel_bits = (func & 0x03) << pin_pos, mask = ~(0x03 << pin_pos);
    uint32_t mode = (pull_up ? (pull_up > 0 ? 0x00 : 0x03) : 0x02) << pin_pos;
    volatile uint32_t *pinsel = &LPC_PINCON->PINSEL0;
    volatile uint32_t *pinmode = &LPC_PINCON->PINMODE0;
    irqstatus_t flag = irq_save();
    pinsel[bank_pos] = (pinsel[bank_pos] & mask) | sel_bits;
    pinmode[bank_pos] = (pinmode[bank_pos] & mask) | mode;
    irq_restore(flag);
}

// Convert a register and bit location back to an integer pin identifier
static int
regs_to_pin(LPC_GPIO_TypeDef *regs, uint32_t bit)
{
    int i;
    for (i=0; i<ARRAY_SIZE(digital_regs); i++)
        if (digital_regs[i] == regs)
            return GPIO(i, ffs(bit)-1);
    return 0;
}

/****************************************************************
 * General Purpose Input Output (GPIO) pins
 ****************************************************************/

struct gpio_out
gpio_out_setup(uint8_t pin, uint8_t val)
{
    if (GPIO2PORT(pin) >= ARRAY_SIZE(digital_regs))
        goto fail;
    LPC_GPIO_TypeDef *regs = digital_regs[GPIO2PORT(pin)];
    struct gpio_out g = { .regs=regs, .bit=GPIO2BIT(pin) };
    gpio_out_reset(g, val);
    return g;
fail:
    shutdown("Not an output pin");
}

void
gpio_out_reset(struct gpio_out g, uint8_t val)
{
    LPC_GPIO_TypeDef *regs = g.regs;
    int pin = regs_to_pin(regs, g.bit);
    irqstatus_t flag = irq_save();
    regs->FIOPIN = (regs->FIOSET & ~g.bit) | (val ? g.bit : 0);
    regs->FIODIR |= g.bit;
    gpio_peripheral(pin, 0, 0);
    irq_restore(flag);
}

void
gpio_out_toggle_noirq(struct gpio_out g)
{
    LPC_GPIO_TypeDef *regs = g.regs;
    regs->FIOPIN = regs->FIOSET ^ g.bit;
}

void
gpio_out_toggle(struct gpio_out g)
{
    irqstatus_t flag = irq_save();
    gpio_out_toggle_noirq(g);
    irq_restore(flag);
}

void
gpio_out_write(struct gpio_out g, uint8_t val)
{
    LPC_GPIO_TypeDef *regs = g.regs;
    if (val)
        regs->FIOSET = g.bit;
    else
        regs->FIOCLR = g.bit;
}

struct gpio_in
gpio_in_setup(uint8_t pin, int8_t pull_up)
{
    if (GPIO2PORT(pin) >= ARRAY_SIZE(digital_regs))
        goto fail;
    LPC_GPIO_TypeDef *regs = digital_regs[GPIO2PORT(pin)];
    struct gpio_in g = { .regs=regs, .bit=GPIO2BIT(pin) };
    gpio_in_reset(g, pull_up);
    return g;
fail:
    shutdown("Not an input pin");
}

void
gpio_in_reset(struct gpio_in g, int8_t pull_up)
{
    LPC_GPIO_TypeDef *regs = g.regs;
    int pin = regs_to_pin(regs, g.bit);
    irqstatus_t flag = irq_save();
    gpio_peripheral(pin, 0, pull_up);
    regs->FIODIR &= ~g.bit;
    irq_restore(flag);
}

uint8_t
gpio_in_read(struct gpio_in g)
{
    LPC_GPIO_TypeDef *regs = g.regs;
    return !!(regs->FIOPIN & g.bit);
}


'Τ': '24',
  'Υ': '25',
  'Ύ': '26',
  'Φ': '27',
  'Χ': '29',
  'Ψ': '30',
  'Ω': '31',
  'Ώ': '32'
});

const Alphabet alphabetRussian1 = Alphabet(key: 'common_language_russian', type: AlphabetType.STANDARD, alphabet: {
  '\u0410': '1', // А
  '\u0411': '2', // Б
  '\u0412': '3', // В
  '\u0413': '4', // Г
  '\u0414': '5', // Д
  '\u0415': '6', // Е
  '\u0401': '7', // Ё
  '\u0416': '8', // Ж
  '\u0417': '9', // З
  '\u0418': '10', // И
  '\u0419': '11', // Й
  '\u041A': '12', // К
  '\u041B': '13', // Л
  '\u041C': '14', // М
  '\u041D': '15', // Н
  '\u041E': '16', // О
  '\u041F': '17', // П
  '\u0420': '18', // Р
  '\u0421': '19', // С
  '\u0422': '20', // Т
  '\u0423': '21', // У
  '\u0424': '22', // Ф
  '\u0425': '23', // Х
  '\u0426': '24', // Ц
  '\u0427': '25', // Ч
  '\u0428': '26', // Ш
  '\u0429': '27', // Щ
  '\u042A': '28', // Ъ
  '\u042B': '29', // Ы
  '\u042C': '30', // Ь
  '\u042D': '31', // Э
  '\u042E': '32', // Ю
  '\u042F': '33', // Я
});

final List<Alphabet> ALL_ALPHABETS = [
  alphabetAZ,
  alphabetGerman1,
  alphabetGerman2,
  alphabetGerman3,
  alphabetDanish,
  alphabetEnglish,
  alphabetFrench1,
  alphabetFrench2,
  alphabetPolish1,
  alphabetSpanish1,
  alphabetSpanish2,
  alphabetGreek1,
  alphabetGreek2,
  alphabetRussian1,
];

const letterFrequencyAlphabetGerman1 = {
  'A': 6,
  'B': 2,
  'C': 2,
  'D': 5,
  'E': 17,
  'F': 2,
  'G': 3,
  'H': 5,
  'I': 8,
  'J': 1,
  'K': 1,
  'L': 3,
  'M': 2,
  'N': 10,
  'O': 2,
  'P': 1,
  'Q': 1,
  'R': 7,
  'S': 7,
  'T': 6,
  'U': 4,
  'V': 1,
  'W': 1,
  'X': 1,
  'Y': 1,
  'Z': 1
};
const letterFrequencyAlphabetDanish = {
  // https://www.sttmedia.de/buchstabenhaeufigkeit-daenisch
  'A': 6,
  'Å': 1,
  'Æ': 1,
  'B': 2,
  'C': 1,
  'D': 7,
  'E': 16,
  'F': 2,
  'G': 5,
  'H': 2,
  'I': 6,
  'J': 1,
  'K': 3,
  'L': 5,
  'M': 3,
  'N': 7,
  'O


_kernel": liger_kernel,
        "use_unsloth_gc": unsloth_gc,
        "stage": "pt",
        "do_train": True,
        "finetuning_type": finetuning_type,
        "dataset": "c4_demo",
        "cutoff_len": seq_length,
        "output_dir": os.path.join("saves", "test_mfu"),
        "logging_strategy": "no",
        "save_strategy": "no",
        "save_only_model": True,
        "overwrite_output_dir": True,
        "per_device_train_batch_size": batch_size,
        "max_steps": num_steps,
        "bf16": True,
    }
    if deepspeed_stage in [2, 3]:
        args["deepspeed"] = "examples/deepspeed/ds_z{}_config.json".format(deepspeed_stage)

    run_exp(args)
    with open(os.path.join("saves", "test_mfu", "all_results.json"), "r", encoding="utf-8") as f:
        result = json.load(f)

    if dist.is_initialized():
        world_size = dist.get_world_size()
    else:
        world_size = 1

    total_batch_size = batch_size * world_size
    mfu_value = (
        result["train_steps_per_second"]
        * compute_model_flops(model_name_or_path, total_batch_size, seq_length)
        / compute_device_flops(world_size)
    )
    print("MFU: {:.2f}%".format(mfu_value * 100))

if __name__ == "__main__":
    fire.Fire(calculate_mfu)


p, #4
	ldr	r2, .L24
	mov	r4, #1744
	ldr	r3, [r0, #172]
	mov	r5, r0
	mov	r7, #0
	mov	r6, #1
	mla	r4, r4, r1, r2
	ldr	r2, .L24+4
	mov	r8, r1
	mov	r0, #22
	ldr	r1, .L24+8
	ldr	ip, [r2, #68]
	add	r9, r4, #24
	str	r3, [r4, #4]
	ldr	r3, [r5, #172]
	str	r3, [r4, #8]
	ldr	r3, [r5, #180]
	str	r3, [r4, #16]
	ldr	r3, [r5, #184]
	str	r3, [r4, #20]
	ldrh	r2, [r5, #52]
	str	r2, [r4, #24]
	ldrh	r3, [r5, #54]
	str	r7, [r4, #36]
	str	r6, [r4, #32]
	str	r3, [r4, #28]
	blx	ip
	ldr	ip, [r4, #28]
	ldr	r0, [r4, #24]
	ldr	r1, .L24+12
	str	r6, [r4, #840]
	smulbb	r0, ip, r0
	ldr	ip, [r1, #104]
	strh	r7, [r4, #40]	@ movhi
	str	r7, [r4, #844]
	cmp	ip, r7
	sub	r0, r0, #1
	strh	r0, [r4, #42]	@ movhi
	ldr	r3, [r5, #192]
	str	r6, [r4, #856]
	str	r7, [r4, #852]
	str	r3, [r4, #848]
	beq	.L23
	mov	r3, r8
	mov	r2, r7
	mov	r1, r5
	mov	r0, #10
	blx	ip
	subs	r0, r0, r7
	movne	r0, #1
	ldmfd	sp, {r4, r5, r6, r7, r8, r9, fp, sp, pc}
.L23:
	mov	r0, r6
	ldmfd	sp, {r4, r5, r6, r7, r8, r9, fp, sp, pc}
.L25:
	.align	2
.L24:
	.word	g_RepairParam
	.word	vfmw_Osal_Func_Ptr_S
	.word	.LC0
	.word	g_vdm_hal_fun_ptr
	UNWIND(.fnend)
	.size	PostPro_CopyYuv_Vp6, .-PostPro_CopyYuv_Vp6
	.align	2
	.global	PostPro_GetHevcMbGroup
	.type	PostPro_GetHevcMbGroup, %function
PostPro_GetHevcMbGroup:
	UNWIND(.fnstart)
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	UNWIND(.movsp ip)
	mov	ip, sp
	stmfd	sp!, {r4, r5, r6, r7, r8, r9, r10, fp, ip, lr, pc}
	UNWIND(.pad #4)
	UNWIND(.save {r4, r5, r6, r7, r8, r9, r10, fp, ip, lr})
	UNWIND(.set


# Fucking Nintendo, how do they work

.extern isReplayEnabled

.extern IOS_Open
.extern IOS_Close
.extern IOS_Read
.extern IOS_Write
.extern OSGetTime
.extern OSTicksToCalendarTime
.extern OSReport
.extern CurrentWorld
.extern CurrentLevel
.extern CurrentStartedArea
.extern CurrentStartedEntrance
.extern snprintf
.extern GetSomeGlobalClass
.extern SomeUnknownClass5408
.extern SomeWipeClass
.extern continueFromReplayHookStart
.extern continueFromReplayEndHook
.extern returnFromRecorder
.extern QueryGlobal5758
.extern GetRandomSeed
.extern Player_ID
.extern Player_Powerup
.extern Player_Flags
.extern EGG__Heap__alloc__FUliPv
.extern EGG__Heap__free__FPvPv
.extern GameHeap2
.extern EggControllerClassPtrMaybe
.extern GameMgrP
.extern StrangeReplayValue1
.extern StrangeReplayValue2
.extern StrangeReplayValue3
.extern WiimotePtr1
.extern Player_ID
.extern RandomSeed
.extern dontSkipReplayPrepare
.extern doSkipReplayPrepare

.set sp, 1

# mode 1 = read, 2 = write?

.text
.align 4

.global replayStart
.global replayEnd
.global replayRecord

#.global luigiOverride
#luigiOverride:
#	#blr
#	lis r3, Player_ID@h
#	ori r3, r3, Player_ID@l
#	li r4, 1
#	stw r4, 0(r3)
#	blr

.global getAndSaveRandomSeed
getAndSaveRandomSeed: # b from 8091F930
	lis r3, RandomSeed@h
	ori r3, r3, RandomSeed@l
	lwz r3, 0(r3)
	lis r4, saveRandomSeed@h
	ori r4, r4, saveRandomSeed@l
	stw r3, 0(r4)

	mr r4, r3
	lis r3, str_gotSeed@h
	ori r3, r3, str_gotSeed@l
	crclr 4*cr1+eq
	bl OSReport

	lwz r0, 0x74(sp)
	mtlr r0
	addi sp, sp, 0x70
	blr

replayStart: # b from 809246E0
	lis r3, isReplayEnabled@h
	ori r3, r3, isReplayEnabled@l
	lbz r3, 0(r3)
	cmpwi r3, 100
	bne justSkipReplayStart

	bl OSGetTime
	lis r5, replayTime@h
	ori r5, r5, replayTime@l
	bl OSTicksToCalendarTime

	li r29, 0
	li r30, 0

replayStartLoop:

	lis r3, str_replayFileNameBuffer@h
	ori r3, r3, str_replayFileNameBuffer@l

	li r4, 64

	lis r5, str_replayFileNameFormat@h
	ori r5, r5, str_replayFileNameFormat@l

	lis r6, CurrentWorld@h
	ori r6, r6, CurrentWorld@l
	lbz r6, 0(r6)
	addi r6, r6, 1

	lis r7, CurrentLevel@h
	ori r7, r7, CurrentLevel@l
	lbz r7, 0(r7)
	addi r7,


ms() if v == value)
                if len(key) > len(existing_key):
                    del unique_models[existing_key]
                    unique_models[key] = value
        return list(unique_models.keys())

    def add_model_collection(self, model_collection):
        if not isinstance(model_collection, ModelCollection):
            raise TypeError("model_collection must be an instance of ModelCollection")
        self.models.update(model_collection.models)

    def __str__(self):
        return str({name: str(config) for name, config in self.models.items()})

from .Model_sets.alibaba import alibaba_models
from .Model_sets.google import google_models
from .Model_sets.microsoft import microsoft_models
from .Model_sets.misc import misc_models
from .Model_sets.mistral import mistral_models
from .Model_sets.meta import meta_models
from .Model_sets.nvidia import nvidia_models

MODEL_DICT = ModelCollection()
MODEL_DICT.add_model_collection(ModelCollection(alibaba_models))
MODEL_DICT.add_model_collection(ModelCollection(google_models))
MODEL_DICT.add_model_collection(ModelCollection(microsoft_models))
MODEL_DICT.add_model_collection(ModelCollection(misc_models))
MODEL_DICT.add_model_collection(ModelCollection(mistral_models))
MODEL_DICT.add_model_collection(ModelCollection(meta_models))
MODEL_DICT.add_model_collection(ModelCollection(nvidia_models))


-lg{height:calc(1.5em + 1rem + var(--bs-border-width)*2)}.form-select{--bs-form-select-bg-img:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");appearance:none;background-color:var(--bs-body-bg);background-image:var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon,none);background-position:right .75rem center;background-repeat:no-repeat;background-size:16px 12px;border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);color:var(--bs-body-color);display:block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem 2.25rem .375rem .75rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.form-select{transition:none}}.form-select:focus{border-color:#86b7fe;box-shadow:0 0 0 .1875rem var(--pst-color-accent);outline:0}.form-select[multiple],.form-select[size]:not([size="1"]){background-image:none;padding-right:.75rem}.form-select:disabled{background-color:var(--bs-secondary-bg)}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--bs-body-color)}.form-select-sm{border-radius:var(--bs-border-radius-sm);font-size:.875rem;padding-bottom:.25rem;padding-left:.5rem;padding-top:.25rem}.form-select-lg{border-radius:var(--bs-border-radius-lg);font-size:1.25rem;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}[data-bs-theme=dark] .form-select{--bs-form-select-bg-img:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E")}.form-check{display:block;margin-bottom:.125rem;min-height:1.5rem;padding-left:1.5em}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-reverse{padding-left:0;padding-right:1.5em;text-align:right}.form-check-reverse .form-check-input{float:right;margin-left:0;margin-right:-1.5em}.form-check-input{--bs-form-check-bg:var(--bs-body-bg);appearance:none;background-color:var(--bs-form-check-bg);background-image:var(--bs-form-check-bg-image);background-position:50%;background-repeat:no-repeat;background-size:contain;border:var(--bs-border-width) solid var(--bs-border-color);flex-shrink:0;height:1em;margin-top:.25em;print-color-adjust:exact;vertical-align:top;width:1em}.


", function(_)
    if C_Cursor.GetCursorItem() ~= nil then
      addonTable.CallbackRegistry:TriggerEvent("CategoryAddItemStart", button.BGR.category, button.BGR.itemID, button.BGR.itemLink, button.addedDirectly)
    end
  end)
end

function BaganatorLiveCategoryLayoutMixin:SetupDummyButton(button)
  if button.setup then
    return
  end
  button.setup = true
  button.isDummy = true

  local function ProcessCursor()
    if C_Cursor.GetCursorItem() ~= nil and button.dummyType ~= "empty" then
      addonTable.CallbackRegistry:TriggerEvent("CategoryAddItemEnd", button.dummyType == "add" and button.BGR.category or nil)
      ClearCursor()
    end
  end
  button:SetScript("OnClick", ProcessCursor)

  button:SetScript("OnReceiveDrag", ProcessCursor)

  button:SetScript("OnEnter", function()
    if button.label then
      GameTooltip:SetOwner(button, "ANCHOR_RIGHT")
      GameTooltip:SetText(button.label)
    end
  end)

  button:SetScript("OnLeave", function()
    GameTooltip:Hide()
  end)

  button.ModifiedIcon = button:CreateTexture(nil, "OVERLAY")
  button.ModifiedIcon:SetPoint("CENTER")
end

function BaganatorLiveCategoryLayoutMixin:ApplyDummyButtonSettings(button, cacheData)
  if button.dummyType == cacheData.dummyType then
    return
  end

  button.dummyType = cacheData.dummyType
  button.ModifiedIcon:SetDesaturated(false)
  if cacheData.dummyType == "remove" then
    button.ModifiedIcon:SetAtlas("transmog-icon-remove")
    button.ModifiedIcon:SetSize(25, 25)
  elseif cacheData.dummyType == "add" then
    button.ModifiedIcon:SetAtlas("Garr_Building-AddFollowerPlus")
    button.ModifiedIcon:SetSize(37, 37)
  elseif cacheData.dummyType == "empty" then
    button.ModifiedIcon:SetAtlas("transmog-icon-remove")
    button.ModifiedIcon:SetSize(25, 25)
    button.ModifiedIcon:SetDesaturated(true)
  end
end

function BaganatorLiveCategoryLayoutMixin:DeallocateUnusedButtons(cacheList)
  local used = {}
  local matchingSlots = {}
  for _, cacheData in ipairs(cacheList) do
    local key = addonTable.ItemViewCommon.Utilities.GetCategoryDataKey(cacheData)
    used[key] = (used[key] or 0) + 1
    matchingSlots[key] = matchingSlots[key] or {}
    if cacheData.slotID then
      matchingSlots[key][cacheData.bagID .. "_" .. cacheData.slotID] = cacheData.itemCount
    end
  end
  for key, list in pairs(self.buttonsByKey) do
    if not used[key] or used[key] < #list then
      for index = #list, 1, -1 do
        local button = list[index]
        -- We match by bag and slot to avoid redrawing (and breaking clicks) on
        -- existing items
        if matchingSlots[key] == nil or button.BGR.itemCount ~= matchingSlots[key][button:GetParent():GetID() .. "_" .. button:GetID()] then
          if not button.isDummy then
            self.buttonPool:Release(button)
          else
            self.dummyButtonPool:Release(button)
          end
          table.remove(list, index)
        end
      end
      if #list == 0 then
        self.buttonsByKey[key] = nil
      end
      self.anyRemoved = true
    end
  end
  self.buttons = {}
end

function BaganatorLiveCategoryLayoutMixin:ShowGroup(cacheList, rowWidth, category)
  local toSet = {}
  local toResetCache = {}
  self.buttons = {}
  local itemWidgetsRefresh = self.refreshStat


err)
		}
	}

	if err = d.Set("fabric_object", dataSourceFlattenFirewallAddress6TemplateFabricObject(o["fabric-object"], d, "fabric_object")); err != nil {
		if !fortiAPIPatch(o["fabric-object"]) {
			return fmt.Errorf("Error reading fabric_object: %v", err)
		}
	}

	return nil
}

func dataSourceFlattenFirewallAddress6TemplateFortiTestDebug(d *schema.ResourceData, fosdebugsn int, fosdebugbeg int, fosdebugend int) {
	log.Printf(strconv.Itoa(fosdebugsn))
	e := validation.IntBetween(fosdebugbeg, fosdebugend)
	log.Printf("ER List: %v, %v", strings.Split("FortiOS Ver", " "), e)
}
// Copyright 2020 Fortinet, Inc. All rights reserved.
// Author: Frank Shen (@frankshen01), Hongbin Lu (@fgtdev-hblu)
// Documentation:
// Frank Shen (@frankshen01), Hongbin Lu (@fgtdev-hblu),
// Xing Li (@lix-fortinet), Yue Wang (@yuew-ftnt), Yuffie Zhu (@yuffiezhu)

package fortios

import (
	"fmt"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
	"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
	"log"
	"testing"
)

func TestAccFortiOSSystemSflow_basic(t *testing.T) {
	rname := acctest.RandString(8)
	log.Printf("TestAccFortiOSSystemSflow_basic %s", rname)

	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			{
				Config: testAccFortiOSSystemSflowConfig(rname),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckFortiOSSystemSflowExists("fortios_system_sflow.trname"),
					resource.TestCheckResourceAttr("fortios_system_sflow.trname", "collector_ip", "0.0.0.0"),
					resource.TestCheckResourceAttr("fortios_system_sflow.trname", "collector_port", "6343"),
					resource.TestCheckResourceAttr("fortios_system_sflow.trname", "source_ip", "0.0.0.0"),
				),
			},
		},
	})
}

func testAccCheckFortiOSSystemSflowExists(n string) resource.TestCheckFunc {
	return func(s *terraform.State) error {
		rs, ok := s.RootModule().Resources[n]
		if !ok {
			return fmt.Errorf("Not found SystemSflow: %s", n)
		}

		if rs.Primary.ID == "" {
			return fmt.Errorf("No SystemSflow is set")
		}

		c := testAccProvider.Meta().(*FortiClient).Client

		i := rs.Primary.ID
		o, err := c.ReadSystemSflow(i)

		if err != nil {
			return fmt.Errorf("Error reading SystemSflow: %s", err)
		}

		if o == nil {
			return fmt.Errorf("Error creating SystemSflow: %s", n)
		}

		return nil
	}
}

func testAccCheckSystemSflowDestroy(s *terraform.State) error {
	c := testAccProvider.Meta().(*FortiClient).Client

	for _, rs := range s.RootModule().Resources {
		if rs.Type != "fortios_system_sflow" {
			continue
		}

		i := rs.Primary.ID
		o, err := c.ReadSystemSflow(i)

		if err == nil {
			if o != nil {
				return fmt.Errorf("Error SystemSflow %s still exists", rs.Primary.ID)
			}
		}

		return nil
	}

	return nil
}


 getStyleValue after https://github.com/caitp/angular.js/commit/92bbb5e225253ebddd38ef5735d66ffef76b6a14 will be applied
    function getStyleValue(name) {
        return parseFloat(styles[name]);
    }

    for (; i < 4; i += 2) {
        // both box models exclude margin, so add it if we want it
        if (extra === 'margin') {
            val += getStyleValue(extra + cssExpand[i]);
        }

        if (isBorderBox) {
            // border-box includes padding, so remove it if we want content
            if (extra === 'content') {
                val -= getStyleValue('padding' + cssExpand[i]);
            }

            // at this point, extra isn't border nor margin, so remove border
            if (extra !== 'margin') {
                val -= getStyleValue('border' + cssExpand[i] + 'Width');
            }
        } else {
            val += getStyleValue('padding' + cssExpand[i]);

            // at this point, extra isn't content nor padding, so add border
            if (extra !== 'padding') {
                val += getStyleValue('border' + cssExpand[i] + 'Width');
            }
        }
    }

    return val;
}

function getOffset(elem) {
    let docElem, win,
        box = elem.getBoundingClientRect(),
        doc = elem && elem.ownerDocument;

    if (!doc) {
        return;
    }

    docElem = doc.documentElement;
    win = getWindow(doc);

    return {
        top: box.top + win.pageYOffset - docElem.clientTop,
        left: box.left + win.pageXOffset - docElem.clientLeft
    };
}

function getWindow(elem) {
    return elem != null && elem === elem.window ? elem : elem.nodeType === 9 && elem.defaultView;
}

function getWidthOrHeight(elem, name, extra) {
    // Start with offset property, which is equivalent to the border-box selectedItems
    let valueIsBorderBox = true,
        val = name === 'width' ? elem.offsetWidth : elem.offsetHeight,
        styles = window.getComputedStyle(elem, null),

        //TODO Make isBorderBox after https://github.com/caitp/angular.js/commit/92bbb5e225253ebddd38ef5735d66ffef76b6a14 will be applied
        isBorderBox = false; //jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";

    // some non-html elements return undefined for offsetWidth, so check for null/undefined
    // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
    // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
    if (val <= 0 || val == null) {
        // Fall back to computed then uncomputed css if necessary
        val = styles[name];

        if (val < 0 || val == null) {
            val = elem.style[name];
        }

        // Computed unit is not pixels. Stop here and return.
        if (rnumnonpx.test(val)) {
            return val;
        }

        // we need the check for style in case a browser which returns unreliable values
        // for getComputedStyle silently falls back to the reliable elem.style
        //valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );

        // Normalize "", auto, and prepare for extra
        val = parseFloat(val) || 0;
    }

    // use the active box-sizing model to add/subtract irrelevant styles
    return val + augmentWidthOrHeight(elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles);
}

/**
 * Calculate free space


    }
    uint8_t octave = floor(t_note / 12) + 1;
    uint16_t volt_per_octave = (uint16_t) (MAX_NOTE_VOLTAGE / OCTAVES);
    uint16_t raw_cv_lo = volt_per_octave * (octave - 1);
    uint16_t raw_cv_hi = volt_per_octave * octave;

    uint16_t raw_cv = (uint16_t)Utils::map(t_note, LOWEST_MIDI_NOTE, (LOWEST_MIDI_NOTE + notes), 0, MAX_NOTE_VOLTAGE);
    uint16_t cv = (uint16_t)Utils::map(raw_cv, raw_cv_lo, raw_cv_hi, (raw_cv_lo + m_settings->calibration[octave - 1]), (raw_cv_hi + m_settings->calibration[octave]));

    return cv;
}

/**
 * Pitch bend value can be between 0 and 0x3fff with 0x2000 meaning no bend.
 * Pitch bend CV calculation:
 * 1. Shift bend value to -0x2000 and 0x2000
 * 2. Get max bend CV value (2 semitones)
 * 3. Calculate actual bend CV value with the bend vs. max bend ratio
*/
int16_t MidiToCV::get_pitch_bend_cv(uint16_t bend) {
    int16_t shiftedBend = bend - PITCH_BEND_CENTER;
    uint8_t maxBendCV = (uint8_t) (MAX_NOTE_VOLTAGE / (OCTAVES * 12) * MAX_PB_SEMINOTES);
    return shiftedBend * maxBendCV / PITCH_BEND_CENTER; // BEND / MAX_BEND_VALUE[8192]] = BENDCV / MAX_BEND_CV
}

void MidiToCV::set_gate(bool on) {
    gpio_put(GP_GATE, on);
}

/**
 * Process settings mode. This is called when the user holds two notes and
 * releases after startup. The only setting now is the MIDI channel. The value
 * is set by pressing keys on the keyboard and it's set in binary according
 * to the following digits:
 *  C: digit 2^0
 *  D: digit 2^1
 *  E: digit 2^2
 *  F: digit 2^3
 *  G: digit 2^4
 *
 * So for channel 5 you have to press E and F then release. For channel 16 you
 * have to press G.
 */
void MidiToCV::m_process_settings() {
    // Save settings note stack if there's a note on event
    if (m_midi_handler->midi_event == NOTE_ON) {
        m_setting_note_stack[m_settings_note_counter] = m_midi_handler->note();
        m_settings_note_counter++;
    }

    // Read settings if there's a note off event
    if (m_midi_handler->midi_event == NOTE_OFF && m_settings_note_counter > 0) {
        int new_midi_channel = 0;

        for (int i = 0; i < NOTE_STACK_SIZE; i++) {
            if (m_setting_note_stack[i] != -1) {
                switch (m_setting_note_stack[i] % 12) {
                    // C note
                    case 0:
                        new_midi_channel += pow(2, 0);
                        break;

                    // D note
                    case 2:
                        new_midi_channel += pow(2, 1);
                        break;

                    // E note
                    case 4:
                        new_midi_channel += pow(2, 2);
                        break;

                    // F note
                    case 5:
                        new_midi_channel += pow(2, 3);


	return w.allocation_width * BUFFER_BYTES
}

func (w *Widget) Reference() cairo.Surface {
	return w
}

func (w *Widget) SetDestructor(f func()) {
}
func (w *Widget) SetUserData(f func()) {
}
func (w *Widget) SetUserDataWidgetHandler(wh WidgetHandler) {
	w.userdata = wh
}

func (w *Widget) ScheduleResize(width int32, height int32) {
	println("ScheduleResize", width, height)

	var bx = (w.parent_window.form.Width() - w.parent_window.form.ClientWidth())
	var by = w.parent_window.form.Height() - w.parent_window.form.ClientHeight()

	// simple impl
	w.parent_window.form.SetSize(int(width)+bx, int(height)+by)
	w.draw_mut.Lock()
	w.drawnHash = 0
	w.drawnHashes = nil
	w.drawnRects = nil
	w.draw_mut.Unlock()
	w.handler.Resize(w, int32(width), int32(height), int32(width), int32(height))
}

func (w *Widget) Destroy() {
	w.destroyed = true
}

func (w *Widget) SetAllocation(x int32, y int32, pwidth int32, pheight int32) {
	w.draw_mut.Lock()
	defer w.draw_mut.Unlock()

	if pwidth <= 0 || pheight <= 0 {
		w.buffer = nil
		w.swapbuffer = nil
		w.drawnHash = 0
		w.drawnHashes = nil
		w.drawnRects = nil
		w.allocation_x = int(x)
		w.allocation_y = int(y)
		w.allocation_width = 0
		w.allocation_height = 0
	}

	w.allocation_x = int(x)
	w.allocation_y = int(y)
	w.allocation_width = int(pwidth)
	w.allocation_height = int(pheight)
	w.buffer = make([]byte, BUFFER_BYTES*w.allocation_width*w.allocation_height, BUFFER_BYTES*w.allocation_width*w.allocation_height)
	w.swapbuffer = nil
	w.drawnHash = 0
	w.drawnHashes = nil
	w.drawnRects = nil
}

func (w *Widget) setHashHashesRects(hash uint64, hashes map[int]uint64, rects map[[2]int][]rect) {
	w.draw_mut.Lock()
	defer w.draw_mut.Unlock()
	if w.swapbuffer == nil {
		return
	}
	w.drawnHash = hash
	w.drawnHashes = hashes
	w.drawnRects = rects
	w.swapbuffer = nil
}

func (w *Widget) WidgetGetLastTime() uint32 {
	return 0
}

func (w *Widget) ScheduleRedraw() {
	go func() {
	//println("ScheduleRedraw")
	w.draw_mut.Lock()
	is_sch := w.scheduled
	w.draw_mut.Unlock()
	if !is_sch {
		w.draw_mut.Lock()
		w.scheduled = true

		w.handler.Redraw(w)
		w.draw_mut.Unlock()
		//
		w.parent_window.form.Invalidate(false)
		redrawer(w, winc.NewCanvasFromHwnd(w.parent_window.f


.caret,
.card-collapse .card a[data-toggle="collapse"][aria-expanded="true"] i,
.card-collapse .card a[data-toggle="collapse"].expanded i {
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
  -webkit-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  transform: rotate(180deg);
}

.caret {
  width: 0;
  height: 0;
  vertical-align: middle;
  border-top: 4px dashed;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  margin-top: -5px;
  position: absolute;
  top: 30px;
  margin-left: 5px;
}

.pull-left {
  float: left;
}

.pull-right {
  float: right;
}

.card form label+.form-control {
  margin-bottom: 20px;
}

.card .map-title {
  color: #ffffff;
}

.card.card-chart .gmnoprint,
.card.card-chart .gm-style-cc {
  display: none !important;
}

.bd-docs h1,
.bd-docs h2,
.bd-docs h3,
.bd-docs h4,
.bd-docs h5,
.bd-docs h6,
.bd-docs p,
.bd-docs ul li,
.bd-docs ol li {
  color: #2c2c2c;
}

.bd-docs .bd-content>table>thead>tr>th {
  color: #222a42;
}

.bd-docs .blockquote,
.bd-docs .blockquote p,
.bd-docs .card p {
  color: rgba(255, 255, 255, 0.8);
}

.bd-docs .bd-example {
  background: linear-gradient(#1e1e2f, #1e1e24);
}

.bd-docs .navbar {
  border-top: none;
}

.bd-docs .navbar .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
}

.bd-docs .bd-example .btn {
  margin: 4px 0;
}

.bd-docs .bd-example .btn .badge {
  display: inline-block;
}

.bd-docs .bd-example .tim-icons {
  color: #ffffff;
}

.bd-docs .bd-example .popover .popover-header {
  color: rgba(181, 181, 181, 0.6);
}

.bd-docs .bd-example .popover-body p {
  color: #212529;
}

.bd-docs .bd-example.tooltip-demo p {
  color: rgba(255, 255, 255, 0.8);
}

.bd-docs .card.card-body,
.bd-docs .card .card-body {
  color: rgba(255, 255, 255, 0.8);
}

.bd-docs label,
.bd-docs .form-check {
  color: rgba(255, 255, 255, 0.8);
}

.bd-docs .form-check+.btn {
  margin-top: 20px;
}

.bd-docs .bd-example thead th,
.bd-docs table thead th {
  color: rgba(255, 255, 255, 0.8);
}

.bd-docs .bd-example h1,
.bd-docs .bd-example h2,
.bd-docs .bd-example h3,
.bd-docs .bd-example h4,
.bd-docs .bd-example h5,
.bd-docs .bd-example h6,
.bd-docs .bd-example .h1,
.bd-docs .bd-example .h2,
.bd-docs .bd-example .h3,
.bd-docs .bd-example .h4,
.bd-docs .bd-example .h5,
.bd-docs .bd-example .h6,
.bd-docs table h1,
.bd-docs table h2,
.bd-docs table h3,
.bd-docs table h4,
.bd-docs table h5,


666;
// $color_alabaster_approx: #f9f9f9;
// $color_pumice_approx: #c8c8c8;
// $color_celeste_approx: #cdcdcd;
// $color_mercury_approx: #e6e6e6;
// $color_mine_shaft_approx: #333333;
// $color_log_cabin_approx: #222222;
// $white: #ffffff;
// $color_anakiwa_approx: #a2d5fa;
// $color_pattens_blue_approx: #e0f2ff;
// $color_matisse_approx: #0f6099;

//fonts -> utils/_fonts.scss
// $font_0: メイリオ;
// $font_1: ヒラギノ角ゴ Pro W3;
// $font_2: Hiragino Kaku Gothic Pro;
// $font_3: ＭＳ Ｐゴシック;
// $font_4: sans-serif;

//urls
$url_pju1: url(../../../../images/gem/skin/vertical/icon-calender-02.png);
$url_pju2: url(../../../../images/gem/skin/vertical/icon-calender-03.png);
$url_pju3: url(../../../../images/gem/skin/vertical/icon-calender-02_o.png);
$url_pju4: url(../../../../images/gem/skin/vertical/icon-calender-03_o.png);

//@extend-elements
//original selectors
//.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited
%extend_pju1 {
	color: $color_log_cabin_approx;
	font-weight: normal;
	background: $white;
}

//original selectors
//.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight
%extend_pju2 {
	border-color: $color_anakiwa_approx;
	color: $color_mine_shaft_approx;
	background-color: $color_pattens_blue_approx;
	background-image: none;
}

//original selectors
//.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active
%extend_pju3 {
	border-color: $color_anakiwa_approx;
	color: $color_matisse_approx;
	background-color: $white;
	background-image: none;
}

//original selectors
//.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus
%extend_pju4 {
	border-color: $color_anakiwa_approx;
	color: $color_matisse_approx;
	background-color: $white;
	background-image: none;
}

//original selectors
//.ui-widget-header .ui-state-hover, .ui-widget-header .ui-state-focus
%extend_pju5 {
	border: none;
	color: $color_matisse_approx;
	background: none;
	background-image: none;
}

//original selectors
//.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next
%extend_pju6 {
	width: 25px;
	height: 25px;
	top: 0;
}

//original selectors
//.ui-state-hover.ui-datepicker-prev .ui-icon, .ui


 self, offset: u64) -> BitResult<BitPackObjHeader> {
        self.seek(SeekFrom::Start(offset))?;
        self.read_pack_obj_header()
    }

    pub fn read_obj_from_offset_raw(&mut self, offset: u64) -> BitResult<BitPackObjRawDeltified> {
        trace!("read_obj_from_offset_raw(offset: {})", offset);
        self.seek(SeekFrom::Start(offset))?;
        self.read_pack_obj()
    }
}

impl<R> Deref for PackfileReader<R> {
    type Target = R;

    fn deref(&self) -> &Self::Target {
        &self.reader
    }
}

impl<R> DerefMut for PackfileReader<R> {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.reader
    }
}

#[cfg(test)]
mod tests;
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.

// Substrate 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.

// Substrate 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 Substrate.  If not, see <http://www.gnu.org/licenses/>.

//! Tests for phragmen.

#![cfg(test)]

use crate::mock::*;
use crate::{elect, PhragmenResult};
use sp_runtime::Perbill;
use substrate_test_utils::assert_eq_uvec;

#[test]
fn float_phragmen_poc_works() {
	let candidates = vec![1, 2, 3];
	let voters = vec![(10, vec![1, 2]), (20, vec![1, 3]), (30, vec![2, 3])];
	let stake_of = create_stake_of(&[(10, 10), (20, 20), (30, 30), (1, 0), (2, 0), (3, 0)]);
	let mut phragmen_result = elect_float(2, 2, candidates, voters, &stake_of).unwrap();
	let winners = phragmen_result.clone().winners;
	let assignments = phragmen_result.clone().assignments;

	assert_eq_uvec!(winners, vec![(2, 40), (3, 50)]);
	assert_eq_uvec!(
		assignments,
		vec![
			(10, vec![(2, 1.0)]),
			(20, vec![(3, 1.0)]),
			(30, vec![(2, 0.5), (3, 0.5)]),
		]
	);

	let mut support_map = build_support_map(&mut phragmen_result, &stake_of);

	assert_eq!(
		support_map.get(&2).unwrap(),
		&_Support {
			own: 0.0,
			total: 25.0,
			others: vec![(10u64, 10.0), (30u64, 15.0)]
		}
	);
	assert_eq!(
		support_map.get(&3).unwrap(),
		&_Support {
			own: 0.0,
			total: 35.0,
			others: vec![(20u64, 20.0), (30u64, 15.0)]
		}
	);

	equalize_float(phragm


ok_clip6
; move.w #$043,$ffff8240.w
 sub.w #400,d1
 swap d1
 divu.w d5,d1
 add.w d1,d0
 move.w #199+200,d1
ok_clip6

 sub.w #200,d0			On remet les coordonnes
 sub.w #200,d1			En etat car clipping termine
 sub.w #200,d2
 sub.w #200,d3

 lea.l table_y,a1		Trouve adresse ecran
 add.w d1,d1
 add.w d1,a1
 add.w (a1),a0
 lea.l table_x,a1
 add.w d0,d0
 add.w d0,a1
 add.w (a1),a0

 lea.l offset_x,a1		Pose adresse de saut et RTS
 add.w d0,d0			Feinte:d0 tait dej *2
 add.w d0,a1
 move.l (a1),a1
 move.l a1,saut+2		Adresse de saut

 lea.l offset_x,a1
 add.w d2,d2
 add.w d2,d2
 add.w d2,a1
 cmp.l #offset_x2,a1
 blo.s ok_clip1
 lea.l offset_x2-4,a1
ok_clip1
 move.l (a1),a1
 move.w (a1),r_rts+2		Ancien Contenu
 move.l a1,r_rts+4		Adresse de Rts
 move.w #$4e75,(a1)		Pose le rts

 move.w d5,a1			a1=pente
 moveq.w #-128,d0		Valeur de chaque point
 moveq.w #64,d1			Composant l'octet d'ecran
 moveq.w #32,d2
 moveq.w #16,d3
 moveq.w #8,d4
 moveq.w #2,d5
 moveq.w #1,d6
 moveq.w #0,d7			Compteur de pente
saut  jsr code_x
 move.l a0,(a3)+
r_rts move.w #0,code_x
 rts

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; routine de ligne verticale (Dy>Dx) ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

line_y
 move.w #$203,$ffff8240.w
 swap d4
 divu.w d5,d4

 subi.w #200,d0
 subi.w #200,d1
 subi.w #200,d2
 subi.w #200,d3

 move.l #$00010007,d2
 lea.l table_x2,a1		Calcul adresse ecran
 add.w d0,d0
 add.w d0,d0
 add.w d0,a1
 add.w (a1)+,a0
 move.w (a1),d0
 cmpi.w #8,d0
 blo.s ok_d2
 subq.w #8,d0
 swap d2
 subq.w #1,a0
ok_d2
 addq.w #1,a0
 lea.l table_y,a1
 add.w d1,d1
 add.w d1,a1
 add.w (a1),a0

 lea.l offset_y,a1
 add.w d5,d5
 add.w d5,d5
 add.w d5,a1
 move.l (a1),a1
 move.w (a1),r_rts2+2
 move.l a1,r_rts2+4
 move.w #$4e75,(a1)

 moveq.w #0,d7
 move.w a2,d1
 jsr code_y
r_rts2
 move.w #0,code_y
 move.l a0,(a3)+
 rts

;;;;;;;;;;;;;;;;;;;;


The method succeeded.

E_POINTER

The pulCount parameter is null.

## -see-also

IMFSensorActivityReport---
description: D3DX10_WELD_EPSILONS structure - Specifies tolerance values for each vertex component when comparing vertices to determine if they are similar enough to be welded together.
ms.assetid: b28a17bd-5d5b-41b3-86d9-327f5497fc94
title: D3DX10_WELD_EPSILONS structure (D3DX10.h)
ms.topic: reference
ms.date: 05/31/2018
topic_type:
- APIRef
- kbSyntax
api_name:
- D3DX10_WELD_EPSILONS
api_type:
- HeaderDef
api_location:
- D3DX10.h
---

# D3DX10\_WELD\_EPSILONS structure

Specifies tolerance values for each vertex component when comparing vertices to determine if they are similar enough to be welded together.

## Syntax

```C++
typedef struct D3DX10_WELD_EPSILONS {
  FLOAT Position;
  FLOAT BlendWeights;
  FLOAT Normal;
  FLOAT PSize;
  FLOAT Specular;
  FLOAT Diffuse;
  FLOAT Texcoord[8];
  FLOAT Tangent;
  FLOAT Binormal;
  FLOAT TessFactor;
} D3DX10_WELD_EPSILONS, *LPD3DX10_WELD_EPSILONS;
```

## Members

**Position**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Position

**BlendWeights**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Blend weight

**Normal**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Normal

**PSize**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Point size value

**Specular**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Specular lighting value

**Diffuse**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Diffuse lighting value

**Texcoord**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Eight texture coordinates

**Tangent**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Tangent

**Binormal**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Binormal

**TessFactor**

Type: **[**FLOAT**](../winprog/windows-data-types.md)**

Tessellation factor

## Remarks

The LPD3DXWeldEpsilons type is defined as a pointer to the D3DXWeldEpsilons structure.

```
typedef D3DX_WELD_EPSILONS *LPD3DX_WELD_EPSILONS;
```

## Requirements

| Requirement | Value |
|-------------------|---------------------


4e2",
  ["fa-parachute-box"] = "\\f4cd",
  ["fa-indent"] = "\\f03c",
  ["fa-truck-field-un"] = "\\e58e",
  ["fa-hourglass"] = "\\f254",
  ["fa-mountain"] = "\\f6fc",
  ["fa-user-md"] = "\\f0f0",
  ["fa-info-circle"] = "\\f05a",
  ["fa-cloud-meatball"] = "\\f73b",
  ["fa-camera"] = "\\f030",
  ["fa-square-virus"] = "\\e578",
  ["fa-meteor"] = "\\f753",
  ["fa-car-on"] = "\\e4dd",
  ["fa-sleigh"] = "\\f7cc",
  ["fa-sort-numeric-down"] = "\\f162",
  ["fa-hand-holding-water"] = "\\f4c1",
  ["fa-water"] = "\\f773",
  ["fa-calendar-check"] = "\\f274",
  ["fa-braille"] = "\\f2a1",
  ["fa-prescription-bottle-medical"] = "\\f486",
  ["fa-landmark"] = "\\f66f",
  ["fa-truck"] = "\\f0d1",
  ["fa-crosshairs"] = "\\f05b",
  ["fa-person-cane"] = "\\e53c",
  ["fa-tent"] = "\\e57d",
  ["fa-vest-patches"] = "\\e086",
  ["fa-check-double"] = "\\f560",
  ["fa-sort-alpha-down"] = "\\f15d",
  ["fa-money-bill-wheat"] = "\\e52a",
  ["fa-cookie"] = "\\f563",
  ["fa-undo"] = "\\f0e2",
  ["fa-hdd"] = "\\f0a0",
  ["fa-grin-squint-tears"] = "\\f586",
  ["fa-dumbbell"] = "\\f44b",
  ["fa-rectangle-list"] = "\\f022",
  ["fa-tarp-droplet"] = "\\e57c",
  ["fa-house-medical-circle-check"] = "\\e511",
  ["fa-skiing-nordic"] = "\\f7ca",
  ["fa-calendar-plus"] = "\\f271",
  ["fa-plane-arrival"] = "\\f5af",
  ["fa-circle-left"] = "\\f359",
  ["fa-train-subway"] = "\\f239",
  ["fa-chart-gantt"] = "\\e0e4",
  ["fa-inr"] = "\\e1bc",
  ["fa-crop-simple"] = "\\f565",
  ["fa-money-bill-alt"] = "\\f3d1",
  ["fa-long-arrow-alt-left"] = "\\f30a",
  ["fa-dna"] = "\\f471",
  ["fa-virus-slash"] = "\\e075",
  ["fa-subtract"] = "\\f068",
  ["fa-chess"] = "\\f439",
  ["fa-long-arrow-left"] = "\\f177",
  ["fa-plug-circle-check"] = "\\e55c",
  ["fa-street-view"] = "\\f21d",
  ["fa-franc-sign"] = "\\e18f",
  ["fa-volume-off"] = "\\f026",
  ["fa-hands-asl-interpreting"] = "\\f2a3",
  ["fa-gear"] = "\\f013",
  ["fa-tint-slash"] = "\\f5c7",
  ["fa-mosque"] = "\\f678",
  ["fa-mosquito"] = "\\e52b",
  ["fa-star-of-david"] = "\\f69a",
  ["fa-person-military-rifle"] = "\\e54b",
  ["fa-shopping-cart"] = "\\f07a",
  ["fa-vials"] = "\\f493",
  ["fa-plug-circle-


Array[noteIndex])
    end

    setNotesThatArePlaying(chordNotesArray)
end

function playOrInsertScaleChord2(scaleNoteIndex, chordTypeIndex)
    local actionDescription = "scale chord " ..
        scaleNoteIndex .. "  (" .. scaleChords[scaleNoteIndex][chordTypeIndex].code .. ")"
    local root = scaleNotes[scaleNoteIndex]
    local chord = scaleChords[scaleNoteIndex][chordTypeIndex]

    local octave = getOctave()
    local chordNotesArray = getChordNotesArray(root, chord, octave)

    if activeTake() ~= nil and notCurrentlyRecording() then
        startUndoBlock()

        if thereAreNotesSelected() then
            changeSelectedNotesToScaleChords(chordNotesArray)
        else
            insertScaleChord(chordNotesArray, false)
        end

        endUndoBlock(actionDescription)
    end

    playScaleChord(chordNotesArray)
    updateChordText(root, chord, chordNotesArray)
end

function ChordButtonSelected(scaleNoteIndex, chordTypeIndex)
    local selectedScaleNote = getSelectedScaleNote()
    local selectedChordType = getSelectedChordType(scaleNoteIndex)

    local chordTypeIsSelected = (tonumber(chordTypeIndex) == tonumber(selectedChordType))
    local scaleNoteIsSelected = (tonumber(scaleNoteIndex) == tonumber(selectedScaleNote))

    return chordTypeIsSelected and scaleNoteIsSelected
end

Achord_store_tbl = {}
for i = 1, #notes do
    Achord_store_tbl[i] = scaleChords
end

local minorSymbols = { 'i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii' }
local majorSymbols = { 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII' }
local diminishedSymbol = 'o'
local augmentedSymbol = '+'
local sixthSymbol = '6'
local seventhSymbol = '7'

local prog = {
    ["MAJ"] = {
        ["MAJ"] = { [0] = "I", [1] = "V", [11] = "IV", [-1] = "IV" },
        ["MIN"] = { [0] = "VI", [1] = "III", [2] = "VII", [11] = "II", [-1] = "II" },
    },
    ["MIN"] = {
        ["MAJ"] = { [0] = 3, [1] = 7, [11] = 6, [-1] = 6 },
        ["MIN"] = { [0] = 1, [1] = 5, [2] = 2, [11] = 4, [-1] = 4 },
    },
}

function updateScaleDegreeHeaders2()
    for i = 1, #scaleNotes do
        local symbol = ""

        local chord = scaleChords[i][1]

        if string.match(chord.code, "major") or chord.code == '7' then
            symbol = majorSymbols[i]
        else
            symbol = minorSymbols[i]
        end

        if (chord.code == 'aug') then
            symbol = symbol .. augmentedSymbol
        end

        if (chord.code == 'dim') then
            symbol = symbol .. diminishedSymbol
        end

        if string.match(chord.code, "6") then
            symbol = symbol .. sixthSymbol
        end

        if string.match(chord.code, "7") then
            symbol = symbol .. seventhSymbol
        end
        if i > 1 then r.ImGui_SameLine(ctx) end

        r.ImGui_InvisibleButton(ctx, symbol, buttonWidth, buttonHeight / 1.5)
        DrawListButton(symbol, 0x242424ff)
    end
end

local function DrawChords()
    local scaleNoteIndex = 1
    local col = 1
    local prev_note
    updateScaleDegreeHeaders2()
    local x, y = r.ImGui_GetCursorPos(ctx)

    for note = getScaleTonicNote(), getScaleTonicNote() + 11 do
        if noteIsInScale(note) then
            for chordTypeIndex, chord in ipairs(scaleChords[scaleNoteIndex]) do
                local text = getScaleNoteName(scaleNoteIndex) .. chord['display']

                local numberOfChordsInScale = getNumberOfScaleChordsForScaleNoteIndex(scaleNoteIndex)


;
  margin: 2rem 0;
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: var(--radius-lg);
  background: var(--md-default-bg-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--spade-purple-300);
}

.feature-card h3 {
  margin-top: 0;
  color: var(--spade-purple-600);
  font-size: 1.125rem;
  font-weight: 600;
}

/* Modern Tables */
.md-typeset table:not([class]) {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.md-typeset table:not([class]) th {
  background: var(--spade-purple-50);
  color: var(--spade-purple-800);
  font-weight: 600;
}

/* Search Styling */
.md-search__input {
  border-radius: var(--radius-md);
  border: 1px solid var(--md-default-fg-color--lightest);
  transition: all 0.2s ease;
}

.md-search__input:focus {
  border-color: var(--spade-purple-500);
  box-shadow: 0 0 0 3px var(--spade-purple-100);
}

/* Modern Logo Styling */
.md-header__button.md-logo img {
  height: 2.5rem;
  width: auto;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.md-header__button.md-logo img:hover {
  transform: scale(1.05);
}

/* Remove duplicate rules - handled above in Top navigation tabs section */

/* Modern Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--md-default-bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--spade-purple-300);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--spade-purple-400);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1rem;
  }

  .md-header__button.md-logo img {
    height: 2rem;
  }
}

/* Button Text Alignment and Spacing Fix */
.md-button,
.md-button.md-button--primary {
  text-align: center !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  margin: 0.25rem 0 !important;
}

/* Ensure button text is never invisible */
.md-button *,
.md-button.md-button--primary * {
  color: inherit !important;
}

/* Fix button positioning in paragraphs */
p .md-button,
p .md-button.md-button--primary {
  display: inline-flex !important;
  vertical-align: middle !important;
  margin: 0.25rem 0.5rem 0.25rem 0 !important;
}

/* Modern Focus States */
.md-button:focus-visible,
.md-b


';
import 'package:end_to_end_test/graphql/__generated__/schema.schema.gql.dart'
    as _i1;
import 'package:end_to_end_test/graphql/__generated__/serializers.gql.dart'
    as _i2;

part 'aliased_hero.var.gql.g.dart';

abstract class GAliasedHeroVars
    implements Built<GAliasedHeroVars, GAliasedHeroVarsBuilder> {
  GAliasedHeroVars._();

  factory GAliasedHeroVars([void Function(GAliasedHeroVarsBuilder b) updates]) =
      _$GAliasedHeroVars;

  factory GAliasedHeroVars.create({required _i1.GEpisode ep}) =>
      GAliasedHeroVars((b) => b..ep = ep);

  _i1.GEpisode get ep;
  static Serializer<GAliasedHeroVars> get serializer =>
      _$gAliasedHeroVarsSerializer;

  Map<String, dynamic> toJson() => (_i2.serializers.serializeWith(
        GAliasedHeroVars.serializer,
        this,
      ) as Map<String, dynamic>);

  static GAliasedHeroVars? fromJson(Map<String, dynamic> json) =>
      _i2.serializers.deserializeWith(
        GAliasedHeroVars.serializer,
        json,
      );
}
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'aliased_hero.var.gql.dart';

// **************************************************************************
// BuiltValueGenerator
// **************************************************************************

Serializer<GAliasedHeroVars> _$gAliasedHeroVarsSerializer =
    _$GAliasedHeroVarsSerializer();

class _$GAliasedHeroVarsSerializer
    implements StructuredSerializer<GAliasedHeroVars> {
  @override
  final Iterable<Type> types = const [GAliasedHeroVars, _$GAliasedHeroVars];
  @override
  final String wireName = 'GAliasedHeroVars';

  @override
  Iterable<Object?> serialize(Serializers serializers, GAliasedHeroVars object,
      {FullType specifiedType = FullType.unspecified}) {
    final result = <Object?>[
      'ep',
      serializers.serialize(object.ep,
          specifiedType: const FullType(_i1.GEpisode)),
    ];

    return result;
  }

  @override
  GAliasedHeroVars deserialize(
      Serializers serializers, Iterable<Object?> serialized,
      {FullType specifiedType = FullType.unspecified}) {
    final result = GAliasedHeroVarsBuilder();

    final iterator = serialized.iterator;
    while (iterator.moveNext()) {
      final key = iterator.current! as String;
      iterator.moveNext();
      final Object? value = iterator.current;
      switch (key) {
        case 'ep':
          result.ep = serializers.deserialize(value,
              specifiedType: const FullType(_i1.GEpisode))! as _i1.GEpisode;
          break;
      }
    }

    return result.build();
  }
}

class _$GAliasedHeroVars extends GAliasedHeroVars {
  @override
  final _i1.GEpisode ep;

  factory _$GAliasedHeroVars(
          [void Function(GAliasedHeroVarsBuilder)? updates]) =>
      (GAliasedHeroVarsBuilder()..update(updates))._build();

  _$GAliasedHeroVars._({required this.ep}) : super._();
  @override
  GAliasedHeroVars rebuild(void Function(GAliasedHeroVarsBuilder) updates) =>
      (toBuilder()..update(updates)).build();

  @override
  GAliasedHeroVarsBuilder toBuilder() =>
      GAliasedHeroVarsBuilder()..replace(this);

  @override
  bool operator ==(Object other) {
    if (identical(other


an>销量
                            {{product.sales}}

                            评价
                            {{product.reviews}}

            {{cat.name}}

                   {{product.subTitle | splitFilter }}

                    全部

20">{{product.name | subStringFilter(0,20)}}...

{{product.name}}

￥{{product.promotePrice | formatMoneyFilter}}
                    ￥{{product.originalPrice | formatMoneyFilter}}

            首页

            我的店铺
            会员中心
            零号博客

                    售后服务

帮助中心

联系我们

反馈建议

<!DOCTYPE html>

<head th:include="back/include/header::html('会员


GVtcGxveW1lbnQ= 7184
IGNyZWF0dXJl 7185
IHJlc3VsdGluZw== 7186
IGFjY3VyYXRl 7187
IG1vbWVudHM= 7188
IGFyZ3VlZA== 7189
IHBlZA== 7190
RHVyaW5n 7191
IDUz 7192
IFRhbA== 7193
IHNvdWdodA== 7194
IHN1ZmZlcmluZw== 7195
IGljb24= 7196
bGVl 7197
ICgk 7198
YWxpYW4= 7199
wrA= 7200
IHByYQ== 7201
IGJvbnVz 7202
KCI= 7203
a28= 7204
IGFjdGluZw== 7205
REU= 7206
ZmFsbA== 7207
IGNvbXBhcmlzb24= 7208
IHNtb290aA== 7209
IE5BUw== 7210
dXBw 7211
IEpvc2VwaA== 7212
ZXBpbmc= 7213
IFRha2U= 7214
IE1pZA== 7215
IHNlbmRpbmc= 7216
ZmFzdA== 7217
IEZhbGw= 7218
IGRlYWxpbmc= 7219
dXNlcg== 7220
IE9yZ2Fu 7221
Q28= 7222
IGF0dGFjaGVk 7223
IHNlZXM= 7224
JS4= 7225
IHR5cGljYWw= 7226
QVJU 7227
IGZpbmRz 7228
IEFzaWE= 7229
dW1pbg== 7230
IENvcmU= 7231
IEVudA== 7232
aW5lbnQ= 7233
dWNl 7234
IEJsb29k 7235
IE5ldmVy 7236
IGVtYWlscw== 7237
IGhpZ2hsaWdodA== 7238
IGNvbmZyb250 7239
YXR1cw== 7240
dXRlZA== 7241
IHVudXM= 7242
IHRvcGlj 7243
IEFkYW0= 7244
IGJsZQ== 7245
YXRp 7246
IHVuZGVyc3Rvb2Q= 7247
U2V0 7248
c3RydWN0 7249
VFA= 7250
IG1vYg== 7251
YWE= 7252
IFN0YXJ0 7253
cGVjdGVk 7254
c2VsbA== 7255
IGRlZGljYXRlZA== 7256
IENB 7257
dWFu 7258
IHNvbmdz 7259
ZXNjcmlwdGlvbg== 7260
IHRlY2g= 7261
IHJhcGU= 7262
IGFzaWRl 7263
IGdyYW50 7264
IDU2 7265
c3Vi 7266
IGFyZ3Vl 7267
IGNvbnRhaW5pbmc= 7268
IHNjaGVkdWxl 7269
IGxpYmVyYWw= 7270
IHB1YmxpY2x5 7271
IGhlYXZpbHk= 7272
IFV0 7273
aW5lcg== 7274
IFNlY3Rpb24= 7275
IENhcmU= 7276
d2VldA== 7277
bHM= 7278
RGlz 7279
4pSA 7280
IEZvbGxvdw== 7281
QmFjaw== 7282
IElU 7283
IGJlcw== 7284
amk= 7285
IEhpdA== 7286
ZXN0ZWQ= 7287
IGV2ZXJ5Ym9keQ== 7288
IFN3ZWQ= 7289
IGZlbWlu 7290
IGZhY2lsaXRpZXM= 7291
IGNvbnZlbg== 7292
Q29tcA== 7293
IE9T 7294


 generate */
			while (samples--)
			{
				/* fetch two samples */
				INT32 val1 = (INT16)base[accum >> 11];
				INT32 val2 = (INT16)base[((accum + (1 << 11)) & voice->accum_mask) >> 11];

				/* interpolate */
				val1 = interpolate(val1, val2, accum);
				accum = (accum - freqcount) & voice->accum_mask;

				/* apply filters */
				apply_filters(voice, val1);

				/* update filters/volumes */
				if (voice->ecount != 0)
				{
					update_envelopes(voice, 1);
					lvol = chip->volume_lookup[voice->lvol >> 4];
					rvol = chip->volume_lookup[voice->rvol >> 4];
					twincobra2_check();
				}

				/* apply volumes and add */
				*lbuffer++ += (val1 * lvol) >> 11;
				*rbuffer++ += (val1 * rvol) >> 11;

				/* check for loop end */
				check_for_end_reverse(voice, accum);
			}
		}
	}

	/* if we stopped, process any additional envelope */
alldone:
	voice->accum = accum;
	if (samples > 0)
		update_envelopes(voice, samples);
}

/**********************************************************************************************

     generate_samples -- tell each voice to generate samples

***********************************************************************************************/

static void generate_samples(INT32 *left, INT32 *right, INT32 samples)
{
	INT32 v;

	/* skip if nothing to do */
	if (!samples)
		return;

	/* clear out the accumulator */
	memset(left, 0, samples * sizeof(left[0]));
	memset(right, 0, samples * sizeof(right[0]));

	/* loop over voices */
	for (v = 0; v <= chip->active_voices; v++)
	{
		es5506_voice *voice = &chip->voice[v];
		UINT16 *base = chip->region_base[voice->control >> 14];

		/* special case: if end == start, stop the voice */
		if (voice->start == voice->end)
			voice->control |= CONTROL_STOP0;

		/* generate from the appropriate source */
		if (!base)
		{
			//logerror("NULL region base %d\n",voice->control >> 14);
			generate_dummy(voice, base, left, right, samples);
		}
		else if (voice->control & 0x2000)
			generate_ulaw(voice, base, left, right, samples);
		else
			generate_pcm(voice, base, left, right, samples);

		/* does this voice have it's IRQ bit raised? */
		if (voice->control&CONTROL_IRQ)
		{
			//logerror("IRQ raised on voice %d!!\n",v);
			/* only update voice vector if existing IRQ is acked by host */
			if (chip->irqv&0x80)
			{
				/* latch voice number into vector, and set high bit low */
				chip->irqv=v&0x7f;

				/* take down IRQ bit on voice */
				voice->control&=~CONTROL_IRQ;

				/* inform host of irq */
				update_irq_state();
			}
		}
	}
}

/**********************************************************************************************

     es5506_update -- update the sound chip so that it is in sync with CPU execution

***********************************************************************************************/

void ES5506Update(INT16 *outputs, INT32 samples_len)
{
#if defined FBA_DEBUG
	if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Update called without init\n"));
#endif

	if (samples_len != nBurnSoundLen) {
		bprintf(0, _T("ES550XUpdate(): once per frame, please!\n"));
		return;
	}

#if 0
	if


 -> Boolean)? = null): Boolean =
    template<Boolean>("resizable", f, this, resizableProperty()!! as ObservableValue<Boolean>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <S, T> javafx.scene.control.TableColumnBase<S, T>.sortable(f: (() -> Boolean)? = null): Boolean =
    template<Boolean>("sortable", f, this, sortableProperty()!! as ObservableValue<Boolean>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <S, T> javafx.scene.control.TableColumnBase<S, T>.comparator(f: (() -> java.util.Comparator<T>)? = null): java.util.Comparator<T> =
    template<java.util.Comparator<T>>("comparator", f, this, comparatorProperty()!! as ObservableValue<java.util.Comparator<T>>)

// javafx.scene.control.ComboBox

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.items(f: (() -> javafx.collections.ObservableList<T>)? = null): javafx.collections.ObservableList<T> =
    template<javafx.collections.ObservableList<T>>("items", f, this, itemsProperty()!! as ObservableValue<javafx.collections.ObservableList<T>>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.selectionModel(f: (() -> javafx.scene.control.SingleSelectionModel<T>)? = null): javafx.scene.control.SingleSelectionModel<T> =
    template<javafx.scene.control.SingleSelectionModel<T>>("selectionModel", f, this, selectionModelProperty()!! as ObservableValue<javafx.scene.control.SingleSelectionModel<T>>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.placeholder(f: (() -> javafx.scene.Node)? = null): javafx.scene.Node =
    template<javafx.scene.Node>("placeholder", f, this, placeholderProperty()!! as ObservableValue<javafx.scene.Node>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.cellFactory(f: (() -> javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>>)? = null): javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>> =
    template<javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>>>("cellFactory", f, this, cellFactoryProperty()!! as ObservableValue<javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>>>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.buttonCell(f: (() -> javafx.scene.control.ListCell<T>)? = null): javafx.scene.control.ListCell<T> =
    template<javafx.scene.control.ListCell<T>>("buttonCell", f, this, buttonCellProperty()!! as ObservableValue<javafx.scene.control.ListCell<T>>)

[suppress("USELESS_CAST_STATIC_ASSERT_IS_FINE")] [suppress("UNCHECKED_CAST")]
public fun <T> javafx.scene.control.ComboBox<T>.visibleRowCount(f: (() -


( - math.pi * 0.5 );
    ground = three.Mesh( plane, three.ShadowMaterial.fromMap( { 'opacity': 0.5 } ) );
    ground.receiveShadow = true;
    ground.position.z = - 0.5;
    threeJs.scene.add( ground );

    final three.TextureLoader tl = three.TextureLoader();

    final map = await tl.fromAsset('assets/textures/jade.jpg' );
    map?.colorSpace = three.SRGBColorSpace;
    map?.wrapS = map.wrapT = three.RepeatWrapping;
    map?.repeat.setValues( 20, 20 );
    map?.flipY = false;

    final disolveMap = await tl.fromAsset( 'assets/textures/shaderball_ds.jpg' );
    disolveMap?.flipY = false;

    final noise = await tl.fromAsset( 'assets/textures/noise.png' );

    await three.RGBELoader().setPath( 'assets/textures/equirectangular/' ).fromAsset( 'moonless_golf_1k.hdr').then (( texture ) {
      final dataTexture = texture as three.DataTexture;
      dataTexture.mapping = three.EquirectangularReflectionMapping;
      threeJs.scene.background = dataTexture;
      threeJs.scene.environment = dataTexture;
      threeJs.scene.backgroundBlurriness = 0.5;
      threeJs.scene.backgroundIntensity = 0.15;
      threeJs.scene.environmentIntensity = 0.15;

      render();
    });

    final loader = three.GLTFLoader().setPath( 'assets/models/gltf/ShaderBall2/' );
    await loader.fromAsset( 'ShaderBall2.gltf').then(( gltf ) {
      final shaderBall = gltf!.scene.children[ 0 ];

      // shaderBall is a group with 3 children : base, inside and logo
      // ao map is include in model

      int i = shaderBall.children.length, n = 0;

      while ( i > 0) {
        i--;
        shaderBall.children[ i ].receiveShadow = true;
        shaderBall.children[ i ].castShadow = true;
        shaderBall.children[ i ].renderOrder = n ++;
      }

      material = shaderBall.children[ 0 ].material!;
      material.map = map;
      material.alphaMap = disolveMap;
      material.transparent = true;

      materialIn = shaderBall.children[ 1 ].material!;
      materialIn.alphaMap = disolveMap;
      materialIn.transparent = true;

      material.onBeforeCompile = (shader,r) {
        shader.uniforms[ 'disolve' ] = { 'value': 0.0 };
        shader.uniforms[ 'threshold' ] = { 'value': 0.2 };

        shader.uniforms[ 'noiseMap' ] = { 'value': noise };
        shader.uniforms[ 'enableRandom' ] = { 'value': 1.0 };
        shader.uniforms[ 'useNoiseMap' ] = { 'value': 1.0 };
        shader.uniforms[ 'useSuslikMethod' ] = { 'value': 0.0 };
        shader.uniforms[ 'debugNoise' ] = { 'value': 0.0 };

        shader.fragmentShader = shader.fragmentShader?.replaceAll( '#include <clipping_planes_pars_fragment>', '#include <clipping_planes_pars_fragment>$randomUV');
        shader.fragmentShader = shader.fragmentShader?.replaceAll( '#include <map_fragment>', mapFragment );

        // for disolve
        shader.fragmentShader = shader.fragmentShader?.replaceAll( '#include <alphamap_pars_fragment>', alphamapParsFragment );
        shader.fragmentShader = shader.fragmentShader?.replaceAll( '#include <alphamap_fragment>', alphamapFragment );

        uniforms = shader.uniforms;
      };


                val tempTranslateX = pdfView.mCanvasTranslate.x + velocityX * 0.75f
                val tempTranslateY = pdfView.mCanvasTranslate.y + velocityY * 0.75f
                val endTranslateX = when {
                    tempTranslateX in canTranslateXRange -> tempTranslateX
                    tempTranslateX > canTranslateXRange.upper -> canTranslateXRange.upper
                    else -> canTranslateXRange.lower
                }
                val endTranslateY = when {
                    tempTranslateY in canTranslateYRange -> tempTranslateY
                    tempTranslateY > canTranslateYRange.upper -> canTranslateYRange.upper
                    else -> canTranslateYRange.lower
                }

                val distanceX = endTranslateX - pdfView.mCanvasTranslate.x
                val distanceY = endTranslateY - pdfView.mCanvasTranslate.y

                pdfView.startFlingAnim(distanceX, distanceY)
                return true
            }

            return super.onFling(e1, e2, velocityX, velocityY)
        }
    }

    /**
     * 飞速滑动动画更新回调
     */
    private class PDFFlingAnimUpdateListener(
        pdfView: PDFView,
        private val distanceX: Float,
        private val distanceY: Float
    ) : ValueAnimator.AnimatorUpdateListener {
        private val mWeakReference = WeakReference(pdfView)
        private val lastCanvasTranslate = PointF(
            pdfView.mCanvasTranslate.x,
            pdfView.mCanvasTranslate.y
        )

        override fun onAnimationUpdate(animation: ValueAnimator) {
            val pdfView = mWeakReference.get() ?: return

            //飞速滑动时，不渲染缩放的 bitmap
            pdfView.clearScalingPages()

            val percent = animation.animatedValue as Float
            pdfView.mCanvasTranslate.x = lastCanvasTranslate.x + distanceX * percent
            pdfView.mCanvasTranslate.y = lastCanvasTranslate.y + distanceY * percent
            pdfView.invalidate()
            //重新计算当前页索引
            pdfView.calculateCurrentPageIndex()
        }
    }

    private class PdfFlingAnimListenerAdapter(pdfView: PDFView) : AnimatorListenerAdapter() {
        private val mWeakReference = WeakReference(pdfView)

        override fun onAnimationCancel(animation: Animator?) {
            preLoadPdf()
        }

        override fun onAnimationEnd(animation: Animator?) {
            preLoadPdf()
        }

        private fun preLoadPdf() {
            val pdfView = mWeakReference.get() ?: return
            pdfView.submitCreateLoadingPagesTask()
        }
    }

    /**
     * 线程任务
     * 创建要显示的pdf页的bitmap集合
     * 有本地缓存的话用本地缓存，没有缓存的话从pdf生成bitmap后缓存
     */
    private class PdfPageToBitmapTask(pdfView: PDFView) : Runnable {
        private val mWeakReference = WeakReference(pdfView)
        override fun run() {
            val pdfView = mWeakReference.get() ?: return
            val tempLoadingPages = arrayListOf<DrawingPage>()
            val pdfRenderer = pdfView.mPdfRenderer ?: return
            val pagePlaceHolders = pdfView.mPagePlaceHolders
            val currentPageIndex = pdfView.mCurrentPageIndex
            val startLoadingIndex = max(0, currentPageIndex - pdfView.mOffscreenPageLimit)
            val endLoadingIndex =
                min(currentPageIndex + pdfView.mOffscreenPageLimit, pagePlaceHolders.lastIndex)
            for (index in startLoadingIndex..endLoadingIndex) {
                val pageRect = pagePlaceHolders[index]
                val fillWidthRect = pageRect.fillWidthRect


(): `number`

Get the current joint translation, usually in meters.

#### Returns

`number`

***

### getLocalAnchorA()

> **getLocalAnchorA**(): [`Vec2`](/api/classes/Vec2)

The local anchor point relative to bodyA's origin.

#### Returns

[`Vec2`](/api/classes/Vec2)

***

### getLocalAnchorB()

> **getLocalAnchorB**(): [`Vec2`](/api/classes/Vec2)

The local anchor point relative to bodyB's origin.

#### Returns

[`Vec2`](/api/classes/Vec2)

***

### getLocalAxisA()

> **getLocalAxisA**(): [`Vec2`](/api/classes/Vec2)

The local joint axis relative to bodyA.

#### Returns

[`Vec2`](/api/classes/Vec2)

***

### getMaxMotorTorque()

> **getMaxMotorTorque**(): `number`

#### Returns

`number`

***

### getMotorSpeed()

> **getMotorSpeed**(): `number`

Get the motor speed, usually in radians per second.

#### Returns

`number`

***

### getMotorTorque()

> **getMotorTorque**(`inv_dt`): `number`

Get the current motor torque given the inverse time step, usually in N-m.

#### Parameters

• **inv\_dt**: `number`

#### Returns

`number`

***

### getNext()

> **getNext**(): [`Joint`](/api/classes/Joint)

Get the next joint the world joint list.

#### Returns

[`Joint`](/api/classes/Joint)

#### Inherited from

[`Joint`](/api/classes/Joint).[`getNext`](/api/classes/Joint#getnext)

***

### getReactionForce()

> **getReactionForce**(`inv_dt`): [`Vec2`](/api/classes/Vec2)

Get the reaction force on bodyB at the joint anchor in Newtons.

#### Parameters

• **inv\_dt**: `number`

#### Returns

[`Vec2`](/api/classes/Vec2)

#### Overrides

[`Joint`](/api/classes/Joint).[`getReactionForce`](/api/classes/Joint#getreactionforce)

***

### getReactionTorque()

> **getReactionTorque**(`inv_dt`): `number`

Get the reaction torque on bodyB in N*m.

#### Parameters

• **inv\_dt**: `number`

#### Returns

`number`

#### Overrides

[`Joint`](/api/classes/Joint).[`getReactionTorque`](/api/classes/Joint#getreactiontorque)

***

### getSpringDampingRatio()

> **getSpringDampingRatio**(): `number`

#### Returns

`number`

***

### getSpringFrequencyHz()

> **getSpringFrequencyHz**(): `number`

#### Returns

`number`

***

### getType()

> **getType**(): `string`

Get the type of the concrete joint.

#### Returns

`string`

#### Inherited from

[`Joint`](/api/classes/Joint).[`getType`](/api/classes/Joint#gettype)

***

### getUserData()

> **getUserData**(): `unknown`

#### Returns

`unknown`

#### Inherited from

[`Joint`](/api/classes/Joint).[`getUserData`](/api/classes/Joint#getuserdata)

***

### initVelocityConstraints()

> **initVelocityConstraints**(`step`): `void`

#### Parameters

• **step**: [`TimeStep`](/api/classes/TimeStep)

#### Returns

`void`

#### Overrides

[`Joint`](/api/classes/Joint).[`initVelocityConstraints`](/api/classes/Joint#initvelocityconstraints)

***

### isActive()

> **isActive**(): `boolean`

Short-cut function to determine i


 SurfaceHolder) {
            }
        })

//        doIfPermission {
//            etUri.setText(getUri())
//        }

        btnSav.setOnClickListener {
            doIfPermission {
                val dir = File(URI_PATH_ROOT)
                if (!dir.exists()) {
                    val mkd = dir.mkdirs()
                    Toast.makeText(this@MainActivity, "创建目录：$mkd", Toast.LENGTH_SHORT).show()
                }
                etUri.setText(etUri.text.toString().replace("https", "http").replace("\n", ""))
                val uri = etUri.text.toString()
                uriString = uri

                val file = File(URI_PATH_ROOT + URI_FILE_NAME)

                try {
                    if (!file.exists()) {
                        file.createNewFile()
                    }
                    val fos = FileOutputStream(file)
                    fos.write(uri.toByteArray())
                    fos.close()
                    Toast.makeText(this@MainActivity, "设置成功，内容保存在：$URI_PATH_ROOT$URI_FILE_NAME", Toast.LENGTH_SHORT).show()
                } catch (e: Exception) {
                    Toast.makeText(this, "设置失败：${e.message}", Toast.LENGTH_SHORT).show()
                }
            }
        }

    }

    private fun doIfPermission(callback: (() -> Unit)?) {
        if (!hasPermission()) {
            requestPermission()
            afterRequestPermissionCallback = callback
        } else {
            callback?.invoke()
        }
    }

    private fun requestPermission() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED
                || checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED
            ) {
                requestPermissions(arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE), 1)
            }
        }
    }

    private fun hasPermission(): Boolean {
        val bool = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_DENIED
                    && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_DENIED)
        } else true
        if (!bool) {
            Toast.makeText(this, "Permission denied", Toast.LENGTH_SHORT).show()
        }
        return bool
    }

    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults)
        if (grantResults.isNotEmpty() && requestCode == 1) {
            if (grantResults[0] != PackageManager.PERMISSION_DENIED) {
                if (afterRequestPermissionCallback != null) {
                    afterRequestPermissionCallback?.invoke()
                    afterRequestPermissionCallback = null
                } else {
                    Toast.makeText(this, "Permission granted", Toast.LENGTH_SHORT).show()
                }
            }
        }
    }

}package xyz.sangcomz.chameleonsample

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.RecyclerView
import com.squareup.picasso.Picasso

/**
 * Created by sangcomz on 27/03/2018.
 */
class ChameleonAdapter : RecyclerView.Adapter<ChameleonAdapter.ChameleonViewHolder>() {
    private var chameleonList: List<Chameleon> = arrayListOf()

    fun set