GKarK0A1WiDpKhGkA41KgKHLZ5CbACJ0bWoaa4YBLQgFjowZXwDsn3s6t78aAqpx_meVI67Eg4P7ELDish8CY9NcMHMXeEBHsctNHtCdJXQLRWf6CyYkmf2T7ym1DP4R58FkpBpkVXEUadFyshJe0nfB9ie17f_njuPpKWN3d2OODZVarxtRsI",
  "owner": "GtDQcrr2QRdoZ-lKto_S_SpzEwiZiHVaj3x4jAgRh4o"
}
```

## Posting a `Data-Item` (recommended)

```js
const signer = new ArweaveSigner(JWK);
const signedDataItem = createData(JSON.stringify({ "some": "data" }), signer, {
  tags: [{ name: 'test', value: 'test' }] // add tags
});
await signedDataItem.sign(signer);

const uploadResult = await turbo.uploadSignedDataItem({
  dataItemStreamFactory: () => signedDataItem.getRaw(),
  dataItemSizeFactory: () => signedDataItem.getRaw().length,
  signal: AbortSignal.timeout(10_000), // Optional: cancel the upload after 10 seconds

});

console.log(JSON.stringify(uploadResult, null, 2));
```

Example Output:

```console
{
  "id": "agcPXVfw92w_JI5v8o6C_Gsixd_BDMaHqNSStX4Eed8",
  "timestamp": 1704990453564,
  "winc": "0",
  "version": "0.2.0",
  "deadlineHeight": 1341387,
  "dataCaches": [
    "arweave.net"
  ],
  "fastFinalityIndexes": [
    "arweave.net"
  ],
  "public": "j0Ki2cJHca6HoC4B3y0ZxFKEe9c539AO5KlfDj76KpWOSx5xtbiDUndEWmJxE-p9ayAI8nF5sSJeRfNpuD4g831fmUbTFvUXKNKcfLJ4knDewyY7YNtVGcjBrNRDbsMPhC6UKiquyewRhBlu3YNyEvC9hV4otuwgGI1QcPQmqL9lztpSbwtV00qQIhYAyDbUCmPU6GMPjgk3o-YTDam0rny80tJnxQu5xvLAH3x-nnaAYVsc4-oDvpKKDzq-i5GzSZAFfiWXlYs80fts0Y-T2w3649IgHIjvPy72jYS6y02HKaL9guTczSQfa5ILhE0XotIFgjTkP0LEhHNVmrG7XA5XyKdgV3tyWi1qPrHs-Se5miuZsD0Mz_tBiVZ_AmqQbUYAmyYmEnuB_NpWJoBj18ItZfP1Bq7BvjriJJmpsOab95hEkQCEJHSHRAkH72aS_oz-bM6lymNtOj68NGzTZ0y0hq9b2FSKFhQbrxQpGSbQQ4p6tnoKF_B2n1xTE1xAU3R5Ju-2CZsGCW6kf2JBVTvyQrU5njVHeAS5niOkaJEzlEoaHvaSZF48AvMKB1nZCKG3xbHdQA8EGWNJ_7D-L5BbH2-7Y6CY-9KNS7HMIFTp39lqWzMJ4gyQzDzOh1vaG8bckm0CSqB9WX


--This is a rank table
--There could be multiple tables to generate spawns from
local Circle_Ranks_01  = {
    ["Underlings"] = {
      --NA
    },
    ["Minions"] = {
        "CoT_01","CoT_02","CoT_03",
        "CoT_11","CoT_21","CoT_22",
        "CoT_23","CoT_24",
        "CoT_31","CoT_32",
        "CoT_33","CoT_34",
        "CoT_41","CoT_42",
        "CoT_43","CoT_44",
    },
    ["Lieutenants"] = {
        "Daemon", "Knight", "Spectre",
    },
    ["Sniper"] = {
      --NA
    },
    ["Boss"] = {
    "Daemon_Lord"
    },
    ["Elite Boss"] = {
        "CoTUniqueThreatLevel1", "CoTUniqueThreatLevel2"
    },
    ["Victims"] = {
        "Ghost_Female_NoFade_NPC1", "Ghost_Female_NoFade_NPC2",
        "Ghost_Female_NoFade_NPC3", "Ghost_Male_NoFade_NPC1",
        "Ghost_Male_NoFade_NPC2", "Ghost_Male_NoFade_NPC3",
    },
    ["Specials"] = {

    },
}

--== CEREMONY ==--

Ceremony_CircleOfThorns_D3_V0 = {
    ["Markers"] = {
        ["Encounter_V_42"] = Circle_Ranks_01.Victims,
        ["Encounter_S_31"] = Circle_Ranks_01.Lieutenants,
        ["Encounter_E_03"] = Circle_Ranks_01.Minions,
        ["Encounter_E_04"] = Circle_Ranks_01.Minions,
    },
}

Ceremony_CircleOfThorns_D3_V1 = {
    ["Markers"] = {
        ["Encounter_V_42"] = Circle_Ranks_01.Victims,
        ["Encounter_E_06"] = Circle_Ranks_01.Minions,
        ["Encounter_E_05"] = Circle_Ranks_01.Minions,
        ["Encounter_S_30"] = Circle_Ranks_01.Lieutenants,
        ["Encounter_E_01"] = Circle_Ranks_01.Minions,
   },
}

Ceremony_CircleOfThorns_D3_V2 = {
    ["Markers"] = {
        ["Encounter_V_40"] = Circle_Ranks_01.Victims,
        ["Encounter_V_42"] = Circle_Ranks_01.Victims,
        ["Encounter_E_05"] = Circle_Ranks_01.Minions,
        ["Encounter_S_31"] = Circle_Ra


  {
    startWrite();
    setAddrWindow(_TFTwidth / 2 - logoWidth/2,  _TFTheight / 2 - logoWidth/2, logoWidth, logoWidth);
    //white filled square
    for (uint16_t i = 0; i < logoWidth; i++)
    {
        for (int x = 0; x < logoWidth; x++)
          SPI_WRITE16(ILI9341_WHITE);
    }

    int logoInnerWidth = logoWidth/2;
    setAddrWindow(_TFTwidth / 2 - logoInnerWidth/2,  _TFTheight / 2 - logoInnerWidth/2, logoInnerWidth, logoInnerWidth);
    //black filled square inside the white one
    for (uint16_t i = 0; i < logoInnerWidth; i++)
    {
        for (int x = 0; x < logoInnerWidth; x++)
          SPI_WRITE16(ILI9341_BLACK);
    }
    endWrite();

    delay(1000);

    //print 'Made with love by...'
    int madeWithLoveLength = strlen(madeWithLove);
     setCursor(_TFTwidth / 2 - (madeWithLoveLength*LINE_WIDTH)/2, _TFTheight - LINE_HEIGHT- 4, CURSOR_ABSOLUTE);
     for (int i = 0; i < madeWithLoveLength; i++)
     {
        if (madeWithLove[i] == '\x03') //heart
          print(madeWithLove[i], ILI9341_RED);
        else
         print(madeWithLove[i], ILI9341_WHITE);
        delay(100);
     }

    delay(500);
  }
}

inline void SmartyKit_DisplayDriver::startWrite(void) {
  SPI_BEGIN_TRANSACTION();
  if (_cs >= 0)
    SPI_CS_LOW();
}

inline void SmartyKit_DisplayDriver::endWrite(void) {
  if (_cs >= 0)
    SPI_CS_HIGH();
  SPI_END_TRANSACTION();
}
void SmartyKit_DisplayDriver::writeCommand(uint8_t cmd) {
  SPI_DC_LOW();
  spiWrite(cmd);
  SPI_DC_HIGH();
}

void SmartyKit_DisplayDriver::sendCommand(uint8_t commandByte, const uint8_t *dataBytes,
                                  uint8_t numDataBytes) {
  startWrite();

  #if defined(_SMARTY_DEBUG_)
  Serial.print(F("PGM -> "));
  #endif

  writeCommand(commandByte);

  for (int i = 0; i < numDataBytes; i++) {
      #if defined(_SMARTY_DEBUG_)
      Serial.print(F("arg")); Serial.print(i+1, DEC); Serial.print(F(" = "));
      #endif
      uint8_t dataByte = pgm_read_byte(dataBytes++);
      dataByte &= 0xFF;
      spiWrite(dataByte);
  }

  endWrite();
}

void SmartyKit_DisplayDriver::sendCommand(uint8_t commandByte, uint8_t *dataBytes,
                                  uint8_t numDataBytes) {
  startWrite();

  writeCommand(commandByte);

  for (int i = 0; i < numDataBytes; i++) {
      spiWrite(*dataBytes); // Send the data bytes
      dataBytes++;
  }

  endWrite();
}

void SmartyKit_DisplayDriver::spiWrite(uint8_t b) {
  if (connection == TFT_HARD_SPI) {
#if defined(__AVR__)
    AVR_WRITESPI(b);
#else
    char c = spiClass->transfer(b);
    #if defined(_SMARTY_DEBUG_)
    Serial.print(F("spiWrite = "));Serial.println(c, HEX);
    #endif
#endif
  } else if (connection == TFT_SOFT_SPI)
  {
    for (uint8_t bit = 0; bit < 8; bit++) {
      if (b & 0x80)


�多元，应交中队副业款3千多元，决算方案由原来311522.76元增加到349345.72元，增加金额37822.96元，每户增加38.5元。搞出的粮食首先安排好食堂，使全中队16个食堂都正常的开火，种子问题也得到彻底的解决。

   粮食供应是按十六个食堂不同情况作了肯定安排，当面兑现。

   其次，通过贯彻政策，解决具体问题，推动了生产高潮，干部群众的冲天干劲迅速改变了前段的生产面貌。为了实现59年更大跃进，20个党员带领全队社员向小麦三类苗开展了激攻，中队干部包社，小队干部包畈，社员包田，全面动手，叫禾苗升级。党员周国富是一个长年有病的人，支部分工他突击周家河畈的三类苗，他脱了赤脚，带头挑粪，每亩施足了300担泡粪和30挑水粪，决心要二、三类苗五天变样。初步统计，该队的450亩小麦三类苗，普遍追肥、锄草了一道，有的还进行了二道，二类苗也追完了80%。

   全面的备耕工作，也大抓起来了。一万多斤的棉种进行了熏蒸和挑选，营养钵已准备了大量土肥，开始动手[有约5个字模糊不清]，早稻谷种都进行了两次风筛和晒选，70亩秧田都进行了三犁三耙；农具的修理已经结束。水车109部，双铧犁、水田犁和七步犁68部，耙耖73部，喷粉粉器120架，都办得整洁如新。王家集小队，六个水车还普遍油了一道。甘家河小队社员还自愿投资了5元5角现金买了修理农具的材料。积肥，这两天也搞得火上加油，全队在1233个劳力中安排60%的人大搞积肥。据十天统计，已积肥311800担，还组织了185个小辅助劳力到处拣粪。甘家河小队55岁的老社员甘先国，每天天一亮就到中一街上拾粪，效率由原来的每天50斤提高到150斤，劳动出勤率大大增加了。据3月17日统计，男女劳力出勤达1400人，占应出勤1233人的113.5%，劳动效率比原来提高了几番。

   目前这个队的干部和社员，正满怀信心的朝着一九五九年更大更好更全面的规划方向，苦干加巧干，迈开雄伟的步伐。

   县委办公室调研组1959年3月20日

   来源：

   湖北省某档案馆

    [返回索引页面]

   Copyright (C)  2024  Marxist-Leninist-Maoist.

   Permission is granted to copy, distribute and/or modify this document under the terms of the GNU


x00,0x00]
          vpmuludq zmm23, zmm5, zmmword ptr [rdx + 8192]

// CHECK: vpmuludq zmm23, zmm5, zmmword ptr [rdx - 8192]
// CHECK:  encoding: [0x62,0xe1,0xd5,0x48,0xf4,0x7a,0x80]
          vpmuludq zmm23, zmm5, zmmword ptr [rdx - 8192]

// CHECK: vpmuludq zmm23, zmm5, zmmword ptr [rdx - 8256]
// CHECK:  encoding: [0x62,0xe1,0xd5,0x48,0xf4,0xba,0xc0,0xdf,0xff,0xff]
          vpmuludq zmm23, zmm5, zmmword ptr [rdx - 8256]

// CHECK: vpmuludq zmm23, zmm5, qword ptr [rdx + 1016]{1to8}
// CHECK:  encoding: [0x62,0xe1,0xd5,0x58,0xf4,0x7a,0x7f]
          vpmuludq zmm23, zmm5, qword ptr [rdx + 1016]{1to8}

// CHECK: vpmuludq zmm23, zmm5, qword ptr [rdx + 1024]{1to8}
// CHECK:  encoding: [0x62,0xe1,0xd5,0x58,0xf4,0xba,0x00,0x04,0x00,0x00]
          vpmuludq zmm23, zmm5, qword ptr [rdx + 1024]{1to8}

// CHECK: vpmuludq zmm23, zmm5, qword ptr [rdx - 1024]{1to8}
// CHECK:  encoding: [0x62,0xe1,0xd5,0x58,0xf4,0x7a,0x80]
          vpmuludq zmm23, zmm5, qword ptr [rdx - 1024]{1to8}

// CHECK: vpmuludq zmm23, zmm5, qword ptr [rdx - 1032]{1to8}
// CHECK:  encoding: [0x62,0xe1,0xd5,0x58,0xf4,0xba,0xf8,0xfb,0xff,0xff]
          vpmuludq zmm23, zmm5, qword ptr [rdx - 1032]{1to8}

// CHECK: vpord  zmm23, zmm2, zmm20
// CHECK:  encoding: [0x62,0xa1,0x6d,0x48,0xeb,0xfc]
          vpord  zmm23, zmm2, zmm20

// CHECK: vpord  zmm23 {k2}, zmm2, zmm20
// CHECK:  encoding: [0x62,0xa1,0x6d,0x4a,0xeb,0xfc]
          vpord  zmm23 {k2}, zmm2, zmm20

// CHECK: vpord  zmm23 {k2} {z}, zmm2, zmm20
// CHECK:  encoding: [0x62,0xa1,0x6d,0xca,0xeb,0xfc]
          vpord  zmm23 {k2} {z}, zmm2, zmm20

// CHECK: vpord  zmm23, zmm2, zmmword ptr [rcx]
// CHECK:  encoding: [0x62,0xe1,0x6d,0x48,0xeb,0x39]
          vpord  zmm23, zmm2, zmmword ptr [rcx]

// CHECK: vpord  zmm23, zmm2, zmmword ptr [rax + 8*r14 + 291]
// CHECK:  encoding: [0x62,0xa1,0x6d,0x48,0xeb,0


and app_title~="-" then
                FreeMemory()
                if showCat == 1 then
                    System.launchApp(games_table[p].name)
                elseif showCat == 2 then
                    System.launchApp(homebrews_table[p].name)
                elseif showCat == 3 then
                    System.launchApp(psp_table[p].name)
                elseif showCat == 4 then
                    System.launchApp(psx_table[p].name)
                else
                    System.launchApp(files_table[p].name)
                end
                System.exit()
            end
        elseif (Controls.check(pad, SCE_CTRL_TRIANGLE) and not Controls.check(oldpad, SCE_CTRL_TRIANGLE)) then
            if showMenu == 0 and app_title~="-" then
				prvRotY = 0
                showMenu = 1
            end
        elseif (Controls.check(pad, SCE_CTRL_START) and not Controls.check(oldpad, SCE_CTRL_START)) then
            if showMenu == 0 then
                showMenu = 2
            end
        elseif (Controls.check(pad, SCE_CTRL_SQUARE) and not Controls.check(oldpad, SCE_CTRL_SQUARE)) then
            -- CATEGORY
            if showCat < 4 then
				if showCat==1 and showHomebrews==0 then
					showCat = 3
				else
					showCat = showCat + 1
				end
            else
                showCat = 0
            end
            hideBoxes = 8
            p = 1
            master_index = p
            startCovers = false
            GetInfoSelected()
            FreeIcons()
        elseif (Controls.check(pad, SCE_CTRL_CIRCLE) and not Controls.check(oldpad, SCE_CTRL_CIRCLE)) then
            -- VIEW
            if showView < 4 then
                showView = showView + 1
            else
                showView = 0
            end
            menuY = 0
            startCovers = false
			local file_config = System.openFile(cur_dir .. "/config.dat", FCREATE)
            System.writeFile(file_config, startCategory .. setReflections .. setSounds .. themeColor .. setBackground .. setLanguage .. showView .. showHomebrews, 8)
            System.closeFile(file_config)
        elseif (Controls.check(pad, SCE_CTRL_LEFT)) and not (Controls.check(oldpad, SCE_CTRL_LEFT)) then
            if setSounds == 1 then
                Sound.play(click, NO_LOOP)
            end
            p = p - 1

            if p > 0 then
                GetInfoSelected()
            end

            if (p <= master_index) then
                master_index = p
            end
        elseif (Controls.check(pad, SCE_CTRL_RIGHT)) and not (Controls.check(oldpad, SCE_CTRL_RIGHT)) then
            if setSounds == 1 then
                Sound.play(click, NO_LOOP)
            end
            p = p + 1

            if p <= curTotal then
                GetInfoSelected()
            end

            if (p >= master_index) then
                master_index = p
            end
        elseif (Controls.check(pad, SCE_CTRL_LTRIGGER)) and not (Controls.check(oldpad, SCE_CTRL_LTRIGGER)) then
            if setSounds == 1 then
                Sound.play(click, NO_LOOP)
            end
            p = p - 5

            if p > 0 then
                GetInfoSelected()
            end

            if (p <= master_index) then
                master_inde


04,9.95,30.93,'–––-фев-–––-–––-май-–––-–––-авг-–––-–––-ноя-–––'],['МФК Займер - 01','RU000A102TL7',100.5,14908,13.31,29.6,'янв-фев-мар-апр-май-июн-июл-авг-сен-окт-ноя--дек'],['ТД РКС-Сочи 002Р-01','RU000A102KQ5',100.27,14797,12.93,27.96,'–––-–––-мар-–––-–––-июн-–––-–––-сен-–––-–––--дек'],['ОР ООО 001P-03','RU000A1021B4',101.38,12390,11.48,30.86,'янв-фев-мар-апр-май-июн-июл-авг-сен-окт-ноя--дек'],['КБ Ренессанс Кредит БО-06','RU000A102RN7',99.44,12385,8.53,32,'–––-фев-–––-–––-–––-–––-–––-авг-–––-–––-–––-–––'],['Кировский завод 1P2','RU000A102UZ5',100.32,8513,9.74,31.96,'–––-–––-мар-–––-–––-июн-–––-–––-сен-–––-–––--дек'],['Лизинг-Трейд 001P-01','RU000A101CB6',101.79,6947,11.81,15.1,'–––-–––-–––-апр-май-июн-июл-авг-сен-–––-–––-–––']]
                );
                var table = new google.visualization.Table(document.getElementById('table_div'));
                table.draw(data, {
                    showRowNumber: true,
                    width: '100%',
                    height: '100%',
                    sortColumn: 3,
                    sortAscending: false
                });
            }
        </script>

            Полное наименование
            Код ценной бумаги
            Цена, %
            Объем сделок за n дней, шт.
            Доходность
            Дюрация, месяцев
            Месяцы выплат

Русская Аквакультура 001Р-01	RU000A102TT0	100.1	<td style


:{"countyId":"Gemenele", "scoring":"0","procente":"
Populatie: 1812
 Total consilieri: 11
 Procent USRPLUS: 3.8%
 Necesar consilieri USRPLUS: 0.42
 Necesar rotunjit: 0" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[26.839537133122434,45.30021202365212],[26.83012457187701,45.28625966714222],[26.84361252712018,45.26449419132122],[26.812067035358183,45.26147549562696],[26.811965776454812,45.27139286160244],[26.7954411790781,45.27245530792118],[26.794322412306254,45.31226142518219],[26.79738861611605,45.329024135875926],[26.808177923039548,45.336867373200654],[26.819989299169517,45.3327004776391],[26.83278488087019,45.315440283549144],[26.830172082452307,45.3068431378621],[26.839537133122434,45.30021202365212]]]},"properties":{"countyId":"Blăjani", "scoring":"0","procente":"
Populatie: 1014
 Total consilieri: 9
 Procent USRPLUS: 4.15%
 Necesar consilieri USRPLUS: 0.37
 Necesar rotunjit: 0" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[27.165351216576145,45.33018114616516],[27.1968815261173,45.32830751525188],[27.18979308187046,45.31921524124589],[27.22066707967039,45.3066468710488],[27.2109947461073,45.291760652079496],[27.24682095883283,45.268645854333364],[27.231364039735237,45.25151903575367],[27.210909931115413,45.22405228930915],[27.175070507753876,45.24934630376453],[27.184710025180234,45.25620342573873],[27.169585078664408,45.27117672437337],[27.14763058509716,45.28611084728887],[27.15076267038201,45.29753296538842],[27.11676823216591,45.313646601202976],[27.121232422760638,45.318807490221],[27.132284728566976,45.332164472479086],[27.165351216576145,45.33018114616516]]]},"properties":{"countyId":"Ghergheasa", "scoring":"1","procente":"
Populatie: 2232
 Total consilieri: 11
 Procent USRPLUS: 7.16%
 Necesar consilieri USRPLUS: 0.79
 Necesar rotunjit: 1" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[26.79738861611605,45.329024135875926],[26.794322412306254,45.31226142518219],[26.7954411790781,45.27245530792118],[26.811965776454812,45.27139286160244],[26.812067035358183,45.26147549562696],[26.81400624869419,45.25094890114893],[26.76777600211161,45


rs of the Krypton project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kryptonmc.krypton.entity.serializer.animal

import org.kryptonmc.krypton.entity.animal.KryptonTamable
import org.kryptonmc.krypton.entity.metadata.MetadataKeys
import org.kryptonmc.krypton.entity.serializer.AgeableSerializer
import org.kryptonmc.krypton.entity.serializer.EntitySerializer
import org.kryptonmc.krypton.util.nbt.getUUID
import org.kryptonmc.krypton.util.nbt.hasUUID
import org.kryptonmc.krypton.util.nbt.putNullable
import org.kryptonmc.krypton.util.nbt.putUUID
import org.kryptonmc.nbt.CompoundTag

object TamableSerializer : EntitySerializer<KryptonTamable> {

    private const val OWNER_TAG = "Owner"
    private const val SITTING_TAG = "Sitting"

    override fun load(entity: KryptonTamable, data: CompoundTag) {
        AgeableSerializer.load(entity, data)
        // TODO: Fix this. The vanilla implementation is weird, and this doesn't make any sense. It also needs old
        //  user conversion stuff that we don't have yet.
        val ownerId = if (data.hasUUID(OWNER_TAG)) {
            data.getUUID(OWNER_TAG)
        } else {
            // Here's where we need to get the owner tag as a string and convert it if needed
            null
        }

        if (ownerId != null) {
            try {
                entity.data.set(MetadataKeys.Tamable.OWNER, ownerId)
                entity.isTamed = true
            } catch (_: Throwable) {
                entity.isTamed = false
            }
        }
        entity.isOrderedToSit = data.getBoolean(SITTING_TAG)
        entity.isSitting = entity.isOrderedToSit
    }

    override fun save(entity: KryptonTamable): CompoundTag.Builder = AgeableSerializer.save(entity).apply {
        putNullable(OWNER_TAG, entity.data.get(MetadataKeys.Tamable.OWNER), CompoundTag.Builder::putUUID)
        putBoolean(SITTING_TAG, entity.isOrderedToSit)
    }
}
/*
 * This file is part of the Krypton project, licensed under the Apache License v2.0
 *
 * Copyright (C) 2021-2023 KryptonMC and the contributors of the Krypton project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kryptonmc.krypton.entity.ai.pathfinding

import com.extollit.gaming.ai.path.HydrazinePathFinder
import com.extollit.gaming.ai.path.PathOptions
import com.extollit.gaming.ai.path.model.IPath
import org.kryptonmc.api.entity


JAW_LEFT(41),
    /**
     * Pushes jawbone forward.
     */
    FT_JAW_FORWARD(42),
    /**
     * Pushes jawbone backward.
     */
    FT_JAW_BACKWARD(43),
    /**
     * Flexes jaw muscles.
     */
    FT_JAW_CLENCH(44),
    /**
     * Raises the jawbone.
     */
    FT_JAW_MANDIBLE_RAISE(45),
    /**
     * Upper right lip part tucks in the mouth.
     */
    FT_LIP_SUCK_UPPER_RIGHT(46),
    /**
     * Upper left lip part tucks in the mouth.
     */
    FT_LIP_SUCK_UPPER_LEFT(47),
    /**
     * Lower right lip part tucks in the mouth.
     */
    FT_LIP_SUCK_LOWER_RIGHT(48),
    /**
     * Lower left lip part tucks in the mouth.
     */
    FT_LIP_SUCK_LOWER_LEFT(49),
    /**
     * Right lip corner folds into the mouth.
     */
    FT_LIP_SUCK_CORNER_RIGHT(50),
    /**
     * Left lip corner folds into the mouth.
     */
    FT_LIP_SUCK_CORNER_LEFT(51),
    /**
     * Upper right lip part pushes into a funnel.
     */
    FT_LIP_FUNNEL_UPPER_RIGHT(52),
    /**
     * Upper left lip part pushes into a funnel.
     */
    FT_LIP_FUNNEL_UPPER_LEFT(53),
    /**
     * Lower right lip part pushes into a funnel.
     */
    FT_LIP_FUNNEL_LOWER_RIGHT(54),
    /**
     * Lower left lip part pushes into a funnel.
     */
    FT_LIP_FUNNEL_LOWER_LEFT(55),
    /**
     * Upper right lip part pushes outwards.
     */
    FT_LIP_PUCKER_UPPER_RIGHT(56),
    /**
     * Upper left lip part pushes outwards.
     */
    FT_LIP_PUCKER_UPPER_LEFT(57),
    /**
     * Lower right lip part pushes outwards.
     */
    FT_LIP_PUCKER_LOWER_RIGHT(58),
    /**
     * Lower left lip part pushes outwards.
     */
    FT_LIP_PUCKER_LOWER_LEFT(59),
    /**
     * Upper right part of the lip pulls up.
     */
    FT_MOUTH_UPPER_UP_RIGHT(60),
    /**
     * Upper left part of the lip pulls up.
     */
    FT_MOUTH_UPPER_UP_LEFT(61),
    /**
     * Lower right part of the lip pulls up.
     */
    FT_MOUTH_LOWER_DOWN_RIGHT(62),
    /**
     * Lower left part of the lip pulls up.
     */
    FT_MOUTH_LOWER_DOWN_LEFT(63),
    /**
     * Upper right lip part pushes in the cheek.
     */
    FT_MOUTH_UPPER_DEEPEN_RIGHT(64),
    /**
     * Upper left lip part pushes in the cheek.
     */
    FT_MOUTH_UPPER_DEEPEN_LEFT(65),
    /**
     * Moves upper lip right.
     */
    FT_MOUTH_UPPER_RIGHT(66),
    /**
     * Moves upper lip left.
     */
    FT_MOUTH_UPPER_LEFT(67),
    /**
     * Moves lower lip right.
     */
    FT_MOUTH_LOWER_RIGHT(68),
    /**
     * Moves lower lip left.
     */
    FT_MOUTH_LOWER_LEFT(69),
    /**
     * Right lip corner pulls diagonally up and out.
     */
    FT_MOUTH_CORNER_PULL_RIGHT(70),


stId",
    applyTraceMiddleware({
      traceHeaders: [HEADER_CUSTOM],
      addRequestId: false
    }),
    fakeControllerForLoggerTesting
  );

  app.get(
    "/delayTest",
    applyTraceMiddleware({
      traceHeaders: [HEADER_CUSTOM]
    }),
    fakeControllerForDelayedLogger
  );

  return app;
}

describe("traceMiddleware", () => {
  it("should apply customer trace headers to logs", async () => {
    const result = await supertest(await getExpressApp())
      .get("/customHeaders")
      .set("Content-Type", "application/json")
      .set(HEADER_CUSTOM, "custom id")
      .set("other-header", "some other header");

    const { body } = result;

    expect(body.level).toEqual("info");
    expect(body[HEADER_CUSTOM]).toEqual("custom id");
    expect(body["other-header"]).toBeFalsy();
  });

  it("should not have trace ids in logs when disabled", async () => {
    const result = await supertest(await getExpressApp())
      .get("/noTraceHeaderInLog")
      .set("Content-Type", "application/json")
      .set(HEADER_CUSTOM, "example id");

    const { body } = result;

    expect(body[HEADER_CUSTOM]).toBeFalsy();
  });

  it("should put the logs in a custom field", async () => {
    const result = await supertest(await getExpressApp())
      .get("/traceLogCustomField")
      .set("Content-Type", "application/json")
      .set(HEADER_CUSTOM, "example id");

    const { body } = result;

    expect(body["extraTrace"][HEADER_CUSTOM]).toEqual("example id");
  });

  it("should have a trace id for an ignored path", async () => {
    const result = await supertest(await getExpressApp())
      .get("/ignoreTraceForPath")
      .set("Content-Type", "application/json")
      .set(HEADER_CUSTOM, "example id");

    const { body } = result;

    expect(body[HEADER_CUSTOM]).toBeFalsy();
  });

  it("should not have request id when disabled", async () => {
    const result = await supertest(await getExpressApp())
      .get("/noRequestId")
      .set("Content-Type", "application/json")
      .set(HEADER_CUSTOM, "example id");

    const { body } = result;

    expect(body["requestId"]).toBeFalsy();
  });

  it("should log different trace ids for concurrent requests", async () => {
    const results = await Promise.all(
      [0, 1, 2, 3, 4].map(async requestId => {
        return supertest(await getExpressApp())
          .get("/delayTest")
          .set("Content-Type", "application/json")
          .set(HEADER_CUSTOM, `example id ${requestId}`);
      })
    );

    results.forEach((result, index) => {
      const { body } = result;
      // check that log has the correct level
      expect(body.level).toEqual("info");

      // check the log has the correct trace id for the numbered request
      expect(body[HEADER_CUSTOM]).toEqual(`example id ${index}`);
    });
  });
});
export type Configuration = {
	wlong: boolean
}

export type WaitTiming = {
  wtime: number,
  count: number
}

export type IntegrationTimingParts = {
	_atime: number,
	integrationCycles: number,
	integrationMaxCount: number,
	integrationTimeMs: number
}

export type Persistence = {
	apres: number
}

export type Status = {
	valid: boolean,
	thresholdViolation: boolean
}

export type Control = {
	again: number
}

export type Threshold = {
	high: number,
	low: number
}

export type Enable = {
	powerOn: boolean,
	active: boolean,
	wait: boolean,


FF1A."
lastmod: '2024-04-05T22:38:41.851366-06:00'
model: gpt-4-0125-preview
summary: "write()`\u95A2\u6570\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3053\u3061\
  \u3089\u304C\u6A19\u6E96\u30A8\u30E9\u30FC\u306B\u5358\u7D14\u306A\u30A8\u30E9\u30FC\
  \u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u66F8\u304D\u8FBC\u3080\u65B9\u6CD5\u3067\u3059\
  \uFF1A."
title: "\u6A19\u6E96\u30A8\u30E9\u30FC\u3078\u306E\u66F8\u304D\u8FBC\u307F"
weight: 25
---

## 方法：
Luaでstderrに書き込むには、`io.stderr:write()`関数を使用します。こちらが標準エラーに単純なエラーメッセージを書き込む方法です：

```lua
io.stderr:write("Error: Invalid input.\n")
```

変数を出力する必要がある場合や、複数のデータを組み合わせる場合は、write関数内でそれらを連結します：

```lua
local errorMessage = "Invalid input."
io.stderr:write("Error: " .. errorMessage .. "\n")
```

**stderr上のサンプル出力：**
```
Error: Invalid input.
```

さらに複雑なシナリオや、より大規模なアプリケーションで作業している場合は、LuaLoggingのようなサードパーティのログ記録ライブラリを検討するかもしれません。LuaLoggingを使用すると、stderrを含む異なる先にログを向けることができます。こちらが簡単な例です：

まず、LuaRocksを使用してLuaLoggingがインストールされていることを確認します：

```
luarocks install lualogging
```

次に、LuaLoggingを使用してstderrにエラーメッセージを書き込むには：

```lua
local logging = require("logging")
local logger = logging.stderr()
logger:error("Error: Invalid input.")
```

このアプローチは、アプリケーション全体で標準化されたログ記録の利点を提供し、簡単なAPIを介してログレベル（例：ERROR、WARN、INFO）を設定する柔軟性を追加します。
---
changelog:
- 2024-02-03, gpt-4-0125-preview, translated from English
date: 2024-02-03 19:17:43.499909-07:00
description: "\u65B9\u6CD5 Lua\u306FPerl\u3084Python\u3068\u3044\u3063\u305F\u8A00\
  \u8A9E\u306E\u3088\u3046\u306B\u30CD\u30A4\u30C6\u30A3\u30D6\u306B\u6B63\u898F\u8868\
  \u73FE\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u4EE3\
  \u308F\u308A\u306B\


0x1000; i++)
            elut[i] = (float) Math.exp(-i / 256.0);

    }

    /**
     * Performs convolution on a specified rectangle. The sources are
     * cobbled.
     *
     * @param sources  an array of source Rasters, guaranteed to provide all
     *                 necessary source data for computing the output.
     * @param dest     a WritableRaster tile containing the area to be computed.
     * @param destRect the rectangle within dest to be processed.
     */
    protected void computeRect(Raster[] sources,
                               WritableRaster dest,
                               Rectangle destRect) {
        // Retrieve format tags.
        RasterFormatTag[] formatTags = getFormatTags();

        Raster source = sources[0];
        Rectangle srcRect = mapDestRect(destRect, 0);

        RasterAccessor srcAccessor =
                new RasterAccessor(source, srcRect, formatTags[0],
                                   getSourceImage(0).getColorModel());
        RasterAccessor dstAccessor =
                new RasterAccessor(dest, destRect, formatTags[1],
                                   this.getColorModel());

        switch (dstAccessor.getDataType()) {
            case DataBuffer.TYPE_USHORT:
                ushortLoop(srcAccessor, dstAccessor);
                break;

            default:
        }

        // If the RasterAccessor object set up a temporary buffer for the
        // op to write to, tell the RasterAccessor to write that data
        // to the raster no that we're done with it.
        if (dstAccessor.isDataCopy()) {
            dstAccessor.clampDataArrays();
            dstAccessor.copyDataToRaster();
        }
    }

    protected void ushortLoop(RasterAccessor src,
                              RasterAccessor dst) {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();

        short[][] dstDataArrays = dst.getShortDataArrays();
        int[] dstBandOffsets = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        short[][] srcDataArrays = src.getShortDataArrays();
        int[] srcBandOffsets = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
        float[][] tmpBuffer = new float[3][ws * dwidth];
        int tmpBufferSize = ws * dwidth;

        short[] dstData = dstDataArrays[0];
        short[] srcData = srcDataArrays[0];
        int srcScanlineOffset = srcBandOffsets[0];
        int dstScanlineOffset = dstBandOffsets[0];

        int revolver = 0;
        int kvRevolver = 0;                 // to match kernel vValues
        for (int j = 0; j < ws - 1; j++) {
            int srcPixelOffset = srcScanlineOffset;

            for (int i = 0; i < dwidth; i++) {
                int imageOffset = srcPixelOffset;
                float sa = 0, sb = 0, ss = 0;
                int g0 = srcData[wr + imageOffset + 1] & 0xffff;
                int a0 = g0 - (srcData[wr + imageOffset] & 0xffff);
                int b0 = g0 - (srcData[wr + imageOffset + 2] & 0xffff);
                for (int v = 0; v < ws; v++) {
                    int g = srcData[imageOffset + 1] & 0xffff;
                    int a = g - (srcData[imageOffset] & 0xffff);
                    int b = g - (srcData[imageOffset + 2] & 0xffff);

                    int sep = ((int) ((SQR(a - a0) + SQR(b - b0)) * scale_r + kernel[wr] + kernel[v])) / 0x10000;
                    if (sep < 0x1000) {
                        float exp = elut[sep];
                        sa += exp *


import B43geography from '../geojson/B43.json'
import B48geography from '../geojson/B48.json'
import B62geography from '../geojson/B62.json'

// These bus routes are GeoJSON, but cause constant problems when I treat
// them like GeoJSON. Syntax errors, type errors. Try again another time.
// It works like this for now (except in indicators/drawBusRoutes.tsx). 🤷♂

export interface RouteConfig {
  [key: string]: {
    name: string
    color: string
    lineRef: string
    path: object
  }
}

const routeConfig: RouteConfig = {
  B43: {
    name: 'B43',
    color: '#cc00ff',
    lineRef: 'MTA%20NYCT_B43',
    path: B43geography
  },
  B48: {
    name: 'B48',
    color: '#a4c215',
    lineRef: 'MTA%20NYCT_B48',
    path: B48geography
  },
  B62: {
    name: 'B62',
    color: '#cc6600',
    lineRef: 'MTA%20NYCT_B62',
    path: B62geography
  }
}

export default routeConfig
import * as express from "express";
import { Schema } from "jsonschema";
import { HttpStatusCode } from "../config/http";
import Response from "../utils/response";
import SchemaValidation from "../utils/schemaValidation";

export default class UserValidators {
  static createUserValidation(req: express.Request, res: express.Response, next: express.NextFunction) {
    try {
      let schema: Schema = {
        type: "object",
        properties: {
          CellockName: { type: "string", maxLength: 100 },
          CellockSurname: { type: "string", maxLength: 100 },
          CellockAccessLevel: { type: "integer" },
        },
        required: ["CellockName", "CellockSurname", "CellockAccessLevel"],
        additionalProperties: false,
      };
      SchemaValidation.validate(req.body, schema);
      next();
    } catch (err) {
      return new Response(err._statusCode ?? HttpStatusCode.BAD_REQUEST, null, err.message).sendJsonResponse(res);
    }
  }

  static updateUserValidation(req: express.Request, res: express.Response, next: express.NextFunction) {
    try {
      let schema: Schema = {
        type: "object",
        properties: {
          CellockName: { type: "string", maxLength: 100 },
          CellockSurname: { type: "string", maxLength: 100 },
          CellockAccessLevel: { type: "integer" },
        },
        required: [],
        additionalProperties: false,
      };
      SchemaValidation.validate(req.body, schema);
      next();
    } catch (err) {
      return new Response(err._statusCode ?? HttpStatusCode.BAD_REQUEST, null, err.message).sendJsonResponse(res);
    }
  }
}
export interface IGetAuthTokenResult {
    accesstoken: string;
    expirytime: number;
    refreshtoken: string;
}
export declare const HTTP_METHODS: {
    POST: string;
    PUT: string;
    DELETE: string;
    GET: string;
};
export interface ITokenObj {
    access_token: string;
    expiry_time?: number;
    refresh_token: string;
    user_identifier: string;
}
export interface IStorage {
    saveOAuthTokens: (token_obj: ITokenObj) => Promise<void>;
    updateOAuthTokens: (token_obj: Partial<ITokenObj>) => Promise<void>;
    getOAuthTokens(user_identifier: string): Promise<IGetAuthTokenResult[]>;
}
import { clientModel }


");
    exit(1);
    }

  /* --- Check if input as acceptable ---------------------------- */
  if (l0 < 1)
    {
    printf("l0<1 not allowed.  first line is 1 not 0.\n");
    exit(1);
    }
  if (p0 < 1)
    {
    printf("p0<1 not allowed.  first line is 1 not 0.\n");
    exit(1);
    }
  if (lN > numlines)
    {
    printf("lN>numlines not allowed.\n");
    exit(1);
    }
  if (pN > numpixels)
    {
    printf("pN>numpixels not allowed.\n");
    exit(1);
    }

  /* --- read in whole line of cpx data -------------------------- */
  outstream = fopen(outfile,"wb");
  for (y=l0;y<=lN;y++)
    {
    rec5       = epr_read_record(MDS1, y-1, NULL);
    line_field = *(epr_get_field(rec5, "proc_data"));
    cnt        = 2*(p0-1);/* p0 starts at 1 for first element (BUGFIX!) */
    /* write out selected pixels */
    for (x=p0;x<=pN;x++)
      {
      realpart_short = epr_get_field_elem_as_short(&line_field,cnt);
      cnt++;
      imagpart_short = epr_get_field_elem_as_short(&line_field,cnt);
      cnt++;
      status = fwrite(&realpart_short,2,1,outstream);
      if (status != 1) fprintf(stderr,"fwrite could not write to disk?");
      status = fwrite(&imagpart_short,2,1,outstream);
      if (status != 1) fprintf(stderr,"fwrite could not write to disk?");
      }
    /* this program seemed to fill all memory for some reason?  try to free it */
    epr_free_record(rec5);
    }
  fclose(outstream);
  epr_close_product(product_id);
  /* Closes product reader API, release all allocated resources */
  epr_close_api();
  return 0;
  }


gantt-theme='material'] div.gantt_scale_line:last-child:after {
  bottom: -1px;
}
:root[data-gantt-theme='material'] .gantt_link_control {
  --dhx-gantt-link-handle-border: var(--dhx-gantt-task-background);
  --dhx-gantt-link-handle-background: #FFF;
  --dhx-gantt-link-handle-border-hover: var(--dhx-gantt-task-background);
  --dhx-gantt-link-handle-background-hover: #FFF;
}
:root[data-gantt-theme='material'] .gantt_task_line.gantt_milestone {
  margin-top: -1px;
  --dhx-gantt-task-border-radius: 2px;
}
:root[data-gantt-theme='contrast-white'] {
  --dhx-gantt-theme: contrast-white;
  --dhx-gantt-base-colors-disabled: #C2C2C2;
  --dhx-gantt-base-colors-text-light: #303030;
  --dhx-gantt-base-colors-text-base: #303030;
  --dhx-gantt-base-colors-background: #FFFFFF;
  --dhx-gantt-base-colors-background-alt: #929292;
  --dhx-gantt-base-colors-border: #4D595B;
  --dhx-gantt-base-colors-border-light: #4D595B;
  --dhx-gantt-base-colors-text-on-fill: #FFF;
  --dhx-gantt-base-colors-primary: #0A47CD;
  --dhx-gantt-base-colors-text-on-fill: rgba(255, 255, 255, 0.9);
  --dhx-gantt-task-background: #0A47CD;
  --dhx-gantt-task-border: 1px solid rgba(0, 0, 0, 0.1);
  --dhx-gantt-project-background: #157949;
  --dhx-gantt-base-colors-warning: #FCBA2E;
  --dhx-gantt-base-colors-success: #77D257;
  --dhx-gantt-base-colors-error: #d01e11;
  --dhx-gantt-base-colors-error-text: #141414;
  --dhx-gantt-btn-color: #FFFFFF;
  --dhx-gantt-btn-color-hover: #FFFFFF;
  --dhx-gantt-btn-color-active: #FFFFFF;
  --dhx-gantt-base-colors-select: #E7E5E5;
  --dhx-gantt-base-colors-hover-color: #E7E5E5;
  --dhx-gantt-base-colors-icons: #303030;
  --dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);
  --dhx-gantt-popup-background: #FFF;
  --dhx-gantt-popup-border: 1px solid #4D595B;
  --dhx-gantt-font-size: 16px;
  --dhx-gantt-heading-font-size: 24px;
  --dhx-gantt-important-font-size: 16px;
  --dhx-gantt-regular-font-size: 16px;
  --dhx-gantt-caption-font-size: 16px;
  --dhx-gantt-btn-outline-color-hover: #212121;
  --dhx-gantt-btn-outline-color-active: #FFFFFF;
}
:root[data-gantt-theme='contrast-black']


rpApi For Web Search](serpapi-for-web-search.md)
* [Spider - web search & crawler](spider-web-scraper-crawler.md)
* [Text File](text-file.md)
* [Unstructured File Loader](unstructured-file-loader.md)
* [Unstructured Folder Loader](unstructured-folder-loader.md)
---
description: Load data from pre-configured document stores.
---

# Document Store

Document Store Node

The Document Store loader enables you to load data from pre-configured document stores in your database. This loader provides a convenient way to access and utilize previously processed and stored documents in your workflows.

## Features

* Load documents from synchronized stores
* Automatic metadata handling
* Multiple output formats
* Asynchronous store selection
* Database integration
* Chunk-based document retrieval
* JSON metadata support

## How It Works

1. **Store Selection**:
   * Lists all available document stores that are in 'SYNC' status
   * Provides store information including name and description
   * Allows selection from synchronized stores only
2. **Document Retrieval**:
   * Fetches document chunks from the selected store
   * Reconstructs documents with original metadata
   * Maintains document structure and relationships

## Parameters

### Required Parameters

* **Select Store**: Choose from available synchronized document stores
  * Displays store name and description
  * Only shows stores in 'SYNC' status
  * Dynamically updated based on database content

## Outputs

The loader provides two output formats:

### Document Output

Returns an array of document objects, each containing:

* **pageContent**: The actual content of the document chunk
* **metadata**: Original document metadata in JSON format

### Text Output

Returns a concatenated string containing:

* All document chunks' content
* Separated by newlines
* Properly escaped characters

## Database Integration

The loader integrates with your database through:

* TypeORM data source connection
* Document store entity management
* Chunk-based storage and retrieval
* Metadata preservation

## Document Structure

Each loaded document contains:

```typescript
{
  pageContent: string,    // The actual content
  metadata: {            // Parsed JSON metadata
    // Original document metadata
    // Store-specific information
    // Custom metadata fields
  }
}
```

## Usage Examples

### Basic Store Selection

```json
{
  "selectedStore": "store-id-123"
}
```

### Accessing Document Content

```typescript
// Document output format
[
  {
    "pageContent": "Document content here...",
    "metadata": {
      "source": "original-file.pdf",
      "page": 1,
      "category": "reports"
    }
  }
]

// Text output format
"Document content here...\nNext document content here...\n"
```

## Best Practices

1. Ensure stores are synchronized before access
2. Choose appropriate output format for your use case
3. Handle metadata appropriately in your workflow
4. Consider chunk size when processing large documents
5. Monitor database performance with large stores

## Notes

* Only synchronized stores are available for selection
* Metadata is automatically parsed from JSON
* Documents are reconstructed from chunks
* Supports both document and text output formats
* Integrates with TypeORM for database access
* Handles escape characters in text output
* Maintains original document structure

{% hint style="info" %}
This section is a work in progress. We appreciate any help you can provide in completing this section. Please check our


40\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540"+
    "\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540"+
    "\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540"+
    "\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1540"+
    "\u1540\u1540\u1540\u1540\u1540\u1540\u1540\u1260\u1260\u1260\u1550\u1260\u1560"+
    "\u1570\u1580\u1260\u1260\u1260\u1590\u1260\u1260\u15A0\u03A0\u15B0\u15C0\u15D0"+
    "\u02B0\u02B0\u15E0\u15F0\u02B0\u02B0\u02B0\u02B0\u02B0\u02B0\u02B0\u02B0\u02B0"+
    "\u02B0\u1600\u1610\u02B0\u1620\u02B0\u1630\u1640\u1650\u1660\u1670\u1680\u02B0"+
    "\u02B0\u02B0\u1690\u16A0\040\u16B0\u16C0\u16D0\u0950\u16E0\u16F0").toCharArray();

  // The Y table has 5888 entries for a total of 11776 bytes.

  static final char Y[] = (
    "\000\000\000\000\002\004\006\000\000\000\000\000\000\000\010\004\012\014\016"+
    "\020\022\024\026\030\032\032\032\032\032\034\036\040\042\044\044\044\044\044"+
    "\044\044\044\044\044\044\044\046\050\052\054\056\056\056\056\056\056\056\056"+
    "\056\056\056\056\060\062\064\000\000\066\000\000\000\000\000\000\000\000\000"+
    "\000\000\000\000\070\072\072\074\076\100\102\104\106\110\112\020\114\116\120"+
    "\122\124\124\124\124\124\124\124\124\124\124\124\126\124\124\124\130\132\132"+
    "\132\132\132\132\132\132\132\132\132\134\132\132\132\136\140\140\140\140\140"+
    "\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140"+
    "\142\140\140\140\144\146\146\146\146\146\146\146\150\140\140\140\140\140\140"+
    "\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\140\152\146"+
    "\146\150\154\140\140\156\160\162\164\166\170\160\172\174\140\176\200\202\140"+
    "\140\140\204\206\210\140\204\212\214\146\216\140\220\140\222\224\224\22


    logUpdate.updateLine(0, "text1");
    logUpdate.persist();
    expect(logUpdate.stdout).toEqual("\ntext1");
  });

  it("should not update line", () => {
    logUpdate.append("text");
    logUpdate.update(5, "text1");
    logUpdate.persist();
    expect(logUpdate.stdout).toEqual("text");
  });

  it("should update line after append another", () => {
    logUpdate.append("text");
    logUpdate.appendLine("text1");
    logUpdate.update(0, "t");
    logUpdate.persist();
    expect(logUpdate.stdout).toEqual("t\ntext1");
  });

  it("persist should clear array and append value to stdout", () => {
    logUpdate.append("text");
    logUpdate.persist();
    expect(logUpdate.stdout).toEqual("text");

    logUpdate.append(" text");
    logUpdate.persist();
    expect(logUpdate.stdout).toEqual("text text");
  });
});
import {ProductType, ProductTypeFactory} from "./product-type";
import {Entity, EntityFactory} from "./entity";

const uuidv4 = require('uuid/v4');

export class Product extends Entity {
    name: string;
    type: ProductType;
    description: string;
    mrp: number;

    constructor(
        id: string,
        name: string,
        type: ProductType,
        description: string,
        mrp: number,
        created: Date
    ) {
        super(id, created)
        this.name = name;
        this.type = type;
        this.description = description;
        this.mrp = mrp;
    }
}

export class ProductFactory implements EntityFactory<Product> {
    public create(obj: any): Product {
        return new Product(
            obj.id,
            obj.name,
            new ProductTypeFactory().create(obj.type),
            obj.description,
            obj.mrp,
            obj.created
        )
    }

    public sanitize(obj: any): Product {
        obj.id = obj.id || uuidv4();
        if (!obj.id) {
            throw "Product Id is undefiend";
        } else if (!obj.name) {
            throw "Product vendor is undefiend";
        } else if (!obj.type.id) {
            throw "Product's type is undefiend";
        } else if (!obj.mrp) {
            throw "Product mrp is undefiend";
        } else {
            return this.create(obj)
        }
    }
}

export class ProductModelFactory implements EntityFactory<Product> {
    public create(obj: any): Product {
        return new Product(
            obj.id,
            obj.name,
            new ProductTypeFactory().create(obj.type),
            obj.description,
            obj.mrp,
            obj.created
        )
    }

    public sanitize(obj: any): Product {
        obj.id = obj.id || uuidv4();
        if (!obj.id) {
            throw "Product Id is undefiend";
        } else if (!obj.name) {
            throw "Product vendor is undefiend";
        } else if (!obj.type.id) {
            throw "Product's type is undefiend";
        } else if (!obj.mrp) {
            throw "Product mrp is undefiend";
        } else {
            return this.create(obj)
        }
    }
}import * as globals from "globals";

const rAllowedStartCharacter = /^[A-Za-z_]/;
const rInvalidChars = /[^A-Za-z0-9_]/g;
const reservedJSLanguage


  );
};

export default Create;
```

</p>
 </details>

Now, if you save your progress and go to the browser, the company and role fields should only display when the Employed option is selected.

<img src="https://refine.ams3.cdn.digitaloceanspaces.com/blog/2022-09-27-react-hook-form-validation/react-hook-form-big2.gif"  alt="react Hook Form error handling" />

<br />

## Form submission

Since our create component is not controlled, the way we're going to handle form submission will be different from what you might be used to.

Rather than adding a click event to the form's button and using it to fire a function that will handle all the submission functionalities, we're going to add an `onSubmit` event listener directly on the form and pass the `handleSubmit` method to it.

First off, destructure the handleSubmit method from the `useForm` hook and create a `handleSubmission` function like so:

```tsx
  const {
    control,
    handleSubmit,
    watch,
    formState: { errors },
} = useForm <IFormValue>
{
    mode: "onChange",
    defaultValues,
    resolver: yupResolver(schema),
};

const handleSubmission = (data: IFormValue) => console.log(data);
```

Lastly, add an `onSubmit` event handler to the form and pass the `handleSubmit` method and `formSubmission` function to it:

```tsx
<form
  onSubmit={handleSubmit(formSubmission)}
  style={{ display: "flex", flexDirection: "column" }}
>
  ...
</form>
```

Now, if you save your progress and head over to the browser, you should get a logged object of the form’s data in your console when you fill in the fields and submit the form.

<img src="https://refine.ams3.cdn.digitaloceanspaces.com/blog/2022-09-27-react-hook-form-validation/react-hook-form-console.gif"  alt="React Hook Form error handling" />

<br />

If you’d like to use your form data in other parts of your **Refine** application, for example, the List page. All you have to do is destructure the `onFinish` method from the `useForm` hook and pass it to the `handleSubmit` function on the form.

## Conclusion

There you have it, we’ve successfully built a form that can validate input values, display dynamic error messages, and render fields based on the selected select option, using **Refine**, React Hook Form, and **yup schema validator**.

## Example

<CodeSandboxExample path="blog-refine-react-hook-form" />
---
title: Redirect in React Router V6 with Navigate Component
description: We'll see how to redirect using Navigate Component in React Router V6
slug: navigate-react-router-redirect
authors: joseph_mawa
tags: [react]
image: https://refine.ams3.cdn.digitaloceanspaces.com/blog/2022-09-29-router-navigate-component/social-3.png
hide_table_of_contents: false
---

**This article was last updated on Jun 14, 2024, to add performance optimization, testing and additional features for React Router**

## Introduction

React Router version 6 shipped recently with several new features and improvements. One such feature is the `Navigate` component. It is the component equivalent of the `useNavigate` hook.

This article will take a deep dive into the `Navigate` component.

Steps we'll cover:

- [Getting started with React router](#getting-started-with-react-router)
- [How to use the `Navigate` component](#how-to-use-the-navigate-component)
- [Features of React Router V6](#features-of-react-router-v6)
- [Performance Optimization](#performance-optimization)
- [React Router Testing](#react-router-testing)

## Getting started with React router

In this section, you will learn how to set up React router in an existing React project.

### Installing React router

Depending on your package manager, install React router from the NPM package registry using one of the commands below.

```sh
# Using


    });

    it('subscribtion reads the new state', done => {
      const store = new Store(1);
      store.subscribe(() => {
        assert.strictEqual(store.getState(), 2);
        done();
      });
      store.dispatch(state => state + 1);
    });

    it('unsubscribe', done => {
      const store = new Store(1);
      const unsubscribe = store.subscribe(() => {
        done(new Error('Unsuccessful subscribtion'));
      });
      unsubscribe();
      store.dispatch(state => state + 1);
      done();
    });
  });
});
import {Node} from "../parser/Node";

export interface IEventListener {

    update(event: string, currentValue: Node, lastValue: Node);
}

export default class AstVisitor {

    root: Node;
    lastVisited: Node;
    listeners: Array<IEventListener>;

    constructor(root: Node) {
        this.root = root;
        this.lastVisited = null;
        this.listeners = [];
    }

    public traverse() {
        this.visit(this.root);
    }

    public visit(node: Node) {
        this.listeners.forEach(
            (l) => {
                l.update("node", node, this.lastVisited);
            }
        );
        this.lastVisited = node;
        this.visitChildren(node);
    }

    private visitChildren(node: Node) {
        if (node.getChildren() !== null) {
            for (let child of node.getChildren()) {
                this.visit(child);
            }
        }
    }

    addListener(listener: IEventListener) {
        this.listeners.push(listener);
    }
}import { configureStore, createSlice } from "@reduxjs/toolkit";

interface Ingredient {
  count: number;
  nameOfIngredient: string;
}

interface IngredientsArray {
  ingredients: Ingredient[];
}

const initialState = {
  ingredients: [
    {
      count: 0,
      nameOfIngredient: "",
    },
  ],
} as IngredientsArray;

const newRecipeSlice = createSlice({
  name: "newRecipe",
  initialState,
  reducers: {
    updateIngredient: (state, action) => {
      const index = state.ingredients.findIndex(
        (element) => element.count === action.payload.id
      );
      state.ingredients[index].nameOfIngredient = action.payload.event;
    },
    deleteIngredient: (state, action) => {
      const index = state.ingredients.findIndex(
        (element) => element.count === action.payload
      );
      state.ingredients.splice(index, 1);
    },
    addIngredient: (state) => {
      if (state.ingredients[0]) {
        state.ingredients.push({
          count: state.ingredients[state.ingredients.length - 1].count + 1,
          nameOfIngredient: "",
        });
      } else {
        state.ingredients.push({
          count: 0,
          nameOfIngredient: "",
        });
      }
    },
  },
});

const store = configureStore({ reducer: newRecipeSlice.reducer });
export const {
  addIngredient,
  deleteIngredient,
  updateIngredient,
} = newRecipeSlice.actions;
export default store;
import { Vector2D } from "../core/maths/vector2D";
import { GameManager } from "./game-manager";
import { Renderable } from "./interfaces";
import { VectorUtils } from "../core/maths/vector-utils";

export class Ball implements Renderable {

    //#region members
    public get position(): Vector2D {
        return this._position;
    }

    private readonly _radius: number = GameManager.CONFIG.ballRadius;
    private _position: Vector2D;
    private _speed: Vector2


{t=+(~~(f*5.9604644775390625e-08)|0);n[G+(c<<2)>>2]=~~(f-t*16777216.0);l=y+i|0;c=c+1|0;f=t}n[G+(c<<2)>>2]=~~f;b=c}o=(b|0)>-1;if(o){f=+u1(1.0,l);l=b;while(1){s[W+(l<<3)>>3]=f*+(n[G+(l<<2)>>2]|0);if((l|0)>0){f=f*5.9604644775390625e-08;l=l+-1|0}else break}if(o){c=b;while(1){u=b-c|0;l=0;f=0.0;while(1){f=f+ +s[10904+(l<<3)>>3]*+s[W+(l+c<<3)>>3];if((l|0)>=(Q|0)|(l|0)>=(u|0))break;else l=l+1|0}s[z+(u<<3)>>3]=f;if((c|0)>0)c=c+-1|0;else break}}}switch(a|0){case 0:{if(o){f=0.0;l=b;while(1){f=f+ +s[z+(l<<3)>>3];if((l|0)>0)l=l+-1|0;else break}}else f=0.0;t=(k|0)==0?f:-f;p=73;break}case 2:case 1:{if(o){f=0.0;l=b;while(1){f=f+ +s[z+(l<<3)>>3];if((l|0)>0)l=l+-1|0;else break}}else f=0.0;c=(k|0)==0;s[A>>3]=c?f:-f;f=+s[z>>3]-f;if((b|0)>=1){l=1;while(1){f=f+ +s[z+(l<<3)>>3];if((l|0)==(b|0))break;else l=l+1|0}}t=c?f:-f;A=A+8|0;p=73;break}case 3:{if((b|0)>0){l=b;f=+s[z+(b<<3)>>3];do{p=l;l=l+-1|0;W=z+(l<<3)|0;t=+s[W>>3];D=f;f=t+f;s[z+(p<<3)>>3]=D+(t-f);s[W>>3]=f}while((p|0)>1);c=(b|0)>1;if(c){l=b;f=+s[z+(b<<3)>>3];do{p=l;l=l+-1|0;W=z+(l<<3)|0;D=+s[W>>3];t=f;f=D+f;s[z+(p<<3)>>3]=t+(D-f);s[W>>3]=f}while((p|0)>2);if(c){l=b;t=0.0;while(1){t=t+ +s[z+(l<<3)>>3];if((l|0)>2)l=l+-1|0;else break}}else t=0.0}else t=0.0}else t=0.0;f=+s[z>>3];if(!k){s[A>>3]=f;f=+s[z+8>>3]}else{s[A>>3]=-f;t=-t;f=-+s[z+8>>3]}s[A+8>>3]=f;A=A+16|0;p=73;break}default:{}}if((p|0)==73)s[A>>3]=t;w=Y;return v&7|0}function u1(e,A){e=+e;A=A|0;var i=0,r=0;if((A|0)<=


7 <p> Ne7 <p> Nd6 | 4.2% <p> 0.9% <p> 0.8% <p> 0.1% <p> 0.0% | 12.1% <p> 14.2% <p> 12.1% <p> 11.5% <p> 8.3% | 78.5% <p> 76.5% <p> 79.7% <p> 84.6% <p> 87.5% | 9.4% <p> 9.3% <p> 8.3% <p> 3.8% <p> 4.2% | 0.514 <p> 0.524 <p> 0.519 <p> 0.538 <p> 0.521 |
|  1.e4 c6 2.f4 f5 3.e5 g5 4.fxg5 Bxe5 5.c3 | 5.4% | Ne6 <p> f4 <p> Nd6 <p> Be6 <p> Qg7 | 4.8% <p> 0.5% <p> 0.0% <p> 0.0% <p> 0.0% | 10.7% <p> 9.1% <p> 12.5% <p> 28.6% <p> 40.0% | 78.5% <p> 80.3% <p> 62.5% <p> 71.4% <p> 40.0% | 10.8% <p> 10.6% <p> 25.0% <p> 0.0% <p> 20.0% | 0.500 <p> 0.493 <p> 0.438 <p> 0.643 <p> 0.600 |
|  1.e4 e5 2.c3 c6 3.Bc2 Bc7 4.Ne2 Ne6 | 5.0% | Ne3 <p> g3 | 4.9% <p> 0.2% | 13.0% <p> 12.5% | 78.3% <p> 83.8% | 8.6% <p> 3.8% | 0.522 <p> 0.544 |
# Opening Analysis **SPI 873**: `QRKBBRNN`

**Overall Statistics:**

| # Played Games           | Average time & moves | White           | Draw           | Black           | Average points for White |
|:------------------------:|:--------------------:|:---------------:|:--------------:|:---------------:|:------------------------:|
| 50000               | 16.0 secs for 86 moves         | 17.6% | 72.6% | 9.8% | 0.539                 |

The openings and the next moves are sorted by likeliness. We show at most the five most likely next moves.

## Openings for threshold = 10.0%

| Opening   | Likeliness | Next moves | Likeliness | White wins      | Draw           | Black wins      | Average points for White |
|-----------|------------|------------|:----------:|:---------------:|:--------------:|:---------------:|:------------------------:|
|  1.e4 Ng6 2.Ng3 | 13.7% | b5 <p> e5 <p> e6 <p> a5 | 7.1% <p> 4.9% <p> 1.6% <p> 0.1% | 10.2% <p> 24.8% <p> 18.5% <p> 19.4% | 80.7% <p> 67.2% <p> 72.2% <p> 67.7% | 9.1% <p> 8.0% <p> 9.3% <p> 12.9% | 0.506 <p> 0.584 <p> 0.546 <p> 0.532 |
|  1.b3 N


䁮"] = "目旡曰",
    ["䁯"] = "目亼口羽",
    ["䁰"] = "目工頁",
    ["䁱"] = "目土土儿",
    ["䁲"] = "目罒貝",
    ["䁳"] = "目艹犬廾",
    ["䁴"] = "目亠囗一",
    ["䁵"] = "目罒一",
    ["䁶"] = "目白方攵",
    ["䁷"] = "乂乂目",
    ["䁸"] = "目曲辰",
    ["䁹"] = "目尸口辛",
    ["䁺"] = "目罒土",
    ["䁻"] = "目白幺木",
    ["䁼"] = "目黑土",
    ["䁽"] = "目巛",
    ["䁾"] = "目艹罒丶",
    ["䁿"] = "黑犬目",
    ["䂀"] = "目⺷禾戈",
    ["䂁"] = "目兔",
    ["䂂"] = "目目目隹",
    ["䂃"] = "目爫罒寸",
    ["䂄"] = "目目目又",
    ["䂅"] = "目言糹虫",
    ["䂆"] = "予丿勹丶",
    ["䂇"] = "予丿ヿ土",
    ["䂈"] = "予丿虫",
    ["䂉"] = "予丿亻矢",
    ["䂊"] = "予丿象",
    ["䂋"] = "古㐄予木",
    ["䂌"] = "予丿立里",
    ["䂍"] = "予丿日氺",
    ["䂎"] = "予丿⺧貝",
    ["䂏"] = "矢刀口",
    ["䂐"] = "矢屮凵",
    ["䂑"] = "矢匕",
    ["䂒"] = "矢士口",
    ["䂓"] = "矢見",
    ["䂔"] = "矢土",
    ["䂕"] = "矢彑",
    ["䂖"] = "石丶",
    ["䂗"] = "石",
    ["䂘"] = "石又丶",
    ["䂙"] = "石阝",
    ["䂚"] = "石乂乂",
    ["䂛"] = "石予",
    ["䂜"] = "石丰",
    ["䂝"] = "石戈",
    ["䂞"] = "石木",
    ["䂟"] = "力口石",
    ["䂠"] = "石矢",
    ["䂡"] = "石一",
    ["䂢"] = "石夂⺀",
    ["䂣"] = "石匕",
    ["䂤"] = "石亻寸",
    ["䂥"] = "石民",
    ["䂦"] = "石人彡",
    ["䂧"] = "石小",
    ["䂨"] = "石斤丶",
    ["䂩"] = "石囗大",
    ["䂪"] = "石儿冫",
    ["䂫"


import jax.numpy as jnp

import jaxsim.typing as jtp

from .skew import Skew

class Cross:
    """
    A utility class for cross product matrix operations.
    """

    @staticmethod
    def vx(velocity_sixd: jtp.Vector) -> jtp.Matrix:
        """
        Compute the cross product matrix for 6D velocities.

        Args:
            velocity_sixd: A 6D velocity vector [v, ω].

        Returns:
            The cross product matrix (6x6).

        Raises:
            ValueError: If the input vector does not have a size of 6.
        """
        velocity_sixd = velocity_sixd.reshape(-1, 6)

        v, ω = jnp.split(velocity_sixd, 2, axis=-1)

        v_cross = jnp.concatenate(
            [
                jnp.concatenate(
                    [Skew.wedge(ω), jnp.zeros((ω.shape[0], 3, 3)).squeeze()], axis=-2
                ),
                jnp.concatenate([Skew.wedge(v), Skew.wedge(ω)], axis=-2),
            ],
            axis=-1,
        )

        return v_cross

    @staticmethod
    def vx_star(velocity_sixd: jtp.Vector) -> jtp.Matrix:
        """
        Compute the negative transpose of the cross product matrix for 6D velocities.

        Args:
            velocity_sixd: A 6D velocity vector [v, ω].

        Returns:
            The negative transpose of the cross product matrix (6x6).

        Raises:
            ValueError: If the input vector does not have a size of 6.
        """
        v_cross_star = -Cross.vx(velocity_sixd).T
        return v_cross_star


\u5B50\u83DC\u5355\u540D\u79F0",prop:"name"},{default:u(()=>[a(r,{modelValue:e.value.name,"onUpdate:modelValue":l[0]||(l[0]=t=>e.value.name=t)},null,8,["modelValue"])]),_:1},8,["label"]),m.modular==="master"?(p(),_(o,{key:0,label:"\u4E3B\u83DC\u5355\u7C7B\u578B",prop:"menuType"},{default:u(()=>[a(V,{modelValue:e.value.menuType,"onUpdate:modelValue":l[1]||(l[1]=t=>e.value.menuType=t)},{default:u(()=>[a(n,{label:1},{default:u(()=>[A]),_:1}),a(n,{label:2},{default:u(()=>[N]),_:1})]),_:1},8,["modelValue"])]),_:1})):s("",!0),e.value.menuType===2&&m.modular==="master"?(p(),_(o,{key:1,label:""},{default:u(()=>[R(v.$slots,"default")]),_:3})):s("",!0),e.value.menuType===1?(p(),F(T,{key:2},[a(o,{label:"\u8DF3\u8F6C\u94FE\u63A5",prop:"visitType"},{default:u(()=>[a(V,{modelValue:e.value.visitType,"onUpdate:modelValue":l[2]||(l[2]=t=>e.value.visitType=t)},{default:u(()=>[a(n,{label:"view"},{default:u(()=>[G]),_:1}),a(n,{label:"miniprogram"},{default:u(()=>[S]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(o,{label:"\u7F51\u5740",prop:"url"},{default:u(()=>[a(r,{modelValue:e.value.url,"onUpdate:modelValue":l[3]||(l[3]=t=>e.value.url=t)},null,8,["modelValue"])]),_:1}),e.value.visitType=="miniprogram"?(p(),F(T,{key:0},[a(o,{label:"AppId",prop:"appId"},{default:u(()=>[a(r,{modelValue:e.value.appId,"onUpdate:modelValue":l[4]||(l[4]=t=>e.value.appId=t)},null,8,["modelValue"])]),_:1}),a(o,{label:"\u8DEF\u5F84",prop:"pagePath"},{default:u(()=>[a(r,{modelValue:e.value.pagePath,"onUpdate:modelValue":l[5]||(l[5]=t=>e.value.pagePath=t)},null,8,["modelValue"])]),_:1})],64)):s("",!0)],64)):s("",!0)]),_:3},8,["rules","model"])}}});export{W as _};
import{_ as B}from"./index.065f20cf.js";import{K as C,I as h,C as w,D as b,F as g,w as V}from"./element-plus.fa1aa32c.js";import{r as d,f as I}from"./index.b4f64333.js";import{d as _,a0 as x,ag as S,o as c,c as k,V as e,M as u,a,O as y,L as N,T}from"./@vue.cab01781.js";import"./@vueuse.724ed0af.js";import"./@element-plus.92b4185f.js";import"./lodash-es.29c53eac.js";import"./da


sToday() + ", ");
        if (getReadCapacityUnits() != null) sb.append("ReadCapacityUnits: " + getReadCapacityUnits() + ", ");
        if (getWriteCapacityUnits() != null) sb.append("WriteCapacityUnits: " + getWriteCapacityUnits() + ", ");
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getLastIncreaseDateTime() == null) ? 0 : getLastIncreaseDateTime().hashCode());
        hashCode = prime * hashCode + ((getLastDecreaseDateTime() == null) ? 0 : getLastDecreaseDateTime().hashCode());
        hashCode = prime * hashCode + ((getNumberOfDecreasesToday() == null) ? 0 : getNumberOfDecreasesToday().hashCode());
        hashCode = prime * hashCode + ((getReadCapacityUnits() == null) ? 0 : getReadCapacityUnits().hashCode());
        hashCode = prime * hashCode + ((getWriteCapacityUnits() == null) ? 0 : getWriteCapacityUnits().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof ProvisionedThroughputDescription == false) return false;
        ProvisionedThroughputDescription other = (ProvisionedThroughputDescription)obj;

        if (other.getLastIncreaseDateTime() == null ^ this.getLastIncreaseDateTime() == null) return false;
        if (other.getLastIncreaseDateTime() != null && other.getLastIncreaseDateTime().equals(this.getLastIncreaseDateTime()) == false) return false;
        if (other.getLastDecreaseDateTime() == null ^ this.getLastDecreaseDateTime() == null) return false;
        if (other.getLastDecreaseDateTime() != null && other.getLastDecreaseDateTime().equals(this.getLastDecreaseDateTime()) == false) return false;
        if (other.getNumberOfDecreasesToday() == null ^ this.getNumberOfDecreasesToday() == null) return false;
        if (other.getNumberOfDecreasesToday() != null && other.getNumberOfDecreasesToday().equals(this.getNumberOfDecreasesToday()) == false) return false;
        if (other.getReadCapacityUnits() == null ^ this.getReadCapacityUnits() == null) return false;
        if (other.getReadCapacityUnits() != null && other.getReadCapacityUnits().equals(this.getReadCapacityUnits()) == false) return false;
        if (other.getWriteCapacityUnits() == null ^ this.getWriteCapacityUnits() == null) return false;
        if (other.getWriteCapacityUnits() != null && other.getWriteCapacityUnits().equals(this.getWriteCapacityUnits()) == false) return false;
        return true;
    }

}
    /*
 * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.dynamodb.model;
import java.io.Serializable;

/**
 * <p>
 * The item attributes from a response in a specific table, along with the read resources consumed on the table during the request.
 * </p>
 * @deprecated This class is no longer supported by the latest service API.
 */
@Deprecated


ON("uNTluLfYgS8", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigSetIfLinkLocalAddr6);
    LIB_FUNCTION("s31rYkpIMMQ", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigSetIfmtu);
    LIB_FUNCTION("tvdzQkm+UaY", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigUnsetIfFlags);
    LIB_FUNCTION("oGEBX0eXGFs", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigUpInterface);
    LIB_FUNCTION("6HNbayHPL7c", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigUpInterfaceWithFlags);
    LIB_FUNCTION("6A6EweB3Dto", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocClearWakeOnWlan);
    LIB_FUNCTION("ZLdJyQJUMkM", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanAdhocCreate);
    LIB_FUNCTION("Yr3UeApLWTY", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocGetWakeOnWlanInfo);
    LIB_FUNCTION("Xma8yHmV+TQ", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanAdhocJoin);
    LIB_FUNCTION("K4o48GTNbSc", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanAdhocLeave);
    LIB_FUNCTION("ZvKgNrrLCCQ", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocPspEmuClearWakeOnWlan);
    LIB_FUNCTION("1j4DZ5dXbeQ", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocPspEmuGetWakeOnWlanInfo);
    LIB_FUNCTION("C-+JPjaEhdA", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocPspEmuSetWakeOnWlan);
    LIB_FUNCTION("7xYdUWg1WdY", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanAdhocScanJoin);
    LIB_FUNCTION("Q7ee2Uav5f8", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocSetExtInfoElement);
    LIB_FUNCTION("xaOTiuxIQNY", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanAdhocSetWakeOnWlan);
    LIB_FUNCTION("QlRJWya+dtE", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanApStart);
    LIB_FUNCTION("6uYcvVjH7Ms", "libSceNet", 1, "libSceNet", 1, 1, sceNetConfigWlanApStop);
    LIB_FUNCTION("MDbg-oAj8Aw", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanBackgroundScanQuery);
    LIB_FUNCTION("cMA8f6jI6s0", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanBackgroundScanStart);
    LIB_FUNCTION("3T5aIe-7L84", "libSceNet", 1, "libSceNet", 1, 1,
                 sceNetConfigWlanBackgroundScanStop);
    LIB_FUNCTION("+3


204f  ! 73: WRASI_I	wr	%r0, 0x004f, %asi
	.word 0xe6b52000  ! 74: STHA_I	stha	%r19, [%r20 + 0x0000] %asi
	.word 0xe6cda000  ! 75: LDSBA_I	ldsba	[%r22, + 0x0000] %asi, %r19
	.word 0xe6f5e000  ! 76: STXA_I	stxa	%r19, [%r23 + 0x0000] %asi
	rd	%asr26, %g1
halt_hwintr_1_14:
	wr	%g1, 1, %asr26
!$EV trig_pc_d(1,expr(@VA(.MAIN.halt_hwintr_1_14), 16, 16)) -> intp(1, 0, 4)
	nop
	.word 0x01000000  ! 77: NOP	nop
	.word 0xe2f6c9e0  ! 78: STXA_R	stxa	%r17, [%r27 + %r0] 0x4f
	.word 0xe4a609e0  ! 79: STWA_R	stwa	%r18, [%r24 + %r0] 0x4f
	.word 0xe4852000  ! 80: LDUWA_I	lduwa	[%r20, + 0x0000] %asi, %r18
	rd	%asr26, %g1
halt_hwintr_1_15:
	wr	%g1, 1, %asr26
!$EV trig_pc_d(1,expr(@VA(.MAIN.halt_hwintr_1_15), 16, 16)) -> intp(1, 0, 4)
	nop
	.word 0x01000000  ! 81: NOP	nop
	.word 0xe4852000  ! 82: LDUWA_I	lduwa	[%r20, + 0x0000] %asi, %r18
	.word 0xe4952000  ! 83: LDUHA_I	lduha	[%r20, + 0x0000] %asi, %r18
	rd	%asr26, %g1
halt_hwintr_1_16:
	wr	%g1, 1, %asr26
!$EV trig_pc_d(1,expr(@VA(.MAIN.halt_hwintr_1_16), 16, 16)) -> intp(1, 0, 4)
	nop
	.word 0x01000000  ! 84: NOP	nop
	.word 0xe6c7ce40  ! 85: LDSWA_R	ldswa	[%r31, %r0] 0x72, %r19
	.word 0xea8f4e60  ! 86: LDUBA_R	lduba	[%r29, %r0] 0x73, %r21
	.word 0x87802020  ! 87: WRASI_I	wr	%r0, 0x0020, %asi
	rd	%asr26, %g1
halt_hwintr_1_17:
	wr	%g1, 1, %asr26
!$EV trig_pc_d(1,expr(@VA(.MAIN.halt_hwintr_1_17), 16, 16)) -> intp(1, 0, 4)
	nop
	.word 0x01000000  ! 88: NOP	nop
	.word 0xe8f74e60  ! 89: STXA_R	stxa	%r20, [%r29 + %r0] 0x73
	.word 0xec8ea000  ! 90: LDUBA_I	lduba	[%r26, + 0x0000] %asi, %r22
	.word 0xe884c400  ! 91: LDUWA_R	lduwa	[%r19, %r0] 0x20, %r20
	rd	%asr26, %g1
halt_hwintr_1_18:
	wr	%g1, 1, %asr26
!$EV trig_pc_d(1,expr(@VA(.MAIN.hal


    if (value !== "0") {
      raw[index] = value;
    }
  });

  for (const char of raw) {
    if (char !== "X") {
      addresses.forEach((address) => address.push(char));
    } else {
      addresses = addresses.flatMap((address) => {
        const one = address.slice();
        const zero = address.slice();

        one.push("1");
        zero.push("0");

        return [zero, one];
      });
    }
  }

  return addresses.map((address) => parseInt(address.join(""), 2));
}

function part1() {
  const memory = new Map<number, number>();
  let currentMask = "";

  for (const line of input) {
    const [start, end] = line.split(" = ");

    if (start === "mask") {
      currentMask = end;
    } else {
      const memAddress = Number(start.trim().replace(/(mem\[|\])/g, ""));
      const value = Number(end);

      memory.set(memAddress, applyMask(currentMask, num2bin(value)));
    }
  }

  return [...memory.values()].reduce((sum, current) => sum += current, 0);
}

function part2() {
  const memory = new Map<number, number>();
  let currentMask = "";

  for (const line of input) {
    const [start, end] = line.split(" = ");

    if (start === "mask") {
      currentMask = end;
    } else {
      const memAddress = Number(start.trim().replace(/(mem\[|\])/g, ""));
      const value = Number(end);
      const addresses = getMemoryAddresses(currentMask, num2bin(memAddress));

      addresses.forEach((address) => {
        memory.set(address, value);
      });
    }
  }

  return [...memory.values()].reduce((sum, current) => sum += current, 0);
}

console.log(`Part 1: ${part1()}`);
console.log(`Part 2: ${part2()}`);
import faker from "faker";

interface CourseMeta {
  id: string;
  courseName: string;
  // name(): string;
  professor: string;
  // professor(): string;
  description?: string;
  // prerequisites?: Course[] | string;
  // prerequisites?: getPreReqs(): Course[] | string;
  prerequisites?(): CourseMeta[] | string;
}

// is Course (as a class) needed, since we are not declaring a NEW course?
// class Course {
//   constructor(
//     getPreReqs: getPreReqs,
//   ){}
//   getPreReqs() {
//     // todo: make pre-reqs, for now return none
//     const arr: CourseMeta[] = []
//     return arr.length ? arr : 'none';
//   }
// }

// TODO: make Course class that constructs the mock Course that you can call new Course(), multiple times

const mockCourse = (): CourseMeta => {
  function mockFullName(): string {
    return `${faker.name.firstName()} ${faker.name.lastName()}`;
  }

  function mockCourseName(): string {
    return `${faker.company.catchPhraseAdjective()} ${faker.hacker.noun()}s`
  }

  return {
    id: faker.datatype.uuid(),
    courseName: mockCourseName(),
    professor: mockFullName()
    // prerequisites: Course.getPreReqs()
  };
};

export {mockCourse, CourseMeta} ;
import { PlayerInt } from '../interfaces/PlayerInt';
import { Mechanics } from '../interfaces/Mechanics';
import { skill } from '../interfaces/skill';
import { Player } from './Player';
import { PlayerStatus, EnemyStatus } from '../enums/Status';
import Characters from '../assets/characters';


/*
 * Copyright (C) 2024 Steven Song (izwb003)
 *
 * 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 2
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
#ifndef SETTINGS_H
#define SETTINGS_H

extern "C" {
#include <libavutil/rational.h>
#include <libavutil/pixfmt.h>
}

#include <QString>
#include <QFileInfo>

namespace AVP {

enum AVPSize {
    kAVPSmallSize,
    kAVPMediumSize,
    kAVPLargeSize
};

struct ColorSettings {
    AVColorPrimaries outputColorPrimary = AVCOL_PRI_BT470M;
    AVColorTransferCharacteristic outputVideoColorTrac = AVCOL_TRC_GAMMA22;
    AVColorSpace outputVideoColorSpace = AVCOL_SPC_FCC;
};

class AVPSettings {
public:
    AVPSize size = kAVPMediumSize;
    QString getSizeString();
    QString getSizeResolution();
    QString getRealSize();
    int getWidth();

    QString inputVideoPath;
    QFileInfo inputVideoInfo;

    double outputVideoBitRate = 20.0;
    AVRational outputFrameRate = av_make_q(24, 1);
    ColorSettings outputColor;
    QString outputFileName = "";
    bool useDolbyNaming = true;
    bool scalePicture = false;
    int outputVolume = 100;

    QString getOutputVideoFinalName();
    QString getOutputAudioFinalName();

    QString outputFilePath;
};
}

extern AVP::AVPSettings settings;

#endif // SETTINGS_H


IUS_TITHE_B_2_WET, ObjectID.HOSIDIUS_TITHE_B_2_DEAD,
		ObjectID.HOSIDIUS_TITHE_B_3_DRY, ObjectID.HOSIDIUS_TITHE_B_3_WET, ObjectID.HOSIDIUS_TITHE_B_3_DEAD,
		ObjectID.HOSIDIUS_TITHE_B_4, ObjectID.HOSIDIUS_TITHE_B_4_DEAD
	),
	LOGAVANO("Logavano", ObjectID.HOSIDIUS_TITHE_C_4,
		ObjectID.HOSIDIUS_TITHE_C_1_DRY, ObjectID.HOSIDIUS_TITHE_C_1_WET, ObjectID.HOSIDIUS_TITHE_C_1_DEAD,
		ObjectID.HOSIDIUS_TITHE_C_2_DRY, ObjectID.HOSIDIUS_TITHE_C_2_WET, ObjectID.HOSIDIUS_TITHE_C_2_DEAD,
		ObjectID.HOSIDIUS_TITHE_C_3_DRY, ObjectID.HOSIDIUS_TITHE_C_3_WET, ObjectID.HOSIDIUS_TITHE_C_3_DEAD,
		ObjectID.HOSIDIUS_TITHE_C_4, ObjectID.HOSIDIUS_TITHE_C_4_DEAD
	);

	@Getter
	private final String name;
	@Getter
	private final int baseId;
	@Getter
	private final int[] objectIds;

	private static final Map<Integer, TitheFarmPlantType> plantTypes;

	static
	{
		ImmutableMap.Builder<Integer, TitheFarmPlantType> builder = new ImmutableMap.Builder<>();

		for (TitheFarmPlantType type : values())
		{
			for (int spotId : type.getObjectIds())
			{
				builder.put(spotId, type);
			}
		}

		plantTypes = builder.build();
	}

	TitheFarmPlantType(String name, int baseId, int... objectIds)
	{
		this.name = name;
		this.baseId = baseId;
		this.objectIds = objectIds;
	}

	public static TitheFarmPlantType getPlantType(int objectId)
	{
		return plantTypes.get(objectId);
	}
}
/*
 * Copyright (c) 2018, Yoav Ram <https://github.com/yoyo421>
 * Copyright (c) 2018, Infinitay <https://github.com/Infinitay>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package net.runelite.client.plugins.fairyring;

import java.util.Arrays;


/// This is updated after every transfer attempt.
    pub static ref LAST_POLLING_SUCCESSFUL: IntGauge = OP_COUNTERS.gauge("last_polling_successful");
}
<reponame>boxdox/get-config<filename>src/config.rs
use anyhow::{bail, Context, Result};
use inquire::Text;
use serde::{Deserialize, Serialize};

#[derive(Default, Debug, Serialize, Deserialize)]
pub struct Config {
    pub gist_id: String,
    pub token: Option<String>,
}

pub fn get_config(package_name: &str) -> Result<Config> {
    let mut cfg: Config = confy::load(package_name).unwrap_or_default();

    if cfg.gist_id.is_empty() {
        let gist_id =
            Text::new("please enter a gist_id (this will be saved into a config file)").prompt()?;
        if gist_id.is_empty() {
            bail!("gist id is empty, cannot proceed. re-run this command and enter a valid gist id")
        }
        cfg.gist_id = gist_id;
        let token = Text::new("enter a token for github (optional)")
            .with_default("")
            .prompt()?;
        cfg.token = Some(token);
        confy::store(package_name, &cfg).with_context(|| "failed to save config")?;
    }

    Ok(cfg)
}

pub fn clear_config(package_name: &str) -> Result<(), confy::ConfyError> {
    let cfg = Config {
        gist_id: "".to_string(),
        token: None,
    };
    confy::store(package_name, cfg)
}
use bytes;
use error_chain::ChainedError;
use futures;
use futures::{Future, Sink, Stream};
use futures_cpupool;
use hyper;
use percent_encoding;
use serde;
use std;
use tokio_core;

use ::Object;
use dlna;
use error::{ResultExt};

const CONNECTION_XML: &str = include_str!("connection.xml");
const CONTENT_XML: &str = include_str!("content.xml");

header! { (Soapaction, "Soapaction") => [String] }

pub struct ServerArgs<F> {
	pub uri: String,
	pub remote: F,
	pub root: std::sync::Arc<::root::Root>,
	pub name: String,
	pub uuid: String,
}

#[derive(Debug)]
struct Shared {
	transcode_cache: std::sync::Mutex<::cache::TranscodeCache>,
}

pub struct ServerFactory<F> {
	uri: String,
	remote: F,
	root: std::sync::Arc<::root::Root>,
	shared: std::sync::Arc<Shared>,
	root_xml: bytes::Bytes,

	cpupool: std::sync::Arc<futures_cpupool::CpuPool>,
}

impl<F> ServerFactory<F> {
	pub fn new(args: ServerArgs<F>) -> Self {
		ServerFactory {
			uri: args.uri,
			remote: args.remote,
			root: args.root,
			shared: std::sync::Arc::new(Shared {
				transcode_cache: std::sync::Mutex::new(::cache::TranscodeCache::new()),
			}),
			root_xml: format!(include_str!("root.xml"),
				name=args.name,
				uuid=args.uuid
			).into(),

			cpupool: std::sync::Arc::new(futures_cpupool::CpuPool::new(8)),
		}
	}
}

impl<F: Fn() -> tokio_core::reactor::Remote> hyper::server::NewService for ServerFactory<F> {
	type Request = hyper::Request;
	type Respon


Rotate);
      // Set the drive control with the created request
      drive.setControl(request);
    }

    @Override
    public boolean isFinished() {
      Pose2d currentPose = drive.getState().Pose;
      Transform2d robotToBranch = branchPose.minus(currentPose);
      if (robotToBranch.getTranslation().getNorm() < 0.01
          && Math.abs(robotToBranch.getRotation().getDegrees()) < 1) {
        controls.vibrateDriveController(0.5);
        return true;
      }
      return false;
    }

    @Override
    public void end(boolean interrupted) {
      // Create a swerve request to stop all motion by setting velocities and rotational rate to 0
      SwerveRequest stop = driveRequest.withVelocityX(0).withVelocityY(0).withRotationalRate(0);
      // Set the drive control with the stop request to halt all movement
      drive.setControl(stop);
      controls.vibrateDriveController(0);
    }
  }

  private static class AutoAlignCommandLeft extends AutoAlignCommand {
    private static final List<Pose2d> blueLeftBranchPoses =
        List.of(blueBranchA, blueBranchC, blueBranchE, blueBranchG, blueBranchI, blueBranchK);

    private static final List<Pose2d> redLeftBranchPoses =
        List.of(redBranchA, redBranchC, redBranchE, redBranchG, redBranchI, redBranchK);

    public static Pose2d getNearestLeftBranch(Pose2d p, boolean isBlue) {
      List<Pose2d> branchPose2ds = isBlue ? blueLeftBranchPoses : redLeftBranchPoses;
      return p.nearest(branchPose2ds);
    }

    public AutoAlignCommandLeft(CommandSwerveDrivetrain drive, Controls controls) {
      super(drive, controls);
    }

    @Override
    public void initialize() {
      Pose2d robotPose = drive.getState().Pose;
      branchPose = getNearestLeftBranch(robotPose, isBlue());
      pidX.setSetpoint(branchPose.getX());
      pidY.setSetpoint(branchPose.getY());
      pidRotate.setSetpoint(branchPose.getRotation().getRadians());
    }
  }

  private static class AutoAlignCommandRight extends AutoAlignCommand {
    private static final List<Pose2d> blueRightBranchPoses =
        List.of(blueBranchB, blueBranchD, blueBranchF, blueBranchH, blueBranchJ, blueBranchL);

    private static final List<Pose2d> redRightBranchPoses =
        List.of(redBranchB, redBranchD, redBranchF, redBranchH, redBranchJ, redBranchL);

    public static Pose2d getNearestRightBranch(Pose2d p) {
      List<Pose2d> branchPose2ds = isBlue() ? blueRightBranchPoses : redRightBranchPoses;
      return p.nearest(branchPose2ds);
    }

    public AutoAlignCommandRight(CommandSwerveDrivetrain drive, Controls controls) {
      super(drive, controls);
    }

    @Override
    public void initialize() {
      Pose2d robotPose = drive.getState().Pose;
      branchPose = getNearestRightBranch(robotPose);
      pidX.setSetpoint(branchPose.getX());
      pidY.setSetpoint(branchPose.getY());
      pidRotate.setSetpoint(branchPose.getRotation().getRadians());
    }
  }
}
package frc.robot.subsystems.drivebase;

import com.ctre.phoenix6.hardware.CANcoder;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.swerve.SwerveDrivetrain;
import com.ctre.phoenix6.swerve.SwerveDrivetrainConstants;
import com.ctre.phoenix6.swerve.SwerveModuleConstants;
import edu.wpi.first.math.Matrix;
import edu.wpi.first.math.numbers.N1;
import edu.wpi.first.math.numbers.


sBack: true, level: 2 },
    { displayName:'Dashboard', iconClass:'fa fa-dashboard fa-3x', route: ['dashboard'], menuScope: MenuScope.parent, isBack: false, level: 1 },
    { displayName:'Publishers', iconClass:'fa fa-bank fa-3x', route: ['publishers'], menuScope: MenuScope.parent, isBack:false, level:1 },
    { displayName:'Heroes', iconClass:'fa fa-heartbeat fa-3x', route: ['heroes'], menuScope: MenuScope.parent, isBack:false, level: 1 },
    { displayName:'Comics', iconClass:'fa fa-book fa-3x', route: ['comics'], menuScope: MenuScope.parent, isBack:false, level:1 },
    { displayName:'Publisher', iconClass:'fa fa-bank fa-3x', route: ['publishers'], menuScope: MenuScope.publisher, isBack:false, level:2 },
    { displayName:'Hero', iconClass:'fa fa-heartbeat fa-3x', route: ['heroes'], menuScope: MenuScope.hero, isBack:false, level: 2 },
    { displayName:'Stories', iconClass:'fa fa-anchor fa-2x', route: ['heroes'], menuScope: MenuScope.hero, isBack:false,level:3 },
    { displayName:'Powers', iconClass:'fa fa-superpowers fa-2x', route: ['heroes'], menuScope: MenuScope.hero, isBack:false,level:3 },
    { displayName:'Quotes', iconClass:'fa fa-comments-o fa-2x', route: ['heroes'], menuScope: MenuScope.hero, isBack:false,level:3 },
    { displayName:'Heroes', iconClass:'fa fa-heartbeat fa-2x', route: ['publishers'], menuScope: MenuScope.publisher, isBack:false, level:3 },
    { displayName:'Comics', iconClass:'fa fa-book fa-2x', route: ['publishers'], menuScope: MenuScope.publisher, isBack:false, level:3 },
];function A(foo, bar) {}
const B = function Name(foo, bar) {};
const C = (foo, bar) => {};

(function(foo, bar) {});

const Obj = {
  D(foo, bar) {},
  E(foo, bar) {},
  F: (foo, bar) => {},
};

class F {
  constructor(foo, bar) {}

  G(foo, bar) {}
}
import { check } from 'express-validator';
import { compare } from 'bcrypt';

import { User } from '../../../common/models';
import { verifyToken } from '../services/auth.service';

export const authRules = {
  forSignup: [
    check('name')
      .isLength({ min: 2 })
      .withMessage('name must be at least 2 chars long'),
    check('email')
      .isEmail()
      .withMessage('Invalid email format!')
      .custom(async (email) => {
        const user = await User.findOne({ where: { email } });
        if (user) {
          return Promise.reject(new Error('E-mail already in use!'));
        }
      }),
    check('password')
      .isLength({ min: 8 })
      .withMessage('password must be at least 8 chars long.')
      .matches(/\d/)
      .withMessage('password must contain a number!'),
  ],

  forLogin: [
    check('email')
      .isEmail()
      .withMessage('Invalid email format')
      .custom(async (email) => {
        const user = await User.findOne({ where: { email } });
        if (!user) {
          return Promise.reject(new Error('E-mail already in use!'));
        }
      }),
    check('password').custom(async (password, { req }) => {
      const user = await User.findOne({ where: { email: req.body.email } });
      const


Value.ToString()];
			}
		}

		/// <summary>
		/// Returns the Ccd Sensitivity Description.
		/// </summary>
		/// <returns>the Ccd Sensitivity Description.</returns>
		private string GetCcdSensitivityDescription()
		{
            if (!base.directory
                .ContainsTag(
                NikonType1Directory.TAG_NIKON_TYPE1_CCD_SENSITIVITY))
            {
                return null;
            }
			int aValue =
				base.directory.GetInt(
				NikonType1Directory.TAG_NIKON_TYPE1_CCD_SENSITIVITY);
			switch (aValue)
			{
				case 0 :
					return BUNDLE["ISO","80"];
				case 2 :
					return BUNDLE["ISO","160"];
				case 4 :
					return BUNDLE["ISO","320"];
				case 5 :
					return BUNDLE["ISO","100"];
				default :
					return BUNDLE["UNKNOWN", aValue.ToString()];
			}
		}

		/// <summary>
		/// Returns the Image Adjustment Description.
		/// </summary>
		/// <returns>the Image Adjustment Description.</returns>
		private string GetImageAdjustmentDescription()
		{
            if (!base.directory
                .ContainsTag(
                NikonType1Directory.TAG_NIKON_TYPE1_IMAGE_ADJUSTMENT))
            {
                return null;
            }
			int aValue =
				base.directory.GetInt(
				NikonType1Directory.TAG_NIKON_TYPE1_IMAGE_ADJUSTMENT);
			switch (aValue)
			{
				case 0 :
					return BUNDLE["NORMAL"];
				case 1 :
					return BUNDLE["BRIGHT_P"];
				case 2 :
					return BUNDLE["BRIGHT_M"];
				case 3 :
					return BUNDLE["CONTRAST_P"];
				case 4 :
					return BUNDLE["CONTRAST_M"


es?.sub)
            }
        }
    }

    private data class AvailableEpisodesDetail(
        @JsonProperty("sub") val sub: List<String>,
        @JsonProperty("dub") val dub: List<String>,
        @JsonProperty("raw") val raw: List<String>
    )

    override suspend fun load(url: String): LoadResponse? {
        val rhino = Context.enter()
        rhino.initStandardObjects()
        rhino.optimizationLevel = -1
        val scope: Scriptable = rhino.initStandardObjects()

        val html = app.get(url).text
        val soup = Jsoup.parse(html)

        val script = soup.select("script").firstOrNull {
            it.html().contains("window.__NUXT__")
        } ?: return null

        val js = """
            const window = {}
            ${script.html()}
            const returnValue = JSON.stringify(window.__NUXT__.fetch[0].show)
        """.trimIndent()

        rhino.evaluateString(scope, js, "JavaScript", 1, null)
        val jsEval = scope.get("returnValue", scope) ?: return null
        val showData = parseJson<Edges>(jsEval as String)

        val title = showData.name
        val description = showData.description
        val poster = showData.thumbnail

        val episodes = showData.availableEpisodes.let {
            if (it == null) return@let Pair(null, null)
            Pair(if (it.sub != 0) ((1..it.sub).map { epNum ->
                Episode(
                    "$mainUrl/anime/${showData.Id}/episodes/sub/$epNum", episode = epNum
                )
            }) else null, if (it.dub != 0) ((1..it.dub).map { epNum ->
                Episode(
                    "$mainUrl/anime/${showData.Id}/episodes/dub/$epNum", episode = epNum
                )
            }) else null)
        }

        val characters = soup.select("div.character > div.card-character-box").mapNotNull {
            val img = it?.selectFirst("img")?.attr("src") ?: return@mapNotNull null
            val name = it.selectFirst("div > a")?.ownText() ?: return@mapNotNull null
            val role = when (it.selectFirst("div > .text-secondary")?.text()?.trim()) {
                "Main" -> ActorRole.Main
                "Supporting" -> ActorRole.Supporting
                "Background" -> ActorRole.Background
                else -> null
            }
            Pair(Actor(name, img), role)
        }

        // bruh, they use graphql
        //val recommendations = soup.select("#suggesction > div > div.p > .swipercard")?.mapNotNull {
        //    val recTitle = it?.selectFirst(".showname > a") ?: return@mapNotNull null
        //    val recName = recTitle.text() ?: return@mapNotNull null
        //    val href = fixUrlNull(recTitle.attr("href")) ?: return@mapNotNull null
        //    val img = it.selectFirst(".image > img").attr("src") ?: return@mapNotNull null
        //    AnimeSearchResponse(recName, href, this.name, TvType.Anime, img)
        //}

        return newAnimeLoadResponse(title, url, TvType.Anime) {
            posterUrl = poster
            year = showData.airedStart?.year

            addEpisodes(DubStatus.Subbed, episodes.first)
            addEpisodes(DubStatus.Dubbed, episodes.second)
            addActors(characters)
            //this.recommendations = recommendations

            showStatus = getStatus(showData.status.toString())

            plot = description?.replace(Regex("""<(.*?)>"""), "")
        }
    }

    private val embedBlackList = listOf(
        "https://mp4upload.com/",
        "https://streamsb.net/",


 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.
//
/// \file acDockWidgetTitleBar.cpp
/// \version 2.21
//
//=====================================================================

#include "acdockwidgettitlebar.h"

acDockWidgetTitlebar::acDockWidgetTitlebar(QWidget* parent)
    : parent(parent)
{
    QString PushButtonStyle("QPushButton {border:none; margin: 0px; padding: 0px } QPushButton:hover {border:1px solid black}");

    QPalette Pal(palette());
    Pal.setColor(QPalette::Background, Qt::lightGray);
    setAutoFillBackground(true);
    setPalette(Pal);
    setMaximumHeight(20);
    m_close = false;

    m_parent = parent;

    // Create a close button and set its icon to that of the OS
    m_ToolBarIcon = new QIcon(":/compressonatorgui/images/settings.png");

    m_buttonToolBar = new QPushButton(this);
    m_buttonToolBar->setIcon(*m_ToolBarIcon);
    m_buttonToolBar->setStyleSheet(PushButtonStyle);
    m_buttonToolBar->setToolTip("Show Tool Bar");
    m_buttonToolBarEnabled = true;

    // Get the OS close button icon
    QStyle* style = qApp->style();

    QIcon minimizeIcon = style->standardIcon(QStyle::SP_TitleBarMinButton);
    // Create a maximize button and set its icon to that of the OS
    m_buttonMinimize = new QPushButton(this);
    m_buttonMinimize->setIcon(minimizeIcon);
    m_buttonMinimize->setStyleSheet(PushButtonStyle);
    m_buttonMinimize->setToolTip("Minimize Window");

    QIcon maximizeIcon = style->standardIcon(QStyle::SP_TitleBarMaxButton);
    // Create a maximize button and set its icon to that of the OS
    m_buttonMaximize = new QPushButton(this);
    m_buttonMaximize->setIcon(maximizeIcon);
    m_buttonMaximize->setStyleSheet(PushButtonStyle);
    m_buttonMaximize->setToolTip("Maximize Window");

    QIcon normalIcon = style->standardIcon(QStyle::SP_TitleBarNormalButton);
    // Create a maximize button and set its icon to that of the OS
    m_buttonNormal = new QPushButton(this);
    m_buttonNormal->setIcon(normalIcon);
    m_buttonNormal->setStyleSheet(PushButtonStyle);
    m_buttonNormal->setToolTip("Normal Window");
    m_buttonNormal->hide();

    QIcon closeIcon = style->standardIcon(QStyle::SP_TitleBarCloseButton);

    // Create a close button and set its icon to that of the OS
    m_buttonClose = new QPushButton(this);
    //m_buttonClose->setIcon(qicon(":/compressonatorgui/images/cxclose.png"));
    m_buttonClose->setIcon(closeIcon);
    m_buttonClose->setStyleSheet(PushButtonStyle);
    m_buttonClose->setToolTip("Close Window");
    m_ButtonCloseEnabled = true;

    // Reserve a label for the Titlebar
    m_label = new QLabel("", this);

    // Set a layout for the n


r.Slider.TickFrequency = 1;
            //LSlider.Slider.IsSnapToTickEnabled = true;

            SetColor(Color);

        }

        public void SetColor(Color color)
        {
            Color = color;

            CustomColorSwatch.CurrentColor = color;

            IsSettingValues = true;

            RSlider.Slider.Value = Color.R;
            GSlider.Slider.Value = Color.G;
            BSlider.Slider.Value = Color.B;
            ASlider.Slider.Value = Color.A;

            SSlider.Slider.Value = Color.GetSaturation();
            LSlider.Slider.Value = Color.GetBrightness();
            HSlider.Slider.Value = Color.GetHue();

            ColorDisplayBorder.Background = new SolidColorBrush(Color);

            IsSettingValues = false;
            OnPickColor?.Invoke(color);
        }

        internal void CustomColorsChanged()
        {
            if (ColorPickerSettings.UsingCustomPalette)
            {
                SaveCustomPalette(ColorPickerSettings.CustomPaletteFilename);
            }
        }

        protected void SampleImageClick(BitmapSource img, Point pos)
        {
            // https://social.msdn.microsoft.com/Forums/vstudio/en-US/82a5731e-e201-4aaf-8d4b-062b138338fe/getting-pixel-information-from-a-bitmapimage?forum=wpf

            int stride = (int) img.Width*4;
            int size = (int) img.Height*stride;
            byte[] pixels = new byte[(int) size];

            img.CopyPixels(pixels, stride, 0);

            // Get pixel
            var x = (int) pos.X;
            var y = (int) pos.Y;

            int index = y*stride + 4*x;

            byte red = pixels[index];
            byte green = pixels[index + 1];
            byte blue = pixels[index + 2];
            byte alpha = pixels[index + 3];

            var color = Color.FromArgb(alpha, blue, green, red);
            SetColor(color);
        }

        private void SampleImage_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            Mouse.Capture(this);

            this.MouseMove += ColorPickerControl_MouseMove;
            this.MouseUp += ColorPickerControl_MouseUp;
        }

        private void ColorPickerControl_MouseMove(object sender, MouseEventArgs e)
        {
            var pos = e.GetPosition(SampleImage);
            var img = SampleImage.Source as BitmapSource;

            if (pos.X > 0 && pos.Y > 0 && pos.X < img.PixelWidth && pos.Y < img.PixelHeight)
                SampleImageClick(img, pos);
        }

        private void ColorPickerControl_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Mouse.Capture(null);
            this.MouseMove -= ColorPickerControl_MouseMove;
            this.MouseUp -= ColorPickerControl_MouseUp;
        }

        private void SampleImage2_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            var pos = e.GetPosition(SampleImage2);
            var img = SampleImage2.Source as BitmapSource;
            SampleImageClick(img, pos);
        }

        private void Swatch_OnOnPickColor(Color color)
        {
            SetColor(color);
        }

        private void HSlider_OnOnValueChanged(double value)
        {
            if (!IsSettingValues)
            {
                var s = Color.GetSaturation();
                var l = Color.GetBrightness();
                var h = (float) value;
                var a = (int) ASlider.Slider.Value;
                Color = Util.FromAhsb(a, h, s, l);

                SetColor(Color);
            }
        }

        private void RSlider_OnOnValueChanged(double value)
        {
            if (!IsSettingValues)
            {
                var val = (byte) value;
                Color.R = val;


48 48-48h48V12c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v52h128V12c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v52h48c26.51 0 48 21.49 48 48v36c0 6.627-5.373 12-12 12zM12 192h424c6.627 0 12 5.373 12 12v260c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V204c0-6.627 5.373-12 12-12zm333.296 95.947-28.169-28.398c-4.667-4.705-12.265-4.736-16.97-.068L194.12 364.665l-45.98-46.352c-4.667-4.705-12.266-4.736-16.971-.068l-28.397 28.17c-4.705 4.667-4.736 12.265-.068 16.97l82.601 83.269c4.667 4.705 12.265 4.736 16.97.068l142.953-141.805c4.705-4.667 4.736-12.265.068-16.97z"/></svg>';
  static const String calendar_day =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="448" height="512" preserveAspectRatio="xMidYMid meet" viewBox="0 0 448 512"><path fill="currentColor" d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm64-192c0-8.8 7.2-16 16-16h96c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16v-96zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"/></svg>';
  static const String calendar_minus =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="448" height="512" preserveAspectRatio="xMidYMid meet" viewBox="0 0 448 512"><path fill="currentColor" d="M436 160H12c-6.6 0-12-5.4-12-12v-36c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48v36c0 6.6-5.4 12-12 12zM12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm304 192c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H132c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h184z