,
    .payment-options {
      flex-direction: column;
      align-items: center;
    }

    .pricing-plan,
    .payment-option {
      width: 100%;
      max-width: 100%;
    }
  }
</style>

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>SPA Router with Web Components</title>

Loading...

  <button class="theme-toggle" id="theme-toggle">Toggle Theme</button>


dates: [
        {
          employeeId: null,
          updatedDate: null
        }
      ],
      managerId: null,
      managerName: null
    }
  ],
  managers: [
    {
      employeeId: null,
      employeeSurname: null,
      employeeName: null
    }
  ]
};

/**
 * Parse response for init
 */
const parseInitManagerResponse = res => {
  let employees = [];
  let departments = [];
  let managers = [];
  if (!_.isNil(res)) {
    employees = res.employees;
    departments = res.departments;
    managers = res.managers;
  }
  return { employees, departments, managers };
};

export type ManagerSettingState = Readonly<typeof managerSettingState>;

/**
 * Reducer manager setting
 */
export default (state: ManagerSettingState = managerSettingState, action): ManagerSettingState => {
  switch (action.type) {
    case REQUEST(ACTION_TYPES.INIT_MANAGER_MODEL):
    case ACTION_TYPES.RESET_MANAGER:
      return {
        ...managerSettingState
      };
    case REQUEST(ACTION_TYPES.SET_MANAGER):
      return {
        ...state
      };
    case FAILURE(ACTION_TYPES.INIT_MANAGER_MODEL):
    case FAILURE(ACTION_TYPES.SET_MANAGER):
      return {
        ...state,
        errorMessage: action.payload.message,
        errorItems: parseErrorRespose(action.payload),
        isUpdateSuccess: false
      };
    case SUCCESS(ACTION_TYPES.INIT_MANAGER_MODEL): {
      const res = parseInitManagerResponse(action.payload.data);
      return {
        ...state,
        employees: res.employees,
        departments: res.departments,
        managers: res.managers
      };
    }
    case SUCCESS(ACTION_TYPES.SET_MANAGER): {
      return {
        ...state,
        isUpdateSuccess: true,
        msgSuccess: { successId: SHOW_MESSAGE_SUCCESS.UPDATE }
      };
    }
    default:
      return state;
  }
};

// API base URL
const employeesApiUrl = API_CONTEXT_PATH + '/' + API_CONFIG.EMPLOYEE_SERVICE_PATH;

/**
 * Init modal
 */
export const initializeManagerModal = employeeIds => ({
  type: ACTION_TYPES.INIT_MANAGER_MODEL,
  payload: axios.post(`${employeesApiUrl}/get-initialize-manager-modal`, employeeIds, {
    headers: { ['Content-Type']: 'application/json' }
  })
});

// PARAM_INITIALIZE_MANAGER_MODAL
// initializeManagerModal(employeeIds: ${JSON.stringify(employeeIds).replace(/"(\w+)"\s*:/g, '$1:')}) {
/**
 * Update manager
 */
export const setManager = settingParams => ({
  type: ACTION_TYPES.SET_MANAGER,
  payload: axios.post(
    `${API_CONTEXT_PATH}/${API_CONFIG.EMPLOYEE_SERVICE_PATH}/set-managers`,
    { settingParams },
    { headers: { ['Content-Type']: 'application/json' } }
  )
});

/**
 * Init modal
 */
export const handleInitializeManagerModal = employeeIds => async dispatch => {
  const data = { employeeIds };
  await dispatch(initializeManagerModal(data));
};

/**
 * update manager
 */
export const handleSetManager = settingParams => async


 animations: Animation[] = [];
		let ticksRootAnimation: Animation;
		let ticksAnimations: Animation[] = [];
		let prevScaleY = scaleY;
		let prevScaleX = scaleX;
		let prevStep = step;
		let prevTranslateX = translateX;
		let prevScaleYLerp = lerp(prevScaleY, prevScaleY);
		let prevScaleXLerp = lerp(prevScaleX, prevScaleX);
		let prevTranslateXLerp = lerp(prevTranslateX, prevTranslateX);
		let disappearing: Set<number> = new Set();
		let appearing: Set<number> = new Set();

		subscribe<ChartState>(index, (curr, prev) => {
			const duration = DUR;
			const currentTime = animations.length >= 1 && animations[0].currentTime || 0;
			const t = currentTime!/duration;
			animations.forEach(a => a.cancel());
			ticksRootAnimation && ticksRootAnimation.cancel();
			ticksAnimations.forEach(a => a.cancel());

			const toDisappear = subtract(curr.hiddenLines, prev.hiddenLines);
			const toAppear = subtract(prev.hiddenLines, curr.hiddenLines);

			const [left,right] = curr.coord;

			const maxY = chart.lines
				.map(l=>l.data)
				.reduce(concat,[])
				.reduce(max2, -Infinity);

			const allVisibleData = chart.lines.filter((l, i) =>!curr.hiddenLines.has(i)).map(l=>l.data);
			const maxVisibleY = allVisibleData.reduce(concat,[]).reduce(max2, -Infinity);
			const inViewData = allVisibleData.map(data => data.slice(floor(toIndex(left)),ceil(toIndex(right))));
			const maxInViewY = inViewData.reduce(concat,[]).reduce(max2, -Infinity);
			const scaleVisibleY = maxVisibleY/maxInViewY;

			const epsilonData = allVisibleData.map(data => data.slice(max2(0,floor(toIndex(left - epsilon))),min2(chart.length -1, ceil(toIndex(right + epsilon)))));
			const maxEpsilonY = epsilonData.reduce(concat,[]).reduce(max2, -Infinity);
			const scaleEpsY = maxVisibleY/maxEpsilonY;
			const scaleY = 0.5 * (scaleVisibleY + scaleEpsY) * (maxY / maxVisibleY);
			scaleX = 1/(right - left);
			const translateX = -left*100;

			animations = polylines.map((poly, lineIdx) => {
				const transform = [
					`scale(${prevScaleXLerp(t)},${prevScaleYLerp(t)}) translate(${prevTranslateXLerp(t)}%)`,
					`scale(${scaleX}, ${scaleY}) translate(${translateX}%)`,
				];
				const opacityFrom = disappearing.has(lineIdx) ?
					lerp(1,0)(t) :
					appearing.has(lineIdx) ?
						lerp(0,1)(t):
						toAppear.has(lineIdx) ?
							'0':
							toDisappear.has(lineIdx) ?
								'1':
								curr.hiddenLines.has(lineIdx) ?
									'0':
									'1';
				const opacityTo = curr.hiddenLines.has(lineIdx) ? '0' : '1';
				const opacity = [opacityFrom, opacityTo];
				return poly.animate({transform, opacity} as PropertyIndexedKeyframes,{duration, fill});
			});

			(()=>{
				const transform = [
					`translate(${prevTranslateXLerp(t)}%)`,
					`translate(${translateX}%)`,
				];
				const width = [
					`${prevScaleXLerp(t)*ticksW}px`,
					`${scaleX*ticksW}px`,
				];


-- Original code and concept by Antiarc. Used and modified with his permission.
-- First adaptation in dbm credits to VEM team. Continued on their behalf do to no time from original author to make it an external mod or DBM plugin.

---@class DBM
local DBM = DBM

---@class DBMHudMap
local mod =  {
	Version = 2 -- That way external usage can querie hud api feature level of of users installed mod version
}

DBM.HudMap = mod

local wipe, type, pairs, ipairs, tinsert, tremove, tonumber, setmetatable, unpack = table.wipe, type, pairs, ipairs, table.insert, table.remove, tonumber, setmetatable, unpack
local abs, pow, sqrt, sin, cos, atan2, floor, ceil, min, max, pi2 = math.abs, math.pow, math.sqrt, math.sin, math.cos, math.atan2, math.floor, math.ceil, math.min, math.max, math.pi * 2
local error = error

local CallbackHandler = _G["LibStub"]:GetLibrary("CallbackHandler-1.0")
---@class DBMMHudMapUpdateFrame: Frame
local updateFrame = CreateFrame("Frame", "DBMHudMapUpdateFrame")
local fixedOnUpdateRate = 0.03
local onUpdate, Point, Edge
local callbacks = CallbackHandler:New(mod)
local activeMarkers = 0
local hudarActive = false
local playerName = UnitName("player")
local encounterMarkers = {}

local GetNumGroupMembers, IsInRaid = GetNumGroupMembers, IsInRaid
local GetTime, WorldFrame = GetTime, WorldFrame
local UnitExists, UnitIsUnit, UnitPosition, UnitIsConnected, GetPlayerFacing = UnitExists, UnitIsUnit, UnitPosition, UnitIsConnected, GetPlayerFacing

local RAID_CLASS_COLORS = _G["CUSTOM_CLASS_COLORS"] or RAID_CLASS_COLORS

-- TAXIROUTE_LINEFACTOR_2 global is removed in legion, but TAXIROUTE_LINEFACTOR still exists, so we create our own
local TAXIROUTE_LINEFACTOR_2 = TAXIROUTE_LINEFACTOR / 2

-- Hard code STANDARD_TEXT_FONT since skinning mods like to taint it (or worse, set it to nil, wtf?)
local standardFont
if LOCALE_koKR then
	standardFont = "Fonts\\2002.TTF"
elseif LOCALE_zhCN then
	standardFont = "Fonts\\ARKai_T.ttf"
elseif LOCALE_zhTW then
	standardFont = "Fonts\\blei00d.TTF"
elseif LOCALE_ruRU then
	standardFont = "Fonts\\FRIZQT___CYR.TTF"
else
	standardFont = "Fonts\\FRIZQT__.TTF"
end

local targetCanvasAlpha, supressCanvas

---@enum (key) textureLookup
local textureLookup = {
	star		= 137001, -- [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_1.blp]]
	circle		= 137002, -- [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_2.blp]]
	diamond		= 137003, -- [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_3.BLP]]
	triangle	= 137004, -- [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_4.blp]]
	moon		= 137005, -- [[Interface\TARGET


img: PhotonImage, level: number): void;
/**
* Lighten an image by a specified amount in the LCh colour space.
*
* # Arguments
* * `img` - A PhotonImage.
* * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
* The `level` must be from 0 to 1 in floating-point, `f32` format.
* Lightening by 80% would be represented by a `level` of 0.8
*
* # Example
* ```no_run
* // For example to lighten an image by 10% in the LCh colour space:
* use photon_rs::colour_spaces::lighten_lch;
* use photon_rs::native::open_image;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* lighten_lch(&mut img, 0.1_f32);
* ```
* @param {PhotonImage} img
* @param {number} level
*/
export function lighten_lch(img: PhotonImage, level: number): void;
/**
* Lighten an image by a specified amount in the HSL colour space.
* # Arguments
* * `img` - A PhotonImage.
* * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
* The `level` must be from 0 to 1 in floating-point, `f32` format.
* Lightening by 80% would be represented by a `level` of 0.8
*
* # Example
* ```no_run
* // For example to lighten an image by 10% in the HSL colour space:
* use photon_rs::colour_spaces::lighten_hsl;
* use photon_rs::native::open_image;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* lighten_hsl(&mut img, 0.1_f32);
* ```
* @param {PhotonImage} img
* @param {number} level
*/
export function lighten_hsl(img: PhotonImage, level: number): void;
/**
* Lighten an image by a specified amount in the HSV colour space.
*
* # Arguments
* * `img` - A PhotonImage.
* * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
* The `level` must be from 0 to 1 in floating-point, `f32` format.
* Lightening by 80% would be represented by a `level` of 0.8
*
* # Example
* ```no_run
* // For example to lighten an image by 10% in the HSV colour space:
* use photon_rs::colour_spaces::lighten_hsv;
* use photon_rs::native::open_image;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* lighten_hsv(&mut img, 0.1_f32);
* ```
* @param {PhotonImage} img
* @param {number} level
*/
export function lighten_hsv(img: PhotonImage, level: number): void;
/**
* Darken the image by a specified amount in the LCh colour space.
*
* # Arguments
* * `img` - A PhotonImage.
* * `level` - Float value from 0 to 1 representing the level to which to darken the image by.
* The `level` must be from 0 to 1 in floating-point, `f32` format.
* Darkening by 80% would be represented by a `level` of 0.8
*
* # Example
* ```no_run
* // For example to darken an image by 10% in the LCh colour space:
* use photon_rs::colour_spaces::darken_lch;
* use photon_rs::native::open_image;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* darken_lch


 can use.
    params.push(id.html_escape().to_mut().clone());
    params.push(apikey.html_escape().to_mut().clone());

    let vec: Vec<Acctcat> =
        conn.prep_exec("SELECT id, apikey, account_id, category_id from accounts_categories where id = :id and apikey = :apikey", params)
            .map(|result| {
                result.map(|x| x.unwrap()).map(|row| {
                    let (id, apikey, account_id, category_id) = rocket_contrib::databases::mysql::from_row(row);
                    Acctcat {id, apikey, account_id, category_id}
                }).collect()
            }).unwrap();

    match vec.len() {
        0 => Json(GetAcctcatResponse::Error(String::from("record not found"))),
        1 => Json(GetAcctcatResponse::One((*vec.get(0).unwrap()).clone())), // why is this one different?
        _ => Json(GetAcctcatResponse::Error(String::from(
            "ID01T Max fubar error. More than one record found. This does not compute.",
        ))),
    }
}

#[rocket::get("/acctcats/for_category?<apikey>&<category_id>")]
pub fn get_acctcats_for_category(
    apikey: &RawStr,
    category_id: &RawStr,
    mut conn: MyRocketSQLConn,
) -> Json<GetAcctcatResponse> {
    let mut params = Vec::new();

    // We receive these arguments as &RawStr.  We must convert them into a form that the mysql parametrization can use.
    params.push(apikey.html_escape().to_mut().clone());
    params.push(category_id.html_escape().to_mut().clone());

    let vec: Vec<Acctcat> =
        conn.prep_exec("SELECT id, apikey, account_id, category_id from accounts_categories where apikey = :apikey and category_id = :category_id", params)
            .map(|result| {
                result.map(|x| x.unwrap()).map(|row| {
                    let (id, apikey, account_id, category_id) = rocket_contrib::databases::mysql::from_row(row);
                    Acctcat {id, apikey, account_id, category_id}
                }).collect()
            }).unwrap();

    Json(GetAcctcatResponse::Many(vec))
}

#[rocket::post("/acctcats", data = "<acctcat>")]
pub fn post_acctcat(
    acctcat: rocket::request::Form<AcctcatShort>,
    mut conn: MyRocketSQLConn,
) -> Json<APIResponse> {
    match conn.prep_exec("INSERT INTO accounts_categories (apikey, account_id, category_id) VALUES (:apikey, :account_id, :category_id)",(&acctcat.apikey, &acctcat.account_id, &acctcat.category_id)) {
        Ok(result) => Json(APIResponse::LastInsertId(result.last_insert_id())),
        Err(err) => Json(APIResponse::Error(String::from(err.to_string())))
    }
}

#[rocket::put("/acctcats", data = "<acctcat>")]
pub fn put_acctcat(
    acctcat: rocket::request::Form<Acctcat>,
    mut conn: MyRocketSQLConn,
) -> Json<APIResponse> {
    match conn.prep_exec("UPDATE accounts_categories SET account_id = :account_id, category_id = :category_id where id = :id and apikey = :apikey",(&


uth"),
        ClosedPD(nose, SvgParts.NOSE, "nose"),
        RoundStrokePD(tail, SvgParts.TAIL, TAIL_STROKE_WIDTH, "tail"),
        ClosedPD(tailCap, SvgParts.TAIL_CAP, "tail_cap"),
        ClosedPD(tailShadow, SvgParts.TAIL_SHADOW, "tail_shadow", false),
        ClosedPD(foot1, SvgParts.FOOT1, "foot1"),
        ClosedPD(leg1, SvgParts.LEG1, "leg1"),
        ClosedPD(foot2, SvgParts.FOOT2, "foot2"),
        ClosedPD(leg2, SvgParts.LEG2, "leg2"),
        ClosedPD(foot3, SvgParts.FOOT3, "foot3"),
        ClosedPD(leg3, SvgParts.LEG3, "leg3"),
        ClosedPD(foot4, SvgParts.FOOT4, "foot4"),
        ClosedPD(leg4, SvgParts.LEG4, "leg4"),
        ClosedPD(leg2Shadow, SvgParts.LEG2_SHADOW, "leg2_shadow", false),
        ClosedPD(body, SvgParts.BODY, "body"), ClosedPD(belly, SvgParts.BELLY, "belly"),
        ClosedPD(bowtie, SvgParts.BOWTIE, "bowtie"),
    )

    fun toSvg(colors: List<Color>, size: Int = 512): String {
        val nodes = drawOrders.mapIndexed { i, draw ->
            draw.toSvgNode(colors[i])
        }.joinToString(separator = "\n  ")
        return SvgParts.FORMAT_SVG.format(size, size, nodes)
    }

    private class RoundStrokePD(
        path: Path,
        pathData: String,
        val strokeWidth: Float,
        name: String,
    ) : PathDraw(path, pathData, name) {
        override fun DrawScope.draw(color: Color) {
            drawPath(path, color, style = Stroke(width = strokeWidth, cap = StrokeCap.Round))
        }

        override fun AndroidCanvas.androidDraw(paint: Paint) {
            paint.style = Paint.Style.STROKE
            paint.strokeWidth = strokeWidth
            paint.strokeCap = Paint.Cap.ROUND
            drawPath(path.asAndroidPath(), paint)
        }

        override fun toSvgNode(color: Color): String {
            return SvgParts.FORMAT_PATH_STROKE.format(
                name, pathData, strokeWidth.toString().trimZeroAndDot(),
                Utilities.getHexColor(color, color.alpha < 1f)
            )
        }
    }

    private class ClosedPD(
        path: Path,
        pathData: String,
        name: String,
        touchable: Boolean = true,
    ) : PathDraw(path, pathData, name, touchable) {
        override fun DrawScope.draw(color: Color) {
            drawPath(path, color, style = Fill)
        }

        override fun AndroidCanvas.androidDraw(paint: Paint) {
            paint.style = Paint.Style.FILL
            drawPath(path.asAndroidPath(), paint)
        }

        override fun toSvgNode(color: Color): String {
            return SvgParts.FORMAT_PATH.format(
                name, pathData,
                Utilities.getHexColor(color, color.alpha < 1f)
            )
        }
    }

    abstract class


[j];

        // Update maximum
        maximum = Math.Max(maximum, sumk);
    }

    return maximum;
}

// Driver code
public static void Main()
{
    int []arr = { 3, 6, 4, 7, 2 };
    int n = arr.Length;
    int K = 2;

    Console.WriteLine(maxSum(arr, n, K));
}
}

// This code is contributed by Akanksha Rai
```

## **服务器端编程语言（Professional Hypertext Preprocessor 的缩写）**

```
<?php
// PHP implementation of the approach

// Function to return the maximum sum for
// every possible sequence such that
// a[i] + a[i+k] + a[i+2k] + ... + a[i+qk]
// is maximized
function maxSum($arr, $n, $K)
{

    // Initialize the maximum with
    // the smallest value
    $maximum = PHP_INT_MIN;

    // Find maximum from all sequences
    for ($i = 0; $i < $n; $i++)
    {
        $sumk = 0;

        // Sum of the sequence
        // starting from index i
        for ($j = $i; $j < $n; $j += $K)
            $sumk = $sumk + $arr[$j];

        // Update maximum
        $maximum = max($maximum, $sumk);
    }

    return $maximum;
}

// Driver code
$arr = array(3, 6, 4, 7, 2);
$n = sizeof($arr);
$K = 2;

echo maxSum($arr, $n, $K);

// This code is contributed by Akanksha Rai
?>
```

## **java 描述语言**

```
<script>

// JavaScript implementation of the approach

// Function to return the maximum sum for
// every possible sequence such that
// a[i] + a[i+k] + a[i+2k] + ... + a[i+qk]
// is maximized
function maxSum(arr, n, K)
{

    // Initialize the maximum with
    // the smallest value
    var maximum = -1000000000;

    // Find maximum from all sequences
    for (var i = 0; i < n; i++) {

        var sumk = 0;

        // Sum of the sequence
        // starting from index i
        for (var j = i; j < n; j += K)
            sumk = sumk + arr[j];

        // Update maximum
        maximum = Math.max(maximum, sumk);
    }

    return maximum;
}

// Driver code
var arr = [3, 6, 4, 7, 2];
var n = arr.length;
var K = 2;
document.write( maxSum(arr, n, K));

</script>
```

****Output:**

```
13
```**

****高效方法:**这个问题可以通过使用[后缀数组](https://www.geeksforgeeks.org/suffix-array-set-1-introduction/)的概念来解决，我们从右侧迭代数组，并为每个 **(i+k)元素(即。，i+k < n)** ，求最大和。该方法的时间复杂度将为 **O(N)。**
以下是上述方法的实施。**

## **C++**

```
// C++ implementation of the approach
#include <bits/stdc++.h>
using namespace std;

// Function to return the maximum sum for
// every possible sequence such that
// a[i] + a[i+k] + a[i+2k] + ... + a[i+qk]
// is maximized
int maxSum(int arr[], int n, int K)
{

    // Initialize the maximum with
    // the smallest value
    int maximum = INT_MIN


, test_E1_data
    la      x26, test_E1_res

    # Test
    lw      x25, 0(x25)

    # Store results
    sw      x25, 0(x26)

    RVTEST_IO_ASSERT_GPR_EQ(x25, 0x76543210)

    RVTEST_IO_WRITE_STR("# Test part E  - Complete\n");

    # ---------------------------------------------------------------------------------------------
    RVTEST_IO_WRITE_STR("# Test part E2 - test store with same base and destination address, base with offset\n");

    # Addresses for test data and results
    la      x27, test_E2_data + 1
    la      x28, test_E2_res

    # Test
    lw      x27, -1(x27)

    # Store results
    sw      x27, 0(x28)

    RVTEST_IO_ASSERT_GPR_EQ(x27, 0xFEDCBA98)

    RVTEST_IO_WRITE_STR("# Test part A1  - Complete\n");

    RVTEST_IO_WRITE_STR("# Test End\n")

 # ---------------------------------------------------------------------------------------------
    # HALT
    RV_COMPLIANCE_HALT


o(Oo0O[0], 16), Oo0O[1]), QOOQQ(QOQ0o(Oo0O[2], 16), Oo0O[3])];
        }
        ,
        o0QQ0["_x64Rotl"] = function oQoo(OQO0, OQOo) {
            var Oo0O = 58;
            while (Oo0O) {
                switch (Oo0O) {
                case 142 + 6 - 89:
                    {
                        if (oQ00o(OQOo, 32)) {
                            return [OQO0[1], OQO0[0]];
                        }
                        Oo0O = 60;
                        break;
                    }
                case 131 + 13 - 83:
                    {
                        OQOo -= 32;
                        return [QOOQQ(QOQ0o(OQO0[1], OQOo), oQQQQ(OQO0[0], O000o(32, OQOo))), QOOQQ(QOQ0o(OQO0[0], OQOo), oQQQQ(OQO0[1], O000o(32, OQOo)))];
                    }
                case 134 + 8 - 82:
                    {
                        if (QoQOQ(OQOo, 32)) {
                            return [QOOQQ(QOQ0o(OQO0[0], OQOo), oQQQQ(OQO0[1], O000o(32, OQOo))), QOOQQ(QOQ0o(OQO0[1], OQOo), oQQQQ(OQO0[0], O000o(32, OQOo)))];
                        }
                        Oo0O = 61;
                        break;
                    }
                case 91 + 20 - 53:
                    {
                        OQOo %= 64;
                        Oo0O = 59;
                        break;
                    }
                }
            }
        }
        ,
        o0QQ0["_x64LeftShift"] = function Q0o0(OQO0, OQOo) {
            OQOo %= 64;
            if (oQ00o(OQOo, 0)) {
                return OQO0;
            }
            if (QoQOQ(OQOo, 32)) {
                return [QOOQQ(QOQ0o(OQO0[0], OQOo), oQQQQ(OQO0[1], O000o(32, OQOo))), QOQ0o(OQO0[1], OQOo)];
            }
            return [QOQ0o(OQO0[1], O000o(OQOo, 32)), 0];
        }
        ,
        o0QQ0["_x64Xor"] = function QOQQ(OQO0, OQOo) {
            return [oOOQ0(OQO0[0], OQOo[0]), oOOQ0(OQO0[1], OQOo[1])];
        }
        ,
        o0QQ0["_x64Fmix"] = function OQQO(OQO0) {
            OQO0 = this["_x64Xor"](OQO0, [0, oQQQQ(OQO0[0], 1)]),
            OQO0 = this["_x64Multiply"](OQO0, [4283543511, 3981806797]),
            OQO0 = this["_x64Xor"](OQO0, [0, oQQQQ(OQO0[0], 1)]),
            OQO0 = this["_x64Multiply"](OQO0, [3301882366, 444984403]),
            OQO0 = this["_x64Xor"](OQO0, [0, oQQQQ(OQO0[0], 1)]);
            return OQO0;
        }
        ,
        o0QQ0["hash128


Set[1][1])

	require.Len(t, fieldSet[2], 1)
	require.Equal(t, "a", fieldSet[2][0])

	require.Len(t, fieldSet[3], 3)
	require.Equal(t, "b", fieldSet[3][0])
	require.Equal(t, "c", fieldSet[3][1])
	require.Equal(t, "d", fieldSet[3][2])

	require.Len(t, fieldSet[4], 1)
	require.Equal(t, "e", fieldSet[4][0])
}

func TestWithPrefix(t *testing.T) {
	t.Run("prefix with len=capacity", func(t *testing.T) {
		fieldSet := New("foo bar{id}", []string{"prefix"})

		require.Len(t, fieldSet, 2)

		require.Len(t, fieldSet[0], 2)
		require.Equal(t, "prefix", fieldSet[0][0])
		require.Equal(t, "foo", fieldSet[0][1])

		require.Len(t, fieldSet[1], 3)
		require.Equal(t, "prefix", fieldSet[1][0])
		require.Equal(t, "bar", fieldSet[1][1])
		require.Equal(t, "id", fieldSet[1][2])
	})
	t.Run("prefix with len<capacity", func(t *testing.T) {
		prefix := make([]string, 0, 2)
		prefix = append(prefix, "prefix")
		fieldSet := New("foo bar{id}", prefix)

		require.Len(t, fieldSet, 2)
		t.Log(fieldSet)

		require.Len(t, fieldSet[0], 2)
		require.Equal(t, "prefix", fieldSet[0][0])
		require.Equal(t, "foo", fieldSet[0][1])

		require.Len(t, fieldSet[1], 3)
		require.Equal(t, "prefix", fieldSet[1][0])
		require.Equal(t, "bar", fieldSet[1][1])
		require.Equal(t, "id", fieldSet[1][2])
	})
}

func TestHandlesRequiresFieldWithArgument(t *testing.T) {
	obj := &codegen.Object{
		Fields: []*codegen.Field{
			{
				FieldDefinition: &ast.FieldDefinition{
					Name: "foo(limit:4) { bar }",
				},
				TypeReference:    nil,
				GoFieldType:      0,
				GoReceiverName:   "",
				GoFieldName:      "",
				IsResolver:       false,
				Args:             nil,
				MethodHasContext: false,
				NoErr:            false,
				VOkFunc:          false,
				Object:           nil,
				Default:          nil,
				Stream:           false,
				Directives:       nil,
			},
		},
		Implements: nil,
	}

	require.NotNil(t, fieldByName(obj, "foo"))
}

func TestInvalid(t *testing.T) {
	require.Panics(t, func() {
		New("foo bar{baz", nil)
	})
}

func TestToGo(t *testing.T) {
	require.Equal(t, "Foo", Field{"foo"}.ToGo())
	require.Equal(t, "FooBar", Field{"foo", "bar"}.ToGo())
	require.Equal(t, "BarID", Field{"bar", "id"}.ToGo())
}

func TestToGoPrivate(t *testing.T) {
	require.Equal(t, "foo", Field{"foo"}.ToGoPrivate())
	require.Equal(t, "fooBar", Field{"foo", "bar"}.ToGoPrivate())
	require.Equal(t, "barID", Field{"bar", "id"}.ToGoPrivate())
}
package computedrequires

// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.81-dev

import (
	"context"
	"fmt"

	computedrequires "github.com/99designs/gqlgen/plugin/federation/testdata/computedrequires/generated"
	model "github.com/99designs/gqlgen/plugin/federation/testdata/computedrequires/generated/models"
)

// FindHelloByName is the resolv


thisValue.inherits(&JSTestObj::s_info))
        return throwVMTypeError(exec);
    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) {
        setDOMException(exec, TYPE_MISMATCH_ERR);
        return JSValue::encode(jsUndefined());
    }
    RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());

    imp->methodWithCallbackArg(callback);
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSTestObj::s_info))
        return throwVMTypeError(exec);
    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    int nonCallback(exec->argument(0).toInt32(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    if (exec->argumentCount() <= 1 || !exec->argument(1).isObject()) {
        setDOMException(exec, TYPE_MISMATCH_ERR);
        return JSValue::encode(jsUndefined());
    }
    RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject());

    imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSTestObj::s_info))
        return throwVMTypeError(exec);
    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    RefPtr<TestCallback> callback;
    if (exec->argumentCount() > 0 && !exec->argument(0).isNull() && !exec->argument(0).isUndefined()) {
        if (!exec->argument(0).isObject()) {
            setDOMException(exec, TYPE_MISMATCH_ERR);
            return JSValue::encode(jsUndefined());
        }
        callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
    }

    imp->methodWithCallbackAndOptionalArg(callback);
    return JSValue::encode(jsUndefined());
}

static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSTestObj::s_info))
        return throwVMTypeError(exec);
    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    TestObj* objArg(toTestObj(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& strArg(ustringToString(exec->argument(1).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->overloadedMethod(objArg, strArg);
    return JSValue::encode(jsUndefined());
}

static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exe


#pragma once

struct lws;
struct lws_ring;

namespace HttpWsServer
{
    class CHttpWorker;

    enum MediaType {
        media_error = 0,
        media_flv,
        media_hls,
        media_h264,
        media_mp4,
        media_m3u8,
        media_ts
    };

    enum SessState {
        session_init = 0,
        session_play_request,
        session_playing,
        session_stoped
    };

    /** per session structure */
    struct pss_http_ws_live {
        struct lws           *wsi;            // http/ws
        MediaType             media_type;     // ǰýʽ
        CHttpWorker          *pWorker;        // CFlvWorker
        int                   error_code;     // ʧʱĴ
        SessState             session_state;  // Ự״̬
        bool                  send_header;    // ӦǷдheader
    };

    extern int callback_live_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len);

    extern int callback_live_ws(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len);
};


package:window_manager/window_manager.dart';
import 'package:flutter_svg/flutter_svg.dart';

import '../consts.dart';
import '../common.dart';
import '../common/widgets/overlay.dart';
import '../main.dart';
import 'model.dart';

class MessageKey {
  final String peerId;
  final int connId;
  bool get isOut => connId == ChatModel.clientModeID;

  MessageKey(this.peerId, this.connId);

  @override
  bool operator ==(other) {
    return other is MessageKey &&
        other.peerId == peerId &&
        other.isOut == isOut;
  }

  @override
  int get hashCode => peerId.hashCode ^ isOut.hashCode;
}

class MessageBody {
  ChatUser chatUser;
  List<ChatMessage> chatMessages;
  MessageBody(this.chatUser, this.chatMessages);

  void insert(ChatMessage cm) {
    chatMessages.insert(0, cm);
  }

  void clear() {
    chatMessages.clear();
  }
}

class ChatModel with ChangeNotifier {
  static final clientModeID = -1;

  OverlayEntry? chatIconOverlayEntry;
  OverlayEntry? chatWindowOverlayEntry;

  bool isConnManager = false;

  RxBool isWindowFocus = true.obs;
  BlockableOverlayState _blockableOverlayState = BlockableOverlayState();
  final Rx<VoiceCallStatus> _voiceCallStatus = Rx(VoiceCallStatus.notStarted);

  Rx<VoiceCallStatus> get voiceCallStatus => _voiceCallStatus;

  TextEditingController textController = TextEditingController();
  RxInt mobileUnreadSum = 0.obs;
  MessageKey? latestReceivedKey;

  Offset chatWindowPosition = Offset(20, 80);

  void setChatWindowPosition(Offset position) {
    chatWindowPosition = position;
    notifyListeners();
  }

  @override
  void dispose() {
    textController.dispose();
    super.dispose();
  }

  final ChatUser me = ChatUser(
    id: Uuid().v4().toString(),
    firstName: translate("Me"),
  );

  late final Map<MessageKey, MessageBody> _messages = {};

  MessageKey _currentKey = MessageKey('', -2); // -2 is invalid value
  late bool _isShowCMSidePage = false;

  Map<MessageKey, MessageBody> get messages => _messages;

  MessageKey get currentKey => _currentKey;

  bool get isShowCMSidePage => _isShowCMSidePage;

  void setOverlayState(Blockable


x
 */
/**
 * Shape/Symbol
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Diamond
 *
 * @todo add height support
 *
 * @author Alexander Futekov
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Egg
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Heart
 *
 * @author Nicolas Gallagher @necolas
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Infinity
 *
 * @author Nicolas Gallagher @necolas
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Pacman
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Symbol/Yin-yang
 *
 * @author Alexander Futekov
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Micro clearfix hack
 *
 * The clearfix hack is a popular way to clear floats without resorting to using presentational markup. This article presents an update to the clearfix method that further reduces the amount of CSS required.
 * Known support: Firefox 2+, Safari 2+, Chrome, Opera 9.27+, IE 6+, IE Mac.
 *
 * @thanks Nicolas Gallagher @necolas
 * @link http://nicolasgallagher.com/micro-clearfix-hack/
 */
/**
 * Note IE7/6 doesn't understand pseudo element as ::before and ::after
 * IE8 need to have :before and not ::before
 * So use only : and not :: if you want to support IE8
 * IE9 Webkit Firefox Opera understand ::
 */
/**
 * UI convex effect from one color
 *
 * @todo merge with ui-button ?
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * UI Glossy helper
 *
 * @deprecated
 * @todo Remove in 0.4
 * @see background/gradients
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * UI simple gradient from one color
 *
 * @todo merge with ui-button ?
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Shape/Polygon/Triangle
 *
 * @author Maxime Thirouin maxime.thirouin@gmail.com @MoOx
 */
/**
 * Keyboard key touch
 * A simple stylesheet for rendering beautiful keyboard-style elements.

 * @author Michael Hüneburg http://michaelhue.com/keyscss
 * @link https://github.com/michaelhue/keyscss (commit 76bb603e921d0145362e0f60eabb79d4f69cbda0)
 *
 * @author Maxime Thirouin @MoOx maxime.thirouin@gmail.com
*/
/**
 * Menu dropdown helper
 *
 * @author Maxime Thirouin @MoOx maxime.thirouin@gmail.com
*/
/**
 * Ui background overlay inspired by Google Chrome modal overlay
 *
 * @author Maxime Thirouin @MoOx maxime.thirouin@gmail.com
 */
/**
 * Background overlay inspired by Google Chrome modal overlay
 *
 * @author Maxime Thirouin @MoOx maxime.thirouin@gmail.com
 */
/**
 * <hr /> separator style
 *
 * @author Chris Coyier @chriscoyier
 * @link http://jsfiddle.net/chriscoyier/GaEzp/35/
 *
 * @author Maxime Thirouin @MoOx maxime.thirouin@gmail.com
 */
/**
 * Micro clearfix hack
 *
 * The clearfix hack is a popular way to clear floats without


er, rowIndex);
                    //dialog.setVisible(true);
                } else {
                    final Dialog dialog = new DialogDiagramProps(DialogConnectSignalsGraphs.this, true, diagram, _grafer);
                    dialog.setVisible(true);
                    baueGUI();
                }
                setSelectedDiagram(diagram);
            }
        });
        _gbc.gridx = 0;
        _gbc.gridy = rowIndex + 1;
        jpMatrix.add(jlGRF[rowIndex], _gbc);
    }

    private void addMatrixField(final int rowIndex, final int columnIndex) {
        final AbstractDiagram diagram = _manager.getDiagram(rowIndex);
        final AbstractCurve curve = diagram.getCurve(columnIndex - 1);
        jbM[rowIndex][columnIndex] = new FormatJTextField();
        jbM[rowIndex][columnIndex].setEditable(false);
        jbM[rowIndex][columnIndex].setBackground(Color.white);
        jbM[rowIndex][columnIndex].setHorizontalAlignment(JTextField.CENTER);
        jbM[rowIndex][columnIndex].setToolTipText(I18nKeys.CLICK_LEFT_OR_RIGHT_BUTTON.getTranslation());
        jbM[rowIndex][columnIndex].setText(curve.getAxisConnection().toString());

        _gbc.gridx = columnIndex;
        _gbc.gridy = rowIndex + 1;
        jpMatrix.add(jbM[rowIndex][columnIndex], _gbc);  // MATRIX: x/y/y2/sg - Knoepfe als zentrales Element
        jbM[rowIndex][columnIndex].setLineSettable(curve);
        jbM[rowIndex][columnIndex].addMouseListener(new MouseAdapter() {  // x-Achse (Zeit) nicht anklick- und veraenderbar
            @Override
            public void mousePressed(final MouseEvent mouseEvent) {
                final List<AbstractDiagram> diagrams = _manager.getDiagrams();
                AbstractDiagram diagram = diagrams.get(rowIndex);
                AbstractCurve curve = diagram.getCurve(columnIndex - 1);
                setSelectedDiagram(diagram);

                // rechte Maus --> 'Flippen' der ZUORDNUNG ohne Dialogfenster-Eingabe
                if (mouseEvent.getModifiers() == MouseEvent.BUTTON3_MASK || mouseEvent.isControlDown()) {
                    final AxisConnection jcbAchsenTyp = curve.getAxisConnection().iterateNext(diagram instanceof DiagramSignal);
                    diagram.getCurve(columnIndex - 1).setAxisConnection(jcbAchsenTyp);
                    jbM[rowIndex][columnIndex].setText(jcbAchsenTyp.toString());

                    _grafer.doZoomAutoFit();
                    _grafer.setAxisPositions();
                    return;
                }
                // linke Maus --> Dialogfenster

                final Dialog dialog = new DialogCurveProperties(DialogConnectSignalsGraphs.this, true, curve, _grafer);
                dialog.setVisible(true);
                repaint();

                _grafer.setAxisPositions();
            }
        });
    }

    private void addWeightField(final int rowIndex) {
        jtfWEIG[rowIndex] = new FormatJTextField();
        jtfWEIG[rowIndex].setPreferredSize(new Dimension(CELL_WIDTH, CELL_HEIGHT));
        jtfWEIG[rowIndex].setHorizontalAlignment(JTextField.CENTER);
        if (_manager.getDiagram(rowIndex) instanceof DiagramSignal) {
            jtfWEIG[rowIndex].setText("-");
            jtfWEIG[rowIndex].setEnabled(false);
        } else {
            jtfWEIG[rowIndex].setEnabled(true);
            jtfWEIG[rowIndex].setNumberToField(Math.round(HUNDRED * _yWeightDiagram[rowIndex]));
        }
        //
        jtfWEIG[rowIndex].addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent actionEvent) {
                DialogConnectSignalsGraphs.this.modifiedWeightIndex = rowIndex;
                aktualisiereGrafer();
                setSelectedDiagram(_manager.getDiagram(rowIndex));
            }
        });

        _gbc.gridx = _grafer.getManager().getNumberInput


गर्न लाग्ने समय",
  "downloadAnnotated": "टिप्पणी सहित डाउनलाेड गर्नुहोस्",
  "downloadRaw": "टिप्पणी बिना डाउनलोड गर्नुहोस्",
  "downloadImported": "आयातित खेल डाउनलोड गर्नुहोस्",
  "crosstable": "क्रसटेबल",
  "youCanAlsoScrollOverTheBoardToMoveInTheGame": "बोर्ड माथी स्क्रल गरेर पनि चालहरु चल्न सकिन्छ।",
  "analysisShapesHowTo": "शिष्ट र क्लिक वा दायाँ क्लिक गरी गोलाकार वा तीरहरु बनाउनुहोस्।",
  "letOtherPlayersMessageYou": "अरु खेलाडी लाई सन्देश पठाउन दिने",
  "shareYourInsightsData": "तपाइको खेल सम्बन्धित अन्तरदृष्टि तथ्याङ्क अरुलाई देखाउने",
  "withNobody": "कसैलाइ पनि नाई",
  "withFriends": "साथीहरू लाइ",
  "withEverybody": "सबै सगँ",
  "kidMode": "बाल मोड",
  "kidModeExplanation": "यो सुरक्षा के बारे हो। बाल मोडमा, साइटभरी संचार बन्द हुन्छ। यो बालबालिकालाई अरु इन्टरनेट प्रयोगकर्ताहरुबाट बचाउन हो।",
  "inKidModeTheLichessLogoGetsIconX": "बाल मोडमा लीचेसको लोगोले %s चिन्ह पाउनेछन् र तपाइ ढुक्क हुन सक्नुहुन्छ।",
  "enableKidMode": "बाल मोड लागु गरौं",
  "disableKidMode": "बाल मोड बन्द गरौं",
  "security": "सुरक्षा",
  "revokeAllSessions": "सबै सत्र रद्द गर्नुहोस्",
  "playChessEverywhere": "सबै ठाउँमा बुद्धिचाल खेलौं",
  "asFreeAsLichess": "लीचेस जस्तै सित्तैमा",
  "builtForTheLoveOfChessNotMoney": "पैसाको लागि होइन, बुद्धिचाल प्रतिको मायाको लागि बनाइएको",
  "everybodyGetsAllFeaturesForFree": "सबैले सबै सुबिधा सित


EntityId != caa.getEntityId()) {
            phaseReport.append("\nPhysical attacks for " + ae.getDisplayName() + "\n");
        }

        // should we even bother?
        if (te == null || te.isDestroyed() || te.isDoomed() || te.crew.isDead()) {
            phaseReport.append("    Charge cancelled as the target has been destroyed.\n");
            return;
        }

        // attacker fell down?
        if (ae.isProne()) {
            phaseReport.append("    Charge cancelled as the attacker has fallen.\n");
            return;
        }

        // attacker immobile?
        if (ae.isImmobile()) {
            phaseReport.append("    Charge cancelled as the attacker has been immobilized.\n");
            return;
        }

        phaseReport.append("    Charging " + te.getDisplayName());

        // target still in the same position?
        if (!te.getPosition().equals(caa.getTargetPos())) {
            phaseReport.append(" but the target has moved.\n");
            return;
        }

        // compute to-hit
        ToHitData toHit = Compute.toHitCharge(game, caa);

        // if the attacker's prone, fudge the roll
        int roll;
        if (toHit.getValue() == ToHitData.IMPOSSIBLE) {
            roll = -12;
            phaseReport.append(", but the charge is impossible (" + toHit.getDesc() + ") : ");
        } else {
            // roll
            roll = Compute.d6(2);
            phaseReport.append("; needs " + toHit.getValue() + ", ");
            phaseReport.append("rolls " + roll + " : ");
        }

        // do we hit?
        if (roll < toHit.getValue()) {
            Coords src = ae.getPosition();
            Coords dest = Compute.getMissedChargeDisplacement(game, ae.getId(), src, direction);
            phaseReport.append("misses.\n");
            // move attacker to side hex
            doEntityDisplacement(ae, src, dest, null);
        }
	else {
	    // Resolve the damage.
	    resolveChargeDamage( ae, te, toHit, direction );
	}
	return;
    }

    /**
     * Handle a charge's damage
     */
    private void resolveChargeDamage(Entity ae, Entity te, ToHitData toHit, int direction) {

        // we hit...
        int damage = Compute.getChargeDamageFor(ae);
        int damageTaken = Compute.getChargeDamageTakenBy(ae, te);
	PilotingRollData chargePSR = null;

	// If we're upright, we may fall down.
	if ( !ae.isProne() ) {
	    chargePSR = new PilotingRollData(ae.getId(), 2, "charging");
	}

        phaseReport.append("hits.");
        phaseReport.append("\n  Defender takes " + damage + " damage" + toHit.getTableDesc() + ".");
        while (damage > 0) {
            int cluster = Math.min(5, damage);
            HitData hit = te.rollHitLocation(toHit.getHitTable(), toHit.getSideTable());
            phaseReport.append(damageEntity(te, hit, cluster));
            damage -= cluster;
        }
        phaseReport.append("\n  Attacker takes " + damageTaken + " damage.");
        while (damageTaken > 0) {
            int cluster = Math.min(5, damageTaken);
            HitData hit = ae.rollHitLocation(ToHitData.HIT_NORMAL, toHit.SIDE_FRONT);
            phaseReport.append(damageEntity(ae, hit, cluster));
            damageTaken -= cluster;
        }
        // move attacker and target, if possible
        Coords src = te.getPosition();
        Coords dest = src.translated(direction);

        if (Compute.isValidDisplacement(game, te.getId(), te.getPosition(), direction)) {
            phaseReport.append("\n");
            doEntityDisplac


"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// ```
pub fn get<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Get, handler)
}

/// Route `HEAD` requests to the given handler.
///
/// See [`get`] for an example.
pub fn head<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Head, handler)
}

/// Route `OPTIONS` requests to the given handler.
///
/// See [`get`] for an example.
pub fn options<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Options, handler)
}

/// Route `PATCH` requests to the given handler.
///
/// See [`get`] for an example.
pub fn patch<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Patch, handler)
}

/// Route `POST` requests to the given handler.
///
/// See [`get`] for an example.
pub fn post<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Post, handler)
}

/// Route `PUT` requests to the given handler.
///
/// See [`get`] for an example.
pub fn put<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Put, handler)
}

/// Route `TRACE` requests to the given handler.
///
/// See [`get`] for an example.
pub fn trace<H, B, T>(handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    on(MethodFilter::Trace, handler)
}

/// Route requests with the given method to the handler.
///
/// # Example
///
/// ```rust
/// use axum::{handler::on, routing::MethodFilter, prelude::*};
///
/// async fn handler() {}
///
/// // Requests to `POST /` will go to `handler`.
/// let app = route("/", on(MethodFilter::Post, handler));
/// # async {
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// ```
pub fn on<H, B, T>(method: MethodFilter, handler: H) -> OnMethod<IntoService<H, B, T>, EmptyRouter>
where
    H: Handler<B, T>,
{
    OnMethod {
        method,
        svc: handler.into_service(),
        fallback: EmptyRouter::new(),
    }
}

pub(crate) mod sealed {
    #![allow(unreachable_pub, missing_docs, missing_debug_implementations)]

    pub trait HiddentTrait {}
    pub struct Hidden;
    impl HiddentTrait for Hidden {}
}

/// Trait for async functions that can be used to handle requests.
///
/// You shouldn't need to depend on this trait directly. It is automatically
/// implemented to closures of the right types.
///
/// See the [module docs](crate::handler) for more details.
#[async_trait]
pub trait Handler<B, In>: Sized {
    // This seals the trait. We cannot use the regular "sealed super trait"
    // approach due to coherence.
    #


		if updateIdx, ok := newColName2Idx[alias+"."+realColName]; ok {
						colPos = int32(updateIdx)
					}
					args[k] = &plan.Expr{
						Typ: selectNode.ProjectList[colPos].Typ,
						Expr: &plan.Expr_Col{
							Col: &plan.ColRef{
								RelPos: selectNodeTag,
								ColPos: colPos,
							},
						},
					}
				}

				var newIdxExpr *plan.Expr
				if len(idxDef.Parts) == 0 {
					newIdxExpr = args[0]
				} else {
					funcName := "serial"
					if !idxDef.Unique {
						funcName = "serial_full"
					}
					newIdxExpr, _ = BindFuncExprImplByPlanExpr(builder.GetContext(), funcName, args)
				}

				newIdx = len(finalProjList)
				finalProjList = append(finalProjList, newIdxExpr)
			}

			insertCols[0].RelPos = finalProjTag
			insertCols[0].ColPos = int32(newIdx)

			insertCols[1].RelPos = finalProjTag
			insertCols[1].ColPos = finalColName2Idx[alias+"."+tableDef.Pkey.PkeyColName]

			updateCtxList = append(updateCtxList, &plan.UpdateCtx{
				ObjRef:     idxNode.ObjRef,
				TableDef:   idxNode.TableDef,
				InsertCols: insertCols,
				DeleteCols: deleteCols,
			})

			if idxDef.Unique {
				lockTargets = append(lockTargets, &plan.LockTarget{
					TableId:            idxNode.TableDef.TblId,
					ObjRef:             idxNode.ObjRef,
					PrimaryColIdxInBat: int32(oldIdx),
					PrimaryColRelPos:   finalProjTag,
					PrimaryColTyp:      finalProjList[oldIdx].Typ,
				})
				if idxNeedUpdate[i][j] {
					lockTargets = append(lockTargets, &plan.LockTarget{
						TableId:            idxNode.TableDef.TblId,
						ObjRef:             idxNode.ObjRef,
						PrimaryColIdxInBat: int32(newIdx),
						PrimaryColRelPos:   finalProjTag,
						PrimaryColTyp:      finalProjList[newIdx].Typ,
					})
				}
			}
		}
	}

	finalProjNode.ProjectList = finalProjList

	dmlNode := &plan.Node{
		NodeType:      plan.Node_MULTI_UPDATE,
		BindingTags:   []int32{builder.genNewTag()},
		UpdateCtxList: updateCtxList,
	}

	lastNodeID = builder.appendNode(&plan.Node{
		NodeType:    plan.Node_LOCK_OP,
		Children:    []int32{lastNodeID},
		TableDef:    dmlCtx.tableDefs[0],
		BindingTags: []int32{builder.genNewTag()},
		LockTargets: lockTargets,
	}, bindCtx)
	reCheckifNeedLockWholeTable(builder)

	dmlNode.Children = append(dmlNode.Children, lastNodeID)
	lastNodeID = builder.appendNode(dmlNode, bindCtx)

	return lastNodeID, err
}
// Copyright 2022 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied


ᚐDestinationᚄ(ctx, v)
			if err != nil {
				return it, err
			}
			it.Destinations = data
		}
	}

	return it, nil
}

func (ec *executionContext) unmarshalInputServerFilter(ctx context.Context, obj interface{}) (model.ServerFilter, error) {
	var it model.ServerFilter
	asMap := map[string]interface{}{}
	for k, v := range obj.(map[string]interface{}) {
		asMap[k] = v
	}

	fieldsInOrder := [...]string{"name", "namespace"}
	for _, k := range fieldsInOrder {
		v, ok := asMap[k]
		if !ok {
			continue
		}
		switch k {
		case "name":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
			data, err := ec.unmarshalNString2string(ctx, v)
			if err != nil {
				return it, err
			}
			it.Name = data
		case "namespace":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace"))
			data, err := ec.unmarshalNString2string(ctx, v)
			if err != nil {
				return it, err
			}
			it.Namespace = data
		}
	}

	return it, nil
}

func (ec *executionContext) unmarshalInputSocketScanResults(ctx context.Context, obj interface{}) (model.SocketScanResults, error) {
	var it model.SocketScanResults
	asMap := map[string]interface{}{}
	for k, v := range obj.(map[string]interface{}) {
		asMap[k] = v
	}

	fieldsInOrder := [...]string{"results"}
	for _, k := range fieldsInOrder {
		v, ok := asMap[k]
		if !ok {
			continue
		}
		switch k {
		case "results":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("results"))
			data, err := ec.unmarshalNRecordedDestinationsForSrc2ᚕgithubᚗcomᚋotterizeᚋnetworkᚑmapperᚋsrcᚋmapperᚋpkgᚋgraphᚋmodelᚐRecordedDestinationsForSrcᚄ(ctx, v)
			if err != nil {
				return it, err
			}
			it.Results = data
		}
	}

	return it, nil
}

func (ec *executionContext) unmarshalInputTrafficLevelResult(ctx context.Context, obj interface{}) (model.TrafficLevelResult, error) {
	var it model.TrafficLevelResult
	asMap := map[string]interface{}{}
	for k, v := range obj.(map[string]interface{}) {
		asMap[k] = v
	}

	fieldsInOrder := [...]string{"srcIP", "dstIP", "bytesSent", "flows"}
	for _, k := range fieldsInOrder {
		v, ok := asMap[k]
		if !ok {
			continue
		}
		switch k {
		case "srcIP":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("srcIP"))
			data, err := ec.unmarshalNString2string(ctx, v)
			if err != nil {
				return it, err
			}
			it.SrcIP = data
		case "dstIP":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dstIP"))
			data, err := ec.unmarshalNString2string(ctx, v)
			if err != nil {
				return it, err
			}
			it.DstIP = data
		case "bytesSent":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytesSent"))
			data, err := ec.unmarshalNInt2int64(ctx, v)
			if err != nil {
				return it, err
			}
			it.BytesSent = data
		case "flows":
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("flows"))
			data, err := ec.unmarshalNInt2int64(ct


\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e2. Configure mcp-openapi-proxy for Glama\u003c/h4\u003e\u003ca id=\"user-content-2-configure-mcp-openapi-proxy-for-glama\" class=\"anchor\" aria-label=\"Permalink: 2. Configure mcp-openapi-proxy for Glama\" href=\"#2-configure-mcp-openapi-proxy-for-glama\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAdd the following configuration to your MCP ecosystem settings:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n    \u0026quot;mcpServers\u0026quot;: {\n        \u0026quot;glama\u0026quot;: {\n            \u0026quot;command\u0026quot;: \u0026quot;uvx\u0026quot;,\n            \u0026quot;args\u0026quot;: [\u0026quot;mcp-openapi-proxy\u0026quot;],\n            \u0026quot;env\u0026quot;: {\n                \u0026quot;OPENAPI_SPEC_URL\u0026quot;: \u0026quot;https://glama.ai/api/mcp/openapi.json\u0026quot;\n            }\n        }\n    }\n}\"\u003e\u003cpre\u003e{\n    \u003cspan class=\"pl-ent\"\u003e\"mcpServers\"\u003c/span\u003e: {\n        \u003cspan class=\"pl-ent\"\u003e\"glama\"\u003c/span\u003e: {\n            \u003cspan class=\"pl-ent\"\u003e\"command\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003euvx\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/


)
                curveTo(27.8639f, 32.626f, 27.9849f, 32.626f, 28.0807f, 32.685f)
                curveTo(28.1766f, 32.7441f, 28.231f, 32.8522f, 28.2214f, 32.9644f)
                verticalLineTo(35.6142f)
                close()
            }
            path(fill = SolidColor(Color(0xFF373536)), stroke = null, strokeLineWidth = 0.0f,
                    strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
                    pathFillType = NonZero) {
                moveTo(34.3299f, 35.577f)
                curveTo(34.3498f, 35.7404f, 34.2335f, 35.8891f, 34.0701f, 35.909f)
                curveTo(33.9067f, 35.929f, 33.758f, 35.8127f, 33.7381f, 35.6493f)
                lineTo(33.6329f, 34.8098f)
                horizontalLineTo(32.6027f)
                curveTo(32.4381f, 34.8098f, 32.3047f, 34.6764f, 32.3047f, 34.5118f)
                curveTo(32.3047f, 34.3471f, 32.4381f, 34.2137f, 32.6027f, 34.2137f)
                horizontalLineTo(33.5605f)
                lineTo(33.532f, 33.9945f)
                curveTo(33.532f, 33.9945f, 33.532f, 33.9814f, 33.532f, 33.9748f)
                curveTo(33.5243f, 33.9228f, 33.5126f, 33.8715f, 33.497f, 33.8214f)
                curveTo(33.482f, 33.7678f, 33.4622f, 33.7157f, 33.4378f, 33.6657f)
                curveTo(33.3316f, 33.4265f, 33.0967f, 33.2702f, 32.8351f, 33.2646f)
                curveTo(32.7842f, 33.2648f, 32.7334f, 33.2707f, 32.6838f, 33.2822f)
                curveTo(32.6382f, 33.2938f, 32.594f, 33.3107f, 32.5523f, 33.3326f)
                curveTo(32.3139f, 33.47f, 32.1582f, 33.7158f, 32.1359f, 33.9901f)
                lineTo(31.9518f, 35.6449f)
                curveTo(31.9264f, 35.8017f, 31.7825f, 35.9111f, 31.6246f, 35.8935f)
                curveTo(31.4667f, 35.876f, 31.3503f, 35.7377f, 31.36f, 35.5792f)
                lineTo(31.5463f, 33.9244f)
                curveTo(31.5877f, 33.4493f, 31.863f, 33.026f, 32.2805f, 32.7956f)
                curveTo(32.3653f, 32.7543f, 32.4542f, 32.722f, 32.5457f, 32.6992f)
                curveTo(32.6405f, 32.6767f, 32.7377f, 32.6656f, 32.8351f, 32.6663f)
                curveTo(33.3223f, 32.6698f, 33.7633f, 32.9553f, 33.966f, 33.3983f)
                curveTo(34.0075f, 33.479f, 34.0412f, 33.5634f, 34.0668f, 33.6504f)
                curveTo(34.0915f, 33.7298f, 34.1091f, 33.8112f, 34.1194


,send_initial_packet=false)

increase_button OUT -> IN _(boolean/filter) TRUE -> INC power_value
decrease_button OUT -> IN _(boolean/filter) TRUE -> DEC power_value

power_value OUT -> IN _(console:prefix="Power value changed: ")

oic(oic/client-light)
cmdline_arguments OUT -> DEVICE_ID oic

oic POWER -> SET power_value
power_value OUT -> POWER oic

state_button OUT -> IN _(boolean/filter) TRUE -> INC state_value_as_int

state_value_from_boolean(converter/boolean-to-int)
state_value(converter/int-to-boolean)

oic STATE -> IN state_value_from_boolean
state_value OUT -> STATE oic

state_value_from_boolean OUT -> SET state_value_as_int
state_value_as_int OUT -> IN state_value

state_value OUT -> IN _(console:prefix="State changed: ")

# This prints server current state. It is not updated
# when this client updates server though: only if server is changed
# elsewhere `oic` node will send output packets.
oic POWER -> IN _(console:prefix="Server power level is: ")
oic STATE -> IN _(console:prefix="Server state is: ")
```

Now it looks bigger than previous codes, but still small relative to
what it does, I bet!

[Next](../step5/tutorial.md), we will write our HTTP controller.

<a name="footnote_04"/>[4] There are two special cases: some input
ports accept `any` type of packet, like `INC` of `int/accumulator` node
type; these ports can be connected to any output port. And some output
ports outputs `empty` packets; this special type of packet can only be
sent to ports that accept `any` packet as input.
# [1.7.0](https://github.com/SolidAlloy/ExtEvents/compare/1.6.0...1.7.0) (2022-07-24)

### Bug Fixes

* Fixed assertion error when using a response created in an older version of the package ([a477fc6](https://github.com/SolidAlloy/ExtEvents/commit/a477fc6cdcea5a646a6cfa51aacce074d734e08d))
* Started removing the AOT Generation folder after the build is complete ([5a39535](https://github.com/SolidAlloy/ExtEvents/commit/5a39535d42ce1e3a7bb75ab1a3aa78c5fdc4fc0e))

### Features

* Added weak value serialization to SerializationUtility ([f70674e](https://github.com/SolidAlloy/ExtEvents/commit/f70674efc0b612cd32427b5abfa87bf4d1f07d78))

# [1.6.0](https://github.com/SolidAlloy/ExtEvents/compare/1.5.1...1.6.0) (2022-07-06)

### Bug Fixes

* Fixed NullReferenceException when building a project with IL2CPP ([4d11316](https://github.com/SolidAlloy/ExtEvents/commit/4d1131675bfd72ffe71adf21b32a53a88cebe864))

### Features

* Added an ability to override dynamic argument names in the ExtEvent drawer ([dcdaf95](https://github.com/SolidAlloy/ExtEvents/commit/dcdaf955b64c353aeb16667324f3e385c7a3cea9))
* Added methods to serialize generic values to binary using odin serializer ([3db0c79](https://github.com/SolidAlloy/ExtEvents/commit/3db0c7943a57dbaf5173b3a8d0bc1ce51fa449da))
* Switched from GUID to assembly


ar hashTable = {};

hashTable[1] = true;
hashTable['1'] = true;

console.log(hashTable); // { '1': true }
```

然而，因為我們使用了 [`JSON.stringify`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify), keys 是 `String` 的類型，會被轉成字串儲存，這樣 `hashTable` key 就是唯一的。

```javascript
var hashTable = {};

hashTable[JSON.stringify(1)] = true;
hashTable[JSON.stringify('1')] = true;

console.log(hashTable); // { '1': true, '\'1\'': true }
```

意思說重複相同的元素數值，但為不同類型的，可以被保留，而重複的元素仍然會被刪除。

```javascript
var deduped = dedup([
	{ a: 1 },
	{ a: 1 },
	[ 1, 2 ],
	[ 1, 2 ],
	1,
	1,
	'1',
	'1'
]);

console.log(deduped); // [ {a: 1}, [1, 2], 1, '1' ]
```

# 資源
## 方法
* [`filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
* [`indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
* [`from`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
* [`JSON.stringify`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)

## ES2015
* [箭頭函式](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions)
* [Sets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)

## Stack overflow
* [將陣列重複的元素移除](http://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array/9229821#9229821)
---
layout: post

title: 實作非同步迴圈
tip-number: 34
tip-username: madmantalking
tip-username-profile: https://github.com/madmantalking
tip-tldr: 你或許可以實作非同步迴圈，但是執行時可能會遇到問題。

redirect_from:
  - /zh_tw/implementing-asynchronous-loops/

categories:
    - zh_TW
    - javascript
---

讓我們嘗試撰寫一個非同步的函式，在每秒列印出迴圈的索引值。

```js
for (var i = 0; i < 5; i++) {
	setTimeout(function(){
		console.log(i);
	}, 1000 * (i + 1));
}
```
上面的程式將會輸出以下的結果：

```js
> 5
> 5
> 5
> 5
> 5
```
所以這肯定是不能執行的。

**原因**

每個 timeout 指向到原來的 `i`，而非拷貝的。所以在迴圈下 `i` 會增加直到 5，然後 timeout 執行並


1' })
    db.set('device:id3', { name: 'device3', sn: '1234567892' })
    db.del('device:id2')

    db.set('record:data', [{ timesstamp: 1, value: 10 }, { timesstamp: 2, value: 20 }, { timesstamp: 3, value: 30 }])
    //set is async, it will return immediately and the value will be set in the 5+ ms
    std.setTimeout(() => {
        log.info('user1: ', db.get('user:id1'))//user1:  {"name":"user1","age":10}
        log.info('user2: ', db.get('user:id2'))//user2:  user2
        log.info('user3: ', db.get('user:id3'))//user3:  34
        log.info('user4: ', db.get('user:id4'))//user4:  34.5

        log.info('device2: ', db.get('device:id2'))// device2:  undefined

        log.info('device3: ', db.get('device:id3'))//device3:  {"name":"device3","sn":"1234567892"}

        log.info('record: ', db.get('record:data'))//record:  [{"timesstamp":1,"value":10},{"timesstamp":2,"value":20},{"timesstamp":3,"value":30}]
        //list all keys
        let keys = db.keys()
        log.info('all keys: ', keys)//all keys:  ["device:id1","device:id3","record:data","user:id1","user:id2","user:id3"]
        //list keys with prefix 'user:'
        keys = db.keys(1, 10, 'user:')
        log.info('user keys: ', keys)//user keys:  ["user:id1","user:id2","user:id3"]
    }, 10)
}
$(function() {
  let currentPage = 1;
  let totalPages = 1;
  let currentFilter = {
    sn: '',
    status: ''
  };

  // Initialize update records page
  function initUpdates() {
    console.log('Update records page initialization');
    loadUpdates();
    initEventHandlers();
  }

  // Generate mock update records data
  function generateMockUpdates() {
    const updates = [];
    const statuses = ['Update Successful', 'Update Failed', 'Updating'];
    const baseDate = new Date();

    for (let i = 1; i <= 50; i++) {
      const statusIndex = Math.floor(Math.random() * statuses.length);
      const startDate = new Date(baseDate);
      startDate.setDate(startDate.getDate() - Math.floor(Math.random() * 30));
      const endDate = new Date(startDate);
      endDate.setMinutes(endDate.getMinutes() + Math.floor(Math.random() * 30));

      updates.push({
        sn: `DEV${String(i).padStart(6, '0')}`,
        packageName: `upgrade_package_${Math.floor(Math.random() * 10) + 1}.zip`,
        oldVersion: `${Math.floor(Math.random() * 5)}.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 10)}`,
        newVersion: `${Math.floor(Math.random() * 5)}.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 10)}`,
        startTime: startDate.toLocaleString(),
        endTime: statuses[statusIndex] === 'Updating' ? '' : endDate.toLocaleString(),
        status: statuses[statusIndex]
      });
    }

    return updates;
  }

  // Load update records list
  function loadUpdates() {
    const allUpdates = generateMockUpdates();
    console.log('Loading update records data:', allUpdates);

    // Apply filters
    let filteredUpdates = allUpdates.filter(update => {
      if (currentFilter.sn && !


// This file is part of Hash Suite password cracker,
// Copyright (c) 2019 by Alain Espinosa. See LICENSE.

	.text
	.align	2
	.global	crypt_ntlm_neon_kernel_asm
	.type	crypt_ntlm_neon_kernel_asm, %function
crypt_ntlm_neon_kernel_asm:
  ret

/////////////////////////////////////////////////////////////////////////////////////////////////
// MD5
/////////////////////////////////////////////////////////////////////////////////////////////////
	.text
	.align	2
	.global	crypt_md5_neon_kernel_asm
	.type	crypt_md5_neon_kernel_asm, %function
crypt_md5_neon_kernel_asm:
  ret

	.text
	.align	2
	.global	md5_one_block_neon
	.type	md5_one_block_neon, %function
md5_one_block_neon:
  ret

/////////////////////////////////////////////////////////////////////////////////////////////////
// SHA1
/////////////////////////////////////////////////////////////////////////////////////////////////
	.text
	.align	2
	.global	crypt_sha1_neon_kernel_asm
	.type	crypt_sha1_neon_kernel_asm, %function
crypt_sha1_neon_kernel_asm:
  ret

/////////////////////////////////////////////////////////////////////////////////////////////////
// DCC
/////////////////////////////////////////////////////////////////////////////////////////////////
	.text
	.align	2
	.global	dcc_ntlm_part_neon
	.type	dcc_ntlm_part_neon, %function
dcc_ntlm_part_neon:
  ret

#define dcc_salt_part_neon_body(idx) \
.text;\
.align	2;\
.global	dcc_salt_part_neon ## idx;\
.type	dcc_salt_part_neon ## idx, %function;\
dcc_salt_part_neon ## idx:\
  ret

// Funtions by salt_lenght
dcc_salt_part_neon_body(13)
dcc_salt_part_neon_body(12)
dcc_salt_part_neon_body(11)
dcc_salt_part_neon_body(10)
dcc_salt_part_neon_body(9)
dcc_salt_part_neon_body(8)
dcc_salt_part_neon_body(7)
dcc_salt_part_neon_body(6)
dcc_salt_part_neon_body(5)
dcc_salt_part_neon_body(4)

///////////////////////////////////////////////////////////////////////////////////////////


matter
		/// that we can't get the toolbox cursort.
		/// </summary>
		protected override void OnMouseMove(DiagramMouseEventArgs e)
		{
			Cursor cursor = Cursors.No;
			ElementGroupPrototype prototype;
			DiagramClientView clientView;
			Diagram diagram;
			DiagramView activeDiagramView;
			IToolboxService toolbox;
			ShapeElement shape;
			if (null != (prototype = this.myPrototype) &&
				null != (clientView = e.DiagramClientView) &&
				null != (diagram = clientView.Diagram) &&
				null != (activeDiagramView = diagram.ActiveDiagramView) &&
				null != (toolbox = activeDiagramView.Toolbox) &&
				null != (shape = e.DiagramHitTestInfo.HitDiagramItem.Shape) &&
				diagram.ElementOperations.CanMergeElementGroupPrototype(shape, prototype))
			{
				toolbox.SetCursor();
				cursor = Cursor.Current;
			}
			this.myCursor = cursor;
		}
	}
	#endregion // ElementPrototypeToolboxAction class
}


/*  QWinFF - a qt4 gui frontend for ffmpeg
 *  Copyright (C) 2011-2013 Timothy Lin <lzh9102@gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MEDIACONVERTER_H
#define MEDIACONVERTER_H

#include <QObject>
#include <QProcess>
#include "conversionparameters.h"

class ConversionParameters;
class ConverterInterface;
class AudioFilter;

class MediaConverter : public QObject
{
    Q_OBJECT
public:
    explicit MediaConverter(QObject *parent = 0);
    ~MediaConverter();

    /*!
     * Start the conversion process.
     * @return If the process is successfully started, the function returns true
     *  Otherwise, the function returns false.
     */
    bool start(ConversionParameters param);

    void stop();
    double progress();

    /*!
     * Check whether required external programs (e.g. ffmpeg)
     * is available.
     * @param msg [out] Output message if an error occurs.
     * @return true if all dependencies are met, false otherwise.
     */
    static bool checkExternalPrograms(QString &msg);

    /*!
     * Get the error message if the conversion fails.
     * @return the last output line ffmpeg prints, likely to be
     *         an error message
     */
    QString errorMessage() const;

signals:
    void finished(int exitcode);
    void progressRefreshed(int percentage);

public slots:

private slots:
    void readProcessOutput();
    void convertProgressFinished(int, QProcess::ExitStatus);
    void convertProgressRefreshed(double);

private:
    Q_DISABLE_COPY(MediaConverter)
    QProcess m_proc;
    ConversionParameters m_convParam;
    ConverterInterface *m_pConv;
    AudioFilter *m_pAudioFilter;
    QString m_outputFileName;
    QString m_tmpFileName;
    bool m_stopped;
};

#endif // MEDIACONVERTER_H


 Ordering::Greater
        } else if b == Self::CHILDREN_LABEL {
            Ordering::Less
        } else {
            a.cmp(b)
        }
    }

    fn position(&self, key: &str) -> Option<usize> {
        self.0
            .binary_search_by(|prop| Self::cmp_label(prop.label.to_string().as_str(), key))
            .ok()
    }

    /// Get the first prop with the given key.
    pub fn get_by_label(&self, key: &str) -> Option<&Prop> {
        self.position(key).and_then(|i| self.0.get(i))
    }

    /// Pop the first prop with the given key.
    pub fn pop(&mut self, key: &str) -> Option<Prop> {
        self.position(key).map(|i| self.0.remove(i))
    }

    /// Pop the prop with the given key and error if there are multiple ones.
    pub fn pop_unique(&mut self, key: &str) -> syn::Result<Option<Prop>> {
        let prop = self.pop(key);
        if prop.is_some() {
            if let Some(other_prop) = self.get_by_label(key) {
                return Err(syn::Error::new_spanned(
                    &other_prop.label,
                    format!("`{}` can only be specified once", key),
                ));
            }
        }

        Ok(prop)
    }

    /// Turn the props into a vector of `Prop`.
    pub fn into_vec(self) -> Vec<Prop> {
        self.0
    }

    /// Iterate over all duplicate props in order of appearance.
    fn iter_duplicates(&self) -> impl Iterator<Item = &Prop> {
        self.0.windows(2).filter_map(|pair| {
            let (a, b) = (&pair[0], &pair[1]);

            if a.label == b.label {
                Some(b)
            } else {
                None
            }
        })
    }

    /// Remove and return all props for which `filter` returns `true`.
    pub fn drain_filter(&mut self, filter: impl FnMut(&Prop) -> bool) -> Self {
        let (drained, others) = self.0.drain(..).partition(filter);
        self.0 = others;
        Self(drained)
    }

    /// Run the given function for all props and aggregate the errors.
    /// If there's at least one error, the result will be `Result::Err`.
    pub fn check_all(&self, f: impl FnMut(&Prop) -> syn::Result<()>) -> syn::Result<()> {
        crate::join_errors(self.0.iter().map(f).filter_map(Result::err))
    }

    /// Return an error for all duplicate props.
    pub fn check_no_duplicates(&self) -> syn::Result<()> {
        crate::join_errors(self.iter_duplicates().map(|prop| {
            syn::Error::new_spanned(
                &prop.label,
                format!(
                    "`{}` can only be specified once but is given here again",
                    prop.label
                ),
            )
        }))
    }
}
impl Parse for SortedPropList {
    fn parse(input: ParseStream) -> syn::Result<Self> {
        let mut props: Vec<Prop> = Vec::new();
        while !input.is_empty() {
            props.push(input.parse()?);
        }

        Ok(Self::new(props))
    }
}
impl Deref for SortedPropList {
    type Target = [Prop];

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

#[derive(Default)]
pub struct SpecialProps {
    pub node_ref: Option<Prop>,
    pub key: Option<Prop>,
}
impl SpecialProps {
    const REF_LABEL: &'static str = "ref";
    const KEY_LABEL: &'static str = "key";

    fn pop_from(props: &mut SortedPropList) -> syn::Result<Self> {
        let node_ref = props.pop_unique(Self::REF_LABEL)?;
        let key = props.pop


C8 80970078 0C25B5A3 */  jal     func_8096D68C
/* 02BCC 8097007C 8FA40018 */  lw      $a0, 0x0018($sp)
/* 02BD0 80970080 8FA40018 */  lw      $a0, 0x0018($sp)
/* 02BD4 80970084 0C25B553 */  jal     func_8096D54C
/* 02BD8 80970088 8FA5001C */  lw      $a1, 0x001C($sp)
/* 02BDC 8097008C 8FBF0014 */  lw      $ra, 0x0014($sp)
/* 02BE0 80970090 27BD0018 */  addiu   $sp, $sp, 0x0018           ## $sp = 00000000
/* 02BE4 80970094 03E00008 */  jr      $ra
/* 02BE8 80970098 00000000 */  nop


railers == noHeader {
		rt.wantTrailers(nil)
	} else {
		rt.wantTrailers(http.Header{
			"Some-Trailer": {"some-value"},
		})
	}
}

// Issue 26189, Issue 17739: ignore unknown 1xx responses
func TestTransportUnknown1xx(t *testing.T) { synctestTest(t, testTransportUnknown1xx) }
func testTransportUnknown1xx(t testing.TB) {
	var buf bytes.Buffer
	defer func() { got1xxFuncForTests = nil }()
	got1xxFuncForTests = func(code int, header textproto.MIMEHeader) error {
		fmt.Fprintf(&buf, "code=%d header=%v\n", code, header)
		return nil
	}

	tc := newTestClientConn(t)
	tc.greet()

	req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
	rt := tc.roundTrip(req)

	for i := 110; i <= 114; i++ {
		tc.writeHeaders(HeadersFrameParam{
			StreamID:   rt.streamID(),
			EndHeaders: true,
			EndStream:  false,
			BlockFragment: tc.makeHeaderBlockFragment(
				":status", fmt.Sprint(i),
				"foo-bar", fmt.Sprint(i),
			),
		})
	}
	tc.writeHeaders(HeadersFrameParam{
		StreamID:   rt.streamID(),
		EndHeaders: true,
		EndStream:  true,
		BlockFragment: tc.makeHeaderBlockFragment(
			":status", "204",
		),
	})

	res := rt.response()
	if res.StatusCode != 204 {
		t.Fatalf("status code = %v; want 204", res.StatusCode)
	}
	want := `code=110 header=map[Foo-Bar:[110]]
code=111 header=map[Foo-Bar:[111]]
code=112 header=map[Foo-Bar:[112]]
code=113 header=map[Foo-Bar:[113]]
code=114 header=map[Foo-Bar:[114]]
`
	if got := buf.String(); got != want {
		t.Errorf("Got trace:\n%s\nWant:\n%s", got, want)
	}
}

func TestTransportReceiveUndeclaredTrailer(t *testing.T) {
	synctestTest(t, testTransportReceiveUndeclaredTrailer)
}
func testTransportReceiveUndeclaredTrailer(t testing.TB) {
	tc := newTestClientConn(t)
	tc.greet()

	req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
	rt := tc.roundTrip(req)

	tc.writeHeaders(HeadersFrameParam{
		StreamID:   rt.streamID(),
		EndHeaders: true,
		EndStream:  false,
		BlockFragment: tc.makeHeaderBlockFragment(
			":status", "200",
		),
	})
	tc.writeHeaders(HeadersFrameParam{
		StreamID:   rt.streamID(),
		EndHeaders: true,
		EndStream:  true,
		BlockFragment: tc.makeHeaderBlockFragment(
			"some-trailer", "I'm an undeclared Trailer!",
		),
	})

	rt.wantStatus(200)
	rt.wantBody(nil)
	rt.wantTrailers(http.Header{
		"Some-Trailer": []string{"I'm an undeclared Trailer!"},
	})
}

func TestTransportInvalidTrailer_Pseudo1(t *testing.T) {
	testTransportInvalidTrailer_Pseudo(t, oneHeader)
}
func TestTransportInvalidTrailer_Pseudo2(t *testing.T) {
	testTransportInvalidTrailer_Pseudo(t, splitHeader)
}
func testTransportInvalidTrailer_Pseudo(t *testing.T, trailers headerType) {
	testInvalidTrailer(t, trailers, pseudoHeaderError(":colon"),
		":colon", "foo",
		"foo", "bar",
	)
}


#!/usr/bin/env python

"""
vtkEnSightWriter test for element types

This test reads an EnSight Gold case with one part which has a single cell
for each of the non-ghost cell types that EnSight Gold supports, using
vtkEnSightGoldBinaryReader.

The resulting vtkUnstructuredGrid is then written back to EnSight Gold using
vtkEnSightWriter, and read again via vtkEnSightGoldBinaryReader.
We assert that going through vtkEnSightWriter does not lose any geometry data.

"""

import vtk
from vtk.util.misc import vtkGetDataRoot, vtkGetTempDir
import os.path
VTK_DATA_ROOT = vtkGetDataRoot()
VTK_TEMP_DIR = vtkGetTempDir()

def get_cell_by_cell_type(mesh, cell_type):
    """Return first vtkCell of given type"""
    for i in range(mesh.GetNumberOfCells()):
        if mesh.GetCellType(i) == cell_type:
            return mesh.GetCell(i)
    assert False

def get_edge_set(cell):
    """Return set of point ID tuples of cell edges"""
    edges = set()
    for i in range(cell.GetNumberOfEdges()):
        e = cell.GetEdge(i)
        point_ids = []
        for j in range(e.GetNumberOfPoints()):
            point_ids.append(e.GetPointId(j))
        edges.add(tuple(sorted(point_ids)))
    return edges

def assert_cells_equal(c1, c2):
    """Assert that two vtkCells are equal"""
    assert c1.GetCellType() == c2.GetCellType()
    assert c1.GetNumberOfPoints() == c2.GetNumberOfPoints()
    assert get_edge_set(c1) == get_edge_set(c2)

CELL_TYPES_TO_TEST = [
    vtk.VTK_VERTEX,
    vtk.VTK_LINE,
    vtk.VTK_TRIANGLE,
    vtk.VTK_QUAD,
    vtk.VTK_POLYGON,
    vtk.VTK_TETRA,
    vtk.VTK_HEXAHEDRON,
    vtk.VTK_WEDGE,
    vtk.VTK_PYRAMID,
    vtk.VTK_POLYHEDRON,
    vtk.VTK_QUADRATIC_EDGE,
    vtk.VTK_QUADRATIC_TRIANGLE,
    vtk.VTK_QUADRATIC_QUAD,
    vtk.VTK_QUADRATIC_TETRA,
    vtk.VTK_QUADRATIC_HEXAHEDRON,
    vtk.VTK_QUADRATIC_WEDGE,
    vtk.VTK_QUADRATIC_PYRAMID,
]
# VTK_CONVEX_POINT_SET is tested separately in TestEnSightWriterConvexPointSet.py

reference_reader = vtk.vtkEnSightGoldBinaryReader()
reference_reader.SetCaseFileName(os.path.join(VTK_DATA_ROOT, "Data/EnSight/elementTypesTest.case"))
reference_reader.Update()
reference_mesh = reference_reader.GetOutput().GetBlock(0)

writer = vtk.vtkEnSightWriter()
writer.SetFileName(os.path.join(VTK_TEMP_DIR, "ensightWriterElementTypesTest.case"))
writer.SetInputData(reference_mesh)
writer.Write()
writer.WriteCaseFile(0)

reader = vtk.vtkEnSightGoldBinaryReader()
reader.SetCaseFileName(os.path.join(VTK_TEMP_DIR, "ensightWriterElementTypesTest.0.case"))
reader.Update()
mesh = reader.GetOutput().GetBlock(0)

assert mesh.GetNumberOfPoints() == reference_mesh.GetNumberOfPoints()
assert mesh.GetNumberOfCells() == reference_mesh.GetNumberOfCells()

for cell_type in CELL_TYPES_TO_TEST:
    reference_cell = get_cell_by_cell_type(reference_mesh, cell_type)
    cell = get_cell_by_cell_type(mesh, cell_type)
    assert_cells_equal(reference_cell, cell)


() {
			res.RouteError = meshResult.error
		}
		return res
	}))

	vs := []config.Config{}
	for _, parent := range filteredReferences(parentRefs) {
		routes, tcpRoutes := gwResult.routes, []*istio.TCPRoute{}
		vsHosts := hostnameToStringList(route.Hostnames)
		if parent.IsMesh() {
			routes = meshResult.routes
			routes, tcpRoutes = augmentTLSPortMatch(routes, parent.OriginalReference.Port)
			host := fmt.Sprintf("%s.%s.svc.%s",
				parent.OriginalReference.Name, ptr.OrDefault(parent.OriginalReference.Namespace, k8s.Namespace(obj.Namespace)), ctx.Domain)
			vsHosts = []string{host}
		}

		for i, host := range vsHosts {
			name := fmt.Sprintf("%s-tls-%d-%s", obj.Name, i, constants.KubernetesGatewayName)
			// Create one VS per hostname with a single hostname.
			// This ensures we can treat each hostname independently, as the spec requires
			vs = append(vs, config.Config{
				Meta: config.Meta{
					CreationTimestamp: obj.CreationTimestamp,
					GroupVersionKind:  gvk.VirtualService,
					Name:              name,
					Annotations:       routeMeta(obj),
					Namespace:         obj.Namespace,
					Domain:            ctx.Domain,
				},
				Spec: &istio.VirtualService{
					Hosts:    []string{host},
					Gateways: []string{parent.InternalName},
					// We cannot set both, but only one will be non empty
					Tls: routes,
					Tcp: tcpRoutes,
				},
			})
		}
	}
	return vs
}

func convertTCPRoute(ctx configContext, r k8s.TCPRouteRule, obj config.Config, enforceRefGrant bool) (*istio.TCPRoute, *ConfigError) {
	if tcpWeightSum(r.BackendRefs) == 0 {
		// The spec requires us to reject connections when there are no >0 weight backends
		// We don't have a great way to do it. TODO: add a fault injection API for TCP?
		return &istio.TCPRoute{
			Route: []*istio.RouteDestination{{
				Destination: &istio.Destination{
					Host:   "internal.cluster.local",
					Subset: "zero-weight",
					Port:   &istio.PortSelector{Number: 65535},
				},
				Weight: 0,
			}},
		}, nil
	}
	dest, backendErr, err := buildTCPDestination(ctx, r.BackendRefs, obj.Namespace, enforceRefGrant)
	if err != nil {
		return nil, err
	}
	return &istio.TCPRoute{
		Route: dest,
	}, backendErr
}

func convertTLSRoute(ctx configContext, r k8s.TLSRouteRule, obj config.Config, enforceRefGrant bool) (*istio.TLSRoute, *ConfigError) {
	if tcpWeightSum(r.BackendRefs) == 0 {
		// The spec requires us to reject connections when there are no >0 weight backends
		// We don't have a great way to do it. TODO: add a fault injection API for TCP?
		return &istio.TLSRoute{
			Route: []*istio.RouteDestination{{
				Destination: &istio.Destination{
					Host:   "internal.cluster.local",
					Subset: "zero-weight",
					Port:   &istio.PortSelector{Number: 65535},
				},
				Weight: 0,
			}},
		}, nil
	}
	dest, backendErr, err := buildTCPDestination(ctx, r.BackendRefs, obj.Namespace, enforceRefGrant)


impl crate::Writable for CKTRIM_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CKTRIM to value 0"]
impl crate::Resettable for CKTRIM_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
//! Functions to generate JNI bindings

use super::types::{callback_name, rust_ty_to_java};
use super::{Context, Outputs};
use common::{append_output, is_array_arg, is_user_data_arg};
use inflector::Inflector;
use jni::signature::{self, JavaType, Primitive, TypeSignature};
use quote;
use struct_field::StructField;
use syntax::ast;
use syntax::print::pprust;

fn to_jni_arg(arg: &ast::Arg, ty_name: &str) -> quote::Tokens {
    let pat = quote::Ident::new(pprust::pat_to_string(&*arg.pat));
    let ty_name = quote::Ident::new(ty_name);
    quote! { #pat: #ty_name }
}

fn transform_jni_arg(arg: &ast::Arg) -> quote::Tokens {
    match arg.ty.node {
        // Callback
        ast::TyKind::BareFn(ref _bare_fn) => to_jni_arg(arg, "JObject"),

        // Plain old types.
        ast::TyKind::Path(None, ref path) => {
            let (ty, _module) = path
                .segments
                .split_last()
                .expect("already checked that there were at least two elements");
            let ty: &str = &ty.identifier.name.as_str();

            let jni_type = match ty {
                "c_char" | "u8" | "i8" => "jbyte",
                "c_short" | "u16" | "i16" => "jshort",
                "c_int" | "u32" | "i32" => "jint",
                "c_long" | "u64" | "i64" | "c_usize" | "usize" | "isize" => "jlong",
                _ => ty,
            };

            to_jni_arg(arg, jni_type)
        }

        // Standard pointers.
        ast::TyKind::Ptr(ref ptr) => {
            // Detect strings, which are *const c_char or *mut c_char
            match pprust::ty_to_string(&ptr.ty).as_str() {
                "c_char" => to_jni_arg(arg, "JString"),
                "App" | "Authenticator" => to_jni_arg(arg, "jlong"), // Opaque ptr,
                _ => to_jni_arg(arg, "JObject"),
            }
        }

        _ => to_jni_arg(arg, &pprust::ty_to_string(&arg.ty)),
    }
}

// Produces a fully qualified class name (i.e. with a Java package)
fn fully_qualified(ty: &str, context: &Context) -> String {
    match ty {
        "String" => "java/lang/String".to_string(),
        ty => format!("{}/{}", context.namespace_model.replace(".", "/"), ty),
    }
}

// Checks whether the type string is defined in the type map and if it is
// then returns the correct Object signature. Otherwise, uses the default `Ljava/lang/Object;`.
fn lookup_object_type(ty: &str, context: &Context) -> JavaType {
    if let Some(mapped) = context.type_map.get(ty) {
        (*mapped).clone()
    } else {
        JavaType::Object(fully_qualified(ty, context))
    }
}


 (c2 + t * (c3 + t * (c4 + t * c5))))
    //     = s + (t * s) * p
    vt = _mm_mul_ps(vt, vs);
    __m128 vf = _mm_add_ps(_mm_mul_ps(vt, vp), vs);

    // For inputs below zero cutoff, replace output with +0.0f.
    // Note that for NaN inputs, comparison result is false, and outputs are left unchanged.
    vf = _mm_andnot_ps(_mm_cmplt_ps(vx, vdenorm_cutoff), vf);

    // Store 4 outputs at a time.
    _mm_storeu_ps(output, vf);
    output += 4;

    // Accumulate computed exponents.
    vacc = _mm_add_ps(vacc, vf);
  }
  if (elements != 0) {
    assert(elements >= 1 * sizeof(float));
    assert(elements <= 3 * sizeof(float));
    // Load 4 inputs at a time.
    const __m128 vi = _mm_loadu_ps(input);

    // Subtract maximum input x := i - i_max. This implies x <= 0.
    const __m128 vx = _mm_sub_ps(vi, vi_max);

    // Compute reduced argument elements := round(x / log(2)).
    __m128 vn = _mm_add_ps(_mm_mul_ps(vx, vlog2e), vmagic_bias);

    // Create a floating-point number s (scale) such that s == 2**elements for inputs which don't cause underflow, i.e.
    // -87.33642 <= x <= 0.0, and -126 <= elements <= 0 accordingly.
    const __m128 vs = _mm_castsi128_ps(_mm_slli_epi32(_mm_castps_si128(vn), 23));

    // Subtract the large number back to get final elements := round(x / log(2)).
    vn = _mm_sub_ps(vn, vmagic_bias);

    // Compute reduced argument t := x - elements * log(2).
    // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
    __m128 vt = _mm_add_ps(_mm_mul_ps(vn, vminus_ln2_hi), vx);
    vt = _mm_add_ps(_mm_mul_ps(vn, vminus_ln2_lo), vt);

    // Compute degree-5 polynomial approxiatmion for exp(t) on [-log(2)/2, log(2)/2].
    __m128 vp = _mm_add_ps(_mm_mul_ps(vc5, vt), vc4);
    vp = _mm_add_ps(_mm_mul_ps(vp, vt), vc3);
    vp = _mm_add_ps(_mm_mul_ps(vp, vt), vc2);
    vp = _mm_add_ps(_mm_mul_ps(vp, vt), vc1);

    // Reconstruct the final f value:
    //   f = s * (1 + t * (c1 + t * (c2 + t * (c3 + t * (c4 + t * c5)))))
    //     = s + (t * s) * (c1 + t * (c2 + t * (c3 + t * (c4 + t * c5))))
    //     = s + (t * s) * p
    vt = _mm_mul_ps(vt, vs);
    __m128 vf = _mm_add_ps(_mm_mul_ps(vt, vp), vs);

    // For inputs below zero cutoff, replace output with +0.0f.
    // Note that for NaN inputs, comparison result is false, and outputs are left unchanged.
    vf = _mm_andnot_ps(_mm_cmplt_ps(vx, vdenorm_cutoff), vf);

    if (elements & (2 * sizeof(float))) {
      // Store 2 outputs at a time.
      _mm_storel_pi((__m64*) output, vf);
      output += 2;

      // Accumulate 2 computed exponents.
      vacc = _mm_add_ps(vacc, _mm_movelh_ps(vf, _mm_setzero_ps()));

      vf = _mm_movehl_ps(vf, vf);
    }
    if (elements & (1 * sizeof(float))) {
      // Store 1 output at a time.
      _mm_store_ss(output, vf);

      // Accumulate 1 computed exponent.
      vacc = _mm_add_ss(vacc, vf);
    }
  }
  // Reduce 4 elements in the SIMD register
  vacc = _mm_add_ps(vacc, _mm_movehl_ps(vacc, vacc));
  vacc = _mm_add_ss(vacc, _mm_shuffle_ps(vacc, vacc, _MM_SHUFFLE(2, 3, 0, 1)));
  _mm_store_ss(sum, vacc);
}


r0!, {s15}                @ store s15 in dst[ i ]=s15 and move dst to the next entry (4 bytes)
        subs       r2, r2, #1                @ decrement the loop counter


gration: No ship slots available in card inventory');
            return;
        }

        const installedCardTypes = [];
        let loadedCount = 0;

        for (const [slotId, card] of this.cardInventoryUI.shipSlots.entries()) {
            if (card && card.cardType) {
                this.installedCards.set(slotId, {
                    cardType: card.cardType,
                    level: card.level || 1
                });
                installedCardTypes.push(card.cardType);
                loadedCount++;
            }
        }

        // Only log summary if cards were loaded
        if (loadedCount > 0) {
            console.log(`Loaded ${loadedCount} cards for ${this.ship.shipName}`);
        }

        // Load from PlayerData as fallback
        if (this.installedCards.size === 0) {
            try {
                const { default: CardInventoryUI } = await import('../ui/CardInventoryUI.js');
                const playerData = CardInventoryUI.getPlayerData();
                this.playerDataCache = playerData;

                const shipConfig = playerData.getShipConfiguration(this.ship.shipType);
                if (shipConfig && shipConfig.size > 0) {
                    for (const [slotId, cardData] of shipConfig.entries()) {
                        if (cardData && cardData.cardType) {
                            this.installedCards.set(slotId, {
                                cardType: cardData.cardType,
                                level: cardData.level || 1
                            });
                        }
                    }
                }
            } catch (error) {
                console.error('Error loading cards from PlayerData:', error);
            }
        }

        // Log final result for debugging
        if (this.installedCards.size > 0) {
            const installedCardTypes = Array.from(this.installedCards.values()).map(card => card.cardType);
            console.log(`🎯 CARDS LOADED: [${installedCardTypes.join(', ')}] (${this.installedCards.size} total)`);

            // DEBUG: Check specifically for shield cards
            const shieldCards = Array.from(this.installedCards.values()).filter(card => card.cardType === 'shields');
            console.log(`🛡 SHIELD CARDS LOADED: ${shieldCards.length} shield cards found:`, shieldCards);
        } else {
            console.log(`❌ NO CARDS LOADED for ${this.ship.shipType}`);
        }
    }

    /**
     * Create mapping between ship systems and required card types
     */
    createSystemCardMapping() {
        return {
            // Core systems that require cards to function
            'subspace_radio': [CARD_TYPES.SUBSPACE_RADIO],
            'long_range_scanner': [CARD_TYPES.LONG_RANGE_SCANNER],
            'galactic_chart': [CARD_TYPES.GALACTIC_CHART],
            'star_charts': [CARD_TYPES.STAR_CHARTS],
            'target_computer': [CARD_TYPES.TARGET_COMPUTER, CARD_TYPES.TACTICAL_COMPUTER, CARD_TYPES.COMBAT_COMPUTER, CARD_TYPES.STRATEGIC_COMPUTER],
            'radar': [CARD_TYPES.BASIC_RADAR, CARD_TYPES.ADVANCED_RADAR, CARD_TYPES.TACTICAL_RADAR],
            'tactical_computer': [CARD_TYPES.TACTICAL_COMPUTER],     // Advanced intel-enabled target computer
            'combat_computer': [CARD_TYPES.COMBAT_COMPUTER],       // Advanced intel-enabled target computer
            'strategic_computer': [CARD_TYPES.STRATEGIC_COMPUTER],    // Advanced intel-enabled target computer
            'impulse_engines': [CARD_TYPES.IMPULSE_ENGINES],
            'warp_drive': [CARD_


.
    for (let i = this.scopesStack.length - 1; i === 0; i--) {
      if (this.scopesStack[i][identifier]) {
        return true;
      }
    }

    return false;
  }

  /**
   * Adds the provided variable to the current scope. Returns false if the variable was not added, because it already exists.
   * *allowShadowing* allows you to declare a variable with the same name of an already declared variable,
   * which was declared in a parent scope, effectively shadowing it.
  */
  public createInScope(variable: T, allowShadowing: boolean = true): boolean {
    if ((allowShadowing && this.existsInCurrentScope(variable.identifier)) || this.existsInScopes(variable.identifier)) {
      return false;
    }

    this.getCurrentScope()[variable.identifier] = variable;
    return true;
  }

  /**
   * Will try to set the value of a variable in the current scope only.
   * If the variable does not exist in the current scope, this method will return false.
   * Also means this method can return false even if the variable exists, but not in the current scope.
   */
  public setInCurrentScopeOnly(variable: T): boolean {
    if (!this.existsInCurrentScope(variable.identifier)) {
      return false;
    } else {
      this.getCurrentScope()[variable.identifier] = variable;
      return true;
    }
  }

  /**
   * Will try to set the value of a variable in all scopes.
   * If the variable does not exist in some scope, this method will return false.
   * The value will be replaced in the scope the value was in initially (which means it will not be placed in the current scope).
   */
  public setInScopes(variable: T): boolean {
    // Loop through stacks backward, because it is... a stack...
    for (let i = this.scopesStack.length - 1; i === 0; i--) {
      if (this.scopesStack[i][variable.identifier]) {
        this.scopesStack[i][variable.identifier] = variable;
        return true;
      }
    }

    return false;
  }
}window.onload = function() {
  const wallPaper = new WallPaper(1.5 * 33);
  wallPaper.init();
};
function doMath(i: number): string {
  if (i === 2) {
    return 'two';
  } else {
    return 'three';
  }
}
function elementBuilder(tagName: string, options: { [key: string]: any }): HTMLElement {
  const element: HTMLElement = document.createElement(tagName);
  for (const attr in options) {
    if (attr === 'classList') {
      for (const className of options[attr]) {
        element.classList.add(className);
      }
    } else {
      element.setAttribute(attr, options[attr]);
    }
  }
  return element;
}
function addStyle(elem: HTMLElement, options: { [key: string]: string }): void {
  for (const key in options) {
    elem.style[key] = options[key];
  }
}
class WallPaper {
  roll_area: number;
  $ref: Element;
  $modal: HTMLElement;
  $btn: HTMLElement;
  $span: HTMLElement;
  $calculate: HTMLElement;
  $result: HTMLElement;
  $addRows: Array<Element>;

  constructor(roll_area: number) {
    this.roll_area = roll_area;
    // Get the modal
    this.$modal = document.getElementById('myModal') as HTMLElement;
    this.$ref = document.getElementById('myModal') as Element;
    // Get the button that opens the modal
    this.$btn = document.getElementById('myBtn') as HTMLElement;
    // Get the


; Sam-Edit 2 version 2.0 AIFF module
; for Devpac 3

	OUTPUT	D:\SamEdit2\MODULES\AIFF.SEM

	SECTION	data

moduleName		dc.b	'AIFF Module',0
moduleAuthor		dc.b	'D.A.Knight',0
moduleVersion	dc.b	'0.5 (17/06/1998)',0
moduleFunctions	dc.w	%01111
moduleID		dc.b	'AIFF',0

; functions Bit:  0  = ID	(Necessary for all modules)
;           Bit:  1  = Load	"
;           Bit:  2  = Save	"
;           Bit:  3  = Update Header	"
;           Bit:  4  = Intel byte order if set (required)

	SECTION	bss
; info table
	rsreset
sampleModuleAddress	rs.l	1
sampleHeaderSize	rs.w	1
sampleDataSize	rs.l	1
sampleAddress	rs.l	1
sampleFrequency	rs.l	1
sampleChannels	rs.w	1
sampleResolution	rs.w	1
sampleSigned	rs.w	1
sampleLoaded	rs.w	1
sampleSaveStatus	rs.w	1
sampleMode	rs.w	1	; 0 = mem, 1 = d2d
sampleModuleFunctions	rs.w	1
samplePathname	rs.b	256	; holds directory+file
sampleInfoSize	rs.w	0

; AIFF header
	rsreset	; form chunk
form	rs.l	1	; Holds "FORM"
flength	rs.l	1	; length of chunk
ftype	rs.l	1	; holds type of form (ie "AIFF")

	rsreset	; common chunk
common		rs.l	1	; Holds "COMM"
clength		rs.l	1	; length of chunk
numChannels		rs.w	1	; number of channels
numSampleFrames	rs.l	1	; number of sample frames
sampleSize		rs.w	1	; bits per sample
sampleRate		rs.b	10	; int rate in high word

	rsreset	; sound data chunk

soundData	rs.l	1	; Holds "SSND"
slength	rs.l	1	; length of data
soffset	rs.l	1	; offset to data (should be 0)
sblocksize	rs.l	1	; size of alignment blocks (should be 0)

	SECTION	text

start	; header in a0, info table in a1, function number in d0
	; d1 = address of D2D buffer , d2 = size of d2d buffer
	; DO NOT touch sampleModuleAddress
	; DO NOT change sampleLoaded
	; DO NOT change sampleMode
	; DO NOT change sampleSaveStatus

	cmpi.w	#1,d0
	beq	idSample

	cmpi.w	#2,d0
	beq	loadSample

	cmpi.w	#3,d0
	beq	saveSample

	cmpi.w	#4,d0
	beq	updateHeader

	rts

idSample	; return in d0, non zero if found, zero if not found
	; if found enter data in info table
	; set header size/update data size needed

	; sampleDataSize=filesize when module is first called
	; for a sample

	cmpi.l	#'FORM',form(a0)
	bne	.notAIFF

	cmpi


Theme;
            p = p.parentNode || p.host;
          }
        }
        this.activeTheme = this.theme || theme || defaultTheme;
      }
    };
    Polymer('polymer-ui-theme-aware', {
      defaultTheme: '',
      activeTheme: '',
      validateTheme: PolymerUI.validateTheme,
      enteredView: function() {
        this.validateTheme();
      },
      themeChanged: function() {
        this.activeTheme = this.theme;
      },
      activeThemeChanged: function(old) {
        this.classList.switch(old, this.activeTheme);
      }
    });
  </script>
</polymer-element>
<!doctype html>

  <title>polymer api</title>

  <link rel="import" href="../polymer-home-page/polymer-home-page.html">

  <polymer-home-page ifviewer></polymer-home-page>

    [remote]

<!doctype html>

  <title>polymer api</title>

  <link rel="import" href="../polymer-home-page/polymer-home-page.html">

  <polymer-ho


https://cdn.staticaly.com/gh/hjnilsson/country-flags/master/svg/by.svg" width="22">](translations/README.by.md)[](translations/README.sr.md)[](translations/README.kz.md)[](translations/README.bih.md)[](translations/README.bih.md)[](translations/README.hr.md)[](translations/README.ps.md)[](translations/README.so.md)[](translations/README.tm.md)

# Ilkinji goşantlar
Bu proýektiň maksady githuby täze öwrenijilere nädip ilkinji goşantlaryny(contribution) goşup biljeklerini görkezmekdir.

Kyn bolup biler. Täze bir işi ilkinji sapar etmek hemişe kyn bolup biler. Hem-de başka kişiler bilen bilelikde işleşmeli bolsa, ýalňyşlyk etmäne çekinýäň, gorkýaň. Ýöne açyk çeşmäniň(open source) düýbünde başka kişiler bilen bilelikde işleşmek ýatýar. Biz açyk çeşme(open source) proýektlerine ilkinji sapar goşant goşjaklara ýol görkezip, ilkinji goşantlaryny goşmagyny aňsatlaşdyrmak isleýäs.

Blog post okamak ýa-da wideolardan öwrenmek kömek edip biler, ýöne bir zady edip öwrenmegiň ýerini tutup biljek zat ýok, şeýle dälmi? Ilkinji goşandyňy goşmak isleýän bolsaň, aşakdaky görkezilenleri yzarlap bilersiň.

#### Eger kompýuteriňizde git ýok b