ors_details(&mut object_1641, item_1640);
                object_1641.finish();
            }
        }
        array_1639.finish();
    }
    if let Some(var_1642) = &input.ipc_mode {
        object.key("IpcMode").string(var_1642);
    }
    if let Some(var_1643) = &input.memory {
        object.key("Memory").string(var_1643);
    }
    if let Some(var_1644) = &input.network_mode {
        object.key("NetworkMode").string(var_1644);
    }
    if let Some(var_1645) = &input.pid_mode {
        object.key("PidMode").string(var_1645);
    }
    if let Some(var_1646) = &input.placement_constraints {
        let mut array_1647 = object.key("PlacementConstraints").start_array();
        for item_1648 in var_1646 {
            {
                let mut object_1649 = array_1647.value().start_object();
                crate::json_ser::serialize_structure_crate_model_aws_ecs_task_definition_placement_constraints_details(&mut object_1649, item_1648);
                object_1649.finish();
            }
        }
        array_1647.finish();
    }
    if let Some(var_1650) = &input.proxy_configuration {
        let mut object_1651 = object.key("ProxyConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_aws_ecs_task_definition_proxy_configuration_details(&mut object_1651, var_1650);
        object_1651.finish();
    }
    if let Some(var_1652) = &input.requires_compatibilities {
        let mut array_1653 = object.key("RequiresCompatibilities").start_array();
        for item_1654 in var_1652 {
            {
                array_1653.value().string(item_1654);
            }
        }
        array_1653.finish();
    }
    if let Some(var_1655) = &input.task_role_arn {
        object.key("TaskRoleArn").string(var_1655);
    }
    if let Some(var_1656) = &input.volumes {
        let mut array_1657 = object.key("Volumes").start_array();
        for item_1658 in var_1656 {
            {
                let mut object_1659 = array_1657.value().start_object();
                crate::json_ser::serialize_structure_crate_model_aws_ecs_task_definition_volumes_details(&mut object_1659, item_1658);
                object_1659.finish();
            }
        }
        array_1657.finish();
    }
}

pub fn serialize_structure_crate_model_container_details(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ContainerDetails,
) {
    if let Some(var_1660) = &input.name {
        object.key("Name").string(var_1660);
    }
    if let Some(var_1661) = &input.image_id {
        object.key("ImageId").string(var_1661);
    }
    if let Some(var_1662) = &input.image_name {
        object.key("ImageName").string(var_1662);
    }
    if let Some(var_1663) = &input.launched_at {
        object.key("LaunchedAt").string(var_1663);
    }
}

pub fn serialize_structure_crate_model_aws_rds_event_subscription_details(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AwsRdsEventSubscriptionDetails,
) {
    if let Some(var_1664) = &input.cust_subscription_id {
        object.key("CustSubscriptionId").string(var_1664);
    }


enum LogFormat { simple, extended }

/// A simple logger class that wraps the [Logger] class.
///
/// This class provides a simple way to log messages with different log levels.
/// It also provides a way to configure the logger with different options.
///
class AppLogger {
  static late Logger _logger;
  static late Level _level;
  static late LogFormat _logFormat;
  late String _name;

  AppLogger() {
    _name = "Logger";
  }

  AppLogger.getLogger(String name) {
    _name = name;
  }

  static void configure({required bool isProduction, bool logToFile = false, LogFormat logFormat = LogFormat.simple}) {
    _level = isProduction ? Level.info : Level.debug;
    _logFormat = logFormat;
    final simple = SimplePrinter(printTime: true);
    final pretty = PrettyPrinter(dateTimeFormat: DateTimeFormat.dateAndTime, methodCount: 2);
    LogPrinter printer = _logFormat == LogFormat.simple ? simple : pretty;
    LogOutput output =
        ConsoleOutput(); // logToFile ? FileOutput(file: File('log.txt'), overrideExisting: true) : ConsoleOutput(); Unsupported operation: Not supported on this platform.
    LogFilter filter = isProduction ? ProductionFilter() : DevelopmentFilter();
    _logger = Logger(filter: filter, printer: printer, output: output, level: _level);
  }

  // generate log methods with message and arguments
  String _msg(dynamic message, [List<dynamic>? args]) {
    String msg = "$_name : $message";
    if (args != null) {
      for (int i = 0; i < args.length; i++) {
        msg = msg.replaceFirst("{}", args[i].toString());
      }
    }
    return msg;
  }

  void trace(dynamic message, [List<Object?>? args]) => _logger.t(_msg(message, args));

  void debug(dynamic message, [List<Object?>? args]) => _logger.d(_msg(message, args));

  void info(dynamic message, [List<Object?>? args]) => _logger.i(_msg(message, args));

  void warn(dynamic message, [List<Object?>? args]) => _logger.w(_msg(message, args));

  void error(dynamic message, [List<Object?>? args]) => _logger.e(_msg(message, args));

  @override
  String toString() {
    return "AppLogger($_name, ${_level.name}, ${_logFormat.name})";
  }
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc_advance/configuration/app_logger.dart';
import 'package:flutter_bloc_advance/configuration/environment.dart';
import 'package:flutter_bloc_advance/configuration/local_storage.dart';
import 'package:flutter_bloc_advance/routes/app_router.dart';

import 'app.dart';
import 'main_local.mapper.g.dart' show initializeJsonMapper;

/// IMPORTANT!! run this command to generate main_prod.mapper.g.dart
// dart run build_runner build --delete-conflicting-outputs
// flutter pub run intl_utils:generate
/// main entry point of local computer development
void main() async {
  // first configure the logger
  AppLogger.configure(isProduction: false);
  final log = AppLogger.getLogger("main_local.dart");

  ProfileConstants.setEnvironment(Environment.dev);

  log.info("Starting App with env: {}", [Environment.dev.name]);

  initializeJsonMapper();
  WidgetsFlutterBinding.ensureInitialized();

  //TODO change to the system language(browser language)
  const defaultLanguage = "en";
  AppLocalStorage().setStorage(StorageType.sharedPreferences);
  await AppLocalStorage().save(St


/*
	SuperCollider real time audio synthesis system
    Copyright (c) 2002 James McCartney. All rights reserved.
	http://www.audiosynth.com

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

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef _PYRARRAYPRIM_H_
#define _PYRARRAYPRIM_H_

void initArrayPrimitives();

int prArrayMultiChanExpand(VMGlobals *g, int numArgsPushed);

int arrayAtIdentityHash(PyrObject *array, PyrSlot *key);
int arrayAtIdentityHashInPairs(PyrObject *array, PyrSlot *key);
int arrayAtIdentityHashInPairsWithHash(PyrObject *array, PyrSlot *key, int hash);

#endif


require "Feature/ResDefines"
require "Feature/AudioConsts"
require "Feature/Supportor/SupportorModule"

require "Feature/Main/MainDlg"
require "Feature/Main/TestDlg"

require "Feature/Activity/Collection/CollectionItem"
require "Feature/Activity/Collection/CollectionMainDlg"
require "Feature/Activity/Collection/CollectionTaskListDlg"
require "Feature/Activity/Collection/CollectionActModel"
require "Feature/Activity/Collection/CollectionDailyTaskItem"
require "Feature/Activity/Collection/CollectionTimedTaskItem"
require "Feature/Activity/LoginOnly/LoginOnlyDefine"
require "Feature/Activity/LoginOnly/LoginOnlyDlg"
require "Feature/Activity/LoginOnly/NoEntryLoginOnlyDlg"

require "Feature/Activity/PrayOnly/PrayOnlyDefine"
require "Feature/Activity/PrayOnly/PrayOnlyMainDlg"
require "Feature/Activity/PrayOnly/PrayOnlyActDefines"

require "Feature/Activity/ActFlip/ActFlipMainDlg"

require "Feature/Activity/CheckinAccess/CheckinAccessDefine"
require "Feature/Activity/CheckinAccess/CheckinAccessMainDlg"

require "Feature/Activity/LuaActivityUtil"

require "Feature/Activity/Act3D5/Act3D5Dlg"
require "Feature/Activity/Act4D5/Act4D5Dlg"
require "Feature/Activity/Act6D8/Act6D8Dlg"
require "Feature/Activity/Act9D1D2/Act9D1D2Dlg"
require "Feature/Activity/Act9D4/Act9D4Dlg"
require "Feature/Activity/Act14D0D2/Act14D0D2Dlg"
require "Feature/Activity/Act16D5D1/Act16D5D1Dlg"

require "Feature/Activity/GridGacha/GridGachaDefine"
require "Feature/Activity/GridGacha/GridGachaMainDlg"

require "Feature/Activity/GridGachaV2/GridGachaV2Define"
require "Feature/Activity/GridGachaV2/GridGachaV2MainDlg"

require "Feature/Activity/FloatParade/FloatParadeProbDetailPanel"
require "Feature/Activity/FloatParade/FloatParadeRulePanel"
require "Feature/Activity/FloatParade/FloatParadeRewardRulePanel"
require "Feature/Activity/FloatParade/FloatParadeRecycleDayListAdapter"
require "Feature/Activity/FloatParade/FloatParadeTacticTab"
require "Feature/Activity/FloatParade/FloatParadeMainDlg"

require "Feature/Activity/CheckinAllPlayer/CheckinAllPlayerMainDlg"
require "Feature/Activity/CheckinVs/Che


sition: oldPosition);

      _line -= newlines.length;
      if (newlines.isEmpty) {
        _column -= oldPosition - newPosition;
      } else {
        // To compute the new column, we need to locate the last newline before
        // the new position. When searching, we must exclude the CR if we're
        // between a CRLF because it's not considered a newline.
        final crOffset = _betweenCRLF ? -1 : 0;
        // Additionally, if we use newPosition as the end of the search and the
        // character at that position itself (the next character) is a newline
        // we should not use it, so also offset to account for that.
        const currentCharOffset = -1;
        final lastNewline = string.lastIndexOf(
            _newlineRegExp, newPosition + currentCharOffset + crOffset);

        // Now we need to know the offset after the newline. This is the index
        // above plus the length of the newline (eg. if we found `\r\n`) we need
        // to add two. However if no newline was found, that index is 0.
        final offsetAfterLastNewline = lastNewline == -1
            ? 0
            : string[lastNewline] == '\r' && string[lastNewline + 1] == '\n'
                ? lastNewline + 2
                : lastNewline + 1;

        _column = newPosition - offsetAfterLastNewline;
      }
    }
  }

  LineScanner(super.string, {super.sourceUrl, super.position});

  @override
  bool scanChar(int character) {
    if (!super.scanChar(character)) return false;
    _adjustLineAndColumn(character);
    return true;
  }

  @override
  int readChar() {
    final character = super.readChar();
    _adjustLineAndColumn(character);
    return character;
  }

  /// Adjusts [_line] and [_column] after having consumed [character].
  void _adjustLineAndColumn(int character) {
    if (character == $lf || (character == $cr && peekChar() != $lf)) {
      _line += 1;
      _column = 0;
    } else {
      _column += inSupplementaryPlane(character) ? 2 : 1;
    }
  }

  @override
  bool scan(Pattern pattern) {
    if (!super.scan(pattern)) return false;

    final newlines = _newlinesIn(lastMatch![0]!, endPosition: position);
    _line += newlines.length;
    if (newlines.isEmpty) {
      _column += lastMatch![0]!.length;
    } else {
      _column = lastMatch![0]!.length - newlines.last.end;
    }

    return true;
  }

  /// Returns a list of [Match]es describing all the newlines in [text], which
  /// ends at [endPosition].
  ///
  /// If [text] ends with `\r`, it will only be treated as a newline if the next
  /// character at [position] is not a `\n`.
  List<Match> _newlinesIn(String text, {required int endPosition}) {
    final newlines = _newlineRegExp.allMatches(text).toList();
    // If the last character is a `\r` it will have been treated as a newline,
    // but this is only valid if the next character is not a `\n`.
    if (endPosition < string.length &&
        text.endsWith('\r') &&
        string[endPosition] == '\n') {
      // newlines should never be empty here, because if `text` ends with `\r`
      // it would have matched `\r(?!\n)` in the newline regex.
      newlines.removeLast();
    }
    return newlines;
  }
}

/// A class representing the state of a [LineScanner].
class LineScannerState {
  /// The [LineScanner] that created this.
  final LineScanner _scanner;


ART6};

#[cfg(any(feature = "stm32f407", feature = "stm32f429"))]
use stm32::usart6::cr2::STOPW;

#[cfg(any(feature = "stm32f401", feature = "stm32f412", feature = "stm32f411"))]
use stm32::usart1::cr2::STOPW;

use gpio::gpioa::{PA10, PA2, PA3, PA9};
use gpio::gpiob::{PB6, PB7};
use gpio::gpioc::{PC6, PC7};
use gpio::gpiod::{PD5, PD6};

#[cfg(any(feature = "stm32f407", feature = "stm32f429"))]
use gpio::gpioa::{PA0, PA1};
#[cfg(any(feature = "stm32f407", feature = "stm32f412", feature = "stm32f429"))]
use gpio::gpiob::{PB10, PB11};
#[cfg(any(feature = "stm32f407", feature = "stm32f429"))]
use gpio::gpioc::PC12;
#[cfg(feature = "stm32f412")]
use gpio::gpioc::PC5;
#[cfg(any(feature = "stm32f407", feature = "stm32f412", feature = "stm32f429"))]
use gpio::gpioc::{PC10, PC11};
#[cfg(any(feature = "stm32f407", feature = "stm32f429"))]
use gpio::gpiod::PD2;
#[cfg(any(feature = "stm32f407", feature = "stm32f412", feature = "stm32f429"))]
use gpio::gpiod::{PD8, PD9};
#[cfg(feature = "stm32f429")]
use gpio::gpioe::{PE0, PE1};
#[cfg(feature = "stm32f429")]
use gpio::gpiof::{PF6, PF7};
#[cfg(any(feature = "stm32f407", feature = "stm32f412", feature = "stm32f429"))]
use gpio::gpiog::{PG14, PG9};
use gpio::{Alternate, AF7, AF8};
use rcc::Clocks;

/// Serial error
#[derive(Debug)]
pub enum Error {
    /// Framing error
    Framing,
    /// Noise error
    Noise,
    /// RX buffer overrun
    Overrun,
    /// Parity check error
    Parity,
    #[doc(hidden)]
    _Extensible,
}

/// Interrupt event
pub enum Event {
    /// New data has been received
    Rxne,
    /// New data can be sent
    Txe,
    /// Idle line state detected
    Idle,
}

pub mod config {
    use time::Bps;
    use time::U32Ext;

    pub enum WordLength {
        DataBits8,
        DataBits9,
    }

    pub enum Parity {
        ParityNone,
        ParityEven,
        ParityOdd,
    }

    pub enum StopBits {
        #[doc = "1 stop bit"]
        STOP1,
        #[doc = "0.5 stop bits"]
        STOP0P5,
        #[doc = "2 stop bits"]
        STOP2,
        #[doc = "1.5 stop bits"]
        STOP1P5,
    }

    pub struct Config {
        pub baudrate: Bps,
        pub wordlength: WordLength,
        pub parity: Parity,
        pub stopbits: StopBits,
    }

    impl Config {
        pub fn baudrate(mut self, baudrate: Bps) -> Self {
            self.baudrate = baudrate;
            self
        }

        pub fn parity_none(mut self) -> Self {
            self.parity = Parity::ParityNone;
            self
        }

        pub fn parity_even(mu


Buffer() )
  {
    buffer->UpdateVB( 0, sizeof(float), no_of_coords, x_coords );
    buffer->UpdateVB( 1, sizeof(float), no_of_coords, y_coords );
  }

  // TODO $$$ append to cache and delays the drawing until it is absolutely necessary.
  //          dependent on VAO specification and `_successive_draw_started`
  glDrawArrays( OpenGL::Primitive( primitive_type ), 0, (GLsizei)no_of_coords );

  // disable vertex attributes and activate program 0
  prog.DeactivateProgram();

  return true;
}

/******************************************************************//**
* \brief Draw a single line sequence.
*
* \author  gernot
* \date    2018-09-07
* \version 1.0
**********************************************************************/
bool CLineOpenGL_base_OpenGL4_OpenGLES3::Draw(
  Render::TPrimitive primitive_type, //!< in: primitive type of the coordinates - lines, line strip, line loop, lines adjacency or line strip adjacency
  size_t             no_of_coords,   //!< in: number of coordinates and number of elements (size) of the coordinate array
  const double      *x_coords,       //!< int pointer to an array of the x coordinates
  const double      *y_coords )      //!< int pointer to an array of the y coordinates
{
  // A new sequence can't be started within an active sequence
  if ( _primitive_prog == nullptr || _primitive_prog->ActiveSequence() )
  {
    ASSERT( false );
    return false;
  }
  ASSERT( Render::BasePrimitive(primitive_type) == Render::TBasePrimitive::polygon );
  auto &prog = *_primitive_prog;

  // activate program, update uniforms and enable vertex attributes
  prog.ActivateProgram( Render::d__b0_x__b1_y );

  // set vertex attribute pointers and draw the line
  if ( auto *buffer = prog.DrawBuffer() )
  {
    buffer->UpdateVB( 0, sizeof(double), no_of_coords, x_coords );
    buffer->UpdateVB( 1, sizeof(double), no_of_coords, y_coords );
  }

  // TODO $$$ append to cache and delays the drawing until it is absolutely necessary.
  //          dependent on VAO specification and `_successive_draw_started`
  glDrawArrays( OpenGL::Primitive( primitive_type ), 0, (GLsizei)no_of_coords );

  // disable vertex attributes and activate program 0
  prog.DeactivateProgram();

  return true;
}

/******************************************************************//**
* \brief Start a new line sequence.
*
* \author  gernot
* \date    2018-09-07
* \version 1.0
**********************************************************************/
bool CLineOpenGL_base_OpenGL4_OpenGLES3::StartSequence(
  Render::TPrimitive primitive_type, //!< in: primitive type of the coordinates - lines, line strip, line loop, lines adjacency or line strip adjacency
  unsigned int       tuple_size )    //!< in: kind of the coordinates - 2: 2D (x, y), 3: 3D (x, y, z), 4: homogeneous (x, y, z, w)
{
  // A new sequence can't be started within an active sequence
  if ( _primitive_prog == nullptr || _primitive_prog->ActiveSequence() )
  {
    ASSERT( false );
    return false;
  }
  ASSERT( Render::BasePrimitive(primitive_type) == Render::TBasePrimitive::polygon );
  auto &prog = *_primitive_prog;

  prog.StartSequence();
  _vertex_cache.TupleSize( tuple_size );
  _squence_type = primitive_type;

  return true;
}

/******************************************************************//**
* \brief Complete an active line sequence.
*
* \author  gernot
* \date    2018-09-07
* \version 1.0
**********************************************************************/
bool CLineOpenGL_base_OpenGL4_OpenGLE


lazy-src="https://img.watech.top/blog/202402182209511.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/>

Mr.Shi

文章

8

标签

4

分类

2

Github 主页

公告

<left>        很喜欢《从你的全世界路过》里面的一句话：虾子要吃活着烧的，痛出来的鲜美，才足够颠倒众生。爱情、事业、生活皆是如此。</left>本站域名 | 水车图床
      watech.top | pb.watech.top
📬：rk1413686404@gmail.com

网站资讯

文章数目 :

8

已运行时间 :

本站总字数 :

4.8k

本站访客数 :

本站总访问量 :

最后更新时间 :
<div c


}

@include breakpoint-deprecated( ">1280px" ) {
	.stats__module-column {
		width: calc(33% - 3px);

		&:last-child {
			clear: none;
			left: -10px;
			position: relative;
		}
	}
}

.old-stats-link .button .gridicon {
	margin-bottom: -2px;
	margin-left: 4px;
}

.stats-navigation__control {
	margin-right: 16px;

	@include breakpoint-deprecated( "<480px" ) {
		margin-right: 0;
	}
}

.stats__sticky-navigation.is-sticky .sticky-panel__content, .sticky-panel.is-sticky .sticky-panel__content {
	background: var(--studio-white);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 0 56px rgba(0, 0, 0, 0.075);

	.stats-period-navigation {
		margin: 9px 0;
	}
}

// Stats section scoped styles
.is-section-stats {
	&.color-scheme.is-classic-dark {
		@include apply-improved-classic-dark-colors();
	}

	.sticky-panel.is-sticky {
		padding: 0;
	}

	// TODO: Remove other independent segmented control styles by this mixin.
	@include segmented-controls;
}

.list-emails {
	.horizontal-bar-list .horizontal-bar-list-item-bar::before {
		display: none;
	}

	.horizontal-bar-list-item--additional,
	.stats-card-header__additional {
		font-weight: 500;
	}
}

@import "calypso/my-sites/stats/grid-layout";
// partially copied from https://github.com/Automattic/woocommerce.com/blob/trunk/themes/woo/css/global/misc.scss

// Color palette support
$woo-lilac: #96588a;
$woo-green: #73ae39;
$woo-gray-background: #e6e6e6;
$woo-gray-light: #f7f7f7;
$woo-text-gray: #333;

// Woo colors
$c-woocommerce-purple-0: #f7edf7 !default;
$c-woocommerce-purple-5: #e5cfe8 !default;
$c-woocommerce-purple-10: #d6b4e0 !default;
$c-woocommerce-purple-20: #c792e0 !default;
$c-woocommerce-purple-30: #af7dd1 !default;
$c-woocommerce-purple-40: #9a69c7 !default;
$c-woocommerce-purple-50: #7f54b3 !default;
$c-woocommerce-purple-60: #674399 !default;
$c-woocommerce-purple-70: #533582 !default;
$c-woocommerce-purple-80: #3c2861 !default;
$c-woocommerce-purple-90: #271b3d !default;
$c-woocommerce-purple-100: #140e1f !default;

// Neutral colors
$c-white: #fff;
$c-black: #000;
$c-gray-0: #f6f7f7 !default;
$c-gray-5: #dcdcde !default;
$c-gray-10: #c3c4c7 !default;
$c-gray-20: #a7aaad !default;
$c-gray-30: #8c8f94 !default;
$c-gray-40: #787c82 !default;
$c-gray-50: #646970 !default;
$c-gray-60: #50575e !default;
$c-gray-


.cuda.device_count():", torch.cuda.device_count())
        torch.cuda.set_device(LOCAL_RANK)
        device = torch.device('cuda', LOCAL_RANK)
        dist.init_process_group(backend="nccl" if dist.is_nccl_available() else "gloo")

    cuda = device.type != 'cpu'

    # Create data
    data_transform = {
        "train": transforms.Compose(
            [transforms.RandomResizedCrop(224),
             transforms.RandomHorizontalFlip(),
             transforms.ToTensor(),
             transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]
        ),
        "val": transforms.Compose(
            [transforms.Resize(256),
             transforms.CenterCrop(224),
             transforms.ToTensor(),
             transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]
        )
    }

    if RANK in {-1, 0}:
        os.makedirs('data', exist_ok=True)
        data_info = read_split_data(config["data"]["data_path"], save_dir='data', val_rate=0.2, plot_image=True)

    with torch_distributed_zero_first(LOCAL_RANK):
        train_set = My_Dataset_with_txt('data', "train.txt", transform=data_transform["train"])
        test_set = My_Dataset_with_txt('data', "val.txt", transform=data_transform["val"])
        # train_set.data = train_set.data[:100]
        # test_set.data = test_set.data[:100]

    train_sampler = None if LOCAL_RANK == -1 else distributed.DistributedSampler(train_set, shuffle=True)
    test_sampler = None if LOCAL_RANK == -1 else distributed.DistributedSampler(test_set, shuffle=False)
    print(train_sampler)

    nw = min([os.cpu_count(), config["train"]["batch_size"] if config["train"]["batch_size"] > 1 else 0, 8])
    train_dataloader = DataLoader(train_set, batch_size=config["train"]["batch_size"], shuffle=train_sampler is None,
                                  num_workers=nw, sampler=train_sampler, pin_memory=True, drop_last=True,
                                  collate_fn=train_set.collate_fn)

    test_dataloader = DataLoader(test_set, batch_size=config["train"]["batch_size"], shuffle=False,
                                 num_workers=nw, sampler=test_sampler, pin_memory=True, drop_last=False,
                                 collate_fn=test_set.collate_fn)
    nb = len(train_dataloader)
    # warmup_iters = max(round(config["train"]["warmup_epochs"] * nb), 100)

    # Write to tensorboard
    if RANK in {-1, 0}:
        for i in range(10):
            img, target = test_set[i]
            tb_writer.add_image("test_set", img, target)

    # Create model
    assert config["train"]["arch"] in model_dict
    model_build_func = get_model(config["train"]["arch"])
    model = model_build_func(num_classes=config["train"]["classes"])

    # pretrain weights
    mf = False
    if config["train"]["weights"] is not None and os.path.exists(config["train"]["weights"]):
        with torch_distributed_zero_first(LOCAL_RANK):
            checkpoint_path = config["train"]["weights"]

        ckpt = torch.load(checkpoint_path, map_location='cpu')
        ckpt_dict = {k: v for k, v in ckpt.items() if model.state_dict()[k].numel() == v.numel()}
        model.load_state_dict(ckpt_dict, strict=True)
    else:
        if RANK != -1:
            checkpoint_path = os.path.join(tempfile.gettempdir(), "initial_weights.pt")
            mf = True

            if RANK == 0:
                torch.save(model.state_dict(), checkpoint_path)

            dist.barrier()
            model.load_state_dict(torch.load(checkpoint_path, map_location='cpu'))

    model = model.to(device)

    # Freeze weights
    if config["train"]["freeze_layers"]:
        for name, p in model.named_parameters():
            if "fc" not in name:
                p.requires_grad_(False)
                logging.info("Freeze layer:{}".format(name))

    # 只有训练带有BN结构的网络时使用SyncBatchNorm才有意义，上面固定权重，使得BN层没有训练
    if config["train"]["syncBN"] and cuda and RANK != -1:
        # 使用SyncBatchNorm后训练会更耗时
        model = torch.nn.SyncBatchNorm.convert_sync_batchnorm(model).to(device)
        logging.info('Using SyncBatchNorm()')

    # Convert to DDP
    if cuda and RANK != -1:
        model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK)

    # Optimizer
    # 学习率要根据并行GPU的数量进行倍增
    lr = config["train"]["lr"] * WORLD_SIZE if RANK != -1 else config["train"]["lr"]
    pg = [p for p in model.parameters() if p.requires_grad]
    optimizer = torch.optim.SGD(pg, lr=lr, momentum=0.9, weight_decay=5e-4)


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

import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import lock

from .. import SECPLUS_GDO_CONFIG_SCHEMA, secplus_gdo_ns, CONF_SECPLUS_GDO_ID

DEPENDENCIES = ["secplus_gdo"]

GDOLock = secplus_gdo_ns.class_("GDOLock", lock.Lock, cg.Component)

CONFIG_SCHEMA = (
    lock.lock_schema(GDOLock)
    .extend(
        {
            cv.GenerateID(): cv.declare_id(GDOLock),
        }
    )
    .extend(SECPLUS_GDO_CONFIG_SCHEMA)
)

async def to_code(config):
    var = await lock.new_lock(config)
    await cg.register_component(var, config)
    parent = await cg.get_variable(config[CONF_SECPLUS_GDO_ID])
    cg.add(parent.register_lock(var))


get_setpadding(gui_handle_p h, gui_dim_t x);

gui_dim_t       gui_widget_getpaddingtop(gui_handle_p h);
gui_dim_t       gui_widget_getpaddingright(gui_handle_p h);
gui_dim_t       gui_widget_getpaddingbottom(gui_handle_p h);
gui_dim_t       gui_widget_getpaddingleft(gui_handle_p h);

/**
 * \}
 */

/**
 * \defgroup        GUI_WIDGET_CALLBACK Callback processing
 * \brief           Callback based functions
 * \{
 */

uint8_t         gui_widget_processdefaultcallback(gui_handle_p h, gui_widget_evt_t evt, gui_evt_param_t* const param, gui_evt_result_t* const result);
uint8_t         gui_widget_setcallback(gui_handle_p h, gui_widget_evt_fn callback);
uint8_t         gui_widget_callback(gui_handle_p h, gui_widget_evt_t evt, gui_evt_param_t* const param, gui_evt_result_t* const result);

/**
 * \}
 */

#if defined(GUI_INTERNAL) && !__DOXYGEN__
//Strictly private functions by GUI
//Widget initialization purpose
void guii_widget_init(void);

//Clipping regions
uint8_t guii_widget_isinsideclippingregion(gui_handle_p h, uint8_t check_sib_cover);

//Move widget down and all its parents with it
void guii_widget_movedowntree(gui_handle_p h);

void guii_widget_focus_clear(void);
void guii_widget_focus_set(gui_handle_p h);
void guii_widget_active_clear(void);
void guii_widget_active_set(gui_handle_p h);

//Execute actual widget remove process
uint8_t guii_widget_executeremove(void);
#endif /* !__DOXYGEN__ */

/**
 * \}
 */

/**
 * \}
 */

/* C++ detection */
#ifdef __cplusplus
}
#endif

#endif /* GUI_HDR_WIDGET_H */


(_ErodeImageFilter filter)
    : creator = filter {
    _constructor();
    _initErode(filter.radiusX, filter.radiusY);
  }

  /// Creates an image filter that applies a matrix transformation.
  ///
  /// For example, applying a positive scale matrix (see [Matrix4.diagonal3])
  /// when used with [BackdropFilter] would magnify the background image.
  _ImageFilter.matrix(_MatrixImageFilter filter)
    : creator = filter {
    if (filter.data.length != 16) {
      throw ArgumentError('"matrix4" must have 16 entries.');
    }
    _constructor();
    _initMatrix(filter.data, filter.filterQuality.index);
  }

  /// Converts a color filter to an image filter.
  _ImageFilter.fromColorFilter(ColorFilter filter)
    : creator = filter {
    _constructor();
    final _ColorFilter? nativeFilter = filter._toNativeColorFilter();
    _initColorFilter(nativeFilter);
  }

  /// Composes `_innerFilter` with `_outerFilter`.
  _ImageFilter.composed(_ComposeImageFilter filter)
    : creator = filter {
    _constructor();
    final _ImageFilter nativeFilterInner = filter.innerFilter._toNativeImageFilter();
    final _ImageFilter nativeFilterOuter = filter.outerFilter._toNativeImageFilter();
    _initComposed(nativeFilterOuter, nativeFilterInner);
  }

  @Native<Void Function(Handle)>(symbol: 'ImageFilter::Create')
  external void _constructor();

  @Native<Void Function(Pointer<Void>, Double, Double, Int32)>(symbol: 'ImageFilter::initBlur', isLeaf: true)
  external void _initBlur(double sigmaX, double sigmaY, int tileMode);

  @Native<Void Function(Pointer<Void>, Double, Double)>(symbol: 'ImageFilter::initDilate', isLeaf: true)
  external void _initDilate(double radiusX, double radiusY);

  @Native<Void Function(Pointer<Void>, Double, Double)>(symbol: 'ImageFilter::initErode', isLeaf: true)
  external void _initErode(double radiusX, double radiusY);

  @Native<Void Function(Pointer<Void>, Handle, Int32)>(symbol: 'ImageFilter::initMatrix')
  external void _initMatrix(Float64List matrix4, int filterQuality);

  @Native<Void Function(Pointer<Void>, Pointer<Void>)>(symbol: 'ImageFilter::initColorFilter')
  external void _initColorFilter(_ColorFilter? colorFilter);

  @Native<Void Function(Pointer<Void>, Pointer<Void>, Pointer<Void>)>(symbol: 'ImageFilter::initComposeFilter')
  external void _initComposed(_ImageFilter outerFilter, _ImageFilter innerFilter);

  /// The original Dart object that created the native wrapper, which retains
  /// the values used for the filter.
  final ImageFilter creator;
}

/// Base class for objects such as [Gradient] and [ImageShader] which
/// correspond to shaders as used by [Paint.shader].
base class Shader extends NativeFieldWrapperClass1 {
  /// This class is created by the engine, and should not be instantiated
  /// or extended directly.
  @pragma('vm:entry-point')
  Shader._();

  bool _debugDisposed = false;

  /// Whether [dispose] has been called.
  ///
  /// This must only be used when asserts are enabled. Otherwise, it will throw.
  bool get debugDisposed {
    late bool disposed;
    assert(() {
      disposed = _debugDisposed;
      return true;
    }());
    return disposed;
  }

  /// Release the resources used by this object. The object is no longer usable
  /// after this method is called.
  ///
  /// The underlying memory allocated by this object will be retained beyond
  /// this call if it is still needed by another object that has not been
  /// disposed. For example, a [Picture] that has not been disposed that
  /// refers to an [ImageShader] may keep its underlying resources alive.
  ///
  ///


ting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}

{{ perms_lacking|unordered_list }}

  {% endblock %}
{% elif protected %}
  {% block delete_protected %}

{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}

{{ protected|unordered_list }}

  {% endblock %}
{% else %}
  {% block delete_confirm %}

{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}

    {% include "admin/includes/object_delete_summary.html" %}

{% translate "Objects" %}

{{ deleted_objects|unordered_list }}

    <form method="post">{% csrf_token %}

    <input type="hidden" name="post" value="yes">
    {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
    {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %}
    <input type="submit" value="{% translate 'Yes, I’m sure' %}">
    {% translate "No, take me back" %}

    </form>
  {% endblock %}
{% endif %}
{% endblock content %}
<!DOCTYPE html>

  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="NONE,NOARCHIVE">
  <title>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}
         {% if request %} at {{ request.path_info }}{% endif %}</title>


 Without treasury enabled.
	pkScript := mustParseShortFormV0("HASH160 DATA_20 0x433ec2ac1ffa1b7b7d0" +
		"27f564529c57197f9ae88 EQUAL")
	for _, test := range tests {
		count := GetPreciseSigOpCount(test.scriptSig, pkScript,
			noTreasury)
		if count != test.nSigOps {
			t.Errorf("%s: expected count of %d, got %d", test.name,
				test.nSigOps, count)
		}
	}

	// The signature in the p2sh script is nonsensical for the tests since
	// this script will never be executed.  What matters is that it matches
	// the right pattern. With treasury enabled.
	pkScript = mustParseShortFormV0("HASH160 DATA_20 0x433ec2ac1ffa1b7b7d0" +
		"27f564529c57197f9ae88 EQUAL")
	for _, test := range tests {
		count := GetPreciseSigOpCount(test.scriptSig, pkScript,
			withTreasury)
		if count != test.nSigOps {
			t.Errorf("%s: expected count of %d, got %d", test.name,
				test.nSigOps, count)
		}
	}
}

// TestRemoveOpcodeByData ensures that removing data carrying opcodes based on
// the data they contain works as expected.
func TestRemoveOpcodeByData(t *testing.T) {
	t.Parallel()

	tests := []struct {
		name   string
		before []byte
		remove []byte
		err    error
		after  []byte
	}{{
		name:   "nothing to do",
		before: mustParseShortFormV0("NOP"),
		remove: []byte{1, 2, 3, 4},
		after:  mustParseShortFormV0("NOP"),
	}, {
		name:   "simple case",
		before: mustParseShortFormV0("DATA_4 0x01020304"),
		remove: []byte{1, 2, 3, 4},
		after:  nil,
	}, {
		name:   "simple case (miss)",
		before: mustParseShortFormV0("DATA_4 0x01020304"),
		remove: []byte{1, 2, 3, 5},
		after:  mustParseShortFormV0("DATA_4 0x01020304"),
	}, {
		name: "stakesubmission simple case p2pkh",
		before: mustParseShortFormV0("SSTX DUP HASH160 DATA_20 0x00{16} " +
			"0x01020304 EQUALVERIFY CHECKSIG"),
		remove: []byte{1, 2, 3, 4},
		after:  mustParseShortFormV0("SSTX DUP HASH160 EQUALVERIFY CHECKSIG"),
	}, {
		name: "stakesubmission simple case p2pkh (miss)",
		before: mustParseShortFormV0("SSTX DUP HASH160 DATA_20 0x00{16} " +
			"0x01020304 EQUALVERIFY CHECKSIG"),
		remove: []byte{1, 2, 3, 4, 5},
		after: mustParseShortFormV0("SSTX DUP HASH160 DATA_20 0x00{16} " +
			"0x01020304 EQUALVERIFY CHECKSIG"),
	}, {
		name: "stakesubmission simple case p2sh",
		before: mustParseShortFormV0("SSTX HASH160 DATA_20 0x00{16} 0x01020304 " +
			"EQUAL"),
		remove: []byte{1, 2, 3, 4},
		after:  mustParseShortFormV0("SSTX HASH160 EQUAL"),
	}, {
		name: "stakesubmission simple case p2sh (miss)",
		before: mus


@_JQFHeah]GhCDXSFX@ !B?`Bw@h`Bm?vH?[\\Bb@Jw?_x@bOvw?Oy?m?w~@K_}?g~w@k\\B?`@", "thio_urea_Q(1)" },
			{ "doH`Drg@HRYVUWuMj``RP@~IHjAcX@ !B?`Bw@h`Bm?vH?_y?mpJH@k_}mwvH?[_|b@JH?P", "thio_urea_R(1)" },
			{ "do}HPANPBLBLdTTrtJTIjf[Yj`a[{Mb|_Mqc@ !BwzXBbKlkLXB@SbnDmpJ@Sox@m?vw@k_}mpK~_p", "thiophene_C(3)" },
			{ "do~DPCFPBLBLdTTvTJTJjeiYj`a[{Mb|_Mqc@ !BwzXBbKlkLX@kaHANmpKRtOx@m?vw@k_}mpK~_p", "thiophene_C(3)" },
			{ "dmuD`AUn@HRfUorjYfj@OjRJ`XgE` !BtMHkaCF@bOw|bHQT?g~H@ig@bOt", "thiophene_D(2)" },
			{ "dg}HPAw`BEBDig{Y\\h{ifZfi@OjRL`hjA` !BtLtknsF?b@HBmxc}?g~H@hc}tMINouR{pId", "thiophene_E(2)" },
			{ "foAQA@IFD@HtDYHhicLhebegTsSTuH@_TqAHiCLe@ !BtLtknsF?b@HBm{}NbOw~_x`BbOwPtdz?UKo@fP", "thiophene_E(2)" },
			{ "foAQA@IFD@HtDYHhmMBhebegTsSTuLBT@~hbLQRNYJ@ !BtLtknsF?b@HBmxc}?`C~_x`BbOwPtdz?UKo@fP", "thiophene_E(2)" },
			{ "f`qQA@EVd@HLDYHhihXUDlT]zfZfijXDhA}SDTafBqT@ !BtLtknsF?b@HBm{}NbOw~@Oy?b@JH?]CRSk}Tn|BY", "thiophene_E(2)" },
			{ "dg]LPLnDL@b`cIHUDhdipkTuTr@_EdKFq\\@ !BmpK~_x`BbOuNo}CRpIeTnz[@tl~@Sf@ZnuP", "thiophene_F(1)" },
			{ "daFH`Lx@aJY|jjVX@~qHsJ` !BOr[|BGlkLP@kAG_|]?t", "thiophene_amino_Aa(45)" },
			{ "fdyab@LRtX@QdbbRRbbcRIPLZejY`@`@OdHcD@ !BtMHkaHc}LXC|bOy?aESMtK_}bOvYpFAeotxlFLwPs]@lF@", "thiophene_amino_Ab(40)" },
			{ "fleab@LJMX@QdbbbRtTTZQJQSTmTs@A@@_HqCL@ !BtMHkaHc}LXC|bK|q?g~DULwPm?vH?Yg@XFV?SbpXs]CMtBpX", "thiophene_amino_Ab(40)" },
			{ "fbuab@LZlx@Qdbbb


tionTagColumn(ctx)
    addSupportsDbtColumn(ctx)
  }

  companion object {
    @JvmStatic
    fun addNormalizationRepositoryColumn(ctx: DSLContext) {
      ctx
        .alterTable("actor_definition")
        .addColumnIfNotExists(DSL.field("normalization_repository", SQLDataType.VARCHAR(255).nullable(true)))
        .execute()
    }

    @JvmStatic
    fun addNormalizationTagColumn(ctx: DSLContext) {
      ctx
        .alterTable("actor_definition")
        .addColumnIfNotExists(DSL.field("normalization_tag", SQLDataType.VARCHAR(255).nullable(true)))
        .execute()
    }

    @JvmStatic
    fun addSupportsDbtColumn(ctx: DSLContext) {
      ctx
        .alterTable("actor_definition")
        .addColumnIfNotExists(DSL.field("supports_dbt", SQLDataType.BOOLEAN.nullable(true)))
        .execute()
    }
  }
}
/*
 * Copyright (c) 2020-2025 Airbyte, Inc., all rights reserved.
 */

package io.airbyte.db.instance.configs.migrations

import io.github.oshai.kotlinlogging.KotlinLogging
import org.flywaydb.core.api.migration.BaseJavaMigration
import org.flywaydb.core.api.migration.Context
import org.jooq.DSLContext
import org.jooq.Record1
import org.jooq.impl.DSL
import org.jooq.impl.SQLDataType
import java.util.UUID
import java.util.stream.Collectors

private val log = KotlinLogging.logger {}

@Suppress("ktlint:standard:class-naming")
class V1_1_1_013__PopulateDataplaneGroups : BaseJavaMigration() {
  override fun migrate(context: Context) {
    log.info { "Running migration: ${javaClass.simpleName}" }
    val ctx = DSL.using(context.connection)
    doMigration(ctx)
  }

  companion object {
    // DEFAULT_ORGANIZATION_ID is from io.airbyte.config.persistence.OrganizationPersistence
    val DEFAULT_ORGANIZATION_ID: UUID = UUID.fromString("00000000-0000-0000-0000-000000000000")
    private val WORKSPACE = DSL.table("workspace")
    private val DATAPLANE_GROUP = DSL.table("dataplane_group")
    private val GEOGRAPHY = DSL.field("geography", SQLDataType.VARCHAR)
    private val ID = DSL.field("id", SQLDataType.UUID)
    private val NAME = DSL.field("name", SQLDataType.VARCHAR)
    private val ENABLED = DSL.field("enabled", SQLDataType.BOOLEAN)
    private val TOMBSTONE = DSL.field("tombstone", SQLDataType.BOOLEAN)
    private val ORGANIZATION_ID = DSL.field("organization_id", SQLDataType.UUID)
    private val UPDATED_BY = DSL.field("updated_by", SQLDataType.UUID)
    private const val GEOGRAPHY_AUTO = "AUTO"
    private const val GEOGRAPHY_US = "US"
    private const val GEOGRAPHY_EU = "EU"

    @JvmStatic
    fun doMigration(ctx: DSLContext) {
      dropUpdatedByNotNullConstraint(ctx)
      addDataplaneGroupNameConstraint(ctx)
      populateDataplaneGroups(ctx)
    }

    fun dropUpdatedByNotNullConstraint(ctx: DSLContext) {
      log.info { "Dropping NOT NULL constraint on updated_by" }
      ctx
        .alterTable(DATAPLANE_GROUP)
        .alterColumn(UPDATED_BY)
        .dropNotNull()
        .execute()
    }

    fun addDataplaneGroupNameConstraint(ctx: DSLContext) {
      log.info { "Checking if constraint 'dataplane_group_name_matches_geography' exists" }

      val constraintExists =
        ctx.fetch


nterval_pattern, "one_one")
                    elseif 0 == de.intervals[1] then
                        increment(dashInterval_pattern, "zero_on")
                    else
                        increment(dashInterval_pattern, "other")
                    end
                end

                if 0 == de.phase then
                    increment(dash_phase, "zero")
                else
                    increment(dash_phase, "other")
                end

                local cap = p:getStrokeCap()
                if 0 == cap then
                    increment(dash_cap, "butt")
                elseif 1 == cap then
                    increment(dash_cap, "round")
                else
                    increment(dash_cap, "square")
                end

                if "drawPoints" == t.verb then
                    local points = t.points
                    increment(drawPoints_count, #points)
                    if 2 == #points then
                        if points[1].y == points[2].y then
                            increment(drawPoints_direction, "hori")
                        elseif points[1].x == points[2].x then
                            increment(drawPoints_direction, "vert")
                        else
                            increment(drawPoints_direction, "other")
                        end
                    end
                end

                --[[
                    eventually would like to print out info on drawPath verbs with dashed effect
                ]]
                if "drawPath" == t.verb then
                end

            end
        end
    end
end

--[[
    lua_pictures will call this function after all of the pictures have been
    "accumulated".
]]
function sk_scrape_summarize()
-- use for non telemetry
--[[
    io.write("Total dashed effects is: ", dashCount, "\n");
    for k1, v1 in next, dashTable do
        io.write("\nTable: ", k1, "\n")
        for k, v in next, v1 do
            io.write("\"", k, "\": ", v, "\n")
        end
    end
]]

-- use for telemetry
    io.write("\ndashCount = dashCount + ", tostring(dashCount), "\n")
    for k1, v1 in next, dashTable do
        for k, v in next, v1 do
            io.write("\nincrement(dashTable, \"", k1, "\", \"", k, "\", ", v, ")\n")
        end
    end
end


rn nil, errors.Wrap(err, "creating istio virtualservice")
	}

	return h.toEndpoint(newVirtualService)
}

func (h *knative) Get(ctx context.Context, meta *dapi.Meta) (*dapi.Endpoint, error) {
	virtualServices := h.knClient.NetworkingV1alpha3().VirtualServices(meta.Org)
	endpointName := knaming.EndpointName(*meta)

	virtualService, err := virtualServices.Get(endpointName, metav1.GetOptions{})
	if err != nil {
		if kerrors.IsNotFound(err) {
			return nil, NotFound{err}
		}
		return nil, errors.Wrapf(err, "getting istio virtualservice '%s'", endpointName)
	}

	return h.toEndpoint(virtualService)
}

func (h *knative) Delete(ctx context.Context, meta *dapi.Meta) error {
	virtualServices := h.knClient.NetworkingV1alpha3().VirtualServices(meta.Org)
	endpointName := knaming.EndpointName(*meta)

	err := virtualServices.Delete(endpointName, &metav1.DeleteOptions{})
	if err != nil {
		if kerrors.IsNotFound(err) {
			return NotFound{err}
		}
		return errors.Wrapf(err, "deleting istio virtualservice '%s'", endpointName)
	}
	return nil
}

func (h *knative) List(ctx context.Context, meta *dapi.Meta) ([]*dapi.Endpoint, error) {
	virtualServices := h.knClient.NetworkingV1alpha3().VirtualServices(meta.Org)

	log.Debugf("listing virtualservices for namespace: %s [%s]", meta.Org, meta.Project)
	virtualServiceList, err := virtualServices.List(metav1.ListOptions{
		LabelSelector: knaming.ToLabelSelector(map[string]string{
			knaming.ProjectLabel: meta.Project,
		}),
	})
	if err != nil {
		return nil, errors.Wrap(err, "listing istio virtualservices")
	}

	var endpoints []*dapi.Endpoint

	for i := range virtualServiceList.Items {
		objectMeta := &virtualServiceList.Items[i].ObjectMeta
		if objectMeta.Labels[knaming.OrgLabel] != "" {
			e, err := h.toEndpoint(&virtualServiceList.Items[i])
			if err != nil {
				return nil, err
			}
			endpoints = append(endpoints, e)
		}
	}
	log.Debugf("found %d virtualservices for namespace: %s [%s]", len(endpoints), meta.Org, meta.Project)
	return endpoints, nil
}

func (h *knative) Update(ctx context.Context, endpoint *dapi.Endpoint) (*dapi.Endpoint, error) {
	virtualService := h.fromEndpoint(endpoint)
	virtualServices := h.knClient.NetworkingV1alpha3().VirtualServices(endpoint.Org)

	updatedVirtualService, err := virtualServices.Update(virtualService)
	if err != nil {
		if kerrors.IsNotFound(err) {
			return nil, NotFound{err}
		}
		return nil, errors.Wrap(err, "updating istio virtualservice")
	}

	return h.toEndpoint(updatedVirtualService)
}

func (h *knative) fromEndpoint(model *dapi.Endpoint) *v1alpha3.VirtualService {
	virtualService := &v1alpha3.VirtualService{
		ObjectMeta: knaming.ToObjectMeta(model.Meta, *model),
	}

	hosts := model.Hosts
	if len(model.Hosts) == 0 {
		hosts = append(hosts, fmt.Sprintf("%s.%s.%s", model.Project, model.Org, h.config.DispatchHost))
	}

	virtualService.Spec.Hosts = hosts
	virtualService.Spec.Gateways = []string{h.config.SharedGateway,


.6 & 78.3 & 85.4 \\\\ COCO (C) & **70.2** & 67.6 & 90.9 & 74.5 \\\\ concat. L \\& C & 70.1 & 76.2 & 83.4 & 88.6 \\\\ sample unf. L \\& C & 69.9 & 71.6 & 82.7 & 60.8 \\\\ LAION-COCO & 69.0 & **77.4** & **91.7** & **93.6** \\\\ \\hline \\hline \\end{tabular}\n' +
      '\\end{table}\n' +
      'Table 4: The zero-shot performance of fine-tuning CLIP with different datasets, with and without hard negative texts.\n' +
      '\n' +
      '\\begin{table}\n' +
      '\\begin{tabular}{c|c c c|c c c c|c} \\hline \\hline  & \\multicolumn{4}{c|}{Text-to-Image/Video} & \\multicolumn{4}{c|}{Image/Video-to-Text} & \\multirow{4}{*}{avg.} \\\\ \\cline{2-2} \\cline{5-10}  & & & & & & & & \\\\ \\cline{1-1} pre-trained & 52.3 & 48.4 & 54.9 & 13.8 & 51.0 & 40.7 & 50.8 & 11.3 & 40.4 \\\\ \\hline NegCLIP & 50.3 & 48.8 & 56.9 & 13.9 & 47.9 & 41.9 & 48.2 & 09.8 & 39.7 \\\\ REPLACE & 49.6 & **50.2** & 56.2 & 13.6 & 44.8 & 40.8 & 47.9 & 09.7 & 39.1 \\\\ \\hline CLIP+CLoVe w/o patching & 47.3 & 35.0 & 53.1 & 11.4 & 43.4 & 37.8 & 42.7 & 08.0 & 34.8 \\\\ CLIP+CLoVe (\\(\\alpha=.6\\)) & **58.7** & 49.9 & **60.5** & **15.7** & **57.5** & **47.5** & **54.5** & **12.4** & **44.6** \\\\ \\hline \\hline \\end{tabular}\n' +
      '\\end{table}\n' +
      'Table 3: Zero-shot retrieval results.\n' +
      '\n' +
      'improvements over the pre-trained model. Interestingly, Betker et al. (2023) also found synthetic captions helpful for text-to-image generation models. They show synthetic captions help such models generate images that align better with the input text.\n' +
      '\n' +
      'The Importance of Hard Negatives.Yuksekgonul et al. (2023); Hsieh et al. (2023) showed that employing randomly generated text negatives as part of the training process can significantly improve the language compositionality skills of pre-trained models. We apply REPLACE (Hsieh et al., 2023) to obtain randomly generated hard negative text along with the LAION-COCO dataset (Schuhmann et al., 2022) and compare it to fine-tuning without negatives. We present the results in Table 5. In this setting, we can observe that employing negatives improves performance over not using them, as measured by the ARO benchmark (Yuksekgonul et al., 2023) (its tasks are, in the order that we show them: VG-Attribution, VG-Relation, COCO-Order, and Flickr30k-Order).\n' +
      '\n' +
      'The Importance of Model Patching.Existing methods to improve CLIP\'s compositionality by employing negatives used by Yuksekgonul et al. (2023); Hsieh et al. (2023) do so by considerably hurting the model\'s performance on more standard object-centric benchmarks such as ImageNet (Deng et al., 2009).\n' +
      '\n' +
      'Figure 3 presents the effect of varying this value for both a compositionality benchmark and an object-centric one. When \\(\\alpha\\) is around 0.4-0.7, the model performs well on both.\n' +
      '\n' +
      '## 5 Conclusions\n' +
      '\n' +
      'In this paper, we introduced CLoVe - a framework to considerably improve the compositionality of pre-trained Contrastive VLMs while preserving their performance on other tasks, unlike existing methods. Our approach combines fine-tuning contrastive VLMs with hard negative texts by leveraging synthetically captioned images, as they can provide an excellent tradeoff between quality and quantity. Subsequently, it patches the original model with the fine-tu


DesignVarNums(elemIndex, dvLen,
                                                        dvNums);
  if (dvNums && dvLen >= this->numDesignVars) {
    if (this->panelWidthNum >= 0) {
      dvNums[this->panelWidthLocalNum] = panelWidthNum;
    }
  }
  return numDesignVars;
}

// Set the element design variable from the design vector
int TACSGPBladeStiffenedShellConstitutive::setDesignVars(
    int elemIndex, int dvLen, const TacsScalar dvs[]) {
  TACSBladeStiffenedShellConstitutive::setDesignVars(elemIndex, dvLen, dvs);
  if (dvLen >= this->numDesignVars) {
    if (this->panelWidthNum >= 0) {
      this->panelWidth = dvs[this->panelWidthLocalNum];
    }
  }

  // NOTE : this is a very important step => here we reset the save on all
  // computed GP models so they recalculate and compute their new values.
  if (this->panelGPs) {
    this->panelGPs->resetSavedData();
  }

  return this->numDesignVars;
}

// Get the element design variables values
int TACSGPBladeStiffenedShellConstitutive::getDesignVars(int elemIndex,
                                                         int dvLen,
                                                         TacsScalar dvs[]) {
  TACSBladeStiffenedShellConstitutive::getDesignVars(elemIndex, dvLen, dvs);
  if (dvLen >= this->numDesignVars) {
    if (this->panelWidthNum >= 0) {
      dvs[this->panelWidthLocalNum] = this->panelWidth;
    }
  }
  return this->numDesignVars;
}

// Get the lower and upper bounds for the design variable values
int TACSGPBladeStiffenedShellConstitutive::getDesignVarRange(int elemIndex,
                                                             int dvLen,
                                                             TacsScalar lb[],
                                                             TacsScalar ub[]) {
  TACSBladeStiffenedShellConstitutive::getDesignVarRange(elemIndex, dvLen, lb,
                                                         ub);
  if (dvLen >= this->numDesignVars) {
    if (this->panelWidthNum >= 0) {
      lb[this->panelWidthLocalNum] = this->panelWidthLowerBound;
      ub[this->panelWidthLocalNum] = this->panelWidthUpperBound;
    }
  }
  return this->numDesignVars;
}

// ==============================================================================
// Buckling functions
// ==============================================================================

TacsScalar TACSGPBladeStiffenedShellConstitutive::computeAffineAspectRatioSens(
    const TacsScalar rho0sens, const TacsScalar D11, const TacsScalar D22,
    const TacsScalar a, const TacsScalar b, TacsScalar *D11sens,
    TacsScalar *D22sens, TacsScalar *asens, TacsScalar *bsens) {
  // compute the derivatives of the affine aspect ratio and return the affine
  // aspect ratio
  TacsScalar rho_0 = computeAffineAspectRatio(D11, D22, a, b);
  // where rho_0 = a/b * (D22/D11)**0.25

  // use power series rules d(x^p) = p * (x^p) / x to cleanly differentiate the
  // expression
  *D11sens += rho0sens * rho_0 * -0.25 / D11;
  *D22sens += rho0sens * rho_0 * 0.25 / D22;
  *asens += rho0sens * rho_0 / a;
  *bsens += rho0sens * rho_0 * -1.0 / b;


 fast block, head full block) before deleting the data.
		markerBatch := hc.chainDb.NewBatch()
		if updateFn != nil {
			newHead, force := updateFn(markerBatch, parent)
			if force && newHead < head {
				log.Warn("Force rewinding till ancient limit", "head", newHead)
				head = newHead
			}
		}
		// Update head header then.
		rawdb.WriteHeadHeaderHash(markerBatch, parentHash)
		if err := markerBatch.Write(); err != nil {
			log.Crit("Failed to update chain markers", "error", err)
		}
		hc.currentHeader.Store(parent)
		hc.currentHeaderHash = parentHash
		headHeaderGauge.Update(parent.Number.Int64())

		// If this is the first iteration, wipe any leftover data upwards too so
		// we don't end up with dangling daps in the database
		var nums []uint64
		if origin {
			for n := num + 1; len(rawdb.ReadAllHashes(hc.chainDb, n)) > 0; n++ {
				nums = append([]uint64{n}, nums...) // suboptimal, but we don't really expect this path
			}
			origin = false
		}
		nums = append(nums, num)

		// Remove the related data from the database on all sidechains
		for _, num := range nums {
			// Gather all the side fork hashes
			hashes := rawdb.ReadAllHashes(hc.chainDb, num)
			if len(hashes) == 0 {
				// No hashes in the database whatsoever, probably frozen already
				hashes = append(hashes, hdr.Hash())
			}
			for _, hash := range hashes {
				if delFn != nil {
					delFn(batch, hash, num)
				}
				rawdb.DeleteHeader(batch, hash, num)
				rawdb.DeleteTd(batch, hash, num)
			}
			rawdb.DeleteCanonicalHash(batch, num)
		}
	}
	// Flush all accumulated deletions.
	if err := batch.Write(); err != nil {
		log.Crit("Failed to rewind block", "error", err)
	}
	// Clear out any stale content from the caches
	hc.headerCache.Purge()
	hc.tdCache.Purge()
	hc.numberCache.Purge()
}

// SetGenesis sets a new genesis block header for the chain
func (hc *HeaderChain) SetGenesis(head *types.Header) {
	hc.genesisHeader = head
}

// Config retrieves the header chain's chain configuration.
func (hc *HeaderChain) Config() *params.ChainConfig { return hc.config }

// Engine retrieves the header chain's consensus engine.
func (hc *HeaderChain) Engine() consensus.Engine { return hc.engine }

// GetBlock implements consensus.ChainReader, and returns nil for every input as
// a header chain does not have blocks available for retrieval.
func (hc *HeaderChain) GetBlock(hash common.Hash, number uint64) *types.Block {
	return nil
}
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package miner implements Ethereum block creation and mining.
package miner

import (


Util();
    private Wallet wallet = realmUtil.queryDefauleWallet();
    private CtListPresenter presenter;
    @BindView(R.id.next_step_layout)
    View nextLayout;
    @BindView(R.id.confirm_layout)
    View confirmLayout;
    String cid;

    @BindView(R.id.fee)
    TextView feeTv;
    @BindView(R.id.impeachvotes)
    TextView amountTv;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_ct_impeachment;
    }

    @Override
    protected void setExtraData(Bundle data) {
        super.setExtraData(data);
        cid = data.getString("cid");
    }

    @Override
    protected void initView(View view) {
        new CRSignUpPresenter().getFee(wallet.getWalletId(), MyWallet.ELA, "", "8USqenwzA5bSAvj1mG4SGTABykE9n5RzJQ", "0", this);
        presenter = new CtListPresenter();
//        presenter.getVoteInfo(wallet.getWalletId(), MyWallet.ELA, "CRC", this);
    }

    @OnClick({R.id.close, R.id.next_step_btn, R.id.confirm_btn})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.close:
                popBackFragment();
                break;
            case R.id.next_step_btn:
                nextLayout.setVisibility(View.GONE);
                confirmLayout.setVisibility(View.VISIBLE);
                break;
            case R.id.confirm_btn:
                impeachCt();
                break;
        }
    }

    private void impeachCt() {
        presenter.getCouncilList(this, String.valueOf(1));
    }

    JSONArray otherUnActiveVote = new JSONArray();
    private void createJsonObject(CtListBean ctListBean) {
        List<CtListBean.Council> councils = ctListBean.getData().getCouncil();
        JSONObject unActiveVotes = new JSONObject();
        List<String> candidates = new ArrayList<>();
        if(null==councils || councils.size()<=0) return;
        for(CtListBean.Council council : councils) {
            String status = council.getStatus();
            String did = council.getDid();
            if(AppUtlis.isNullOrEmpty(status) || !status.equals("Elected")) {
                candidates.add(did);
            }
        }

        unActiveVotes.put("Type", "CRCImpeachment");
        unActiveVotes.put("Candidates", JSON.toJSON(candidates));
        otherUnActiveVote.add(unActiveVotes);
    }

    JSONObject otherVotes = new JSONObject();
    private void getVotes(CommmonStringEntity commmonStringEntity) {
        try {
            if(null == commmonStringEntity) return;
            String json = commmonStringEntity.getData();

            JSONArray jsonArray = (JSONArray) JSON.parse(json);
            JSONObject jsonObject = (JSONObject) jsonArray.get(0);
            JSONObject votesObj = (JSONObject) jsonObject.get("Votes");
            String amount = (String) votesObj.get(cid);

            otherVotes.put(cid, amount);
            Log.d("test", "amount:"+amount);
        } catch (Exception e) {
            e.printStackTrace();
        }
//        otherVotes.put(did, amount);
    }

    private void doVote() {
        presenter.createImpeachmentCRCTransaction(wallet.getWalletId(), MyWallet.ELA, "", otherVotes.toJSONString(), "", otherUnActiveVote.toJSONString(), this);
    }

    @Override
    public void onGetData(String methodName, BaseEntity baseEntity, Object o) {
        if(methodName.equals("getFee")) {
            long fee = ((CommmonLongEntity) baseEntity).getData();
            feeTv.setText(NumberiUtil.ma


pe.GetTypeInfo()); }
		}

		public MockAssembly(string location, params Type[] exportedTypes)
		{
			this.fullName = PathOp.GetFileNameWithoutExtension(location);
			this.location = location;
			this.exportedTypes.AddRange(exportedTypes);
		}

		public void AddPrivateType(Type type)
		{
			this.privateTypes.Add(type);
		}
		public void AddExportedType(Type type)
		{
			this.exportedTypes.Add(type);
		}

		public override Type[] GetExportedTypes()
		{
			this.ThrowIfInvalid();
			return this.exportedTypes
				.ToArray();
		}
		public override Type[] GetTypes()
		{
			this.ThrowIfInvalid();
			return this.exportedTypes
				.Concat(this.privateTypes)
				.ToArray();
		}

		private void ThrowIfInvalid()
		{
			if (this.invalid)
				throw new TypeLoadException("This is a mocked invalid Assembly");
		}

		public static MockAssembly CreateInvalid(string location)
		{
			MockAssembly assembly = new MockAssembly(location);
			assembly.invalid = true;
			return assembly;
		}
	}
}


        if (b > 1)
            {
                b -= 1;
                float bbbb = (b * b) * (b * b);
                float xo, yo, zo;
                if (outGradOnly)
                {
                    int hash = Hash(seed, i1, j1, k1) & (255 << 2);
                    xo = RandVecs3D[hash];
                    yo = RandVecs3D[hash | 1];
                    zo = RandVecs3D[hash | 2];
                }
                else
                {
                    int hash = Hash(seed, i1, j1, k1);
                    int index1 = hash & (63 << 2);
                    int index2 = (hash >> 6) & (255 << 2);
                    float xg = Gradients3D[index1];
                    float yg = Gradients3D[index1 | 1];
                    float zg = Gradients3D[index1 | 2];
                    float value = x1 * xg + y1 * yg + z1 * zg;
                    float xgo = RandVecs3D[index2];
                    float ygo = RandVecs3D[index2 | 1];
                    float zgo = RandVecs3D[index2 | 2];
                    xo = value * xgo;
                    yo = value * ygo;
                    zo = value * zgo;
                }
                vx += bbbb * xo;
                vy += bbbb * yo;
                vz += bbbb * zo;
            }

            if (l == 1) break;

            ax0 = 0.5f - ax0;
            ay0 = 0.5f - ay0;
            az0 = 0.5f - az0;

            x0 = xNSign * ax0;
            y0 = yNSign * ay0;
            z0 = zNSign * az0;

            a += (0.75f - ax0) - (ay0 + az0);

            i += (xNSign >> 1) & PrimeX;
            j += (yNSign >> 1) & PrimeY;
            k += (zNSign >> 1) & PrimeZ;

            xNSign = -xNSign;
            yNSign = -yNSign;
            zNSign = -zNSign;

            seed += 1293373;
        }

        coord.x += vx * warpAmp;
        coord.y += vy * warpAmp;
        coord.z += vz * warpAmp;
    }

    public static class Vector2
    {
        public /*FNLfloat*/ float x;
        public /*FNLfloat*/ float y;
        public Vector2(/*FNLfloat*/ float x, /*FNLfloat*/ float y)
        {
            this.x = x;
            this.y = y;
        }
    }

    public static class Vector3
    {
        public /*FNLfloat*/ float x;
        public /*FNLfloat*/ float y;
        public /*FNLfloat*/ float z;
        public Vector3(/*FNLfloat*/ float x, /*FNLfloat*/ float y, /*FNLfloat*/ float z)
        {
            this.x = x;
            this.y = y;
            this.z = z;
        }
    }
}
/*
 * Copyright 2019 ZHENG BAO LE
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package me.zbl.authmore.clientsample;

import me.zbl.authmore.client.ClientRestTemplate;
import me.zbl.authmore.client.PasswordToken


        let scalar = C::Scalar::from(k as u64)
                    * C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0])
                    - sum;
                (base * scalar).to_affine()
            })
            .collect::<ArrayVec<C, H>>()
            .into_inner()
            .unwrap(),
    );

    window_table
}

/// For each window, we interpolate the $x$-coordinate.
/// Here, we pre-compute and store the coefficients of the interpolation polynomial.
pub fn compute_lagrange_coeffs<C: CurveAffine>(base: C, num_windows: usize) -> Vec<[C::Base; H]> {
    // We are interpolating over the 3-bit window, k \in [0..8)
    let points: Vec<_> = (0..H).map(|i| C::Base::from(i as u64)).collect();

    let window_table = compute_window_table(base, num_windows);

    window_table
        .iter()
        .map(|window_points| {
            let x_window_points: Vec<_> = window_points
                .iter()
                .map(|point| *point.coordinates().unwrap().x())
                .collect();
            lagrange_interpolate(&points, &x_window_points)
                .into_iter()
                .collect::<ArrayVec<C::Base, H>>()
                .into_inner()
                .unwrap()
        })
        .collect()
}

/// For each window, $z$ is a field element such that for each point $(x, y)$ in the window:
/// - $z + y = u^2$ (some square in the field); and
/// - $z - y$ is not a square.
/// If successful, return a vector of `(z: u64, us: [C::Base; H])` for each window.
///
/// This function was used to generate the `z`s and `u`s for the Orchard fixed
/// bases. The outputs of this function have been stored as constants, and it
/// is not called anywhere in this codebase. However, we keep this function here
/// as a utility for those who wish to use it with different parameters.
pub fn find_zs_and_us<C: CurveAffine>(
    base: C,
    num_windows: usize,
) -> Option<Vec<(u64, [C::Base; H])>> {
    // Closure to find z and u's for one window
    let find_z_and_us = |window_points: &[C]| {
        assert_eq!(H, window_points.len());

        let ys: Vec<_> = window_points
            .iter()
            .map(|point| *point.coordinates().unwrap().y())
            .collect();
        (0..(1000 * (1 << (2 * H)))).find_map(|z| {
            ys.iter()
                .map(|&y| {
                    if (-y + C::Base::from(z)).sqrt().is_none().into() {
                        (y + C::Base::from(z)).sqrt().into()
                    } else {
                        None
                    }
                })
                .collect::<Option<ArrayVec<C::Base, H>>>()
                .map(|us| (z, us.into_inner().unwrap()))
        })
    };

    let window_table = compute_window_table(base, num_windows);
    window_table
        .iter()
        .map(|window_points| find_z_and_us(window_points))
        .collect()
}

/// Test that the z-values and u-values satisfy the conditions:
///      1. z + y = u^2,
///      2. z - y is not a square
/// for the y-coordinate of each fixed-base


    try {
            return java.lang.Double.parseDouble(parserDouble)
        } catch (e: Exception) {
            return 0.0
        }

    }

    fun format2Decimal(d: Double?): String {
        val instance = DecimalFormat.getInstance()
        instance.minimumFractionDigits = 2
        instance.maximumFractionDigits = 2
        return instance.format(d)
    }

    fun formatDecimal(d: Double?): String {
        val instance = DecimalFormat.getInstance()
        instance.minimumFractionDigits = 0
        instance.maximumFractionDigits = 8
        return instance.format(d).replace(",", "")
    }

    /**
     * converting a double number to string by digits
     */
    fun getStringByDigits(num: Double, digits: Int): String {
        /* if (digits == 0) {
            return (int) num + "";
        } else {
            NumberFormat instance = DecimalFormat.getInstance();
            instance.setMinimumFractionDigits(digits);
            instance.setMaximumFractionDigits(digits);
            return instance.format(num).replace(",", "");
        }*/
        return String.format(Locale.getDefault(), "%." + digits + "f", num)
    }

    private const val MILLION = 10000.0
    private const val MILLIONS = 1000000.0
    private const val BILLION = 100000000.0
    private const val MILLION_UNIT = "万"
    private const val BILLION_UNIT = "亿"

    /**
     * 将数字转换成以万为单位或者以亿为单位，因为在前端数字太大显示有问题
     */
    fun amountConversion(amount: Double, keepTwoDigits: Boolean): String {

        val result: String

        result = if (amount < 1) {
            when {
                keepTwoDigits -> getStringByDigits(amount, 2)
                amount.toString().length > 8 -> getStringByDigits(amount, 6)
                else -> "$amount"
            }
        } else {
            val lengthInt = "${amount.toInt()}".length
            if (lengthInt < 8) {
                if (keepTwoDigits) {
                    getStringByDigits(amount, 2)
                } else {
                    getStringByDigits(amount, 8 - lengthInt)
                }
            } else {
                formatNumberInfo(amount).toString()
            }
        }

        return result

    }

    /**
     * 将数字转换成以万为单位或者以亿为单位，因为在前端数字太大显示有问题
     *
     * @author
     * @version 1.00.00
     *
     * @date 2018年1月18日
     * @param amount 报销金额
     * @return
     */

    private fun formatNumberInfo(amount: Double): NumberInfo {
        var amount = amount
        val info = NumberInfo()
        if (amount == 0.0) {
            info.number = "0.00"
            info.unit = ""
            return info
        }
        val positiveNum = amount >= 0
        amount = Math.abs(amount)

        //最终返回的结果值
        info.number = amount.toString()
        //四舍五入后的值
        var value = 0.0
        //转换后的值
        var tempValue = 0.0
        //余数
        var remainder = 0.0

        //金额大于1万小于100万
        if (amount > MILLION && amount <= MILLIONS) {
            tempValue = amount / MILLION
            remainder = amount % MILLION

            //余数小于5000则不进行四舍五入
            //            if(remainder < (MILLION / 2)){
            //                value = formatNumber(tempValue,2,false);
            //            }else{
            //                value = formatNumber(tempValue,2,true);
            //            }
            value = formatNumber(tempValue, 2, true)

            info.number = zeroFill(value)
            info.unit = MILLION_UNIT
        } else if (amount > MILLIONS && amount <= BILLION) {
            tempValue = amount / MILLION
            remainder =


 分类   | 在ImageNet数据集中，"Golden Retriever"属于哪个大类别？                                                                                |
| 生成   | 请描述一张图片中的场景，包括其中的物体以及它们之间的关系。                                                                                |
| 编辑   | 给定一段英文文章，请修改其中的语法错误并给出修改后的句子。                                                                                |
| 比较   | 比较KNN和SVM这两种常见的机器学习算法，在什么情况下KNN表现更好，在什么情况下SVM表现更好？                                                                                |
| 理解   | 给定一段自然语言文本，请问其中的主题是什么？                                                                                |
| 聚类   | 给定一个数据集，请使用聚类算法将数据分成尽可能多的类别，并计算每个类别的中心点。                                                                                |
| 预测   | 基于一份用户购物历史记录，预测该用户是否会购买一款新上架的商品。                                                                                |
| 识别   | 对于一段语音信号，请提取其MFCC特征并用于进行说话人识别任务。                                                                                |
| 推荐   | 基于用户历史行为、商品信息等数据，请推荐该用户可能感兴趣的前五个商品。                                                                                |
| 翻译   | 将一篇中文文章翻译成英文，并保持其原有的文意和结构。                                                                                |
|自然语言生成|请使用GPT-3.5生成一�


FromTask,
      'my.name.space',
      'xyz/abc.zip',
    );

    await testing.fakeauth.withAnonymousScopes(['queue:get-artifact:xyz/abc.zip'], async () => {
      const res = await request.get(url).redirects(0).catch(function(err) {
        return err.response;
      });
      assert.equal(res.statusCode, 303, 'Expected 303 redirect');
      const location = res.headers.location.replace(/bewit=.*/, 'bewit=xyz');
      assert.equal(location,
        libUrls.api(helper.rootUrl, 'queue', 'v1', `/task/${taskId}/artifacts/xyz%2Fabc.zip?bewit=xyz`));
    });
  });

  test('access private artifact (with * scope)', async function() {
    const taskId = slugid.nice();
    debug('### Insert task into index');
    await helper.index.insertTask('my.name.space', {
      taskId: taskId,
      rank: 41,
      data: { hello: 'world' },
      expires: taskcluster.fromNowJSON('24 hours'),
    });

    debug('### Download private artifact using index');
    const url = helper.index.buildSignedUrl(
      helper.index.findArtifactFromTask,
      'my.name.space',
      'not-public/abc.zip',
    );
    const res = await request.get(url).redirects(0).catch(function(err) {
      return err.response;
    });
    assert.equal(res.statusCode, 303, 'Expected 303 redirect');
    const location = res.headers.location.replace(/bewit=.*/, 'bewit=xyz');
    assert.equal(location,
      libUrls.api(helper.rootUrl, 'queue', 'v1', `/task/${taskId}/artifacts/not-public%2Fabc.zip?bewit=xyz`));
  });

  test('access private artifact (with no scopes)', async function() {
    const taskId = slugid.nice();
    debug('### Insert task into index');
    await helper.index.insertTask('my.name.space', {
      taskId: taskId,
      rank: 41,
      data: { hello: 'world' },
      expires: taskcluster.fromNowJSON('24 hours'),
    });

    debug('### Download private artifact using index without queue:get-artifact:..');
    helper.scopes('some-scope');
    const url = helper.index.buildSignedUrl(
      helper.index.findArtifactFromTask,
      'my.name.space',
      'not-public/abc.zip',
    );
    const res = await request.get(url).redirects(0).catch(function(err) {
      return err.response;
    });
    assert.equal(res.statusCode, 403, 'Expected 403 Forbidden');
  });

  test('delete task', async function() {
    const taskId = slugid.nice();
    debug('### Insert task into index');
    await helper.index.insertTask('some.testing.name.space', {
      taskId: taskId,
      rank: 41,
      data: { hello: 'world' },
      expires: taskcluster.fromNowJSON('24 hours'),
    });

    let result = await helper.index.findTask('some.testing.name.space');
    assert(result.taskId === taskId, 'Wrong taskId');

    await helper.index.deleteTask('some.testing.name.space');

    await assert.rejects(
      () => helper.index.findTask('some.testing.name.space'),
      err => err.code === 'ResourceNotFound');

    // parent namespace still exists
    let listRes = await helper.index.listNamespaces('some.testing');
    assert.deepEqual(listRes.namespaces.map(({ name }) => name), ['name']);
  });
});
import assert from 'assert';
import events from 'events';
import debugFactory from 'debug';
const debug = debugFactory('hooks:scheduler');
import taskcluster from '@taskcluster/client';
import nextDate from './nextdate.js';
import taskcrea


  {d20-d21},[r2,:128]!    @ {z[o2],z[o2+1]}
        vst2.32         {d16-d17},[r0,:128]!    @ {z[0],z[1]}
        vst2.32         {d22-d23},[r3,:128]!    @ {z[o3],z[o3+1]}
        vst2.32         {d18-d19},[r4,:128]!    @ {z[o1],z[o1+1]}
        sub             r5,  r5,  #8            @ wim -= 2
1:
        vld1.32         {d20-d21},[r2,:128]     @ {z[o2],z[o2+1]}
        vld1.32         {d22-d23},[r3,:128]     @ {z[o3],z[o3+1]}
        vswp            d21, d22
        vld1.32         {d4}, [r1]!             @ {wre[0],wre[1]}
        vrev64.32       q0,  q10
        vmul.f32        q10, q10, d4[0]
        vrev64.32       q1,  q11
        vmul.f32        q11, q11, d4[1]
        vld1.32         {d5}, [r5]              @ {wim[-1],wim[0]}
        vmul.f32        q0,  q0,  q3
        sub             r5,  r5,  #8            @ wim -= 2
        vmul.f32        q1,  q1,  q3
        vmla.f32        q10, q0,  d5[1]         @ {t1,t2,t5,t6}
        vmla.f32        q11, q1,  d5[0]         @ {t1a,t2a,t5a,t6a}
        vld2.32         {d16-d17},[r0,:128]     @ {z[0],z[1]}
        subs            r6,  r6,  #1            @ n--
        vld2.32         {d18-d19},[r4,:128]     @ {z[o1],z[o1+1]}
        vzip.32         q10, q11
        vadd.f32        d0,  d22, d20
        vadd.f32        d1,  d21, d23
        vsub.f32        d2,  d21, d23
        vsub.f32        d3,  d22, d20
        vsub.f32        q10, q8,  q0
        vadd.f32        q8,  q8,  q0
        vsub.f32        q11, q9,  q1
        vadd.f32        q9,  q9,  q1
        vst2.32         {d20-d21}, [r2,:128]!   @ {z[o2],z[o2+1]}
        vst2.32         {d16-d17}, [r0,:128]!   @ {z[0],z[1]}
        vst2.32         {d22-d23}, [r3,:128]!   @ {z[o3],z[o3+1]}
        vst2.32         {d18-d19}, [r4,:128]!   @ {z[o1],z[o1+1]}
        bne             1b

        pop             {r4-r6,pc}
endfunc

.macro  def_fft n, n2, n4
        .align 6
function fft\n\()_neon
        push            {r4, lr}
        mov             r4,  r0
        bl              fft\n2\()_neon
        add             r0,  r4,  #\n4*2*8
        bl              fft\n4\()_neon
        add             r0,  r4,  #\n4*3*8
        bl              fft\n


benchmark::State& state) {
  absl::Time now = absl::Now();
  while (state.KeepRunning()) {
    benchmark::DoNotOptimize(absl::ToTimespec(now));
  }
}
BENCHMARK(BM_Time_ToTimespec);

void BM_Time_FromTimespec(benchmark::State& state) {
  timespec ts = absl::ToTimespec(absl::Now());
  while (state.KeepRunning()) {
    if (++ts.tv_nsec == 1000 * 1000 * 1000) {
      ++ts.tv_sec;
      ts.tv_nsec = 0;
    }
    benchmark::DoNotOptimize(absl::TimeFromTimespec(ts));
  }
}
BENCHMARK(BM_Time_FromTimespec);

//
// Comparison with InfiniteFuture/Past
//

void BM_Time_InfiniteFuture(benchmark::State& state) {
  while (state.KeepRunning()) {
    benchmark::DoNotOptimize(absl::InfiniteFuture());
  }
}
BENCHMARK(BM_Time_InfiniteFuture);

void BM_Time_InfinitePast(benchmark::State& state) {
  while (state.KeepRunning()) {
    benchmark::DoNotOptimize(absl::InfinitePast());
  }
}
BENCHMARK(BM_Time_InfinitePast);

}  // namespace
// Copyright 2018 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "absl/functional/bind_front.h"

#include <stddef.h>

#include <functional>
#include <memory>
#include <string>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/memory/memory.h"

namespace {

char CharAt(const char* s, size_t index) { return s[index]; }

TEST(BindTest, Basics) {
  EXPECT_EQ('C', absl::bind_front(CharAt)("ABC", 2));
  EXPECT_EQ('C', absl::bind_front(CharAt, "ABC")(2));
  EXPECT_EQ('C', absl::bind_front(CharAt, "ABC", 2)());
}

TEST(BindTest, Lambda) {
  auto lambda = [](int x, int y, int z) { return x + y + z; };
  EXPECT_EQ(6, absl::bind_front(lambda)(1, 2, 3));
  EXPECT_EQ(6, absl::bind_front(lambda, 1)(2, 3));
  EXPECT_EQ(6, absl::bind_front(lambda, 1, 2)(3));
  EXPECT_EQ(6, absl::bind_front(lambda, 1, 2, 3)());
}

struct Functor {
  std::string operator()() & { return "&"; }
  std::string operator()() const& { return "const&"; }
  std::string operator()() && { return "&&"; }
  std::string operator()() const&& { return "const&&"; }
};

TEST(BindTest, PerfectForwardingOfBoundArgs) {
  auto f = absl::bind_front(Functor());
  const auto& cf = f;
  EXPECT_EQ("&", f());
  EXPECT_EQ("const&", cf());
  EXPECT_EQ("&&", std::move(f)());
  E


36	testytuna	50

237	BackMoon	50

238	stalk	50

239	Bits Please	50

240	WAGNAX	50

241	c00ldy	50

242	simple dimple	50

243	Hep	50

244	gigi	50

Theme designed by PRI4CE

				Powered by CTFd

<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta data-n-head="1" name="description" data-hid="description" content="TSG CTF is an on-line CTF organized by TSG, the official computer society of The University of Tokyo"><meta data-n-head="1" name="apple-mobile-web-app-title" content="TSG CTF 2024"><meta data-n-head="1" name="og:title" content="TSG CTF 2024"><meta data-n-head="1" name="og:site_name" content="TSG CTF 2024"><meta data-n-head="1" name="og


		send("200 OK", NULL, "");

	nFile.close();
}

// ------------------------
void ESPWebDAV::handleWriteError(String message, FatFile *wFile)	{
// ------------------------
	// close this file
	wFile->close();
	// delete the wrile being written
	sd.remove(uri.c_str());
	// send error
	send("500 Internal Server Error", "text/plain", message);
	DBG_PRINTLN(message);
}

// ------------------------
void ESPWebDAV::handleDirectoryCreate(ResourceType resource)	{
// ------------------------
	DBG_PRINTLN("Processing MKCOL");

	// does URI refer to anything
	if(resource != RESOURCE_NONE)
		return handleNotFound();

	// create directory
	if (!sd.mkdir(uri.c_str(), true)) {
		// send error
		send("500 Internal Server Error", "text/plain", "Unable to create directory");
		DBG_PRINTLN("Unable to create directory");
		return;
	}

	DBG_PRINT(uri);	DBG_PRINTLN(" directory created");
	sendHeader("Allow", "OPTIONS,MKCOL,LOCK,POST,PUT");
	send("201 Created", NULL, "");
}

// ------------------------
void ESPWebDAV::handleMove(ResourceType resource)	{
// ------------------------
	DBG_PRINTLN("Processing MOVE");

	// does URI refer to anything
	if(resource == RESOURCE_NONE)
		return handleNotFound();

	if(destinationHeader.length() == 0)
		return handleNotFound();

	String dest = urlDecode(urlToUri(destinationHeader));

	DBG_PRINT("Move destination: "); DBG_PRINTLN(dest);

	// move file or directory
	if ( !sd.rename(uri.c_str(), dest.c_str())	) {
		// send error
		send("500 Internal Server Error", "text/plain", "Unable to move");
		DBG_PRINTLN("Unable to move file/directory");
		return;
	}

	DBG_PRINTLN("Move successful");
	sendHeader("Allow", "OPTIONS,MKCOL,LOCK,POST,PUT");
	send("201 Created", NULL, "");
}

// ------------------------
void ESPWebDAV::handleDelete(ResourceType resource)	{
// ------------------------
	DBG_PRINTLN("Processing DELETE");

	// does URI refer to anything
	if(resource == RESOURCE_NONE)
		return handleNotFound();

	bool retVal;

	if(resource == RESOURCE_FILE)
		// delete a file
		retVal = sd.remove(uri.c_str());
	else
		// delete a directory
		retVal = sd.rmdir(uri.c_str());

	if(!retVal)	{
		// send error
		send("500 Internal Server Error", "text/plain", "Unable to delete");
		DBG_PRINTLN("Unable to delete file/directory");
		return;
	}

	DBG_PRINTLN("Delete successful");
	sendHeader("Allow", "OPTIONS,MKCOL,LOCK,POST,PUT");
	send("200 OK", NULL, "");
}

// Generated by gmmproc 2.45.3 -- DO NOT MODIFY!

#include <glibmm.h>

#include <ydkmm/pixbufformat.h>
#include <ydkmm/private/pixbufformat_p.h>

// -*- c++ -*-
/* $Id: pixbufformat.ccg,v 1.2 2003/11/22 18:58:20 murrayc Exp $ */

/* Copyright (C) 2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more


ത്തില് അല്ലാഹു അവരുടെ അടുക്കല് ചെല്ലുകയും അവരുടെ മനസ്സുകളില് ഭയം ഇടുകയും ചെയ്തു. അവര് സ്വന്തം കൈകള്‍കൊണ്ടും സത്യവിശ്വാസികളുടെ കൈകള്‍കൊണ്ടും അവരുടെ വീടുകള് നശിപ്പിച്ചിരുന്നു. ആകയാല് കണ്ണുകളുള്ളവരേ, നിങ്ങള് ഗുണപാഠം ഉള്‍കൊള്ളുക."
  },
  {
    "surah_number": 59,
    "verse_number": 3,
    "content":
        "അല്ലാഹു അവരുടെ മേല് നാടുവിട്ടുപോക്ക് വിധിച്ചിട്ടില്ലായിരുന്നുവെങ്കില് ഇഹലോകത്ത് വെച്ച് അവന് അവരെ ശിക്ഷിക്കുമായിരുന്നു.പരലോകത്ത് അവര്‍ക്കു നരകശിക്ഷയുമുണ്ട്."
  },
  {
    "surah_number": 59,
    "verse_number": 4,
    "content":
        "അത് അല്ലാഹുവോടും അവന്‍റെ റസൂലിനോടും അവര് മത്സരിച്ചു നിന്നതിന്‍റെ ഫലമത്രെ. വല്ലവനും അല്ലാഹുവുമായി മത്സരിക്കുന്ന പക്ഷം തീര്‍ച്ചയായും അല്ലാഹു കഠിനമായി ശിക്ഷിക്കുന്നവനാ�


  $v1, $v1, $a0 /* handwritten instruction */
/* 3FE80 8004F680 00088248 */  mtc2       $v0, C2_VZ0 /* handwritten instruction */
/* 3FE84 8004F684 00008348 */  mtc2       $v1, C2_VXY0 /* handwritten instruction */
/* 3FE88 8004F688 0000218E */  lw         $at, 0x0($s1)
/* 3FE8C 8004F68C 04003122 */  addi       $s1, $s1, 0x4 /* handwritten instruction */
.L8004F690:
/* 3FE90 8004F690 0100184A */  RTPS
/* 3FE94 8004F694 42150100 */  srl        $v0, $at, 21
/* 3FE98 8004F698 821A0100 */  srl        $v1, $at, 10
/* 3FE9C 8004F69C FF076330 */  andi       $v1, $v1, 0x7FF
/* 3FEA0 8004F6A0 FF032430 */  andi       $a0, $at, 0x3FF
/* 3FEA4 8004F6A4 20105400 */  add        $v0, $v0, $s4 /* handwritten instruction */
/* 3FEA8 8004F6A8 2218A302 */  sub        $v1, $s5, $v1 /* handwritten instruction */
/* 3FEAC 8004F6AC 2220C402 */  sub        $a0, $s6, $a0 /* handwritten instruction */
/* 3FEB0 8004F6B0 00240400 */  sll        $a0, $a0, 16
/* 3FEB4 8004F6B4 20186400 */  add        $v1, $v1, $a0 /* handwritten instruction */
/* 3FEB8 8004F6B8 0000218E */  lw         $at, 0x0($s1)
/* 3FEBC 8004F6BC 00088248 */  mtc2       $v0, C2_VZ0 /* handwritten instruction */
/* 3FEC0 8004F6C0 00700248 */  mfc2       $v0, C2_SXY2 /* handwritten instruction */
/* 3FEC4 8004F6C4 00008348 */  mtc2       $v1, C2_VXY0 /* handwritten instruction */
/* 3FEC8 8004F6C8 40210200 */  sll        $a0, $v0, 5
/* 3FECC 8004F6CC 22284700 */  sub        $a1, $v0, $a3 /* handwritten instruction */
/* 3FED0 8004F6D0 0200A01C */  bgtz       $a1, .L8004F6DC
/* 3FED4 8004F6D4 22284800 */   sub       $a1, $v0, $t0 /* handwritten instruction */
/* 3FED8 8004F6D8 01008420 */  addi       $a0, $a0, 0x1 /* handwritten instruction */
.L8004F6DC:
/* 3FEDC 8004F6DC 0200A004 */  bltz       $a1, .L8004F6E8
/* 3FEE0 8004F6E0 002C0200 */   sll       $a1, $v0, 16
/* 3FEE4 8004F6E4 02008420 */  addi       $a0, $a0, 0x2 /* handwritten instruction */
.L8004F6E8:
/* 3FEE8 8004F6E8 2218A600 */  sub        $v1, $a1, $a2 /* handwritten instruction */
/* 3FEEC 8004F6EC 0200601C */  bgtz       $v1, .L8004F6F8
/* 3FEF0 8004F6F0 2228A900 */   sub       $a1, $a1, $t1 /* handwritten instruction */
/* 3FEF4 8004F6F4 040084


c.Get("registry").(registry.Registry), c.Get("txStream").(am.RawMessageStream)), nil
	})
	container.AddScoped("inboxMiddleware", func(c di.Container) (any, error) {
		tx := c.Get("tx").(*sql.Tx)
		inboxStore := pg.NewInboxStore("depot.inbox", tx)
		return tm.NewInboxHandlerMiddleware(inboxStore), nil
	})
	container.AddScoped("shoppingLists", func(c di.Container) (any, error) {
		return postgres.NewShoppingListRepository(
			"depot.shopping_lists",
			c.Get("tx").(*sql.Tx),
		), nil
	})
	container.AddScoped("stores", func(c di.Container) (any, error) {
		return postgres.NewStoreCacheRepository(
			"depot.stores_cache",
			c.Get("tx").(*sql.Tx),
			grpc.NewStoreRepository(c.Get("conn").(*grpc.ClientConn)),
		), nil
	})
	container.AddScoped("products", func(c di.Container) (any, error) {
		return postgres.NewProductCacheRepository(
			"depot.products_cache",
			c.Get("tx").(*sql.Tx),
			grpc.NewProductRepository(c.Get("conn").(*grpc.ClientConn)),
		), nil
	})

	// setup application
	container.AddScoped("app", func(c di.Container) (any, error) {
		return logging.LogApplicationAccess(
			application.New(
				c.Get("shoppingLists").(domain.ShoppingListRepository),
				c.Get("stores").(domain.StoreCacheRepository),
				c.Get("products").(domain.ProductCacheRepository),
				c.Get("domainDispatcher").(*ddd.EventDispatcher[ddd.AggregateEvent]),
			),
			c.Get("logger").(zerolog.Logger),
		), nil
	})
	container.AddScoped("domainEventHandlers", func(c di.Container) (any, error) {
		return logging.LogEventHandlerAccess[ddd.AggregateEvent](
			handlers.NewDomainEventHandlers(c.Get("eventStream").(am.EventStream)),
			"DomainEvents", c.Get("logger").(zerolog.Logger),
		), nil
	})
	container.AddScoped("integrationEventHandlers", func(c di.Container) (any, error) {
		return logging.LogEventHandlerAccess[ddd.Event](
			handlers.NewIntegrationEventHandlers(
				c.Get("stores").(domain.StoreCacheRepository),
				c.Get("products").(domain.ProductCacheRepository),
			),
			"IntegrationEvents", c.Get("logger").(zerolog.Logger),
		), nil
	})
	container.AddScoped("commandHandlers", func(c di.Container) (any, error) {
		return logging.LogCommandHandlerAccess[ddd.Command](
			handlers.NewCommandHandlers(c.Get("app").(application.App)),
			"Commands", c.Get("logger").(zerolog.Logger),
		), nil
	})

	// setup Driver adapters
	if err := grpc.RegisterServerTx(container, mono.RPC()); err != nil {
		return err
	}
	if err := rest.RegisterGateway(ctx, mono.Mux(), mono.Config().Rpc.Address()); err != nil {
		return err
	}
	if err := rest.RegisterSwagger(mono.Mux()); err != nil {
		return err
	}
	handlers.RegisterDomainEventHandlersTx(container)
	if err = handlers.RegisterIntegrationEventHandlersTx(container); err != nil {
		return err
	}
	if err = handlers.RegisterCommandHandlersTx(container); err != nil {
		return err
	}
	startOutboxProcessor(ctx, container)

	retu


ename T, qualifier Q>
	GLM_FUNC_DECL bool isNormalized(vec<L, T, Q> const& v, T const& epsilon);

	//! Check whether a vector is null.
	/// @see gtx_vector_query extensions.
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL bool isNull(vec<L, T, Q> const& v, T const& epsilon);

	//! Check whether a each component of a vector is null.
	/// @see gtx_vector_query extensions.
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, bool, Q> isCompNull(vec<L, T, Q> const& v, T const& epsilon);

	//! Check whether two vectors are orthonormal.
	/// @see gtx_vector_query extensions.
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL bool areOrthonormal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);

	/// @}
}// namespace glm

#include "vector_query.inl"
/*
 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */

#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP

#include "gc_implementation/shared/mutableSpace.hpp"

//
// A PSMarkSweepDecorator is used to add "ParallelScavenge" style mark sweep operations
// to a MutableSpace.
//

class ObjectStartArray;

class PSMarkSweepDecorator: public CHeapObj<mtGC> {
 private:
  static PSMarkSweepDecorator* _destination_decorator;

 protected:
  MutableSpace* _space;
  ObjectStartArray* _start_array;
  HeapWord* _first_dead;
  HeapWord* _end_of_live;
  HeapWord* _compaction_top;
  size_t _allowed_dead_ratio;

  bool insert_deadspace(size_t& allowed_deadspace_words, HeapWord* q,
                        size_t word_len);

 public:
  PSMarkSweepDecorator(MutableSpace* space, ObjectStartArray* start_array,
                       size_t allowed_dead_ratio) :
    _space(space), _start_array(start_array),
    _allowed_dead_ratio(allowed_dead_ratio) { }

  // During a compacting collection, we need to collapse objects into
  // spaces in a given order. We want to fill space A, space B, and so
  // on. The code that controls that order is in the following methods.
  static void set_destination_decorator_tenured();
  static void set_


е поможет никому, кроме тех, кому Милостивый позволит и чьими речами Он будет доволен"
  },
  {
    "surah_number": 20,
    "verse_number": 110,
    "content":
        "Он знает их будущее и прошлое, но они не способны объять Его своим знанием"
  },
  {
    "surah_number": 20,
    "verse_number": 111,
    "content":
        "Лица смирятся перед Живым, Вседержителем, и разочарование постигнет тех, кто понесет бремя несправедливости"
  },
  {
    "surah_number": 20,
    "verse_number": 112,
    "content":
        "А тот, кто совершал праведные дела, будучи верующим, не будет бояться ни несправедливости, ни ущемления"
  },
  {
    "surah_number": 20,
    "verse_number": 113,
    "content":
        "Таким образом Мы ниспослали его в виде Корана на арабском языке и подробно разъяснили в нем Свои угрозы, чтобы они устрашились или чтобы это стало для них назиданием"
  },
  {
    "surah_number": 20,
    "verse_number": 114,
    "content":
        "Превыше всего Аллах, Истинный Царь! Не торопись читать Коран, пока ниспослание откровения тебе не будет завершено, и говори: «Господи! Приумножь мои знания»"
  },
  {
    "surah_number": 20,
    "verse_number": 115,
    "content":
        "Прежде Мы заключили завет с Адамом, но он забыл, и Мы не нашли у него твердой воли"
  },
  {
    "surah_number": 20,
    "verse_number": 116,
    "content":
        "Вот сказали Мы ангелам: «Падите ниц перед Адамом!». Они пали ниц, и только Иблис отказался"
  },
  {
    "surah_number": 20,
    "verse_number": 117,
    "content":
        "Мы сказали: «О Адам! Это - враг тебе и твоей жене. Пусть же он не выведет вас из Рая, а не то ты станешь несчастным"
  },
  {
    "surah_number": 20,
    "verse_number": 118,
    "content": "В нем ты не будешь голодным и нагим"
  },
  {
    "surah_number": 20,
    "verse_number": 119,
    "content": "В нем ты не будешь страдать от жажды и зноя»"
  },
  {
    "surah_number": 20,
    "verse_number": 120,
    "content":
        "Но дьявол стал нашептывать ему и сказал: «О Адам! Показать ли тебе дерево вечности и непреходящей власти?»"
  },
  {
    "surah_number": 20,
    "verse_number":


RELEASED);
        SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, (data[3] & 0x01) ? SDL_PRESSED : SDL_RELEASED);
    }

#define READ_STICK_AXIS(offset) \
    (data[offset] == 0x80 ? 0 : (Sint16)HIDAPI_RemapVal((float)((int)data[offset] - 0x80), 0x01 - 0x80, 0xff - 0x80, SDL_MIN_SINT16, SDL_MAX_SINT16))
    {
        axis = READ_STICK_AXIS(4);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
        axis = READ_STICK_AXIS(5);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis);
        axis = READ_STICK_AXIS(6);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis);
        axis = READ_STICK_AXIS(7);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
    }
#undef READ_STICK_AXIS

#define READ_TRIGGER_AXIS(offset) \
    (Sint16)(((int)data[offset] * 257) - 32768)
    {
        axis = READ_TRIGGER_AXIS(8);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis);
        axis = READ_TRIGGER_AXIS(9);
        SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis);
    }
#undef READ_TRIGGER_AXIS

    SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state)));
}

static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device)
{
    SDL_DriverStadia_Context *ctx = (SDL_DriverStadia_Context *)device->context;
    SDL_Joystick *joystick = NULL;
    Uint8 data[USB_PACKET_LENGTH];
    int size = 0;

    if (device->num_joysticks > 0) {
        joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
    } else {
        return SDL_FALSE;
    }

    while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
#ifdef DEBUG_STADIA_PROTOCOL
        HIDAPI_DumpPacket("Google Stadia packet: size = %d", data, size);
#endif
        if (joystick == NULL) {
            continue;
        }

        HIDAPI_DriverStadia_HandleStatePacket(joystick, ctx, data, size);
    }

    if (size < 0) {
        /* Read error, device is disconnected */
        HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
    }
    return size >= 0;
}

static void HIDAPI_DriverStadia_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
}

static void HIDAPI_DriverStadia_FreeDevice(SDL_HIDAPI_Device *device)
{
}

SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverStadia = {
    SDL_HINT_JOYSTICK_HIDAPI_STADIA,
    SDL_TRUE,
    HIDAPI_DriverStadia_RegisterHints,
    HIDAPI_DriverStadia_UnregisterHints,
    HIDAPI_DriverStadia_IsEnabled,
    HIDAPI_DriverStadia_IsSupportedDevice,
    HIDAPI_DriverStadia_InitDevice,
    HIDAPI_DriverStadia_GetDevicePlayerIndex,
    HIDAPI_DriverStadia_SetDevicePlayerIndex,
    HIDAPI_DriverStadia_UpdateDevice,
    HIDAPI_DriverStadia_OpenJoystick,
    HIDAPI_DriverStadia_RumbleJoystick,
    HIDAPI_DriverStadia_RumbleJoystickTriggers,
    HIDAPI_DriverStadia_GetJoystickCapabilities,
    HIDAPI_DriverStadia_SetJoystickLED,
    HIDAPI_DriverStadia_SendJoystickEffect,
    HIDAPI_DriverStadia_SetJoystickSensorsEnabled,
    HIDAPI_DriverStadia_CloseJoystick,
    HIDAPI_DriverStadia_FreeDevice,
};

#endif /* SDL_JOYSTICK_HIDAPI_STADIA */

#endif /* SDL_JOYSTICK_HIDAPI */

/* vi: set ts=4 sw=4 expandtab: */