local U = {}

local dota2team = {

	[1] = {
		['name'] = "Navi TI1";
		['alias'] = "Na'Vi";
		['players'] = {
			'Artstyle.Darer',
			'Puppey',
			'Dendi',
			'LightToHeaveN',
			'XBOCT'
		};
		['sponsorship'] = '';
	},
	[2] = {
		['name'] = "Ehome TI1";
		['alias'] = "EH.GIGABYTE";
		['players'] = {
			'820',
			'357',
			'FCB',
			'PLT',
			'X!!'
		};
		['sponsorship'] = '';
	},
	[3] = {
		['name'] = "IG TI2";
		['alias'] = "iG";
		['players'] = {
			'Zhou',
			'Ferrari_430',
			'YYF',
			'ChuaN',
			'Faith'
		};
		['sponsorship'] = '';
	},
	[4] = {
		['name'] = "Navi TI2";
		['alias'] = "Na'Vi";
		['players'] = {
			'XBOCT',
			'Dendi',
			'LightToHeaveN',
			'Puppey',
			'ARS-ART'
		};
		['sponsorship'] = '';
	},
	[5] = {
		['name'] = "Alliance TI3";
		['alias'] = "";
		['players'] = {
			'Lod[A]',
			'[A]s4',
			'[A]dmiralBulldog',
			'[A]EGM',
			'[A]kke'
		};
		['sponsorship'] = '';
	},
	[6] = {
		['name'] = "Navi TI3";
		['alias'] = "Na'Vi";
		['players'] = {
			'XBOCT',
			'Dendi',
			'Funn1k',
			'Puppey',
			'KuroKy'
		};
		['sponsorship'] = '';
	},
	[7] = {
		['name'] = "Newbee TI4";
		['alias'] = "Newbee";
		['players'] = {
			'Hao',
			'Mu',
			'xiao8',
			'Banana',
			'SanSheng'
		};
		['sponsorship'] = '';
	},
	[8] = {
		['name'] = "VG TI4";
		['alias'] = "VG";
		['players'] = {
			'Sylar',
			'Super',
			'rOtk',
			'fy',
			'Fenrir'
		};
		['sponsorship'] = '';
	},
	[9] = {
		['name'] = "Evil Geniuses TI5";
		['alias'] = "EG";
		['players'] = {
			'Fear',
			'SumaiL.Coffin',
			'UNiVeRsE',
			'Aui_2000',
			'ppd'
		};
		['sponsorship'] = '';
	},
	[10] = {
		['name'] = "CDEC Gaming TI5";
		['alias'] = "CDEC";
		['players'] = {
			'Q',
			'Xz',
			'garder',
			'Shiki',
			'Agressif'
		};
		['sponsorship'] = '';
	},
	[11] = {
		['name'] = "Wings Gaming TI6";
		['alias'] = "Wings";
		['players'] = {
			'shadow',
			'跳刀跳刀丶.bLink',
			'Faith_bian.Vicky',
			'y`.innocence',
			'iceice'
		};
		['sponsorship'] = '';
	},
	[12] = {
		['name'] = "Digital Chaos TI6";
		['alias'] = "DC


.\\d{1,}))?' + // milliseconds capture
                    ')?' +
                '(' + // capture UTC offset component
                    'Z|' + // UTC capture
                    '(?:' + // offset specifier +/-hours:minutes
                        '([-+])' + // sign capture
                        '(\\d{2})' + // hours offset capture
                        ':(\\d{2})' + // minutes offset capture
                    ')' +
                ')?)?)?)?' +
            '$');

            var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];

            var dayFromMonth = function dayFromMonth(year, month) {
                var t = month > 1 ? 1 : 0;
                return (
                    months[month] +
                    Math.floor((year - 1969 + t) / 4) -
                    Math.floor((year - 1901 + t) / 100) +
                    Math.floor((year - 1601 + t) / 400) +
                    365 * (year - 1970)
                );
            };

            var toUTC = function toUTC(t) {
                var s = 0;
                var ms = t;
                if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
                    // work around a Safari 8/9 bug where it treats the seconds as signed
                    var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
                    var sToShift = Math.floor(msToShift / 1e3);
                    s += sToShift;
                    ms -= sToShift * 1e3;
                }
                return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
            };

            // Copy any custom methods a 3rd party library may have added
            for (var key in NativeDate) {
                if (owns(NativeDate, key)) {
                    DateShim[key] = NativeDate[key];
                }
            }

            // Copy "native" methods explicitly; they may be non-enumerable
            defineProperties(DateShim, {
                now: NativeDate.now,
                UTC: NativeDate.UTC
            }, true);
            DateShim.prototype = NativeDate.prototype;
            defineProperties(DateShim.prototype, {
                constructor: DateShim
            }, true);

            // Upgrade Date.parse to handle simplified ISO 8601 strings
            var parseShim = function parse(string) {
                var match = isoDateExpression.exec(string);
                if (match) {
                    // parse months, days, hours, minutes, seconds, and milliseconds
                    // provide default values if necessary
                    // parse the UTC offset component
                    var year = $Number(match[1]),
                        month = $Number(match[2] || 1) - 1,
                        day = $Number(match[3] || 1) - 1,
                        hour = $Number(match[4] || 0),
                        minute = $Number(match[5] || 0),
                        second = $Number(match[6] || 0),
                        millisecond = Math.floor($Number(match[7] || 0) * 1000),
                        // When time zone is missed, local offset should be used
                        // (ES 5.1 bug)
                        // see https://bugs.ecmascript.org/show_bug.cgi?id=112
                        isLocalTime = Boolean(match[4] && !match[8]),
                        signOffset = match[9] === '-' ? 1 : -1,
                        hourOffset = $Number(match[10] || 0),
                        minuteOffset = $Number(match[11] || 0),
                        result;
                    var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
                    if (
                        hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
                        minute < 60 && second < 60 && millisecond < 1000 &&
                        month > -1 && month < 12 && hourOffset <


t-of-ua/bot-detail?bot=sogou spider"}},8397:{userAgent:"Y!J-BRJ/YATS crawler (http://help.yahoo.co.jp/help/jp/search/indexing/indexing-15.html)",metadata:{uaFamily:"Yahoo! JAPAN",uaName:"Y!J-BRJ/YATS",uaUrl:"http://help.yahoo.co.jp/help/jp/search/indexing/indexing-15.html",uaCompany:"Yahoo Japan Corporation",uaCompanyUrl:"http://www.yahoo.co.jp/",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=Yahoo! JAPAN"}},8406:{userAgent:"yacybot (freeworld-global; amd64 Linux 3.2.0-35-generic; java 1.7.0_09; Europe/en) http://yacy.net/bot.html",metadata:{uaFamily:"yacybot",uaName:"yacybot",uaUrl:"http://yacy.net/bot.html",uaCompany:"Michael Christen",uaCompanyUrl:"",uaIcon:"bot_yacybot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=yacybot"}},8429:{userAgent:"OpenWebSpider v0.1.4 (http://www.openwebspider.org/)",metadata:{uaFamily:"OpenWebSpider",uaName:"OpenWebSpider v0.1.4",uaUrl:"http://www.openwebspider.org/",uaCompany:"Stefano Alimonti",uaCompanyUrl:"",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=OpenWebSpider"}},8487:{userAgent:"emefgebot/beta (+http://emefge.de/bot.html)",metadata:{uaFamily:"emefgebot",uaName:"emefgebot/beta",uaUrl:"http://emefge.de/bot.html",uaCompany:"Bayern Anzeiger UG",uaCompanyUrl:"http://bayernanzeiger.de/",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=emefgebot"}},8574:{userAgent:"coccoc/1.0 (http://help.coccoc.com/)",metadata:{uaFamily:"coccoc",uaName:"coccoc/1.0",uaUrl:"http://help.coccoc.com/",uaCompany:"Coc Coc",uaCompanyUrl:"http://coccoc.vn/",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=coccoc"}},8586:{userAgent:"ExB Language Crawler 2.1.5 (+http://www.exb.de/crawler)",metadata:{uaFamily:"ExB Language Crawler",uaName:"ExB Language Crawler 2.1.5",uaUrl:"http://www.exb.de/crawler/",uaCompany:"ExB Communication Systems GmbH",uaCompanyUrl:"http://www.exb.de/",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=ExB Language Crawler"}},8590:{userAgent:"Mozilla/4.0 (compatible;  Vagabondo/4.0; webcrawler at wise-guys dot nl; http://webagent.wise-guys.nl/; http://www.wise-guys.nl/)",metadata:{uaFamily:"Vagabondo",uaName:"Vagabondo/4.0",uaUrl:"http://webagent.wise-guys.nl/",uaCompany:"WiseGuys Internet BV",uaCompanyUrl:"http://www.wise-guys.nl/",uaIcon:"bot.png",uaInfoUrl:"/list-of-ua/bot-detail?bot=Vagabondo"}},8607:{userAgent:"ExB Language Crawler 2.1.2 (+http://www.exb.de/crawler)",metadata:{uaFamily:"ExB Language Crawler",uaName:"ExB Language Crawler 2.1.2",uaUrl:"http://www.exb.de/


to ("online communities" to "online community page for"),
    "eb535226-f8ca-499d-9b18-6a144df4ae6f" to ("blogs" to "blog of"),
    "93883cf6-e818-4938-990e-75863f8db2d3" to ("crowdfunding page" to "crowdfunding page for"),
    "6f77d54e-1d81-4e1a-9ea5-37947577151b" to ("patronage page" to "patronage page for"),
    "919db454-212f-495a-a9bb-f69631729953" to ("get the music" to "get the music"),
    "611b1862-67af-4253-a64f-34adba305d1d" to ("purchase music for mail-order" to "mail-order purchase page for"),
    "f8319a2f-f824-4617-81c8-be6560b3b203" to ("purchase music for download" to "download purchase page for"),
    "34ae77fe-defb-43ea-95d4-63c7540bac78" to ("download music for free" to "free download page for"),
    "769085a1-c2f7-4c24-a532-2375a77693bd" to ("stream for free" to "free music streaming page for"),
    "63cc5d1f-f096-4c94-a43f-ecb32ea94161" to ("streaming page" to "streaming page for"),
    "c550166e-0548-4a18-b1d4-e2ae423a3e88" to ("Bandcamp" to "Bandcamp page for"),
    "4c21e5f5-2960-4abc-88a1-62ce491bb96e" to ("CD Baby" to "CD Baby page for"),
    "631712a0-7525-42ba-b7a3-605aa7a238c4" to ("YouTube Music" to "YouTube Music channel for"),
    "d94fb61c-fa20-4e3c-a19a-71a949fb2c55" to ("other databases" to "other databases"),
    "6b3e3c85-0002-4f34-aca6-80ace0d7e846" to ("Allmusic" to "Allmusic page for"),
    "ea45ed3d-2d5e-456e-8c32-94b6f51426e2" to ("Bandsintown" to "Bandsintown page for"),
    "f82f9342-a08d-46b7-ab7a-d8b6330c805d" to ("BookBrainz" to "BookBrainz page for"),
    "991d7d60-01ee-41de-9b62-9ef3f86c2447" to ("CPDL" to "CPDL page for"),
    "04a5b104-a4c2-4bac-99a1-7b837c37d9e4" to ("Discogs" to "Discogs page for"),
    "94c8b0cc-4477-4106-932c-da60e63de61c" to ("IMDb" to "IMDb page for"),
    "8147b6a2-ad14-4ce7-8f0a-697f9a31f68f" to ("IMSLP" to "IMSLP page for"),
    "08db8098-c0df-4b78-82c3-c8697b4bba7f" to ("Last.fm" to "Last.fm page for"),
    "79c5b84d-a206-4f4c-9832-78c028c312c3" to ("SecondHandSongs" to "SecondHandSongs page for"),
    "bf5d0d5e-27a1-4e94-9df7-3cdc67b3b207" to ("setlist.fm" to "setlist.fm page for"),
    "aac9c4bc-a5b9-30b8-9839-e3ac314c6e58" to


can internally convert 16 bit images to 8 bit images

### zune-python
- New crate, expose Rust image functions to python side
- Support converting to numpy,decoding images to raw numpy etc
- Impressive speeds. (decoding is slightly faster than opencv for the set of chosen test images)

### zune-imageprocs
- new crate: Improve image filter ergonomics.
- Multithreaded routines return error and don't panic in case of errors
- Better support for `f32` images.
## Adding a new colorspace

To add a new colorspace to the library, the following steps are need

We are going to assume that we are trying to add the colorspace `XYZ`

### 1. Add enum variant to  `core/src/colorspace.rs/ColorSpace`

```Rust
pub enum ColorSpace {
    //.. other definitions
    RGB,
    // the new colorspace we are trying to add
    XYZ,
}
```

### 2. Add methods needed for enums

- `XYZ` colorspace has 3 components, and no alpha channel, so we add it's definition in `num_components` method as
  returning
  three components

```Rust
impl ColorSpace {
    pub fn num_components(self) {
        match self
        {
            Self::RGB | Self::YCbCr | Self::BGR | Self::XYZ /*new definition*/ => 3,
            Self::RGBA | Self::YCCK | Self::CMYK | Self::BGRA => 4,
            Self::Luma => 1,
            Self::LumaA => 2,
            Self::Unknown => 0
        }
    }
}
```

### 3. Add the new colorspace to the `ALL_COLORSPACES` trait

```Rust
pub static ALL_COLORSPACES: [ColorSpace; 10] = [
    // .. PREVIOUS DEFINITIONS
    ColorSpace::YCbCr,
    ColorSpace::XYZ // new definition
];
```

### 4. (Optional) add a mapping from the colorspace to RGB and back

It is recommended to add a mapping that converts the colorspace from RGB to it and vice versa, as most
decoders and encoders understand RGB.

This is done in the `zune-image/src/core_filters/colorspace.rs` file## Adding a new test to the repo

This walkthrough takes one through steps it takes to add a simple test to the library.

### 1. Add image/images to test-images

`test-images` directory is the repo that contains sample images that help test for regressions and correctness.

It contains a set of small/medium-sized images that stress certain parts of the decoder, so in case we have a
regression we don't want to occur, we add the image to `test-images`.

The structure is `test-images->format->[images]` for ease of use.

- Remember to add the images to VCS

### 2. Add the file details to `tests/tests/[{format}.json]`

E.g there is a `jpeg.json` which contains information about jpeg files.

The format is simple

| Field      | Status    | Explanation                                                                 |
|------------|-----------|-----------------------------------------------------------------------------|
| name       | Mandatory | File name with extension                                                    |
| hash       | Mandatory | xxhash(seed of `0`) result of the decoded result still not in planar format |
| colorspace | Optional  | Expected colorspace output of the image, only used by `zune-jpeg` currently |
| comment    | Optional  | A reason why the file exists, useful for debugging purposes                 |

Here is an example of such a file description

```json
{
  "name": "weid_sampling_factors.jpg",
  "hash": 290923794124024565485763288568005295883,
  "comment": "Non normal sampling factors, h2v1 for all components",
  "colorspace": "rgb"
}
```

Each entry is part of an array, so it should be inside `[]`

#### Tip: Incase you don't know the hash and you have ensured the output is correct(matches other libraries)

- Run the testing once, once you get the error, copy the hash printed to stdout

### 3. Run decoder

Ensure


.0/20 vs. fe80::1"
			},
		},
		{
			// Address family mismatch: IPv4 containing_prefix, IPv6 contained_ip_or_prefix (prefix).
			cty.StringVal("192.168.2.0/20"),
			cty.StringVal("fe80::/24"),
			cty.NilVal,
			func(err error) bool {
				return err != nil && err.Error() == "address family mismatch: 192.168.2.0/20 vs. fe80::/24"
			},
		},
		{
			// Address family mismatch: IPv6 containing_prefix, IPv4 contained_ip_or_prefix (IP).
			cty.StringVal("fe80::/48"),
			cty.StringVal("192.168.2.1"),
			cty.NilVal,
			func(err error) bool {
				return err != nil && err.Error() == "address family mismatch: fe80::/48 vs. 192.168.2.1"
			},
		},
		{
			// Address family mismatch: IPv6 containing_prefix, IPv4 contained_ip_or_prefix (prefix).
			cty.StringVal("fe80::/48"),
			cty.StringVal("192.168.2.0/20"),
			cty.NilVal,
			func(err error) bool {
				return err != nil && err.Error() == "address family mismatch: fe80::/48 vs. 192.168.2.0/20"
			},
		},
		{
			// Input error: invalid CIDR address.
			cty.StringVal("not-a-cidr"),
			cty.StringVal("192.168.2.1"),
			cty.NilVal,
			func(err error) bool {
				return err != nil && err.Error() == "invalid CIDR address: not-a-cidr"
			},
		},
		{
			// Input error: invalid IP address.
			cty.StringVal("192.168.2.0/20"),
			cty.StringVal("not-an-address"),
			cty.NilVal,
			func(err error) bool {
				return err != nil && err.Error() == "invalid IP address or prefix: not-an-address"
			},
		},
	}

	for _, test := range tests {
		t.Run(fmt.Sprintf("cidrcontains(%#v, %#v)", test.Prefix, test.Address), func(t *testing.T) {
			got, err := CidrContains(test.Prefix, test.Address)

			if !test.ErrFn(err) {
				t.Errorf("unexpected error: %v", err)
			}

			if !got.RawEquals(test.Want) {
				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
			}
		})
	}
}
// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package funcs

import (
	"fmt"
	"testing"

	"github.com/opentofu/opentofu/internal/lang/marks"
	"github.com/zclconf/go-cty/cty"
)

func TestLog(t *testing.T) {
	tests := []struct {
		Num  cty.Value
		Base cty.Value
		Want cty.Value
		Err  bool
	}{
		{
			cty.NumberFloatVal(1),
			cty.NumberFloatVal(10),
			cty.NumberFloatVal(0),
			false,
		},
		{
			cty.NumberFloatVal(10),
			cty.NumberFloatVal(10),
			cty.NumberFloatVal(1),
			false,
		},

		{
			cty.NumberFloatVal(


ODDdFoY4NlzlXc3tDslWJtCJF75Nw8Oj_g",
                      "zJK_eSMXjwM8dXmMZLnI8FGM08zJ3_ubGeEMJ-5TBy0"
                    ],
                    "vaccine": {
                      "_sd": [
                        "1cF5hLwkhMNIaqfWJrXI7NMWedL-9f6Y2PA52yPjSZI",
                        "Hiy6WWueLD5bn16298tPv7GXhmldMDOTnBi-CZbphNo",
                        "Lb027q691jXXl-jC73vi8ebOj9smx3C-_og7gA4TBQE"
                      ],
                      "type": "Vaccine"
                    },
                    "recipient": {
                      "_sd": [
                        "1lSQBNY24q0Th6OGzthq-7-4l6cAaxrYXOGZpeW_lnA",
                        "3nzLq81M2oN06wdv1shHvOEJVxZ5KLmdDkHEDJABWEI",
                        "Pn1sWi06G4LJrnn-_RT0RbM_HTdxnPJQuX2fzWv_JOU",
                        "lF9uzdsw7HplGLc714Tr4WO7MGJza7tt7QFleCX4Itw"
                      ],
                      "type": "VaccineRecipient"
                    },
                    "type": "VaccinationEvent"
                  },
                  "_sd_alg": "sha-256",
                  "cnf": {
                    "jwk": {
                      "kty": "EC",
                      "crv": "P-256",
                      "x": "TCAER19Zvu3OHF4j4W4vfSVoHIP1ILilDls7vCeGemc",
                      "y": "ZxjiWWbZMQGHVWKVQ4hbSIirsVfuecCE6t4jT9F2HZQ"
                    }
                  }
                }
            """.trimIndent().trim(),
            prettyJson.encodeToString(sdJwtKb.sdJwt.jwtBody)
        )

        assertEquals(
            """
                [
                  [
                    "Pc33JM2LchcU_lHggv_ufQ",
                    "order",
                    "3/3"
                  ],
                  [
                    "AJx-095VPrpTtN4QMOqROA",
                    "dateOfVaccination",
                    "2021-06-23T13:40:12Z"
                  ],
                  [
                    "2GLC42sKQveCfGfryNRN9w",
                    "atcCode",
                    "J07BX03"
                  ],
                  [
                    "eluV5Og3gSNII8EYnsxA_A",
                    "medicinalProductName",
                    "COVID-19 Vaccine Moderna"
                  ]
                ]
            """.trimIndent().trim(),
            prettyPrintDisclosures(sdJwtKb.sdJwt.disclosures)
        )

        assertEquals(
            """
                {
                  "@context": [
                    "https://www.w3.org/2018/credentials/v1",
                    "https://w3id.org/vaccination/v1"
                  ],
                  "type": [
                    "VerifiableCredential",
                    "Vaccin


   )
        worker_group_state: WorkerGroupState = worker_group.get_worker_group_state()
        self._state_manager.update_train_run_attempt_running(
            run_id=self._run_id,
            attempt_id=worker_group_context.run_attempt_id,
            workers=worker_group_state.workers,
        )

    def before_worker_group_shutdown(self, worker_group: WorkerGroup):
        worker_group_context: WorkerGroupContext = (
            worker_group.get_worker_group_context()
        )
        # TODO: Consider passing error reason directly to the callback.
        # Something along the lines of:
        #    WorkerGroup.shutdown(reason)
        #    -> WorkerGroupCallback.before_worker_group_shutdown(reason)
        worker_group_poll_status: Optional[
            WorkerGroupPollStatus
        ] = worker_group.get_latest_poll_status()
        if worker_group_poll_status and worker_group_poll_status.errors:
            self._state_manager.update_train_run_attempt_errored(
                run_id=self._run_id,
                attempt_id=worker_group_context.run_attempt_id,
                status_detail=worker_group_poll_status.get_error_string(),
            )
        else:
            self._state_manager.update_train_run_attempt_finished(
                run_id=self._run_id,
                attempt_id=worker_group_context.run_attempt_id,
            )

    def before_worker_group_abort(self, worker_group_context: WorkerGroupContext):
        self._state_manager.update_train_run_attempt_aborted(
            self._run_id,
            worker_group_context.run_attempt_id,
        )


2_RESULT_FIELD.full_name = "p60.sc_60002.result"
slot3.SC_60002_RESULT_FIELD.number = 1
slot3.SC_60002_RESULT_FIELD.index = 0
slot3.SC_60002_RESULT_FIELD.label = 2
slot3.SC_60002_RESULT_FIELD.has_default_value = false
slot3.SC_60002_RESULT_FIELD.default_value = 0
slot3.SC_60002_RESULT_FIELD.type = 13
slot3.SC_60002_RESULT_FIELD.cpp_type = 3
slot3.SC_60002_ID_FIELD.name = "id"
slot3.SC_60002_ID_FIELD.full_name = "p60.sc_60002.id"
slot3.SC_60002_ID_FIELD.number = 2
slot3.SC_60002_ID_FIELD.index = 1
slot3.SC_60002_ID_FIELD.label = 2
slot3.SC_60002_ID_FIELD.has_default_value = false
slot3.SC_60002_ID_FIELD.default_value = 0
slot3.SC_60002_ID_FIELD.type = 13
slot3.SC_60002_ID_FIELD.cpp_type = 3
SC_60002.name = "sc_60002"
SC_60002.full_name = "p60.sc_60002"
SC_60002.nested_types = {}
SC_60002.enum_types = {}
SC_60002.fields = {
	slot3.SC_60002_RESULT_FIELD,
	slot3.SC_60002_ID_FIELD
}
SC_60002.is_extendable = false
SC_60002.extensions = {}
slot3.CS_60003_ID_FIELD.name = "id"
slot3.CS_60003_ID_FIELD.full_name = "p60.cs_60003.id"
slot3.CS_60003_ID_FIELD.number = 1
slot3.CS_60003_ID_FIELD.index = 0
slot3.CS_60003_ID_FIELD.label = 2
slot3.CS_60003_ID_FIELD.has_default_value = false
slot3.CS_60003_ID_FIELD.default_value = 0
slot3.CS_60003_ID_FIELD.type = 13
slot3.CS_60003_ID_FIELD.cpp_type = 3
CS_60003.name = "cs_60003"
CS_60003.full_name = "p60.cs_60003"
CS_60003.nested_types = {}
CS_60003.enum_types = {}
CS_60003.fields = {
	slot3.CS_60003_ID_FIELD
}
CS_60003.is_extendable = false
CS_60003.extensions = {}
slot3.SC_60004_REQUEST_LIST_FIELD.name = "request_list"
slot3.SC_60004_REQUEST_LIST_FIELD.full_name = "p60.sc_60004.request_list"
slot3.SC_60004_REQUEST_LIST_FIELD.number = 2
slot3.SC_60004_REQUEST_LIST_FIELD.index = 0
slot3.SC_60004_REQUEST_LIST_FIELD.label = 3
slot3.SC_60004_REQUEST_LIST_FIELD.has_default_value = false
slot3.SC_60004_REQUEST_LIST_FIELD.default_value = {}
slot3.SC_60004_REQUEST_LIST_FIELD.message_type = MSG_INFO
slot3.SC_60004_REQUEST_LIST_FIELD.type = 11
slot3.SC_60004_REQUEST_LIST_FIELD.cpp_type = 10
SC_60004.name = "sc_60004"
SC_60004.full_name = "p60.sc_60004"
SC_60004.nested_types = {}
SC_60004.enum_types = {}
SC_60004.fields = {
	slot3.SC_60004_REQUEST_LIST_FIELD
}
SC_60004.is_extendable = false


bool _ctrl = false;

  bool get ctrl => _ctrl;

  set ctrl(bool value) {
    if (_ctrl != value) {
      _ctrl = value;
      notifyListeners();
    }
  }

  bool _shift = false;

  bool get shift => _shift;

  set shift(bool value) {
    if (_shift != value) {
      _shift = value;
      notifyListeners();
    }
  }

  bool _alt = false;

  bool get alt => _alt;

  set alt(bool value) {
    if (_alt != value) {
      _alt = value;
      notifyListeners();
    }
  }

  @override
  String? call(TerminalKeyboardEvent event) {
    final ret = _inputHandler.call(event.copyWith(
      ctrl: event.ctrl || _ctrl,
      shift: event.shift || _shift,
      alt: event.alt || _alt,
    ));
    G.maybeCtrlJ = event.key.name == "keyJ"; //这个是为了稍后区分按键到底是Enter还是Ctrl+J
    if (!(Util.getGlobal("isStickyKey") as bool)) {
      G.keyboard.ctrl = false;
      G.keyboard.shift = false;
      G.keyboard.alt = false;
    }
    return ret;
  }
}

//一个结合terminal和pty的类
class TermPty {
  late final Terminal terminal;
  late final Pty pty;

  TermPty() {
    terminal = Terminal(inputHandler: G.keyboard, maxLines: Util.getGlobal("termMaxLines") as int);
    pty = Pty.start(
      "/system/bin/sh",
      workingDirectory: G.dataPath,
      columns: terminal.viewWidth,
      rows: terminal.viewHeight,
    );
    pty.output
        .cast<List<int>>()
        .transform(const Utf8Decoder())
        .listen(terminal.write);
    pty.exitCode.then((code) {
      terminal.write('the process exited with exit code $code');
      if (code == 0) {
        SystemChannels.platform.invokeMethod("SystemNavigator.pop");
      }
      //Signal 9 hint
      if (code == -9) {
        D.androidChannel.invokeMethod("launchSignal9Page", {});
      }
    });
    terminal.onOutput = (data) {
      if (!(Util.getGlobal("isTerminalWriteEnabled") as bool)) {
        return;
      }
      //由于对回车的处理似乎存在问题，所以拿出来单独处理
      data.split("").forEach((element) {
        if (element == "\n" && !G.maybeCtrlJ) {
          terminal.keyInput(TerminalKey.enter);
          return;
        }
        G.maybeCtrlJ = false;
        pty.write(const Utf8Encoder().convert(element));
      });
    };
    terminal.onResize = (w, h, pw, ph) {
      pty.resize(h, w);
    };
  }

}

//default values
class D {

  //常用链接
  static const links = [
    {"name": "projectUrl", "value": "https://github.com/Cateners/tiny_computer"},
    {"name": "issueUrl", "value": "https://github.com/Cateners/tiny_computer/issues"},
    {"name": "faqUrl", "value": "https://gitee.com/caten/tc-hints/blob/master/pool/faq.md"},
    {"name": "solutionUrl", "value": "https://gitee.com/caten/tc-hints/blob/m


 bit flips break the authentication
                for _ in 0..4 {
                    let mut pmt3 = PartialMerkleTree::decode(&mut serialized).unwrap();
                    pmt3.damage(&mut rng);
                    let mut match_txid3 = vec![];
                    let merkle_root_3 = pmt3
                        .extract_matches(&mut match_txid3, &mut indexes)
                        .unwrap();
                    assert_ne!(merkle_root_3, merkle_root_1);
                }
            }
        }
    }

    #[test]
    fn pmt_malleability() {
        // Create some fake tx ids with the last 2 hashes repeating
        let txids: Vec<Hash> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 10]
            .iter()
            .map(|i| h256_rev(&format!("{:064x}", i)))
            .collect();

        let matches = vec![
            false, false, false, false, false, false, false, false, false, true, true, false,
        ];

        let tree = PartialMerkleTree::from_txids(&txids, &matches);
        // Should fail due to duplicate txs found
        let result = tree.extract_matches(&mut vec![], &mut vec![]);
        assert!(result.is_err());
    }

    // #[test]
    // fn merkle_block_serialization() {
    //     // Got it by running the rpc call `gettxoutproof '["220ebc64e21abece964927322cba69180ed853bb187fbc6923bac7d010b9d87a"]'`
    //     let data = hex::decode(
    //         "0100000090f0a9f110702f808219ebea1173056042a714bad51b916cb6800000000000005275289558f51c\
    //         9966699404ae2294730c3c9f9bda53523ce50e9b95e558da2fdb261b4d4c86041b1ab1bf930900000005fac\
    //         7708a6e81b2a986dea60db2663840ed141130848162eb1bd1dee54f309a1b2ee1e12587e497ada70d9bd10d\
    //         31e83f0a924825b96cb8d04e8936d793fb60db7ad8b910d0c7ba2369bc7f18bb53d80e1869ba2c32274996c\
    //         ebe1ae264bc0e2289189ff0316cdc10511da71da757e553cada9f3b5b1434f3923673adb57d83caac392c38\
    //         af156d6fc30b55fad4112df2b95531e68114e9ad10011e72f7b7cfdb025700"
    //     ).unwrap();
    //     let mb: MerkleBlock = deserialize(data.as_slice()).unwrap();
    //     assert_eq!(get_block_13b8a().hash(), mb.header.hash());
    //
    //     let merkle_root = mb.pmt.extract_matches(&mut vec![], &mut vec![]).unwrap();
    //     assert_eq!(merkle_root, mb.header.merkle_root_hash);
    //
    //     // Serialize again and check that it matches the original bytes
    //     assert_eq!(data, *serialize(&mb));
    // }

    /// Create a MerkleBlock using a list of txids which will be found in the given block.
    #[test]
    fn merkle_block_construct_from_txids_found() {
        let block = get_block_13b8a();

        let txid1 = h256_rev("74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20");
        let txid2 = h256_rev("


 the planned value.
		to.Metastores = from.Metastores
	}
}

func (to *ListMetastoresResponse) SyncFieldsDuringRead(ctx context.Context, from ListMetastoresResponse) {
	if !from.Metastores.IsNull() && !from.Metastores.IsUnknown() && to.Metastores.IsNull() && len(from.Metastores.Elements()) == 0 {
		// The default representation of an empty list for TF autogenerated resources in the resource state is Null.
		// If a user specified a non-Null, empty list for Metastores, and the deserialized field value is Null,
		// set the resulting resource state to the empty list to match the planned value.
		to.Metastores = from.Metastores
	}
}

func (c ListMetastoresResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder {
	attrs["metastores"] = attrs["metastores"].SetOptional()
	attrs["next_page_token"] = attrs["next_page_token"].SetOptional()

	return attrs
}

// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListMetastoresResponse.
// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry
// the type information of their elements in the Go type system. This function provides a way to
// retrieve the type information of the elements in complex fields at runtime. The values of the map
// are the reflected types of the contained elements. They must be either primitive values from the
// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF
// SDK values.
func (a ListMetastoresResponse) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type {
	return map[string]reflect.Type{
		"metastores": reflect.TypeOf(MetastoreInfo{}),
	}
}

// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise
// interfere with how the plugin framework retrieves and sets values in state. Thus, ListMetastoresResponse
// only implements ToObjectValue() and Type().
func (o ListMetastoresResponse) ToObjectValue(ctx context.Context) basetypes.ObjectValue {
	return types.ObjectValueMust(
		o.Type(ctx).(basetypes.ObjectType).AttrTypes,
		map[string]attr.Value{
			"metastores":      o.Metastores,
			"next_page_token": o.NextPageToken,
		})
}

// Type implements basetypes.ObjectValuable.
func (o ListMetastoresResponse) Type(ctx context.Context) attr.Type {
	return types.ObjectType{
		AttrTypes: map[string]attr.Type{
			"metastores": basetypes.ListType{
				ElemType: MetastoreInfo{}.Type(ctx),
			},
			"next_page_token": types.StringType,
		},
	}
}

// GetMetastores returns the value of the Metastores field in ListMetastoresResponse as
// a slice of MetastoreInfo values.
// If the field is unknown or null, the boolean return value is false.
func (o *ListMetastoresResponse) GetMetastores(ctx context.Context) ([]MetastoreInfo, bool) {
	if o.Metastores.IsNull() || o.Metastores.IsUnknown() {
		return nil, false
	}
	var v []MetastoreInfo
	d := o.Metastores.ElementsAs(ctx, &v, true)
	if d.HasError() {
		panic(pluginfwcommon.DiagToString(d))
	}
	return v, true
}

// SetMetastores sets the value of the Metastores field in ListMetastoresResponse.
func (o *ListMetastoresResponse) SetMetastores(ctx context.Context, v []MetastoreInfo) {
	vs := make([]attr.Value, 0, len(v))
	for _, e := range v {
		vs = append(vs, e.ToObjectValue(ctx))
	}
	t := o.Type(ctx).


 (eventName === 'InfoUpdated') {
            let endpointId = params.endpointId;
            let endpoint = this._endpoints.get(endpointId);
            if (endpoint) {
                endpoint._handleEvent(EndpointEventTypes.InfoUpdated, params);
            }
        }
    }

    /**
     * @ignore
     */
    private _replaceCallIdWithCallInEvent(data: any) {
        delete data.callId;
        data.call = this;
    }

    /**
     * @ignore
     */
    private _emit(eventType: CallEventTypes, event: object) {
        console.log(`VOXCRD: Call._emit: ready to emit event: ${eventType}`);
        const handlers = this._listeners.get(eventType);
        handlers!.forEach(handler => handler(event));
    }

}
import {find, isEmpty} from 'lodash';

export const assignTeam = (teams, user) => {
 for (const [team, users] of Object.entries(teams)) {
   const currentUser = find(users, { 'name': user.name })
   if (currentUser) return team;
 }
 return null;
}

export const findOthers = (team, user) => {
  // const currentUser = find(team, {'name': user.name });
  return team.filter(others => others.name !== user.name);
}

export const orderTeams = (teamScores) => {
  if (isEmpty(teamScores)) return null;

  const sortedTeams = [];
  const sorted = [];

  for (let team in teamScores) {
    sorted.push([team, teamScores[team]])
  };
  sorted.sort((a, b) => a[1] - b[1]).reverse();

  sorted.forEach(team => {
    sortedTeams.push(team[0]);
  });

  return sortedTeams;
}

export const getLeader = teamScores => {
  const sorted = [];

  for (let team in teamScores) {
    sorted.push([team, teamScores[team]])
  };
  sorted.sort((a, b) => a[1] - b[1]).reverse();

  return sorted;
}
import { FFmpegHlsDriver } from "./FFmpegHlsDriver";
import { VideoMediaStream } from "../../MediaProviders/MediaStreams/VideoStream";
import * as strToStream from 'string-to-stream';

export class HlsVirtualPlaylist {
    protected buffer : Buffer;

    driver : FFmpegHlsDriver;

    input : VideoMediaStream;

    get length () : number {
        if ( !this.buffer ) {
            return 0;
        }

        return this.buffer.length;
    }

    constructor ( driver : FFmpegHlsDriver, input : VideoMediaStream ) {
        this.driver = driver;
        this.input = input;

        this.buffer = this.create( driver, input );
    }

    protected create ( driver, input ) : Buffer {
        const lines : string[] = [];

        const duration : number = this.driver.getSegmentDuration();

        const dur = 1000 * this.driver.getSegmentDuration();

        const durationString : string = '#EXTINF:' + Math.min( Math.ceil( dur / 23.98 ) * 23.98 / 1000, this.input.duration ) + ',';

        lines.push(
            '#EXTM3U',
            '#EXT-X-VERSION:3',
            '#EXT-X-TARGETDURATION:' + ( duration + 1 ),
            '#EXT-X-MEDIA-SEQUENCE:0',
            '#EXT-X-PLAYLIST-TYPE:VOD',
            '#EXT-X-DISCONTINUITY'
        );

        let i = 0;

        for ( let s = 0; s < this.input.duration; i++ ) {
            lines.push(
                s + duration > this.input.duration ? '#EXTINF:' + ( this.input.duration - s ) + ',' : durationString,
                ( this.driver.getSegmentLocationPrefix() || '' ) + 'index' + i + '.ts'
            );


 &[u8], post_digits: &[u8]) -> f64 {
    let mut full_number: Vec<u8> = Vec::new();
    full_number.extend_from_slice(pre_digits);
    full_number.extend_from_slice(b".");
    full_number.extend_from_slice(post_digits);
    bytes_to_f64(&full_number)
}

/// Get a float per the wierd PDF rules that i dont trust std library functions
/// with for some reason.
pub fn recognize_pdf_float(i: &[u8]) -> IResult<&[u8], PdfObject> {
    match preceded(
        pdf_whitespace,
        alt((
            tuple((
                opt(alt((map(tag(b"+"), |_| 1f64), map(tag(b"-"), |_| -1f64)))),
                take_while(is_digit),
                tag(b"."),
                take_while1(is_digit),
            )),
            tuple((
                opt(alt((map(tag(b"+"), |_| 1f64), map(tag(b"-"), |_| -1f64)))),
                take_while1(is_digit),
                tag(b"."),
                take_while(is_digit),
            )),
        )),
    )(i)
    {
        Ok((rest, (Some(sign), pre_digits, _decimal_point, post_digits))) => Ok((
            rest,
            PdfObject::Float(sign * two_byte_slices_of_digits_to_f64(pre_digits, post_digits)),
        )),
        Ok((rest, (None, pre_digits, _decimal_point, post_digits))) => Ok((
            rest,
            PdfObject::Float(two_byte_slices_of_digits_to_f64(pre_digits, post_digits)),
        )),
        Err(err) => Err(err),
    }
}

#[inline]
fn is_pdf_whitespace(chr: u8) -> bool {
    chr == 0x00 || chr == 0x09 || chr == 0x0A || chr == 0x0C || chr == 0x0D || chr == 0x20
}

fn pdf_whitespace(i: &[u8]) -> IResult<&[u8], &[u8]> {
    take_while(is_pdf_whitespace)(i)
}

#[inline]
fn is_pdf_delimiter(chr: u8) -> bool {
    chr == 0x28
        || chr == 0x29
        || chr == 0x3c
        || chr == 0x3e
        || chr == 0x5b
        || chr == 0x5d
        || chr == 0x7b
        || chr == 0x7d
        || chr == 0x2f
        || chr == 0x25
}

#[inline]
fn can_be_in_hexadecimal_string(chr: u8) -> bool {
    is_hex_digit(chr) || is_pdf_whitespace(chr)
}

#[inline]
fn hex_digit_to_byte_value(chr: u8) -> u8 {
    // heh
    if (0x30..=0x39).contains(&chr) {
        chr - 0x30
    } else if (0x41..=0x46).contains(&chr) {
        chr - 0x37
    } else {
        chr - 0x57
    }
}

// because we trust.  this irks me.
fn vec_of_bytes_from_hex_string_literal(input: &[u8]) -> Option<Vec<u8>> {
    let mut result: Vec<u8> = Vec::new();
    let filtered: Vec<u8> = input
        .iter()
        .filter(|&x| is_hex_digit(*x))
        .map(|&x| hex_digit_to_byte_value(x))
        .collect();

    for pair in filtered.chunks(2) {
        if pair.len() == 2 {
            result.push((pair[0] << 4) + pair[1]);
        } else if pair.len() ==


092E1B8 00000000 */  nop
/* 01BEC 8092E1BC 3C038094 */  lui     $v1, %hi(D_80938CA8)       ## $v1 = 80940000
/* 01BF0 8092E1C0 24638CA8 */  addiu   $v1, $v1, %lo(D_80938CA8)  ## $v1 = 80938CA8
/* 01BF4 8092E1C4 3C0140A0 */  lui     $at, 0x40A0                ## $at = 40A00000
/* 01BF8 8092E1C8 44810000 */  mtc1    $at, $f0                   ## $f0 = 5.00
/* 01BFC 8092E1CC C4640004 */  lwc1    $f4, 0x0004($v1)           ## 80938CAC
/* 01C00 8092E1D0 C4680010 */  lwc1    $f8, 0x0010($v1)           ## 80938CB8
/* 01C04 8092E1D4 46002180 */  add.s   $f6, $f4, $f0
/* 01C08 8092E1D8 46004280 */  add.s   $f10, $f8, $f0
/* 01C0C 8092E1DC E4660004 */  swc1    $f6, 0x0004($v1)           ## 80938CAC
/* 01C10 8092E1E0 E46A0010 */  swc1    $f10, 0x0010($v1)          ## 80938CB8
/* 01C14 8092E1E4 920903E4 */  lbu     $t1, 0x03E4($s0)           ## 000003E4
.L8092E1E8:
/* 01C18 8092E1E8 3C0A8094 */  lui     $t2, %hi(D_80938C98)       ## $t2 = 80940000
/* 01C1C 8092E1EC 254A8C98 */  addiu   $t2, $t2, %lo(D_80938C98)  ## $t2 = 80938C98
/* 01C20 8092E1F0 312B0002 */  andi    $t3, $t1, 0x0002           ## $t3 = 00000000
/* 01C24 8092E1F4 11600014 */  beq     $t3, $zero, .L8092E248
/* 01C28 8092E1F8 312CFFFC */  andi    $t4, $t1, 0xFFFC           ## $t4 = 00000000
/* 01C2C 8092E1FC A20C03E4 */  sb      $t4, 0x03E4($s0)           ## 000003E4
/* 01C30 8092E200 8D420000 */  lw      $v0, 0x0000($t2)           ## 80938C98
/* 01C34 8092E204 02002825 */  or      $a1, $s0, $zero            ## $a1 = 00000000
/* 01C


x839460a1  ! 3869: WRPR_TNPC_I	wrpr	%r17, 0x00a1, %tnpc
hwintr_2_167:
!$EV trig_pc_d(2,expr(@VA(.MAIN.hwintr_2_167), 16, 16)) -> intp(2, 0, 3b)
	.word 0x8595a03f  ! 3881: WRPR_TSTATE_I	wrpr	%r22, 0x003f, %tstate
	.word 0xbb504000  ! 3883: RDPR_TNPC	<illegal instruction>
	.word 0xbb520000  ! 3886: RDPR_PIL	<illegal instruction>
	.word 0xf015e179  ! 3887: LDUH_I	lduh	[%r23 + 0x0179], %r24
	.word 0xbc9ca048  ! 3893: XORcc_I	xorcc 	%r18, 0x0048, %r30
	.word 0xfa5c4000  ! 3897: LDX_R	ldx	[%r17 + %r0], %r29
	.word 0xb151c000  ! 3898: RDPR_TL	<illegal instruction>
	.word 0xf6040000  ! 3899: LDUW_R	lduw	[%r16 + %r0], %r27
	.word 0xf414e07a  ! 3900: LDUH_I	lduh	[%r19 + 0x007a], %r26
	.word 0xbf518000  ! 3906: RDPR_PSTATE	<illegal instruction>
	setx	data_start_5, %g1, %r16
	ta	T_CHANGE_HPRIV
	mov	0x38, %g1
	stxa	%r16, [%g1] 0x58
	ta	T_CHANGE_NONHPRIV
	.word 0xfc05c000  ! 3912: LDUW_R	lduw	[%r23 + %r0], %r30
	.word 0xfe0dc000  ! 3913: LDUB_R	ldub	[%r23 + %r0], %r31
	.word 0xb43dc000  ! 3915: XNOR_R	xnor 	%r23, %r0, %r26
	.word 0xb3540000  ! 3922: RDPR_GL	<illegal instruction>
hwintr_2_168:
!$EV trig_pc_d(2,expr(@VA(.MAIN.hwintr_2_168), 16, 16)) -> intp(2, 0, 24)
	.word 0xbb500000  ! 3926: RDPR_TPC	<illegal instruction>
	ta	T_CHANGE_HPRIV
	.word 0x81983ec9  ! 3928: WRHPR_HPSTATE_I	wrhpr	%r0, 0x1ec9, %hpstate
hwintr_2_169:
!$EV trig_pc_d(2,expr(@VA(.MAIN.hwintr_2_169), 16, 16)) -> intp(2, 0, 1f)
	.word 0xf01d6186  ! 3933: LDD_I	ldd	[%r21 + 0x0186], %r24
	.word 0xbe34c000  ! 3934: SUBC_R	orn 	%r19, %r0, %r31
	.word 0xf45ca080  ! 3936: LDX_I	ldx	[%r18 + 0x0080], %r26
	.word 0xf204e16d  ! 3940: LDUW_I	lduw	[%r19 + 0x016d], %r25
	.word 0xbac42118  ! 3941: ADDCcc_I	addccc 	%r16, 0x0118, %r29
	.word 0xf4054000  ! 3942: LDUW_R	lduw	[%r21 + %r0], %r26
	.word 0xf80d213b  ! 39


", "\u7C7B\u8DEF\u5F84: {0}"},
        {"colon mark", ":"},
        {"colon space", ": "},
        {"Command is not supported on the target VM", "\u76EE\u6807 VM \u4E0D\u652F\u6301\u547D\u4EE4 ''{0}''"},
        {"Command is not supported on a read-only VM connection", "\u53EA\u8BFB VM \u8FDE\u63A5\u4E0D\u652F\u6301\u547D\u4EE4 ''{0}''"},
        {"Command not valid until the VM is started with the run command", "\u5728\u4F7F\u7528 ''run'' \u547D\u4EE4\u542F\u52A8 VM \u524D, \u547D\u4EE4 ''{0}'' \u662F\u65E0\u6548\u7684"},
        {"Condition must be boolean", "\u6761\u4EF6\u5FC5\u987B\u662F\u5E03\u5C14\u578B"},
        {"Connector and Transport name", "  \u8FDE\u63A5\u5668: {0}, \u4F20\u8F93: {1}"},
        {"Connector argument nodefault", "    \u53C2\u6570: {0} (\u65E0\u9ED8\u8BA4\u503C)"},
        {"Connector argument default", "    \u53C2\u6570: {0}, \u9ED8\u8BA4\u503C: {1}"},
        {"Connector description", "    \u8BF4\u660E: {0}"},
        {"Connector required argument nodefault", "    \u6240\u9700\u7684\u53C2\u6570: {0} (\u65E0\u9ED8\u8BA4\u503C)"},
        {"Connector required argument default", "    \u6240\u9700\u7684\u53C2\u6570: {0}, \u9ED8\u8BA4\u503C: {1}"},
        {"Connectors available", "\u53EF\u7528\u8FDE\u63A5\u5668\u4E3A:"},
        {"Constant is not a method", "\u5E38\u91CF\u4E0D\u662F\u65B9\u6CD5"},
        {"Could not open:", "\u65E0\u6CD5\u6253\u5F00: {0}"},
        {"Current method is native", "\u5F53\u524D\u65B9\u6CD5\u4E3A\u672C\u673A\u65B9\u6CD5"},
        {"Current thread died. Execution continuing...", "\u5F53\u524D\u7EBF\u7A0B{0}\u5DF2\u6210\u4E3A\u6B7B\u7EBF\u7A0B\u3002\u7EE7\u7EED\u6267\u884C..."},
        {"Current thread isnt suspended.", "\u5F53\u524D\u7EBF\u7A0B\u672A\u6302\u8D77\u3002"},
        {"Current thread not set.", "\u5F53\u524D\u7EBF\u7A0B\u672A\u8BBE\u7F6E\u3002"},
        {"dbgtrace flag value must be an integer:", "dbgtrace \u6807\u8BB0\u503C\u5FC5\u987B\u4E3A\u6574\u6570: {0}"},
        {"Deferring.", "\u6B63\u5728\u5EF6\u8FDF{0}\u3002


/BasicLayoutExample.ts
     */
    class BasicLayout extends LayoutBase {

        /**
         * @language zh_CN
         * 构造函数。
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        constructor();

        /**
         * @language zh_CN
         * BasicLayout不支持虚拟布局，设置这个属性无效。
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        useVirtualLayout: boolean;
        /**
         * @inheritDoc
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        measure(): void;
        /**
         * @inheritDoc
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
    }
}
declare module eui.sys {
    /**
     * @private
     * 一个工具方法，使用BasicLayout规则测量目标对象。
     */
    function measure(target: eui.Group | eui.Component): void;
    /**
     * @private
     * 一个工具方法，使用BasicLayout规则布局目标对象。
     */
    function updateDisplayList(target: eui.Group | eui.Component, unscaledWidth: number, unscaledHeight: number): egret.Point;
}
declare module eui {

    /**
     * @language zh_CN
     * ColumnAlign 类为 TileLayout 类的 columnAlign 属性定义可能的值。
     *
     * @version Egret 2.4
     * @version eui 1.0
     * @platform Web,Native
     * @includeExample  extension/eui/layout/ColumnAlignExample.ts
     */
    class ColumnAlign {

        /**
         * @language zh_CN
         * 不将行两端对齐。
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        static LEFT: string;

        /**
         * @language zh_CN
         * 通过增大水平间隙将行两端对齐。
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        static JUSTIFY_USING_GAP: string;

        /**
         * @language zh_CN
         * 通过增大行高度将行两端对齐。
         *
         * @version Egret 2.4
         * @version eui 1.0
         * @platform Web,Native
         */
        static JUSTIFY_USING_WIDTH: string;
    }
}
declare module eui {

    /**
     * @language zh_CN
     * 线性布局基类，通常作为 HorizontalLayout 和 VerticalLayout 的父类。
     *
     * @version Egret 2.4
     * @version eui 1.0
     * @platform Web,Native
     */
    class LinearLayoutBase extends LayoutBase {
        /**
         * @private
         */
        $horizontalAlign: string;

        /**
         * @language zh_CN
         * 布局元素的水平对齐策略。
         *
egret.HorizontalAlign 和
         * eui.JustifyAlign类定义此属性的可能值。

         *
         * @default "left"


fid - Rfid Factory Id" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_factory_id"}
String rfid_product_id "Rfid - Rfid Product Id" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_product_id"}
String rfid_time "Rfid - Rfid Time" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_time"}
String rfid_serial_num "Rfid - Rfid Serial Num" (G_airpurifier) {channel="miio:basic:airpurifier:rfid_serial_num"}
Number reboot_cause "Others - Reboot Cause" (G_airpurifier) {channel="miio:basic:airpurifier:reboot_cause"}
Number hw_version "Others - Hw Version" (G_airpurifier) {channel="miio:basic:airpurifier:hw_version"}
Number sgp_ethanol "Others - Sgp Ethanol" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_ethanol"}
Number sgp_serial "Others - Sgp Serial" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_serial"}
String sgp_version "Others - Sgp Version" (G_airpurifier) {channel="miio:basic:airpurifier:sgp_version"}
Number country_code "Others - Country Code" (G_airpurifier) {channel="miio:basic:airpurifier:country_code"}
Switch gesture_status "Others - Gesture Status" (G_airpurifier) {channel="miio:basic:airpurifier:gesture_status"}
```

### Mi Standing Fan (zhimi.fan.sa1) item file lines

note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.

```java
Group G_fan "Mi Standing Fan" <status>
Switch power "Power" (G_fan) {channel="miio:basic:fan:power"}
Switch angleEnable "Rotation" (G_fan) {channel="miio:basic:fan:angleEnable"}
Number:Time usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"}
Number:Angle angle "Angle" (G_fan) {channel="miio:basic:fan:angle"}
Number:Time poweroffTime "Power-Off Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"}
Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"}
Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"}
Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"}
Dimmer speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"}
Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"}
Dimmer naturalLevel "Natural Level" (G_fan) {channel="miio:basic:fan:naturalLevel"}
Switch acPower "AC Power" (G_fan) {channel="miio:basic:fan:acPower"}
String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"}
```

### Mi Smart Fan (zhimi.fan.v1) item file lines

note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.

```java
Group G_fan "Mi Smart Fan" <status>
Switch power "Power" (G_fan) {channel="miio:basic:fan:power"}
Switch angleEnable "Rotation" (G_fan) {channel="miio:basic:fan:angleEnable"}
Number:Time usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"}
Number:Angle angle "Angle" (G_fan) {channel="miio:basic:fan:angle"}
Number:


NewEncodedObjectParser[TReference](actionEncoder)
	return &ActionReaders[TReference]{
		CommandAction: model_parser.LookupParsedObjectReader(
			c.parsedObjectPoolIngester,
			model_parser.NewChainedObjectParser(
				encodedObjectParser,
				model_parser.NewProtoObjectParser[TReference, model_command_pb.Action](),
			),
		),
		CommandPathPatternChildren: model_parser.LookupParsedObjectReader(
			c.parsedObjectPoolIngester,
			model_parser.NewChainedObjectParser(
				encodedObjectParser,
				model_parser.NewProtoObjectParser[TReference, model_command_pb.PathPattern_Children](),
			),
		),
		CommandResult: model_parser.LookupParsedObjectReader(
			c.parsedObjectPoolIngester,
			model_parser.NewChainedObjectParser(
				encodedObjectParser,
				model_parser.NewProtoObjectParser[TReference, model_command_pb.Result](),
			),
		),

		FetchResult: model_parser.LookupParsedObjectReader(
			c.parsedObjectPoolIngester,
			model_parser.NewChainedObjectParser(
				encodedObjectParser,
				model_parser.NewProtoObjectParser[TReference, model_fetch_pb.Result](),
			),
		),
	}, nil
}
package analysis_test

import (
	"testing"

	model_analysis "bonanza.build/pkg/model/analysis"
	model_core "bonanza.build/pkg/model/core"
	model_analysis_pb "bonanza.build/pkg/proto/model/analysis"
	model_filesystem_pb "bonanza.build/pkg/proto/model/filesystem"
	model_starlark_pb "bonanza.build/pkg/proto/model/starlark"

	"github.com/buildbarn/bb-storage/pkg/testutil"
	"github.com/stretchr/testify/require"

	"google.golang.org/protobuf/types/known/wrapperspb"

	"go.uber.org/mock/gomock"
)

// emptyLeaves can be embedded into DirectoryContents messages to
// indicate that a directory contains no files or symlinks.
var emptyLeaves = &model_filesystem_pb.DirectoryContents_LeavesInline{
	LeavesInline: &model_filesystem_pb.Leaves{},
}

func directoryNode(name string, contents *model_filesystem_pb.DirectoryContents) *model_filesystem_pb.DirectoryNode {
	return &model_filesystem_pb.DirectoryNode{
		Name: name,
		Directory: &model_filesystem_pb.Directory{
			Contents: &model_filesystem_pb.Directory_ContentsInline{
				ContentsInline: contents,
			},
		},
	}
}

// singleChildDirectoryContents can be used to construct a directory
// that only contains a single child that is also a directory.
func singleChildDirectoryContents(name string, childContents *model_filesystem_pb.DirectoryContents) *model_filesystem_pb.DirectoryContents {
	return &model_filesystem_pb.DirectoryContents{
		Directories: []*model_filesystem_pb.DirectoryNode{
			directoryNode(name, childContents),
		},
		Leaves: emptyLeaves,
	}
}

func TestFileRoot(t *testing.T) {
	ctrl, ctx := gomock.WithContext(t.Context(), t)
	bct := newBaseComputerTester(ctrl)

	exampleConfiguration := newObject(func(patcher *model_core.ReferenceMessagePatcher[model_core.CreatedObjectTree]) model_core.Marshalable {
		return model_core.NewProtoListMarshalable([]*model_analysis_pb.BuildSettingOverride{{
			Level: &model_analysis_pb.BuildSettingOverride_Leaf_{
				Leaf: &model_analysis_pb.BuildSettingOverride_Leaf{
					Label: "@@bazel_tools+//command_line_option:platforms",
					Value: &model_starlark_pb.Value{
						Kind: &model_starlark_pb.Value_List{
							List: &model_st


</address>

    <button class="close" data-dismiss="modal"
        aria-hidden="true">×</button>

Add Machine to Dashboard

                Address

                    <input class="form-control" id="add-machine-address"
                       type="test" value="{{ full_address }}"
                       list="options"
                       placeholder="{{ placeholder }}"/>
                    <datalist id="options">
                        {{#options}}
                        <option value="{{.}}">
                        {{/options}}
                    </datalist>

                Color

    {{#nearlimit}}

        Connecting simultaneously to more than {{ limit }} machines is unsupported.

    {{/nearlimit}}
    <button class="pf-c-button pf-m-secondary" data-dismiss="modal" translate="yes">Cancel</button>
    <button class="pf-c-button pf-m-primary" translate="yes">Add</button>

<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<meta name="description" content="">
	<meta name="author" content="">

	<title>XaoS.js</title>

	<link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="starter-template.css" rel="stylesheet">

			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
				Toggle navigation

			</button>
			XaoS.js

About

GitHub

    <canvas id="canvas">

Your browser doesn't seem to support the <canvas> tag.
            Try Chrome or Firefox.

    </canvas>

      <button id ="fullScreenButton" class = "btn btn-primary" onclick="goFullScreen();"></button>
      <a href="index.html" id ="resetButton"


/*
    Unitemp - Universal temperature reader
    Copyright (C) 2022-2023  Victor Nikitchuk (https://github.com/quen0n)

    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 <https://www.gnu.org/licenses/>.
*/
#ifndef UNITEMP
#define UNITEMP

/* Подключение стандартных библиотек */

/* Подключение API Flipper Zero */
//Файловый поток
#include <toolbox/stream/file_stream.h>
//Экран
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/widget.h>
#include <gui/modules/popup.h>
//Уведомления
#include <notification/notification.h>
#include <notification/notification_messages.h>

/* Внутренние библиотеки */
//Интерфейсы подключения датчиков
#include "Sensors.h"

/* Объявление макроподстановок */
//Имя приложения
#define APP_NAME "Unitemp"
//Версия приложения
#define UNITEMP_APP_VER "1.1.2-dev"
//Путь хранения файлов плагина
#define APP_PATH_FOLDER "/ext/unitemp"
//Имя файла с настройками
#define APP_FILENAME_SETTINGS "settings.cfg"
//Имя файла с датчиками
#define APP_FILENAME_SENSORS "sensors.cfg"

//Размер буффера текста
#define BUFF_SIZE 32

#define UNITEMP_D

#ifdef FURI_DEBUG
#define UNITEMP_DEBUG(msg, ...) FURI_LOG_D(APP_NAME, msg, ##__VA_ARGS__)
#else
#define UNITEMP_DEBUG(msg, ...)
#endif

/* Объявление перечислений */
//Единицы измерения температуры
typedef enum { UT_TEMP_CELSIUS, UT_TEMP_FAHRENHEIT, UT_TEMP_COUNT } tempMeasureUnit;
//Единицы измерения давления
typedef enum {
    UT_PRESSURE_MM_HG,
    UT_PRESSURE_IN_HG,
    UT_PRESSURE_KPA,

    UT_PRESSURE_COUNT
} pressureMeasureUnit;
/* Объявление структур */
//Настройки плагина
typedef struct {
    //Бесконечная работа подсветки
    bool infinityBacklight;
    //Единица измерения температуры
    tempMeasureUnit temp_unit;
    //Единица измерения давления
    pressureMeasureUnit pressure_unit;
    //Последнее состояние OTG
    bool lastOTGState;
} UnitempSettings;

//Основная структура плагина
typedef struct {
    //Система
    bool processing; //Флаг работы приложения. При ложном значении приложение закрывается
    bool sensors_ready; //Флаг готовности датчиков к опросу
    //Основные настройки
    UnitempSettings settings;
    //Массив указателей на датчики
    Sensor** sensors;
    //Количество загруженных датчиков
    uint8_t sensors_count;
    //SD-карта
    Storage* storage; //Хранилище
    Stream* file_stream; //Файловый поток

    //Экран
    Gui* gui;
    ViewDispatcher* view_dispatcher;
    NotificationApp* notifications;
    Widget* widget;
    Popup* popup;
    //Буффер для различного текста
    char* buff;
} Unitemp;

/* Объявление прототипов функций */

/**
 * @brief Перевод значения температуры датчика из Цельсия в Фаренгейты
 *
 * @param sensor Указатель на датчик
 */
void uintemp_celsiumToFarengate(Sensor* sensor);

/**
 * @brief Конвертация давления из паскалей в мм рт.ст.
 *
 * @param sensor Указатель на датчик
 */
void unitemp_pascalToMmHg(Sensor* sensor);

/**
 * @brief Конвертация давления из паскалей в килопаскали
 *
 * @param sensor Указатель на датчик
 */
void unitemp_pascalToKPa(Sensor* sensor);
/**
 * @brief Конвертация давления из паскалей в дюйм рт.ст.
 *
 * @param sensor Указатель на датчик
 */
void unitemp_pascalToInHg(Sensor* sensor);

/**
 * @brief Сохранение настроек на SD-карту
 *
 * @return Истина если сохранение успешное
 */
bool unitemp_saveSettings(void);
/**
 * @brief Загрузка настроек с SD-карты
 *
 * @return Истина если загрузка успешная
 */
bool unitemp_loadSettings(void);

extern Unitemp* app;
#endif


match h.next() {
                    Some(h) => Some(WeekdayAndHour(w.to_owned(), h)),
                    None => w.next().map(|w| WeekdayAndHour(w, Hour::C0)),
                }
            }
            None => Some(WeekdayAndHour(Weekday::first(), Hour::C0)),
        };
        self.curr = new.to_owned();
        new
    }
}

//
#[derive(Debug, Clone, Default)]
pub struct WeekdayFromSundayAndHourIterator {
    curr: Option<WeekdayAndHour>,
}

impl WeekdayFromSundayAndHourIterator {
    pub fn new() -> Self {
        Self::default()
    }
}

impl Iterator for WeekdayFromSundayAndHourIterator {
    type Item = WeekdayAndHour;

    fn next(&mut self) -> Option<Self::Item> {
        let new = match &self.curr {
            Some(v) => {
                let WeekdayAndHour(w, h) = v;
                match h.next() {
                    Some(h) => Some(WeekdayAndHour(w.to_owned(), h)),
                    None => w.next_from_sunday().map(|w| WeekdayAndHour(w, Hour::C0)),
                }
            }
            None => Some(WeekdayAndHour(Weekday::first_from_sunday(), Hour::C0)),
        };
        self.curr = new.to_owned();
        new
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[cfg(feature = "with-chrono")]
    #[test]
    fn test_from_chrono() {
        use chrono::Utc;

        assert_eq!(
            WeekdayAndHour::from("2021-08-01T00:00:00".parse::<NaiveDateTime>().unwrap()),
            WeekdayAndHour(Weekday::Sun, Hour::C0)
        );

        assert_eq!(
            WeekdayAndHour::from("2021-08-01T00:00:00Z".parse::<DateTime<Utc>>().unwrap()),
            WeekdayAndHour(Weekday::Sun, Hour::C0)
        );
    }

    #[test]
    fn test_iter() {
        assert_eq!(WeekdayAndHourIterator::new().into_iter().count(), 7 * 24);

        assert_eq!(
            WeekdayAndHourIterator::new().next(),
            Some(WeekdayAndHour(Weekday::Mon, Hour::C0))
        );
    }

    #[test]
    fn test_from_sunday_iter() {
        assert_eq!(
            WeekdayFromSundayAndHourIterator::new().into_iter().count(),
            7 * 24
        );

        assert_eq!(
            WeekdayFromSundayAndHourIterator::new().next(),
            Some(WeekdayAndHour(Weekday::Sun, Hour::C0))
        );
    }
}
use async_trait::async_trait;
use finql_postgres::PostgresDB;
use finql_data::DataError;

use crate::user::{User, UserHandler, UserSettings};
use crate::accounts::Account;

#[async_trait]
impl UserHandler for PostgresDB {
    /// Clean database by dropping all tables related to user management and run init_users
    async fn clean_users(&self) -> Result<(), DataError> {
        sqlx::query!("DROP TABLE IF EXISTS account_rights").execute(&self.pool).await
        .map_err(|e| DataError::DataAccessFailure(e.to_string()))?;
        self.init_users().await?;
        sqlx::query!("DROP TABLE IF EXISTS users").execute(&self.pool).await
           .map_err(|e| DataError::DataAccessFailure(e.to_string()))?;
        self.init_users().await?;
        Ok(())
    }

    /// Set up new tables for user management
    async fn init_users(&self) -> Result<(), DataError> {
        sqlx::query!(
        "CREATE TABLE IF NOT EXISTS users (
            id SERIAL PRIMARY KEY,
            name TEXT NOT NULL,
            display TEXT,
            salt_hash TEXT NOT NULL,
            is_admi


'''OpenGL extension VERSION.GL_1_2

This module customises the behaviour of the
OpenGL.raw.GL.VERSION.GL_1_2 to provide a more
Python-friendly API

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/VERSION/GL_1_2.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.VERSION.GL_1_2 import *
from OpenGL.raw.GL.VERSION.GL_1_2 import _EXTENSION_NAME

def glInitGl12VERSION():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )

# INPUT glDrawRangeElements.indices size not checked against 'count,type'
glDrawRangeElements=wrapper.wrapper(glDrawRangeElements).setInputArraySize(
    'indices', None
)
# INPUT glTexImage3D.pixels size not checked against 'format,type,width,height,depth'
glTexImage3D=wrapper.wrapper(glTexImage3D).setInputArraySize(
    'pixels', None
)
# INPUT glTexSubImage3D.pixels size not checked against 'format,type,width,height,depth'
glTexSubImage3D=wrapper.wrapper(glTexSubImage3D).setInputArraySize(
    'pixels', None
)
### END AUTOGENERATED SECTION
from OpenGL.GL.ARB.imaging import *
from OpenGL.GL.VERSION.GL_1_2_images import *

GL_POINT_SIZE_GRANULARITY = GL_SMOOTH_POINT_SIZE_GRANULARITY # alias
GL_POINT_SIZE_RANGE = GL_SMOOTH_POINT_SIZE_RANGE # alias
GL_LINE_WIDTH_GRANULARITY = GL_SMOOTH_LINE_WIDTH_GRANULARITY # alias
GL_LINE_WIDTH_RANGE = GL_SMOOTH_LINE_WIDTH_RANGE # alias

glDrawRangeElements = wrapper.wrapper( glDrawRangeElements ).setPyConverter(
    'indices', arrays.AsArrayOfType( 'indices', 'type' ),
).setReturnValues(
    wrapper.returnPyArgument( 'indices' )
)


( opacity: 0.0...1.0 ) : color

通过设置在RGBA色彩空间的alpha(透明度)分量返回一个新的颜色值。

opacify

( delta: 0.0...1.0 ) : color

通过增加/减少在RGBA色彩空间的alpha(透明度)分量返回一个新的颜色值。

grayscale

( ratio: 0.0...1.0 = 1.0) : color

通过设置混合颜色的灰度值返回一个新的颜色值。

parse

( text: string )

静态方法(类的), 解析text字符串为一个颜色值。支持的格式:

"#RGB"

"#RRGGBB"

"rgb(r,g,b)"

"rgba(r,g,b,a)"

类似于下面的文字: "yellow"、"gold"、"red"等。

toString

( [#RGB | #rgb | #rgba] ) : string

根据提供的格式返回颜色值的字符串表示形式。支持的格式:

#RGB -  输出颜色值字符串格式为"#RRGGBB";

#rgb -  输出颜色值字符串格式为"rgb(r,g,b)";

#rgba - 输出颜色值字符串格式为"rgba(r,g,b,a)"。

toInteger

( ) : int

转换颜色值为一个32位整数。

toHSV

( ) : float,float,float

将颜色值转换成3个值 - H、S和V颜色分量。

toHSL

( ) : float,float,float

将颜色值转换成3个值 - H、S和L颜色分量。

morph

( from : color, to:color, ratio: float ) : color

根据下面的公式计算平均值: (to - from) * ratio + from(应用于每个颜色分量)。 该转换基于左乘颜色空间。

    <META http-equiv="Content-Type" content="text/


 inf.setInfluencerScore(16);
        inf.setInitialInfluencerScore(55.5);
        inf.setProbability(0.4);
        influencers.add(inf);

        persister.bulkPersisterBuilder(JOB_ID).persistInfluencers(influencers).executeRequest();

        verify(client).execute(eq(TransportBulkAction.TYPE), bulkRequestCaptor.capture(), any());

        BulkRequest bulkRequest = bulkRequestCaptor.getValue();
        assertEquals(1, bulkRequest.numberOfActions());

        String s = ((IndexRequest) bulkRequest.requests().get(0)).source().utf8ToString();
        assertTrue(s.matches(".*probability.:0\\.4.*"));
        assertTrue(s.matches(".*influencer_field_name.:.infName1.*"));
        assertTrue(s.matches(".*influencer_field_value.:.infValue1.*"));
        assertTrue(s.matches(".*initial_influencer_score.:55\\.5.*"));
        assertTrue(s.matches(".*influencer_score.:16\\.0.*"));
    }

    public void testExecuteRequest_ClearsBulkRequest() {
        List<Influencer> influencers = new ArrayList<>();
        Influencer inf = new Influencer(JOB_ID, "infName1", "infValue1", new Date(), 600);
        inf.setInfluencerScore(16);
        inf.setInitialInfluencerScore(55.5);
        inf.setProbability(0.4);
        influencers.add(inf);

        JobResultsPersister.Builder builder = persister.bulkPersisterBuilder(JOB_ID);
        builder.persistInfluencers(influencers).executeRequest();
        assertEquals(0, builder.getBulkRequest().numberOfActions());
    }

    public void testBulkRequestExecutesWhenReachMaxDocs() {
        JobResultsPersister.Builder bulkBuilder = persister.bulkPersisterBuilder("foo");
        for (int i = 0; i <= JobRenormalizedResultsPersister.BULK_LIMIT; i++) {
            ModelPlot modelPlot = new ModelPlot("foo", new Date(), 123456, i);
            bulkBuilder.persistModelPlot(modelPlot);
        }

        InOrder inOrder = inOrder(client);
        inOrder.verify(client).settings();
        inOrder.verify(client, times(3)).threadPool();
        verify(client).projectResolver();
        inOrder.verify(client).execute(eq(TransportBulkAction.TYPE), bulkRequestCaptor.capture(), any());
        verifyNoMoreInteractions(client);
    }

    public void testPersistTimingStats() {
        TimingStats timingStats = new TimingStats(
            "foo",
            7,
            1.0,
            2.0,
            1.23,
            7.89,
            new ExponentialAverageCalculationContext(600.0, Instant.ofEpochMilli(123456789), 60.0)
        );
        persister.bulkPersisterBuilder(JOB_ID).persistTimingStats(timingStats).executeRequest();

        InOrder inOrder = inOrder(client);
        inOrder.verify(client).settings();
        inOrder.verify(client, times(3)).threadPool();
        verify(client).projectResolver();
        inOrder.verify(client).execute(eq(TransportBulkAction.TYPE), bulkRequestCaptor.capture(), any());
        verifyNoMoreInteractions(client);

        BulkRequest bulkRequest = bulkRequestCaptor.getValue();
        assertThat(bulkRequest.requests().size(), equalTo(1));
        IndexRequest indexRequest = (IndexRequest) bulkRequest.requests().get(0);
        assertThat(indexRequest.index(), equalTo(".ml-anomalies-.write-foo"));
        assertThat(indexRequest.id(), equalTo("foo_timing_stats"));
        assertThat(
            indexRequest.sourceAsMap(),
            equalTo(


        /// The template contains a script frontmatter (script only) and the parser will parse only this part.
        /// </summary>
        FrontMatterOnly,

        /// <summary>
        /// The template contains a script frontmatter (script only) and a content (text and script mixed) and will parse both.
        /// </summary>
        FrontMatterAndContent,

        /// <summary>
        /// The template is directly scriban code (script only) so no necessary {{ }} for entering a code block
        /// </summary>
        ScriptOnly,
    }
}


d_text, flags=re.X)

# make sure string with very long space range does not hang the extractor (triggered by a bug in
# readability for which we added a work around in extract_text.py)
@timeout_decorator.timeout(seconds=5, use_signals=False)
def test_extract_article_from_page_long_space():
    long_space = ' ' * 1000000
    html = '
foo' + long_space + '
'

    extracted_text = extract_article_from_page(html)

    assert re.search(r'foo', extracted_text, flags=re.X)

# Try out with different kinds of whitespace in a single sequence
@timeout_decorator.timeout(seconds=5, use_signals=False)
def test_extract_article_from_page_long_varied_whitespace():
    long_space = ' \n\t\r' * 1000000
    html = '
foo' + long_space + '
'

    extracted_text = extract_article_from_page(html)

    assert re.search(r'foo', extracted_text, flags=re.X)

# Try out with different kinds of whitespace in a single sequence
@timeout_decorator.timeout(seconds=5, use_signals=False)
def test_extract_article_from_page_nonprintable_characters():
    long_space = '\x00\x01\x02 ' * 1000000
    html = '
foo' + long_space + '
'

    extracted_text = extract_article_from_page(html)

    assert re.search(r'foo', extracted_text, flags=re.X)


'''''
Дан список чисел. С помощью map() получить список,
где каждое число из исходного списка переведено в строку.
Пример: на входе – [1, 2, 3], на выходе – [‘1’, ‘2’, ‘3’]
'''''
'''''
num = [1, 2, 3, 4]
#Преобразуем значение в строку используя str
nums = list(map(str, num))
print(nums)
'''''

#а если я зохочу поставить любой другой символ
num = [1, 2, 3, 4]
# Так же преобразуем в строку
nums = list(map(str, num))
# Объединяем элементы списка разделяя их двоеточиями
result = ':'.join(nums)
print(result)

# а еще можно сделать так
#print('[' + ':'.join(nums) + ']')  # [1:2:3]


;
 ; ELoad
 ;
 ; (c) 2011 Thomas Giesel
 ; transfer code based on work by Per Olofsson
 ;
 ; This software is provided 'as-is', without any express or implied
 ; warranty.  In no event will the authors be held liable for any damages
 ; arising from the use of this software.
 ;
 ; Permission is granted to anyone to use this software for any purpose,
 ; including commercial applications, and to alter it and redistribute it
 ; freely, subject to the following restrictions:
 ;
 ; 1. The origin of this software must not be misrepresented; you must not
 ;    claim that you wrote the original software. If you use this software
 ;    in a product, an acknowledgment in the product documentation would be
 ;    appreciated but is not required.
 ; 2. Altered source versions must be plainly marked as such, and must not be
 ;    misrepresented as being the original software.
 ; 3. This notice may not be removed or altered from any source distribution.
 ;
 ; Thomas Giesel skoe@directbox.com
 ;

.import drv_get_start_ts
.import drv_readsector
.import drv_send
.import drv_recv

drivebuffer     = $0600

.export drive_code_common_start
drive_code_common_start:

; =============================================================================
;
; Drive code assembled to fixed address $0400 follows
;
; =============================================================================
.org $0400

.export drive_common_start
drive_common_start:

; =============================================================================
;
; load file
; args: start track, start sector
; returns: $00 for EOF, $ff for error, $01-$fe for each data block
;
; =============================================================================
load:
        jsr drv_get_start_ts
loadchain:
@sendsector:
        jsr drv_readsector
        bcc :+
        lda #$ff                ; send read erro


 (m CategoryModel) updateViewportHeight() CategoryModel {
	if !m.ready {
		return m
	}
	headerHeight := lipgloss.Height(m.headerView())
	footerHeight := lipgloss.Height(m.footerView())
	verticalMarginHeight := headerHeight + footerHeight
	availableHeight := m.Height - verticalMarginHeight - 4 // -4 for padding (2) and newlines (2)
	viewportHeight := m.calculateViewportHeight(availableHeight)
	m.viewport.Height = viewportHeight
	return m
}

// handleFilterCategories processes the filter message and applies filtering.
func (m CategoryModel) handleFilterCategories(msg FilterCategoriesMsg) CategoryModel {
	m.filterText = msg.FilterText
	var filtered []domain.Category
	filterLower := strings.ToLower(msg.FilterText)
	for _, category := range m.categories {
		if strings.Contains(strings.ToLower(category.CategoryName), filterLower) {
			filtered = append(filtered, category)
			continue
		}
		groupName := m.getGroupName(category.GroupID)
		if strings.Contains(strings.ToLower(groupName), filterLower) {
			filtered = append(filtered, category)
		}
	}
	m.filteredCategories = filtered
	m.isFiltered = true
	m.cursor = 0
	m.filterInput.SetValue("")
	m = m.ensureCursorVisible()
	m = m.updateViewportHeight()

	return m
}

// clearFilter clears the filter state.
func (m CategoryModel) clearFilter() CategoryModel {
	m.isFiltering = false
	m.filterText = ""
	m.filteredCategories = nil
	m.isFiltered = false
	m.filterInput.SetValue("")
	m.filterInput.Blur()
	m = m.ensureCursorVisible()
	m = m.updateViewportHeight()

	return m
}

// resetEditingState resets all editing-related state flags and inputs.
func (m CategoryModel) resetEditingState() CategoryModel {
	m.addCategory = false
	m.moveCategory = false
	m.selectedGroup = domain.CategoryGroup{}
	m.movingCategory = domain.Category{}
	m.isEditingName = false
	m.editInput.Blur()
	m.editInput.SetValue("")
	m.editingIndex = -1
	m = m.clearFilter()
	return m
}

// focusInput activates the text input for category name editing.
func (m CategoryModel) focusInput() (tea.Model, tea.Cmd) {
	m.isEditingName = true
	m.editInput.Focus()
	return m, textinput.Blink
}

// headerView renders the header section
func (m CategoryModel) headerView() string {
	var b strings.Builder

	title := fmt.Sprintf("Manage Expense Categories - %s %d", m.CurrentMonth.String(), m.CurrentYear)
	if m.isFiltering {
		title = "Filter Categories"
	} else if m.isEditingName {
		title = "Edit Category Name"
	} else if m.addCategory {
		title = fmt.Sprintf("Add Category to %s", m.selectedGroup.GroupName)
	} else if m.IsMovingCategory() {
		title = fmt.Sprintf("Moving: %s", m.movingCategory.CategoryName)
	}

	b.WriteString(HeaderText.Render(title))
	b.WriteString("\n")

	if m.isFiltering {
		b.WriteString("\n")
		b.WriteString("Filter Categories (Enter to apply filter, Esc to cancel):\n")
		b.WriteString(m.filterInput.View())
	} else if m.isEditingName {
		b.WriteString("\n")
		b.WriteString("Enter Category Name (Enter to save, Esc to cancel):\n")
		b.WriteString(m.editInput.View())
	} else if m.addCategory {
		b.WriteString("\n")
		b.WriteString("Enter Category Name (Enter to save, Esc to cancel):


class MeshPart(object):
 """ Represents a portion of a mesh for partitioning """
 EndFaceIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """End of subinterval of parent mesh face array

Get: EndFaceIndex(self: MeshPart) -> int

"""

 EndVertexIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """End of subinterval of parent mesh vertex array

Get: EndVertexIndex(self: MeshPart) -> int

"""

 StartFaceIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """Start of subinterval of parent mesh face array

Get: StartFaceIndex(self: MeshPart) -> int

"""

 StartVertexIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """Start of subinterval of parent mesh vertex array

Get: StartVertexIndex(self: MeshPart) -> int

"""

 TriangleCount=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """

Get: TriangleCount(self: MeshPart) -> int

"""

 VertexCount=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """EndVertexIndex - StartVertexIndex

Get: VertexCount(self: MeshPart) -> int

"""


        data: data,
        queryParameters: queryParameters,
        options: options,
        cancelToken: cancelToken,
        onSendProgress: onSendProgress,
        onReceiveProgress: onReceiveProgress);
  }

  BaseOptions get options {
    return _dio.options;
  }

  Future<Response<dynamic>> _retry(
      RequestOptions requestOptions, String baseUrl) async {
    final options = Options(
      method: requestOptions.method,
      headers: requestOptions.headers,
    );
    options.headers?["x-api-key"] = App.app.userDb!.token;

    _dio.interceptors.clear();
    _dio.options.baseUrl = baseUrl;

    return _dio.request<dynamic>(requestOptions.path,
        data: requestOptions.data,
        queryParameters: requestOptions.queryParameters,
        options: options);
  }
}
import 'dart:convert';

import 'package:vocechat_client/api/lib/resource_api.dart';
import 'package:vocechat_client/app.dart';
import 'package:vocechat_client/dao/init_dao/archive.dart';
import 'package:vocechat_client/dao/init_dao/chat_msg.dart';

class ArchiveHandler {
  Future<ArchiveM?> getLocalArchive(ChatMsgM chatMsgM) async {
    final archiveId = chatMsgM.msgNormal!.content;
    final archiveM = await ArchiveDao().getArchive(archiveId);
    if (archiveM != null) {
      return archiveM;
    }
    return null;
  }

  Future<ArchiveM?> getArchive(ChatMsgM chatMsgM,
      {bool serverFetch = true}) async {
    final archiveId = chatMsgM.msgNormal!.content;
    final archiveM = await ArchiveDao().getArchive(archiveId);
    if (archiveM != null) {
      return archiveM;
    }

    if (serverFetch) {
      try {
        final resourceApi = ResourceApi();
        final res = await resourceApi.getArchive(archiveId);
        if (res.statusCode == 200 && res.data != null) {
          final archive = res.data!;
          final archiveM = ArchiveM.item(
              archiveId, json.encode(archive), chatMsgM.createdAt);

          await ArchiveDao().addOrUpdate(archiveM);
          return archiveM;
        } else {
          App.logger.severe("Archive fetched failed. Id: $archiveId");
        }
      } catch (e) {
        App.logger.severe("$e, archiveId: $archiveId");
      }
    }
    return null;
  }
}
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_settings.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

UserSettings _$UserSettingsFromJson(Map<String, dynamic> json) => UserSettings(
      burnAfterReadingGroups:
          (json['burn_after_reading_groups'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(int.parse(k), e as int),
      ),
      burnAfterReadingUsers:
          (json['burn_after_reading_users'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(int.parse(k), e as int),
      ),
      muteGroups: (json['mute_groups'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(int.parse(k), e as int?),
      ),
      muteUsers: (json['mute_users'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(int.parse(k), e as int?),
      ),
      pinnedGroups: (json['pinned_groups']


43\xf5\x2a\x8e\x92\x1f\x35\xb1\x49\x97\x69\x6a\x61\x0d\x3b\xe2\x4f\xe1\x90\x46\xcd\xd9\xf4\x7a\x35\x64\x06\xac\x1b\x05\x79\xbb\xe1\x08\xb2\x91\x67\xd7\x6f\xff\x9f\x48\x1f\xd2\xd9\xea\xbf\x28\x78\x71\x42\x4f\xd4\x64\x70\x73\x03\x15\x2a\x51\xa4\x97\x09\x1d\x02\x9f\x4f\xc2\x3b\x4b\xed\xc1\xa4\x0d\x05\x19\x36\xcf\x6d\x5b\x23\x81\x63\x6d\x54\xe7\xa9\x3d\xa6\x78\x0c\x77\xce\xfa\x8e\x8d\x50\xbb\x34\xcb\x5e\x24\xb7\xc8\xe1\x77\x7c\x24\xb0\xb5\x5f\x2a\xdc\x36\x10\xed\xee\xdd\x68\xed\x91\x69\xd4\x06\x04\x5b\x3f\x2f\x71\x47\xa3\x26\xd0\xed\xa9\x80\x0c\x8b\x97\xe1\x78\x7d\xb2\xfa\xae\x8e\xaa\x6c\x54\x61\x93\xe1\x16\x6a\x7c\x08\x6c\xbe\xdf\xf8\x89\x62\x7d\x82\x27\xdb\xdf\x55\xe3\xff\xcc\x97\x6a\x76\xeb\x1b\xb0\xc7\xb7\xbe\xc9\x72\xea\xd7\x80\xc6\xdc\xe8\xf2\xe5\xad\xd4\x49\x8d\xd6\xd2\x4b\x52\x1d\x1a\x58\xf7\x60\x8e\x4c\x35\x8c\x8c\x5a\x73\x8b\x47\x4a\xdb\x5e\x15\x50\xa7\x59\x18\xdf\xf3\x8e\xc4\x94\x9c\x93\xf3\x7f\x01\x00\x00\xff\xff\x36\x89\x03\x27\x71\x0d\x00\x00"

func utilityPrivatereceiverforwarderCdcBytes() ([]byte, error) {
	return bindataRead(
		_utilityPrivatereceiverforwarderCdc,
		"utility/PrivateReceiverForwarder.cdc",
	)
}

func utilityPrivatereceiverforwarderCdc() (*asset, error) {
	bytes, err := utilityPrivatereceiverforwarderCdcBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "utility/PrivateReceiverForwarder.cdc", size: 0, mode: os.FileMode(0), modTime: time.


${h}:${m}:${s}`;
      }, 100);
    });

    stopStopwatchBtn.addEventListener('click', () => {
      const elapsed = stopwatch.stop();
      clearInterval(displayInterval);
      console.log(`Elapsed time: ${elapsed} seconds`);
    });

    resetStopwatchBtn.addEventListener('click', () => {
      stopwatch.reset();
      stopwatchDisplay.textContent = '0:0:0';
    });
  </script>
</body>
</html>
```

## Development

### Building from Source

If you want to build this library from source:

1. Install Rust and wasm-pack:
   ```bash
   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
   ```

2. Clone the repository:
   ```bash
   git clone https://github.com/yourusername/clock-timer.git
   cd clock-timer
   ```

3. Build the WebAssembly modules:
   ```bash
   wasm-pack build --target bundler --out-dir dist/bundler
   wasm-pack build --target web --out-dir dist/web
   wasm-pack build --target nodejs --out-dir dist/node
   ```

## License

MIT
# rust-ticker Web Example

This example demonstrates how to use the `rust-ticker` library in a web browser.

## Timer Example

A 5-second countdown timer that displays the remaining time in HH:MM:SS format.

### Features:
- Start button to begin the countdown
- Reset button to reset the timer to its initial state
- Visual display of the remaining time

## Stopwatch Example

A simple stopwatch that counts up from zero.

### Features:
- Start button to begin timing
- Stop button to pause the stopwatch
- Reset button to reset the stopwatch to zero
- Visual display of the elapsed time

## Code Example

```javascript
// Import the Timer and Stopwatch classes
import { Timer, Stopwatch } from 'rust-ticker';

// Create a timer for 5 seconds
const timer = new Timer(0, 0, 5);

// Start the timer
timer.start().then(() => {
    console.log('Timer completed!');
});

// Create a stopwatch
const stopwatch = new Stopwatch();

// Start the stopwatch
stopwatch.start();

// Stop the stopwatch after some time
setTimeout(() => {
    const elapsed = stopwatch.stop();
    console.log(`Elapsed time: ${elapsed} seconds`);

    // Reset the stopwatch
    stopwatch.reset();
}, 3000);
```

## Implementation Details

The web example uses ES modules to import the `rust-ticker` library:

```javascript
import { Timer, Stopwatch } from '../dist/web/clockjs.js';
```

### Timer Implementation

The timer is initialized with a duration of 5 seconds and updates the display every second as it counts down.

### Stopwatch Implementation

The stopwatch starts from zero and updates the display every 100ms to show the elapsed time.

## Styling

The example includes a clean, responsive user interface with:
- Container elements for each demo component
- Clear visual separation between demos
- Consistent button styling
- Monospace font for time displays## Acknowledgements

- Thanks to [andrejnevesjr](https://github.com/andrejnevesjr) for their [airflow-spark-minio-postgres]([https://github.com/username/repo](https://github.com/andrejnevesjr/airflow-spark-minio-postgres), which inspired/was used in this project.

## Table of contents
- [Table of contents](#table-of-contents)
- [Project Requirements](#project-requirements)
- [Project Structure](#project-structure)
- [High Level Architecture](#high-level-architecture)
- [:ship: Co


},
  DashboardFiles = {
    fg = "#7aa2f7"
  },
  DashboardFooter = {
    fg = "#2ac3de"
  },
  DashboardHeader = {
    fg = "#7aa2f7"
  },
  DashboardIcon = {
    fg = "#7dcfff"
  },
  DashboardKey = {
    fg = "#ff9e64"
  },
  DashboardMruIcon = {
    fg = "#9d7cd8"
  },
  DashboardMruTitle = {
    fg = "#7dcfff"
  },
  DashboardProjectIcon = {
    fg = "#e0af68"
  },
  DashboardProjectTitle = {
    fg = "#7dcfff"
  },
  DashboardProjectTitleIcon = {
    fg = "#ff9e64"
  },
  DashboardShortCut = {
    fg = "#7dcfff"
  },
  DashboardShortCutIcon = {
    fg = "#bb9af7"
  },
  Debug = {
    fg = "#ff9e64"
  },
  DefinitionCount = {
    fg = "#9d7cd8"
  },
  DefinitionIcon = {
    fg = "#7aa2f7"
  },
  Delimiter = "Special",
  DiagnosticError = {
    fg = "#db4b4b"
  },
  DiagnosticHint = {
    fg = "#1abc9c"
  },
  DiagnosticInfo = {
    fg = "#0db9d7"
  },
  DiagnosticInformation = "DiagnosticInfo",
  DiagnosticUnderlineError = {
    sp = "#db4b4b",
    undercurl = true
  },
  DiagnosticUnderlineHint = {
    sp = "#1abc9c",
    undercurl = true
  },
  DiagnosticUnderlineInfo = {
    sp = "#0db9d7",
    undercurl = true
  },
  DiagnosticUnderlineWarn = {
    sp = "#e0af68",
    undercurl = true
  },
  DiagnosticUnnecessary = {
    fg = "#414868"
  },
  DiagnosticVirtualTextError = {
    bg = "#362c3d",
    fg = "#db4b4b"
  },
  DiagnosticVirtualTextHint = {
    bg = "#233745",
    fg = "#1abc9c"
  },
  DiagnosticVirtualTextInfo = {
    bg = "#22374b",
    fg = "#0db9d7"
  },
  DiagnosticVirtualTextWarn = {
    bg = "#373640",
    fg = "#e0af68"
  },
  DiagnosticWarn = {
    fg = "#e0af68"
  },
  DiagnosticWarning = "DiagnosticWarn",
  DiffAdd = {
    bg = "#283b4d"
  },
  DiffChange = {
    bg = "#272d43"
  },
  DiffDelete = {
    bg = "#3f2d3d"
  },
  DiffText = {
    bg = "#394b70"
  },
  Directory = {
    fg = "#7aa2f7"
  },
  EndOfBuffer = {
    fg = "#24283b"
  },
  Error = {
    fg = "#db4b4b"
  },
  ErrorMsg = {
    fg = "#db4b4b"
  },
  FlashBackdrop = {
    fg = "#545c7e"
  },
  FlashLabel = {
    bg = "#ff007c",
    bold = true,
    fg = "#c0caf5"
  },
  FloatBorder = {
    bg = "#1f2335",
    fg = "#29a4bd"
  },
  FloatTitle = {
    bg = "#1


expected_output = {
    "interfaces": {
        "GigabitEthernet2.390": {
            "ipv4": {
                "neighbors": {
                    "10.12.90.1": {
                        "age": "-",
                        "ip": "10.12.90.1",
                        "link_layer_address": "fa16.3eff.9c9e",
                        "origin": "static",
                        "protocol": "Internet",
                        "type": "ARPA",
                    },
                    "10.12.90.2": {
                        "age": "139",
                        "ip": "10.12.90.2",
                        "link_layer_address": "fa16.3eff.5a76",
                        "origin": "dynamic",
                        "protocol": "Internet",
                        "type": "ARPA",
                    },
                }
            }
        },
        "GigabitEthernet2.410": {
            "ipv4": {
                "neighbors": {
                    "10.12.110.1": {
                        "age": "-",
                        "ip": "10.12.110.1",
                        "link_layer_address": "fa16.3eff.9c9e",
                        "origin": "static",
                        "protocol": "Internet",
                        "type": "ARPA",
                    }
                }
            }
        },
    }
}


gecko.geckocircuits.control;

import ch.technokrat.gecko.geckocircuits.control.calculators.AbstractControlCalculatable;
import ch.technokrat.gecko.geckocircuits.control.calculators.MaxCalculatorMultiInputs;
import ch.technokrat.gecko.geckocircuits.control.calculators.MaxCalculatorTwoInputs;
import ch.technokrat.gecko.i18n.resources.I18nKeys;

public final class ReglerMAX extends AbstractReglerVariableInputs {
    public static final ControlTypeInfo tinfo = new ControlTypeInfo(ReglerMAX.class, "MAX", I18nKeys.MAXIMUM);

    public ReglerMAX() {
        super(2);
    }

    @Override
    public String[] getOutputNames() {
        return new String[]{"max"};
    }

    @Override
    public I18nKeys[] getOutputDescription() {
        return new I18nKeys[]{I18nKeys.LARGEST_VALUE_OF_THE_INPUTS};
    }

    @Override
    public AbstractControlCalculatable getInternalControlCalculatableForSimulationStart() {
        if (XIN.size() == 2) {
            return new MaxCalculatorTwoInputs();
        } else {
            return new MaxCalculatorMultiInputs(XIN.size());
        }

    }

}
/*  This file is part of GeckoCIRCUITS. Copyright (C) ETH Zurich, Gecko-Simulations AG
 *
 *  GeckoCIRCUITS 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.
 *
 *  GeckoCIRCUITS 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
 *  GeckoCIRCUITS.  If not, see <http://www.gnu.org/licenses/>.
 */

package ch.technokrat.gecko.geckocircuits.control;

import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author andy
 */
class ReglerRandomDialog extends DialogElementCONTROL<ReglerSignalSource>{

    public ReglerRandomDialog(ReglerSignalSource element) {
        super(element);
    }

    @Override
    void baueGuiIndividual() {
        jpM = new JPanel();
        JLabel infoLabel = new JLabel("Random walk output");
        jpM.add(infoLabel);
    }

}
/*  This file is part of GeckoCIRCUITS. Copyright (C) ETH Zurich, Gecko-Simulations GmbH
 *
 *  GeckoCIRCUITS 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.
 *
 *  GeckoCIRCUITS 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
 *  GeckoCIRCUITS.  If not, see <http://www.gnu.org/licenses/>.
 */
package ch.technokrat.gecko.geckocircuits.control;

import ch.technokrat.gecko.geckocircuits.circuit.*;
import ch.technokrat.gecko.geckocircuits.control.calculators.AbstractControlCalculatable;
import ch.technokrat.gecko.geckocircuits.datacontainer.AbstractDataContainer;
import ch.technokrat.gecko.geckocircuits.datacontainer.ContainerStatus;
import ch


using System;
using System.IO;
using System.Threading.Tasks;
using Binance;
using Binance.Application;
using Binance.Cache;
using Binance.Utility;
using Binance.WebSocket;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

// ReSharper disable AccessToDisposedClosure

namespace BinanceMarketDepth
{
    /// <summary>
    /// Demonstrate how to maintain multiple order book caches
    /// and respond to real-time depth-of-market update events.
    /// </summary>
    internal class MultiCacheExample
    {
        /// <summary>
        /// Example with multiple controllers not using combined streams.
        /// </summary>
        /// <returns></returns>
        public static async Task ExampleMain()
        {
            try
            {
                // Load configuration.
                var configuration = new ConfigurationBuilder()
                    .SetBasePath(Directory.GetCurrentDirectory())
                    .AddJsonFile("appsettings.json", true, false)
                    .Build();

                // Configure services.
                var services = new ServiceCollection()
                    .AddBinance() // add default Binance services.
                    .AddLogging(builder => builder // configure logging.
                        .SetMinimumLevel(LogLevel.Trace)
                        .AddFile(configuration.GetSection("Logging:File")))
                    .BuildServiceProvider();

                Console.Clear(); // clear the display.

                const int limit = 5;

                var api = services.GetService<IBinanceApi>();

                // Query and display the order books.
                var btcOrderBook = await api.GetOrderBookAsync(Symbol.BTC_USDT, limit);
                var ethOrderBook = await api.GetOrderBookAsync(Symbol.ETH_BTC, limit);
                Display(btcOrderBook, ethOrderBook);

                // Create cache.
                var btcCache = services.GetService<IOrderBookCache>();
                var ethCache = services.GetService<IOrderBookCache>();

                // Create web socket streams.
                var webSocket1 = services.GetService<IBinanceWebSocketStream>();
                var webSocket2 = services.GetService<IBinanceWebSocketStream>();
                // NOTE: IBinanceWebSocketStream must be setup as Transient with DI (default).

                // Initialize controllers.
                using (var controller1 = new RetryTaskController(webSocket1.StreamAsync))
                using (var controller2 = new RetryTaskController(webSocket2.StreamAsync))
                {
                    controller1.Error +=


ist();
        }

        public GroupedDictionary(IEnumerable<TEntity> entities, Func<TEntity, IEnumerable<TGroup>> groupKeySelector, Func<IEnumerable<TEntity>, IEnumerable<TEntity>> sortFunc = null)
        {
            GroupedResults = entities
                .SelectMany(entity => groupKeySelector(entity).Select(grouper => new { entity, grouper }))
                .GroupBy(x => x.grouper, x => x.entity)
                .Select(g => new GroupResult<TGroup, TEntity>(g.Key, sortFunc != null ? sortFunc(g.AsEnumerable()) : g.AsEnumerable()))
                .ToList();
        }

        public IEnumerable<TEntity> this[TGroup key]
        {
            get
            {
                var group = GroupedResults.FirstOrDefault(gr => EqualityComparer<TGroup>.Default.Equals(gr.Grouper, key));
                return group != null ? group.Entities : Enumerable.Empty<TEntity>();
            }
        }

        public List<GroupResult<TGroup, TEntity>> AsList() => GroupedResults;

        public IEnumerable<TGroup> Keys => GroupedResults.Select(gr => gr.Grouper);

        public IEnumerable<IEnumerable<TEntity>> Values => GroupedResults.Select(gr => gr.Entities);
    }
}


/*
 * Copyright (c) 2011-2012 Stephen A. Pratt
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
using UnityEngine;

namespace org.critterai.nav.u3d
{
    /// <summary>
    /// Provides a convenient structure for grouping together related navigation resources.
    /// </summary>
    public struct NavGroup
    {
        /// <summary>
        /// The navigation mesh used by <see cref="query"/>.
        /// </summary>
        public Navmesh mesh;

        /// <summary>
        /// A navigation mesh query.
        /// </summary>
        public NavmeshQuery query;

        /// <summary>
        /// The filter to use with <see cref="query"/>.
        /// </summary>
        public NavmeshQueryFilter filter;


compositor_initcompositiontarget.htm
tech.root: dshow
ms.assetid: 16d54090-a0fa-480f-ba94-a15aa08d4576
ms.date: 4/26/2023
ms.keywords: IVMRImageCompositor interface [DirectShow],InitCompositionTarget method, IVMRImageCompositor.InitCompositionTarget, IVMRImageCompositor::InitCompositionTarget, IVMRImageCompositorInitCompositionTarget, InitCompositionTarget, InitCompositionTarget method [DirectShow], InitCompositionTarget method [DirectShow],IVMRImageCompositor interface, dshow.ivmrimagecompositor_initcompositiontarget, strmif/IVMRImageCompositor::InitCompositionTarget
req.header: strmif.h
req.include-header: Dshow.h
req.target-type: Windows
req.target-min-winverclnt: Windows XP with SP1 [desktop apps only]
req.target-min-winversvr: Windows Server 2003 [desktop apps only]
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance:
req.unicode-ansi:
req.idl:
req.max-support:
req.namespace:
req.assembly:
req.type-library:
req.lib: Strmiids.lib
req.dll:
req.irql:
targetos: Windows
req.typenames:
req.redist:
ms.custom: 19H1
f1_keywords:
 - IVMRImageCompositor::InitCompositionTarget
 - strmif/IVMRImageCompositor::InitCompositionTarget
dev_langs:
 - c++
topic_type:
 - APIRef
 - kbSyntax
api_type:
 - COM
api_location:
 - Strmiids.lib
 - Strmiids.dll
api_name:
 - IVMRImageCompositor.InitCompositionTarget
---

# IVMRImageCompositor::InitCompositionTarget

## -description

\[The feature associated with this page, [DirectShow](/windows/win32/directshow/directshow), is a legacy feature. It has been superseded by [MediaPlayer](/uwp/api/Windows.Media.Playback.MediaPlayer), [IMFMediaEngine](/windows/win32/api/mfmediaengine/nn-mfmediaengine-imfmediaengine), and [Audio/Video Capture in Media Foundation](/windows/win32/medfound/audio-video-capture-in-media-foundation). Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use **MediaPlayer**, **IMFMediaEngine** and **Audio/Video Capture in Media Foundation** instead of **DirectShow**, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.\]

The InitCompositionTarget method informs the compositor that a new composition target has been created. The compositor should perform any necessary configuration work in this method. This could include attaching a Z or stencil buffer for the new render target

## -parameters

### -param pD3DDevice [in]

Pointer to the IUnknown interface of the Direct3D device object.

### -param pddsRenderTarget [in]

Specifies the DirectDraw surface.

## -returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

## -see-also

IVMRImageCompositor Interface

Using the Video Mixing Renderer---
description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
external help file: RemoteDesktop.psm1-help.xml
Module Name: RemoteDesktop
ms.date: 12/20/2016
online version: https://learn.microsoft.com/powershell/module/RemoteDesktop/get-rdserver?view=windowsserver