ntry kUnaryEvaluators[] = {
    REGISTER_UNARY_EVALUATOR(FID::kCastInt4, VT::kInt4, VT::kInt2, EvaluateCastInt2Int4),
    REGISTER_UNARY_EVALUATOR(FID::kCastInt8, VT::kInt8, VT::kInt2, EvaluateCastInt2Int8),
    REGISTER_UNARY_EVALUATOR(FID::kCastInt8, VT::kInt8, VT::kInt4, EvaluateCastInt4Int8),
    REGISTER_UNARY_EVALUATOR(FID::kCastFloat8, VT::kFloat8, VT::kFloat4, EvaluateCastFloat4Float8),
    REGISTER_FOR_ALL_TYPES(REGISTER_IS_NULL)};

#undef REGISTER_IS_NOT_NULL
#undef REGISTER_IS_NULL
#undef REGISTER_IS_NULL_EVALUATOR
#undef REGISTER_UNARY_EVALUATOR

bool AreCastsBeforeInvokeAllowed(FunctionID fid) {
  switch (fid) {
    case FID::kLessThan:
    case FID::kLessThanOrEqualTo:
    case FID::kGreaterThan:
    case FID::kGreaterThanOrEqualTo:
    case FID::kNotEqual:
    case FID::kEqual:
      return true;
    default:
      return false;
  }
  return false;
}

}  // namespace

arrow::Result<std::vector<GenericStats>> Registry::CastToSameTypeForComparison(std::vector<GenericStats> args) const {
  std::vector<ValueType> value_types;
  for (const auto& arg : args) {
    value_types.emplace_back(arg.min_max.GetValueType());
  }
  std::set<ValueType> unique_value_types(value_types.begin(), value_types.end());
  if (unique_value_types.size() == 1) {
    return args;
  }

  if (unique_value_types == std::set<ValueType>{VT::kInt2, VT::kInt4}) {
    for (auto& arg : args) {
      if (arg.min_max.GetValueType() == VT::kInt2) {
        ARROW_ASSIGN_OR_RAISE(arg, (EvaluateUnary<VT::kInt4, VT::kInt2, EvaluateCastInt2Int4>(std::move(arg))));
      }
    }
    return args;
  }

  if ((unique_value_types == std::set<ValueType>{VT::kInt2, VT::kInt4, VT::kInt8}) ||
      (unique_value_types == std::set<ValueType>{VT::kInt4, VT::kInt8}) ||
      (unique_value_types == std::set<ValueType>{VT::kInt2, VT::kInt8})) {
    for (auto& arg : args) {
      if (arg.min_max.GetValueType() == VT::kInt2) {
        ARROW_ASSIGN_OR_RAISE(arg, (EvaluateUnary<VT::kInt8, VT::kInt2, EvaluateCastInt2Int8>(std::move(arg))));
      } else if (arg.min_max.GetValueType() == VT::kInt4) {
        ARROW_ASSIGN_OR_RAISE(arg, (EvaluateUnary<VT::kInt8, VT::kInt4, EvaluateCastInt4Int8>(std::move(arg))));
      }
    }
    return args;
  }

  if (unique_value_types == std::set<ValueType>{VT::kFloat4, VT::kFloat8}) {
    for (auto& arg : args) {
      if (arg.min_max.GetValueType() == VT::kFloat4) {
        ARROW_ASSIGN_OR_RAISE(arg, (EvaluateUnary<VT::kFloat8, VT::kFloat4, EvaluateCastFloat4Float8>(std::move(arg))));
      }
    }
    return args;
  }

  // cast all to timestamp
  if (unique_value_types == std::set<ValueType>{VT::kTimestamp, VT::kTimestamptz} ||
      unique_value_types == std::set<ValueType>{VT::kTimestamp


 people in the AddressBook and prints info about them.
void printAddressBook(AddressBook addressBook) {
  for (var person in addressBook.people) {
    print('Person ID: ${person.id}');
    print('  Name: ${person.name}');
    if (person.hasEmail()) {
      print('  E-mail address:${person.email}');
    }

    for (var phoneNumber in person.phones) {
      switch (phoneNumber.type) {
        case Person_PhoneType.MOBILE:
          print('   Mobile phone #: ');
          break;
        case Person_PhoneType.HOME:
          print('   Home phone #: ');
          break;
        case Person_PhoneType.WORK:
          print('   Work phone #: ');
          break;
        default:
          print('   Unknown phone #: ');
          break;
      }
      print(phoneNumber.number);
    }
  }
}

/// Reads the entire address book from a file and prints all
/// the information inside.
void main(List<String> arguments) {
  if (arguments.length != 1) {
    print('Usage: list_person ADDRESS_BOOK_FILE');
    exit(-1);
  }

  // Read the existing address book.
  final file = new File(arguments.first);
  final addressBook = new AddressBook.fromBuffer(file.readAsBytesSync());
  printAddressBook(addressBook);
}
// Mocks generated by Mockito 5.4.4 from annotations
// in wallet/test/mocks/user.manager.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i14;

import 'package:flutter_bloc/flutter_bloc.dart' as _i18;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i13;
import 'package:wallet/constants/env.dart' as _i5;
import 'package:wallet/managers/api.service.manager.dart' as _i7;
import 'package:wallet/managers/manager.dart' as _i16;
import 'package:wallet/managers/preferences/preferences.manager.dart' as _i3;
import 'package:wallet/managers/providers/user.data.provider.dart' as _i8;
import 'package:wallet/managers/secure.storage/secure.storage.manager.dart'
    as _i2;
import 'package:wallet/managers/users/user.key.dart' as _i11;
import 'package:wallet/managers/users/user.manager.dart' as _i12;
import 'package:wallet/managers/users/user.manager.event.dart' as _i17;
import 'package:wallet/managers/users/user.manager.state.dart' as _i9;
import 'package:wallet/models/drift/db/app.database.dart' as _i4;
import 'package:wallet/models/native.session.model.dart' as _i6;
import 'package:wallet/rust/proton_api/auth_credential.dart' as _i15;
import 'package:wallet/rust/proton_api/proton_users.dart' as _i10;

// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

class _FakeSecureStorageManager_0 extends _i1.SmartFake
    implements _


: "E13.1 kiss: woman, woman, dark skin tone, medium skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 200D 1F48B 200D 1F469 1F3FD",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤💋👩🏾": {
			Slug:        "kiss-woman,-woman,-dark-skin-tone,-medium-dark-skin-tone",
			Character:   "👩🏿❤💋👩🏾",
			UnicodeName: "E13.1 kiss: woman, woman, dark skin tone, medium-dark skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 200D 1F48B 200D 1F469 1F3FE",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤💋👩🏿": {
			Slug:        "kiss-woman,-woman,-dark-skin-tone",
			Character:   "👩🏿❤💋👩🏿",
			UnicodeName: "E13.1 kiss: woman, woman, dark skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 200D 1F48B 200D 1F469 1F3FF",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤👨🏻": {
			Slug:        "couple-with-heart-woman,-man,-dark-skin-tone,-light-skin-tone",
			Character:   "👩🏿❤👨🏻",
			UnicodeName: "E13.1 couple with heart: woman, man, dark skin tone, light skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 FE0F 200D 1F468 1F3FB",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤👨🏼": {
			Slug:        "couple-with-heart-woman,-man,-dark-skin-tone,-medium-light-skin-tone",
			Character:   "👩🏿❤👨🏼",
			UnicodeName: "E13.1 couple with heart: woman, man, dark skin tone, medium-light skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 FE0F 200D 1F468 1F3FC",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤👨🏽": {
			Slug:        "couple-with-heart-woman,-man,-dark-skin-tone,-medium-skin-tone",
			Character:   "👩🏿❤👨🏽",
			UnicodeName: "E13.1 couple with heart: woman, man, dark skin tone, medium skin tone",
			CodePoint:   "1F469 1F3FF 200D 2764 FE0F 200D 1F468 1F3FD",
			Group:       "People & Body",
			SubGroup:    "family",
		},

		"👩🏿❤👨🏾": {
			Slug:        "couple-with-heart-woman,-man,-dark-skin-tone,-medium-dark-skin-tone",
			Character:   "👩🏿❤👨🏾",
			UnicodeName: "E13.1 couple with heart: woman


put(serdeId, Optional.ofNullable(sd.getSerdeInfo().getParameters()));
    }

    updateParamTableInBatch("\"SD_PARAMS\"", "\"SD_ID\"", validSdIds, sdParamsOpt);
    updateBucketColsInBatch(idToBucketCols, validSdIds);
    updateSortColsInBatch(idToSortCols, validSdIds);
    updateSkewedInfoInBatch(idToSkewedInfo, validSdIds);
    Map<Long, Long> sdIdToNewCdId = updateCDInBatch(cdIds.stream().toList(), validSdIds, sdIdToCdId, sdIdToNewColumns);
    updateSerdeInBatch(serdeIds, serdeIdToSerde);
    updateParamTableInBatch("\"SERDE_PARAMS\"", "\"SERDE_ID\"", serdeIds, serdeParamsOpt);

    List<Long> cdIdsMayDelete = sdIdToCdId.entrySet().stream()
        .filter(entry -> sdIdToNewCdId.containsKey(entry.getKey()))
        .map(entry -> entry.getValue())
        .collect(Collectors.toList());

    // Update SDS table after CDS to get the freshest CD_ID values.
    sdIdToCdId.replaceAll((sdId, cdId) ->
        sdIdToNewCdId.containsKey(sdId) ? sdIdToNewCdId.get(sdId) : cdId);
    updateSDInBatch(validSdIds, idToSd, sdIdToCdId);

    Set<Long> usedIds = new HashSet<>(Batchable.runBatched(maxBatchSize, cdIdsMayDelete,
        new Batchable<Long, Long>() {
          @Override
          public List<Long> run(List<Long> input) throws Exception {
            String idLists = MetaStoreDirectSql.getIdListForIn(input);
            String queryText = "select DISTINCT \"CD_ID\" from \"SDS\" where \"CD_ID\" in ( " + idLists + ")";
            List<Long> cdIds = new ArrayList<>();
            try (QueryWrapper query = new QueryWrapper(pm.newQuery("javax.jdo.query.SQL", queryText))) {
              List<Object> sqlResult = executeWithArray(query.getInnerQuery(), null, queryText);
              if (sqlResult != null) {
                for (Object cdId : sqlResult) {
                  cdIds.add(MetastoreDirectSqlUtils.extractSqlLong(cdId));
                }
              }
            }
            return cdIds;
          }
    }));
    List<Long> unusedCdIds = cdIdsMayDelete.stream().filter(id -> !usedIds.contains(id)).collect(Collectors.toList());

    deleteCDInBatch(unusedCdIds);
  }

  private void updateSDInBatch(List<Long> ids, Map<Long, StorageDescriptor> idToSd,
                               Map<Long, Long> idToCdId) throws MetaException {
    List<String> columns = Arrays.asList("\"CD_ID\"", "\"INPUT_FORMAT\"", "\"IS_COMPRESSED\"",
        "\"IS_STOREDASSUBDIRECTORIES\"", "\"LOCATION\"", "\"NUM_BUCKETS\"", "\"OUTPUT_FORMAT\"");
    List<String> conditionKeys = Arrays.asList("\"SD_ID\"");
    String stmt = TxnUtils.createUpdatePreparedStmt("\"SDS\"", columns, conditionKeys);
    int maxRows = dbType.getMaxRows(maxBatchSize, 8);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, ids,
        new Batchable<Long, Void>() {
          @Override
          public List<Void> run(List<Long> input) throws SQLException {
            for (Long sdId : input) {
              StorageDescriptor sd = idToSd.get(sdId);
              statement.setLong(1, idToCdId.get(sdId));
              statement.setString(2, sd.getInputFormat());
              statement.setObject(3, dbType.getBoolean(sd.isCompressed()));
              statement.setObject(4, dbType.getBoolean(sd.isStored


tial_left}; "
         f"Angle_Right = {angle_initial_right}")

    # Рисуем текст на изображении
    draw.text(
        (10, image_size - 90),
        "Pythagoras tree | @fil_fc_fractal_bot", font=font, fill='black')
    draw.text(
        (10, image_size - 35),
        numbers_str, font=font_small, fill='black')

    # image.save("pythagoras_tree.png", "PNG")

    # Сохраняем изображение в байтовом потоке
    image_stream = io.BytesIO()
    image.save(image_stream, format='PNG')
    image_stream.seek(0)

    return image_stream

# Запуск бота
if __name__ == '__main__':
    bot.polling(none_stop=True)


></svg>');}.iconoir-number-1-square::before{mask-image:url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4Z" stroke="currentColor"/><path d="M13 16V8L10 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4Z" stroke="currentColor"/><path d="M13 16V8L10 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>');}.iconoir-number-2-square::before{mask-image:url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4Z" stroke="currentColor"/><path d="M9.5 10.8V10.4C9.5 9.07452 10.5332 8 11.8077 8C13.0822 8 14.1154 9.07452 14.1154 10.4C14.1154 10.857 13.9926 11.2841 13.7794 11.6476C12.7289 13.4396 9.5 16 9.5 16H14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4Z" stroke="currentColor"/><path d="M9.5 10.8V10.4C9.5 9.07452 10.5332 8 11.8077 8C13.0822 8 14.1154 9.07452 14.1154 10.4C14.1154 10.857 13.9926 11.2841 13.7794 11.6476C12.7289 13.4396 9.5 16 9.5 16H14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>');}.iconoir-number-3-square::before{mask-image:url('data:image/


tion.IsOSPlatform(OSPlatform.Windows))
            {
                fileName += ".exe";
            }

            var mainModule = Process.GetCurrentProcess().MainModule;
            if (!string.IsNullOrEmpty(mainModule?.FileName)
                && Path.GetFileName(mainModule.FileName).Equals(fileName, StringComparison.OrdinalIgnoreCase))
            {
                return mainModule.FileName;
            }

            //TODO; fix to have a nullable Command and not resure scaffolding's.  Tracked https://github.com/dotnet/Scaffolding/issues/1549
#pragma warning disable CS8603 // Possible null reference return.
            return null;
#pragma warning restore CS8603 // Possible null reference return.
        }
    }
}


quiet {
            LevelFilter::Error
        } else {
            match opt.verbosity {
                0 => LevelFilter::Warn,
                1 => LevelFilter::Info,
                2 => LevelFilter::Debug,
                3 => LevelFilter::Trace,
                _ => unreachable!(),
            }
        },
        simplelog::ConfigBuilder::new()
            .set_time_level(LevelFilter::Off)
            .set_location_level(LevelFilter::Debug)
            .set_target_level(LevelFilter::Off)
            .set_thread_level(LevelFilter::Off)
            .set_level_padding(simplelog::LevelPadding::Left)
            .add_filter_allow("dotter".into())
            .build(),
        simplelog::TerminalMode::Mixed,
    )
    .unwrap();

    trace!("Loaded options: {:#?}", opt);

    if std::env::var("USER").unwrap_or_default() == "root" {
        warn!("It is not recommended to run Dotter as root, since the cache files and all files not marked with an `owner` field will default to being owned by root.
If you're truly logged in as root, it is safe to ignore this message.
Otherwise, run `dotter undeploy` as root, remove cache.toml and cache/ folders, then use Dotter as a regular user.");
    }

    match opt.action.unwrap_or_default() {
        args::Action::Deploy => {
            debug!("Deploying...");
            if deploy::deploy(&opt).context("deploy")? {
                // An error occurred
                return Ok(false);
            }
        }
        args::Action::Undeploy => {
            debug!("Un-Deploying...");
            if deploy::undeploy(opt).context("undeploy")? {
                // An error occurred
                return Ok(false);
            }
        }
        args::Action::Init => {
            debug!("Initializing repo...");
            init::init(opt).context("initalize directory")?;
        }
        args::Action::Watch => {
            debug!("Watching...");
            watch::watch(opt).context("watch repository")?;
        }
    }

    Ok(true)
}
//! Functions for encoding Frames into the RESP3 protocol.
//!
//! <https://github.com/antirez/RESP3/blob/master/spec.md>

use crate::resp3::types::*;
use crate::resp3::utils::{self as resp3_utils};
use crate::types::{RedisProtocolError, RedisProtocolErrorKind, CRLF};
use crate::utils;
use bytes::BytesMut;
use cookie_factory::GenError;

macro_rules! encode_attributes (
  ($x:ident, $attributes:ident) => {
    if let Some(ref attributes) = *$attributes {
      $x = gen_attribute($x, attributes)?;
    }
  }
);

fn gen_simplestring<'a>(
  mut x: (&'a mut [u8], usize),
  data: &str,
  attributes: &Option<Attributes>,
) -> Result<(&'a mut [u8], usize), GenError> {
  encode_attributes!(x, attributes);

  do_gen!(
    x,
    gen_be_u8!(FrameKind::SimpleString.to_byte()) >> gen_slice!(data.as_bytes()) >> gen_slice!(CRLF.as_bytes())
  )
}

fn gen_simpleerror<'a>(
  mut x: (&'a mut [u8], usize),
  data: &str,
  attributes: &Option<Attributes>,
) -> Result<(&'a mut [u8], usize), GenError> {
  encode_attributes!(x, attributes);

  do_gen!(
    x,
    gen_be_u8!(FrameKind::SimpleError.to_byte()) >> gen_slice!(


-- Name: Weapons
-- Description: [Station Tutorial]
--- -------------------
--- -Goes over weapon controls
---
--- [Station Info]
--- -------------------
--- Data:
--- -In the upper-left corner, the Weapons officer's screen displays the ship's energy (max is 1,000), and the strength of its front and rear shields.
---
--- Targeting:
--- -To fire beam weapons and target guided missile weapons, the Weapons officer can select ships on the screen's short-range radar.
---
--- Missiles:
--- -Missiles are one of a ship's most destructive weapons. Before a missile can be fired, the Weapons officer selects it, then selects one of the weapon tubes to load it. Loading and unloading weapon tubes takes time. Mines are also loaded into a special type of weapon tube. Weapon tubes face a specific direction, and some ships only have tubes on certain sides of a ship, making cooperation with the helms officer's maneuvers especially important.
--- -To fire a missile, the Weapons officer presses a loaded missile tube. Except for HVLIs, missiles home in on any target selected by the Weapons officer. Otherwise, the missile is dumb-fired and flies in a straight line from its tube. The Weapons officer can choose to lock the tube's aim onto a target or click the Lock button to the top right of the radar to manually angle a shot.
---
--- Weapon Types:
--- Homing:
--- -A simple, high-speed missile with a small warhead.
--- Nuke:
--- -A powerful homing missile that deals tremendous damage to all ships within 1U of its detonation.
--- Electromagentic Pulse (EMP):
--- -A homing missile that deals powerful damage to the shields of all ships within 1U of detonation, but doesn't damage physical systems or hulls.
--- High-velocity Lead Impactor (HVLI


ExperimentGroup(name, displayName)
    for (preference in experiments) {
        group.addPreference(preference)
    }

    return group
}

private fun experiment(displayName: String, experiment: Preference.Boolean): ExperimentPreference {
    return ExperimentPreference(displayName, experiment)
}

class ExperimentGroup(val name: String, val displayName: String = "Experiment $name") {
    private val _preferences = mutableListOf<ExperimentPreference>()
    val preferences: List<ExperimentPreference> = _preferences

    fun addPreference(preference: ExperimentPreference) {
        _preferences.add(preference)
    }

    val defaultValues: Map<String, Boolean> by lazy { _preferences.associate { it.preference.key to it.preference.default } }

    fun asState(repository: ExperimentRepository): Map<String, ViewModelStatePreference<Boolean, Boolean, Preference.Default<Boolean>>> {
        return _preferences.associate { preference ->
            preference.preference.key to repository.asViewModelState(
                preference.preference
            )
        }
    }

    val hidden: Boolean = false
    fun isVisible(repository: ExperimentRepository): Boolean {
        return !hidden || repository.hasExperiment(defaultValues.keys)
    }
}

data class ExperimentPreference(val displayName: String, val preference: Preference.Boolean)
package fe.linksheet.feature.app.`package`.domain

import android.content.Context
import android.content.pm.verify.domain.DomainVerificationManager
import androidx.annotation.RequiresApi
import androidx.core.content.getSystemService
import fe.composekit.core.AndroidVersion

fun interface DomainVerificationManagerCompat {
    fun getDomainVerificationUserState(packageName: String): VerificationStateCompat?
}

fun DomainVerificationManagerCompat(context: Context): DomainVerificationManagerCompat {
    return when {
        AndroidVersion.isAtLeastApi31S() -> Api31Impl(
            domainVerificationManager = context.getSystemService<DomainVerificationManager>()
        )

        else -> PreApi31Impl
    }
}

private object PreApi31Impl : DomainVerificationManagerCompat {
    override fun getDomainVerificationUserState(packageName: String): VerificationStateCompat? {
        return VerificationUnsupportedState
    }
}

@RequiresApi(31)
private class Api31Impl(private val domainVerificationManager: DomainVerificationManager?) : DomainVerificationManagerCompat {

    override fun getDomainVerificationUserState(packageName: String): VerificationStateCompat? {
        return domainVerificationManager
            ?.getDomainVerificationUserState(packageName)
            ?.takeIf { it.hostToStateMap.isNotEmpty() }
            ?.let {
                VerificationState(it.hostToStateMap, it.isLinkHandlingAllowed)
            }
    }
}
package fe.linksheet.feature.systeminfo.device

object Xiaomi11TPro_A13 : Device(
    codename = "cas",
    fingerprint = "missi_phonenonab_cn-user-13-TKQ1.221114.001-V14.0.2.0.TJJCNXM-release-keys",
    buildProperties = parseTestBuildProperties(
        """
            ####################################
            # from generate-common-build-props
            # These properties identify this partition image.
            ####################################
            ro.product.product.brand=Xiaomi
            ro.product.product.device=missi
            ro.product.product.manufacturer=QUALCOMM
            ro.product.product.model=miproduct
            ro.product.product.cert=
            ro.product.product.name=cas
            ro.product.product.marketname=
            ro.product.build.date=Mon Jun  5 06:17:25 UTC 2023
            ro.product.build.date.utc=1685945845
            ro.product.build.fingerprint=Xiaomi/cas/missi:13/TKQ1.221114.001/V14.0.2.


return true;
    }

    // the full label path, as it is known by Bazel
    private final String fullLabel;

    // the local label path part
    // for //a/b/c, this will be a/b/c
    // for @foo//a/b/c this will be a/b/c
    private final String localLabelPart;

    // if this label points to an external repo, the repository name; otherwise null
    // for @foo//a/b/c this will be foo
    private final String repositoryName;

    /**
     * A BazelLabel instance can be created with any syntactically valid Bazel Label String.
     *

     * Examples:

     * //foo/blah:t1

     * //foo

     * blah/...

     *

     * Throws an IllegalArgumentException is the label string does not parse correctly.
     */
    public BazelLabel(String labelPathStr) {
        BazelLabel.validateLabelPath(labelPathStr, true);

        // does this label refer to an external repo? Ex: @foo//a/b/c:d
        if (labelPathStr.startsWith(BAZEL_EXTERNALREPO_AT)) {
            // also deal with incompatible_unambiguous_label_stringification bazelbuild/bazel#16196 (and bzlmod)
            labelPathStr = labelPathStr.startsWith(BAZEL_CANONICAL_EXTERNALREPO_AT)
                    ? labelPathStr.substring(BAZEL_CANONICAL_EXTERNALREPO_AT.length())
                    : labelPathStr.substring(BAZEL_EXTERNALREPO_AT.length());
            var i = labelPathStr.indexOf(BAZEL_ROOT_SLASHES);
            if (i > 0) {
                repositoryName = labelPathStr.substring(0, i);
                labelPathStr = labelPathStr.substring(i);
            } else {
                repositoryName = null;
            }
        } else {
            repositoryName = null;
        }
        localLabelPart = BazelLabel.makeLabelPathRelative(labelPathStr);
        fullLabel = getFullLabelPath(repositoryName, localLabelPart);
    }

    /**
     * Instantiates a BazelLabel instance with the Bazel package path and the label name specified separately. For
     * example: "a/b/c" and "my-target-name" becomes //a/b/c:my-target-name.
     */
    public BazelLabel(String packagePath, String targetName) {
        this(sanitizePackagePath(packagePath) + BazelLabel.BAZEL_COLON + sanitizeTargetName(targetName));
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (other instanceof BazelLabel o) {
            return fullLabel.equals(o.fullLabel);
        }
        return false;
    }

    /**
     * Returns the repository of this label, null if no repository was specified for this label.
     *
     * @return the repository name, without the leading '@' and trailing "//"
     */
    public String getExternalRepositoryName() {
        return repositoryName;
    }

    // EXTERNAL REPOS

    /**
     * Converts label to a package wildcard path.
     *

     * Example1: //foo/blah -> //foo:blah:*

     * Example2: //foo/blah:bar -> //foo:blah:*
     *
     * @return a new BazelLabel instance, with added package wildcard syntax
     * @throws IllegalStateException
     *             if this is not a package default label
     */
    @Deprecated
    public BazelLabel getLabelAsWildcard() {
        // TODO why do we need this?
        // TODO this shouldnt care about default target
        if (!isDefaultTarget()) {
            throw new IllegalStateException("label " + localLabelPart + " is not package default");
        }
        // TODO all check for :all?
        return getFullLabel(
            repositoryName,
            getPackagePath() + BazelLabel.BAZEL_COLON + Baz


 => setState(() => enableSafeSearch = v),
                      updateSafeSearch: (v) => setState(() => safeSearch = v),
                      updateUseGlobalSettingsServices: (v) => setState(() => useGlobalSettingsServices = v),
                      ignoreClientQueryLog: _ignoreClientQueryLog,
                      ignoreClientStatistics: _ignoreClientStatistics,
                      updateIgnoreClientQueryLog: (v) => setState(() => _ignoreClientQueryLog = v),
                      updateIgnoreClientStatistics: (v) => setState(() => _ignoreClientStatistics = v),
                      enableDnsCache: _enableDnsCache,
                      updateEnableDnsCache: (v) => setState(() => _enableDnsCache = v),
                      dnsCacheField: _dnsCacheField,
                      dnsCacheError: _dnsCacheError,
                      updateDnsCacheError: (v) => setState(() => _dnsCacheError = v),
                      blockedServicesSchedule: _blockedServicesSchedule,
                      setBlockedServicesSchedule: (v) => setState(() => _blockedServicesSchedule = v),
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
      );
    }
  }
}

class _Errors extends StatelessWidget {
  final bool nameValid;
  final bool identifiersValid;
  final bool dnsCacheValid;

  const _Errors({
    required this.nameValid,
    required this.identifiersValid,
    required this.dnsCacheValid,
  });

  @override
  Widget build(BuildContext context) {
    return Card(
      elevation: 0,
      color: Colors.red.withOpacity(0.2),
      margin: const EdgeInsets.all(16),
      child: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              AppLocalizations.of(context)!.errors,
              style: const TextStyle(
                fontSize: 18
              ),
            ),
            const SizedBox(height: 8),
            if (!nameValid) Text(
              "● ${AppLocalizations.of(context)!.nameInvalid}",
              style: const TextStyle(
                fontSize: 14
              ),
            ),
            if (!identifiersValid) Text(
              "● ${AppLocalizations.of(context)!.oneIdentifierRequired}",
              style: const TextStyle(
                fontSize: 14
              ),
            ),
            if (!dnsCacheValid) Text(
              "● ${AppLocalizations.of(context)!.dnsCacheNumber}",
              style: const TextStyle(


constrain();
        btn.make_interrupt_source(&mut sys_cfg);
        btn.enable_interrupt(&mut ctx.device.EXTI);
        btn.trigger_on_edge(&mut ctx.device.EXTI, Edge::Falling);

        ctx.core.DCB.enable_trace();
        ctx.core.DWT.enable_cycle_counter();
        let mono = DwtSystick::new(
            &mut ctx.core.DCB,
            ctx.core.DWT,
            ctx.core.SYST,
            clocks.hclk().0,
        );

        defmt::info!("Tap the button!");
        blink::spawn().ok();
        (
            Shared {
                btn,
                pressed: None,
                ms: 500.millis(),
            },
            Local { led },
            init::Monotonics(mono),
        )
    }

    #[idle]
    fn idle(_: idle::Context) -> ! {
        loop {}
    }

    #[task(binds = EXTI15_10, shared = [btn])]
    fn on_exti(mut ctx: on_exti::Context) {
        ctx.shared.btn.lock(|b| b.clear_interrupt_pending_bit());
        debounce::spawn_after(30.millis()).ok();
    }

    #[task(shared = [btn, ms, pressed], local = [clear: Option<clear::SpawnHandle> = None])]
    fn debounce(ctx: debounce::Context) {
        if let Some(handle) = ctx.local.clear.take() {
            handle.cancel().ok();
        }
        (ctx.shared.btn, ctx.shared.pressed, ctx.shared.ms).lock(|btn, pressed, ms| {
            if btn.is_low() {
                if let Some(instant) = pressed.take() {
                    *ms = (monotonics::now() - instant).convert();
                    defmt::info!("{:?} bpm", 60_000 / (*ms).ticks());
                }
                pressed.replace(monotonics::now());
            }
        });
        *ctx.local.clear = clear::spawn_after(2_000.millis()).ok();
    }

    #[task(shared = [pressed])]
    fn clear(mut ctx: clear::Context) {
        ctx.shared.pressed.lock(|i| i.take());
    }

    #[task(shared = [ms], local = [led])]
    fn blink(mut ctx: blink::Context) {
        blink::spawn_after(ctx.shared.ms.lock(|t| *t).convert()).ok();
        ctx.local.led.set_high();
        cortex_m::asm::delay(FREQ / 100);
        ctx.local.led.set_low();
    }
}
<reponame>HPIPS/HPIPS_Chain
// Copyright 2017-2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.

// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Substrate 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 Substrate.  If not, see <http://www.gnu.org/licenses/>.

//! Generic implementation of an unchecked (pre-verification) extrinsic.

#[cfg(feature = "std")]
use std::fmt;

use rstd::prelude::*;
use runtime_io::blake2_256;
use crate::codec::{Decode, Encode, Input, Error};
use crate::traits::{self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic};
use super::CheckedExtrinsic;

const TRANSACTION_VERSION: u8


iel de Lukas Marx
Lien : https://malcoded.com/posts/angular-color-picker/
*/
import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Output, ViewChild } from '@angular/core';

const COLORSTOP1 = 0.17;
const COLORSTOP2 = 0.34;
const COLORSTOP3 = 0.51;
const COLORSTOP4 = 0.68;
const COLORSTOP5 = 0.85;
const LINEWIDTH1 = 5;
const LINEWIDTH2 = 10;
@Component({
    selector: 'app-color-slider',
    templateUrl: './color-slider.component.html',
    styleUrls: ['./color-slider.component.scss'],
})
export class ColorSliderComponent implements AfterViewInit {
    @ViewChild('canvas', { static: false })
    canvas: ElementRef<HTMLCanvasElement>;

    @Output()
    color: EventEmitter<string> = new EventEmitter();

    mouseDown: boolean = false;
    private ctx: CanvasRenderingContext2D;
    private selectedHeight: number;

    ngAfterViewInit(): void {
        this.draw();
    }

    @HostListener('window:mouseup', ['$event'])
    onMouseUp(evt: MouseEvent): void {
        this.mouseDown = false;
    }

    draw(): void {
        if (!this.ctx) {
            this.ctx = this.canvas.nativeElement.getContext('2d') as CanvasRenderingContext2D;
        }
        const width = this.canvas.nativeElement.width;
        const height = this.canvas.nativeElement.height;
        this.ctx.clearRect(0, 0, width, height);
        const gradient = this.ctx.createLinearGradient(0, 0, 0, height);
        gradient.addColorStop(0, 'rgba(255, 0, 0, 1)');
        gradient.addColorStop(COLORSTOP1, 'rgba(255, 255, 0, 1)');
        gradient.addColorStop(COLORSTOP2, 'rgba(0, 255, 0, 1)');
        gradient.addColorStop(COLORSTOP3, 'rgba(0, 255, 255, 1)');
        gradient.addColorStop(COLORSTOP4, 'rgba(0, 0, 255, 1)');
        gradient.addColorStop(COLORSTOP5, 'rgba(255, 0, 255, 1)');
        gradient.addColorStop(1, 'rgba(255, 0, 0, 1)');
        this.ctx.beginPath();
        this.ctx.rect(0, 0, width, height);
        this.ctx.fillStyle = gradient;
        this.ctx.fill();
        this.ctx.closePath();
        if (this.selectedHeight) {
            this.ctx.beginPath();
            this.ctx.strokeStyle = 'white';
            this.ctx.lineWidth = LINEWIDTH1;
            this.ctx.rect(0, this.selectedHeight - LINEWIDTH1, width, LINEWIDTH2);
            this.ctx.stroke();
            this.ctx.closePath();
        }
    }

    onMouseDown(evt: MouseEvent): void {
        this.mouseDown = true;
        this.selectedHeight = evt.offsetY;
        this.draw();
        this.emitColor(evt.offsetX, evt.offsetY);
    }

    onMouseMove(evt: MouseEvent): void {
        if (this.mouseDown) {
            this.selectedHeight = evt.offsetY;
            this.draw();
            this.emitColor(evt.offsetX, evt.offsetY);
        }
    }

    emitColor(x: number, y: number): void {
        const hexColor = this.getColorAtPosition(x, y);
        this.color.emit(hexColor);
    }

    getColorAtPosition(x: number, y: number): string {
        const imageData = this.ctx.getImageData(x, y, 1, 1).data;
        return this.RGBToHex(imageData[0], imageData[1], imageData[2]);
    }

    RGBToHex(r: number, g: number, b: number): string {
        let red =


369
IEZvckNhbkJlQ29udmVydGVkVG9G 80370
IEZvckNhbkJlQ29udmVydGVkVG9Gb3JlYWNo 80371
IEFhZA== 80372
IGFpcnN0cmlrZXM= 80373
aXNPaw== 80374
IGZlZGVyYXRpb24= 80375
IExhYnJhZG9y 80376
X2xhdW5jaGVy 80377
YWxvZ3k= 80378
Pj4oKTsKCg== 80379
IEp1Yg== 80380
dXRy 80381
aXN0aW5ndWlzaGVk 80382
YWJhbnQ= 80383
UmVnaW9ucw== 80384
L2hlbHBlcg== 80385
X2xpc3Rlbg== 80386
CVRvYXN0 80387
IEZpbGVNYW5hZ2Vy 80388
aXRvcmlz 80389
IGVsZWN0cm9kZXM= 80390
R1JBREU= 80391
IGJlZ2dlZA== 80392
IFBsYXRlcw== 80393
YWZvbmU= 80394
ISEhCg== 80395
IGVieA== 80396
IGRlZmF1bHRQcm9wcw== 80397
IGNvbXBhcmVUbw== 80398
IFNDQw== 80399
LmV4dGVudA== 80400
YXV0b3M= 80401
IOyW 80402
IFRvbGtpZW4= 80403
OjoqOwoK 80404
Kics 80405
LmRvY3VtZW50cw== 80406
c2luZw== 80407
PUJpdENvbnZlcnRlcg== 80408
IEtyaXNobmE= 80409
IHBsYWlzaXI= 80410
IGJ1Z2d5 80411
IHJlZ3VsYXRlcw== 80412
IGZyaWRheQ== 80413
IGNvbXBsZXRlbmVzcw== 80414
IGF1ZGlibGU= 80415
IFJlY29nbml0aW9uRXhjZXB0aW9u 80416
IHNoZWRkaW5n 80417
W10pewo= 80418
KGJhbGw= 80419
IENoYXRDb2xvcg== 80420
KENvZGU= 80421
KCksCgo= 80422
IHRlcnRpYXJ5 80423
IFNJREU= 80424
KEpTT05PYmplY3Q= 80425
pOaWrQ== 80426
UmVtYXJrcw== 80427
IGxpc3RCb3g= 80428
LmltYWdlVXJs 80429
IGRlbGF5aW5n 80430
IHNvY2lvZWNvbm9taWM= 80431
Lmxw 80432
PE15 80433
Lm9uU3RhcnQ= 80434
IFNjb3I= 80435
Ynl0ZXJpYW4= 80436
LXJvY2s= 80437
X21ldGVy 80438
IHJlcG1hdA== 80439
IHByZWd1bnRh 80440
IE1FVEE= 80441
KGd0 80442
IEZSSUVORA== 80443
IHNvcnRl 80444
IGhlcA== 80445
b25vbWllcw== 80446
IGF1dG9tw6F0 80447
IEZvcm1hdHM= 80448
c3RhdGVQcm92aWRlcg== 80449
LWZsb29y 80450
X01VWA== 80451
KENvbnRlbnQ= 804


グルユメモノガタリ.md)[メグリメグルユメモノガタリ](./メグリメグルユメモノガタリ.md)首发日期：2011-05-08 （第八回 博麗神社例大祭 (未找到链接)）EP （一般向）[](./カワリガワルナミモヨウ.md)[カワリガワルナミモヨウ](./カワリガワルナミモヨウ.md)首发日期：2011-10-16 （東方紅楼夢7 (未找到链接)）EP （一般向）Upright Telecast プチ合同 封面图片 (未找到链接)[Upright Telecast プチ合同](./Upright_Telecast_プチ合同.md)首发日期：2012-03-17 （Upright Telecast 1 (未找到链接)）EP、合作 （一般向）[](./シズミシズムイシノソコ.md)[シズミシズムイシノソコ](./シズミシズムイシノソコ.md)首发日期：2012-07-08 （アンダーグラウンドカーニバル1 (未找到链接)）EP （一般向）[](./ヒメイロタイムライン.md)[ヒメイロタイムライン](./ヒメイロタイムライン.md)首发日期：2012-09-09 （境界から視えた外界 -廻- (未找到链接)）NHS-A-0001全长 （一般向）[境界から視えた外界-廻-会場限定おまけCD](./境界から視えた外界-廻-会場限定おまけCD.md)首发日期：2012-09-09 （境界から視えた外界 -廻- (未找到链接)）Omake （一般向）[](./ヒカリヒカルハスモヨウ.md)[ヒカリヒカルハスモヨウ](./ヒカリヒカルハスモヨウ.md)首发日期：2012-10-07 （東方紅楼夢8 (未找到链接)）EP （一般向）[](./777_bloomeeting_casino（同人专辑）.md)[777 bloomeeting casino](./777_bloomeeting_casino（同人专辑）.md)首发日期：2012-11-17 （777 bloomeeting casino 1 (未找到链接)）全长 （一般向）[](./トキイロティアレイン.md)[トキイロティアレイン](./トキイロティアレイン.md)首发日期：2013-05-26 （第十回 博麗神社例大祭 (未找到链接)）NHS-A-0002全长 （一般向）[](./カゲリカゲルツキアカリ.md)[カゲリカゲルツキアカリ](./カゲリカゲルツキアカリ.md)首发日期：2013-10-13 （東方紅楼夢9 (未找到链接)）EP （一般向）[](./ツムギツムグフタリタビ.md)[ツムギツムグフタリタビ](./ツムギツムグフタリタビ.md)首发日期：2013-11-03 （科学世紀のカフェテラス（第3回） (未找到链接)）EP （一般向）[](./微の花_睡の星.md)[微の花　睡の星](./微の花_睡の星.md)首发日期：2014-05-11 （第十一回 博麗神社例大祭 (未找到链接)）合作、EP （一般向）该作品是与 [天�


ac[cb]:sub(1,bb-2)..ac[cb]:sub(bb,ac[cb]:len())
_c[cb]=_c[cb]:sub(1,bb-2).._c[cb]:sub(bb,_c[cb]:len())if(bb>1)then bb=bb-1 end
if(ab>1)then if(bb<ab)then ab=ab-1 end end end;if(cb<_b)then _b=_b-1 end;_d(cd)cd:setValue("")end
if(__a==keys.delete)then
if(bb>db[cb]:len())then
if(db[cb+1]~=nil)then db[cb]=db[cb]..
db[cb+1]table.remove(db,cb+1)
table.remove(_c,cb+1)table.remove(ac,cb+1)end else
db[cb]=db[cb]:sub(1,bb-1)..db[cb]:sub(bb+1,db[cb]:len())
ac[cb]=ac[cb]:sub(1,bb-1)..ac[cb]:sub(bb+1,ac[cb]:len())
_c[cb]=_c[cb]:sub(1,bb-1).._c[cb]:sub(bb+1,_c[cb]:len())end;_d(cd)end
if(__a==keys.enter)then
table.insert(db,cb+1,db[cb]:sub(bb,db[cb]:len()))
table.insert(ac,cb+1,ac[cb]:sub(bb,ac[cb]:len()))
table.insert(_c,cb+1,_c[cb]:sub(bb,_c[cb]:len()))db[cb]=db[cb]:sub(1,bb-1)
ac[cb]=ac[cb]:sub(1,bb-1)_c[cb]=_c[cb]:sub(1,bb-1)cb=cb+1;bb=1;ab=1;if(cb-_b>=d_a)then
_b=_b+1 end;cd:setValue("")end
if(__a==keys.up)then
if(cb>1)then cb=cb-1;if(bb>db[cb]:len()+1)then bb=
db[cb]:len()+1 end;if(ab>1)then if(bb<ab)then ab=bb-c_a+1;if(ab<1)then
ab=1 end end end;if(_b>1)then if(
cb<_b)then _b=_b-1 end end end end
if(__a==keys.down)then if(cb<#db)then cb=cb+1;if(bb>db[cb]:len()+1)then bb=
db[cb]:len()+1 end
if(cb>=_b+d_a)then _b=_b+1 end end end
if(__a==keys.right)then bb=bb+1;if(cb<#db)then if(bb>db[cb]:len()+1)then bb=1
cb=cb+1 end elseif(bb>db[cb]:len())then
bb=db[cb]:len()+1 end;if(bb<1)then bb=1 end;if
(bb<ab)or(bb>=c_a+ab)then ab=bb-c_a+1 end
if(ab<1)then ab=1 end end
if(__a==keys.left)then bb=bb-1;if(bb>=1)then
if(bb<ab)or(bb>=c_a+ab)then ab=bb end end
if(cb>1)then if(bb<1)then cb=cb-1
bb=db[cb]:len()+1;ab=bb-c_a+1 end end;if(bb<1)then bb=1 end;if(ab<1)then ab=1 end end end
if(dd=="char")then db[cb]=db[cb]:sub(1,bb-1)..__a..
db[cb]:sub(bb,db[cb]:len())ac[cb]=ac[cb]:sub(1,
bb-1)..
_a[cd.fgColor]..ac[cb]:sub(bb,ac[cb]:len())_c[cb]=_c[cb]:sub(1,
bb-1)..


 FollowRequestsNotifierRef
    on AutoDisposeStreamNotifierProviderRef<PaginationState<FollowRequest>> {
  /// The parameter `account` of this provider.
  Account get account;
}

class _FollowRequestsNotifierProviderElement
    extends
        AutoDisposeStreamNotifierProviderElement<
          FollowRequestsNotifier,
          PaginationState<FollowRequest>
        >
    with FollowRequestsNotifierRef {
  _FollowRequestsNotifierProviderElement(super.provider);

  @override
  Account get account => (origin as FollowRequestsNotifierProvider).account;
}

// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'announcements_notifier_provider.dart';

// **************************************************************************
// RiverpodGenerator
// **************************************************************************

String _$announcementsNotifierHash() =>
    r'8e24f5f4cfd7a8e9e681b8a0930bd9275892b8b7';

/// Copied from Dart SDK
class _SystemHash {
  _SystemHash._();

  static int combine(int hash, int value) {
    // ignore: parameter_assignments
    hash = 0x1fffffff & (hash + value);
    // ignore: parameter_assignments
    hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
    return hash ^ (hash >> 6);
  }

  static int finish(int hash) {
    // ignore: parameter_assignments
    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
    // ignore: parameter_assignments
    hash = hash ^ (hash >> 11);
    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
  }
}

abstract class _$AnnouncementsNotifier
    extends
        BuildlessAutoDisposeStreamNotifier<
          PaginationState<AnnouncementsResponse>
        > {
  late final Account account;
  late final bool isActive;

  Stream<PaginationState<AnnouncementsResponse>> build(
    Account account, {
    bool isActive = true,
  });
}

/// See also [AnnouncementsNotifier].
@ProviderFor(AnnouncementsNotifier)
const announcementsNotifierProvider = AnnouncementsNotifierFamily();

/// See also [AnnouncementsNotifier].
class AnnouncementsNotifierFamily
    extends Family<AsyncValue<PaginationState<AnnouncementsResponse>>> {
  /// See also [AnnouncementsNotifier].
  const AnnouncementsNotifierFamily();

  /// See also [AnnouncementsNotifier].
  AnnouncementsNotifierProvider call(Account account, {bool isActive = true}) {
    return AnnouncementsNotifierProvider(account, isActive: isActive);
  }

  @override
  AnnouncementsNotifierProvider getProviderOverride(
    covariant AnnouncementsNotifierProvider provider,
  ) {
    return call(provider.account, isActive: provider.isActive);
  }

  static const Iterable<ProviderOrFamily>? _dependencies = null;

  @override
  Iterable<ProviderOrFamily>? get dependencies => _dependencies;

  static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;

  @override
  Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
      _allTransitiveDependencies;

  @override
  String? get name => r'announcementsNotifierProvider';
}

/// See also [AnnouncementsNotifier].
class AnnouncementsNotifierProvider
    extends
        AutoDisposeStreamNotifierProviderImpl<
          AnnouncementsNotifier,
          PaginationState<AnnouncementsResponse>
        > {
  /// See also [AnnouncementsNotifier].
  AnnouncementsNotifierProvider(Account account, {bool isActive = true})
    : this._internal(
        () => AnnouncementsNotifier()
          ..account = account
          ..isActive = isActive,
        from:


attr(app, "settings", None), "scene_width", screen.width))
        except Exception:
            scene_w = screen.width
        self.x = -64 if self.dir > 0 else scene_w - 2
        self._frame_idx = 0
        self._frame_t = 0.0
        self._frame_dt = 0.25
        self._active = True

    @property
    def active(self) -> bool:  # type: ignore[override]
        return self._active

    def update(self, dt: float, screen: "ScreenProtocol", app: "AsciiQuariumProtocol") -> None:
        self.x += self.speed * dt
        self._frame_t += dt
        if self._frame_t >= self._frame_dt:
            self._frame_t = 0.0
            self._frame_idx = (self._frame_idx + 1) % 4
        try:
            scene_w = int(getattr(getattr(app, "settings", None), "scene_width", screen.width))
        except Exception:
            scene_w = screen.width
        if (self.dir > 0 and self.x > scene_w) or (self.dir < 0 and self.x < -self._w_left):
            self._active = False

    def draw(self, screen: "ScreenProtocol", mono: bool = False) -> None:
        if self.dir > 0:
            img = self.frames_right[self._frame_idx]
            msk = self.masks_right[self._frame_idx]
        else:
            img = self.frames_left[self._frame_idx]
            msk = self.masks_left[self._frame_idx]
        if mono:
            draw_sprite(screen, img, int(self.x), int(self.y), Screen.COLOUR_WHITE)
        else:
            draw_sprite_masked(screen, img, msk, int(self.x), int(self.y), Screen.COLOUR_GREEN)

def spawn_monster(screen: "ScreenProtocol", app: "AsciiQuariumProtocol"):
    return [Monster(screen, app)]


'

jest.mock('./models', () => ({
  getMatchmakingSeasons: jest.fn(),
  addMatchmakingSeason: jest.fn(),
  deleteMatchmakingSeason: jest.fn(),
}))

const getMatchmakingSeasonsMock = asMockedFunction(getMatchmakingSeasons)
const addMatchmakingSeasonMock = asMockedFunction(addMatchmakingSeason)
const deleteMatchmakingSeasonMock = asMockedFunction(deleteMatchmakingSeason)

const STARTING_SEASONS: ReadonlyArray<MatchmakingSeason> = [
  {
    id: makeSeasonId(3),
    startDate: new Date('2023-01-01'),
    name: 'Cooler Season',
    resetMmr: false,
  },
  {
    id: makeSeasonId(2),
    startDate: new Date('2022-06-01'),
    name: 'Cool Season',
    resetMmr: true,
  },
  {
    id: makeSeasonId(1),
    startDate: new Date('2012-01-01'),
    name: 'Beta Season',
    resetMmr: true,
  },
]

describe('matchmaking/matchmaking-seasons', () => {
  let clock: FakeClock
  let service: MatchmakingSeasonsService

  beforeEach(() => {
    clock = new FakeClock()
    clock.setCurrentTime(Number(new Date('2022-05-13T16:18:00')))
    service = new MatchmakingSeasonsService(clock)

    let mockDbState = Array.from(STARTING_SEASONS)
    getMatchmakingSeasonsMock.mockClear()
    getMatchmakingSeasonsMock.mockImplementation(() => Promise.resolve(Array.from(mockDbState)))

    addMatchmakingSeasonMock.mockClear()
    addMatchmakingSeasonMock.mockImplementation(season => {
      // This isn't totally correct but should work fine given what we actually want to test
      const nextId = (mockDbState[0].id ?? 0) + 1
      const createdSeason = { ...season, id: makeSeasonId(nextId) }
      mockDbState = [createdSeason, ...mockDbState].sort(
        (a, b) => Number(b.startDate) - Number(a.startDate),
      )
      return Promise.resolve(createdSeason)
    })

    deleteMatchmakingSeasonMock.mockClear()
    deleteMatchmakingSeasonMock.mockImplementation(id => {
      mockDbState = mockDbState.filter(s => s.id !== id)
      return Promise.resolve()
    })
  })

  test('should retrieve all seasons', async () => {
    const seasons = await service.getAllSeasons()
    expect(seasons).toHaveLength(3)
    expect(seasons[0].id).toBe(3)
    expect(seasons[0].startDate).toEqual(new Date('2023-01-01'))
  })

  test('should retrieve the right season for a given date', async () => {
    let season = await service.getSeasonForDate(new Date('2022-05-01T00:00:00'))
    expect(season.id).toBe(1)

    season = await service.getSeasonForDate(new Date('2022-06-02T00:00:00'))
    expect(season.id).toBe(2)
  })

  test('should retrieve the right season for the current date', async () => {
    let season = await service.getCurrentSeason()
    expect(season.id).toBe(1)

    clock.setCurrentTime(Number(new Date('2022-06-02T00:00:00')))
    season = await service.getCurrentSeason()
    expect(season.id).toBe(2)

    clock.setCurrentTime(Number(new Date('2025-06-02T00:00:00')))
    season = await service.getCurrentSeason()
    expect(season.id).toBe(3)
  })

  test('should allow adding a new season', async () => {
    const createdSeason = await service.addSeason({
      startDate: new Date('2025-01-01'),


c.String())
					s.WriteString("; ")
				}
				dbg.printLine(terminal.StyleFeedback, "command on halt: %s", strings.TrimSuffix(s.String(), "; "))
			}
			return nil
		}

		var input string

		option, _ := tokens.Get()
		switch strings.ToUpper(option) {
		case "OFF":
			dbg.commandOnHalt = dbg.commandOnHalt[:0]
			dbg.printLine(terminal.StyleFeedback, "no command on halt")
			return nil

		case "ON":
			dbg.commandOnHalt = dbg.commandOnHaltStored
			for _, c := range dbg.commandOnHalt {
				dbg.printLine(terminal.StyleFeedback, "auto-command on halt: %s", c)
			}
			return nil

		default:
			// token isn't one we recognise so push it back onto the token queue
			tokens.Unget()

			// use remaininder of command line to form the ONHALT command sequence
			input = strings.TrimSpace(tokens.Remainder())
			tokens.End()
		}

		// empty list of tokens. taking note of existing command - not the same
		// as commandOnHaltStored because ONHALT might be OFF
		existingOnHalt := dbg.commandOnHalt
		dbg.commandOnHalt = dbg.commandOnHalt[:0]

		// tokenise commands to check for integrity
		for _, s := range strings.Split(input, ",") {
			toks, err := dbg.tokeniseCommand(s, false, false)
			if err != nil {
				dbg.commandOnHalt = existingOnHalt
				return err
			}
			dbg.commandOnHalt = append(dbg.commandOnHalt, toks)
		}

		// make a copy of
		dbg.commandOnHaltStored = dbg.commandOnHalt

		// display the new ONHALT command(s)
		s := strings.Builder{}
		for _, c := range dbg.commandOnHalt {
			s.WriteString(c.String())
			s.WriteString("; ")
		}
		dbg.printLine(terminal.StyleFeedback, "command on halt: %s", strings.TrimSuffix(s.String(), "; "))

		return nil

	case cmdOnStep:
		if tokens.Remaining() == 0 {
			if len(dbg.commandOnStep) == 0 {
				dbg.printLine(terminal.StyleFeedback, "no command on step")
			} else {
				s := strings.Builder{}
				for _, c := range dbg.commandOnStep {
					s.WriteString(c.String())
					s.WriteString("; ")
				}
				dbg.printLine(terminal.StyleFeedback, "command on step: %s", strings.TrimSuffix(s.String(), "; "))
			}
			return nil
		}

		var input string

		option, _ := tokens.Get()
		switch strings.ToUpper(option) {
		case "OFF":
			dbg.commandOnStep = dbg.commandOnStep[:0]
			dbg.printLine(terminal.StyleFeedback, "auto-command on step: OFF")
			return nil

		case "ON":
			dbg.commandOnStep = dbg.commandOnStepStored
			for _, c := range dbg.commandOnStep {
				dbg.printLine(terminal.StyleFeedback, "auto-command on step: %s", c)
			}
			return nil

		default:
			// token isn't one we recognise so push it back onto the token queue
			tokens.Unget()

			// use remaininder of command line to form the ONSTEP command sequence
			input = strings.TrimSpace(tokens.Remainder())
			tokens.End()
		}

		// empty list of tokens. taking note of existing command - not the same
		// as commandOnStepStored because ONSTEP might be OFF
		existingOnStep := dbg.commandOnStep
		dbg.commandOnStep = dbg.commandOnStep[:0]

		// tokenise commands to check for integrity
		for _, s := range strings.Split(i


-replace")
        .spawn().map_err(|_| Error::Custom {
            id: String::new(),
            desc: "unable to run updater".to_string(),
        }));

    process::exit(0);
}

/// This function is as the final step of a self-upgrade. It replaces
/// CARGO_HOME/bin/multirust with the running exe, and updates the the
/// links to it. On windows this will run *after* the original
/// multirust process exits.
#[cfg(unix)]
pub fn self_replace() -> Result<()> {
    try!(install_bins());

    Ok(())
}

#[cfg(windows)]
pub fn self_replace() -> Result<()> {
    try!(wait_for_parent());
    try!(install_bins());

    Ok(())
}

pub fn cleanup_self_updater() -> Result<()> {
    let cargo_home = try!(utils::cargo_home());
    let ref setup = cargo_home.join(&format!("bin/rustup-setup{}", EXE_SUFFIX));

    if setup.exists() {
        try!(utils::remove_file("setup", setup));
    }

    // Transitional
    let ref old_setup = cargo_home.join(&format!("bin/multirust-setup{}", EXE_SUFFIX));

    if old_setup.exists() {
        try!(utils::remove_file("setup", old_setup));
    }

    Ok(())
}
// Required for dlopen, et al.
#[cfg(feature = "dlopen")]
extern crate libc;

mod ffi_types;
mod ffi_funcs;

pub use ffi_types::*;
pub use ffi_funcs::*;

#[cfg(feature = "dlopen")]
pub unsafe fn open() -> Option<LibLoader> {
    return LibLoader::open();
}
use crate::learn_shape::TrailObservationsResult;
use crate::shapes::{JsonTrail, ShapeDiffResult};
use crate::state::endpoint::{PathComponentId, RequestId, ResponseId, ShapeId};
use serde::Serialize;
use std::collections::hash_map::{DefaultHasher, HashMap};
use std::hash::{Hash, Hasher};

#[derive(Debug, Serialize, Hash)]
pub enum InteractionDiffResult {
  UnmatchedRequestUrl(UnmatchedRequestUrl),
  UnmatchedRequestBodyContentType(UnmatchedRequestBodyContentType),
  UnmatchedRequestBodyShape(UnmatchedRequestBodyShape),
  UnmatchedResponseBodyContentType(UnmatchedResponseBodyContentType),
  UnmatchedResponseBodyShape(UnmatchedResponseBodyShape),
  //
  // Matches
  // -------
  #[serde(skip)]
  MatchedRequestBodyContentType(MatchedRequestBodyContentType),
  #[serde(skip)]
  MatchedResponseBodyContentType(MatchedResponseBodyContentType),
}

impl InteractionDiffResult {
  pub fn fingerprint(&self) -> String {
    let mut hash_state = DefaultHasher::new();
    Hash::hash(self, &mut hash_state);
    format!("{:x}", hash_state.finish())
  }
}

////////////////////////////////////////////////////////////////////////////////
#[derive(Debug, Serialize, Hash)]
#[serde(rename_all = "camelCase")]
pub struct UnmatchedRequestUrl {
  pub interaction_trail: InteractionTrail,
  pub requests_trail: RequestSpecTrail,
}

impl UnmatchedRequestUrl {
  pub fn new(interaction_trail: InteractionTrail, requests_trail: RequestSpecTrail) -> Self {
    return UnmatchedRequestUrl {
      interaction_trail,
      requests_trail,
    };
  }
}

#[derive(Debug, Serialize, Hash)]
#[serde(rename_all = "camelCase")]
pub struct UnmatchedRequestBodyContentType {
  pub interaction_trail: InteractionTrail,
  pub requests_trail: RequestSpecTrail,
}

impl UnmatchedRequestBodyContentType {
  pub fn new(interaction_trail: InteractionTrail, requests_trail: RequestSpecTrail) -> Self {
    return UnmatchedRequestBodyContentType {
      interaction_


import numpy as np
import gymnasium
from gymnasium.spaces import Box
from gymnasium.envs.mujoco.hopper_v5 import HopperEnv

class RacingHoppersEnv(HopperEnv):
    def __init__(self, *args, n_agents=1, **kwargs):
        super().__init__(*args, **kwargs)
        self.n_agents = n_agents
        obs_size = (
            self.data.qpos.size
            + self.data.qvel.size
            - self._exclude_current_positions_from_observation * n_agents
        )
        self.observation_space = Box(
            low=-np.inf, high=np.inf, shape=(obs_size,), dtype=np.float64
        )

        self.observation_structure = {
            "skipped_qpos": 1 * self._exclude_current_positions_from_observation * n_agents,
            "qpos": self.data.qpos.size
            - 1 * self._exclude_current_positions_from_observation * n_agents,
            "qvel": self.data.qvel.size,
        }

    def _get_obs(self):
        all = []

        poslen = self.data.qpos.size // self.n_agents
        vellen = self.data.qvel.size // self.n_agents

        for i in range(self.n_agents):
            position = self.data.qpos[i*poslen:(i+1)*poslen].flatten()
            velocity = np.clip(self.data.qvel[i*vellen:(i+1)*vellen].flatten(), -10, 10)

            if self._exclude_current_positions_from_observation:
                position = position[1:]

            a = np.concatenate(
                (
                    position,
                    velocity,
                )
            ).ravel()
            all.append(a)
        return np.concatenate(all)

gymnasium.envs.register(
    id="RacingHoppers-v5",
    entry_point="customHopperEnv:RacingHoppersEnv",
)


e-14,
         .904048781597883114936897101298e-15,
         -.2164006195089607347809812047e-15,
         .522210223399585498460798024417e-16,
         -.126972960236455533637241552778e-16,
         .310914550427619758383622741295e-17,
         -.766376292032038552400956671481e-18,
         .190081925136274520253692973329e-18
    };

    private static final double ERFCC_COEF[] = {
         .715179310202924774503697709496e-1,
         -.265324343376067157558893386681e-1,
         .171115397792085588332699194606e-2,
         -.163751663458517884163746404749e-3,
         .198712935005520364995974806758e-4,
         -.284371241276655508750175183152e-5,
         .460616130896313036969379968464e-6,
         -.822775302587920842057766536366e-7,
         .159214187277090112989358340826e-7,
         -.329507136225284321486631665072e-8,
         .72234397604005554658126115389e-9,
         -.166485581339872959344695966886e-9,
         .401039258823766482077671768814e-10,
         -.100481621442573113272170176283e-10,
         .260827591330033380859341009439e-11,
         -.699111056040402486557697812476e-12,
         .192949233326170708624205749803e-12,
         -.547013118875433106490125085271e-13,
         .158966330976269744839084032762e-13,
         -.47268939801975548392036958429e-14,
         .14358733767849847867287399784e-14,
         -.444951056181735839417250062829e-15,
         .140481088476823343737305537466e-15,
         -.451381838776421089625963281623e-16,
         .147452154104513307787018713262e-16,
         -.489262140694577615436841552532e-17,
         .164761214141064673895301522827e-17,
         -.562681717632940809299928521323e-18,
         .194744338223207851429197867821e-18
    };

    @JRubyMethod(name = "erfc", required = 1, module = true, visibility = Visibility.PRIVATE)
    public static RubyFloat erfc(IRubyObject recv, IRubyObject x) {
        double value = ((RubyFloat)RubyKernel.new_float(recv,x)).getDoubleValue();
        double  result;
        double  y = Math.abs(value);

        if (value <= -6.013687357) {
            result = 2;
        } else if (y < 1.49012e-08) {
            result = 1 - 2 * value / 1.77245385090551602729816748334;
        } else {
            double ysq = y*y;
            if (y < 1) {
                result = 1 - value * (1 + chebylevSerie(2 * ysq - 1, ERFC_COEF));
            } else if (y <= 4.0) {
                result = Math.exp(-ysq)/y*(0.5+chebylevSerie((8.0 / ysq - 5.0) / 3.0, ERFC2_COEF));
                if (value < 0) result = 2.


        );

        assert_eq!(zero + matrix, matrix);
    }

    #[test]
    fn test_matrix_with_zero_determinant() {
        let matrix: Matrix2x2<f64> = Matrix2x2::new(
            1_f64, 2_f64,
            4_f64, 8_f64
        );

        assert_eq!(matrix.determinant(), 0.0);
    }

    #[test]
    fn test_lower_triangular_matrix_determinant() {
        let matrix: Matrix2x2<f64> = Matrix2x2::new(
            2_f64,  0_f64,
            5_f64,  3_f64
        );

        assert_eq!(matrix.determinant(), 2_f64 * 3_f64);
    }

    #[test]
    fn test_upper_triangular_matrix_determinant() {
        let matrix: Matrix2x2<f64> = Matrix2x2::new(
            2_f64,  5_f64,
            0_f64,  3_f64
        );

        assert_eq!(matrix.determinant(), 2_f64 * 3_f64);
    }

    #[test]
    fn test_matrix_inverse() {
        let matrix: Matrix2x2<f64> = Matrix2x2::new(
            5_f64, 1_f64,
            1_f64, 5_f64
        );
        let expected: Matrix2x2<f64> = (1_f64 / 24_f64) * Matrix2x2::new(
             5_f64, -1_f64,
            -1_f64,  5_f64
        );
        let result = matrix.inverse().unwrap();

        assert_relative_eq!(result, expected, epsilon = 1e-8);
    }

    #[test]
    fn test_identity_is_invertible() {
        assert!(Matrix2x2::<f64>::identity().is_invertible());
    }

    #[test]
    fn test_identity_inverse_is_identity() {
        let result: Matrix2x2<f64> = Matrix2x2::identity().inverse().unwrap();
        let expected: Matrix2x2<f64> = Matrix2x2::identity();

        assert_eq!(result, expected);
    }

    #[test]
    fn test_inverse_diagonal_matrix() {
        let matrix: Matrix2x2<f64> = 4_f64 * Matrix2x2::identity();
        let expected: Matrix2x2<f64> = (1_f64 / 4_f64) * Matrix2x2::identity();
        let result = matrix.inverse().unwrap();

        assert_eq!(result, expected);
    }

    #[test]
    fn test_matrix_with_nonzero_determinant_is_invertible() {
        let matrix = Matrix2x2::new(1f32, 2f32, 3f32, 4f32);

        assert!(matrix.is_invertible());
    }

    #[test]
    fn test_matrix_with_zero_determinant_is_not_invertible() {
        let matrix = Matrix2x2::new(1f32, 2f32, 4f32, 8f32);

        assert!(!matrix.is_invertible());
    }

    #[test]
    fn test_noninvertible_matrix_returns_none() {
        let matrix = Matrix2x2::new(1f32, 2f32, 4f32, 8f32);

        assert!(matrix.inverse().is_none());
    }

    #[test]
    fn test_matrix_times_inverse_is_identity() {
        let matrix = Matrix2x2::new(36.84, 427.46, 7.47, 61.89);
        let matrix_inv = matrix.inverse().unwrap();
        let one = Matrix2x2::identity();

        assert_relative_eq!(matrix * matrix_inv, one, epsilon = 1e-8);
    }

    #[test]
    fn test_inverse_times_matrix_is_identity() {


= math.floor(inputSize / s)
               local sz = inputSize
               local t = 16
               local delta = inputSize / 2

               mask = image.scale(mask,sz,sz,'bilinear')
               mask = mask:gt(thr)

               local imgMask = torch.zeros(h + bw * 2, w + bw * 2)
               imgMask:zero()
               print(#imgMask)
               print(math.floor((x - 1) * t) .. ' ' .. math.floor((y - 1) * t) .. ' ' .. sz)
               imgMask:narrow(1, math.floor((x - 1) * t + 1), sz):narrow(2, math.floor((y - 1) * t + 1), sz)[mask] = 1
               --imgMask:narrow(1, math.floor((x - 1) * t + 1), sz):narrow(2, math.floor((y - 1) * t + 1), sz)[1 - mask] = -1
               imgMask:narrow(1, math.floor((x - 1) * t + 1), 1):narrow(2, math.floor((y - 1) * t + 1), sz):fill(-1)
               imgMask:narrow(1, math.floor((x - 1) * t + 1) + sz - 1, 1):narrow(2, math.floor((y - 1) * t + 1), sz):fill(-1)
               imgMask:narrow(1, math.floor((x - 1) * t + 1), sz):narrow(2, math.floor((y - 1) * t + 1), 1):fill(-1)
               imgMask:narrow(1, math.floor((x - 1) * t + 1), sz):narrow(2, math.floor((y - 1) * t + 1) + sz - 1, 1):fill(-1)
               --imgMask = imgMask:narrow(1, bw + 1, h):narrow(2, bw + 1, w):byte()
               local img = torch.ones(3,h+2*bw,w+2*bw) * 0.5
               img:narrow(2,bw+1,h):narrow(3,bw+1,w):copy(inp)
               --print(#img)
               --print(#imgMask)
               img[1][imgMask:eq(1)] = 1
               img[2][imgMask:eq(1)] = 0
               img[3][imgMask:eq(1)] = 0
               img[1][imgMask:eq(-1)] = 0
               img[2][imgMask:eq(-1)] = 0
               img[3][imgMask:eq(-1)] = 1
               local score = outScore[x][y]
               image.save('test/masks/mask_' .. i .. '_' .. x .. '_' .. y .. '_' .. score .. '.png', img)
            end
         end
      end
   end

   local function unfoldMasksMatrix(masks)
      local umasks = {}
      local oSz = math.sqrt(masks[1]:size(1))
      for _,mask in pairs(masks) do
         local umask = mask:reshape(oSz,oSz,mask:size(2),mask:size(3))
         umask=umask:transpose(1,3):transpose(2,3):transpose(2,4):transpose(3,4)
         table.insert(umasks,umask)
      end
      return umasks
   end

   local masks = unfoldMasksMatrix(outPyramidMask)
   local scores = outPyramidScore

   local function getTopScores()
      local sortedScores = torch.Tensor()
      local sortedIds = torch.Tensor()
      local pos = torch.Tensor()

      local topScores = torch.Tensor()

      -- sort scores/ids for each scale
      local nScales=#scales
      local rowN = scores[nScales]:size(1) * scores[nScales]:size(2)
      sortedScores:resize(rowN,nScales):zero()


一个重要的关键。

   以上是我根据工商联一年来的工作所感到的一些意见，希望代表先生们加以讨论。总而言之，我认为必须使工商联成为领导工商业者遵守共同纲领及人民政府政策法令和代表各类工商业者特别是私营工商业者的合法利益的一种组织，成为工商业者团结、互助与自我教育、改造的一种团体。中国经济是发展不平衡的，在行业与行业间，在大、中、小企业间（包括摊商在内），在先进地区与落后地区间，在大、中、小城市间矛盾的存在是不可避免的。工商联应该协助政府，照顾各方，加强他们相互间的联系，密切他们的合作。

   五

   代表先生们：通过了这次代表大会，我们工商业者就将成立我们自己全国性的组织了。这在工商界历史上是一件大事！我们生在毛泽东时代的工商业者，实在感到无比的光荣与兴奋！

   代表先生们：我们要稳步的过渡到社会主义，一方面要逐步实现国家的社会主义工业化，一方面要逐步实现国家对农业、对手工业和对私营工商业的社会主义改造。私营工商业的改造是我国社会主义改造中三个重要环节的一个。我们工商业者，这几年来，是有进步的，对於国民经济的恢复是有一定贡献的，在实现国家总路线中，在进行私营工商业的社会主义改造中，当然还有一些具体问题需要解决的。但我们相信，在伟大的中国人民领袖毛主席、中国共产党与人民政府领导之下，是有充分信心解决这些问题，有充分信心来完成这一光荣的历史任务的。在这里，经过思想改造的、具有爱国热忱的、眼光远大的工商界领袖和骨干分子，应该起着带头作用。

   最后，让我们工商业者团结在中国共产党与毛主席的周围，为着实现私营工商业的社会主义改造，为着正确地发挥私营工商业者应有的作用，为着稳步过渡到社会主义的伟大目标而奋勇前进吧！

   来源：经济资料�


ion: ".jpeg",
            width: 1024,
            height: 768,
            resizeMode: ResizeMode.KeepAspectRatio,
            quality: 85
        );

        // 显示调整结果
        Console.WriteLine($"总文件数: {result.TotalFiles}");
        Console.WriteLine($"成功调整: {result.SuccessfulConversions}");
        Console.WriteLine($"调整失败: {result.FailedConversions}");

        if (!string.IsNullOrEmpty(result.ErrorMessage))
        {
            Console.WriteLine($"错误信息: {result.ErrorMessage}");
        }

        if (result.TotalFiles == 0)
        {
            Console.WriteLine("提示：请将 .jpeg 格式的图片文件放置在 example/input 目录下来测试批量尺寸调整功能。");
        }
    }

    /// <summary>
    /// 图像压缩优化示例
    /// </summary>
    private static void CompressImageExample()
    {
        // 创建示例目录
        var exampleDir = Path.Combine(Directory.GetCurrentDirectory(), "example");
        Directory.CreateDirectory(exampleDir);

        var sourceFile = Path.Combine(exampleDir, "sample.jpg");
        var targetFile = Path.Combine(exampleDir, "sample_compressed.jpg");

        Console.WriteLine($"源文件: {sourceFile}");
        Console.WriteLine($"目标文件: {targetFile}");

        // 检查源文件是否存在
        if (!File.Exists(sourceFile))
        {
            Console.WriteLine("源文件不存在，跳过压缩示例。");
            Console.WriteLine("提示：请将图片文件放置在 example 目录下并命名为 sample.jpg 来测试压缩功能。");
            return;
        }

        // 执行压缩（压缩级别60，不保留元数据）
        bool success = ImageConverter.CompressImage(
            sourceFilePath: sourceFile,
            targetFilePath: targetFile,
            compressionLevel: 60,
            preserveMetadata: false
        );

        if (success)
        {
            Console.WriteLine("✓ 压缩成功！");

            // 显示文件大小对比
            if (File.Exists(sourceFile) && File.Exists(targetFile))
            {
                var originalSize = new FileInfo(sourceFile).Length;
                var compressedSize = new FileInfo(targetFile).Length;
                var compressionRatio = (1.0 - (double)compressedSize / originalSize) * 100;

                Console.WriteLine($"原始文件大小: {originalSize:N0} 字节");
                Console.WriteLine($"压缩后大小: {compressedSize:N0} 字节");
                Console.WriteLine($"压缩率: {compressionRatio:F1}%");
            }
        }
        else
        {
            Console.WriteLine("✗ 压缩失败！");
        }
    }

    /// <summary>
    /// 批量压缩优化示例
    /// </summary>
    private static void BatchCompressExample()
    {
        // 创建示例目录结构
        var exampleDir = Path.Combine(Directory.GetCurrentDirectory(), "example");
        var inputDir = Path.Combine(exampleDir, "input");
        var outputDir = Path.Combine(exampleDir, "compressed_output");

        Directory.CreateDirectory(inputDir);
        Directory.CreateDirectory(outputDir);

        Console.WriteLine($"源目录: {inputDir}");
        Console.WriteLine($"输出目录: {outputDir}");
        Console


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace ZCS_FormUI.Controls
{
    public partial class TreeViewCheckEx : TreeView
    {
        public TreeViewCheckEx()
        {
            InitializeComponent();
        }

        public TreeViewCheckEx(IContainer container)
        {
            container.Add(this);

            this.BorderStyle = BorderStyle.None;
            InitializeComponent();
        }

        #region WIN32
        public const UInt32 TV_FIRST = 4352;
        public const UInt32 TVSIL_NORMAL = 0;
        public const UInt32 TVSIL_STATE = 2;
        public const UInt32 TVM_SETIMAGELIST = TV_FIRST + 9;
        public const UInt32 TVM_GETNEXTITEM = TV_FIRST + 10;
        public const UInt32 TVIF_HANDLE = 16;
        public const UInt32 TVIF_STATE = 8;
        public const UInt32 TVIS_STATEIMAGEMASK = 61440;

        public const UInt32 TVM_GETITEM = TV_FIRST + 12;
        public const UInt32 TVM_SETITEM = TV_FIRST + 13;
        private const UInt32 TVM_HITTEST = TV_FIRST + 17;

        public const UInt32 TVGN_ROOT = 0;

        //TVHITTESTINFO.flags flags
        public const int TVHT_ONITEMSTATEICON = 64;

        // Use a sequential structure layout to define TVITEM for the TreeView.
        [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
        private struct TVITEM
        {
            public uint mask;
            public IntPtr hItem;
            public uint state;
            public uint stateMask;
            public IntPtr pszText;
            public int cchTextMax;
            public int iImage;
            public int iSelectedImage;
            public int cChildren;
            public IntPtr lParam;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
        private struct POINTAPI
        {
            public int x;
            public int y;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
        private struct TVHITTESTINFO
        {
            public POINTAPI pt;
            public int flags;
            public IntPtr hItem;
        }

        // Declare two overloaded SendMessage functions. The
        // difference is in the last parameter: one is ByVal and the
        // other is ByRef.
        [DllImport("user32.dll")]
        private static extern UInt32 SendMessage(IntPtr hWnd, UInt32 Msg,
            UInt32 wParam, UInt32 lParam);

        [DllImport("User32", CharSet = CharSet.Auto)]
        private static extern UInt32 SendMessage(IntPtr hWnd, UInt32 msg,
            UInt32 wParam, ref TVITEM lParam);

        [DllImport("User32", CharSet = CharSet.Auto)]
        private static extern UInt32 SendMessage(IntPtr hWnd, UInt32 msg,
            UInt32 wParam, ref TVHITTESTINFO lParam);
        #endregion

        #region 私有 fields
        private Dictionary<TreeNode, CkBoxState> _NodeStateDict = new Dictionary<TreeNode, CkBoxState>();
        #endregion

        #region Protected fields
        protected ImageList _CtrlStateImageList;
        protected bool _ImageListSent = false;
        #endregion

        #region Public 属性
        /// <summary>
        /// The imagelist for node state
        /// </summary>
        [
        Browsable(true),
        CategoryAttribute("Behavior"),
        Description("从该结点状态图像的ImageList控制")
        ]
        public ImageList CheckBoxStateImageList
        {
            set
            {
                _ImageListSent = false;
                _CtrlStateImageList = value;
            }

            get
            {
                if (_CtrlStateImageList == null)
                {
                    _CtrlStateImageList = ctlStateImageList;
                }
                return _CtrlStateImageList;
            }
        }

        #endregion

        #region Priva


		ID:           123,
		Type:         hcloud.ImageTypeSystem,
		Status:       hcloud.ImageStatusAvailable,
		Name:         "test",
		Created:      time.Date(2036, 8, 12, 12, 0, 0, 0, time.UTC),
		Description:  "Test Image",
		ImageSize:    20.0,
		DiskSize:     20.0,
		Architecture: hcloud.ArchitectureX86,
		Labels: map[string]string{
			"key": "value",
		},
	}

	fx.Client.ImageClient.EXPECT().
		GetForArchitecture(gomock.Any(), "test", hcloud.ArchitectureX86).
		Return(img, nil, nil)

	out, errOut, err := fx.Run(cmd, []string{"test", "--architecture", "x86"})

	expOut := fmt.Sprintf(`ID:		123
Type:		system
Status:		available
Name:		test
Created:	%s (%s)
Description:	Test Image
Image size:	20.00 GB
Disk size:	20 GB
OS flavor:
OS version:	-
Architecture:	x86
Rapid deploy:	no
Protection:
  Delete:	no
Labels:
  key: value
`, util.Datetime(img.Created), humanize.Time(img.Created))

	require.NoError(t, err)
	assert.Empty(t, errOut)
	assert.Equal(t, expOut, out)
}
package image_test

import (
	"strconv"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.uber.org/mock/gomock"

	"github.com/hetznercloud/cli/internal/cmd/image"
	"github.com/hetznercloud/cli/internal/testutil"
	"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

func TestDelete(t *testing.T) {
	fx := testutil.NewFixture(t)
	defer fx.Finish()

	cmd := image.DeleteCmd.CobraCommand(fx.State())
	fx.ExpectEnsureToken()

	img := &hcloud.Image{
		ID: 123,
	}

	fx.Client.ImageClient.EXPECT().
		GetByID(gomock.Any(), img.ID).
		Return(img, nil, nil)
	fx.Client.ImageClient.EXPECT().
		Delete(gomock.Any(), img).
		Return(nil, nil)

	out, errOut, err := fx.Run(cmd, []string{"123"})

	expOut := "Image 123 deleted\n"

	require.NoError(t, err)
	assert.Empty(t, errOut)
	assert.Equal(t, expOut, out)
}

func TestDeleteMultiple(t *testing.T) {
	fx := testutil.NewFixture(t)
	defer fx.Finish()

	cmd := image.DeleteCmd.CobraCommand(fx.State())
	fx.ExpectEnsureToken()

	images := []*hcloud.Image{
		{
			ID: 123,
		},
		{
			ID: 456,
		},
		{
			ID: 789,
		},
	}

	var ids []string
	for _, img := range images {
		ids = append(ids, strconv.FormatInt(img.ID, 10))
		fx.Client.ImageClient.EXPECT().
			GetByID(gomock.Any(), img.ID).
			Return(img, nil, nil)
		fx.Client.ImageClient.EXPECT().
			Delete(gomock.Any(), img).
			Return(nil, nil)
	}

	out, errOut, err := fx.Run(cmd, ids)

	require.NoError(t, err)
	assert.Empty(t, errOut)
	assert.Equal(t, "Images 123, 456, 789 deleted\n", out)
}
package types

import (
	"testing"


quot;>Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean">Pacific Ocean</a> on July 24.</p> <hr/> <p style="text-align: right;"><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small></p>
			</textarea>

			<input type="submit" value="Submit">

	</form>

			CKEditor - The text editor for the Internet - http://ckeditor.com

			Copyright © 2003-2013, CKSource - Frederico
			Knabben. All rights reserved.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_modify %}

{% block title %}{% if errors %}{% translate "Error:" %} {% endif %}{{ block.super }}{% endblock %}
{% block extrahead %}{{ block.super }}

{{ media }}
{% endblock %}

{% block extrastyle %}{{ block.super }}<


-reg-py">ReLU DNN Regression (Friedman)

ReLU DNN Regression (Friedman)

Outcome Testing¶

Accuracy: Classification

Accuracy: Classification

Accuracy: Regression

Accuracy: Regression

WeakSpot: Classification

WeakSpot: Classification

WeakSpot: Regression

WeakSpot: Regression

Overfit: Classification

Overfit: Classification

<span cl


 set; }

        public static void Encode(XdrDataOutputStream stream, AlphaNum4 encodedAlphaNum4)
        {
            AssetCode4.Encode(stream, encodedAlphaNum4.AssetCode);
            AccountID.Encode(stream, encodedAlphaNum4.Issuer);
        }
        public static AlphaNum4 Decode(XdrDataInputStream stream)
        {
            AlphaNum4 decodedAlphaNum4 = new AlphaNum4();
            decodedAlphaNum4.AssetCode = AssetCode4.Decode(stream);
            decodedAlphaNum4.Issuer = AccountID.Decode(stream);
            return decodedAlphaNum4;
        }
    }
}


	},
//	"m_nCPOutput": 1,
//	"m_nOutVectorField": 0,
//	"m_flQuantizeValue":
//	{
//		"m_nType": "PF_TYPE_LITERAL",
//		"m_nMapType": "PF_MAP_TYPE_DIRECT",
//		"m_flLiteralValue": 0.000000,
//		"m_NamedValue": "",
//		"m_nControlPoint": 0,
//		"m_nScalarAttribute": 3,
//		"m_nVectorAttribute": 6,
//		"m_nVectorComponent": 0,
//		"m_bReverseOrder": false,
//		"m_flRandomMin": 0.000000,
//		"m_flRandomMax": 1.000000,
//		"m_bHasRandomSignFlip": false,
//		"m_nRandomSeed": -1,
//		"m_nRandomMode": "PF_RANDOM_MODE_CONSTANT",
//		"m_flLOD0": 0.000000,
//		"m_flLOD1": 0.000000,
//		"m_flLOD2": 0.000000,
//		"m_flLOD3": 0.000000,
//		"m_nNoiseInputVectorAttribute": 0,
//		"m_flNoiseOutputMin": 0.000000,
//		"m_flNoiseOutputMax": 1.000000,
//		"m_flNoiseScale": 0.100000,
//		"m_vecNoiseOffsetRate":
//		[
//			0.000000,
//			0.000000,
//			0.000000
//		],
//		"m_flNoiseOffset": 0.000000,
//		"m_nNoiseOctaves": 1,
//		"m_nNoiseTurbulence": "PF_NOISE_TURB_NONE",
//		"m_nNoiseType": "PF_NOISE_TYPE_PERLIN",
//		"m_nNoiseModifier": "PF_NOISE_MODIFIER_NONE",
//		"m_flNoiseTurbulenceScale": 1.000000,
//		"m_flNoiseTurbulenceMix": 0.500000,
//		"m_flNoiseImgPreviewScale": 1.000000,
//		"m_bNoiseImgPreviewLive": true,
//		"m_flNoCameraFallback": 0.000000,
//		"m_bUseBoundsCenter": false,
//		"m_nInputMode": "PF_INPUT_MODE_CLAMPED",
//		"m_flMultFactor": 1.000000,
//		"m_flInput0": 0.000000,
//		"m_flInput1": 1.000000,
//		"m_flOutput0": 0.000000,
//		"m_flOutput1": 1.000000,
//		"m_flNotchedRangeMin": 0.000000,
//		"m_flNotchedRangeMax": 1.000000,
//		"m_flNotchedOutputOutside": 0.000000,
//		"m_flNotchedOutputInside": 1.000000,
//		"m_nRoundType": "PF_ROUND_TYPE_NEAREST",
//		"m_nBiasType": "PF_BIAS_TYPE_STANDARD",
//		"m_flBiasParameter": 0.000000,
//		"m_Curve":
//		{
//			"m_spline":
//			[
//			],
//			"m_tangents":
//			[
//			],
//			"m_vDomainMins":
//			[
//				0.000000,
//				0.000000
//			],
//			"m_vDomainMaxs":
//			[
//				0.000000,
//				0.000000
//			]
//		}
//	}
//}
class C_OP_QuantizeCPComponent : public CParticleFunctionPreEmission
{
	// MPropertyFriendlyName = "input"
	CParticleCollectionFloatInput m_flInputValue;
	// MPropertyFriendlyName = "output control point"
	int32 m_nCPOutput;
	// MPropertyFriendlyName = "output component"
	// MPropertyAttributeChoiceName = "vector_component"
	int32 m_nOutVectorField;
	// MPropertyFriendlyName = "interval to snap to"
	CParticleCollectionFloatInput m_flQuantizeValue;
};


_grad()
        reconstructed_weights = compression_module.reconstruct()
        train_loss = loss(reconstructed_weights, original_weights)
        # print(train_loss)

        if train_loss < best_loss:
            best_loss = train_loss.item()
            best_state_dict = copy.deepcopy(compression_module.state_dict())
            patience_counter = 0
        else:
            patience_counter += 1
            if patience_counter == patience:
                break
        if train_loss < low_bound:
            print(
                "early stopping low bound",
                low_bound,
                "train_loss",
                torch.sqrt(train_loss / avg_weight),
            )
            break

        train_loss.backward()
        if clip_grad > 0:
            torch.nn.utils.clip_grad_norm_(compression_module.parameters(), clip_grad)

        # for name, param in compression_module.named_parameters():
        #     print(name, torch.any(~torch.isfinite(param.grad)))
        optimizer.step()
        if val_loss is not None:
            lr_scheduler.step(val_loss)
        else:
            # print("no val loss")
            lr_scheduler.step(train_loss)

        if i % discrete_update_every == 0 and i != 0:
            compression_module.update_discrete()

        if verbose and i % verbose == 0:
            print(
                f'iter {i}, train loss {torch.sqrt(train_loss/avg_weight).item()}, lr {round(optimizer.param_groups[0]["lr"], 6)}'
            )

    compression_module.load_state_dict(best_state_dict)
    print(
        "best loss relative",
        torch.sqrt(best_loss / avg_weight).item(),
        "best loss absolute",
        best_loss,
    )
    return compression_module, torch.sqrt(best_loss / avg_weight).item()


_object, in_ancestor, in_bannedTags)
{
	if (in_object == null)
	{
		return false;
	}

	if (in_object == in_ancestor)
	{
		return true;
	}

	if (typeof(in_bannedTags) != 'undefined' &&
		(',' + in_bannedTags.join(',') + ',').indexOf(',' + in_object.tagName + ',') != -1)
	{
		return false;
	}

	while (in_object != document.documentElement)
	{
		try
		{
			if ((tmp_object = in_object.offsetParent) && tmp_object == in_ancestor)
			{
				return true;
			}
			else if ((tmp_object = in_object.parentNode) == in_ancestor)
			{
				return true;
			}
			else
			{
				in_object = tmp_object;
			}
		}
		// in case we get some wierd error, assume we left the building
		catch(e)
		{
			return false;
		}
	}

	return false;
}

// }}}
// {{{ domLib_detectCollisions()

/**
 * For any given target element, determine if elements on the page
 * are colliding with it that do not obey the rules of z-index.
 */
function domLib_detectCollisions(in_object, in_recover, in_useCache)
{
	// the reason for the cache is that if the root menu is built before
	// the page is done loading, then it might not find all the elements.
	// so really the only time you don't use cache is when building the
	// menu as part of the page load
	if (!domLib_collisionsCached)
	{
		var tags = [];

		if (!domLib_canDrawOverFlash)
		{
			tags[tags.length] = 'object';
		}

		if (!domLib_canDrawOverSelect)
		{
			tags[tags.length] = 'select';
		}

		domLib_collisionElements = domLib_getElementsByTagNames(tags, true);
		domLib_collisionsCached = in_useCache;
	}

	// if we don't have a tip, then unhide selects
	if (in_recover)
	{
		for (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)
		{
			var thisElement = domLib_collisionElements[cnt];

			if (!thisElement.hideList)
			{
				thisElement.hideList = new Hash();
			}

			thisElement.hideList.remove(in_object.id);
			if (!thisElement.hideList.length)
			{
				domLib_collisionElements[cnt].style.visibility = 'visible';
				if (domLib_isKonq)
				{
					domLib_collisionElements[cnt].style.display = '';
				}
			}
		}

		return;
	}
	else if (domLib_collisionElements.length == 0)
	{
		return;
	}

	// okay, we have a tip, so hunt and destroy
	var objectOffsets = domLib_getOffsets(in_object);

	for (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)
	{
		var thisElement = domLib_collisionElements[cnt];

		// if collision element is in active element, move on
		// WARNING: is this too costly?
		if (domLib_isDescendantOf(thisElement, in_object))
		{
			continue;
		}

		// konqueror only has trouble with multirow selects
		if (domLib_isKonq &&
			thisElement.tagName == 'SELECT' &&
			(thisElement.size <= 1 && !thisElement.multiple))
		{
			continue;
		}

		if (!thisElement.hideList)
		{
			thisElement.hideList = new Hash();
		}

		var selectOffsets = domLib_getOffsets(thisElement);
		var center2centerDistance = Math.sqrt(Math.pow(selectOffsets


d("app")
const pokemons : number = 100

interface IPokemon {
    id: number;
    name : string;
    image : string;
    type : string;
}

const fetchData = (): void => {
    for (let i = 1; i <= pokemons; i++){
        getPokemon(i)
    }
}

const getPokemon = async (id: number): Promise<void>  => {
    const data : Response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`)
    const pokemon : any = await data.json()
    console.log(pokemon)
    const pokemonType: string = pokemon.types
    .map((poke: any) => poke.type.name)
    .join(", ")

    const transformedPokemon = {
        id : pokemon.id,
        name : pokemon.name,
        image : `${pokemon.sprites.front_default}`,
        type : pokemonType
    }

    showPokemon(transformedPokemon)
}

const showPokemon = (pokemon : IPokemon) : void =>{
    let output : string = `

        #${pokemon.id}

${pokemon.name}

        ${pokemon.type}

    `

    container.innerHTML += output
}

fetchData()import Module         from 'module';

import * as miscUtils from './miscUtils';

export function builtinModules(): Set<string> {
  // @ts-expect-error
  return new Set(Module.builtinModules || Object.keys(process.binding(`natives`)));
}

function getLibc() {
  // It seems that Node randomly crashes with no output under some circumstances when running a getReport() on Windows.
  // Since Windows has no libc anyway, shortcut this path.
  if (process.platform === `win32`)
    return null;

  const report: any = process.report?.getReport() ?? {};
  const sharedObjects: Array<string> = report.sharedObjects ?? [];

  // Matches the first group if libc, second group if musl
  const libcRegExp = /\/(?:(ld-linux-|[^/]+-linux-gnu\/)|(libc.musl-|ld-musl-))/;

  return miscUtils.mapAndFind(sharedObjects, entry => {
    const match = entry.match(libcRegExp);
    if (!match)
      return miscUtils.mapAndFind.skip;

    if (match[1])
      return `glibc`;
    if (match[2])
      return `musl`;

    throw new Error(`Assertion failed: Expected the libc variant to have been detected`);
  }) ?? null;
}

export type Architecture = {
  os: string;
  cpu: string;
  libc: string | null;
};

export type ArchitectureSet = {
  os: Array<string> | null;
  cpu: Array<string> | null;
  libc: Array<string> | null;
};

let architecture: Architecture | undefined;
let architectureSet: ArchitectureSet | undefined;

export function getArchitecture() {
  return architecture = architecture ?? {
    os: process.platform,
    cpu: process.arch,
    libc: getLibc(),
  };
}

export function getArchitectureName(architecture = getArchitecture()) {
  if (architecture.libc) {
    return `${architecture.os}-${architecture.cpu}-${architecture.libc}`;
  } else {
    return `${architecture.os}-${architecture.cpu}`;
  }
}

export function getArchitectureSet() {
  const architecture = getArchitecture


 }

        public void SetHoldPedal(int value)
        {
            holdPedal = value >= 64;
        }

        public void SetReverbSend(int value)
        {
            reverbSend = (byte)value;
        }

        public void SetChorusSend(int value)
        {
            chorusSend = (byte)value;
        }

        public void SetRpnCoarse(int value)
        {
            rpn = (short)((rpn & 0x7F) | (value << 7));
            lastDataType = DataType.Rpn;
        }

        public void SetRpnFine(int value)
        {
            rpn = (short)((rpn & 0xFF80) | value);
            lastDataType = DataType.Rpn;
        }

        public void SetNrpnCoarse(int value)
        {
            lastDataType = DataType.Nrpn;
        }

        public void SetNrpnFine(int value)
        {
            lastDataType = DataType.Nrpn;
        }

        public void DataEntryCoarse(int value)
        {
            if (lastDataType != DataType.Rpn)
            {
                return;
            }

            switch (rpn)
            {
                case 0:
                    pitchBendRange = (short)((pitchBendRange & 0x7F) | (value << 7));
                    break;

                case 1:
                    fineTune = (short)((fineTune & 0x7F) | (value << 7));
                    break;

                case 2:
                    coarseTune = (short)(value - 64);
                    break;
            }
        }

        public void DataEntryFine(int value)
        {
            if (lastDataType != DataType.Rpn)
            {
                return;
            }

            switch (rpn)
            {
                case 0:
                    pitchBendRange = (short)((pitchBendRange & 0xFF80) | value);
                    break;

                case 1:
                    fineTune = (short)((fineTune & 0xFF80) | value);
                    break;
            }
        }

        public void SetPitchBend(int value1, int value2)
        {
            pitchBend = (1F / 8192F) * ((value1 | (value2 << 7)) - 8192);
        }

        public bool IsPercussionChannel => isPercussionChannel;

        public int BankNumber => bankNumber;
        public int PatchNumber => patchNumber;

        public float Modulation => (50F / 16383F) * modulation;
        public float Volume => (1F / 16383F) * volume;
        public float Pan => (100F / 16383F) * pan - 50F;
        public float Expression => (1F / 16383F) * expression;
        public bool HoldPedal => holdPedal;

        public float ReverbSend => (1F / 127F) * reverbSend;
        public float ChorusSend => (1F / 127F) * chorusSend;

        public float PitchBendRange => (pitchBendRange >> 7) + 0.01F * (pitchBendRange & 0x7F);
        public float Tune => coarseTune + (1F / 8192F) * (fineTune - 8192);

        public float PitchBend => PitchBendRange * pitchBend;

        private enum DataType
        {
            None,
            Rpn,
            Nrpn
        }
    }
}


 selection grid is based on.</typeparam>
		/// <returns>The modified selection state.</returns>
		private static TEnum SelectionGrid<TEnum>(TEnum state, GUIStyle style) where TEnum : System.Enum
		{
			if (System.Enum.GetValues(typeof(TEnum)) is not TEnum[] enumOptions)
			{
				Debug.LogWarning($"Unable to get values for type: {typeof(TEnum).Name}");
				return state;
			}

			int selected = enumOptions.IndexOf(state);

			selected = GUILayout.SelectionGrid(selected,
											   enumOptions.Select(e  => $"{e}").ToArray(),
											   enumOptions.Length,
											   style ?? EditorStyles.miniButton);

			return enumOptions[selected];
		}

		/// <summary>
		/// A helper that assigns the given texture to all the background and stretched background
		/// styles of the given <see cref="GUIStyle"/>.
		/// </summary>
		/// <param name="style">The style to modify.</param>
		/// <param name="texture">The texture to assign to the style.</param>
		private static void ApplyTextureToAllStyles(ref GUIStyle style, Texture2D texture)
		{
			// assign all backgrounds
			style.hover.background =
				style.onHover.background =
					style.focused.background =
						style.onFocused.background =
							style.active.background =
								style.onActive.background =
									style.normal.background =
										style.onNormal.background = texture;

			// assign all scaled backgrounds
			style.hover.scaledBackgrounds =
				style.onHover.scaledBackgrounds =
					style.focused.scaledBackgrounds =
						style.onFocused.scaledBackgrounds =
							style.active.scaledBackgrounds =
								style.onActive.scaledBackgrounds =
									style.normal.scaledBackgrounds =
										style.onNormal.scaledBackgrounds = new[] { texture };
		}
	}
}


核心代碼: 1) 產生socket 對象:socket = new Socket(); 2) socket 對象獲取連接
             *      out = socket.getOutputStream(); 3) 根據sock 獲取的連接流發送http post
             *      請求 out.write(reqMsg.toString().getBytes()); 4) 獲取服務端的相應: in
             *      = socket.getInputStream(); 5) 合理處理IO 流: 開啟和關閉
             */
            socket = new Socket();
            // configSocket(socket);

            /**
             * 连接服务端
             */
            // 客户端的Socket构造方法请求与服务器连接时,可能要等待一段时间
            // 默认的Socket构造方法会一直等待下去,直到连接成功,或者出现异常
            // 若欲设定这个等待时间,就要像下面这样使用不带参数的Socket构造方法,单位是毫秒
            // 若超过下面设置的30秒等待建立连接的超时时间,则会抛出SocketTimeoutException
            // 注意:如果超时时间设为0,则表示永远不会超时
            socket.connect(new InetSocketAddress(host, port), 6000);
            if (head != null) {
                reqMsg.append(head);
            }
            /**
             * 构造HTTP请求报文
             */
            String path = sendURL.getPath();
            reqMsg.append("POST ").append((path != null && path.length() > 0) ? path : "/").append(" HTTP/1.1\r\n");
            reqMsg.append("Cache-Control: no-cache\r\n");
            reqMsg.append("Pragma: no-cache\r\n");
            reqMsg.append("User-Agent: JavaSocket/").append(System.getProperty("java.version")).append("\r\n");
            reqMsg.append("Host: ").append(sendURL.getHost()).append("\r\n");
            reqMsg.append("Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n");
            reqMsg.append("Connection: keep-alive\r\n");
            reqMsg.append("Content-Type: application/x-www-form-urlencoded; charset=").append(reqCharset)
                    .append("\r\n");
            reqMsg.append("Content-Length: ").append(reqData.getBytes().length).append("\r\n");
            reqMsg.append("\r\n");
            reqMsg.append(reqData);

            /**
             * 发送HTTP请求
             */
            out = socket.getOutputStream();
            // 这里针对getBytes()补充一下:之所以没有在该方法中指明字符集(包括上面头信息组装Content-Length的时候)
            // 是因为传进来的请求正文里面不会含中文,而非中文的英文字母符号等等,其getBytes()无论是否指明字符集,得到的都是内容一样的字节数组
            // 所以更建议不要直接调用本方法,而是通过sendPostRequest(String, Map<String, String>,
            // String)间接调用本方法
            // sendPostRequest(.., Map,
            // ..)在调用本方法前,会自动对请求参数值进行URLEncoder(注意不包括key=value中的'key=')
            // 而该方法的第三个参数reqCharset只是为了拼装HTTP请求头信息用的,目的是告诉服务器使用哪种字符集解码HTTP请求报文里面的中文信息
            out.write(reqMsg.toString().getBytes());

            /**
             * 接


HMass[PI];
        info->BH_accreted_Mass = priv->BH_accreted_Mass[PI];
        info->BH_FeedbackWeightSum = priv->BH_FeedbackWeightSum[PI];

        info->SPH_SwallowID = priv->SPH_SwallowID[PI];
        info->SwallowID =  BHManager[PI].SwallowID;
        info->CountProgs = BHManager[PI].CountProgs;
        info->Swallowed =  pp[p_i].Swallowed;
        /************************************************************************************************/
        /* When SeedBHDynMass is larger than gas particle mass, we have three mass tracer of blackhole. */
        /* BHP(p_i).Mass : intrinsic mass of BH, accreted every (active) time step.                     */
        /* P[p_i].Mass :  Dynamic mass of BH, used for gravitational interaction.                       */
        /*                Starts to accrete gas particle when BHP(p_i).Mass > SeedBHDynMass             */
        /* BHP(p_i).Mtrack: Initialized as gas particle mass, and is capped at SeedBHDynMass,           */
        /*                 it traces BHP(p_i).Mass by swallowing gas when BHP(p_i).Mass < SeedBHDynMass */
        /************************************************************************************************/
        info->Mtrack = BHManager[PI].Mtrack;
        info->Mdyn = pp[p_i].Mass;

        info->KineticFdbkEnergy = BHManager[PI].KineticFdbkEnergy;
        info->NumDM = priv->NumDM[PI];
        info->VDisp = BHManager[PI].VDisp;
        info->MgasEnc = priv->MgasEnc[PI];
        info->KEflag = priv->KEflag[PI];

        info->a = priv->atime;
    }

    fwrite(infos,sizeof(struct BHinfo),NumActiveBlackHoles,FdBlackholeDetails);
    // fflush(FdBlackholeDetails);
    myfree(infos);
    int64_t totalN;

    MPI_Allreduce(&NumActiveBlackHoles, &totalN, 1, MPI_INT64, MPI_SUM, MPI_COMM_WORLD);
    message(0, "Written details of %ld blackholes in %lu bytes each.\n", totalN, sizeof(struct BHinfo));
    return totalN * sizeof(struct BHinfo);
}

void
write_blackhole_txt(FILE * FdBlackHoles, const struct UnitSystem units, const double atime)
{
    int total_bh, i;
    double total_mdoteddington;
    double total_mass_holes, total_mdot;

    double Local_BH_mass = 0;
    double Local_BH_Mdot = 0;
    double Local_BH_Medd = 0;
    int Local_BH_num = 0;
    /* Compute total mass of black holes
     * present by summing contents of black hole array*/
    #pragma omp parallel for reduction(+ : Local_BH_num) reduction(+: Local_BH_mass) reduction(+: Local_BH_Mdot) reduction(+: Local_BH_Medd)
    for(i = 0; i < SlotsManager->info[5].size; i ++)
    {
        if(BhP[i].SwallowID != (MyIDType) -1)
            continue;
        Local_BH_num++;
        Local_BH_mass += BhP[i].Mass;
        Local_BH_Mdot += BhP[i].Mdot;
        Local_BH_Medd += BhP[i].Mdot/BhP[i].Mass;
    }

    MPI_Reduce(&Local_BH_mass, &total_mass_holes, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
    MPI_Reduce(&Local_BH_Mdot, &total_mdot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
    MPI_Reduce(&Local_BH_Medd, &total_mdoteddington, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
    MPI_Reduce(&Local_BH_num, &total_bh, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);

    if(FdBlackHoles)
    {
        /* convert to solar masses per yr */
        double mdot_in_msun_per_year =
            total_mdot * (units.UnitMass_in_g / SOLAR_MASS) / (units.UnitTime_in_s / SEC_PER_YEAR);

        total_mdoteddington *= 1.0 / ((4 * M_PI * GRAVITY * LIGHTCGS * PROTONMASS /
                    (0.1 * LIGHTCGS * LIGHTCGS * THOMPSON)) * units.UnitTime_in_s);

        fprintf(FdBlackHoles, "%g %d %g %g %g %g\n",
                atime, total_bh, total_mass_holes, total_mdot, mdot_in_msun_per_year, total_mdoteddington);
        fflush(FdBlackHoles);
    }
}


// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_CHECKPOINTS_H
#define BITCOIN_CHECKPOINTS_H

#include "uint256.h"

#include <map>

class CBlockIndex;
struct CCheckpointData;

/**
 * Block-chain checkpoints are compiled-in sanity checks.
 * They are updated every release or three.
 */
namespace Checkpoints
{

//! Returns true if block passes checkpoint checks
bool CheckBlock(const CCheckpointData& data, int nHeight, const uint256& hash);

//! Return conservative estimate of total number of blocks, 0 if unknown
int GetTotalBlocksEstimate(const CCheckpointData& data);

//! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
CBlockIndex* GetLastCheckpoint(const CCheckpointData& data);

double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true);

} //namespace Checkpoints

#endif // BITCOIN_CHECKPOINTS_H