// Progpow Minimum difficulty until fork (used for saturation)
pub const OLD_MIN_DIFFICULTY_PROGPOW: u64 = 100000;

/// RandomX Minimum difficulty (used for saturation)
pub const BLOCK_DIFF_FACTOR_RANDOMX: u64 = 64;

/// Progpow Minimum difficulty (used for saturation)
pub const BLOCK_DIFF_FACTOR_PROGPOW: u64 = 64;

/// Minimum scaling factor for AR pow, enforced in diff retargetting
/// avoids getting stuck when trying to increase ar_scale subject to dampening
pub const MIN_AR_SCALE: u64 = AR_SCALE_DAMP_FACTOR;

/// Clamp factor to use for difficulty adjustment
/// Limit value to within this factor of goal
pub const RX_CLAMP_FACTOR: u64 = 2;

/// Dampening factor to use for difficulty adjustment
pub const RX_DIFFICULTY_DAMP_FACTOR: u64 = 3;

/// Clamp factor to use for difficulty adjustment
/// Limit value to within this factor of goal
pub const PP_CLAMP_FACTOR: u64 = 2;

/// Dampening factor to use for difficulty adjustment
pub const PP_DIFFICULTY_DAMP_FACTOR: u64 = 3;

/// unit difficulty, equal to graph_weight(SECOND_POW_EDGE_BITS)
pub const UNIT_DIFFICULTY: u64 =
	((2 as u64) << (SECOND_POW_EDGE_BITS - BASE_EDGE_BITS)) * (SECOND_POW_EDGE_BITS as u64);

/// The initial difficulty at launch. This should be over-estimated
/// and difficulty should come down at launch rather than up
/// Currently grossly over-estimated at 10% of current
/// ethereum GPUs (assuming 1GPU can solve a block at diff 1 in one block interval)
pub const INITIAL_DIFFICULTY: u64 = 1_000_000 * UNIT_DIFFICULTY;

/// Minimal header information required for the Difficulty calculation to
/// take place
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct HeaderInfo {
	/// Block hash, ZERO_HASH when this is a sythetic entry.
	pub block_hash: Hash,
	/// Timestamp of the header, 1 when not used (returned info)
	pub timestamp: u64,
	/// Network difficulty or next difficulty to use
	pub difficulty: Difficulty,
	/// Network secondary PoW factor or factor to use
	pub secondary_scaling: u32,
	/// Whether the header is a secondary proof of work
	pub is_secondary: bool,
	/// timespan of the previous block of the same algorithm type
	pub prev_timespan: u64,
}

impl HeaderInfo {
	/// Default constructor
	pub fn new(
		block_hash: Hash,
		timestamp: u64,
		difficulty: Difficulty,
		secondary_scaling: u32,
		is_secondary: bool,
		prev_timespan: u64,
	) -> HeaderInfo {
		HeaderInfo {
			block_hash,
			timestamp,
			difficulty,
			secondary_scaling,
			is_secondary,
			prev_timespan,
		}
	}

	/// Constructor from a timestamp and difficulty, setting a default secondary
	/// PoW factor
	pub fn from_ts_diff(timestamp: u64, difficulty: Difficulty) -> HeaderInfo {
		HeaderInfo {
			block_hash: ZERO_HASH,
			timestamp,
			difficulty,
			secondary_scaling: global::initial_graph_weight(),
			is_secondary: true,
			prev_timespan: 0,
		}
	}

	/// Constructor from a difficulty and secondary factor, setting a default
	/// timestamp
	pub fn from_diff_scaling(difficulty: Difficulty, secondary_scaling: u32) -> HeaderInfo {
		HeaderInfo {
			block_hash: ZERO_HASH,
			timestamp: 1,
			difficulty,


NG](trait.RNG.html) client
///
/// Clients of an [RNG](trait.RNG.html) must implement this trait.
pub trait Client {
    /// Called by the (RNG)[trait.RNG.html] when there are one or more random
    /// numbers available
    ///
    /// `randomness` in an `Iterator` of available random numbers. The amount of
    /// randomness available may increase if `randomness` is not consumed
    /// quickly so clients should not rely on iterator termination to finish
    /// consuming random numbers.
    ///
    /// The client returns either `Continue::More` if the iterator did not have
    /// enough random values and the client would like to be called again when
    /// more is available, or `Continue::Done`.
    fn randomness_available(&self, randomness: &mut Iterator<Item = u32>) -> Continue;
}
use crate::traits::sync::{Migrate, Query, Transaction};
use crate::Migration;
use postgres::{Client as PgClient, Error as PgError, Transaction as PgTransaction};
use time::format_description::well_known::Rfc3339;
use time::OffsetDateTime;

fn query_applied_migrations(
    transaction: &mut PgTransaction,
    query: &str,
) -> Result<Vec<Migration>, PgError> {
    let rows = transaction.query(query, &[])?;
    let mut applied = Vec::new();
    for row in rows.into_iter() {
        let version = row.get(0);
        let applied_on: String = row.get(2);
        // Safe to call unwrap, as we stored it in RFC3339 format on the database
        let applied_on = OffsetDateTime::parse(&applied_on, &Rfc3339).unwrap();

        let checksum: String = row.get(3);

        applied.push(Migration::applied(
            version,
            row.get(1),
            applied_on,
            checksum
                .parse::<u64>()
                .expect("checksum must be a valid u64"),
        ));
    }
    Ok(applied)
}

impl Transaction for PgClient {
    type Error = PgError;

    fn execute(&mut self, queries: &[&str]) -> Result<usize, Self::Error> {
        let mut transaction = PgClient::transaction(self)?;
        let mut count = 0;
        for query in queries.iter() {
            PgTransaction::batch_execute(&mut transaction, query)?;
            count += 1;
        }
        transaction.commit()?;
        Ok(count as usize)
    }
}

impl Query<Vec<Migration>> for PgClient {
    fn query(&mut self, query: &str) -> Result<Vec<Migration>, Self::Error> {
        let mut transaction = PgClient::transaction(self)?;
        let applied = query_applied_migrations(&mut transaction, query)?;
        transaction.commit()?;
        Ok(applied)
    }
}

impl Migrate for PgClient {}
use twilight_model::{
    application::component::{button::ButtonStyle, Button},
    channel::ReactionType,
};

#[derive(Clone, Debug)]
#[must_use = "builders have no effect if unused"]
pub struct ButtonBuilder(Button);

impl ButtonBuilder {
    /// Create a new builder to construct a [`Button`].
    pub const fn new(style: ButtonStyle, custom_id_or_url: String) -> Self {


*
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_SELECT_FEATURE_COUNT = 0;

	/**
	 * The meta object id for the '{@link org.bimserver.models.ifc2x3tc1.impl.IfcLibraryInformationImpl Ifc Library Information}' class.
	 *
	 *
	 * @see org.bimserver.models.ifc2x3tc1.impl.IfcLibraryInformationImpl
	 * @see org.bimserver.models.ifc2x3tc1.impl.Ifc2x3tc1PackageImpl#getIfcLibraryInformation()
	 * @generated
	 */
	int IFC_LIBRARY_INFORMATION = 287;

	/**
	 * The feature id for the 'Name' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION__NAME = IFC_LIBRARY_SELECT_FEATURE_COUNT + 0;

	/**
	 * The feature id for the 'Version' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION__VERSION = IFC_LIBRARY_SELECT_FEATURE_COUNT + 1;

	/**
	 * The feature id for the 'Publisher' reference.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION__PUBLISHER = IFC_LIBRARY_SELECT_FEATURE_COUNT + 2;

	/**
	 * The feature id for the 'Version Date' reference.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION__VERSION_DATE = IFC_LIBRARY_SELECT_FEATURE_COUNT + 3;

	/**
	 * The feature id for the 'Library Reference' reference list.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION__LIBRARY_REFERENCE = IFC_LIBRARY_SELECT_FEATURE_COUNT + 4;

	/**
	 * The number of structural features of the 'Ifc Library Information' class.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_INFORMATION_FEATURE_COUNT = IFC_LIBRARY_SELECT_FEATURE_COUNT + 5;

	/**
	 * The meta object id for the '{@link org.bimserver.models.ifc2x3tc1.impl.IfcLibraryReferenceImpl Ifc Library Reference}' class.
	 *
	 *
	 * @see org.bimserver.models.ifc2x3tc1.impl.IfcLibraryReferenceImpl
	 * @see org.bimserver.models.ifc2x3tc1.impl.Ifc2x3tc1PackageImpl#getIfcLibraryReference()
	 * @generated
	 */
	int IFC_LIBRARY_REFERENCE = 288;

	/**
	 * The feature id for the 'Location' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int IFC_LIBRARY_REFERENCE__LOCATION = IFC_EXTERNAL_REFERENCE__LOCATION;

	/**
	 * The feature id for the 'Item Reference' attribute.
	 *
	 *
	 * @generated
	 * @ordered


etoothDevice {}

void main() {
  setUpAll(() async {
    await initPrefServiceForTest();
  });

  test('Technogym Run constructor tests', () async {
    final treadmill = DeviceFactory.getTechnogymRun();

    expect(treadmill.sport, ActivityType.run);
    expect(treadmill.fourCC, technogymRunFourCC);
    expect(treadmill.isMultiSport, false);
  });

  test('Technogym Run RSC Device interprets flags properly', () async {
    final treadmill = RunningSpeedAndCadenceSensor(MockBluetoothDevice());

    final canProcess = treadmill.canMeasurementProcessed(sampleData[0]);

    expect(canProcess, true);
    expect(treadmill.speedMetric, isNotNull);
    expect(treadmill.cadenceMetric, isNotNull);
    expect(treadmill.distanceMetric, isNotNull);
  });

  group('Technogym Run RSC Device interprets RSC data properly', () {
    for (final sample in sampleData) {
      final expected = RecordWithSport(
        distance: (((sample[9] * 256 + sample[8]) * 256 + sample[7]) * 256 + sample[6]) / 10.0,
        elapsed: null,
        calories: null,
        power: null,
        speed: (sample[2] * 256 + sample[1]) / 256.0 * DeviceDescriptor.ms2kmh,
        cadence: sample[3],
        heartRate: null,
        pace: null,
        sport: ActivityType.run,
        caloriesPerHour: null,
        caloriesPerMinute: null,
        strokeCount: null,
      );

      final sum = sample.fold<int>(0, (a, b) => a + b);
      test("$sum", () async {
        final treadmill = RunningSpeedAndCadenceSensor(MockBluetoothDevice());

        final record = treadmill.processMeasurement(sample);

        expect(record.id, Isar.autoIncrement);
        expect(record.id, expected.id);
        expect(record.activityId, Isar.minId);
        expect(record.activityId, expected.activityId);
        expect(record.distance, expected.distance);
        expect(record.elapsed, expected.elapsed);
        expect(record.calories, expected.calories);
        expect(record.power, expected.power);
        if (record.speed != null) {
          expect(record.speed, closeTo(expected.speed!, eps));
        } else {
          expect(record.speed, null);
        }
        expect(record.cadence, expected.cadence);
        expect(record.heartRate, expected.heartRate);
        expect(record.elapsedMillis, expected.elapsedMillis);
        expect(record.pace, expected.pace);
        expect(record.sport, expected.sport);
        expect(record.caloriesPerHour, expected.caloriesPerHour);
        expect(record.caloriesPerMinute, expected.caloriesPerMinute);
        expect(record.strokeCount, expected.strokeCount);
      });
    }
  });
}
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:isar/isar.dart';
import 'package:mocktail/mocktail.dart';
import 'package:track_my_indoor_exercise/devices/device_descriptors/device_descriptor.dart';
import 'package:track_my_indoor_exercise/devices/device_descriptors/npe_runn_treadmill.dart';
import 'package:track_my_indoor_exercise/devices/device_fourcc.dart';
import 'package:track_my_indoor_exercise/devices/gadgets/running_speed_and_cadence_sensor.dart';
import 'package:track_my_indoor_exercise/persistence/record.dart';
import '


Operation.HERITABLE_ATOM
		self.getAtomProperty(EXPLICIT_SUBCLASSING_KEY.atom).notNil ->
			SerializerOperation.EXPLICIT_SUBCLASS_ATOM
		else -> SerializerOperation.ATOM
	}

	override fun o_SetAtomBundle(self: AvailObject, bundle: A_Bundle)
	{
		self.atomicUpdateSlot(BUNDLE_OR_NIL) {
			assert(isNil or bundle.isNil) {
				"Bundle can be cleared or set, but not changed"
			}
			bundle
		}
	}

	override fun o_SetAtomProperty(
		self: AvailObject,
		key: A_Atom,
		value: A_BasicObject)
	{
		var map = self.volatileSlot(PROPERTY_MAP_POJO)
		if (map.isNil)
		{
			synchronized(self)
			{
				// Re-check the volatile field.
				map = self.volatileSlot(PROPERTY_MAP_POJO)
				if (map.isNil)
				{
					map = identityPojo(WeakHashMap<A_Atom, A_BasicObject>())
					self.setVolatileSlot(PROPERTY_MAP_POJO, map)
				}
			}
		}
		synchronized(self) {
			super.o_SetAtomProperty(self, key.makeShared(), value.makeShared())
		}
	}

	/**
	 * Create a new atom with the given initialization values, then setting the
	 * descriptor to the receiver.  The name is not globally unique, but serves
	 * to help to visually distinguish atoms. The hash value is provided to
	 * allow an existing non-shared [atom][AtomDescriptor] to be converted to
	 * this shared form, after which the client can convert the original atom
	 * into an [indirection][IndirectionDescriptor] to the new shared one.
	 *
	 * Note that the properties in the map, if present, are not made shared
	 * here, as this could lead to unbounded recursion if an atom is used inside
	 * one of its own properties.  The client should make these shared after
	 * this method returns.
	 *
	 * @param name
	 *   An [A_String] used to help identify the new atom.
	 * @param issuingModule
	 *   The [A_Module] that issued this atom.
	 * @param propertyMapPojoOrNil
	 *   Either a raw [pojo][RawPojoDescriptor] containing the weak property
	 *   map for the new [A_Atom], or [nil].
	 * @param originalHashOrZero
	 *   The hash value that must be set for this atom, or zero if a non-zero
	 *   hash should be generated now for the new atom.
	 * @return
	 *   The new atom, not equal to any object in use before this method was
	 *   invoked.
	 */
	fun createInitialized(
		name: A_String,
		issuingModule: A_Module,
		propertyMapPojoOrNil: AvailObject,
		originalHashOrZero: Int
	): AvailObject = initialPrivateMutable.create {
		setSlot(NAME, name.makeShared())
		setSlot(ISSUING_MODULE, issuingModule.makeShared())
		setVolatileSlot(PROPERTY_MAP_POJO, propertyMapPojoOrNil)
		val hash = originalHashOrZero.ifZero {
			AvailRuntimeSupport.nextNonzeroHash()
		}
		setSlot(HASH_OR_ZERO, hash)
		setSlot(BUNDLE_OR_NIL, nil)
		setDescriptor(this@AtomWithPropertiesSharedDescriptor)
	}

	companion object {
		private val initialPrivateMutable =
			AtomWithPropertiesSharedDescriptor(MUTABLE, false, TypeTag.ATOM_TAG)

		/** The shared [AtomWithPropertiesDescriptor]. */
		val shared =
			AtomWithPropertiesSharedDescriptor(SHARED, false, TypeTag.ATOM_TAG)

		/** The shared [AtomWithPropertiesDescriptor]. */
		val sharedSpecial =
			AtomWithPropertiesSharedDescriptor(SHARED, true, TypeTag.ATOM_TAG)

		/**
		 * The descriptor reserved for the [true][AtomDescriptor.trueObject]
		 * atom.
		 */
		val sharedForTrue =
			AtomWithPropertiesSharedDescriptor(SHARED, true, TypeTag.TRUE_TAG)

		/**
		 * The descriptor reserved for the [false][AtomDescriptor.falseObject]
		 * atom.
		 */
		val sharedForFalse =
			AtomWithPropertiesSharedDescriptor(SHARED, true, TypeTag.FALSE_TAG)
	}
}
/*
 * GrammaticalRestrictionDescriptor.kt
 * Copyright © 1993-2022, The Avail Foundation, LLC.
 * All rights reserve


< nonzeros ) {
         rows( rand<size_t>( 0UL, m-1UL ), rand<size_t>( 0UL, n-1UL ) ) = rand<ElementType>();
      }
   }
   //**********************************************************************************************

   //**********************************************************************************************
   /*!\brief Randomization of a sparse row selection.
   //
   // \param rows The row selection to be randomized.
   // \param min The smallest possible value for a matrix element.
   // \param max The largest possible value for a matrix element.
   // \return void
   */
   template< typename RT     // Type of the row selection
           , typename Arg >  // Min/max argument type
   inline void randomize( RT&& rows, const Arg& min, const Arg& max ) const
   {
      using RowsType    = RemoveReference_t<RT>;
      using ElementType = ElementType_t<RowsType>;

      BLAZE_CONSTRAINT_MUST_BE_ROWS_TYPE( RowsType );
      BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RowsType );

      const size_t m( rows.rows()    );
      const size_t n( rows.columns() );

      if( m == 0UL || n == 0UL ) return;

      const size_t nonzeros( rand<size_t>( 1UL, std::ceil( 0.5*m*n ) ) );

      rows.reset();
      rows.reserve( nonzeros );

      while( rows.nonZeros() < nonzeros ) {
         rows( rand<size_t>( 0UL, m-1UL ), rand<size_t>( 0UL, n-1UL ) ) = rand<ElementType>( min, max );
      }
   }
   //**********************************************************************************************

   //**********************************************************************************************
   /*!\brief Randomization of a sparse row selection.
   //
   // \param rows The row selection to be randomized.
   // \param nonzeros The number of non-zero elements of the random row selection.
   // \param min The smallest possible value for a matrix element.
   // \param max The largest possible value for a matrix element.
   // \return void
   // \exception std::invalid_argument Invalid number of non-zero elements.
   */
   template< typename RT    // Type of the row selection
           , typename Arg > // Min/max argument type
   inline void randomize( RT&& rows, size_t nonzeros, const Arg& min, const Arg& max ) const
   {
      using RowsType    = RemoveReference_t<RT>;
      using ElementType = ElementType_t<RowsType>;

      BLAZE_CONSTRAINT_MUST_BE_ROWS_TYPE( RowsType );
      BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RowsType );

      const size_t m( rows.rows()    );
      const size_t n( rows.columns() );

      if( nonzeros > m*n ) {
         BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
      }

      if( m == 0UL || n == 0UL ) return;

      rows.reset();
      rows.reserve( nonzeros );

      while( rows.nonZeros() < nonzeros ) {
         rows( rand<size_t>( 0UL, m-1UL ), rand<size_t>( 0UL, n-1UL ) ) = rand<ElementType>( min, max );
      }
   }
   //**********************************************************************************************
};
/*! \endcond */
//*************************************************************************************************

} // namespace blaze

#endif


Bed.get(SearchService);
    service.searchBookInfo(1, 'カルマート').subscribe(book => {
      // hitCountが1件以上であることを確認
      expect(book.hitCount).toBeGreaterThan(1);
      // itemsの件数が1件以上であることを確認
      expect(book.items.length).toBeGreaterThan(1);
      // nextPageUriがnullでないことを確認
      expect(book.nextPageUri).not.toBeNull();
      // nextPageUriが空文字でないことを確認
      expect(book.nextPageUri).not.toEqual('');
    });
  });

  it('書籍詳細検索APIをCallし応答を受け取れることを確認', () => {
    const service: SearchService = TestBed.get(SearchService);
    service.searchDetailsBook('1234567890123').subscribe(bookDetails => {
      // 著者名がnull出ないことを確認
      expect(bookDetails.authors).not.toBeNull();
      // 概要が空文字でないことを確認
      expect(bookDetails.description).not.toEqual('');
      // 画像Uriがnullでないことを確認。
      expect(bookDetails.imageUri).not.toBeNull();
      // 発行年月日がnullでないことを確認。
      expect(bookDetails.publishedDate).not.toBeNull();
      // タイトルが空文字でないことを確認。
      expect(bookDetails.title).not.toEqual('');
    });
  });
});
import { Action } from '@ngrx/store';
import { NavBarItem } from '../nav-bar.model';

export enum NavBarActionTypes {
    RETRIEVE = '[nav-bar] Retrieve',
    RETRIEVE_SUCCESS = '[nav-bar] Retrieve Success',
    RETRIEVE_ERROR = '[nav-bar] Retrieve Error',
}

export class ActionNavBarRetrieve implements Action {
    readonly type = NavBarActionTypes.RETRIEVE;
}
export class ActionNavBarSuccess implements Action {
    readonly type = NavBarActionTypes.RETRIEVE_SUCCESS;
    constructor(readonly payload: NavBarItem[]) { }
}
export class ActionNavBarError implements Action {
    readonly type = NavBarActionTypes.RETRIEVE_ERROR;
    constructor(readonly payload: string) { }
}

export type NavBarActions = ActionNavBarRetrieve | ActionNavBarSuccess | ActionNavBarError;
import { getIsBuildingDataCache } from '../../common/framework/data_cache.js';
import { Colors } from '../../common/util/colors.js';
import { assert, unreachable } from '../../common/util/util.js';
import {
  deserializeExpectation,
  SerializedExpectation,
  serializeExpectation,
} from '../shader/execution/expression/case_cache.js';
import { Expectation, toComparator } from '../shader/execution/expression/expression.js';

import { isFloatValue, Matrix, Scalar, Value, Vector } from './conversion.js';
import { FPInterval } from './floating_point.js';

/** Comparison describes the result of a Comparator function. */
export interface Comparison {
  matched: boolean; // True if the two values were considered a match
  got: string; // The string representation of the 'got' value (possibly with markup)
  expected: string; // The string representation of the 'expected' value (possibly with markup)
}

// All Comparators must be serializable to be used in the CaseCache.
// New Comparators should add a new entry to SerializableComparatorKind and
// define functionality in serialize/deserializeComparator as needed.
//
// 'value' and 'packed' are internal framework Comparators that exist, so that
// the whole Case type hierarchy doesn't need to be split into Serializable vs
// non-Serializable paths. Passing them into the CaseCache will cause a runtime
// error.
// 'value' and 'packed' should never be used in .spec.ts files.
//
export type SerializableComparatorKind = 'an


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

#ifndef _DEPNG3DIMAGEINFO_H_
#define _DEPNG3DIMAGEINFO_H_

#include "png.h"

#include <dragengine/systems/modules/image/deBaseImageInfo.h>
#include <dragengine/common/string/decString.h>
#include <dragengine/common/math/decMath.h>

/**
 * @brief Image information class.
 */
class dePng3DImageInfo : public deBaseImageInfo{
public:
	decString filename;

	int width;
	int height;
	int depth;
	int componentCount;
	int bitCount;

public:
	/** @name Constructors and Destructors */
	/*@{*/
	/** Creates a new info object. */
	dePng3DImageInfo( const char *nfilename );
	/** Cleans up the info object. */
	virtual ~dePng3DImageInfo();
	/*@}*/

	/** @name Management */
	/*@{*/
	/** Retrieves the width in pixels. */
	virtual int GetWidth();
	/** Retrieves the height in pixels. */
	virtual int GetHeight();
	/** Retrieves the depth in pixels. */
	virtual int GetDepth();
	/** Retrieves the number of components. */
	virtual int GetComponentCount();
	/** Retrieves the bit count of each component. */
	virtual int GetBitCount();
	/*@}*/
};

// end of include only once
#endif


       await excelWriter.saveProgress();
                }

                // 更新进度
                const now = Date.now();
                if (now - lastProgressUpdate > progressUpdateInterval) {
                    const completedCount = Math.min(i + batchSize, posts.length);
                    const totalCompleted = actualStartPosition - 1 + completedCount;
                    const progressPercent = Math.round((completedCount / posts.length) * 100);
                    const progressBar = generateProgressBar(progressPercent);

                    const timeElapsed = (now - rebuildResult.startTime) / 1000;
                    const postsPerSecond = rebuildResult.successCount / timeElapsed;
                    const estimatedTimeLeft = (posts.length - completedCount) / postsPerSecond;

                    await messageManager.updateMessage(
                        `🔄 重建进度：${progressBar} ${progressPercent}% (${completedCount}/${posts.length})\n` +
                        `📍 总进度：第${actualStartPosition}到第${totalCompleted}个帖子\n` +
                        `✅ 成功：${rebuildResult.successCount} ❌ 失败：${rebuildResult.failedCount}\n` +
                        `⚡ 速度：${postsPerSecond.toFixed(1)} 帖子/秒 | 预计剩余：${Math.round(estimatedTimeLeft)}秒\n` +
                        `📄 进度文件：${excelWriter.getOutputFileName()}`
                    );

                    lastProgressUpdate = now;
                }

                // 批次间延迟
                if (i + batchSize < posts.length) {
                    console.log(`⏱ 批次完成，等待 ${delayBetweenBatches / 1000} 秒后继续...`);
                    await delay(delayBetweenBatches);
                }
            }

            // 7. 最终保存
            console.log('💾 保存最终结果...');
            await excelWriter.saveProgress();

            const outputPath = excelWriter.getOutputPath();
            const outputFileName = excelWriter.getOutputFileName();
            rebuildResult.complete(outputPath);

            // 8. 清理资源
            await postRebuilder.cleanup(targetForum);

            // 9. 发送完成报告
            const completionMessage = generateCompletionMessage(rebuildResult, outputFileName, actualStartPosition, allPosts.length);
            await messageManager.updateMessage(completionMessage);

            // 10. 发送Excel文件
            await sendExcelFile(messageManager, outputPath, outputFileName, rebuildResult);

        } catch (error) {
            console.error('重建论坛时出错:', error);

            if (error.code === 429 || error.message.includes('rate limit')) {
                const message = `⚠ 遇到Discord API频率限制，请等待几分钟后使用以下命令继续：\n` +
                    `\`/重建论坛 目标论坛:${targetForum}\`\n\n` +
                    `系统会自动从上次中断的位置继续处理。`;

                await messageManager.updateMessage(message);
            } else {
                const errorMessage = `❌ 重建过程中出现错误: ${error.message}`;
                await messageManager.updateMessage(errorMessage);
            }
        }

    } catch (error) {
        console.error('执行重建论坛命令时出错:', error);

        try {
            if (interaction.deferred) {
                await messageManager.updateMessage('❌ 命令执行失败，请检查日志。');
            } else {
                await interaction.reply({
                    content: '❌ 命令执行失败，请检查日志。',
                    flags: MessageFlags.Ephemeral
                });
            }
        } catch (finalError) {
            console.error('最终错误处理也失败:', finalError);
        }
    }
}

async function sendExcelFile(messageManager,


ter($ret, retain: true, release: true);
  }

  /// dataWithData:
  static NSMutableData dataWithData(NSData data) {
    final $ret = _objc_msgSend_1sotr3r(
      _class_NSMutableData,
      _sel_dataWithData_,
      data.ref.pointer,
    );
    return NSMutableData.castFromPointer($ret, retain: true, release: true);
  }

  /// dataWithLength:
  static NSMutableData? dataWithLength(int length) {
    final $ret = _objc_msgSend_14hpxwa(
      _class_NSMutableData,
      _sel_dataWithLength_,
      length,
    );
    return $ret.address == 0
        ? null
        : NSMutableData.castFromPointer($ret, retain: true, release: true);
  }

  /// new
  static NSMutableData new$() {
    final $ret = _objc_msgSend_151sglz(_class_NSMutableData, _sel_new);
    return NSMutableData.castFromPointer($ret, retain: false, release: true);
  }

  /// supportsSecureCoding
  static bool getSupportsSecureCoding() {
    return _objc_msgSend_91o635(
      _class_NSMutableData,
      _sel_supportsSecureCoding,
    );
  }

  /// Returns a new instance of NSMutableData constructed with the default `new` method.
  factory NSMutableData() => new$();
}

extension NSMutableData$Methods on NSMutableData {
  /// compressedDataUsingAlgorithm:error:
  ///
  /// iOS: introduced 13.0.0
  /// macOS: introduced 10.15.0
  NSMutableData? compressedDataUsingAlgorithm(
    NSDataCompressionAlgorithm algorithm, {
    required ffi.Pointer<ffi.Pointer<objc.ObjCObject>> error,
  }) {
    objc.checkOsVersionInternal(
      'NSMutableData.compressedDataUsingAlgorithm:error:',
      iOS: (false, (13, 0, 0)),
      macOS: (false, (10, 15, 0)),
    );
    final $ret = _objc_msgSend_1vnlaqg(
      this.ref.pointer,
      _sel_compressedDataUsingAlgorithm_error_,
      algorithm.value,
      error,
    );
    return $ret.address == 0
        ? null
        : NSMutableData.castFromPointer($ret, retain: true, release: true);
  }

  /// decompressedDataUsingAlgorithm:error:
  ///
  /// iOS: introduced 13.0.0
  /// macOS: introduced 10.15.0
  NSMutableData? decompressedDataUsingAlgorithm(
    NSDataCompressionAlgorithm algorithm, {
    required ffi.Pointer<ffi.Pointer<objc.ObjCObject>> error,
  }) {
    objc.checkOsVersionInternal(
      'NSMutableData.decompressedDataUsingAlgorithm:error:',
      iOS: (false, (13, 0, 0)),
      macOS: (false, (10, 15, 0)),
    );
    final $ret = _objc_msgSend_1vnlaqg(
      this.ref.pointer,
      _sel_decompressedDataUsingAlgorithm_error_,
      algorithm.value,
      error,
    );
    return $ret.address == 0
        ? null
        : NSMutableData.castFromPointer($ret, retain: true, release: true);
  }

  /// init
  NSMutableData init() {
    objc.checkOsVersionInternal(
      'NSMutableData.init',
      iOS: (false, (2, 0, 0)),
      macOS: (false, (10, 0, 0)),
    );
    final $ret = _objc_msgSend_151sglz(
      this.ref.retainAndReturnPointer(),
      _sel_init,
    );
    return NSMutableData.castFromPointer($ret, retain: false, release: true);
  }

  /// initWithBase64EncodedData:options:
  NSMutableData? initWith


     AlbumTrack.Key("ALBUM_1", track_number = 2),
      AlbumTrack.Key("ALBUM_1", track_number = 3)
    )
    assertThat(items).containsAll(albumTracks)
  }

  @Test
  fun `batchWrite greater than max batch size`() {
    val albumTracks = (1..(MAX_BATCH_WRITE + 5)).map {
      AlbumTrack("ALBUM_1", it.toLong(), "track $it", Duration.parse("PT3M28S"))
    }
    val result = musicDb.batchWrite(BatchWriteSet.Builder().clobber(albumTracks).build())
    assertThat(result.isSuccessful).isTrue()

    val items = musicDb.batchLoad(
      *(albumTracks.map { AlbumTrack.Key("ALBUM_1", track_number = it.track_number) }.toTypedArray())
    )
    assertThat(items).containsAll(albumTracks)
  }

  @Test
  fun batchLoadAfterBatchDelete() {
    val t1 = AlbumTrack("ALBUM_1", 1, "dreamin'", Duration.parse("PT3M28S"))
    val t2 = AlbumTrack("ALBUM_1", 2, "what you do to me", Duration.parse("PT3M24S"))
    val t3 = AlbumTrack("ALBUM_1", 3, "too slow", Duration.parse("PT2M27S"))

    val result1 = musicDb.batchWrite(BatchWriteSet.Builder().clobber(t1, t2, t3).build())
    assertThat(result1.isSuccessful).isTrue()
    val result2 = musicDb.batchWrite(BatchWriteSet.Builder().delete(AlbumTrack.Key("ALBUM_1", 2)).build())
    assertThat(result2.isSuccessful).isTrue()

    val items = musicDb.batchLoad(
      AlbumTrack.Key("ALBUM_1", track_number = 1),
      AlbumTrack.Key("ALBUM_1", track_number = 2),
      AlbumTrack.Key("ALBUM_1", track_number = 3)
    )
    assertThat(items).containsExactly(t3, t1)
  }

  @Test
  fun `batchLoad with return capacity requested`() = runBlockingTest {
    val albumTracks = (1..(MAX_BATCH_READ + 5)).map {
      AlbumTrack("ALBUM_1", it.toLong(), "track $it", Duration.parse("PT3M28S"))
    }
    for (albumTrack in albumTracks) {
      musicTable.albumTracks.save(albumTrack)
    }
    val playlistInfo = PlaylistInfo(
      playlist_token = "PLAYLIST_1",
      playlist_name = "WFH Music",
      playlist_tracks = listOf(AlbumTrack.Key("ALBUM_1", 1))
    )
    musicTable.playlistInfo.save(playlistInfo)

    val loadedItems = musicDb.batchLoad(
      PlaylistInfo.Key("PLAYLIST_1"),
      *(albumTracks.map { AlbumTrack.Key("ALBUM_1", track_number = it.track_number) }.toTypedArray()),
      returnConsumedCapacity = ReturnConsumedCapacity.TOTAL
    )
    assertThat(loadedItems.getItems<AlbumTrack>()).containsAll(albumTracks)
    assertThat(loadedItems.getItems<PlaylistInfo>()).containsExactly(playlistInfo)

    assertThat(loadedItems.consumedCapacity)
      .extracting<Double> { it.capacityUnits() }
      .contains(50.0, 3.0)

    val loadedWithoutCapacity = musicDb.batchLoad(
      PlaylistInfo.Key("PLAYLIST_1"),
      *(albumTracks.map { AlbumTrack.Key("ALBUM_1", track_number = it.track_number) }.toTypedArray()),
      returnConsumedCapacity = ReturnConsumedCapacity.NONE
    )
    assertThat(loadedWithoutCapacity.consumedCapacity).isEmpty()
  }
}
/*
 * Copyright 2021 Square Inc.
 *
 * Licensed under


============================================
    Copyright (c) 2005-2012 Joel de Guzman
    Copyright (c) 2005-2006 Dan Marsden

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209)
#define BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209

#include <boost/fusion/support/config.hpp>
#include <boost/mpl/int.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>

namespace boost { namespace fusion
{
    template <typename Deque, typename T>
    struct front_extended_deque
      : detail::keyed_element<typename Deque::next_down, T, Deque>
      , sequence_base<front_extended_deque<Deque, T> >
    {
        typedef detail::keyed_element<typename Deque::next_down, T, Deque> base;
        typedef mpl::int_<(Deque::next_down::value - 1)> next_down;
        typedef typename Deque::next_up next_up;
        typedef mpl::int_<(result_of::size<Deque>::value + 1)> size;

        template <typename Arg>
        BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        front_extended_deque(Deque const& deque, Arg const& val)
          : base(val, deque)
        {}

#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
        template <typename Arg>
        BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        front_extended_deque(Deque const& deque, Arg& val)
          : base(val, deque)
        {}
#else
        template <typename Arg>
        BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        front_extended_deque(Deque const& deque, Arg&& val)
          : base(BOOST_FUSION_FWD_ELEM(Arg, val), deque)
        {}
#endif
    };
}}

#endif
/*=============================================================================
    Copyright (c) 2005-2012 Joel de Guzman
    Copyright (c) 2005-2007 Dan Marsden

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_DEQUE_FORWARD_02092007_0749)
#define FUSION_DEQUE_FORWARD_02092007_0749

#include <boost/fusion/support/config.hpp>
#include <boost/config.hpp>

#if (defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)   \
  || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS))   \
  || (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
# if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
#   undef BOOST_FUSION_HAS_VARIADIC_DEQUE
# endif
#else
# if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
#   define BOOST_FUSION_HAS_VARIADIC_DEQUE
# endif
#endif

#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
# if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
#   undef BOOST_FUSION_HAS_VARIADIC_DEQUE
# endif
#endif

///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
# include <boost/fusion/container/deque/detail/cpp03


timestamps and tenant support."""

    __abstract__ = True

    # Removed custom query method to avoid conflicts with modern SQLAlchemy
    # Use db.session.query(Model) instead

# Import db from extensions to avoid circular imports
from app.extensions import db

class BaseModel(db.Model, _BaseModelMixin):
    """Base model with timestamps."""

    __abstract__ = True

class TenantBaseModel(db.Model, _TenantBaseModelMixin):
    """Base model with timestamps and tenant support."""

    __abstract__ = True


and low

	set_b0_low
        sbrc    preg_2, 2
	 set_b0_high		; bit 2 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 1
	 set_b0_high		; bit 1 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 0
	 set_b0_high		; bit 0 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
	RCALL	four_bits	; output 4 times 0
				; the lower 4-bit are followed by 4 x 0
 #else		/* (LCD_INTERFACE_MODE == MODE_1803_SERIAL) */
  ; output lowest bit first
        sbrc    preg_2, 0
	 set_b0_high		; bit 0 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 1
	 set_b0_high		; bit 1 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 2
	 set_b0_high		; bit 2 == 1
	RCALL	toggle_en	; set en high and low
				; the upper 4-bit are followed by 4 x 0
	set_b0_low
        sbrc    preg_2, 3
	 set_b0_high		; bit 3 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
	RCALL	four_bits	; output 4 times 0
				; the lower 4-bit are followed by 4 x 0

	set_b0_low
        sbrc    preg_2, 4
	 set_b0_high		; bit 4 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 5
	 set_b0_high		; bit 5 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 6
	 set_b0_high		; bit 6 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
        sbrc    preg_2, 7
	 set_b0_high		; bit 7 == 1
	RCALL	toggle_en	; set en high and low

	set_b0_low
	RCALL	four_bits	; output 4 times 0
				; the upper 4-bit are followed by 4 x 0
 #endif
	RCALL	wait50us
	RCALL	wait30us	; at least 72 us delay
	ret		// return _lcd_hw_write
	.endfunc

/* output 4 times the same bit */
four_bits:
	RCALL toggle_en
	RCALL toggle_en
	RCALL toggle_en
	RCALL toggle_en
	ret

toggle_en:
	set_en_high              ;force data read from LCD controller
        set_en_high		; hold en high to meet the specification (300ns)
	set_en_low		; set SCLK back to low
	ret
#elif (LCD_INTERFACE_MODE == MODE_I2C)
;---------------------------------------------------------------------------------
;===================================================
_lcd_hw_write:
	; use I2C as master
	push 	preg_2
        push	preg_1		; save data/command
	release_scl
	rcall	WAIT_I2C
	set_low_sda		; set START bit
	rcall	WAIT_I2C
	ldi	preg_1, (LCD_I2C_ADDR*2)
	rcall	i2c_send	; writ


GOS =
        { "RSA/ECB/PKCS1Padding", "RSA" };

    @Override
    public void main(Provider p) throws Exception {
        try {
            Cipher.getInstance(RSA_ALGOS[0], p);
        } catch (GeneralSecurityException e) {
            System.out.println(RSA_ALGOS[0] + " unsupported, skipping");
            return;
        }
        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
        kpg.initialize(1024);
        KeyPair kp = kpg.generateKeyPair();

        for (String rsaAlgo: RSA_ALGOS) {
            Cipher cipherPKCS11 = Cipher.getInstance(rsaAlgo, p);
            Cipher cipherJce = Cipher.getInstance(rsaAlgo, "SunJCE");

            String algos[] = {"AES", "RC2", "Blowfish"};
            int keySizes[] = {128, 256};

            for (int j = 0; j < algos.length; j++) {
                String algorithm = algos[j];
                KeyGenerator keygen =
                    KeyGenerator.getInstance(algorithm);

                for (int i = 0; i < keySizes.length; i++) {
                    SecretKey secretKey = null;
                    System.out.print("Generate " + keySizes[i] + "-bit " +
                        algorithm + " key using ");
                    try {
                        keygen.init(keySizes[i]);
                        secretKey = keygen.generateKey();
                        System.out.println(keygen.getProvider().getName());
                    } catch (InvalidParameterException ipe) {
                        secretKey = new SecretKeySpec(new byte[32], algorithm);
                        System.out.println("SecretKeySpec class");
                    }
                    test(kp, secretKey, cipherPKCS11, cipherJce);
                    test(kp, secretKey, cipherPKCS11, cipherPKCS11);
                    test(kp, secretKey, cipherJce, cipherPKCS11);
                }
            }
        }
    }

    private static void test(KeyPair kp, SecretKey secretKey,
            Cipher wrapCipher, Cipher unwrapCipher)
            throws Exception {
        String algo = secretKey.getAlgorithm();
        wrapCipher.init(Cipher.WRAP_MODE, kp.getPublic());
        byte[] wrappedKey = wrapCipher.wrap(secretKey);
        unwrapCipher.init(Cipher.UNWRAP_MODE, kp.getPrivate());
        Key unwrappedKey =
                unwrapCipher.unwrap(wrappedKey, algo, Cipher.SECRET_KEY);

        System.out.println("Test " + wrapCipher.getProvider().getName() +
                "/" + unwrapCipher.getProvider().getName() + ": ");
        if (!Arrays.equals(secretKey.getEncoded(),
                unwrappedKey.getEncoded())) {
            throw new Exception("Test Failed!");
        }
        System.out.println("Passed");
    }

    public static void main(String[] args) throws Exception {
        main(new TestRSACipherWrap(), args);
    }
}
/*
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this c


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

#pragma once

#include "quantum.h"

#define XXX KC_NO

/* This a shortcut to help you visually see your layout.
 *
 * The first section contains all of the arguments representing the physical
 * layout of the board and position of the keys.
 *
 * The second converts the arguments into a two-dimensional array which
 * represents the switch matrix.
 */
#define LAYOUT( \
    k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
    k10,      k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
    k20,      k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k4D, \
    k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
    k40, k41, k42,                k46,                k4A, k4B, k4C, k4E, k2E \
) { \
    { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
    { k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
    { k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \
    { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
    { k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4A, k4B, k4C, k4D, k4E } \
}


(version) ?? throw new InvalidOperationException($"{nameof(CreateInstance)}() must not return null");
        }

        protected virtual T CreateInstance<T>(double? version) => Activator.CreateInstance<T>();

        /// <inheritdoc cref="ReadBufferable{T}(ByteOrder)"/>
        public T ReadBufferable<T>() where T : IBufferable<T>
            => ReadBufferable<T>(ByteOrder);

        /// <summary>
        /// Reads a bufferable type from the underlying stream and advances the current position of the stream
        /// by the number of bytes specified by the type's implementation of <see cref="IBufferable.SizeOf"/>.
        /// </summary>
        /// <typeparam name="T">The bufferable type to read.</typeparam>
        /// <param name="byteOrder">The byte order to use.</param>
        /// <returns>A new instance of the specified bufferable type.</returns>
        /// <remarks>
        /// Bufferable types are expected to be a contiguous span of bytes containing all data required to instanciate the type.
        /// All relevant properties of the type must be deserialized during <see cref="IBufferable{TBufferable}.ReadFromBuffer(ReadOnlySpan{byte})"/>.
        /// <see cref="OffsetAttribute"/> and other related attributes will be ignored.
        /// </remarks>
        public T ReadBufferable<T>(ByteOrder byteOrder) where T : IBufferable<T>
        {
            var buffer = ReadBytes(T.SizeOf);
            if (T.PackSize > 1 && byteOrder != NativeByteOrder)
                Utils.ReverseEndianness(buffer, T.PackSize);

            return T.ReadFromBuffer(buffer);
        }

        #endregion
    }
}


(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
/*# sourceMappingURL=bootstrap-theme.min.css.map */@charset "UTF-8";

/*!
 * Bootstrap  v5.2.3 (https://getbootstrap.com/)
 * Copyright 2011-2022 The Bootstrap Authors
 * Copyright 2011-2022 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
:root {
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-black: #000;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800


);

          city.name = c.name;
          city.region = c.region;
          city.map = maps.find(m => m.name === c.map);

          return city;
        });

        const promises = cities.map((city) => {
            return getLatLng(city.name)
              .then(({ lat, lng }) => {
                city.lat = lat;
                city.lng = lng;
              })
          });

        await Promise.all(promises);

        await queryRunner.manager.save(cities);

        const connections: Connection[] = [
            ...connectionsItaly.map(c => ({ ...c, map: maps.find(m => m.name === 'Italy') }))
          ].map(c => {
            const connection = new Connection();
            connection.cost = c.cost;
            connection.map = c.map;
            connection.cities = c.cityNames.map(cityName => {
              const city = cities.find(city => city.name === cityName);
              if (!city) {
                console.log("CITY NOT FOUND:", cityName);
              }
              return city;
            });

            return connection;
          });

          await queryRunner.manager.save(connections);
    }

    public async down(queryRunner: QueryRunner): Promise<any> {
    }

}
export type Tree<Board> = {
  node: Node<Board>,
  children: Node<Board>[] | undefined
}

export type Score = number | "win" | "loss" | "draw"

export type Node<Board> = {
  board: Board,
  score: Score | undefined
}

export type NextMoves<Board, Player> = (board: Board, player: Player) => Board[]

export type Scorer<Board, Player> = (board: Board, player: Player) => Score

const scoreToNumber = (s: Score) => {
  switch(s) {
    case "win": return Number.POSITIVE_INFINITY
    case "loss": return Number.NEGATIVE_INFINITY
    case "draw": return 0
    default: return s
  }
}

function maxListBy<A>(xs: A[], f: (a: A) => number): number {
  let maxScore = Number.NEGATIVE_INFINITY
  for(let x of xs) {
    const score = f(x)
    if(score > maxScore) {
      maxScore = score
    }
  }
  return maxScore
}

export function alphaBeta<Board, Player>(
  tree: Tree<Board>,
  player: Player,
  opponent: Player,
  ply: number,
  nextMovesFn: NextMoves<Board, Player>,
  scorer: Scorer<Board, Player>): void {
  if(ply === 0) {
    tree.node.score = scorer(tree.node.board, player)
  } else {
    const children = nextMovesFn(tree.node.board, player).map(board => ({board, score: scorer(board, player)}))
    tree.children = children
    tree.node.score = maxListBy(children, x => scoreToNumber(x.score))
  }
}
import { useMemo } from "react";

import { Coords, Position } from "./index.types";

export default function useLimit(initialPosition: Position | null, currPosition: Position, limit: Coords | null): Position {
  if(!limit) return currPosition;

  let x = (initialPosition ? initialPosition.x : 0);
  let y = (initialPosition ? initialPosition.y : 0);

  const minLeft =


.94 0 01.16-.525c.044.11.15.188.275.188a.3.3 0 00.17-.545Z"/><path d="M15.146 3.5c-5.781 0-10.21 4.902-9.878 10.559v.018l.024.305a4 4 0 00.572 7.454l.203 2.64.001.014C6.413 28.288 9.323 31 13.051 31h5.987c3.617 0 6.637-2.702 6.982-6.51l.002-.023.178-2.65a4.001 4.001 0 00.5-7.438l.02-.307C27.163 8.279 22.599 3.5 16.843 3.5h-1.697Zm-7.8 11.495-.082-1.062c-.262-4.54 3.29-8.433 7.882-8.433h1.697c4.62 0 8.236 3.819 7.883 8.424v.009l-.073 1.07a1 1 0 00.782 1.044 2.001 2.001 0 01-.265 3.946 1 1 0 00-.914.93l-.228 3.398C23.77 27.107 21.603 29 19.038 29H13.05c-2.656 0-4.734-1.885-4.99-4.684l-.26-3.399a1 1 0 00-.933-.921 2 2 0 01-.303-3.949 1 1 0 00.781-1.053Z"/></g></svg>';
  static const String man_beard =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><g fill="currentColor"><path d="M20.458 15.4c1.214 0 2.24.84 2.527 1.967a.512.512 0 01-.503.633h-.8a1.664 1.664 0 00-1.61-2.108 1.65 1.65 0 00-1.658 1.665c0 .157.02.305.06.443h-.149a.428.428 0 01-.424-.504 2.6 2.6 0 012.557-2.096ZM9.015 17.367a2.607 2.607 0 015.085.128.428.428 0 01-.425.505h-.148c.04-.138.059-.286.059-.443 0-.926-.74-1.665-1.659-1.665A1.664 1.664 0 0010.318 18h-.8a.512.512 0 01-.503-.633Z"/><path d="M19.115 17.557a.94.94 0 01.16-.525c.043.11.15.188.274.188a.3.3 0 00.17-.545A.947.947 0 0120.902 18h-1.677a.98.98 0 01-.11-.443Zm-7.188-.946a.947.947 0 01.84 1.389h-1.679a.979.979 0 01-.108-.443c0-.172.046-.334.127-.473a.295.295 0 00.544-.164.301.301 0 00-.105-.229.947.947 0 01.381-.08ZM9.6 13.9l-.637-.765a.995.995 0 001.266 1.537l.003-.003.011-.008c.019-.014.053-.038.102-.07.1-.06.254-.147.458-.228a3.3 3.3 0 011.742-.18.995.995 0 10.31-1.966 5.284 5.284 0 00-2.784.295 4.817 4.817 0 00-.782.393 3.707 3.707 0 00-.289.2l-.022.018-.009.007-.003.003-.002.001s-.001.001.636.766Zm13.336-.765-.63.758.63-.758a.


�命囹圄鬼，旧许金钱未答酬。

鬼值朱雀，为城隍、草野总管天曹华光即五显灵官，广灵侯即南堂陆太君，司令即灶神，并旧欠愿心牢中之鬼。

勾陈值鬼细推详，必犯承天后土皇，跌死伤亡随体现，止苍贤圣降洪殃。

鬼值勾陈，为土皇并五方贤圣，跌死之鬼。

腾蛇妖怪却临门，作犯方隅皇社神，或断腾蛇坟墓土，产亡缢死二灵魂。

鬼值腾蛇为妖怪，并作犯上。

又为腾蛇土当方土地里社之神、及产亡、缢死二鬼。

白虎西台大小伤，金神五道叶神堂，雌雄二煞玄坛将，刀剑伤身虎咬亡。

鬼值白虎，为伤司五道丧煞。

赵玄坛金神即七煞也，叶神即九卓也，并刀伤虎伤之鬼。

玄武采山同圣帝，伏尸坑厕井神台，曹堂杜氏加河太，溺水穿斋二鬼来。

鬼值玄武，为圣帝曹三河太伏尸坑厕土井泉童子、杜氏夫人。

采山即草野三郎、并瀹死窃盗二鬼。

然定六神诸圣位，还须八卦五行排，谁爻临鬼详端的，莫累人间虚费财。

总论星煞值鬼诀之四凡居卦下论阴阳，定兴官爻细审详，上值青龙天喜位，决然花煞有相妨。

凡看神司，须推官鬼，属阳则男伤，属阴则女鬼，看临何星何煞，便知何祟为殃。

鬼值青龙天喜，可言花煞之神，天喜起例，正月从戌上顺行十二位也。

如逢白虎丧门照，卦中值此犯丧殃。

丧门起例：正月戌、二月未、三月辰、四月丑、五月又到戌，只此四位周而复始。

鬼临白虎丧门者，便言丧煞为殃。

天火天烛同朱雀，五显灵官及灶皇。

天火起例，正月子、二月卯、三月午、四月酉，只此四位周而复始。

又天烛煞云：


 also the advanced options)
  -V, --version       display the version number and exit

With no FILE, or when FILE is -, read standard input.

Report bugs to <xz@tukaani.org> (in English or Finnish).
XZ Utils home page: <https://tukaani.org/xz/>

┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ xz -d newflag.out
xz: newflag.out: Filename has an unknown suffix, skipping

┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ mv newflag.out newflag.xz

┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ xz -d newflag.xz
xz: newflag: Cannot set the file permissions: Value too large for defined data type

┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ file newflag
newflag: ASCII text
```

### The encoded flag

And finally we have something that is close to the flag.

Let's see it

```bash
┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ cat newflag
7069636f4354467b66316c656e406d335f6d406e3170756c407431306e5f
6630725f3062326375723137795f37396230316332367d0a
```

It looks like hex-encoded data. We can use Python to decode it.

```bash
┌──(kali㉿kali)-[/picoCTF/picoCTF_2022/Forensics/File_Types]
└─$ python
Python 3.10.9 (main, Dec  7 2022, 13:47:07) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> enc_flag = "7069636f4354467b66316c656e406d335f6d406e3170756c407431306e5f6630725f3062326375723137795f37396230316332367d0a"
>>> bytes.fromhex(enc_flag).decode()
'picoCTF{<REDACTED>}\n'
```

For additional information, please see the references below.

## References

- [ar - Linux manual page](https://man7.org/linux/man-pages/man1/ar.1.html)
- [bzip2 - Linux manual page](https://linux.die.net/man/1/bzip2)
- [cpio - Linux manual page](https://linux.die.net/man/1/cpio)
- [file - Linux manual page](https://man7.org/linux/man-pages/man1/file.1.html)
- [gzip - Linux manual page](https://linux.die.net/man/1/gzip)
- [head - Linux manual page](https://man7.org/linux/man-pages/man1/head.1.html)
- [lzip - Linux manual page](https://linux.die.net/man/1/lzip)
- [lzma - Linux manual page](https://linux.die.net/man/1/lzma)
- [lzop - Linux manual page](https://linux.die.net/man/1/lzop)
- [python - Linux manual page](https://linux.die.net/man/1/python)
- [Python (programming language) - Wikipedia](https://en.wikipedia.org/wiki/Python_(programming_language))
- [xz - Linux manual page](https://linux.die.net/man/1/xz)
# Trivial Flag Transfer Protocol

- [Challenge information](#challenge-information)
- [Solution](#solution)
- [References](#references)

## Challenge information
```
Points: 90
Tags: picoCTF 2021, Forensics


//flutter.dev/to/review-gradle-config.
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig = signingConfigs.getByName("debug")
        }
    }
}

flutter {
    source = "../.."
}
package jr.brian.issaaiapp.viewmodel

import android.content.Context
import androidx.compose.runtime.MutableState
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import jr.brian.issaaiapp.model.repository.Repository
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject
import android.speech.tts.TextToSpeech
import jr.brian.issaaiapp.model.local.ChatsDao
import java.util.*

@HiltViewModel
class MainViewModel @Inject constructor(private val repository: Repository) : ViewModel() {
    private val _response = MutableStateFlow<String?>(null)
    val response = _response.asStateFlow()

    companion object {
        var textToSpeech: TextToSpeech? = null
        var autoSpeak = false
    }

    suspend fun getChatGptResponse(
        context: Context,
        dao: ChatsDao,
        userPrompt: String,
        conversationName: String,
        system: MutableState<String>,
        isAITypingLabelShowing: MutableState<Boolean>
    ) {
        val aiResponse = repository.getChatGptResponse(
            dao = dao,
            userPrompt = userPrompt,
            conversationName = conversationName,
            system = system,
            isAITypingLabelShowing = isAITypingLabelShowing
        )
        _response.emit(aiResponse)
        if (autoSpeak) {
            textToSpeech(context = context, text = aiResponse)
        }
    }

    fun textToSpeech(context: Context, text: String) {
        textToSpeech = TextToSpeech(
            context
        ) {
            if (it == TextToSpeech.SUCCESS) {
                textToSpeech?.let { txtToSpeech ->
                    if (!txtToSpeech.isSpeaking) {
                        txtToSpeech.language = Locale.getDefault()
                        txtToSpeech.setSpeechRate(1.0f)
                        txtToSpeech.stop()
                        txtToSpeech.speak(
                            text,
                            TextToSpeech.QUEUE_ADD,
                            null,
                            null
                        )
                    }
                }
            }
        }
    }

    fun stopSpeech() {
        textToSpeech?.stop()
    }
}/**
 * Created by brian.a.madden@gmail.com on 12/23/16.
 *
 * Copyright (c) <2016> <H, llc>
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE


n it
		class ButtonFilters : RscIGUIShortcutButton
		{
			idc = 148;
			shortcuts[] = {"0x00050000 + 3"};
			x = 0;
			y = 0;
			text = "Filter";
			w = 0;
			h = 0;
		};

		// Cannot be removed due to crash or something is dependend on it
		class ButtonContinue : RscIGUIShortcutButton
		{
			idc = 1;
			shortcuts[] = {"0x00050000 + 0",28,57,156};
			x = 0;
			y = 0;
			default = 1;
			w = 0;
			h = 0;
		};

		class ButtonClose : RscActiveText
		{
			idc = 2;
			style = "0x30 + 0x800";
			text = "\z\addons\dayz_code\gui\gear\gear_ui_close.paa";
			x = 0.919;
			y = 0.039;
			w = 0.051;
			h = 0.057;
			color[] = {1,1,1,0.5};
			colorActive[] = {1,1,1,0.8};
		};

		// Cannot be removed due to crash or something is dependend on it
		class Break_7 : RscLineBreak {};
	};

	class ControlsBackground
	{
		class Mainback : RscPicture
		{
			idc = 1005;
			x = -0.086;
			y = -0.03;
			w = 1.1;
			h = 1.121;
			moving = 0;
			text = "\z\addons\dayz_code\gui\gear\gear_bg.paa";
		};

		class CA_Gear_slot_primary_background : RscPicture
		{
			idc = 1006;
			x = 0.603;
			y = 0.285;
			w = 0.309;
			h = 0.174;
			text = "\z\addons\dayz_code\gui\gear\gear_ui_holding.paa";
		};

		class CA_Gear_slot_secondary_background : RscPicture
		{
			idc = 1007;
			x = 0.603;
			y = 0.104;
			w = 0.309;
			h = 0.174;
			text = "\z\addons\dayz_code\gui\gear\gear_ui_back.paa";
		};

		class CA_Gear_slot_carry_background : RscPicture
		{
			idc = 1008;
			x = 0.603;
			y = 0.468;
			w = 0.309;
			h = 0.174;
			text = "\z\addons\dayz_code\gui\gear\gear_ui_carrying.paa";
		};

		class CA_Gear_slot_handgun_background : RscPicture
		{
			idc = 1009;
			x = 0.465;
			y = 0.663;
			w = 0.133;
			h = 0.177;
			text = "\z\addons\dayz_code\gui\gear\gear_ui_pistol.paa";
		};

		class CA_Gear_slot_special1_background : RscPicture
		{
			idc = 1010;
			x = 0.878;
			y = 0.671;
			w = 0.12;
			h = 0.16;
			colorBackground[] = {0.6,0.54,0.64,0.2};
			colorBackgroundSelected[] = {0.6,0.54,0.64,0.8};
			text = "\z\addons\dayz_code\gui\gear\gear_ui_vision1.paa";
		};

		class CA_Gear_slot_special2_background : RscPicture
		{
			idc = 1011;
			x = 0.878;
			y = 0.861;
			w = 0.12;
			h = 0.16;
			text = "\z\


/*
**
** Copyright 2020 OpenHW Group
**
** Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     https://solderpad.org/licenses/
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
*******************************************************************************
** Debugger Exception code
*******************************************************************************
*/

#include "corev_uvmt.h"

.section .debugger_exception, "ax"
.global _debugger_exception_start
.global glb_debug_status
.global glb_hart_status
.global glb_debug_exception_status
.global glb_expect_debug_exception
//.global _debugger_fail
//.global _debugger_end
.set test_fail, 0x1

_debugger_exception_start


最大字节）。这将使名称服务器开始对DNS响应进行拆分。当CA向受害者.com的名称服务器发送DNS查询以询问受害者.com的TXT记录时，名称服务器会将响应拆分为以下两个数据包：第一个包含查询ID和源端口，这是攻击者不能冒充的；第二个包含响应部分，可被攻击者利用。在DNS验证过程中，攻击者可以不断地向CA发送假冒的响应，希望在CA从名称服务器接收到真正的响应之前，将他们的假冒响应偷偷传给CA。

这样，DNS响应的回答部分（重要部分！）就可以被伪造，而攻击者可以欺骗CA错误地颁发证书。

解决方案

乍一看，人们可能认为证书透明（CT）日志可以公开错误颁发的证书，并让CA可以快速撤销它。然而，CT日志可能需要长达24小时的时间才能写入新颁发的证书，不同的浏览器可能遵循着不同的证书撤销流程。我们需要一种解决方案，使CA能够主动地防止这种攻击，而不是在事后进行处理。

我们很高兴地宣布，Cloudflare为CA提供了一个免费的API，可以利用我们的全球网络从世界各地的多个较好的位置执行DCV。这个API支持DCV进程，可以防止BGP劫持和偏离路径的DNS攻击。

考虑到Cloudflare在全球运行175多个（截止至2019年9月已经有193个）数据中心，我们有着从多个有利位置执行DCV的独特地位。每个数据中心都有到DNS名称服务器或HTTP端点的唯一路径，这意味着成功劫持BGP路由只能影响DCV请求的子集，从而使我们能进一步阻碍BGP劫持。由于我们使用RPKI（资源公共密钥基础架构），因此我们实际上也会签名并验证BGP路由。

此DCV检查器还保护CAs免受偏离路径的DNS欺骗攻击。我们在服务中内置的另一个特性是DNS查询源IP随机化，它有助于防止偏离路径的攻击。通过使攻击者无法预测源IP，用伪造的


0.5) 70%,rgba(225,153,77,0.5) 100%),url(/static/img/footer-textures/medal-copper.png);background-image:-o-linear-gradient(35deg,rgba(111,84,67,0.5) 0%,rgba(238,169,96,0.5) 70%,rgba(225,153,77,0.5) 100%),url(/static/img/footer-textures/medal-copper.png);background-image:-ms-linear-gradient(35deg,rgba(111,84,67,0.5) 0%,rgba(238,169,96,0.5) 70%,rgba(225,153,77,0.5) 100%),url(/static/img/footer-textures/medal-copper.png);background-image:linear-gradient(35deg,rgba(111,84,67,0.5) 0%,rgba(238,169,96,0.5) 70%,rgba(225,153,77,0.5) 100%),url(/static/img/footer-textures/medal-copper.png)}.sticker_themed.hurricane-sandy{background:#807c87 url(/static/img/footer-textures/question.png);-webkit-box-shadow:0 1px 0 #504c57;-moz-box-shadow:0 1px 0 #504c57;box-shadow:0 1px 0 #504c57}.sticker_themed.slowpoke-pumpkin{background:#eba052 url(/static/img/footer-textures/pumpkin-pie.png)}.sticker_themed.slowpoke-ghost{background:#f90 url(/static/img/footer-textures/jack-o-lantern.jpg)}#image_tile.qt_footer_tile .sticker_themed.usa-pin,#image_tile.qt_footer_tile .sticker_themed.usa-hat,#image_tile.qt_footer_tile .sticker_themed.usa-eagle{color:#3F200B;background:#00F;background-image:url(static/img/footer-textures/fake_usa.png);-webkit-box-shadow:0 1px 0 #9e531b;-moz-box-shadow:0 1px 0 #9e531b;box-shadow:0 1px 0 #9e531b;text-shadow:0 1px 0 rgba(255,255,255,0.6)}#image_tile.qt_footer_tile .sticker_themed.usa-pin a,#image_tile.qt_footer_tile .sticker_themed.usa-hat a,#image_tile.qt_footer_tile .sticker_themed.usa-eagle a{color:#00F;text-shadow:1px 1px #fff,1px -1px 0 #fff,-1px 1px 0 #fff,-1px -1px 0 #fff}.extend_dropdown_item,#header ul.user_links>li.avatar .dropdown li>a,#header ul.user_links>li.activity li.loading{display:block;position:relative;padding:0.3em 0.75em;background:#fff;font-size:1.4em;text-align:left}.extend_dropdown_item:hover,#header ul.user_links>li.avatar .dropdown li>a:hover,#header ul.user_links>li.activity li.loading:hover{background:#29abe2;color:#fff;text-decoration:none}#header .placeholder{height:3.8em}#header .placeholder.tall{height:13em}#header .fixed_wrapper{position:fixed;height:0;top:0;left:0;width:100%;z-index:3}#header .top_bar{position:relative;border-bottom:1px solid #999;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.3);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.3);box-shadow:0 1px 3px rgba(0,0,0,0.3);background:#eee;background-image:-moz-linear-gradient(90deg,#eee 0%,#fff 100%);background-image:-webkit


elf:bottom() - self:top()
end

--- @param x number
--- @param y number
function rectangle:expand(x, y)
    self.topLeft.x = math.min(self.topLeft.x, x)
    self.topLeft.y = math.min(self.topLeft.y, y)
    self.bottomRight.x = math.max(self.bottomRight.x, x)
    self.bottomRight.y = math.max(self.bottomRight.y, y)
end

---@param x number
---@param y number
function rectangle:move(x, y)
    self.topLeft.x = self.topLeft.x + x
    self.topLeft.y = self.topLeft.y + y
    self.bottomRight.x = self.bottomRight.x + x
    self.bottomRight.y = self.bottomRight.y + y
end

--- @param x number
--- @param y number
function rectangle:sweep(x, y)
    self:expand(x - self:width(), y - self:height())
    self:expand(x + self:width(), y + self:height())
end

--- @param other slick.geometry.rectangle
--- @return boolean
function rectangle:overlaps(other)
    return self:left() <= other:right() and self:right() >= other:left() and
           self:top() <= other:bottom() and self:bottom() >= other:top()
end

--- @param p slick.geometry.point
--- @param E number?
--- @return boolean
function rectangle:inside(p, E)
    E = E or 0
    return slickmath.withinRange(p.x, self:left(), self:right(), E) and slickmath.withinRange(p.y, self:top(), self:bottom(), E)
end

return rectangle


》、《至乐》诸篇 多属空想和寓言 实有"洗洋自恣"之概 但《逍遥游》所出列子之言和宋荣于底名字 乃后人加入 宋荣子是与苟卿同时底人物 《秋水》所出公孙龙与魏牟底问答 以后屡出"庄子之言"、"庄子曰"底文句 也是后加底 《肤筐》与《知北游》中有"故日"、"故"底文句 或者是从原本《庄子》引出 《吕氏春秋·有始览·去尤篇》"庄子曰 以瓦投者翔"一节与脏子·达生篇》"以瓦注者巧"一节字句稍微不同 大概也是从同一原本引出来底

《庄子》原本在苟子时代虽已存在 但是还没被尊重到与老子平等 当时只说"老关"而不说"老庄" 着极利屡记与惠子对话 想是战国末道家攻击辩者底作品 因而庄子底名渐为世人所尊重 到淮南子时代 老庄底名字便连在一起 雅南子·要略篇》举《道应》底大意说："《道应》者 揽掇遂事之踪 追观往古之迹 察祸福利害之反 考验乎老庄之术 而以合得失之势者也 '《淮南》虽称'优庄" 却多引《庄子》底文句 汉代道家推尊庄子 因他稍后于孟子 便将老子推上与孔子同时 而以老庄与孔孟对称 汉代儒学是继承苟子底礼乐说 但孟子底仁义说亦有相当的势力 故在事实上是苟孟并尊 如《韩诗外传》人中庸》 都是苟孟思想底混合作品

仁义说更受道家底反对 《庄子》底编成最初也与排斥仁义有关 后来才反抗辩者之辩 由一本原书加以润色 其时期 自战国末到汉初 执笔者走不止一人 胜子》底内容不一致底原故就在加人和伪造底部分很多 若以这书为传庄子学说底人们汇集 而冠以"脏子》"底名 那就差不远了 《汉书电文志》所列道家典籍许多是内容不一致而托于一个人底名字底下底 如《管子》便是最显的例 甚至假托古人底名以


he values of the Felix configuration.
type FelixConfigurationSpec struct {
	// UseInternalDataplaneDriver, if true, Felix will use its internal dataplane programming logic.  If false, it
	// will launch an external dataplane driver and communicate with it over protobuf.
	UseInternalDataplaneDriver *bool `json:"useInternalDataplaneDriver,omitempty"`

	// DataplaneDriver filename of the external dataplane driver to use.  Only used if UseInternalDataplaneDriver
	// is set to false.
	DataplaneDriver string `json:"dataplaneDriver,omitempty"`

	// DataplaneWatchdogTimeout is the readiness/liveness timeout used for Felix's (internal) dataplane driver.
	// Deprecated: replaced by the generic HealthTimeoutOverrides.
	DataplaneWatchdogTimeout *metav1.Duration `json:"dataplaneWatchdogTimeout,omitempty" configv1timescale:"seconds"`

	// IPv6Support controls whether Felix enables support for IPv6 (if supported by the in-use dataplane).
	IPv6Support *bool `json:"ipv6Support,omitempty" confignamev1:"Ipv6Support"`

	// RouteRefreshInterval is the period at which Felix re-checks the routes
	// in the dataplane to ensure that no other process has accidentally broken Calico's rules.
	// Set to 0 to disable route refresh. [Default: 90s]
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$`
	RouteRefreshInterval *metav1.Duration `json:"routeRefreshInterval,omitempty" configv1timescale:"seconds"`

	// InterfaceRefreshInterval is the period at which Felix rescans local interfaces to verify their state.
	// The rescan can be disabled by setting the interval to 0.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$`
	InterfaceRefreshInterval *metav1.Duration `json:"interfaceRefreshInterval,omitempty" configv1timescale:"seconds"`

	// IptablesRefreshInterval is the period at which Felix re-checks the IP sets
	// in the dataplane to ensure that no other process has accidentally broken Calico's rules.
	// Set to 0 to disable IP sets refresh. Note: the default for this value is lower than the
	// other refresh intervals as a workaround for a Linux kernel bug that was fixed in kernel
	// version 4.11. If you are using v4.11 or greater you may want to set this to, a higher value
	// to reduce Felix CPU usage. [Default: 10s]
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$`
	IptablesRefreshInterval *metav1.Duration `json:"iptablesRefreshInterval,omitempty" configv1timescale:"seconds"`

	// IptablesPostWriteCheckInterval is the period after Felix has done a write
	// to the dataplane that it schedules an extra read back in order to check the write was not
	// clobbered by another process. This should only occur if another application on the system
	// doesn't respect the iptables lock. [Default: 1s]
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$`
	IptablesPostWriteCheckInterval *metav1.Duration `json:"iptablesPostWriteCheckInterval,omitempty" configv1timescale:"seconds" confignamev1:"IptablesPostWriteCheckIntervalSecs"`

	// IptablesLockFilePath is the location of the iptables lock file. You may need to change this
	// if the lock file is not


.0"
    id("org.jetbrains.kotlin.plugin.serialization") version "1.9.22"
    id("com.github.johnrengelman.shadow") version "7.0.0"
    id("app.cash.sqldelight") version "2.0.2"
}

application.mainClass = "com.endrf.boater.BotKt"
group = "com.endrf"
version = "0.4.0"

val jdaVersion = "5.1.0"

repositories {
    mavenCentral()
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    testImplementation(kotlin("test"))
    implementation("net.dv8tion:JDA:$jdaVersion")
    implementation("dev.arbjerg:lavaplayer:2.2.1")
    implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.14")
    implementation("io.ktor:ktor-server-netty:2.3.12")
    implementation("io.ktor:ktor-server-websockets:2.3.11")
    implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.11")
    implementation("org.reflections:reflections:0.10.2")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1-Beta")
    implementation("com.github.dotenv-org:dotenv-vault-kotlin:0.0.3")
    implementation("net.peanuuutz.tomlkt:tomlkt:0.4.0")
    implementation("app.cash.sqldelight:sqlite-driver:2.0.2")
    implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
}

sqldelight {
    databases {
        create("BoaterData") {
            packageName.set("com.endrf")
        }
    }
}

tasks.test {
    useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "18"
}package com.endrf.boater

import com.endrf.boater.responses.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Suppress("PLUGIN_IS_NOT_ENABLED")
@Serializable
data class MusicApiResponse(
    val provider: String,
    @SerialName("title") val title: String,
    @SerialName("id") val id: String,
    @SerialName("artist") val artist: String,
    @SerialName("artists") val artists: String,
    @SerialName("artistLogo") val artistLogo: String? = null,
    @SerialName("artistURL") val artistURL: String? = null,
    @SerialName("url") val url: String,
    @SerialName("cover") val cover: String,
    @SerialName("durationMs") val durationMs: Int,
    @SerialName("releaseDate") val releaseDate: String? = null,
    @SerialName("isrc") val isrc: String? = null
) {
    companion object {
        fun convertToMusicResponse(spotifyMusicResponse: SpotifyMusicResponse): MusicApiResponse {
            return MusicApiResponse(
                provider = "spotify",
                title = spotifyMusicResponse.title,
                id = spotifyMusicResponse.id,
                artist = spotifyMusicResponse.artist,
                artists = spotifyMusicResponse.artistList,
                artistLogo = spotifyMusicResponse.artistLogo(),
                artistURL = spotifyMusicResponse.artistURL,
                url = spotifyMusicResponse.url,
                cover = spotifyMusicResponse.cover,
                durationMs = spotifyMusicResponse.durationMs,
                releaseDate = spotifyMusicResponse.releaseDate,
                isrc = spotifyMusicResponse.isrc
            )
        }

        fun convertToMusicResponse(appleMusicResponse: AppleMusicResponse): MusicApiResponse {
            return MusicApiResponse(
                provider = "apple",
                title = appleMusicResponse.title,
                id = appleMusicResponse.id,
                artist = appleMusicResponse.artist,
                artists = appleMusicResponse.artistList,
                artistLogo = appleMusicResponse.artistLogo(),
                artistURL = appleMusicResponse.artistURL,


 rect.top;
            i = rect.bottom + i7;
            if (!this.f2374OooO) {
                this.f2381OooO0oO = -i7;
            }
        } else {
            rect.setEmpty();
            i = 0;
        }
        if (o00000o.getInputMethodMode() == 2) {
            z = true;
        } else {
            z = false;
        }
        int OooO00o2 = o00OOO0.OooO00o(o00000o, this.f2387OooOOOO, this.f2381OooO0oO, z);
        int i8 = this.f2378OooO0Oo;
        if (i8 == -1) {
            i3 = OooO00o2 + i;
        } else {
            int i9 = this.f2380OooO0o0;
            if (i9 != -2) {
                if (i9 != -1) {
                    makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(i9, 1073741824);
                } else {
                    makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(context.getResources().getDisplayMetrics().widthPixels - (rect.left + rect.right), 1073741824);
                }
            } else {
                makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(context.getResources().getDisplayMetrics().widthPixels - (rect.left + rect.right), Integer.MIN_VALUE);
            }
            int OooO00o3 = this.f2377OooO0OO.OooO00o(makeMeasureSpec, OooO00o2 + 0);
            if (OooO00o3 > 0) {
                i2 = this.f2377OooO0OO.getPaddingBottom() + this.f2377OooO0OO.getPaddingTop() + i + 0;
            } else {
                i2 = 0;
            }
            i3 = OooO00o3 + i2;
        }
        if (o00000o.getInputMethodMode() == 2) {
            z2 = true;
        } else {
            z2 = false;
        }
        Oooo0.Oooo0.OooO0Oo(o00000o, this.f2382OooO0oo);
        if (o00000o.isShowing()) {
            View view = this.f2387OooOOOO;
            WeakHashMap weakHashMap = OooOooo.o0o0Oo.f1363OooO00o;
            if (!OooOooo.oo0o0O0.OooO0O0(view)) {
                return;
            }
            int i10 = this.f2380OooO0o0;
            if (i10 == -1) {
                i10 = -1;
            } else if (i10 == -2) {
                i10 = this.f2387OooOOOO.getWidth();
            }
            if (i8 == -1) {
                if (z2) {
                    i8 = i3;
                } else {
                    i8 = -1;
                }
                int i11 = this.f2380OooO0o0;
                if (z2) {
                    if (i11 == -1) {
                        i5 = -1;
                    } else {
                        i5 = 0;
                    }
                    o00000o.setWidth(i5);
                    o00000o.setHeight(0);
                } else {
                    if (i11 == -1) {
                        i6 = -1;
                    }
                    o00000o.setWidth(i6);
                    o00000o.setHeight(-1);
                }
            } else if (i8 == -2) {
                i8 = i3;
            }
            o00000o.setOutsideTouchable(true);
            View view2 = this.f2387OooOOOO;
            int i12 = this.f2379OooO0o;
            int i13 = this.f2381OooO0oO


::<Self>(offset);
                let mut x = 0u8;
                x.decode(decoder, offset)?;
                if x == 0 {
                    Ok(())
                } else {
                    Err($crate::Error::Invalid)
                }
            }
        }

        impl $crate::encoding::Autonull for $name {
            #[inline(always)]
            fn naturally_nullable(_context: &$crate::encoding::Context) -> bool {
                false
            }
        }
    };
}

/// Encodes the provided unknown bytes and handles behind a FIDL envelope.
#[doc(hidden)] // only exported for macro use
pub fn encode_unknown_data(
    val: &mut UnknownData,
    encoder: &mut Encoder<'_, '_>,
    offset: usize,
    recursion_depth: usize,
) -> Result<()> {
    match encoder.context.wire_format_version {
        WireFormatVersion::V1 => {
            (val.bytes.len() as u32).encode(encoder, offset, recursion_depth)?;
            (val.handles.len() as u32).encode(encoder, offset + 4, recursion_depth)?;
            ALLOC_PRESENT_U64.clone().encode(encoder, offset + 8, recursion_depth)?;
            Encoder::check_recursion_depth(recursion_depth + 1)?;
            encoder.append_out_of_line_bytes(&val.bytes);
            encoder.append_unknown_handles(&mut val.handles);
        }
        WireFormatVersion::V2 => {
            if val.bytes.len() <= 4 {
                unsafe {
                    std::ptr::copy_nonoverlapping(
                        val.bytes.as_ptr(),
                        encoder.buf.as_mut_ptr().offset(offset as isize),
                        val.bytes.len(),
                    );
                }
                encoder.padding(offset + val.bytes.len(), 4 - val.bytes.len());
                (val.handles.len() as u16).encode(encoder, offset + 4, recursion_depth)?;
                1u16.encode(encoder, offset + 6, recursion_depth)?;
                encoder.append_unknown_handles(&mut val.handles);
            } else {
                (val.bytes.len() as u32).encode(encoder, offset, recursion_depth)?;
                (val.handles.len() as u32).encode(encoder, offset + 4, recursion_depth)?;
                Encoder::check_recursion_depth(recursion_depth + 1)?;
                encoder.append_out_of_line_bytes(&val.bytes);
                encoder.append_unknown_handles(&mut val.handles);
            }
        }
    }
    encoder.set_next_handle_subtype(ObjectType::NONE);
    encoder.set_next_handle_rights(Rights::SAME_RIGHTS);
    Ok(())
}

/// Encodes the provided unknown bytes behind a FIDL envelope.
#[doc(hidden)] // only exported for macro use
pub fn encode_unknown_bytes(
    val: &[u8],
    encoder: &mut Encoder<'_, '_>,
    offset: usize,
    recursion_depth: usize,
) -> Result<()> {
    match encoder.context.wire_format_version {
        WireFormatVersion::V1 => {
            (val.len() as u64).encode(encoder, offset, recursion_depth)?;
            ALLOC_PRESENT_U64.clone().encode(encoder, offset + 8, recursion_depth)?;
            Encoder::check_recursion_depth(recursion_depth + 1)?;
            encoder.append_out_of_line_bytes(val);
        }
        WireFormatVersion::V2 => {
            if val.len() <= 4 {
                unsafe {
                    std::ptr::copy_nonoverlapping(
                        val.as_ptr(),
                        encoder.buf.as_mut_ptr().offset(offset as isize),
                        val.len(),
                    );
                }
                encoder.padding(offset + val.len(), 4 - val.len());
                0u16.encode(encoder, offset + 4, recursion_depth)?;
                1u16.encode(encoder, offset + 6, recursion_depth)?;
            } else {
                (val.len() as u64).encode(encoder, offset, recursio


 formEntryId");
			oql.bind(formContentId);

			QueryResults results = oql.execute();

			while (results.hasMore())
			{
				formEntryList.add(results.next());
			}

			results.close();
			oql.close();
		}
		catch(Exception e)
		{
			throw new SystemException("An error occurred when we tried to fetch a list of form entries. Reason:" + e.getMessage(), e);
		}

		return formEntryList;
	}

	/**
	 * Returns the Repository with the given name fetched within a given transaction.
	 *
	 * @param name
	 * @param db
	 * @return
	 * @throws SystemException
	 * @throws Bug
	 */

	public List<String> getFormEntryValueNames(Integer formContentId, Database db) throws SystemException, Bug
	{
		List<String> formEntryValueNames = new ArrayList<String>();

		try
		{
			OQLQuery oql = db.getOQLQuery("CALL SQL select (select max(fev2.id) from cmFormEntryValue fev2 where fev2.name = fev.name) as id, fev.name as column1Value, '' as column2Value, '' as column3Value, '' as column4Value, '' as column5Value, '' as column6Value, '' as column7Value from cmFormEntry fe, cmFormEntryValue fev where fev.formEntryId = fe.id AND fe.formcontentid = $1 group by fev.name AS org.infoglue.cms.entities.management.GeneralOQLResult");
			oql.bind(formContentId);

			QueryResults results = oql.execute(Database.READONLY);
			while (results.hasMore())
			{
				GeneralOQLResult resultBean = (GeneralOQLResult)results.next();
				formEntryValueNames.add(resultBean.getValue1());
			}

			results.close();
			oql.close();
		}
		catch(Exception e)
		{
			throw new SystemException("An error occurred when we tried to fetch a list of form entries. Reason:" + e.getMessage(), e);
		}

		return formEntryValueNames;
	}

	/**
	 * Returns the Repository with the given name fetched within a given transaction.
	 *
	 * @param name
	 * @param db
	 * @return
	 * @throws SystemException
	 * @throws Bug
	 */

	public Map<Integer, String> getFormEntryNamedValueList(Integer formContentId, String name, Database db) throws SystemException, Bug
	{
		Map<Integer,String> formEntryValueNames = new HashMap<Integer,String>();

		try
		{
			OQLQuery oql = db.getOQLQuery("CALL SQL select fe.id as id, fev.value as column1Value, '' as column2Value, '' as column3Value, '' as column4Value, '' as column5Value, '' as column6Value, '' as column7Value from cmFormEntry fe, cmFormEntryValue fev where fev.formEntryId = fe.id AND fe.formContentId = $1 AND fev.name = $2 AS org.infoglue.cms.entities.management.GeneralOQLResult");
			oql.bind(formContentId);
			oql.bind(name);
			QueryResults results = oql.execute(Database.READONLY);
			while (results.hasMore())
			{
				GeneralOQLResult resultBean = (GeneralOQLResult)results.next();
				formEntryValueNames.put(resultBean.getId(), resultBean.getValue1());
			}

			results.close();
			oql.close();
		}
		catch(Exception e)
		{
			throw new SystemException("An error occurred when we tried to fetch a list of form entries. Reason:" + e.getMessage(), e);
		}

		return formEntryValueNames;
	}

	/**
	 * Returns the Repository with the given name fetched within a given transaction.
	 *
	 * @param name
	 * @param db
	 * @return
	 * @throws SystemException
	 * @throws Bug
	 */

	public Map<Integer,Integer> getFormEntryCountMap(Database db) throws SystemException, Bug
	{
		Map<Integer,Integer> formEntryCountMap = new HashMap<Integer,Integer>();

		try
		{
			OQLQuery oql = db.getOQLQue


# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

import proto  # type: ignore

__protobuf__ = proto.module(
    package="google.ads.googleads.v20.enums",
    marshal="google.ads.googleads.v20",
    manifest={
        "DemandGenChannelStrategyEnum",
    },
)

class DemandGenChannelStrategyEnum(proto.Message):
    r"""Container for the channel strategy enum."""

    class DemandGenChannelStrategy(proto.Enum):
        r"""The channel strategy defines a general grouping of channels
        to enable in the Demand Gen channel controls.

        Values:
            UNSPECIFIED (0):
                Not specified.
            UNKNOWN (1):
                The value is unknown in this version.
            ALL_CHANNELS (2):
                All channels are enabled.
            ALL_OWNED_AND_OPERATED_CHANNELS (3):
                All Google-owned and operated channels are
                enabled; third-party channels (e.g., Display)
                are disabled.
        """

        UNSPECIFIED = 0
        UNKNOWN = 1
        ALL_CHANNELS = 2
        ALL_OWNED_AND_OPERATED_CHANNELS = 3

__all__ = tuple(sorted(__protobuf__.manifest))


0,y=y|0;var w=0,C=0,R=0,L=0;R=_c(40)|0,R||_i(23390,23360,98,23403),g[R>>2]=g[A>>2],g[R+4>>2]=g[A+4>>2],g[R+8>>2]=g[A+8>>2],g[R+12>>2]=g[A+12>>2],C=R+16|0,g[C>>2]=g[y>>2],g[C+4>>2]=g[y+4>>2],g[C+8>>2]=g[y+8>>2],g[C+12>>2]=g[y+12>>2],g[R+32>>2]=0,C=~~(+En(+(+$n(10,+ +(15-(g[m+12>>2]|0)|0))*(+Re[A>>3]+ +Re[A+8>>3])))%+(g[m+4>>2]|0))>>>0,C=(g[m>>2]|0)+(C<<2)|0,w=g[C>>2]|0;do if(!w)g[C>>2]=R;else{for(;!(Ee(w,A)|0&&Ee(w+16|0,y)|0);)if(C=g[w+32>>2]|0,w=C|0?C:w,!(g[w+32>>2]|0)){L=10;break}if((L|0)==10){g[w+32>>2]=R;break}return Mi(R),L=w,L|0}while(0);return L=m+8|0,g[L>>2]=(g[L>>2]|0)+1,L=R,L|0}function hv(m,A,y){m=m|0,A=A|0,y=y|0;var w=0,C=0;if(C=~~(+En(+(+$n(10,+ +(15-(g[m+12>>2]|0)|0))*(+Re[A>>3]+ +Re[A+8>>3])))%+(g[m+4>>2]|0))>>>0,C=g[(g[m>>2]|0)+(C<<2)>>2]|0,!C)return y=0,y|0;if(!y){for(m=C;;){if(Ee(m,A)|0){w=10;break}if(m=g[m+32>>2]|0,!m){m=0,w=10;break}}if((w|0)==10)return m|0}for(m=C;;){if(Ee(m,A)|0&&Ee(m+16|0,y)|0){w=10;break}if(m=g[m+32>>2]|0,!m){m=0,w=10;break}}return(w|0)==10?m|0:0}function nd(m,A){m=m|0,A=A|0;var y=0;if(y=~~(+En(+(+$n(10,+ +(15-(g[m+12>>2]|0)|0))*(+Re[A>>3]+ +Re[A+8>>3])))%+(g[m+4>>2]|0))>>>0,m=g[(g[m>>2]|0)+(y<<2)>>2]|0,!m)return y=0,y|0;for(;;){if(Ee(m,A)|0){A=5;break}if(m=g[m+32>>2]|0,!m){m=0,A=5;break}}return(A|0)==5?m|0:0}function Zg(){return 23424}function sh(m){return m=+m,+ +Kw(+m)}function Zl(m){return m=+m,~~+sh(m)|0}function _c(m){m=m|0;var A=0,y=0,


estamp: timestamp}},
			},
		},
		{
			name: "GetSamplesForPCollectionsWithNoResult",
			samples: []DataSample{
				{PCollectionID: "pid1", Element: []byte("element1"), Timestamp: timestamp},
				{PCollectionID: "pid2", Element: []byte("element2"), Timestamp: timestamp},
			},
			pids: []string{"pid3"},
			want: map[string][]*DataSample{},
		},
		{
			name: "GetSamplesForPCollectionsTooManySamples",
			samples: []DataSample{
				{PCollectionID: "pid1", Element: []byte("element1"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element2"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element3"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element4"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element5"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element6"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element7"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element8"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element9"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element10"), Timestamp: timestamp},
				{PCollectionID: "pid1", Element: []byte("element11"), Timestamp: timestamp},
			},
			pids: []string{"pid1"},
			want: map[string][]*DataSample{
				"pid1": {
					{PCollectionID: "pid1", Element: []byte("element2"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element3"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element4"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element5"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element6"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element7"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element8"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element9"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element10"), Timestamp: timestamp},
					{PCollectionID: "pid1", Element: []byte("element11"), Timestamp: timestamp},
				}},
		},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			ctx := context.Background()
			ctx, cancel := context.WithCancel(ctx)
			dataSampler := NewDataSampler(ctx)
			go dataSampler.Process()
			for _, sample := range test.samples {
				dataSampler.SendSample(sample.PCollectionID, sample.Element, sample.Timestamp)
			}
			var samplesCount = -1
			var samples map[string][]*DataSample
			for i := 0; i < 5; i++ {
				samples = dataSampler.GetSamples(test.pids)
				if len(samples) == len(test.want) {
					samplesCount = len(samples)
					break
				}
				time.Sleep(time.Second)
			}
			cancel()
			if samplesCount != len(test.want) {
				t.Errorf("got an unexpected number of sampled elements: %v, want: %v", samplesCount, len(test.want))
			}
			if !verifySampledElements(samples, test.want) {
				t.Errorf("got an unexpected sampled elements: %v, want: %v", samples, test.want)
			}
		})
	}
}

func verifySampledElements(samples, want map[string][]*DataSample) bool {
	if len(samples) != len(want) {
		return false
	}
	for pid, samples := range samples {
		expected, ok := want[pid]
		if !ok {
			return false


son(restaurante);
        }else {
            res.status(404).send();
        }
    })
})

restauranteRouter.put('/:id', (req, res, next)=>{
    const restaurante = Restaurante.findByIdAndUpdate(req.params.id, req.body,(err:any, restaurante:any)=>{
        if (err){
            res.status(500).json(err);
        }else if (restaurante){
            res.send(restaurante);
        }else {
            res.status(404).send();
        }
    })
});

restauranteRouter.delete('/:id', (req, res, next)=>{
    const restaurante = Restaurante.deleteOne({ _id:req.params.id }, (err:any)=>{
        if (err){
            res.status(500).json();
        }else {
            res.send('Restaurante excluído da base de dados!!!');
        }
    })
})import {Pipe, PipeTransform} from '@angular/core';

@Pipe({name: 'timeNumbers'})
export class TimeNumbersPipe implements PipeTransform {
  transform(n: string) {
    if (n !== undefined && n !== null) {
      let hours = n.split(':')[0]
      let min = n.split(':')[1]
      let result = "";
      if (hours.length === 1) {
        hours = '0' + hours;
      }
      if (min.length === 1) {
        min = '0' + min;
      }
      return  hours + ":" + min;
    } else {
      return "";
    }
  }
}
import { performance } from "perf_hooks";

const measure = (
  target: Object,
  propertyKey: string,
  descriptor: PropertyDescriptor
) => {
  const originalMethod = descriptor.value;

  descriptor.value = function (...args) {
    const start = performance.now();
    const result = originalMethod.apply(this, args);
    const finish = performance.now();
    console.log(`Execution time: ${finish - start} milliseconds`);
    return result;
  };

  return descriptor;
};

class Rocket {
  @measure
  launch() {
    console.log("Launching in 3... 2... 1... 🚀");
  }
}

const rocket = new Rocket();
rocket.launch();
import { ThunkAction } from "redux-thunk";
import { ERRORS } from "../constants/error";
import { oauth, searchTweets as reqSearchTweets } from "../service/twitter";
import { RootState } from "../store/root";
import { Tweet } from "../store/twitter";
import { convertError } from "../util/error";

type TwitterThunkAction = ThunkAction<void, RootState, void, TwitterActions>;

export const STORE_TOKEN = "TWITTER/STORE_TOKEN" as const;
export const STORE_TWEETS = "TWITTER/STORE_TWEETS" as const;

export const ERROR_ACCRUED = "TWITTER/ERROR_ACCRUED" as const;

export const UPDATE_LAST_SEARCH_DATE = "TWITTER/UPDATE_LAST_SEARCH_DATE" as const;

export const storeToken = (token: string) => ({
  type: STORE_TOKEN,
  payload: { token },
});

export const appAuthThunk = (): TwitterThunkAction => {
  return async (dispatch) => {
    const res = await oauth();
    if ("errors" in res) {
      const err = convertError(res.errors[0]);
      dispatch(errorAccrued(err, res.errors[0].message));
    } else {
      dispatch(storeToken(res.token));
    }
  };
};

export const updateLastSearchDate = (date: Date) => ({
  type: UPDATE_LAST_SEARCH_DATE,
  payload: {
    date,
  },
});

export const errorAccrued = (errorCode: ERRORS, message: string) =>


compilations.all {
            kotlinOptions {
                jvmTarget = "1.8"
            }
        }
    }
    androidTarget {
        publishLibraryVariants("release")
    }

    jvm("desktop")

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64(),
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "lib"
            isStatic = true
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(compose.runtime)
                implementation(compose.foundation)
                implementation(compose.material)
                @OptIn(ExperimentalComposeLibrary::class)
                implementation("org.jetbrains.compose.components:components-resources:1.4.0")
                implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5")
            }
        }
        val androidMain by getting {
            dependencies {
            }
        }
        val iosX64Main by getting
        val iosArm64Main by getting
        val iosSimulatorArm64Main by getting
        val iosMain by creating {
            dependsOn(commonMain)
            iosX64Main.dependsOn(this)
            iosArm64Main.dependsOn(this)
            iosSimulatorArm64Main.dependsOn(this)
        }
        val desktopMain by getting {
            dependencies {
            }
        }
    }
}

android {
    compileSdk = (findProperty("android.compileSdk") as String).toInt()
    namespace = "com.myapplication.common"

    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    sourceSets["main"].res.srcDirs("src/androidMain/res")
    sourceSets["main"].resources.srcDirs("src/commonMain/resources")

    defaultConfig {
        minSdk = (findProperty("android.minSdk") as String).toInt()
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

mavenPublishing {
//    publishToMavenCentral(SonatypeHost.DEFAULT)
    // or when publishing to https://s01.oss.sonatype.org
    publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
    signAllPublications()
    coordinates("io.github.rizmaulana", "compose-stacked-snackbar", "1.0.4")

    pom {
        name.set(project.name)
        description.set("Compose stacked snackbar")
        inceptionYear.set("2024")
        url.set("https://github.com/rizmaulana/compose-stacked-snackbar/")
        licenses {
            license {
                name.set("The Apache License, Version 2.0")
                url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
                distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
            }
        }
        developers {
            developer {
                id.set("rizmaulana")
                name.set("Rizki Maulana")
                url.set("https://github.com/rizmaulana/")
            }
        }
        scm {
            url.set("https://github.com/rizmaulana/compose-stacked-snackbar/")
            connection.set("scm:git:git://github.com/rizmaulana/compose-stacked-snackbar.git")
            developerConnection.set("scm:git:ssh://git@github.com/rizmaulana/compose-stacked-snackbar.git")
        }
    }
}
package id.rizmaulana.covid19.util

import androidx.annotation.IntDef

/**
 * rizmaulana@live.com 2019-06-14.
 */
object Constant {
    const val API_